/* XXX Ugh, we need to get rid of this kind of special case: */ if (op->opnum == OP_READ && op->u.read.rd_filp) fput(op->u.read.rd_filp); 
nfsd4_proc_compound(struct svc_rqst *rqstp,		    struct nfsd4_compoundargs *args,		    struct nfsd4_compoundres *resp){	struct nfsd4_op	*op;	struct svc_fh	*current_fh = NULL;	struct svc_fh	*save_fh = NULL;	struct nfs4_stateowner *replay_owner = NULL;	int		slack_space;    /* in words, not bytes! */	int		status;	status = nfserr_resource;	current_fh = kmalloc(sizeof(*current_fh), GFP_KERNEL);	if (current_fh == NULL)		goto out;	fh_init(current_fh, NFS4_FHSIZE);	save_fh = kmalloc(sizeof(*save_fh), GFP_KERNEL);	if (save_fh == NULL)		goto out;	fh_init(save_fh, NFS4_FHSIZE);	resp->xbuf = &rqstp->rq_res;	resp->p = rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len;	resp->tagp = resp->p;	/* reserve space for: taglen, tag, and opcnt */	resp->p += 2 + XDR_QUADLEN(args->taglen);	resp->end = rqstp->rq_res.head[0].iov_base + PAGE_SIZE;	resp->taglen = args->taglen;	resp->tag = args->tag;	resp->opcnt = 0;	resp->rqstp = rqstp;	/*	 * According to RFC3010, this takes precedence over all other errors.	 */	status = nfserr_minor_vers_mismatch;	if (args->minorversion > NFSD_SUPPORTED_MINOR_VERSION)		goto out;	status = nfs_ok;	while (!status && resp->opcnt < args->opcnt) {		op = &args->ops[resp->opcnt++];		/*		 * The XDR decode routines may have pre-set op->status;		 * for example, if there is a miscellaneous XDR error		 * it will be set to nfserr_bad_xdr.		 */		if (op->status)			goto encode_op;		/* We must be able to encode a successful response to		 * this operation, with enough room left over to encode a		 * failed response to the next operation.  If we don't		 * have enough room, fail with ERR_RESOURCE.		 *//* FIXME - is slack_space *really* words, or bytes??? - neilb */		slack_space = (char *)resp->end - (char *)resp->p;		if (slack_space < COMPOUND_SLACK_SPACE + COMPOUND_ERR_SLACK_SPACE) {			BUG_ON(slack_space < COMPOUND_ERR_SLACK_SPACE);			op->status = nfserr_resource;			goto encode_op;		}		/* All operations except RENEW, SETCLIENTID, RESTOREFH		* SETCLIENTID_CONFIRM, PUTFH and PUTROOTFH		* require a valid current filehandle		*		* SETATTR NOFILEHANDLE error handled in nfsd4_setattr		* due to required returned bitmap argument		*/		if ((!current_fh->fh_dentry) &&		   !((op->opnum == OP_PUTFH) || (op->opnum == OP_PUTROOTFH) ||		   (op->opnum == OP_SETCLIENTID) ||		   (op->opnum == OP_SETCLIENTID_CONFIRM) ||		   (op->opnum == OP_RENEW) || (op->opnum == OP_RESTOREFH) ||		   (op->opnum == OP_RELEASE_LOCKOWNER) ||		   (op->opnum == OP_SETATTR))) {			op->status = nfserr_nofilehandle;			goto encode_op;		}		switch (op->opnum) {		case OP_ACCESS:			op->status = nfsd4_access(rqstp, current_fh, &op->u.access);			break;		case OP_CLOSE:			op->status = nfsd4_close(rqstp, current_fh, &op->u.close);			replay_owner = op->u.close.cl_stateowner;			break;		case OP_COMMIT:			op->status = nfsd4_commit(rqstp, current_fh, &op->u.commit);			break;		case OP_CREATE:			op->status = nfsd4_create(rqstp, current_fh, &op->u.create);			break;		case OP_DELEGRETURN:			op->status = nfsd4_delegreturn(rqstp, current_fh, &op->u.delegreturn);			break;		case OP_GETATTR:			op->status = nfsd4_getattr(rqstp, current_fh, &op->u.getattr);			break;		case OP_GETFH:			op->status = nfsd4_getfh(current_fh, &op->u.getfh);			break;		case OP_LINK:			op->status = nfsd4_link(rqstp, current_fh, save_fh, &op->u.link);			break;		case OP_LOCK:			op->status = nfsd4_lock(rqstp, current_fh, &op->u.lock);			replay_owner = op->u.lock.lk_stateowner;			break;		case OP_LOCKT:			op->status = nfsd4_lockt(rqstp, current_fh, &op->u.lockt);			break;		case OP_LOCKU:			op->status = nfsd4_locku(rqstp, current_fh, &op->u.locku);			replay_owner = op->u.locku.lu_stateowner;			break;		case OP_LOOKUP:			op->status = nfsd4_lookup(rqstp, current_fh, &op->u.lookup);			break;		case OP_LOOKUPP:			op->status = nfsd4_lookupp(rqstp, current_fh);			break;		case OP_NVERIFY:			op->status = nfsd4_verify(rqstp, current_fh, &op->u.nverify);			if (op->status == nfserr_not_same)				op->status = nfs_ok;			break;		case OP_OPEN:			op->status = nfsd4_open(rqstp, current_fh, &op->u.open);			replay_owner = op->u.open.op_stateowner;			break;		case OP_OPEN_CONFIRM:			op->status = nfsd4_open_confirm(rqstp, current_fh, &op->u.open_confirm);			replay_owner = op->u.open_confirm.oc_stateowner;			break;		case OP_OPEN_DOWNGRADE:			op->status = nfsd4_open_downgrade(rqstp, current_fh, &op->u.open_downgrade);			replay_owner = op->u.open_downgrade.od_stateowner;			break;		case OP_PUTFH:			op->status = nfsd4_putfh(rqstp, current_fh, &op->u.putfh);			break;		case OP_PUTROOTFH:			op->status = nfsd4_putrootfh(rqstp, current_fh);			break;		case OP_READ:			op->status = nfsd4_read(rqstp, current_fh, &op->u.read);			break;		case OP_READDIR:			op->status = nfsd4_readdir(rqstp, current_fh, &op->u.readdir);			break;		case OP_READLINK:			op->status = nfsd4_readlink(rqstp, current_fh, &op->u.readlink);			break;		case OP_REMOVE:			op->status = nfsd4_remove(rqstp, current_fh, &op->u.remove);			break;		case OP_RENAME:			op->status = nfsd4_rename(rqstp, current_fh, save_fh, &op->u.rename);			break;		case OP_RENEW:			op->status = nfsd4_renew(&op->u.renew);			break;		case OP_RESTOREFH:			op->status = nfsd4_restorefh(current_fh, save_fh);			break;		case OP_SAVEFH:			op->status = nfsd4_savefh(current_fh, save_fh);			break;		case OP_SETATTR:			op->status = nfsd4_setattr(rqstp, current_fh, &op->u.setattr);			break;		case OP_SETCLIENTID:			op->status = nfsd4_setclientid(rqstp, &op->u.setclientid);			break;		case OP_SETCLIENTID_CONFIRM:			op->status = nfsd4_setclientid_confirm(rqstp, &op->u.setclientid_confirm);			break;		case OP_VERIFY:			op->status = nfsd4_verify(rqstp, current_fh, &op->u.verify);			if (op->status == nfserr_same)				op->status = nfs_ok;			break;		case OP_WRITE:			op->status = nfsd4_write(rqstp, current_fh, &op->u.write);			break;		case OP_RELEASE_LOCKOWNER:			op->status = nfsd4_release_lockowner(rqstp, &op->u.release_lockowner);			break;		default:			BUG_ON(op->status == nfs_ok);			break;		}encode_op:		if (op->status == NFSERR_REPLAY_ME) {			op->replay = &replay_owner->so_replay;			nfsd4_encode_replay(resp, op);			status = op->status = op->replay->rp_status;		} else {			nfsd4_encode_operation(resp, op);			status = op->status;		}		if (replay_owner && (replay_owner != (void *)(-1))) {			nfs4_put_stateowner(replay_owner);			replay_owner = NULL;		}	}out:	nfsd4_release_compoundargs(args);	if (current_fh)		fh_put(current_fh);	kfree(current_fh);	if (save_fh)		fh_put(save_fh);	kfree(save_fh);	return status;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7e06b7f9e9537cb826f3cff95816fc4384b67806/nfs4proc.c/clean/fs/nfsd/nfs4proc.c