Skip to content

Commit 8c721cb

Browse files
tititiou36jankara
authored andcommitted
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.fr Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent 6efb943 commit 8c721cb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/quota/dquot.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,12 @@ static inline void remove_dquot_hash(struct dquot *dquot)
288288
static struct dquot *find_dquot(unsigned int hashent, struct super_block *sb,
289289
struct kqid qid)
290290
{
291-
struct hlist_node *node;
292291
struct dquot *dquot;
293292

294-
hlist_for_each (node, dquot_hash+hashent) {
295-
dquot = hlist_entry(node, struct dquot, dq_hash);
293+
hlist_for_each_entry(dquot, dquot_hash+hashent, dq_hash)
296294
if (dquot->dq_sb == sb && qid_eq(dquot->dq_id, qid))
297295
return dquot;
298-
}
296+
299297
return NULL;
300298
}
301299

0 commit comments

Comments
 (0)