aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfsplus/inode.c')
-rw-r--r--fs/hfsplus/inode.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 5b1cb98741cc..30486e01d003 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -308,13 +308,19 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr)
308 return 0; 308 return 0;
309} 309}
310 310
311int hfsplus_file_fsync(struct file *file, int datasync) 311int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
312 int datasync)
312{ 313{
313 struct inode *inode = file->f_mapping->host; 314 struct inode *inode = file->f_mapping->host;
314 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); 315 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
315 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb); 316 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
316 int error = 0, error2; 317 int error = 0, error2;
317 318
319 error = filemap_write_and_wait_range(inode->i_mapping, start, end);
320 if (error)
321 return error;
322 mutex_lock(&inode->i_mutex);
323
318 /* 324 /*
319 * Sync inode metadata into the catalog and extent trees. 325 * Sync inode metadata into the catalog and extent trees.
320 */ 326 */
@@ -342,6 +348,8 @@ int hfsplus_file_fsync(struct file *file, int datasync)
342 if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags)) 348 if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags))
343 blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); 349 blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
344 350
351 mutex_unlock(&inode->i_mutex);
352
345 return error; 353 return error;
346} 354}
347 355