diff options
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/inode.c b/fs/inode.c index 27ee1af50d02..c36d9480335c 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -495,8 +495,7 @@ static struct inode * find_inode(struct super_block * sb, struct hlist_head *hea | |||
495 | struct inode * inode = NULL; | 495 | struct inode * inode = NULL; |
496 | 496 | ||
497 | repeat: | 497 | repeat: |
498 | hlist_for_each (node, head) { | 498 | hlist_for_each_entry(inode, node, head, i_hash) { |
499 | inode = hlist_entry(node, struct inode, i_hash); | ||
500 | if (inode->i_sb != sb) | 499 | if (inode->i_sb != sb) |
501 | continue; | 500 | continue; |
502 | if (!test(inode, data)) | 501 | if (!test(inode, data)) |
@@ -520,8 +519,7 @@ static struct inode * find_inode_fast(struct super_block * sb, struct hlist_head | |||
520 | struct inode * inode = NULL; | 519 | struct inode * inode = NULL; |
521 | 520 | ||
522 | repeat: | 521 | repeat: |
523 | hlist_for_each (node, head) { | 522 | hlist_for_each_entry(inode, node, head, i_hash) { |
524 | inode = hlist_entry(node, struct inode, i_hash); | ||
525 | if (inode->i_ino != ino) | 523 | if (inode->i_ino != ino) |
526 | continue; | 524 | continue; |
527 | if (inode->i_sb != sb) | 525 | if (inode->i_sb != sb) |
@@ -1151,13 +1149,8 @@ static inline void iput_final(struct inode *inode) | |||
1151 | void iput(struct inode *inode) | 1149 | void iput(struct inode *inode) |
1152 | { | 1150 | { |
1153 | if (inode) { | 1151 | if (inode) { |
1154 | const struct super_operations *op = inode->i_sb->s_op; | ||
1155 | |||
1156 | BUG_ON(inode->i_state == I_CLEAR); | 1152 | BUG_ON(inode->i_state == I_CLEAR); |
1157 | 1153 | ||
1158 | if (op && op->put_inode) | ||
1159 | op->put_inode(inode); | ||
1160 | |||
1161 | if (atomic_dec_and_lock(&inode->i_count, &inode_lock)) | 1154 | if (atomic_dec_and_lock(&inode->i_count, &inode_lock)) |
1162 | iput_final(inode); | 1155 | iput_final(inode); |
1163 | } | 1156 | } |