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/hfs | |
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/hfs')
-rw-r--r-- | fs/hfs/inode.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 87de671baa83..93ceec8fbb8f 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -625,6 +625,30 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr) | |||
625 | return 0; | 625 | return 0; |
626 | } | 626 | } |
627 | 627 | ||
628 | static int hfs_file_fsync(struct file *filp, int datasync) | ||
629 | { | ||
630 | struct inode *inode = filp->f_mapping->host; | ||
631 | struct super_block * sb; | ||
632 | int ret, err; | ||
633 | |||
634 | /* sync the inode to buffers */ | ||
635 | ret = write_inode_now(inode, 0); | ||
636 | |||
637 | /* sync the superblock to buffers */ | ||
638 | sb = inode->i_sb; | ||
639 | if (sb->s_dirt) { | ||
640 | lock_super(sb); | ||
641 | sb->s_dirt = 0; | ||
642 | if (!(sb->s_flags & MS_RDONLY)) | ||
643 | hfs_mdb_commit(sb); | ||
644 | unlock_super(sb); | ||
645 | } | ||
646 | /* .. finally sync the buffers to disk */ | ||
647 | err = sync_blockdev(sb->s_bdev); | ||
648 | if (!ret) | ||
649 | ret = err; | ||
650 | return ret; | ||
651 | } | ||
628 | 652 | ||
629 | static const struct file_operations hfs_file_operations = { | 653 | static const struct file_operations hfs_file_operations = { |
630 | .llseek = generic_file_llseek, | 654 | .llseek = generic_file_llseek, |
@@ -634,7 +658,7 @@ static const struct file_operations hfs_file_operations = { | |||
634 | .aio_write = generic_file_aio_write, | 658 | .aio_write = generic_file_aio_write, |
635 | .mmap = generic_file_mmap, | 659 | .mmap = generic_file_mmap, |
636 | .splice_read = generic_file_splice_read, | 660 | .splice_read = generic_file_splice_read, |
637 | .fsync = file_fsync, | 661 | .fsync = hfs_file_fsync, |
638 | .open = hfs_file_open, | 662 | .open = hfs_file_open, |
639 | .release = hfs_file_release, | 663 | .release = hfs_file_release, |
640 | }; | 664 | }; |