Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/sunrpc: Make rpc_auth_create_args a const

This turns rpc_auth_create_args into a const as it gets passed through the
auth stack.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

authored by

Sargun Dhillon and committed by
Anna Schumaker
82b98ca5 0914bb96

+11 -9
+3 -2
include/linux/sunrpc/auth.h
··· 125 125 struct module *owner; 126 126 rpc_authflavor_t au_flavor; /* flavor (RPC_AUTH_*) */ 127 127 char * au_name; 128 - struct rpc_auth * (*create)(struct rpc_auth_create_args *, struct rpc_clnt *); 128 + struct rpc_auth * (*create)(const struct rpc_auth_create_args *, 129 + struct rpc_clnt *); 129 130 void (*destroy)(struct rpc_auth *); 130 131 131 132 int (*hash_cred)(struct auth_cred *, unsigned int); ··· 175 174 struct rpc_cred * rpc_lookup_machine_cred(const char *service_name); 176 175 int rpcauth_register(const struct rpc_authops *); 177 176 int rpcauth_unregister(const struct rpc_authops *); 178 - struct rpc_auth * rpcauth_create(struct rpc_auth_create_args *, 177 + struct rpc_auth * rpcauth_create(const struct rpc_auth_create_args *, 179 178 struct rpc_clnt *); 180 179 void rpcauth_release(struct rpc_auth *); 181 180 rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t,
+1 -1
net/sunrpc/auth.c
··· 253 253 EXPORT_SYMBOL_GPL(rpcauth_list_flavors); 254 254 255 255 struct rpc_auth * 256 - rpcauth_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 256 + rpcauth_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 257 257 { 258 258 struct rpc_auth *auth; 259 259 const struct rpc_authops *ops;
+5 -4
net/sunrpc/auth_gss/auth_gss.c
··· 985 985 * parameters based on the input flavor (which must be a pseudoflavor) 986 986 */ 987 987 static struct gss_auth * 988 - gss_create_new(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 988 + gss_create_new(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 989 989 { 990 990 rpc_authflavor_t flavor = args->pseudoflavor; 991 991 struct gss_auth *gss_auth; ··· 1132 1132 * (which is guaranteed to last as long as any of its descendants). 1133 1133 */ 1134 1134 static struct gss_auth * 1135 - gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args, 1135 + gss_auth_find_or_add_hashed(const struct rpc_auth_create_args *args, 1136 1136 struct rpc_clnt *clnt, 1137 1137 struct gss_auth *new) 1138 1138 { ··· 1169 1169 } 1170 1170 1171 1171 static struct gss_auth * 1172 - gss_create_hashed(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 1172 + gss_create_hashed(const struct rpc_auth_create_args *args, 1173 + struct rpc_clnt *clnt) 1173 1174 { 1174 1175 struct gss_auth *gss_auth; 1175 1176 struct gss_auth *new; ··· 1189 1188 } 1190 1189 1191 1190 static struct rpc_auth * 1192 - gss_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 1191 + gss_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 1193 1192 { 1194 1193 struct gss_auth *gss_auth; 1195 1194 struct rpc_xprt_switch *xps = rcu_access_pointer(clnt->cl_xpi.xpi_xpswitch);
+1 -1
net/sunrpc/auth_null.c
··· 19 19 static struct rpc_cred null_cred; 20 20 21 21 static struct rpc_auth * 22 - nul_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 22 + nul_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 23 23 { 24 24 atomic_inc(&null_auth.au_count); 25 25 return &null_auth;
+1 -1
net/sunrpc/auth_unix.c
··· 30 30 static const struct rpc_credops unix_credops; 31 31 32 32 static struct rpc_auth * 33 - unx_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 33 + unx_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt) 34 34 { 35 35 dprintk("RPC: creating UNIX authenticator for client %p\n", 36 36 clnt);