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 | |
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')
-rw-r--r-- | fs/nfs/nfs4_fs.h | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4state.c | 14 |
3 files changed, 7 insertions, 11 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index a986f13e8039..cee871471e8d 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -108,7 +108,6 @@ struct nfs_unique_id { | |||
108 | */ | 108 | */ |
109 | struct nfs4_state_owner { | 109 | struct nfs4_state_owner { |
110 | struct nfs_unique_id so_owner_id; | 110 | struct nfs_unique_id so_owner_id; |
111 | struct nfs_client *so_client; | ||
112 | struct nfs_server *so_server; | 111 | struct nfs_server *so_server; |
113 | struct rb_node so_client_node; | 112 | struct rb_node so_client_node; |
114 | 113 | ||
@@ -118,7 +117,6 @@ struct nfs4_state_owner { | |||
118 | atomic_t so_count; | 117 | atomic_t so_count; |
119 | unsigned long so_flags; | 118 | unsigned long so_flags; |
120 | struct list_head so_states; | 119 | struct list_head so_states; |
121 | struct list_head so_delegations; | ||
122 | struct nfs_seqid_counter so_seqid; | 120 | struct nfs_seqid_counter so_seqid; |
123 | struct rpc_sequence so_sequence; | 121 | struct rpc_sequence so_sequence; |
124 | }; | 122 | }; |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 243d6c72cfa1..de9ff1505a24 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1350,7 +1350,7 @@ static void nfs4_open_prepare(struct rpc_task *task, void *calldata) | |||
1350 | } | 1350 | } |
1351 | /* Update sequence id. */ | 1351 | /* Update sequence id. */ |
1352 | data->o_arg.id = sp->so_owner_id.id; | 1352 | data->o_arg.id = sp->so_owner_id.id; |
1353 | data->o_arg.clientid = sp->so_client->cl_clientid; | 1353 | data->o_arg.clientid = sp->so_server->nfs_client->cl_clientid; |
1354 | if (data->o_arg.claim == NFS4_OPEN_CLAIM_PREVIOUS) { | 1354 | if (data->o_arg.claim == NFS4_OPEN_CLAIM_PREVIOUS) { |
1355 | task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR]; | 1355 | task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR]; |
1356 | nfs_copy_fh(&data->o_res.fh, data->o_arg.fh); | 1356 | nfs_copy_fh(&data->o_res.fh, data->o_arg.fh); |
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: |