Commit 8c721cb0 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jan Kara

quota: Use 'hlist_for_each_entry' to simplify code

Use 'hlist_for_each_entry' instead of hand writing it.
This saves a few lines of code.

Link: https://lore.kernel.org/r/f82d3e33964dcbd2aac19866735e0a8381c8a735.1619599407.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 6efb943b
...@@ -288,14 +288,12 @@ static inline void remove_dquot_hash(struct dquot *dquot) ...@@ -288,14 +288,12 @@ static inline void remove_dquot_hash(struct dquot *dquot)
static struct dquot *find_dquot(unsigned int hashent, struct super_block *sb, static struct dquot *find_dquot(unsigned int hashent, struct super_block *sb,
struct kqid qid) struct kqid qid)
{ {
struct hlist_node *node;
struct dquot *dquot; struct dquot *dquot;
hlist_for_each (node, dquot_hash+hashent) { hlist_for_each_entry(dquot, dquot_hash+hashent, dq_hash)
dquot = hlist_entry(node, struct dquot, dq_hash);
if (dquot->dq_sb == sb && qid_eq(dquot->dq_id, qid)) if (dquot->dq_sb == sb && qid_eq(dquot->dq_id, qid))
return dquot; return dquot;
}
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment