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/inode.c | |
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/inode.c')
-rw-r--r-- | fs/hfsplus/inode.c | 27 |
1 files changed, 26 insertions, 1 deletions
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, |