Skip to content

Commit

Permalink
nfsd: Remove callback_cred
Browse files Browse the repository at this point in the history
Clean up: The global callback_cred is no longer used, so it can be
removed.

Signed-off-by: Chuck Lever <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
chucklever authored and J. Bruce Fields committed Aug 22, 2018
1 parent cb25e7b commit a26dd64
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 30 deletions.
20 changes: 0 additions & 20 deletions fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,26 +746,6 @@ static int max_cb_time(struct net *net)
return max(nn->nfsd4_lease/10, (time_t)1) * HZ;
}

static struct rpc_cred *callback_cred;

int set_callback_cred(void)
{
if (callback_cred)
return 0;
callback_cred = rpc_lookup_machine_cred("nfs");
if (!callback_cred)
return -ENOMEM;
return 0;
}

void cleanup_callback_cred(void)
{
if (callback_cred) {
put_rpccred(callback_cred);
callback_cred = NULL;
}
}

static struct rpc_cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc_clnt *client, struct nfsd4_session *ses)
{
if (clp->cl_minorversion == 0) {
Expand Down
10 changes: 2 additions & 8 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -7231,14 +7231,10 @@ nfs4_state_start(void)
{
int ret;

ret = set_callback_cred();
if (ret)
return ret;

laundry_wq = alloc_workqueue("%s", WQ_UNBOUND, 0, "nfsd4");
if (laundry_wq == NULL) {
ret = -ENOMEM;
goto out_cleanup_cred;
goto out;
}
ret = nfsd4_create_callback_queue();
if (ret)
Expand All @@ -7249,8 +7245,7 @@ nfs4_state_start(void)

out_free_laundry:
destroy_workqueue(laundry_wq);
out_cleanup_cred:
cleanup_callback_cred();
out:
return ret;
}

Expand Down Expand Up @@ -7287,7 +7282,6 @@ nfs4_state_shutdown(void)
{
destroy_workqueue(laundry_wq);
nfsd4_destroy_callback_queue();
cleanup_callback_cred();
}

static void
Expand Down
2 changes: 0 additions & 2 deletions fs/nfsd/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,6 @@ extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(const char *recdir,
struct nfsd_net *nn);
extern __be32 nfs4_check_open_reclaim(clientid_t *clid,
struct nfsd4_compound_state *cstate, struct nfsd_net *nn);
extern int set_callback_cred(void);
extern void cleanup_callback_cred(void);
extern void nfsd4_probe_callback(struct nfs4_client *clp);
extern void nfsd4_probe_callback_sync(struct nfs4_client *clp);
extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *);
Expand Down

0 comments on commit a26dd64

Please sign in to comment.