mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-22 16:06:04 -05:00
cred: fold get_new_cred_many() into get_cred_many()
There's no need for this to be a separate helper. Link: https://lore.kernel.org/r/20241126-zaunpfahl-wovon-c3979b990a63@brauner Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
252120f79a
commit
a6babf4cbe
1 changed files with 2 additions and 15 deletions
|
@ -186,20 +186,6 @@ static inline const struct cred *revert_creds(const struct cred *revert_cred)
|
||||||
return override_cred;
|
return override_cred;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* get_new_cred_many - Get references on a new set of credentials
|
|
||||||
* @cred: The new credentials to reference
|
|
||||||
* @nr: Number of references to acquire
|
|
||||||
*
|
|
||||||
* Get references on the specified set of new credentials. The caller must
|
|
||||||
* release all acquired references.
|
|
||||||
*/
|
|
||||||
static inline struct cred *get_new_cred_many(struct cred *cred, int nr)
|
|
||||||
{
|
|
||||||
atomic_long_add(nr, &cred->usage);
|
|
||||||
return cred;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get_cred_many - Get references on a set of credentials
|
* get_cred_many - Get references on a set of credentials
|
||||||
* @cred: The credentials to reference
|
* @cred: The credentials to reference
|
||||||
|
@ -220,7 +206,8 @@ static inline const struct cred *get_cred_many(const struct cred *cred, int nr)
|
||||||
if (!cred)
|
if (!cred)
|
||||||
return cred;
|
return cred;
|
||||||
nonconst_cred->non_rcu = 0;
|
nonconst_cred->non_rcu = 0;
|
||||||
return get_new_cred_many(nonconst_cred, nr);
|
atomic_long_add(nr, &nonconst_cred->usage);
|
||||||
|
return cred;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue