Skip to content

Commit 49d1c99

Browse files
committed
[E2FSPROGS] rename copy_file_range to copy_file_chunk
As of 2.27, glibc will have a copy_file_range library call to wrap the new copy_file_range system call. This conflicts with the function in misc/create_inode.c, which this patch renames _copy_file_range.
1 parent 6d50368 commit 49d1c99

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
From 01551bdba16ab16512a01affe02ade32c41ede8a Mon Sep 17 00:00:00 2001
2+
From: Palmer Dabbelt <palmer@dabbelt.com>
3+
Date: Fri, 29 Dec 2017 10:19:51 -0800
4+
Subject: [PATCH] misc: rename copy_file_range to copy_file_chunk
5+
6+
As of 2.27, glibc will have a copy_file_range library call to wrap the
7+
new copy_file_range system call. This conflicts with the function in
8+
misc/create_inode.c, which this patch renames _copy_file_range.
9+
10+
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
11+
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12+
---
13+
misc/create_inode.c | 8 ++++----
14+
1 file changed, 4 insertions(+), 4 deletions(-)
15+
16+
diff --git a/misc/create_inode.c b/misc/create_inode.c
17+
index 08b4ec28d..deae05e69 100644
18+
--- a/misc/create_inode.c
19+
+++ b/misc/create_inode.c
20+
@@ -398,7 +398,7 @@ static ssize_t my_pread(int fd, void *buf, size_t count, off_t offset)
21+
}
22+
#endif /* !defined HAVE_PREAD64 && !defined HAVE_PREAD */
23+
24+
-static errcode_t copy_file_range(ext2_filsys fs, int fd, ext2_file_t e2_file,
25+
+static errcode_t copy_file_chunk(ext2_filsys fs, int fd, ext2_file_t e2_file,
26+
off_t start, off_t end, char *buf,
27+
char *zerobuf)
28+
{
29+
@@ -472,7 +472,7 @@ static errcode_t try_lseek_copy(ext2_filsys fs, int fd, struct stat *statbuf,
30+
31+
data_blk = data & ~(fs->blocksize - 1);
32+
hole_blk = (hole + (fs->blocksize - 1)) & ~(fs->blocksize - 1);
33+
- err = copy_file_range(fs, fd, e2_file, data_blk, hole_blk, buf,
34+
+ err = copy_file_chunk(fs, fd, e2_file, data_blk, hole_blk, buf,
35+
zerobuf);
36+
if (err)
37+
return err;
38+
@@ -523,7 +523,7 @@ static errcode_t try_fiemap_copy(ext2_filsys fs, int fd, ext2_file_t e2_file,
39+
goto out;
40+
for (i = 0, ext = ext_buf; i < fiemap_buf->fm_mapped_extents;
41+
i++, ext++) {
42+
- err = copy_file_range(fs, fd, e2_file, ext->fe_logical,
43+
+ err = copy_file_chunk(fs, fd, e2_file, ext->fe_logical,
44+
ext->fe_logical + ext->fe_length,
45+
buf, zerobuf);
46+
if (err)
47+
@@ -576,7 +576,7 @@ static errcode_t copy_file(ext2_filsys fs, int fd, struct stat *statbuf,
48+
goto out;
49+
#endif
50+
51+
- err = copy_file_range(fs, fd, e2_file, 0, statbuf->st_size, buf,
52+
+ err = copy_file_chunk(fs, fd, e2_file, 0, statbuf->st_size, buf,
53+
zerobuf);
54+
out:
55+
ext2fs_free_mem(&zerobuf);
56+

0 commit comments

Comments
 (0)