misc: rename copy_file_range to copy_file_chunk 30/220030/2 accepted/tizen_6.0_base_tool_hotfix tizen_6.0_base_hotfix accepted/tizen/6.0/base/20201029.110439 accepted/tizen/6.0/base/tool/20201029.111935 accepted/tizen/6.0/base/tool/hotfix/20201030.124750 accepted/tizen/6.0/base/tool/hotfix/20201102.085930 accepted/tizen/base/20200113.064839 submit/tizen_6.0_base/20201029.184801 submit/tizen_6.0_base_hotfix/20201030.192501 submit/tizen_6.0_base_hotfix/20201102.162701 submit/tizen_base/20200108.045102 tizen_6.0.m2_release
authorPalmer Dabbelt <palmer@dabbelt.com>
Fri, 29 Dec 2017 18:19:51 +0000 (10:19 -0800)
committerDongkyun Son <dongkyun.s@samsung.com>
Thu, 2 Jan 2020 02:32:13 +0000 (11:32 +0900)
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>
(cherry picked from commit 01551bdba16ab16512a01affe02ade32c41ede8a)

Change-Id: I7cea55432515e292356374e1fdc7a369ea7f6fb7

misc/create_inode.c

index 8ce3faf..cd89146 100644 (file)
@@ -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);