aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-rename-copy_file_range-to-copy_file_chunk.patch
blob: 308fe0e292b78860c57ed3db227fa3371f826d00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From 647353f7c3fd29e1ffd468d7ff56d9643047ab35 Mon Sep 17 00:00:00 2001
From: Palmer Dabbelt <palmer@dabbelt.com>
Date: Fri, 29 Dec 2017 10:19:51 -0800
Subject: [PATCH] misc: 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.

Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

Upstream-Status: Backport

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
---
 misc/create_inode.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/misc/create_inode.c b/misc/create_inode.c
index 8ce3fafa..cd89146f 100644
--- a/misc/create_inode.c
+++ b/misc/create_inode.c
@@ -396,7 +396,7 @@ static ssize_t my_pread(int fd, void *buf, size_t count, off_t offset)
 }
 #endif /* !defined HAVE_PREAD64 && !defined HAVE_PREAD */
 
-static errcode_t copy_file_range(ext2_filsys fs, int fd, ext2_file_t e2_file,
+static errcode_t copy_file_chunk(ext2_filsys fs, int fd, ext2_file_t e2_file,
 				 off_t start, off_t end, char *buf,
 				 char *zerobuf)
 {
@@ -470,7 +470,7 @@ static errcode_t try_lseek_copy(ext2_filsys fs, int fd, struct stat *statbuf,
 
 		data_blk = data & ~(fs->blocksize - 1);
 		hole_blk = (hole + (fs->blocksize - 1)) & ~(fs->blocksize - 1);
-		err = copy_file_range(fs, fd, e2_file, data_blk, hole_blk, buf,
+		err = copy_file_chunk(fs, fd, e2_file, data_blk, hole_blk, buf,
 				      zerobuf);
 		if (err)
 			return err;
@@ -521,7 +521,7 @@ static errcode_t try_fiemap_copy(ext2_filsys fs, int fd, ext2_file_t e2_file,
 			goto out;
 		for (i = 0, ext = ext_buf; i < fiemap_buf->fm_mapped_extents;
 		     i++, ext++) {
-			err = copy_file_range(fs, fd, e2_file, ext->fe_logical,
+			err = copy_file_chunk(fs, fd, e2_file, ext->fe_logical,
 					      ext->fe_logical + ext->fe_length,
 					      buf, zerobuf);
 			if (err)
@@ -574,7 +574,7 @@ static errcode_t copy_file(ext2_filsys fs, int fd, struct stat *statbuf,
 		goto out;
 #endif
 
-	err = copy_file_range(fs, fd, e2_file, 0, statbuf->st_size, buf,
+	err = copy_file_chunk(fs, fd, e2_file, 0, statbuf->st_size, buf,
 			      zerobuf);
 out:
 	ext2fs_free_mem(&zerobuf);
-- 
2.16.2