diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-07-04 04:24:09 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:47:43 -0400 |
commit | b5fc510c48f631882ccec3c0f02a25d5b67de09f (patch) | |
tree | 1749954353b972502f05cdfae75b9d5e77cc1f5a /fs/hfsplus | |
parent | fa9b227e9019ebaeeb06224ba531a490f91144b3 (diff) |
get rid of file_fsync()
Copy and simplify in the only two users remaining.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hfsplus')
-rw-r--r-- | fs/hfsplus/hfsplus_fs.h | 1 | ||||
-rw-r--r-- | fs/hfsplus/inode.c | 27 | ||||
-rw-r--r-- | fs/hfsplus/super.c | 2 |
3 files changed, 28 insertions, 2 deletions
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index 6505c30ad965..dc856be3c2b0 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h | |||
@@ -351,6 +351,7 @@ int hfsplus_show_options(struct seq_file *, struct vfsmount *); | |||
351 | 351 | ||
352 | /* super.c */ | 352 | /* super.c */ |
353 | struct inode *hfsplus_iget(struct super_block *, unsigned long); | 353 | struct inode *hfsplus_iget(struct super_block *, unsigned long); |
354 | int hfsplus_sync_fs(struct super_block *sb, int wait); | ||
354 | 355 | ||
355 | /* tables.c */ | 356 | /* tables.c */ |
356 | extern u16 hfsplus_case_fold_table[]; | 357 | extern u16 hfsplus_case_fold_table[]; |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 654c5a8ddf1c..c5a979d62c65 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -311,6 +311,31 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr) | |||
311 | return 0; | 311 | return 0; |
312 | } | 312 | } |
313 | 313 | ||
314 | static int hfsplus_file_fsync(struct file *filp, int datasync) | ||
315 | { | ||
316 | struct inode *inode = filp->f_mapping->host; | ||
317 | struct super_block * sb; | ||
318 | int ret, err; | ||
319 | |||
320 | /* sync the inode to buffers */ | ||
321 | ret = write_inode_now(inode, 0); | ||
322 | |||
323 | /* sync the superblock to buffers */ | ||
324 | sb = inode->i_sb; | ||
325 | if (sb->s_dirt) { | ||
326 | if (!(sb->s_flags & MS_RDONLY)) | ||
327 | hfsplus_sync_fs(sb, 1); | ||
328 | else | ||
329 | sb->s_dirt = 0; | ||
330 | } | ||
331 | |||
332 | /* .. finally sync the buffers to disk */ | ||
333 | err = sync_blockdev(sb->s_bdev); | ||
334 | if (!ret) | ||
335 | ret = err; | ||
336 | return ret; | ||
337 | } | ||
338 | |||
314 | static const struct inode_operations hfsplus_file_inode_operations = { | 339 | static const struct inode_operations hfsplus_file_inode_operations = { |
315 | .lookup = hfsplus_file_lookup, | 340 | .lookup = hfsplus_file_lookup, |
316 | .truncate = hfsplus_file_truncate, | 341 | .truncate = hfsplus_file_truncate, |
@@ -328,7 +353,7 @@ static const struct file_operations hfsplus_file_operations = { | |||
328 | .aio_write = generic_file_aio_write, | 353 | .aio_write = generic_file_aio_write, |
329 | .mmap = generic_file_mmap, | 354 | .mmap = generic_file_mmap, |
330 | .splice_read = generic_file_splice_read, | 355 | .splice_read = generic_file_splice_read, |
331 | .fsync = file_fsync, | 356 | .fsync = hfsplus_file_fsync, |
332 | .open = hfsplus_file_open, | 357 | .open = hfsplus_file_open, |
333 | .release = hfsplus_file_release, | 358 | .release = hfsplus_file_release, |
334 | .unlocked_ioctl = hfsplus_ioctl, | 359 | .unlocked_ioctl = hfsplus_ioctl, |
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 74b473a8ef92..a32c241e4e45 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c | |||
@@ -154,7 +154,7 @@ static void hfsplus_clear_inode(struct inode *inode) | |||
154 | } | 154 | } |
155 | } | 155 | } |
156 | 156 | ||
157 | static int hfsplus_sync_fs(struct super_block *sb, int wait) | 157 | int hfsplus_sync_fs(struct super_block *sb, int wait) |
158 | { | 158 | { |
159 | struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; | 159 | struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; |
160 | 160 | ||