FreeBSD/sys/fs/nfsclient/nfs_clvnops.c
/*
 * Nfs Version 3 and 4 commit rpc
 */
Nfs Version 3 and 4 commit rpc
Nfs Version 3 and 4 commit rpc
int
ncl_commit(struct vnode *vp, u_quad_t offset, int cnt, struct ucred *cred,
   struct thread *td)
{
	struct nfsvattr nfsva;
	struct nfsmount *nmp = VFSTONFS(vp->v_mount);
	int error, attrflag;
	mtx_lock(&nmp->nm_mtx);
	if ((nmp->nm_state & NFSSTA_HASWRITEVERF) == 0) {
		mtx_unlock(&nmp->nm_mtx);
		return (0);
	}
	mtx_unlock(&nmp->nm_mtx);
	error = nfsrpc_commit(vp, offset, cnt, cred, td, &nfsva,
	    &attrflag, NULL);
	if (attrflag != 0)
		(void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL,
		    0, 1);
	if (error != 0 && NFS_ISV4(vp))
		error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0);
	return (error);
}
int ncl_commit ( struct vnode * vp , u_quad_t offset , int cnt , struct ucred * cred , struct thread * td ) { struct nfsvattr nfsva ; struct nfsmount * nmp = VFSTONFS ( vp -> v_mount ) ; int error , attrflag ; mtx_lock ( & nmp -> nm_mtx ) ; if ( ( nmp -> nm_state & NFSSTA_HASWRITEVERF ) == 0 ) { mtx_unlock ( & nmp -> nm_mtx ) ; return ( 0 ) ; } mtx_unlock ( & nmp -> nm_mtx ) ; error = nfsrpc_commit ( vp , offset , cnt , cred , td , & nfsva , & attrflag , NULL ) ; if ( attrflag != 0 ) ( void ) nfscl_loadattrcache ( & vp , & nfsva , NULL , NULL , 0 , 1 ) ; if ( error != 0 && NFS_ISV4 ( vp ) ) error = nfscl_maperr ( td , error , ( uid_t ) 0 , ( gid_t ) 0 ) ; return ( error ) ; }
Nfs Version 3 and 4 commit rpc
Nfs Version 3 and 4 commit rpc