提交 c5c8be3c 编写于 作者: M Matthias Kaehlcke 提交者: Linus Torvalds

fs/inode.c: use hlist_for_each_entry()

fs/inode.c: use hlist_for_each_entry() in find_inode() and find_inode_fast()

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: NMatthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 af065b8a
...@@ -495,8 +495,7 @@ static struct inode * find_inode(struct super_block * sb, struct hlist_head *hea ...@@ -495,8 +495,7 @@ static struct inode * find_inode(struct super_block * sb, struct hlist_head *hea
struct inode * inode = NULL; struct inode * inode = NULL;
repeat: repeat:
hlist_for_each (node, head) { hlist_for_each_entry(inode, node, head, i_hash) {
inode = hlist_entry(node, struct inode, i_hash);
if (inode->i_sb != sb) if (inode->i_sb != sb)
continue; continue;
if (!test(inode, data)) if (!test(inode, data))
...@@ -520,8 +519,7 @@ static struct inode * find_inode_fast(struct super_block * sb, struct hlist_head ...@@ -520,8 +519,7 @@ static struct inode * find_inode_fast(struct super_block * sb, struct hlist_head
struct inode * inode = NULL; struct inode * inode = NULL;
repeat: repeat:
hlist_for_each (node, head) { hlist_for_each_entry(inode, node, head, i_hash) {
inode = hlist_entry(node, struct inode, i_hash);
if (inode->i_ino != ino) if (inode->i_ino != ino)
continue; continue;
if (inode->i_sb != sb) if (inode->i_sb != sb)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册