diff mbox

Cleanup sync_file_range implementation

Message ID 1445451155-23390-1-git-send-email-adhemerval.zanella@linaro.com
State New
Headers show

Commit Message

Adhemerval Zanella Netto Oct. 21, 2015, 6:12 p.m. UTC
Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups
the mips code to assume __NR_sync_file_range and the powerpc one
to either assume __NR_sync_file_range2 or __NR_sync_file_range.

Checked on powerpc64le and build for mips (ABIO32, ABIN32, and ABI64).

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
	(__NR_sync_file_range2): Assume it is always defined.
	* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
	(__NR_sync_file_range): Assume it is always defined.
---
 ChangeLog                                                   |  5 +++++
 sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c       | 11 -----------
 sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c | 11 -----------
 3 files changed, 5 insertions(+), 22 deletions(-)

Comments

Joseph Myers Oct. 21, 2015, 8:29 p.m. UTC | #1
The MIPS change is OK.
Florian Weimer Oct. 22, 2015, 9:09 a.m. UTC | #2
On 10/21/2015 08:12 PM, Adhemerval Zanella wrote:
> Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups
> the mips code to assume __NR_sync_file_range and the powerpc one
> to either assume __NR_sync_file_range2 or __NR_sync_file_range.

Looks good to me.

Florian
Paul E. Murphy Oct. 22, 2015, 1:40 p.m. UTC | #3
LGTM.

On 10/21/2015 01:12 PM, Adhemerval Zanella wrote:
> Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups
> the mips code to assume __NR_sync_file_range and the powerpc one
> to either assume __NR_sync_file_range2 or __NR_sync_file_range.
> 
> Checked on powerpc64le and build for mips (ABIO32, ABIN32, and ABI64).
> 
> 	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
> 	(__NR_sync_file_range2): Assume it is always defined.
> 	* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
> 	(__NR_sync_file_range): Assume it is always defined.
diff mbox

Patch

diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c b/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
index b79e44d..0d85168 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
@@ -23,8 +23,6 @@ 
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-
-#ifdef __NR_sync_file_range
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 {
@@ -33,12 +31,3 @@  sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 			 __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
 			 flags);
 }
-#else
-int
-sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-stub_warning (sync_file_range)
-#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
index 9f46458..92245f9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
@@ -23,19 +23,8 @@ 
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-
-#if defined __NR_sync_file_range2
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 {
   return SYSCALL_CANCEL (sync_file_range2, fd, flags, from, to);
 }
-#else
-int
-sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-stub_warning (sync_file_range)
-#endif