aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2009-03-23 19:52:46 -0400
committerJames Morris <jmorris@namei.org>2009-03-23 19:52:46 -0400
commit703a3cd72817e99201cef84a8a7aecc60b2b3581 (patch)
tree3e943755178ff410694722bb031f523136fbc432 /fs/inode.c
parentdf7f54c012b92ec93d56b68547351dcdf8a163d3 (diff)
parent8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff)
Merge branch 'master' into next
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 40e37c026565..8a47ccd9fc38 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -369,6 +369,7 @@ static int invalidate_list(struct list_head *head, struct list_head *dispose)
369 invalidate_inode_buffers(inode); 369 invalidate_inode_buffers(inode);
370 if (!atomic_read(&inode->i_count)) { 370 if (!atomic_read(&inode->i_count)) {
371 list_move(&inode->i_list, dispose); 371 list_move(&inode->i_list, dispose);
372 WARN_ON(inode->i_state & I_NEW);
372 inode->i_state |= I_FREEING; 373 inode->i_state |= I_FREEING;
373 count++; 374 count++;
374 continue; 375 continue;
@@ -470,6 +471,7 @@ static void prune_icache(int nr_to_scan)
470 continue; 471 continue;
471 } 472 }
472 list_move(&inode->i_list, &freeable); 473 list_move(&inode->i_list, &freeable);
474 WARN_ON(inode->i_state & I_NEW);
473 inode->i_state |= I_FREEING; 475 inode->i_state |= I_FREEING;
474 nr_pruned++; 476 nr_pruned++;
475 } 477 }
@@ -666,6 +668,7 @@ void unlock_new_inode(struct inode *inode)
666 * just created it (so there can be no old holders 668 * just created it (so there can be no old holders
667 * that haven't tested I_LOCK). 669 * that haven't tested I_LOCK).
668 */ 670 */
671 WARN_ON((inode->i_state & (I_LOCK|I_NEW)) != (I_LOCK|I_NEW));
669 inode->i_state &= ~(I_LOCK|I_NEW); 672 inode->i_state &= ~(I_LOCK|I_NEW);
670 wake_up_inode(inode); 673 wake_up_inode(inode);
671} 674}
@@ -1155,6 +1158,7 @@ void generic_delete_inode(struct inode *inode)
1155 1158
1156 list_del_init(&inode->i_list); 1159 list_del_init(&inode->i_list);
1157 list_del_init(&inode->i_sb_list); 1160 list_del_init(&inode->i_sb_list);
1161 WARN_ON(inode->i_state & I_NEW);
1158 inode->i_state |= I_FREEING; 1162 inode->i_state |= I_FREEING;
1159 inodes_stat.nr_inodes--; 1163 inodes_stat.nr_inodes--;
1160 spin_unlock(&inode_lock); 1164 spin_unlock(&inode_lock);
@@ -1196,16 +1200,19 @@ static void generic_forget_inode(struct inode *inode)
1196 spin_unlock(&inode_lock); 1200 spin_unlock(&inode_lock);
1197 return; 1201 return;
1198 } 1202 }
1203 WARN_ON(inode->i_state & I_NEW);
1199 inode->i_state |= I_WILL_FREE; 1204 inode->i_state |= I_WILL_FREE;
1200 spin_unlock(&inode_lock); 1205 spin_unlock(&inode_lock);
1201 write_inode_now(inode, 1); 1206 write_inode_now(inode, 1);
1202 spin_lock(&inode_lock); 1207 spin_lock(&inode_lock);
1208 WARN_ON(inode->i_state & I_NEW);
1203 inode->i_state &= ~I_WILL_FREE; 1209 inode->i_state &= ~I_WILL_FREE;
1204 inodes_stat.nr_unused--; 1210 inodes_stat.nr_unused--;
1205 hlist_del_init(&inode->i_hash); 1211 hlist_del_init(&inode->i_hash);
1206 } 1212 }
1207 list_del_init(&inode->i_list); 1213 list_del_init(&inode->i_list);
1208 list_del_init(&inode->i_sb_list); 1214 list_del_init(&inode->i_sb_list);
1215 WARN_ON(inode->i_state & I_NEW);
1209 inode->i_state |= I_FREEING; 1216 inode->i_state |= I_FREEING;
1210 inodes_stat.nr_inodes--; 1217 inodes_stat.nr_inodes--;
1211 spin_unlock(&inode_lock); 1218 spin_unlock(&inode_lock);