nfsstats.rpccnt[NFSPROC_RENAME]++; nfsm_reqhead(fdvp, NFSPROC_RENAME, (NFSX_FH+NFSX_UNSIGNED)*2+nfsm_rndup(fcnp->cn_namelen)+ nfsm_rndup(fcnp->cn_namelen));  nfsm_fhtom(fdvp); nfsm_strtom(fcnp->cn_nameptr, fcnp->cn_namelen, NFS_MAXNAMLEN); nfsm_fhtom(tdvp); nfsm_strtom(tcnp->cn_nameptr, tcnp->cn_namelen, NFS_MAXNAMLEN); nfsm_request(fdvp, NFSPROC_RENAME, tcnp->cn_proc, tcnp->cn_cred); nfsm_reqdone; VTONFS(fdvp)->n_flag |= NMODIFIED; VTONFS(fdvp)->n_attrstamp = 0; VTONFS(tdvp)->n_flag |= NMODIFIED; VTONFS(tdvp)->n_attrstamp = 0;
error = nfs_renamerpc(fdvp, fcnp->cn_nameptr, fcnp->cn_namelen, tdvp, tcnp->cn_nameptr, tcnp->cn_namelen, tcnp->cn_cred, tcnp->cn_proc);
nfs_rename(v)	void *v;{	struct vop_rename_args  /* {		struct vnode *a_fdvp;		struct vnode *a_fvp;		struct componentname *a_fcnp;		struct vnode *a_tdvp;		struct vnode *a_tvp;		struct componentname *a_tcnp;	} */ *ap = v;	register struct vnode *fvp = ap->a_fvp;	register struct vnode *tvp = ap->a_tvp;	register struct vnode *fdvp = ap->a_fdvp;	register struct vnode *tdvp = ap->a_tdvp;	register struct componentname *tcnp = ap->a_tcnp;	register struct componentname *fcnp = ap->a_fcnp;	register u_int32_t *tl;	register caddr_t cp;	register int32_t t2;	caddr_t bpos, dpos;	int error = 0;	struct mbuf *mreq, *mrep, *md, *mb, *mb2;	/* Check for cross-device rename */	if ((fvp->v_mount != tdvp->v_mount) ||	    (tvp && (fvp->v_mount != tvp->v_mount))) {		error = EXDEV;		goto out;	}	nfsstats.rpccnt[NFSPROC_RENAME]++;	nfsm_reqhead(fdvp, NFSPROC_RENAME,		(NFSX_FH+NFSX_UNSIGNED)*2+nfsm_rndup(fcnp->cn_namelen)+		nfsm_rndup(fcnp->cn_namelen)); /* or fcnp->cn_cred?*/	nfsm_fhtom(fdvp);	nfsm_strtom(fcnp->cn_nameptr, fcnp->cn_namelen, NFS_MAXNAMLEN);	nfsm_fhtom(tdvp);	nfsm_strtom(tcnp->cn_nameptr, tcnp->cn_namelen, NFS_MAXNAMLEN);	nfsm_request(fdvp, NFSPROC_RENAME, tcnp->cn_proc, tcnp->cn_cred);	nfsm_reqdone;	VTONFS(fdvp)->n_flag |= NMODIFIED;	VTONFS(fdvp)->n_attrstamp = 0;	VTONFS(tdvp)->n_flag |= NMODIFIED;	VTONFS(tdvp)->n_attrstamp = 0;	if (fvp->v_type == VDIR) {		if (tvp != NULL && tvp->v_type == VDIR)			cache_purge(tdvp);		cache_purge(fdvp);	}out:	if (tdvp == tvp)		vrele(tdvp);	else		vput(tdvp);	if (tvp)		vput(tvp);	vrele(fdvp);	vrele(fvp);	/*	 * Kludge: Map ENOENT => 0 assuming that it is a reply to a retry.	 */	if (error == ENOENT)		error = 0;	return (error);}