aboutsummaryrefslogtreecommitdiffstats
path: root/mm/fadvise.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/fadvise.c')
-rw-r--r--mm/fadvise.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/fadvise.c b/mm/fadvise.c
index fac23ecf8d72..4a3907cf79f8 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -28,6 +28,7 @@
28SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice) 28SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice)
29{ 29{
30 struct fd f = fdget(fd); 30 struct fd f = fdget(fd);
31 struct inode *inode;
31 struct address_space *mapping; 32 struct address_space *mapping;
32 struct backing_dev_info *bdi; 33 struct backing_dev_info *bdi;
33 loff_t endbyte; /* inclusive */ 34 loff_t endbyte; /* inclusive */
@@ -39,7 +40,8 @@ SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice)
39 if (!f.file) 40 if (!f.file)
40 return -EBADF; 41 return -EBADF;
41 42
42 if (S_ISFIFO(file_inode(f.file)->i_mode)) { 43 inode = file_inode(f.file);
44 if (S_ISFIFO(inode->i_mode)) {
43 ret = -ESPIPE; 45 ret = -ESPIPE;
44 goto out; 46 goto out;
45 } 47 }
@@ -50,7 +52,7 @@ SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice)
50 goto out; 52 goto out;
51 } 53 }
52 54
53 if (mapping->a_ops->get_xip_mem) { 55 if (IS_DAX(inode)) {
54 switch (advice) { 56 switch (advice) {
55 case POSIX_FADV_NORMAL: 57 case POSIX_FADV_NORMAL:
56 case POSIX_FADV_RANDOM: 58 case POSIX_FADV_RANDOM: