mirror of https://gitee.com/openkylin/linux.git
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 <christophe.jaillet@wanadoo.fr> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
6efb943b86
commit
8c721cb0f7
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue