]> Git Repo - linux.git/commitdiff
cred: fold get_new_cred_many() into get_cred_many()
authorChristian Brauner <[email protected]>
Tue, 26 Nov 2024 13:22:16 +0000 (14:22 +0100)
committerChristian Brauner <[email protected]>
Mon, 2 Dec 2024 10:25:15 +0000 (11:25 +0100)
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]>
include/linux/cred.h

index 360f5fd3854bddf866abef141cb633ea95c38d73..0c3c4b16b469c6e75a867b599c1f85b53c926988 100644 (file)
@@ -186,20 +186,6 @@ static inline const struct cred *revert_creds(const struct cred *revert_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
  * @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)
                return cred;
        nonconst_cred->non_rcu = 0;
-       return get_new_cred_many(nonconst_cred, nr);
+       atomic_long_add(nr, &nonconst_cred->usage);
+       return cred;
 }
 
 /*
This page took 0.044708 seconds and 4 git commands to generate.