005-misc-rename-copy_file_range-to-copy_file_chunk.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. As of 2.27, glibc will have a copy_file_range library call to wrap the
  6. new copy_file_range system call. This conflicts with the function in
  7. misc/create_inode.c, which this patch renames _copy_file_range.
  8. Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
  9. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  10. ---
  11. misc/create_inode.c | 8 ++++----
  12. 1 file changed, 4 insertions(+), 4 deletions(-)
  13. --- a/misc/create_inode.c
  14. +++ b/misc/create_inode.c
  15. @@ -392,7 +392,7 @@ static ssize_t my_pread(int fd, void *bu
  16. }
  17. #endif /* !defined HAVE_PREAD64 && !defined HAVE_PREAD */
  18. -static errcode_t copy_file_range(ext2_filsys fs, int fd, ext2_file_t e2_file,
  19. +static errcode_t copy_file_chunk(ext2_filsys fs, int fd, ext2_file_t e2_file,
  20. off_t start, off_t end, char *buf,
  21. char *zerobuf)
  22. {
  23. @@ -466,7 +466,7 @@ static errcode_t try_lseek_copy(ext2_fil
  24. data_blk = data & ~(fs->blocksize - 1);
  25. hole_blk = (hole + (fs->blocksize - 1)) & ~(fs->blocksize - 1);
  26. - err = copy_file_range(fs, fd, e2_file, data_blk, hole_blk, buf,
  27. + err = copy_file_chunk(fs, fd, e2_file, data_blk, hole_blk, buf,
  28. zerobuf);
  29. if (err)
  30. return err;
  31. @@ -516,7 +516,7 @@ static errcode_t try_fiemap_copy(ext2_fi
  32. }
  33. for (i = 0, ext = ext_buf; i < fiemap_buf->fm_mapped_extents;
  34. i++, ext++) {
  35. - err = copy_file_range(fs, fd, e2_file, ext->fe_logical,
  36. + err = copy_file_chunk(fs, fd, e2_file, ext->fe_logical,
  37. ext->fe_logical + ext->fe_length,
  38. buf, zerobuf);
  39. if (err)
  40. @@ -569,7 +569,7 @@ static errcode_t copy_file(ext2_filsys f
  41. goto out;
  42. #endif
  43. - err = copy_file_range(fs, fd, e2_file, 0, statbuf->st_size, buf,
  44. + err = copy_file_chunk(fs, fd, e2_file, 0, statbuf->st_size, buf,
  45. zerobuf);
  46. out:
  47. ext2fs_free_mem(&zerobuf);