Skip to content

Commit

Permalink
SUNRPC: remove generic cred code.
Browse files Browse the repository at this point in the history
This is no longer used.

Signed-off-by: NeilBrown <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
  • Loading branch information
NeilBrown authored and amschuma-ntap committed Dec 19, 2018
1 parent a52458b commit 89a4f75
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 225 deletions.
6 changes: 0 additions & 6 deletions include/linux/sunrpc/auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ struct rpc_auth_create_args {

/* Flags for rpcauth_lookupcred() */
#define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */
#define RPCAUTH_LOOKUP_RCU 0x02 /* lock-less lookup */

/*
* Client authentication ops
Expand Down Expand Up @@ -151,15 +150,10 @@ extern const struct rpc_authops authunix_ops;
extern const struct rpc_authops authnull_ops;

int __init rpc_init_authunix(void);
int __init rpc_init_generic_auth(void);
int __init rpcauth_init_module(void);
void rpcauth_remove_module(void);
void rpc_destroy_generic_auth(void);
void rpc_destroy_authunix(void);

struct rpc_cred * rpc_lookup_cred(void);
struct rpc_cred * rpc_lookup_cred_nonblock(void);
struct rpc_cred * rpc_lookup_generic_cred(struct auth_cred *, int, gfp_t);
int rpcauth_register(const struct rpc_authops *);
int rpcauth_unregister(const struct rpc_authops *);
struct rpc_auth * rpcauth_create(const struct rpc_auth_create_args *,
Expand Down
2 changes: 1 addition & 1 deletion net/sunrpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ obj-$(CONFIG_SUNRPC_GSS) += auth_gss/
obj-$(CONFIG_SUNRPC_XPRT_RDMA) += xprtrdma/

sunrpc-y := clnt.o xprt.o socklib.o xprtsock.o sched.o \
auth.o auth_null.o auth_unix.o auth_generic.o \
auth.o auth_null.o auth_unix.o \
svc.o svcsock.o svcauth.o svcauth_unix.o \
addr.o rpcb_clnt.o timer.o xdr.o \
sunrpc_syms.o cache.o rpc_pipe.o \
Expand Down
18 changes: 1 addition & 17 deletions net/sunrpc/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,6 @@ rpcauth_lookup_credcache(struct rpc_auth *auth, struct auth_cred * acred,
hlist_for_each_entry_rcu(entry, &cache->hashtable[nr], cr_hash) {
if (!entry->cr_ops->crmatch(acred, entry, flags))
continue;
if (flags & RPCAUTH_LOOKUP_RCU) {
if (test_bit(RPCAUTH_CRED_NEW, &entry->cr_flags) ||
refcount_read(&entry->cr_count) == 0)
continue;
cred = entry;
break;
}
cred = get_rpccred(entry);
if (cred)
break;
Expand All @@ -594,9 +587,6 @@ rpcauth_lookup_credcache(struct rpc_auth *auth, struct auth_cred * acred,
if (cred != NULL)
goto found;

if (flags & RPCAUTH_LOOKUP_RCU)
return ERR_PTR(-ECHILD);

new = auth->au_ops->crcreate(auth, acred, flags, gfp);
if (IS_ERR(new)) {
cred = new;
Expand Down Expand Up @@ -925,15 +915,10 @@ int __init rpcauth_init_module(void)
err = rpc_init_authunix();
if (err < 0)
goto out1;
err = rpc_init_generic_auth();
if (err < 0)
goto out2;
err = register_shrinker(&rpc_cred_shrinker);
if (err < 0)
goto out3;
goto out2;
return 0;
out3:
rpc_destroy_generic_auth();
out2:
rpc_destroy_authunix();
out1:
Expand All @@ -943,6 +928,5 @@ int __init rpcauth_init_module(void)
void rpcauth_remove_module(void)
{
rpc_destroy_authunix();
rpc_destroy_generic_auth();
unregister_shrinker(&rpc_cred_shrinker);
}
199 changes: 0 additions & 199 deletions net/sunrpc/auth_generic.c

This file was deleted.

2 changes: 0 additions & 2 deletions net/sunrpc/auth_null.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ nul_destroy(struct rpc_auth *auth)
static struct rpc_cred *
nul_lookup_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
{
if (flags & RPCAUTH_LOOKUP_RCU)
return &null_cred;
return get_rpccred(&null_cred);
}

Expand Down

0 comments on commit 89a4f75

Please sign in to comment.