diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-06-24 15:11:43 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-06-24 15:11:43 -0400 |
commit | 1f0e890dba5b0f543fea47732116b1c65d55614e (patch) | |
tree | 85bc22beff0f721893a856c482dc28574eed68bd /fs/nfs/nfs4state.c | |
parent | 1055d76d91e69c8ea9fb748db4d4a53b6384df31 (diff) |
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>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index c3c6b8aeb209..13e17e32e3e4 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -373,7 +373,6 @@ nfs4_alloc_state_owner(void) | |||
373 | return NULL; | 373 | return NULL; |
374 | spin_lock_init(&sp->so_lock); | 374 | spin_lock_init(&sp->so_lock); |
375 | INIT_LIST_HEAD(&sp->so_states); | 375 | INIT_LIST_HEAD(&sp->so_states); |
376 | INIT_LIST_HEAD(&sp->so_delegations); | ||
377 | rpc_init_wait_queue(&sp->so_sequence.wait, "Seqid_waitqueue"); | 376 | rpc_init_wait_queue(&sp->so_sequence.wait, "Seqid_waitqueue"); |
378 | sp->so_seqid.sequence = &sp->so_sequence; | 377 | sp->so_seqid.sequence = &sp->so_sequence; |
379 | spin_lock_init(&sp->so_sequence.lock); | 378 | spin_lock_init(&sp->so_sequence.lock); |
@@ -386,7 +385,7 @@ static void | |||
386 | nfs4_drop_state_owner(struct nfs4_state_owner *sp) | 385 | nfs4_drop_state_owner(struct nfs4_state_owner *sp) |
387 | { | 386 | { |
388 | if (!RB_EMPTY_NODE(&sp->so_client_node)) { | 387 | if (!RB_EMPTY_NODE(&sp->so_client_node)) { |
389 | struct nfs_client *clp = sp->so_client; | 388 | struct nfs_client *clp = sp->so_server->nfs_client; |
390 | 389 | ||
391 | spin_lock(&clp->cl_lock); | 390 | spin_lock(&clp->cl_lock); |
392 | rb_erase(&sp->so_client_node, &clp->cl_state_owners); | 391 | 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 | |||
408 | new = nfs4_alloc_state_owner(); | 407 | new = nfs4_alloc_state_owner(); |
409 | if (new == NULL) | 408 | if (new == NULL) |
410 | return NULL; | 409 | return NULL; |
411 | new->so_client = clp; | ||
412 | new->so_server = server; | 410 | new->so_server = server; |
413 | new->so_cred = cred; | 411 | new->so_cred = cred; |
414 | spin_lock(&clp->cl_lock); | 412 | spin_lock(&clp->cl_lock); |
@@ -425,7 +423,7 @@ struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *server, struct | |||
425 | 423 | ||
426 | void nfs4_put_state_owner(struct nfs4_state_owner *sp) | 424 | void nfs4_put_state_owner(struct nfs4_state_owner *sp) |
427 | { | 425 | { |
428 | struct nfs_client *clp = sp->so_client; | 426 | struct nfs_client *clp = sp->so_server->nfs_client; |
429 | struct rpc_cred *cred = sp->so_cred; | 427 | struct rpc_cred *cred = sp->so_cred; |
430 | 428 | ||
431 | if (!atomic_dec_and_lock(&sp->so_count, &clp->cl_lock)) | 429 | 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) | |||
624 | static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, fl_owner_t fl_owner) | 622 | static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, fl_owner_t fl_owner) |
625 | { | 623 | { |
626 | struct nfs4_lock_state *lsp; | 624 | struct nfs4_lock_state *lsp; |
627 | struct nfs_client *clp = state->owner->so_client; | 625 | struct nfs_client *clp = state->owner->so_server->nfs_client; |
628 | 626 | ||
629 | lsp = kzalloc(sizeof(*lsp), GFP_NOFS); | 627 | lsp = kzalloc(sizeof(*lsp), GFP_NOFS); |
630 | if (lsp == NULL) | 628 | if (lsp == NULL) |
@@ -645,7 +643,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f | |||
645 | 643 | ||
646 | static void nfs4_free_lock_state(struct nfs4_lock_state *lsp) | 644 | static void nfs4_free_lock_state(struct nfs4_lock_state *lsp) |
647 | { | 645 | { |
648 | struct nfs_client *clp = lsp->ls_state->owner->so_client; | 646 | struct nfs_client *clp = lsp->ls_state->owner->so_server->nfs_client; |
649 | 647 | ||
650 | spin_lock(&clp->cl_lock); | 648 | spin_lock(&clp->cl_lock); |
651 | nfs_free_unique_id(&clp->cl_lockowner_id, &lsp->ls_id); | 649 | nfs_free_unique_id(&clp->cl_lockowner_id, &lsp->ls_id); |
@@ -1043,11 +1041,11 @@ restart: | |||
1043 | case -NFS4ERR_BAD_STATEID: | 1041 | case -NFS4ERR_BAD_STATEID: |
1044 | case -NFS4ERR_RECLAIM_BAD: | 1042 | case -NFS4ERR_RECLAIM_BAD: |
1045 | case -NFS4ERR_RECLAIM_CONFLICT: | 1043 | case -NFS4ERR_RECLAIM_CONFLICT: |
1046 | nfs4_state_mark_reclaim_nograce(sp->so_client, state); | 1044 | nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state); |
1047 | break; | 1045 | break; |
1048 | case -NFS4ERR_EXPIRED: | 1046 | case -NFS4ERR_EXPIRED: |
1049 | case -NFS4ERR_NO_GRACE: | 1047 | case -NFS4ERR_NO_GRACE: |
1050 | nfs4_state_mark_reclaim_nograce(sp->so_client, state); | 1048 | nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state); |
1051 | case -NFS4ERR_STALE_CLIENTID: | 1049 | case -NFS4ERR_STALE_CLIENTID: |
1052 | case -NFS4ERR_BADSESSION: | 1050 | case -NFS4ERR_BADSESSION: |
1053 | case -NFS4ERR_BADSLOT: | 1051 | case -NFS4ERR_BADSLOT: |