FreeBSD/sys/fs/nfsserver/nfs_nfsdport.c
/*
 * Get attributes into nfsvattr structure.
 */
Get attributes into nfsvattr structure.
Get attributes into nfsvattr structure .
int
nfsvno_getattr(struct vnode *vp, struct nfsvattr *nvap, struct ucred *cred,
    struct thread *p, int vpislocked)
{
	int error, lockedit = 0;
	if (vpislocked == 0) {
		if (NFSVOPISLOCKED(vp) != LK_EXCLUSIVE) {
			lockedit = 1;
			NFSVOPLOCK(vp, LK_SHARED | LK_RETRY);
		}
	}
	error = VOP_GETATTR(vp, &nvap->na_vattr, cred);
	if (lockedit != 0)
		NFSVOPUNLOCK(vp, 0);
	NFSEXITCODE(error);
	return (error);
}
int nfsvno_getattr ( struct vnode * vp , struct nfsvattr * nvap , struct ucred * cred , struct thread * p , int vpislocked ) { int error , lockedit = 0 ; if ( vpislocked == 0 ) { if ( NFSVOPISLOCKED ( vp ) != LK_EXCLUSIVE ) { lockedit = 1 ; NFSVOPLOCK ( vp , LK_SHARED | LK_RETRY ) ; } } error = VOP_GETATTR ( vp , & nvap -> na_vattr , cred ) ; if ( lockedit != 0 ) NFSVOPUNLOCK ( vp , 0 ) ; NFSEXITCODE ( error ) ; return ( error ) ; }
Get attributes into nfsvattr structure.
Get attributes into nfsvattr structure .
/*
		 * When vpislocked == 0, the vnode is either exclusively
		 * locked by this thread or not locked by this thread.
		 * As such, shared lock it, if not exclusively locked.
		 */