FreeBSD/sys/fs/nfsclient/nfs_clvnops.c
/*
 * Do an nfs rename rpc. Called from nfs_rename() and nfs_renameit().
 */
Do an nfs rename rpc.
Do an nfs rename rpc .
static int
nfs_renamerpc(struct vnode *fdvp, struct vnode *fvp, char *fnameptr,
    int fnamelen, struct vnode *tdvp, struct vnode *tvp, char *tnameptr,
    int tnamelen, struct ucred *cred, struct thread *td)
{
	struct nfsvattr fnfsva, tnfsva;
	struct nfsnode *fdnp = VTONFS(fdvp);
	struct nfsnode *tdnp = VTONFS(tdvp);
	int error = 0, fattrflag, tattrflag;
	error = nfsrpc_rename(fdvp, fvp, fnameptr, fnamelen, tdvp, tvp,
	    tnameptr, tnamelen, cred, td, &fnfsva, &tnfsva, &fattrflag,
	    &tattrflag, NULL, NULL);
	mtx_lock(&fdnp->n_mtx);
	fdnp->n_flag |= NMODIFIED;
	if (fattrflag != 0) {
		mtx_unlock(&fdnp->n_mtx);
		(void) nfscl_loadattrcache(&fdvp, &fnfsva, NULL, NULL, 0, 1);
	} else {
		fdnp->n_attrstamp = 0;
		mtx_unlock(&fdnp->n_mtx);
		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(fdvp);
	}
	mtx_lock(&tdnp->n_mtx);
	tdnp->n_flag |= NMODIFIED;
	if (tattrflag != 0) {
		mtx_unlock(&tdnp->n_mtx);
		(void) nfscl_loadattrcache(&tdvp, &tnfsva, NULL, NULL, 0, 1);
	} else {
		tdnp->n_attrstamp = 0;
		mtx_unlock(&tdnp->n_mtx);
		KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(tdvp);
	}
	if (error && NFS_ISV4(fdvp))
		error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0);
	return (error);
}
static int nfs_renamerpc ( struct vnode * fdvp , struct vnode * fvp , char * fnameptr , int fnamelen , struct vnode * tdvp , struct vnode * tvp , char * tnameptr , int tnamelen , struct ucred * cred , struct thread * td ) { struct nfsvattr fnfsva , tnfsva ; struct nfsnode * fdnp = VTONFS ( fdvp ) ; struct nfsnode * tdnp = VTONFS ( tdvp ) ; int error = 0 , fattrflag , tattrflag ; error = nfsrpc_rename ( fdvp , fvp , fnameptr , fnamelen , tdvp , tvp , tnameptr , tnamelen , cred , td , & fnfsva , & tnfsva , & fattrflag , & tattrflag , NULL , NULL ) ; mtx_lock ( & fdnp -> n_mtx ) ; fdnp -> n_flag |= NMODIFIED ; if ( fattrflag != 0 ) { mtx_unlock ( & fdnp -> n_mtx ) ; ( void ) nfscl_loadattrcache ( & fdvp , & fnfsva , NULL , NULL , 0 , 1 ) ; } else { fdnp -> n_attrstamp = 0 ; mtx_unlock ( & fdnp -> n_mtx ) ; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE ( fdvp ) ; } mtx_lock ( & tdnp -> n_mtx ) ; tdnp -> n_flag |= NMODIFIED ; if ( tattrflag != 0 ) { mtx_unlock ( & tdnp -> n_mtx ) ; ( void ) nfscl_loadattrcache ( & tdvp , & tnfsva , NULL , NULL , 0 , 1 ) ; } else { tdnp -> n_attrstamp = 0 ; mtx_unlock ( & tdnp -> n_mtx ) ; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE ( tdvp ) ; } if ( error && NFS_ISV4 ( fdvp ) ) error = nfscl_maperr ( td , error , ( uid_t ) 0 , ( gid_t ) 0 ) ; return ( error ) ; }
Do an nfs rename rpc.
Do an nfs rename rpc .