nilfs2: merge list_del()/list_add_tail() to list_move_tail()
authorNicolas Kaiser <nikai@nikai.net>
Sat, 19 Mar 2011 15:45:30 +0000 (16:45 +0100)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tue, 10 May 2011 13:21:44 +0000 (22:21 +0900)
Merge list_del() + list_add_tail() to list_move_tail().

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
fs/nilfs2/inode.c
fs/nilfs2/segment.c

index c0aa27490c027f40c40a12951caf38720f0ff417..2cc8c087b2d57300e9f437734e15612a7cfce699 100644 (file)
@@ -872,8 +872,7 @@ int nilfs_set_file_dirty(struct inode *inode, unsigned nr_dirty)
                        return -EINVAL; /* NILFS_I_DIRTY may remain for
                                           freeing inode */
                }
-               list_del(&ii->i_dirty);
-               list_add_tail(&ii->i_dirty, &nilfs->ns_dirty_files);
+               list_move_tail(&ii->i_dirty, &nilfs->ns_dirty_files);
                set_bit(NILFS_I_QUEUED, &ii->i_state);
        }
        spin_unlock(&nilfs->ns_inode_lock);
index afe4f2183454d49a4be19b902c200b1922ebcc4e..5deeadda9083de848cc745d70bf9ef5429237093 100644 (file)
@@ -1991,8 +1991,7 @@ static int nilfs_segctor_collect_dirty_files(struct nilfs_sc_info *sci,
 
                clear_bit(NILFS_I_QUEUED, &ii->i_state);
                set_bit(NILFS_I_BUSY, &ii->i_state);
-               list_del(&ii->i_dirty);
-               list_add_tail(&ii->i_dirty, &sci->sc_dirty_files);
+               list_move_tail(&ii->i_dirty, &sci->sc_dirty_files);
        }
        spin_unlock(&nilfs->ns_inode_lock);
 
@@ -2014,8 +2013,7 @@ static void nilfs_segctor_drop_written_files(struct nilfs_sc_info *sci,
                clear_bit(NILFS_I_BUSY, &ii->i_state);
                brelse(ii->i_bh);
                ii->i_bh = NULL;
-               list_del(&ii->i_dirty);
-               list_add_tail(&ii->i_dirty, &ti->ti_garbage);
+               list_move_tail(&ii->i_dirty, &ti->ti_garbage);
        }
        spin_unlock(&nilfs->ns_inode_lock);
 }
This page took 0.086881 seconds and 5 git commands to generate.