Commit 94e77119 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sys_fadvise64_64

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.
parent 7161ee20
...@@ -878,5 +878,6 @@ ENTRY(sys_call_table) ...@@ -878,5 +878,6 @@ ENTRY(sys_call_table)
.long sys_fstatfs64 .long sys_fstatfs64
.long sys_tgkill /* 270 */ .long sys_tgkill /* 270 */
.long sys_utimes .long sys_utimes
.long sys_fadvise64_64
nr_syscalls=(.-sys_call_table)/4 nr_syscalls=(.-sys_call_table)/4
...@@ -277,8 +277,9 @@ ...@@ -277,8 +277,9 @@
#define __NR_fstatfs64 269 #define __NR_fstatfs64 269
#define __NR_tgkill 270 #define __NR_tgkill 270
#define __NR_utimes 271 #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> */ /* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could
* deactivate the pages and clear PG_Referenced. * 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 file *file = fget(fd);
struct inode *inode; struct inode *inode;
...@@ -79,3 +79,9 @@ long sys_fadvise64(int fd, loff_t offset, size_t len, int advice) ...@@ -79,3 +79,9 @@ long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
fput(file); fput(file);
return ret; return ret;
} }
long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
{
return sys_fadvise64_64(fd, offset, len, advice);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment