]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xfs: optimize fsync on directories
authorChristoph Hellwig <hch@infradead.org>
Sun, 2 Oct 2011 14:25:16 +0000 (14:25 +0000)
committerAlex Elder <aelder@sgi.com>
Wed, 5 Oct 2011 04:12:33 +0000 (23:12 -0500)
commit6f76e76852b85216d518d6163ff1e84bd73a624d
tree0f716cad55c740f2bda3538e701542a19e553fde
parentedc3615f7fd97dc78ea2cd872f55c4b382c46bb5
xfs: optimize fsync on directories

Directories are only updated transactionally, which means fsync only
needs to flush the log the inode is currently dirty, but not bother
with checking for dirty data, non-transactional updates, and most
importanly doesn't have to flush disk caches except as part of a
transaction commit.

While the first two optimizations can't easily be measured, the
latter actually makes a difference when doing lots of fsync that do
not actually have to commit the inode, e.g. because an earlier fsync
already pushed the log far enough.

The new xfs_dir_fsync is identical to xfs_nfs_commit_metadata except
for the prototype, but I'm not sure creating a common helper for the
two is worth it given how simple the functions are.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
fs/xfs/xfs_file.c
fs/xfs/xfs_trace.h