* [PATCH] cred: fold get_new_cred_many() into get_cred_many()
@ 2024-11-26 13:22 Christian Brauner
2024-11-27 2:04 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Christian Brauner @ 2024-11-26 13:22 UTC (permalink / raw)
To: Linus Torvalds
Cc: Christian Brauner, Amir Goldstein, Miklos Szeredi, Al Viro,
Jens Axboe, linux-kernel, linux-fsdevel
There's no need for this to be a separate helper.
Signed-off-by: Christian Brauner <brauner@kernel.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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] cred: fold get_new_cred_many() into get_cred_many()
2024-11-26 13:22 [PATCH] cred: fold get_new_cred_many() into get_cred_many() Christian Brauner
@ 2024-11-27 2:04 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2024-11-27 2:04 UTC (permalink / raw)
To: Christian Brauner, Linus Torvalds
Cc: Amir Goldstein, Miklos Szeredi, Al Viro, linux-kernel, linux-fsdevel
On 11/26/24 6:22 AM, Christian Brauner wrote:
> There's no need for this to be a separate helper.
Reviewed-by: Jens Axboe <axboe@kernel.dk>
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-27 2:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-26 13:22 [PATCH] cred: fold get_new_cred_many() into get_cred_many() Christian Brauner
2024-11-27 2:04 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®