summaryrefslogtreecommitdiff
path: root/fs/sync.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-18 00:12:34 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-18 00:12:34 (GMT)
commit038911597e17017cee55fe93d521164a27056866 (patch)
tree8f279a91de8237ce370a14d745940cccfd78ea07 /fs/sync.c
parent66dc830d14a222c9214a8557e9feb1e4a67a3857 (diff)
parenta26f49926da938f47561f386be56a83dd37a496d (diff)
downloadlinux-038911597e17017cee55fe93d521164a27056866.tar.xz
Merge branch 'lazytime' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull lazytime mount option support from Al Viro: "Lazytime stuff from tytso" * 'lazytime' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: ext4: add optimization for the lazytime mount option vfs: add find_inode_nowait() function vfs: add support for a lazytime mount option
Diffstat (limited to 'fs/sync.c')
-rw-r--r--fs/sync.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/sync.c b/fs/sync.c
index 01d9f18..fbc98ee 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -177,8 +177,16 @@ SYSCALL_DEFINE1(syncfs, int, fd)
*/
int vfs_fsync_range(struct file *file, loff_t start, loff_t end, int datasync)
{
+ struct inode *inode = file->f_mapping->host;
+
if (!file->f_op->fsync)
return -EINVAL;
+ if (!datasync && (inode->i_state & I_DIRTY_TIME)) {
+ spin_lock(&inode->i_lock);
+ inode->i_state &= ~I_DIRTY_TIME;
+ spin_unlock(&inode->i_lock);
+ mark_inode_dirty_sync(inode);
+ }
return file->f_op->fsync(file, start, end, datasync);
}
EXPORT_SYMBOL(vfs_fsync_range);