writeback: cleanup writeback_single_inode()
authorWu Fengguang <fengguang.wu@intel.com>
Wed, 23 Sep 2009 12:33:42 +0000 (20:33 +0800)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 25 Sep 2009 16:08:25 +0000 (18:08 +0200)
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>
fs/fs-writeback.c

index 551684de13924dc256d89bb3b7ce175a02b73fdf..916e83489caa8fef98684f4a7fce532c7cb454f5 100644 (file)
@@ -449,8 +449,13 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
        spin_lock(&inode_lock);
        inode->i_state &= ~I_SYNC;
        if (!(inode->i_state & (I_FREEING | I_CLEAR))) {
-               if (!(inode->i_state & I_DIRTY) &&
-                   mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
+               if (inode->i_state & I_DIRTY) {
+                       /*
+                        * Someone redirtied the inode while were writing back
+                        * the pages.
+                        */
+                       redirty_tail(inode);
+               } else if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
                        /*
                         * We didn't write back all the pages.  nfs_writepages()
                         * sometimes bales out without doing anything. Redirty
@@ -494,12 +499,6 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
                                inode->i_state |= I_DIRTY_PAGES;
                                redirty_tail(inode);
                        }
-               } else if (inode->i_state & I_DIRTY) {
-                       /*
-                        * Someone redirtied the inode while were writing back
-                        * the pages.
-                        */
-                       redirty_tail(inode);
                } else if (atomic_read(&inode->i_count)) {
                        /*
                         * The inode is clean, inuse