aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2021-09-23 02:56:06 +0800
committerGao Xiang <hsiangkao@linux.alibaba.com>2021-09-24 09:07:47 +0800
commite9afc04087450a2711fcdbf49d5b2d076ec29e58 (patch)
tree45710fcac1a74a44e1010441c4623599c47bd6ac /include
parentaa6233fee463a924b4d720e3810c32867bade7d9 (diff)
downloaderofs-utils-e9afc04087450a2711fcdbf49d5b2d076ec29e58.tar.gz
erofs-utils: introduce copy_file_range
Add copy_file_range support. Emulate it instead if libc doesn't support it or has no emulation. Link: https://lore.kernel.org/r/20210922185607.49909-5-hsiangkao@linux.alibaba.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'include')
-rw-r--r--include/erofs/io.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/erofs/io.h b/include/erofs/io.h
index 0763baf..2597bf4 100644
--- a/include/erofs/io.h
+++ b/include/erofs/io.h
@@ -7,6 +7,7 @@
#ifndef __EROFS_IO_H
#define __EROFS_IO_H
+#define _GNU_SOURCE
#include <unistd.h>
#include "internal.h"
@@ -24,6 +25,10 @@ int dev_fsync(void);
int dev_resize(erofs_blk_t nblocks);
u64 dev_length(void);
+int erofs_copy_file_range(int fd_in, erofs_off_t *off_in,
+ int fd_out, erofs_off_t *off_out,
+ size_t length);
+
static inline int blk_write(const void *buf, erofs_blk_t blkaddr,
u32 nblocks)
{