diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-08 01:22:00 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:14 -0400 |
commit | c475879556a8602bbe2faa9a06f6e5fcc8c05bb2 (patch) | |
tree | 9d7e4882a08171d1ff1b84e3f02d3e604756815b /fs/affs/file.c | |
parent | 4427f0c36e22e2cd6696b2fe7643e9756a14b3d3 (diff) |
sanitize ->fsync() for affs
unfortunately, for affs (especially for affs directories) we have
no real way to keep track of metadata ownership. So we have to
do more or less what file_fsync() does, but we do *not* need to
call write_super() there.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/affs/file.c')
-rw-r--r-- | fs/affs/file.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/affs/file.c b/fs/affs/file.c index 9246cb4aa018..184e55c1c9ba 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c | |||
@@ -34,7 +34,7 @@ const struct file_operations affs_file_operations = { | |||
34 | .mmap = generic_file_mmap, | 34 | .mmap = generic_file_mmap, |
35 | .open = affs_file_open, | 35 | .open = affs_file_open, |
36 | .release = affs_file_release, | 36 | .release = affs_file_release, |
37 | .fsync = file_fsync, | 37 | .fsync = affs_file_fsync, |
38 | .splice_read = generic_file_splice_read, | 38 | .splice_read = generic_file_splice_read, |
39 | }; | 39 | }; |
40 | 40 | ||
@@ -915,3 +915,15 @@ affs_truncate(struct inode *inode) | |||
915 | } | 915 | } |
916 | affs_free_prealloc(inode); | 916 | affs_free_prealloc(inode); |
917 | } | 917 | } |
918 | |||
919 | int affs_file_fsync(struct file *filp, struct dentry *dentry, int datasync) | ||
920 | { | ||
921 | struct inode * inode = dentry->d_inode; | ||
922 | int ret, err; | ||
923 | |||
924 | ret = write_inode_now(inode, 0); | ||
925 | err = sync_blockdev(inode->i_sb->s_bdev); | ||
926 | if (!ret) | ||
927 | ret = err; | ||
928 | return ret; | ||
929 | } | ||