summaryrefslogtreecommitdiffstats
path: root/fs/hfs/inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-07-04 12:24:09 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:47:43 -0400
commitb5fc510c48f631882ccec3c0f02a25d5b67de09f (patch)
tree1749954353b972502f05cdfae75b9d5e77cc1f5a /fs/hfs/inode.c
parentfa9b227e9019ebaeeb06224ba531a490f91144b3 (diff)
downloadop-kernel-dev-b5fc510c48f631882ccec3c0f02a25d5b67de09f.zip
op-kernel-dev-b5fc510c48f631882ccec3c0f02a25d5b67de09f.tar.gz
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/inode.c')
-rw-r--r--fs/hfs/inode.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 87de671..93ceec8 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)
return 0;
}
+static int hfs_file_fsync(struct file *filp, int datasync)
+{
+ struct inode *inode = filp->f_mapping->host;
+ struct super_block * sb;
+ int ret, err;
+
+ /* sync the inode to buffers */
+ ret = write_inode_now(inode, 0);
+
+ /* sync the superblock to buffers */
+ sb = inode->i_sb;
+ if (sb->s_dirt) {
+ lock_super(sb);
+ sb->s_dirt = 0;
+ if (!(sb->s_flags & MS_RDONLY))
+ hfs_mdb_commit(sb);
+ unlock_super(sb);
+ }
+ /* .. finally sync the buffers to disk */
+ err = sync_blockdev(sb->s_bdev);
+ if (!ret)
+ ret = err;
+ return ret;
+}
static const struct file_operations hfs_file_operations = {
.llseek = generic_file_llseek,
@@ -634,7 +658,7 @@ static const struct file_operations hfs_file_operations = {
.aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.splice_read = generic_file_splice_read,
- .fsync = file_fsync,
+ .fsync = hfs_file_fsync,
.open = hfs_file_open,
.release = hfs_file_release,
};
OpenPOWER on IntegriCloud