diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2014-01-14 08:46:51 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2014-01-14 14:20:49 -0500 |
commit | 086352f1aa8d717eaf565074d6634c7bdd26aca0 (patch) | |
tree | d708e25a18042650b975700c10f92029a58fd0a9 | |
parent | 39849d6946a84861a517c09ca0b691ce6d98c7a6 (diff) |
GFS2: No need to invalidate pages for a dio read
We recently fixed the writeback of pages prior to performing
direct i/o, however the initial fix was perhaps a bit heavy
handed. There is no need to invalidate pages if the direct i/o
is only a read, since they will be identical to what has been
flushed to disk anyway.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r-- | fs/gfs2/aops.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index cf858dad75d9..49436fa7cd4f 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c | |||
@@ -1032,8 +1032,9 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb, | |||
1032 | unmap_shared_mapping_range(ip->i_inode.i_mapping, offset, len); | 1032 | unmap_shared_mapping_range(ip->i_inode.i_mapping, offset, len); |
1033 | rv = filemap_write_and_wait_range(mapping, lstart, end); | 1033 | rv = filemap_write_and_wait_range(mapping, lstart, end); |
1034 | if (rv) | 1034 | if (rv) |
1035 | return rv; | 1035 | goto out; |
1036 | truncate_inode_pages_range(mapping, lstart, end); | 1036 | if (rw == WRITE) |
1037 | truncate_inode_pages_range(mapping, lstart, end); | ||
1037 | } | 1038 | } |
1038 | 1039 | ||
1039 | rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, | 1040 | rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, |