diff options
| author | NeilBrown <neilb@suse.com> | 2018-12-02 19:30:30 -0500 |
|---|---|---|
| committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2018-12-19 13:52:44 -0500 |
| commit | 97f68c6b02e0225b38d327103c59cfe2ab5ecda7 (patch) | |
| tree | 87d434407fef925b2d3fefad5dd759d33b9eb31a /include | |
| parent | f06bc03339ad4c1baa964a5f0606247ac1c3c50b (diff) | |
SUNRPC: add 'struct cred *' to auth_cred and rpc_cred
The SUNRPC credential framework was put together before
Linux has 'struct cred'. Now that we have it, it makes sense to
use it.
This first step just includes a suitable 'struct cred *' pointer
in every 'struct auth_cred' and almost every 'struct rpc_cred'.
The rpc_cred used for auth_null has a NULL 'struct cred *' as nothing
else really makes sense.
For rpc_cred, the pointer is reference counted.
For auth_cred it isn't. struct auth_cred are either allocated on
the stack, in which case the thread owns a reference to the auth,
or are part of 'struct generic_cred' in which case gc_base owns the
reference, and "acred" shares it.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sunrpc/auth.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index c4db9424b63b..1f95bd612053 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -46,6 +46,7 @@ enum { | |||
| 46 | 46 | ||
| 47 | /* Work around the lack of a VFS credential */ | 47 | /* Work around the lack of a VFS credential */ |
| 48 | struct auth_cred { | 48 | struct auth_cred { |
| 49 | const struct cred *cred; | ||
| 49 | kuid_t uid; | 50 | kuid_t uid; |
| 50 | kgid_t gid; | 51 | kgid_t gid; |
| 51 | struct group_info *group_info; | 52 | struct group_info *group_info; |
| @@ -68,6 +69,7 @@ struct rpc_cred { | |||
| 68 | unsigned long cr_expire; /* when to gc */ | 69 | unsigned long cr_expire; /* when to gc */ |
| 69 | unsigned long cr_flags; /* various flags */ | 70 | unsigned long cr_flags; /* various flags */ |
| 70 | refcount_t cr_count; /* ref count */ | 71 | refcount_t cr_count; /* ref count */ |
| 72 | const struct cred *cr_cred; | ||
| 71 | 73 | ||
| 72 | kuid_t cr_uid; | 74 | kuid_t cr_uid; |
| 73 | 75 | ||
