This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] sync ARM and MIPS bits/fcntl.h with trunk.
- From: "Lior Balkohen" <balkohen at gmail dot com>
- To: libc-ports at sources dot redhat dot com
- Date: Sun, 2 Apr 2006 18:15:16 +0200
- Subject: Re: [PATCH] sync ARM and MIPS bits/fcntl.h with trunk.
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=GydesUbRS1TBGNfRTkm7m3bOUfL2ClEupn93W58igWZjQ1PB67+ewnBj0aYKJgioSxl2wlzso2e1LBNMqs8MsY3d3j78SpulQTT5+LrOn6uAi8Xc4hAQp9nMiiKIALy6tUqxJpL6F4NEYP/KR/zs9kCMGelTkyFlOxES4h1tuBE=
Hi!
Kernel people were not happy with the recently-added
LINUX_FADV_ASYNC_WRITE and LINUX_FADV_WRITE_WAIT fadvise(), so they
decided to do it in a new sys_sync_file_range() syscall instead. Look
here: http://lkml.org/lkml/2006/3/30/57
Consequently Ulrich removed LINUX_FADV_ASYNC_WRITE and
LINUX_FADV_WRITE_WAIT from arch/bits/fcntl.h in HEAD.
At the time (i.e. 2.6.16-git20), only i386 has sys_sync_file_range
syscall and ia64, powerpc and x86_64 have splice syscall. But since
Ulrich made changes also in sparc, sh, s390 and alpha, I assume that
these architectures soon will have them, too.
Please review.
2006-04-02 Lior Balkohen <balkohen@gmail.com>
* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Remove
LINUX_FADV_ASYNC_WRITE and LINUX_FADV_WRITE_WAIT.
Define SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WRITE
and SYNC_FILE_RANGE_WAIT_AFTER.
Add sync_file_range and splice prototypes.
* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Likewise.
diff -Naur ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
ports~/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
--- ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h 2006-03-28
06:32:41.000000000 +0200
+++ ports~/sysdeps/unix/sysv/linux/arm/bits/fcntl.h 2006-04-02
17:27:00.000000000 +0200
@@ -180,16 +180,37 @@
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
-/* Linux-specific operations for posix_fadvise. */
+
#ifdef __USE_GNU
-# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */
-# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */
+# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
+ in the range before performing the
+ write. */
+# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
+ dirty pages in the range which are
+ not presently under writeback. */
+# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
+ the range after performing the
+ write. */
#endif
__BEGIN_DECLS
+#ifdef __USE_GNU
+
/* Provide kernel hint to read ahead. */
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
+
+/* Selective file content synch'ing. */
+extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+ unsigned int __flags);
+
+
+/* Splice two files together. */
+extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
+ __THROW;
+
+#endif
+
__END_DECLS
diff -Naur ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
ports~/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
--- ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h 2006-03-28
06:32:14.000000000 +0200
+++ ports~/sysdeps/unix/sysv/linux/mips/bits/fcntl.h 2006-04-02
17:26:10.000000000 +0200
@@ -193,16 +193,37 @@
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
-/* Linux-specific operations for posix_fadvise. */
+
#ifdef __USE_GNU
-# define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range. */
-# define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range. */
+# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
+ in the range before performing the
+ write. */
+# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
+ dirty pages in the range which are
+ not presently under writeback. */
+# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
+ the range after performing the
+ write. */
#endif
__BEGIN_DECLS
+#ifdef __USE_GNU
+
/* Provide kernel hint to read ahead. */
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
+
+/* Selective file content synch'ing. */
+extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
+ unsigned int __flags);
+
+
+/* Splice two files together. */
+extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
+ __THROW;
+
+#endif
+
__END_DECLS