summaryrefslogtreecommitdiff
path: root/fs/eventpoll.c
diff options
context:
space:
mode:
authorAndreas Rohner <andreas.rohner@gmx.net>2014-10-14 02:53:22 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-14 04:18:20 +0400
commitb9f6614072687f1ea9bf09a99789c976cbe89714 (patch)
tree938284793390ed8d05ad3be57c721e9d4e53faf7 /fs/eventpoll.c
parente2c7617ae36b27f97643bfa08aabe27e630c1a76 (diff)
downloadlinux-b9f6614072687f1ea9bf09a99789c976cbe89714.tar.xz
nilfs2: improve the performance of fdatasync()
Support for fdatasync() has been implemented in NILFS2 for a long time, but whenever the corresponding inode is dirty the implementation falls back to a full-flegded sync(). Since every write operation has to update the modification time of the file, the inode will almost always be dirty and fdatasync() will fall back to sync() most of the time. But this fallback is only necessary for a change of the file size and not for a change of the various timestamps. This patch adds a new flag NILFS_I_INODE_SYNC to differentiate between those two situations. * If it is set the file size was changed and a full sync is necessary. * If it is not set then only the timestamps were updated and fdatasync() can go ahead. There is already a similar flag I_DIRTY_DATASYNC on the VFS layer with the exact same semantics. Unfortunately it cannot be used directly, because NILFS2 doesn't implement write_inode() and doesn't clear the VFS flags when inodes are written out. So the VFS writeback thread can clear I_DIRTY_DATASYNC at any time without notifying NILFS2. So I_DIRTY_DATASYNC has to be mapped onto NILFS_I_INODE_SYNC in nilfs_update_inode(). Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/eventpoll.c')
0 files changed, 0 insertions, 0 deletions