diff options
author | Dave Chinner <dchinner@redhat.com> | 2015-04-16 22:03:27 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-04-16 22:03:27 +1000 |
commit | 0cefb29e6a63727bc7606c47fc538467594ef112 (patch) | |
tree | e2171e13faac717139a565a6e7268a15aabe4f58 /fs/open.c | |
parent | 40c63fbc55a968383b8bb5cacad81585e80cd323 (diff) |
xfs: using generic_file_direct_write() is unnecessary
generic_file_direct_write() does all sorts of things to make DIO
work "sorta ok" with mixed buffered IO workloads. We already do
most of this work in xfs_file_aio_dio_write() because of the locking
requirements, so there's only a couple of things it does for us.
The first thing is that it does a page cache invalidation after the
->direct_IO callout. This can easily be added to the XFS code.
The second thing it does is that if data was written, it updates the
iov_iter structure to reflect the data written, and then does EOF
size updates if necessary. For XFS, these EOF size updates are now
not necessary, as we do them safely and race-free in IO completion
context. That leaves just the iov_iter update, and that's also moved
to the XFS code.
Therefore we don't need to call generic_file_direct_write() and in
doing so remove redundant buffered writeback and page cache
invalidation calls from the DIO submission path. We also remove a
racy EOF size update, and make the DIO submission code in XFS much
easier to follow. Wins all round, really.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/open.c')
0 files changed, 0 insertions, 0 deletions