[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241126-zaunpfahl-wovon-c3979b990a63@brauner>
Date: Tue, 26 Nov 2024 14:22:16 +0100
From: Christian Brauner <brauner@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Christian Brauner <brauner@...nel.org>,
Amir Goldstein <amir73il@...il.com>,
Miklos Szeredi <miklos@...redi.hu>,
Al Viro <viro@...iv.linux.org.uk>,
Jens Axboe <axboe@...nel.dk>,
linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: [PATCH] cred: fold get_new_cred_many() into get_cred_many()
There's no need for this to be a separate helper.
Signed-off-by: Christian Brauner <brauner@...nel.org>
---
Putting this on top of kernel.cred.
---
include/linux/cred.h | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 360f5fd3854b..0c3c4b16b469 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -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;
}
/*
--
2.45.2
Powered by blists - more mailing lists