aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ.Bruce Fields <bfields@fieldses.org>2006-12-13 03:35:28 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 12:05:54 -0500
commita4f1706a9bd94d0e33e853a7e9f40b2650d54fbf (patch)
tree66c2bb36ac0b9da3edb13bcee77a46ab576a5e89
parentd9e626f1e23358487595c2d3901126d00f9de7e0 (diff)
[PATCH] knfsd: nfsd4: move replay_owner to cstate
Tuck away the replay_owner in the cstate while we're at it. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/nfsd/nfs4proc.c31
-rw-r--r--fs/nfsd/nfs4state.c22
-rw-r--r--include/linux/nfsd/xdr4.h17
3 files changed, 31 insertions, 39 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 0166b49fb23e..0972cb33d7d4 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -163,7 +163,7 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
163 163
164static inline __be32 164static inline __be32
165nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 165nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
166 struct nfsd4_open *open, struct nfs4_stateowner **replay_owner) 166 struct nfsd4_open *open)
167{ 167{
168 __be32 status; 168 __be32 status;
169 dprintk("NFSD: nfsd4_open filename %.*s op_stateowner %p\n", 169 dprintk("NFSD: nfsd4_open filename %.*s op_stateowner %p\n",
@@ -255,7 +255,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
255out: 255out:
256 if (open->op_stateowner) { 256 if (open->op_stateowner) {
257 nfs4_get_stateowner(open->op_stateowner); 257 nfs4_get_stateowner(open->op_stateowner);
258 *replay_owner = open->op_stateowner; 258 cstate->replay_owner = open->op_stateowner;
259 } 259 }
260 nfs4_unlock_state(); 260 nfs4_unlock_state();
261 return status; 261 return status;
@@ -761,6 +761,7 @@ static void cstate_free(struct nfsd4_compound_state *cstate)
761 return; 761 return;
762 fh_put(&cstate->current_fh); 762 fh_put(&cstate->current_fh);
763 fh_put(&cstate->save_fh); 763 fh_put(&cstate->save_fh);
764 BUG_ON(cstate->replay_owner);
764 kfree(cstate); 765 kfree(cstate);
765} 766}
766 767
@@ -773,6 +774,7 @@ static struct nfsd4_compound_state *cstate_alloc(void)
773 return NULL; 774 return NULL;
774 fh_init(&cstate->current_fh, NFS4_FHSIZE); 775 fh_init(&cstate->current_fh, NFS4_FHSIZE);
775 fh_init(&cstate->save_fh, NFS4_FHSIZE); 776 fh_init(&cstate->save_fh, NFS4_FHSIZE);
777 cstate->replay_owner = NULL;
776 return cstate; 778 return cstate;
777} 779}
778 780
@@ -786,7 +788,6 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
786{ 788{
787 struct nfsd4_op *op; 789 struct nfsd4_op *op;
788 struct nfsd4_compound_state *cstate = NULL; 790 struct nfsd4_compound_state *cstate = NULL;
789 struct nfs4_stateowner *replay_owner = NULL;
790 int slack_bytes; 791 int slack_bytes;
791 __be32 status; 792 __be32 status;
792 793
@@ -876,7 +877,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
876 break; 877 break;
877 case OP_CLOSE: 878 case OP_CLOSE:
878 op->status = nfsd4_close(rqstp, cstate, 879 op->status = nfsd4_close(rqstp, cstate,
879 &op->u.close, &replay_owner); 880 &op->u.close);
880 break; 881 break;
881 case OP_COMMIT: 882 case OP_COMMIT:
882 op->status = nfsd4_commit(rqstp, cstate, 883 op->status = nfsd4_commit(rqstp, cstate,
@@ -901,15 +902,13 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
901 op->status = nfsd4_link(rqstp, cstate, &op->u.link); 902 op->status = nfsd4_link(rqstp, cstate, &op->u.link);
902 break; 903 break;
903 case OP_LOCK: 904 case OP_LOCK:
904 op->status = nfsd4_lock(rqstp, cstate, &op->u.lock, 905 op->status = nfsd4_lock(rqstp, cstate, &op->u.lock);
905 &replay_owner);
906 break; 906 break;
907 case OP_LOCKT: 907 case OP_LOCKT:
908 op->status = nfsd4_lockt(rqstp, cstate, &op->u.lockt); 908 op->status = nfsd4_lockt(rqstp, cstate, &op->u.lockt);
909 break; 909 break;
910 case OP_LOCKU: 910 case OP_LOCKU:
911 op->status = nfsd4_locku(rqstp, cstate, &op->u.locku, 911 op->status = nfsd4_locku(rqstp, cstate, &op->u.locku);
912 &replay_owner);
913 break; 912 break;
914 case OP_LOOKUP: 913 case OP_LOOKUP:
915 op->status = nfsd4_lookup(rqstp, cstate, 914 op->status = nfsd4_lookup(rqstp, cstate,
@@ -926,17 +925,15 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
926 break; 925 break;
927 case OP_OPEN: 926 case OP_OPEN:
928 op->status = nfsd4_open(rqstp, cstate, 927 op->status = nfsd4_open(rqstp, cstate,
929 &op->u.open, &replay_owner); 928 &op->u.open);
930 break; 929 break;
931 case OP_OPEN_CONFIRM: 930 case OP_OPEN_CONFIRM:
932 op->status = nfsd4_open_confirm(rqstp, cstate, 931 op->status = nfsd4_open_confirm(rqstp, cstate,
933 &op->u.open_confirm, 932 &op->u.open_confirm);
934 &replay_owner);
935 break; 933 break;
936 case OP_OPEN_DOWNGRADE: 934 case OP_OPEN_DOWNGRADE:
937 op->status = nfsd4_open_downgrade(rqstp, cstate, 935 op->status = nfsd4_open_downgrade(rqstp, cstate,
938 &op->u.open_downgrade, 936 &op->u.open_downgrade);
939 &replay_owner);
940 break; 937 break;
941 case OP_PUTFH: 938 case OP_PUTFH:
942 op->status = nfsd4_putfh(rqstp, cstate, &op->u.putfh); 939 op->status = nfsd4_putfh(rqstp, cstate, &op->u.putfh);
@@ -1001,16 +998,16 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
1001 998
1002encode_op: 999encode_op:
1003 if (op->status == nfserr_replay_me) { 1000 if (op->status == nfserr_replay_me) {
1004 op->replay = &replay_owner->so_replay; 1001 op->replay = &cstate->replay_owner->so_replay;
1005 nfsd4_encode_replay(resp, op); 1002 nfsd4_encode_replay(resp, op);
1006 status = op->status = op->replay->rp_status; 1003 status = op->status = op->replay->rp_status;
1007 } else { 1004 } else {
1008 nfsd4_encode_operation(resp, op); 1005 nfsd4_encode_operation(resp, op);
1009 status = op->status; 1006 status = op->status;
1010 } 1007 }
1011 if (replay_owner) { 1008 if (cstate->replay_owner) {
1012 nfs4_put_stateowner(replay_owner); 1009 nfs4_put_stateowner(cstate->replay_owner);
1013 replay_owner = NULL; 1010 cstate->replay_owner = NULL;
1014 } 1011 }
1015 /* XXX Ugh, we need to get rid of this kind of special case: */ 1012 /* XXX Ugh, we need to get rid of this kind of special case: */
1016 if (op->opnum == OP_READ && op->u.read.rd_filp) 1013 if (op->opnum == OP_READ && op->u.read.rd_filp)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index f0a994e3b2c5..db701c47a342 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2242,8 +2242,7 @@ check_replay:
2242 2242
2243__be32 2243__be32
2244nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 2244nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2245 struct nfsd4_open_confirm *oc, 2245 struct nfsd4_open_confirm *oc)
2246 struct nfs4_stateowner **replay_owner)
2247{ 2246{
2248 __be32 status; 2247 __be32 status;
2249 struct nfs4_stateowner *sop; 2248 struct nfs4_stateowner *sop;
@@ -2280,7 +2279,7 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2280out: 2279out:
2281 if (oc->oc_stateowner) { 2280 if (oc->oc_stateowner) {
2282 nfs4_get_stateowner(oc->oc_stateowner); 2281 nfs4_get_stateowner(oc->oc_stateowner);
2283 *replay_owner = oc->oc_stateowner; 2282 cstate->replay_owner = oc->oc_stateowner;
2284 } 2283 }
2285 nfs4_unlock_state(); 2284 nfs4_unlock_state();
2286 return status; 2285 return status;
@@ -2314,8 +2313,7 @@ reset_union_bmap_deny(unsigned long deny, unsigned long *bmap)
2314__be32 2313__be32
2315nfsd4_open_downgrade(struct svc_rqst *rqstp, 2314nfsd4_open_downgrade(struct svc_rqst *rqstp,
2316 struct nfsd4_compound_state *cstate, 2315 struct nfsd4_compound_state *cstate,
2317 struct nfsd4_open_downgrade *od, 2316 struct nfsd4_open_downgrade *od)
2318 struct nfs4_stateowner **replay_owner)
2319{ 2317{
2320 __be32 status; 2318 __be32 status;
2321 struct nfs4_stateid *stp; 2319 struct nfs4_stateid *stp;
@@ -2361,7 +2359,7 @@ nfsd4_open_downgrade(struct svc_rqst *rqstp,
2361out: 2359out:
2362 if (od->od_stateowner) { 2360 if (od->od_stateowner) {
2363 nfs4_get_stateowner(od->od_stateowner); 2361 nfs4_get_stateowner(od->od_stateowner);
2364 *replay_owner = od->od_stateowner; 2362 cstate->replay_owner = od->od_stateowner;
2365 } 2363 }
2366 nfs4_unlock_state(); 2364 nfs4_unlock_state();
2367 return status; 2365 return status;
@@ -2372,7 +2370,7 @@ out:
2372 */ 2370 */
2373__be32 2371__be32
2374nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 2372nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2375 struct nfsd4_close *close, struct nfs4_stateowner **replay_owner) 2373 struct nfsd4_close *close)
2376{ 2374{
2377 __be32 status; 2375 __be32 status;
2378 struct nfs4_stateid *stp; 2376 struct nfs4_stateid *stp;
@@ -2405,7 +2403,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2405out: 2403out:
2406 if (close->cl_stateowner) { 2404 if (close->cl_stateowner) {
2407 nfs4_get_stateowner(close->cl_stateowner); 2405 nfs4_get_stateowner(close->cl_stateowner);
2408 *replay_owner = close->cl_stateowner; 2406 cstate->replay_owner = close->cl_stateowner;
2409 } 2407 }
2410 nfs4_unlock_state(); 2408 nfs4_unlock_state();
2411 return status; 2409 return status;
@@ -2646,7 +2644,7 @@ check_lock_length(u64 offset, u64 length)
2646 */ 2644 */
2647__be32 2645__be32
2648nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 2646nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2649 struct nfsd4_lock *lock, struct nfs4_stateowner **replay_owner) 2647 struct nfsd4_lock *lock)
2650{ 2648{
2651 struct nfs4_stateowner *open_sop = NULL; 2649 struct nfs4_stateowner *open_sop = NULL;
2652 struct nfs4_stateowner *lock_sop = NULL; 2650 struct nfs4_stateowner *lock_sop = NULL;
@@ -2796,7 +2794,7 @@ out:
2796 release_stateowner(lock_sop); 2794 release_stateowner(lock_sop);
2797 if (lock->lk_replay_owner) { 2795 if (lock->lk_replay_owner) {
2798 nfs4_get_stateowner(lock->lk_replay_owner); 2796 nfs4_get_stateowner(lock->lk_replay_owner);
2799 *replay_owner = lock->lk_replay_owner; 2797 cstate->replay_owner = lock->lk_replay_owner;
2800 } 2798 }
2801 nfs4_unlock_state(); 2799 nfs4_unlock_state();
2802 return status; 2800 return status;
@@ -2888,7 +2886,7 @@ out:
2888 2886
2889__be32 2887__be32
2890nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 2888nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2891 struct nfsd4_locku *locku, struct nfs4_stateowner **replay_owner) 2889 struct nfsd4_locku *locku)
2892{ 2890{
2893 struct nfs4_stateid *stp; 2891 struct nfs4_stateid *stp;
2894 struct file *filp = NULL; 2892 struct file *filp = NULL;
@@ -2946,7 +2944,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2946out: 2944out:
2947 if (locku->lu_stateowner) { 2945 if (locku->lu_stateowner) {
2948 nfs4_get_stateowner(locku->lu_stateowner); 2946 nfs4_get_stateowner(locku->lu_stateowner);
2949 *replay_owner = locku->lu_stateowner; 2947 cstate->replay_owner = locku->lu_stateowner;
2950 } 2948 }
2951 nfs4_unlock_state(); 2949 nfs4_unlock_state();
2952 return status; 2950 return status;
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 594b8ca69755..4e5cd05ea373 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -47,6 +47,7 @@
47struct nfsd4_compound_state { 47struct nfsd4_compound_state {
48 struct svc_fh current_fh; 48 struct svc_fh current_fh;
49 struct svc_fh save_fh; 49 struct svc_fh save_fh;
50 struct nfs4_stateowner *replay_owner;
50}; 51};
51 52
52struct nfsd4_change_info { 53struct nfsd4_change_info {
@@ -442,25 +443,21 @@ extern __be32 nfsd4_process_open1(struct nfsd4_open *open);
442extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, 443extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
443 struct svc_fh *current_fh, struct nfsd4_open *open); 444 struct svc_fh *current_fh, struct nfsd4_open *open);
444extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, 445extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
445 struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc, 446 struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc);
446 struct nfs4_stateowner **);
447extern __be32 nfsd4_close(struct svc_rqst *rqstp, 447extern __be32 nfsd4_close(struct svc_rqst *rqstp,
448 struct nfsd4_compound_state *, 448 struct nfsd4_compound_state *,
449 struct nfsd4_close *close, 449 struct nfsd4_close *close);
450 struct nfs4_stateowner **replay_owner);
451extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp, 450extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
452 struct nfsd4_compound_state *, struct nfsd4_open_downgrade *od, 451 struct nfsd4_compound_state *,
453 struct nfs4_stateowner **replay_owner); 452 struct nfsd4_open_downgrade *od);
454extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *, 453extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
455 struct nfsd4_lock *lock, 454 struct nfsd4_lock *lock);
456 struct nfs4_stateowner **replay_owner);
457extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, 455extern __be32 nfsd4_lockt(struct svc_rqst *rqstp,
458 struct nfsd4_compound_state *, 456 struct nfsd4_compound_state *,
459 struct nfsd4_lockt *lockt); 457 struct nfsd4_lockt *lockt);
460extern __be32 nfsd4_locku(struct svc_rqst *rqstp, 458extern __be32 nfsd4_locku(struct svc_rqst *rqstp,
461 struct nfsd4_compound_state *, 459 struct nfsd4_compound_state *,
462 struct nfsd4_locku *locku, 460 struct nfsd4_locku *locku);
463 struct nfs4_stateowner **replay_owner);
464extern __be32 461extern __be32
465nfsd4_release_lockowner(struct svc_rqst *rqstp, 462nfsd4_release_lockowner(struct svc_rqst *rqstp,
466 struct nfsd4_release_lockowner *rlockowner); 463 struct nfsd4_release_lockowner *rlockowner);