10 #include <linux/kernel.h>
21 #include <asm/unistd.h>
29 struct fd f = fdget(
fd);
46 mapping = f.
file->f_mapping;
47 if (!mapping ||
len < 0) {
52 if (mapping->
a_ops->get_xip_mem) {
70 if (!len || endbyte < len)
80 spin_lock(&f.
file->f_lock);
82 spin_unlock(&f.
file->f_lock);
85 spin_lock(&f.
file->f_lock);
87 spin_unlock(&f.
file->f_lock);
91 spin_lock(&f.
file->f_lock);
93 spin_unlock(&f.
file->f_lock);
101 nrpages = end_index - start_index + 1;
123 if (end_index >= start_index)
134 #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
137 return SYSC_fadvise64_64((
int) fd, offset, len, (
int) advice);
142 #ifdef __ARCH_WANT_SYS_FADVISE64
148 #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
149 asmlinkage long SyS_fadvise64(
long fd, loff_t offset,
long len,
long advice)
151 return SYSC_fadvise64((
int) fd, offset, (
size_t)len, (
int)advice);