if (waitfor == MNT_LAZY || (LIST_EMPTY(&vp->v_dirtyblkhd) && vp->v_uobj.uo_npages == 0))
if (VOP_ISLOCKED(vp) || vp->v_dirtyblkhd.lh_first == NULL || waitfor == MNT_LAZY)
nfs_sync(mp, waitfor, cred, p)	struct mount *mp;	int waitfor;	struct ucred *cred;	struct proc *p;{	register struct vnode *vp;	int error, allerror = 0;	/*	 * Force stale buffer cache information to be flushed.	 */loop:	for (vp = mp->mnt_vnodelist.lh_first;	     vp != NULL;	     vp = vp->v_mntvnodes.le_next) {		/*		 * If the vnode that we are about to sync is no longer		 * associated with this mount point, start over.		 */		if (vp->v_mount != mp)			goto loop;		if (waitfor == MNT_LAZY ||		    (LIST_EMPTY(&vp->v_dirtyblkhd) &&		     vp->v_uobj.uo_npages == 0))			continue;		if (vget(vp, LK_EXCLUSIVE, p))			goto loop;		error = VOP_FSYNC(vp, cred, waitfor, p);		if (error)			allerror = error;		vput(vp);	}	return (allerror);}