lkml.org 
[lkml]   [2009]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 4/6] 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>
    ---
    fs/fs-writeback.c | 15 +++++++--------
    1 file changed, 7 insertions(+), 8 deletions(-)

    --- linux.orig/fs/fs-writeback.c 2009-09-23 18:33:17.000000000 +0800
    +++ linux/fs/fs-writeback.c 2009-09-23 18:44:10.000000000 +0800
    @@ -452,8 +452,13 @@ writeback_single_inode(struct inode *ino
    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
    @@ -497,12 +502,6 @@ writeback_single_inode(struct inode *ino
    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



    \
     
     \ /
      Last update: 2009-09-23 14:47    [W:0.035 / U:0.008 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site