aboutsummaryrefslogtreecommitdiffstats
path: root/mm/fadvise.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 11:38:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 11:38:30 -0500
commitc397f8fa4379040bada53256c848e62c8b060392 (patch)
tree8101efb5c0c3b0a73e5e65f3474843c0914cc4d0 /mm/fadvise.c
parent796e1c55717e9a6ff5c81b12289ffa1ffd919b6f (diff)
parentaaaf5fbf56f16c81a653713cc333b18ad6e25ea9 (diff)
Merge branch 'akpm' (patches from Andrew)
Merge fifth set of updates from Andrew Morton: - A few things which were awaiting merges from linux-next: - rtc - ocfs2 - misc others - Willy's "dax" feature: direct fs access to memory (mainly NV-DIMMs) which isn't backed by pageframes. * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (37 commits) rtc: add driver for DS1685 family of real time clocks MAINTAINERS: add entry for Maxim PMICs on Samsung boards lib/Kconfig: use bool instead of boolean powerpc: drop _PAGE_FILE and pte_file()-related helpers ocfs2: set append dio as a ro compat feature ocfs2: wait for orphan recovery first once append O_DIRECT write crash ocfs2: complete the rest request through buffer io ocfs2: do not fallback to buffer I/O write if appending ocfs2: allocate blocks in ocfs2_direct_IO_get_blocks ocfs2: implement ocfs2_direct_IO_write ocfs2: add orphan recovery types in ocfs2_recover_orphans ocfs2: add functions to add and remove inode in orphan dir ocfs2: prepare some interfaces used in append direct io MAINTAINERS: fix spelling mistake & remove trailing WS dax: does not work correctly with virtual aliasing caches brd: rename XIP to DAX ext4: add DAX functionality dax: add dax_zero_page_range ext2: get rid of most mentions of XIP in ext2 ext2: remove ext2_aops_xip ...
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: