diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/ops_file.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index 7bd971bf7cdd..b3f1e0349ae0 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c | |||
@@ -510,6 +510,11 @@ static int gfs2_close(struct inode *inode, struct file *file) | |||
510 | * is set. For stuffed inodes we must flush the log in order to | 510 | * is set. For stuffed inodes we must flush the log in order to |
511 | * ensure that all data is on disk. | 511 | * ensure that all data is on disk. |
512 | * | 512 | * |
513 | * The call to write_inode_now() is there to write back metadata and | ||
514 | * the inode itself. It does also try and write the data, but thats | ||
515 | * (hopefully) a no-op due to the VFS having already called filemap_fdatawrite() | ||
516 | * for us. | ||
517 | * | ||
513 | * Returns: errno | 518 | * Returns: errno |
514 | */ | 519 | */ |
515 | 520 | ||
@@ -518,10 +523,6 @@ static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
518 | struct inode *inode = dentry->d_inode; | 523 | struct inode *inode = dentry->d_inode; |
519 | int sync_state = inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC); | 524 | int sync_state = inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC); |
520 | int ret = 0; | 525 | int ret = 0; |
521 | struct writeback_control wbc = { | ||
522 | .sync_mode = WB_SYNC_ALL, | ||
523 | .nr_to_write = 0, | ||
524 | }; | ||
525 | 526 | ||
526 | if (gfs2_is_jdata(GFS2_I(inode))) { | 527 | if (gfs2_is_jdata(GFS2_I(inode))) { |
527 | gfs2_log_flush(GFS2_SB(inode), GFS2_I(inode)->i_gl); | 528 | gfs2_log_flush(GFS2_SB(inode), GFS2_I(inode)->i_gl); |
@@ -530,7 +531,7 @@ static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
530 | 531 | ||
531 | if (sync_state != 0) { | 532 | if (sync_state != 0) { |
532 | if (!datasync) | 533 | if (!datasync) |
533 | ret = sync_inode(inode, &wbc); | 534 | ret = write_inode_now(inode, 0); |
534 | 535 | ||
535 | if (gfs2_is_stuffed(GFS2_I(inode))) | 536 | if (gfs2_is_stuffed(GFS2_I(inode))) |
536 | gfs2_log_flush(GFS2_SB(inode), GFS2_I(inode)->i_gl); | 537 | gfs2_log_flush(GFS2_SB(inode), GFS2_I(inode)->i_gl); |