aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNicolas Kaiser <nikai@nikai.net>2011-03-19 11:45:30 -0400
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-05-10 09:21:44 -0400
commiteaae0f37d83bed7ccd0c6d0f52de1de44f92aecc (patch)
tree15f643a13b7d80ab9406ac84c2430b151983a531 /fs
parent349dbc3669d043e656f3ed48c7bfe073ca1c6326 (diff)
nilfs2: merge list_del()/list_add_tail() to list_move_tail()
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/nilfs2/inode.c3
-rw-r--r--fs/nilfs2/segment.c6
2 files changed, 3 insertions, 6 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index c0aa27490c02..2cc8c087b2d5 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -872,8 +872,7 @@ int nilfs_set_file_dirty(struct inode *inode, unsigned nr_dirty)
872 return -EINVAL; /* NILFS_I_DIRTY may remain for 872 return -EINVAL; /* NILFS_I_DIRTY may remain for
873 freeing inode */ 873 freeing inode */
874 } 874 }
875 list_del(&ii->i_dirty); 875 list_move_tail(&ii->i_dirty, &nilfs->ns_dirty_files);
876 list_add_tail(&ii->i_dirty, &nilfs->ns_dirty_files);
877 set_bit(NILFS_I_QUEUED, &ii->i_state); 876 set_bit(NILFS_I_QUEUED, &ii->i_state);
878 } 877 }
879 spin_unlock(&nilfs->ns_inode_lock); 878 spin_unlock(&nilfs->ns_inode_lock);
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index afe4f2183454..5deeadda9083 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -1991,8 +1991,7 @@ static int nilfs_segctor_collect_dirty_files(struct nilfs_sc_info *sci,
1991 1991
1992 clear_bit(NILFS_I_QUEUED, &ii->i_state); 1992 clear_bit(NILFS_I_QUEUED, &ii->i_state);
1993 set_bit(NILFS_I_BUSY, &ii->i_state); 1993 set_bit(NILFS_I_BUSY, &ii->i_state);
1994 list_del(&ii->i_dirty); 1994 list_move_tail(&ii->i_dirty, &sci->sc_dirty_files);
1995 list_add_tail(&ii->i_dirty, &sci->sc_dirty_files);
1996 } 1995 }
1997 spin_unlock(&nilfs->ns_inode_lock); 1996 spin_unlock(&nilfs->ns_inode_lock);
1998 1997
@@ -2014,8 +2013,7 @@ static void nilfs_segctor_drop_written_files(struct nilfs_sc_info *sci,
2014 clear_bit(NILFS_I_BUSY, &ii->i_state); 2013 clear_bit(NILFS_I_BUSY, &ii->i_state);
2015 brelse(ii->i_bh); 2014 brelse(ii->i_bh);
2016 ii->i_bh = NULL; 2015 ii->i_bh = NULL;
2017 list_del(&ii->i_dirty); 2016 list_move_tail(&ii->i_dirty, &ti->ti_garbage);
2018 list_add_tail(&ii->i_dirty, &ti->ti_garbage);
2019 } 2017 }
2020 spin_unlock(&nilfs->ns_inode_lock); 2018 spin_unlock(&nilfs->ns_inode_lock);
2021} 2019}