NFSv4: Clean up struct nfs4_state_owner

The 'so_delegations' list appears to be unused.

Also eliminate so_client. If we already have so_server, we can get to the
nfs_client structure.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Trond Myklebust 2010-06-24 15:11:43 -04:00
Родитель 1055d76d91
Коммит 1f0e890dba
3 изменённых файлов: 7 добавлений и 11 удалений

Просмотреть файл

@ -108,7 +108,6 @@ struct nfs_unique_id {
*/ */
struct nfs4_state_owner { struct nfs4_state_owner {
struct nfs_unique_id so_owner_id; struct nfs_unique_id so_owner_id;
struct nfs_client *so_client;
struct nfs_server *so_server; struct nfs_server *so_server;
struct rb_node so_client_node; struct rb_node so_client_node;
@ -118,7 +117,6 @@ struct nfs4_state_owner {
atomic_t so_count; atomic_t so_count;
unsigned long so_flags; unsigned long so_flags;
struct list_head so_states; struct list_head so_states;
struct list_head so_delegations;
struct nfs_seqid_counter so_seqid; struct nfs_seqid_counter so_seqid;
struct rpc_sequence so_sequence; struct rpc_sequence so_sequence;
}; };

Просмотреть файл

@ -1350,7 +1350,7 @@ static void nfs4_open_prepare(struct rpc_task *task, void *calldata)
} }
/* Update sequence id. */ /* Update sequence id. */
data->o_arg.id = sp->so_owner_id.id; data->o_arg.id = sp->so_owner_id.id;
data->o_arg.clientid = sp->so_client->cl_clientid; data->o_arg.clientid = sp->so_server->nfs_client->cl_clientid;
if (data->o_arg.claim == NFS4_OPEN_CLAIM_PREVIOUS) { if (data->o_arg.claim == NFS4_OPEN_CLAIM_PREVIOUS) {
task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR]; task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR];
nfs_copy_fh(&data->o_res.fh, data->o_arg.fh); nfs_copy_fh(&data->o_res.fh, data->o_arg.fh);

Просмотреть файл

@ -373,7 +373,6 @@ nfs4_alloc_state_owner(void)
return NULL; return NULL;
spin_lock_init(&sp->so_lock); spin_lock_init(&sp->so_lock);
INIT_LIST_HEAD(&sp->so_states); INIT_LIST_HEAD(&sp->so_states);
INIT_LIST_HEAD(&sp->so_delegations);
rpc_init_wait_queue(&sp->so_sequence.wait, "Seqid_waitqueue"); rpc_init_wait_queue(&sp->so_sequence.wait, "Seqid_waitqueue");
sp->so_seqid.sequence = &sp->so_sequence; sp->so_seqid.sequence = &sp->so_sequence;
spin_lock_init(&sp->so_sequence.lock); spin_lock_init(&sp->so_sequence.lock);
@ -386,7 +385,7 @@ static void
nfs4_drop_state_owner(struct nfs4_state_owner *sp) nfs4_drop_state_owner(struct nfs4_state_owner *sp)
{ {
if (!RB_EMPTY_NODE(&sp->so_client_node)) { if (!RB_EMPTY_NODE(&sp->so_client_node)) {
struct nfs_client *clp = sp->so_client; struct nfs_client *clp = sp->so_server->nfs_client;
spin_lock(&clp->cl_lock); spin_lock(&clp->cl_lock);
rb_erase(&sp->so_client_node, &clp->cl_state_owners); rb_erase(&sp->so_client_node, &clp->cl_state_owners);
@ -408,7 +407,6 @@ struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *server, struct
new = nfs4_alloc_state_owner(); new = nfs4_alloc_state_owner();
if (new == NULL) if (new == NULL)
return NULL; return NULL;
new->so_client = clp;
new->so_server = server; new->so_server = server;
new->so_cred = cred; new->so_cred = cred;
spin_lock(&clp->cl_lock); spin_lock(&clp->cl_lock);
@ -425,7 +423,7 @@ struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *server, struct
void nfs4_put_state_owner(struct nfs4_state_owner *sp) void nfs4_put_state_owner(struct nfs4_state_owner *sp)
{ {
struct nfs_client *clp = sp->so_client; struct nfs_client *clp = sp->so_server->nfs_client;
struct rpc_cred *cred = sp->so_cred; struct rpc_cred *cred = sp->so_cred;
if (!atomic_dec_and_lock(&sp->so_count, &clp->cl_lock)) if (!atomic_dec_and_lock(&sp->so_count, &clp->cl_lock))
@ -624,7 +622,7 @@ __nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t fl_owner)
static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, fl_owner_t fl_owner) static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, fl_owner_t fl_owner)
{ {
struct nfs4_lock_state *lsp; struct nfs4_lock_state *lsp;
struct nfs_client *clp = state->owner->so_client; struct nfs_client *clp = state->owner->so_server->nfs_client;
lsp = kzalloc(sizeof(*lsp), GFP_NOFS); lsp = kzalloc(sizeof(*lsp), GFP_NOFS);
if (lsp == NULL) if (lsp == NULL)
@ -645,7 +643,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f
static void nfs4_free_lock_state(struct nfs4_lock_state *lsp) static void nfs4_free_lock_state(struct nfs4_lock_state *lsp)
{ {
struct nfs_client *clp = lsp->ls_state->owner->so_client; struct nfs_client *clp = lsp->ls_state->owner->so_server->nfs_client;
spin_lock(&clp->cl_lock); spin_lock(&clp->cl_lock);
nfs_free_unique_id(&clp->cl_lockowner_id, &lsp->ls_id); nfs_free_unique_id(&clp->cl_lockowner_id, &lsp->ls_id);
@ -1043,11 +1041,11 @@ restart:
case -NFS4ERR_BAD_STATEID: case -NFS4ERR_BAD_STATEID:
case -NFS4ERR_RECLAIM_BAD: case -NFS4ERR_RECLAIM_BAD:
case -NFS4ERR_RECLAIM_CONFLICT: case -NFS4ERR_RECLAIM_CONFLICT:
nfs4_state_mark_reclaim_nograce(sp->so_client, state); nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state);
break; break;
case -NFS4ERR_EXPIRED: case -NFS4ERR_EXPIRED:
case -NFS4ERR_NO_GRACE: case -NFS4ERR_NO_GRACE:
nfs4_state_mark_reclaim_nograce(sp->so_client, state); nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state);
case -NFS4ERR_STALE_CLIENTID: case -NFS4ERR_STALE_CLIENTID:
case -NFS4ERR_BADSESSION: case -NFS4ERR_BADSESSION:
case -NFS4ERR_BADSLOT: case -NFS4ERR_BADSLOT: