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>
This commit is contained in:
Steven Whitehouse 2014-01-14 13:46:51 +00:00
Родитель 39849d6946
Коммит 086352f1aa
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -1032,8 +1032,9 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
unmap_shared_mapping_range(ip->i_inode.i_mapping, offset, len); unmap_shared_mapping_range(ip->i_inode.i_mapping, offset, len);
rv = filemap_write_and_wait_range(mapping, lstart, end); rv = filemap_write_and_wait_range(mapping, lstart, end);
if (rv) if (rv)
return rv; goto out;
truncate_inode_pages_range(mapping, lstart, end); if (rw == WRITE)
truncate_inode_pages_range(mapping, lstart, end);
} }
rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,