diff options
author | Benny Halevy <bhalevy@panasas.com> | 2009-04-03 01:28:41 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-03 20:41:19 -0400 |
commit | dd453dfd70538cadc02cb47ff8d8cfd0cb8cf435 (patch) | |
tree | c55174fec4f6c7ddd803a598bcd755ec87e7ff0e /fs/nfsd/nfs4state.c | |
parent | e10e0cfc2f27364c73b28adbd3c8688d97049e73 (diff) |
nfsd: pass nfsd4_compound_state* to nfs4_preprocess_{state,seq}id_op
Currently we only use cstate->current_fh,
will also be used by nfsd41 code.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 9192e5b35f42..f49f305096ec 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2810,10 +2810,12 @@ static int is_delegation_stateid(stateid_t *stateid) | |||
2810 | * Checks for stateid operations | 2810 | * Checks for stateid operations |
2811 | */ | 2811 | */ |
2812 | __be32 | 2812 | __be32 |
2813 | nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int flags, struct file **filpp) | 2813 | nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate, |
2814 | stateid_t *stateid, int flags, struct file **filpp) | ||
2814 | { | 2815 | { |
2815 | struct nfs4_stateid *stp = NULL; | 2816 | struct nfs4_stateid *stp = NULL; |
2816 | struct nfs4_delegation *dp = NULL; | 2817 | struct nfs4_delegation *dp = NULL; |
2818 | struct svc_fh *current_fh = &cstate->current_fh; | ||
2817 | struct inode *ino = current_fh->fh_dentry->d_inode; | 2819 | struct inode *ino = current_fh->fh_dentry->d_inode; |
2818 | __be32 status; | 2820 | __be32 status; |
2819 | 2821 | ||
@@ -2878,10 +2880,14 @@ setlkflg (int type) | |||
2878 | * Checks for sequence id mutating operations. | 2880 | * Checks for sequence id mutating operations. |
2879 | */ | 2881 | */ |
2880 | static __be32 | 2882 | static __be32 |
2881 | nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *stateid, int flags, struct nfs4_stateowner **sopp, struct nfs4_stateid **stpp, struct nfsd4_lock *lock) | 2883 | nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid, |
2884 | stateid_t *stateid, int flags, | ||
2885 | struct nfs4_stateowner **sopp, | ||
2886 | struct nfs4_stateid **stpp, struct nfsd4_lock *lock) | ||
2882 | { | 2887 | { |
2883 | struct nfs4_stateid *stp; | 2888 | struct nfs4_stateid *stp; |
2884 | struct nfs4_stateowner *sop; | 2889 | struct nfs4_stateowner *sop; |
2890 | struct svc_fh *current_fh = &cstate->current_fh; | ||
2885 | __be32 status; | 2891 | __be32 status; |
2886 | 2892 | ||
2887 | dprintk("NFSD: preprocess_seqid_op: seqid=%d " | 2893 | dprintk("NFSD: preprocess_seqid_op: seqid=%d " |
@@ -3004,7 +3010,7 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
3004 | 3010 | ||
3005 | nfs4_lock_state(); | 3011 | nfs4_lock_state(); |
3006 | 3012 | ||
3007 | if ((status = nfs4_preprocess_seqid_op(&cstate->current_fh, | 3013 | if ((status = nfs4_preprocess_seqid_op(cstate, |
3008 | oc->oc_seqid, &oc->oc_req_stateid, | 3014 | oc->oc_seqid, &oc->oc_req_stateid, |
3009 | CONFIRM | OPEN_STATE, | 3015 | CONFIRM | OPEN_STATE, |
3010 | &oc->oc_stateowner, &stp, NULL))) | 3016 | &oc->oc_stateowner, &stp, NULL))) |
@@ -3074,7 +3080,7 @@ nfsd4_open_downgrade(struct svc_rqst *rqstp, | |||
3074 | return nfserr_inval; | 3080 | return nfserr_inval; |
3075 | 3081 | ||
3076 | nfs4_lock_state(); | 3082 | nfs4_lock_state(); |
3077 | if ((status = nfs4_preprocess_seqid_op(&cstate->current_fh, | 3083 | if ((status = nfs4_preprocess_seqid_op(cstate, |
3078 | od->od_seqid, | 3084 | od->od_seqid, |
3079 | &od->od_stateid, | 3085 | &od->od_stateid, |
3080 | OPEN_STATE, | 3086 | OPEN_STATE, |
@@ -3127,7 +3133,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
3127 | 3133 | ||
3128 | nfs4_lock_state(); | 3134 | nfs4_lock_state(); |
3129 | /* check close_lru for replay */ | 3135 | /* check close_lru for replay */ |
3130 | if ((status = nfs4_preprocess_seqid_op(&cstate->current_fh, | 3136 | if ((status = nfs4_preprocess_seqid_op(cstate, |
3131 | close->cl_seqid, | 3137 | close->cl_seqid, |
3132 | &close->cl_stateid, | 3138 | &close->cl_stateid, |
3133 | OPEN_STATE | CLOSE_STATE, | 3139 | OPEN_STATE | CLOSE_STATE, |
@@ -3474,7 +3480,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
3474 | goto out; | 3480 | goto out; |
3475 | 3481 | ||
3476 | /* validate and update open stateid and open seqid */ | 3482 | /* validate and update open stateid and open seqid */ |
3477 | status = nfs4_preprocess_seqid_op(&cstate->current_fh, | 3483 | status = nfs4_preprocess_seqid_op(cstate, |
3478 | lock->lk_new_open_seqid, | 3484 | lock->lk_new_open_seqid, |
3479 | &lock->lk_new_open_stateid, | 3485 | &lock->lk_new_open_stateid, |
3480 | OPEN_STATE, | 3486 | OPEN_STATE, |
@@ -3501,7 +3507,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
3501 | goto out; | 3507 | goto out; |
3502 | } else { | 3508 | } else { |
3503 | /* lock (lock owner + lock stateid) already exists */ | 3509 | /* lock (lock owner + lock stateid) already exists */ |
3504 | status = nfs4_preprocess_seqid_op(&cstate->current_fh, | 3510 | status = nfs4_preprocess_seqid_op(cstate, |
3505 | lock->lk_old_lock_seqid, | 3511 | lock->lk_old_lock_seqid, |
3506 | &lock->lk_old_lock_stateid, | 3512 | &lock->lk_old_lock_stateid, |
3507 | LOCK_STATE, | 3513 | LOCK_STATE, |
@@ -3697,7 +3703,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
3697 | 3703 | ||
3698 | nfs4_lock_state(); | 3704 | nfs4_lock_state(); |
3699 | 3705 | ||
3700 | if ((status = nfs4_preprocess_seqid_op(&cstate->current_fh, | 3706 | if ((status = nfs4_preprocess_seqid_op(cstate, |
3701 | locku->lu_seqid, | 3707 | locku->lu_seqid, |
3702 | &locku->lu_stateid, | 3708 | &locku->lu_stateid, |
3703 | LOCK_STATE, | 3709 | LOCK_STATE, |