FreeBSD/sys/fs/nfsclient/nfs_clvnops.c
/*
 * NFS advisory byte-level locks.
 */
NFS advisory byte-level locks.
NFS advisory byte - level locks .
static int
nfs_advlockasync(struct vop_advlockasync_args *ap)
{
	struct vnode *vp = ap->a_vp;
	u_quad_t size;
	int error;
	if (NFS_ISV4(vp))
		return (EOPNOTSUPP);
	error = NFSVOPLOCK(vp, LK_SHARED);
	if (error)
		return (error);
	if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) {
		size = VTONFS(vp)->n_size;
		NFSVOPUNLOCK(vp, 0);
		error = lf_advlockasync(ap, &(vp->v_lockf), size);
	} else {
		NFSVOPUNLOCK(vp, 0);
		error = EOPNOTSUPP;
	}
	return (error);
}
static int nfs_advlockasync ( struct vop_advlockasync_args * ap ) { struct vnode * vp = ap -> a_vp ; u_quad_t size ; int error ; if ( NFS_ISV4 ( vp ) ) return ( EOPNOTSUPP ) ; error = NFSVOPLOCK ( vp , LK_SHARED ) ; if ( error ) return ( error ) ; if ( ( VFSTONFS ( vp -> v_mount ) -> nm_flag & NFSMNT_NOLOCKD ) != 0 ) { size = VTONFS ( vp ) -> n_size ; NFSVOPUNLOCK ( vp , 0 ) ; error = lf_advlockasync ( ap , & ( vp -> v_lockf ) , size ) ; } else { NFSVOPUNLOCK ( vp , 0 ) ; error = EOPNOTSUPP ; } return ( error ) ; }
NFS advisory byte-level locks.
NFS advisory byte - level locks .