]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sys_fadvise64_64
authorAndrew Morton <akpm@osdl.org>
Thu, 14 Aug 2003 17:06:03 +0000 (10:06 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 14 Aug 2003 17:06:03 +0000 (10:06 -0700)
Alas, both POSIX and I got the fadvise() interface wrong.  It needs to take a
64-bit length, not a 32-bit one.  Because fadvise(POSIX_FADV_DONTNEED) on a
4TB file will require 1000 syscalls.  Silly.

There are glibc's in the wild which use the existing syscall, so we must
make a new one.

arch/i386/kernel/entry.S
include/asm-i386/unistd.h
mm/fadvise.c

index 11fd358d27583bfede77e0dffe95754aac00ad51..b832e3ed10d7582c76ff9db66a113ea6f06465be 100644 (file)
@@ -878,5 +878,6 @@ ENTRY(sys_call_table)
        .long sys_fstatfs64     
        .long sys_tgkill        /* 270 */
        .long sys_utimes
- 
+       .long sys_fadvise64_64
+
 nr_syscalls=(.-sys_call_table)/4
index 5d123438d526587d1600de0dc6124f1bd831f166..f54d2da2e79d133afd6c582aa8adf190f1968c52 100644 (file)
 #define __NR_fstatfs64         269
 #define __NR_tgkill            270
 #define __NR_utimes            271
+#define __NR_fadvise64_64      272
 
-#define NR_syscalls 272
+#define NR_syscalls 273
 
 /* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */
 
index 8f1899604ac467494488ca5eb89b5f70801c5f2f..da7a5f31b941b7cc92d61000aaa0115d77fdbcc9 100644 (file)
@@ -20,7 +20,7 @@
  * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could
  * deactivate the pages and clear PG_Referenced.
  */
-long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
+long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
 {
        struct file *file = fget(fd);
        struct inode *inode;
@@ -79,3 +79,9 @@ out:
        fput(file);
        return ret;
 }
+
+long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
+{
+       return sys_fadvise64_64(fd, offset, len, advice);
+}
+