Skip to content

Commit

Permalink
quota: Use 'hlist_for_each_entry' to simplify code
Browse files Browse the repository at this point in the history
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.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Christophe JAILLET authored and Jan Kara committed May 10, 2021
1 parent 6efb943 commit 8c721cb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/quota/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
struct kqid qid)
{
struct hlist_node *node;
struct dquot *dquot;

hlist_for_each (node, dquot_hash+hashent) {
dquot = hlist_entry(node, struct dquot, dq_hash);
hlist_for_each_entry(dquot, dquot_hash+hashent, dq_hash)
if (dquot->dq_sb == sb && qid_eq(dquot->dq_id, qid))
return dquot;
}

return NULL;
}

Expand Down

0 comments on commit 8c721cb

Please sign in to comment.