Skip to content

Commit a6babf4

Browse files
committed
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 <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 252120f commit a6babf4

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

include/linux/cred.h

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -186,20 +186,6 @@ static inline const struct cred *revert_creds(const struct cred *revert_cred)
186186
return override_cred;
187187
}
188188

189-
/**
190-
* get_new_cred_many - Get references on a new set of credentials
191-
* @cred: The new credentials to reference
192-
* @nr: Number of references to acquire
193-
*
194-
* Get references on the specified set of new credentials. The caller must
195-
* release all acquired references.
196-
*/
197-
static inline struct cred *get_new_cred_many(struct cred *cred, int nr)
198-
{
199-
atomic_long_add(nr, &cred->usage);
200-
return cred;
201-
}
202-
203189
/**
204190
* get_cred_many - Get references on a set of credentials
205191
* @cred: The credentials to reference
@@ -220,7 +206,8 @@ static inline const struct cred *get_cred_many(const struct cred *cred, int nr)
220206
if (!cred)
221207
return cred;
222208
nonconst_cred->non_rcu = 0;
223-
return get_new_cred_many(nonconst_cred, nr);
209+
atomic_long_add(nr, &nonconst_cred->usage);
210+
return cred;
224211
}
225212

226213
/*

0 commit comments

Comments
 (0)