aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-04-06 22:01:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 11:31:17 -0400
commita2e7d2df82cafb76f76809ddf6e2caa8afe4f75e (patch)
treeac16ef25c4d3e4eaf55090b57035d292ec5bc9fb /fs/nilfs2
parent3358b4aaa84fd4c1cdd64391875e92cbb8afeb29 (diff)
nilfs2: cleanup nilfs_clear_inode
This will remove the following unnecessary locks and cleanup code in nilfs_clear_inode(): - unnecessary protection using nilfs_transaction_begin() and nilfs_transaction_end(). - cleanup code of i_dirty list field which is never chained when this function is called. - spinlock used when releasing i_bh field. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/super.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 10e82c00aedc..268b563d215a 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -184,8 +184,6 @@ static inline void nilfs_destroy_inode_cache(void)
184static void nilfs_clear_inode(struct inode *inode) 184static void nilfs_clear_inode(struct inode *inode)
185{ 185{
186 struct nilfs_inode_info *ii = NILFS_I(inode); 186 struct nilfs_inode_info *ii = NILFS_I(inode);
187 struct nilfs_transaction_info ti;
188 struct nilfs_sb_info *sbi = NILFS_SB(inode->i_sb);
189 187
190#ifdef CONFIG_NILFS_POSIX_ACL 188#ifdef CONFIG_NILFS_POSIX_ACL
191 if (ii->i_acl && ii->i_acl != NILFS_ACL_NOT_CACHED) { 189 if (ii->i_acl && ii->i_acl != NILFS_ACL_NOT_CACHED) {
@@ -200,21 +198,14 @@ static void nilfs_clear_inode(struct inode *inode)
200 /* 198 /*
201 * Free resources allocated in nilfs_read_inode(), here. 199 * Free resources allocated in nilfs_read_inode(), here.
202 */ 200 */
203 nilfs_transaction_begin(inode->i_sb, &ti, 0); 201 BUG_ON(!list_empty(&ii->i_dirty));
204
205 spin_lock(&sbi->s_inode_lock);
206 if (!list_empty(&ii->i_dirty))
207 list_del_init(&ii->i_dirty);
208 brelse(ii->i_bh); 202 brelse(ii->i_bh);
209 ii->i_bh = NULL; 203 ii->i_bh = NULL;
210 spin_unlock(&sbi->s_inode_lock);
211 204
212 if (test_bit(NILFS_I_BMAP, &ii->i_state)) 205 if (test_bit(NILFS_I_BMAP, &ii->i_state))
213 nilfs_bmap_clear(ii->i_bmap); 206 nilfs_bmap_clear(ii->i_bmap);
214 207
215 nilfs_btnode_cache_clear(&ii->i_btnode_cache); 208 nilfs_btnode_cache_clear(&ii->i_btnode_cache);
216
217 nilfs_transaction_end(inode->i_sb, 0);
218} 209}
219 210
220/** 211/**