Commit 82b98ca5 authored by Sargun Dhillon's avatar Sargun Dhillon Committed by Anna Schumaker

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: default avatarSargun Dhillon <sargun@sargun.me>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 0914bb96
...@@ -125,7 +125,8 @@ struct rpc_authops { ...@@ -125,7 +125,8 @@ struct rpc_authops {
struct module *owner; struct module *owner;
rpc_authflavor_t au_flavor; /* flavor (RPC_AUTH_*) */ rpc_authflavor_t au_flavor; /* flavor (RPC_AUTH_*) */
char * au_name; char * au_name;
struct rpc_auth * (*create)(struct rpc_auth_create_args *, struct rpc_clnt *); struct rpc_auth * (*create)(const struct rpc_auth_create_args *,
struct rpc_clnt *);
void (*destroy)(struct rpc_auth *); void (*destroy)(struct rpc_auth *);
int (*hash_cred)(struct auth_cred *, unsigned int); int (*hash_cred)(struct auth_cred *, unsigned int);
...@@ -174,7 +175,7 @@ struct rpc_cred * rpc_lookup_generic_cred(struct auth_cred *, int, gfp_t); ...@@ -174,7 +175,7 @@ struct rpc_cred * rpc_lookup_generic_cred(struct auth_cred *, int, gfp_t);
struct rpc_cred * rpc_lookup_machine_cred(const char *service_name); struct rpc_cred * rpc_lookup_machine_cred(const char *service_name);
int rpcauth_register(const struct rpc_authops *); int rpcauth_register(const struct rpc_authops *);
int rpcauth_unregister(const struct rpc_authops *); int rpcauth_unregister(const struct rpc_authops *);
struct rpc_auth * rpcauth_create(struct rpc_auth_create_args *, struct rpc_auth * rpcauth_create(const struct rpc_auth_create_args *,
struct rpc_clnt *); struct rpc_clnt *);
void rpcauth_release(struct rpc_auth *); void rpcauth_release(struct rpc_auth *);
rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t, rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t,
......
...@@ -253,7 +253,7 @@ rpcauth_list_flavors(rpc_authflavor_t *array, int size) ...@@ -253,7 +253,7 @@ rpcauth_list_flavors(rpc_authflavor_t *array, int size)
EXPORT_SYMBOL_GPL(rpcauth_list_flavors); EXPORT_SYMBOL_GPL(rpcauth_list_flavors);
struct rpc_auth * struct rpc_auth *
rpcauth_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) rpcauth_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
{ {
struct rpc_auth *auth; struct rpc_auth *auth;
const struct rpc_authops *ops; const struct rpc_authops *ops;
......
...@@ -985,7 +985,7 @@ static void gss_pipe_free(struct gss_pipe *p) ...@@ -985,7 +985,7 @@ static void gss_pipe_free(struct gss_pipe *p)
* parameters based on the input flavor (which must be a pseudoflavor) * parameters based on the input flavor (which must be a pseudoflavor)
*/ */
static struct gss_auth * static struct gss_auth *
gss_create_new(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) gss_create_new(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
{ {
rpc_authflavor_t flavor = args->pseudoflavor; rpc_authflavor_t flavor = args->pseudoflavor;
struct gss_auth *gss_auth; struct gss_auth *gss_auth;
...@@ -1132,7 +1132,7 @@ gss_destroy(struct rpc_auth *auth) ...@@ -1132,7 +1132,7 @@ gss_destroy(struct rpc_auth *auth)
* (which is guaranteed to last as long as any of its descendants). * (which is guaranteed to last as long as any of its descendants).
*/ */
static struct gss_auth * static struct gss_auth *
gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args, gss_auth_find_or_add_hashed(const struct rpc_auth_create_args *args,
struct rpc_clnt *clnt, struct rpc_clnt *clnt,
struct gss_auth *new) struct gss_auth *new)
{ {
...@@ -1169,7 +1169,8 @@ gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args, ...@@ -1169,7 +1169,8 @@ gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args,
} }
static struct gss_auth * static struct gss_auth *
gss_create_hashed(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) gss_create_hashed(const struct rpc_auth_create_args *args,
struct rpc_clnt *clnt)
{ {
struct gss_auth *gss_auth; struct gss_auth *gss_auth;
struct gss_auth *new; struct gss_auth *new;
...@@ -1188,7 +1189,7 @@ gss_create_hashed(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) ...@@ -1188,7 +1189,7 @@ gss_create_hashed(struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
} }
static struct rpc_auth * static struct rpc_auth *
gss_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) gss_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
{ {
struct gss_auth *gss_auth; struct gss_auth *gss_auth;
struct rpc_xprt_switch *xps = rcu_access_pointer(clnt->cl_xpi.xpi_xpswitch); struct rpc_xprt_switch *xps = rcu_access_pointer(clnt->cl_xpi.xpi_xpswitch);
......
...@@ -19,7 +19,7 @@ static struct rpc_auth null_auth; ...@@ -19,7 +19,7 @@ static struct rpc_auth null_auth;
static struct rpc_cred null_cred; static struct rpc_cred null_cred;
static struct rpc_auth * static struct rpc_auth *
nul_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) nul_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
{ {
atomic_inc(&null_auth.au_count); atomic_inc(&null_auth.au_count);
return &null_auth; return &null_auth;
......
...@@ -30,7 +30,7 @@ static struct rpc_auth unix_auth; ...@@ -30,7 +30,7 @@ static struct rpc_auth unix_auth;
static const struct rpc_credops unix_credops; static const struct rpc_credops unix_credops;
static struct rpc_auth * static struct rpc_auth *
unx_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) unx_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
{ {
dprintk("RPC: creating UNIX authenticator for client %p\n", dprintk("RPC: creating UNIX authenticator for client %p\n",
clnt); clnt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment