Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153677
b: refs/heads/master
c: c237dc0
h: refs/heads/master
i:
  153675: aacf6e0
v: v3
  • Loading branch information
J. Bruce Fields committed May 1, 2009
1 parent 3676ff6 commit 2581e6a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e300a63ce4ccec073d254d883a3638d5dca1d771
refs/heads/master: c237dc0303bcf6f4cc2e0efe4fe4e341c6f34dac
16 changes: 8 additions & 8 deletions trunk/fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ static int max_cb_time(void)
int setup_callback_client(struct nfs4_client *clp)
{
struct sockaddr_in addr;
struct nfs4_callback *cb = &clp->cl_callback;
struct nfs4_cb_conn *cb = &clp->cl_cb_conn;
struct rpc_timeout timeparms = {
.to_initval = max_cb_time(),
.to_retries = 0,
Expand Down Expand Up @@ -422,15 +422,15 @@ static void nfsd4_cb_probe_done(struct rpc_task *task, void *calldata)
if (task->tk_status)
warn_no_callback_path(clp, task->tk_status);
else
atomic_set(&clp->cl_callback.cb_set, 1);
atomic_set(&clp->cl_cb_conn.cb_set, 1);
put_nfs4_client(clp);
}

static const struct rpc_call_ops nfsd4_cb_probe_ops = {
.rpc_call_done = nfsd4_cb_probe_done,
};

static struct rpc_cred *lookup_cb_cred(struct nfs4_callback *cb)
static struct rpc_cred *lookup_cb_cred(struct nfs4_cb_conn *cb)
{
struct auth_cred acred = {
.machine_cred = 1
Expand All @@ -448,7 +448,7 @@ static struct rpc_cred *lookup_cb_cred(struct nfs4_callback *cb)

void do_probe_callback(struct nfs4_client *clp)
{
struct nfs4_callback *cb = &clp->cl_callback;
struct nfs4_cb_conn *cb = &clp->cl_cb_conn;
struct rpc_message msg = {
.rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_NULL],
.rpc_argp = clp,
Expand Down Expand Up @@ -480,7 +480,7 @@ nfsd4_probe_callback(struct nfs4_client *clp)
{
int status;

BUG_ON(atomic_read(&clp->cl_callback.cb_set));
BUG_ON(atomic_read(&clp->cl_cb_conn.cb_set));

status = setup_callback_client(clp);
if (status) {
Expand All @@ -501,12 +501,12 @@ void
nfsd4_cb_recall(struct nfs4_delegation *dp)
{
struct nfs4_client *clp = dp->dl_client;
struct rpc_clnt *clnt = clp->cl_callback.cb_client;
struct rpc_clnt *clnt = clp->cl_cb_conn.cb_client;
struct nfs4_cb_recall *cbr = &dp->dl_recall;
struct rpc_message msg = {
.rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_RECALL],
.rpc_argp = cbr,
.rpc_cred = clp->cl_callback.cb_cred
.rpc_cred = clp->cl_cb_conn.cb_cred
};
int retries = 1;
int status = 0;
Expand All @@ -519,7 +519,7 @@ nfsd4_cb_recall(struct nfs4_delegation *dp)
switch (status) {
case -EIO:
/* Network partition? */
atomic_set(&clp->cl_callback.cb_set, 0);
atomic_set(&clp->cl_cb_conn.cb_set, 0);
case -EBADHANDLE:
case -NFS4ERR_BAD_STATEID:
/* Race: client probably got cb_recall
Expand Down
22 changes: 11 additions & 11 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f
{
struct nfs4_delegation *dp;
struct nfs4_file *fp = stp->st_file;
struct nfs4_callback *cb = &stp->st_stateowner->so_client->cl_callback;
struct nfs4_cb_conn *cb = &stp->st_stateowner->so_client->cl_cb_conn;

dprintk("NFSD alloc_init_deleg\n");
if (fp->fi_had_conflict)
Expand Down Expand Up @@ -633,19 +633,19 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name)
static void
shutdown_callback_client(struct nfs4_client *clp)
{
struct rpc_clnt *clnt = clp->cl_callback.cb_client;
struct rpc_clnt *clnt = clp->cl_cb_conn.cb_client;

if (clnt) {
/*
* Callback threads take a reference on the client, so there
* should be no outstanding callbacks at this point.
*/
clp->cl_callback.cb_client = NULL;
clp->cl_cb_conn.cb_client = NULL;
rpc_shutdown_client(clnt);
}
if (clp->cl_callback.cb_cred) {
put_rpccred(clp->cl_callback.cb_cred);
clp->cl_callback.cb_cred = NULL;
if (clp->cl_cb_conn.cb_cred) {
put_rpccred(clp->cl_cb_conn.cb_cred);
clp->cl_cb_conn.cb_cred = NULL;
}
}

Expand Down Expand Up @@ -719,7 +719,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir)
return NULL;
memcpy(clp->cl_recdir, recdir, HEXDIR_LEN);
atomic_set(&clp->cl_count, 1);
atomic_set(&clp->cl_callback.cb_set, 0);
atomic_set(&clp->cl_cb_conn.cb_set, 0);
INIT_LIST_HEAD(&clp->cl_idhash);
INIT_LIST_HEAD(&clp->cl_strhash);
INIT_LIST_HEAD(&clp->cl_openowners);
Expand Down Expand Up @@ -971,7 +971,7 @@ parse_ipv4(unsigned int addr_len, char *addr_val, unsigned int *cbaddrp, unsigne
static void
gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se)
{
struct nfs4_callback *cb = &clp->cl_callback;
struct nfs4_cb_conn *cb = &clp->cl_cb_conn;

/* Currently, we only support tcp for the callback channel */
if ((se->se_callback_netid_len != 3) || memcmp((char *)se->se_callback_netid_val, "tcp", 3))
Expand Down Expand Up @@ -1691,7 +1691,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
else {
/* XXX: We just turn off callbacks until we can handle
* change request correctly. */
atomic_set(&conf->cl_callback.cb_set, 0);
atomic_set(&conf->cl_cb_conn.cb_set, 0);
expire_client(unconf);
status = nfs_ok;

Expand Down Expand Up @@ -2425,7 +2425,7 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_sta
{
struct nfs4_delegation *dp;
struct nfs4_stateowner *sop = stp->st_stateowner;
struct nfs4_callback *cb = &sop->so_client->cl_callback;
struct nfs4_cb_conn *cb = &sop->so_client->cl_cb_conn;
struct file_lock fl, *flp = &fl;
int status, flag = 0;

Expand Down Expand Up @@ -2617,7 +2617,7 @@ nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
renew_client(clp);
status = nfserr_cb_path_down;
if (!list_empty(&clp->cl_delegations)
&& !atomic_read(&clp->cl_callback.cb_set))
&& !atomic_read(&clp->cl_cb_conn.cb_set))
goto out;
status = nfs_ok;
out:
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/nfsd/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct nfs4_delegation {
#define dl_fh dl_recall.cbr_fh

/* client delegation callback info */
struct nfs4_callback {
struct nfs4_cb_conn {
/* SETCLIENTID info */
u32 cb_addr;
unsigned short cb_port;
Expand Down Expand Up @@ -186,7 +186,7 @@ struct nfs4_client {
struct svc_cred cl_cred; /* setclientid principal */
clientid_t cl_clientid; /* generated by server */
nfs4_verifier cl_confirm; /* generated by server */
struct nfs4_callback cl_callback; /* callback info */
struct nfs4_cb_conn cl_cb_conn; /* callback info */
atomic_t cl_count; /* ref count */
u32 cl_firststate; /* recovery dir creation */

Expand Down

0 comments on commit 2581e6a

Please sign in to comment.