diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-06-02 17:38:30 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:47:44 -0400 |
commit | a4ffdde6e56fdf8c34ddadc2674d6eb978083369 (patch) | |
tree | 0fa07df92d804cb7d0482135195e4835cb16403a /fs/fs-writeback.c | |
parent | b5fc510c48f631882ccec3c0f02a25d5b67de09f (diff) |
simplify checks for I_CLEAR/I_FREEING
add I_CLEAR instead of replacing I_FREEING with it. I_CLEAR is
equivalent to I_FREEING for almost all code looking at either;
it's there to keep track of having called clear_inode() exactly
once per inode lifetime, at some point after having set I_FREEING.
I_CLEAR and I_FREEING never get set at the same time with the
current code, so we can switch to setting i_flags to I_FREEING | I_CLEAR
instead of I_CLEAR without loss of information. As the result of
such change, checks become simpler and the amount of code that needs
to know about I_CLEAR shrinks a lot.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r-- | fs/fs-writeback.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index d5be1693ac93..7608880b5c58 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -352,7 +352,7 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc) | |||
352 | 352 | ||
353 | spin_lock(&inode_lock); | 353 | spin_lock(&inode_lock); |
354 | inode->i_state &= ~I_SYNC; | 354 | inode->i_state &= ~I_SYNC; |
355 | if (!(inode->i_state & (I_FREEING | I_CLEAR))) { | 355 | if (!(inode->i_state & I_FREEING)) { |
356 | if ((inode->i_state & I_DIRTY_PAGES) && wbc->for_kupdate) { | 356 | if ((inode->i_state & I_DIRTY_PAGES) && wbc->for_kupdate) { |
357 | /* | 357 | /* |
358 | * More pages get dirtied by a fast dirtier. | 358 | * More pages get dirtied by a fast dirtier. |
@@ -499,7 +499,7 @@ static int writeback_sb_inodes(struct super_block *sb, struct bdi_writeback *wb, | |||
499 | if (inode_dirtied_after(inode, wbc->wb_start)) | 499 | if (inode_dirtied_after(inode, wbc->wb_start)) |
500 | return 1; | 500 | return 1; |
501 | 501 | ||
502 | BUG_ON(inode->i_state & (I_FREEING | I_CLEAR)); | 502 | BUG_ON(inode->i_state & I_FREEING); |
503 | __iget(inode); | 503 | __iget(inode); |
504 | pages_skipped = wbc->pages_skipped; | 504 | pages_skipped = wbc->pages_skipped; |
505 | writeback_single_inode(inode, wbc); | 505 | writeback_single_inode(inode, wbc); |
@@ -935,7 +935,7 @@ void __mark_inode_dirty(struct inode *inode, int flags) | |||
935 | if (hlist_unhashed(&inode->i_hash)) | 935 | if (hlist_unhashed(&inode->i_hash)) |
936 | goto out; | 936 | goto out; |
937 | } | 937 | } |
938 | if (inode->i_state & (I_FREEING|I_CLEAR)) | 938 | if (inode->i_state & I_FREEING) |
939 | goto out; | 939 | goto out; |
940 | 940 | ||
941 | /* | 941 | /* |
@@ -1001,7 +1001,7 @@ static void wait_sb_inodes(struct super_block *sb) | |||
1001 | list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { | 1001 | list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { |
1002 | struct address_space *mapping; | 1002 | struct address_space *mapping; |
1003 | 1003 | ||
1004 | if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) | 1004 | if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) |
1005 | continue; | 1005 | continue; |
1006 | mapping = inode->i_mapping; | 1006 | mapping = inode->i_mapping; |
1007 | if (mapping->nrpages == 0) | 1007 | if (mapping->nrpages == 0) |