aboutsummaryrefslogtreecommitdiffstats
path: root/mm/fadvise.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/fadvise.c')
-rw-r--r--mm/fadvise.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/mm/fadvise.c b/mm/fadvise.c
index 0df4c899e979..3c0f1e99f5e4 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -49,9 +49,21 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
49 goto out; 49 goto out;
50 } 50 }
51 51
52 if (mapping->a_ops->get_xip_page) 52 if (mapping->a_ops->get_xip_page) {
53 /* no bad return value, but ignore advice */ 53 switch (advice) {
54 case POSIX_FADV_NORMAL:
55 case POSIX_FADV_RANDOM:
56 case POSIX_FADV_SEQUENTIAL:
57 case POSIX_FADV_WILLNEED:
58 case POSIX_FADV_NOREUSE:
59 case POSIX_FADV_DONTNEED:
60 /* no bad return value, but ignore advice */
61 break;
62 default:
63 ret = -EINVAL;
64 }
54 goto out; 65 goto out;
66 }
55 67
56 /* Careful about overflows. Len == 0 means "as much as possible" */ 68 /* Careful about overflows. Len == 0 means "as much as possible" */
57 endbyte = offset + len; 69 endbyte = offset + len;