FreeBSD/sys/fs/nfsclient/nfs_clvnops.c
/*
 * Do an nfs setattr rpc.
 */
Do an nfs setattr rpc.
Do an nfs setattr rpc .
static int
nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred,
    struct thread *td)
{
	struct nfsnode *np = VTONFS(vp);
	int error, ret, attrflag, i;
	struct nfsvattr nfsva;
	if (NFS_ISV34(vp)) {
		mtx_lock(&np->n_mtx);
		for (i = 0; i < NFS_ACCESSCACHESIZE; i++)
			np->n_accesscache[i].stamp = 0;
		np->n_flag |= NDELEGMOD;
		mtx_unlock(&np->n_mtx);
		KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp);
	}
	error = nfsrpc_setattr(vp, vap, NULL, cred, td, &nfsva, &attrflag,
	    NULL);
	if (attrflag) {
		ret = nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1);
		if (ret && !error)
			error = ret;
	}
	if (error && NFS_ISV4(vp))
		error = nfscl_maperr(td, error, vap->va_uid, vap->va_gid);
	return (error);
}
static int nfs_setattrrpc ( struct vnode * vp , struct vattr * vap , struct ucred * cred , struct thread * td ) { struct nfsnode * np = VTONFS ( vp ) ; int error , ret , attrflag , i ; struct nfsvattr nfsva ; if ( NFS_ISV34 ( vp ) ) { mtx_lock ( & np -> n_mtx ) ; for ( i = 0 ; i < NFS_ACCESSCACHESIZE ; i ++ ) np -> n_accesscache [ i ] . stamp = 0 ; np -> n_flag |= NDELEGMOD ; mtx_unlock ( & np -> n_mtx ) ; KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE ( vp ) ; } error = nfsrpc_setattr ( vp , vap , NULL , cred , td , & nfsva , & attrflag , NULL ) ; if ( attrflag ) { ret = nfscl_loadattrcache ( & vp , & nfsva , NULL , NULL , 0 , 1 ) ; if ( ret && ! error ) error = ret ; } if ( error && NFS_ISV4 ( vp ) ) error = nfscl_maperr ( td , error , vap -> va_uid , vap -> va_gid ) ; return ( error ) ; }
Do an nfs setattr rpc.
Do an nfs setattr rpc .