From: NeilBrown Remove the unneeded stateowner argument from nfs4_check_open() and init_stateid. Signed-off-by: Andy Adamson Signed-off-by: J. Bruce Fields Signed-off-by: Neil Brown Signed-off-by: Andrew Morton --- 25-akpm/fs/nfsd/nfs4state.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff -puN fs/nfsd/nfs4state.c~nfsd4-remove-unneeded-stateowner-arguments fs/nfsd/nfs4state.c --- 25/fs/nfsd/nfs4state.c~nfsd4-remove-unneeded-stateowner-arguments 2005-03-21 22:49:50.000000000 -0800 +++ 25-akpm/fs/nfsd/nfs4state.c 2005-03-21 22:49:50.000000000 -0800 @@ -1123,7 +1123,8 @@ release_stateowner(struct nfs4_stateowne } static inline void -init_stateid(struct nfs4_stateid *stp, struct nfs4_file *fp, struct nfs4_stateowner *sop, struct nfsd4_open *open) { +init_stateid(struct nfs4_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *open) { + struct nfs4_stateowner *sop = open->op_stateowner; unsigned int hashval = stateid_hashval(sop->so_id, fp->fi_id); INIT_LIST_HEAD(&stp->st_hash); @@ -1529,10 +1530,11 @@ out: } static int -nfs4_check_open(struct nfs4_file *fp, struct nfs4_stateowner *sop, struct nfsd4_open *open, struct nfs4_stateid **stpp) +nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_stateid **stpp) { struct nfs4_stateid *local; int status = nfserr_share_denied; + struct nfs4_stateowner *sop = open->op_stateowner; list_for_each_entry(local, &fp->fi_perfile, st_perfile) { /* ignore lock owners */ @@ -1692,7 +1694,6 @@ out: int nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open) { - struct nfs4_stateowner *sop = open->op_stateowner; struct nfs4_file *fp = NULL; struct inode *ino = current_fh->fh_dentry->d_inode; struct nfs4_stateid *stp = NULL; @@ -1708,7 +1709,7 @@ nfsd4_process_open2(struct svc_rqst *rqs */ fp = find_file(ino); if (fp) { - if ((status = nfs4_check_open(fp, sop, open, &stp))) + if ((status = nfs4_check_open(fp, open, &stp))) goto out; } else { status = nfserr_resource; @@ -1735,7 +1736,7 @@ nfsd4_process_open2(struct svc_rqst *rqs flags = MAY_READ; if ((status = nfs4_new_open(rqstp, &stp, current_fh, flags))) goto out; - init_stateid(stp, fp, sop, open); + init_stateid(stp, fp, open); if (open->op_truncate) { struct iattr iattr = { .ia_valid = ATTR_SIZE, _