diff options
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/super.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 13e7ed4188ea..b541bd75bd1f 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -437,12 +437,6 @@ static int ubifs_sync_fs(struct super_block *sb, int wait) | |||
437 | { | 437 | { |
438 | int i, err; | 438 | int i, err; |
439 | struct ubifs_info *c = sb->s_fs_info; | 439 | struct ubifs_info *c = sb->s_fs_info; |
440 | struct writeback_control wbc = { | ||
441 | .sync_mode = WB_SYNC_ALL, | ||
442 | .range_start = 0, | ||
443 | .range_end = LLONG_MAX, | ||
444 | .nr_to_write = LONG_MAX, | ||
445 | }; | ||
446 | 440 | ||
447 | /* | 441 | /* |
448 | * Zero @wait is just an advisory thing to help the file system shove | 442 | * Zero @wait is just an advisory thing to help the file system shove |
@@ -453,17 +447,6 @@ static int ubifs_sync_fs(struct super_block *sb, int wait) | |||
453 | return 0; | 447 | return 0; |
454 | 448 | ||
455 | /* | 449 | /* |
456 | * VFS calls '->sync_fs()' before synchronizing all dirty inodes and | ||
457 | * pages, so synchronize them first, then commit the journal. Strictly | ||
458 | * speaking, it is not necessary to commit the journal here, | ||
459 | * synchronizing write-buffers would be enough. But committing makes | ||
460 | * UBIFS free space predictions much more accurate, so we want to let | ||
461 | * the user be able to get more accurate results of 'statfs()' after | ||
462 | * they synchronize the file system. | ||
463 | */ | ||
464 | generic_sync_sb_inodes(sb, &wbc); | ||
465 | |||
466 | /* | ||
467 | * Synchronize write buffers, because 'ubifs_run_commit()' does not | 450 | * Synchronize write buffers, because 'ubifs_run_commit()' does not |
468 | * do this if it waits for an already running commit. | 451 | * do this if it waits for an already running commit. |
469 | */ | 452 | */ |
@@ -473,6 +456,13 @@ static int ubifs_sync_fs(struct super_block *sb, int wait) | |||
473 | return err; | 456 | return err; |
474 | } | 457 | } |
475 | 458 | ||
459 | /* | ||
460 | * Strictly speaking, it is not necessary to commit the journal here, | ||
461 | * synchronizing write-buffers would be enough. But committing makes | ||
462 | * UBIFS free space predictions much more accurate, so we want to let | ||
463 | * the user be able to get more accurate results of 'statfs()' after | ||
464 | * they synchronize the file system. | ||
465 | */ | ||
476 | err = ubifs_run_commit(c); | 466 | err = ubifs_run_commit(c); |
477 | if (err) | 467 | if (err) |
478 | return err; | 468 | return err; |