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.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 010cd363d085..4cc1e3a36ec7 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -119,8 +119,8 @@ static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb,
119 struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; 119 struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host;
120 ssize_t ret; 120 ssize_t ret;
121 121
122 ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, 122 ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs,
123 offset, nr_segs, hfsplus_get_block, NULL); 123 hfsplus_get_block);
124 124
125 /* 125 /*
126 * In case of error extending write may have instantiated a few 126 * In case of error extending write may have instantiated a few
@@ -298,6 +298,8 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr)
298 298
299 if ((attr->ia_valid & ATTR_SIZE) && 299 if ((attr->ia_valid & ATTR_SIZE) &&
300 attr->ia_size != i_size_read(inode)) { 300 attr->ia_size != i_size_read(inode)) {
301 inode_dio_wait(inode);
302
301 error = vmtruncate(inode, attr->ia_size); 303 error = vmtruncate(inode, attr->ia_size);
302 if (error) 304 if (error)
303 return error; 305 return error;
@@ -308,13 +310,19 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr)
308 return 0; 310 return 0;
309} 311}
310 312
311int hfsplus_file_fsync(struct file *file, int datasync) 313int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
314 int datasync)
312{ 315{
313 struct inode *inode = file->f_mapping->host; 316 struct inode *inode = file->f_mapping->host;
314 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); 317 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
315 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb); 318 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
316 int error = 0, error2; 319 int error = 0, error2;
317 320
321 error = filemap_write_and_wait_range(inode->i_mapping, start, end);
322 if (error)
323 return error;
324 mutex_lock(&inode->i_mutex);
325
318 /* 326 /*
319 * Sync inode metadata into the catalog and extent trees. 327 * Sync inode metadata into the catalog and extent trees.
320 */ 328 */
@@ -342,6 +350,8 @@ int hfsplus_file_fsync(struct file *file, int datasync)
342 if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags)) 350 if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags))
343 blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); 351 blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
344 352
353 mutex_unlock(&inode->i_mutex);
354
345 return error; 355 return error;
346} 356}
347 357