Commit ae1b7f7d4b9ea587fda95c38301f4e72e8146634

Authored by Wu Fengguang
Committed by Jens Axboe
1 parent 7fbdea3232

writeback: cleanup writeback_single_inode()

Make the if-else straight in writeback_single_inode().
No behavior change.

Cc: Jan Kara <jack@suse.cz>
Cc: Michael Rubin <mrubin@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

Showing 1 changed file with 7 additions and 8 deletions Side-by-side Diff

... ... @@ -449,9 +449,14 @@
449 449 spin_lock(&inode_lock);
450 450 inode->i_state &= ~I_SYNC;
451 451 if (!(inode->i_state & (I_FREEING | I_CLEAR))) {
452   - if (!(inode->i_state & I_DIRTY) &&
453   - mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
  452 + if (inode->i_state & I_DIRTY) {
454 453 /*
  454 + * Someone redirtied the inode while were writing back
  455 + * the pages.
  456 + */
  457 + redirty_tail(inode);
  458 + } else if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
  459 + /*
455 460 * We didn't write back all the pages. nfs_writepages()
456 461 * sometimes bales out without doing anything. Redirty
457 462 * the inode; Move it from b_io onto b_more_io/b_dirty.
... ... @@ -494,12 +499,6 @@
494 499 inode->i_state |= I_DIRTY_PAGES;
495 500 redirty_tail(inode);
496 501 }
497   - } else if (inode->i_state & I_DIRTY) {
498   - /*
499   - * Someone redirtied the inode while were writing back
500   - * the pages.
501   - */
502   - redirty_tail(inode);
503 502 } else if (atomic_read(&inode->i_count)) {
504 503 /*
505 504 * The inode is clean, inuse