Commit c4c95471 authored by Andrew Morton's avatar Andrew Morton Committed by Jens Axboe

[PATCH] don't invalidate pagecache after direct-IO reads

There's no need to take down pagecache after performing direct-IO reads
from a file or a blockdevice.

And when using direct access to a blockdev which has a filesystem
mounted it creates unnecessary disturbance of filesystem activity.
parent f7844601
...@@ -900,7 +900,7 @@ generic_file_direct_IO(int rw, struct file *file, const struct iovec *iov, ...@@ -900,7 +900,7 @@ generic_file_direct_IO(int rw, struct file *file, const struct iovec *iov,
} }
retval = mapping->a_ops->direct_IO(rw, file, iov, offset, nr_segs); retval = mapping->a_ops->direct_IO(rw, file, iov, offset, nr_segs);
if (mapping->nrpages) if (rw == WRITE && mapping->nrpages)
invalidate_inode_pages2(mapping); invalidate_inode_pages2(mapping);
out: out:
return retval; return retval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment