2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
16 #include <sys/types.h>
17 #include <sys/param.h>
18 #include <sys/systm.h>
19 #include <sys/cmn_err.h>
21 #include <sys/debug.h>
22 #include <sys/errno.h>
25 #include <sys/t_lock.h>
28 #include <sys/pathname.h>
29 #include <sys/sysmacros.h>
31 #include <sys/vnode.h>
34 #include <sys/nbmlock.h>
35 #include <sys/fcntl.h>
38 * Are vp1 and vp2 the same vnode?
41 vn_compare(vnode_t
*vp1
, vnode_t
*vp2
)
45 if (vp1
!= NULL
&& VOP_REALVP(vp1
, &realvp
, NULL
) == 0)
47 if (vp2
!= NULL
&& VOP_REALVP(vp2
, &realvp
, NULL
) == 0)
49 return (VN_CMP(vp1
, vp2
));
54 vn_mountedvfs(vnode_t
*vp
)
60 xva_init(xvattr_t
*xvap
)
62 bzero(xvap
, sizeof (xvattr_t
));
63 xvap
->xva_mapsize
= XVA_MAPSIZE
;
64 xvap
->xva_magic
= XVA_MAGIC
;
65 xvap
->xva_vattr
.va_mask
= AT_XVATTR
;
66 xvap
->xva_rtnattrmapp
= &(xvap
->xva_rtnattrmap
)[0];
70 * If AT_XVATTR is set, returns a pointer to the embedded xoptattr_t
71 * structure. Otherwise, returns NULL.
74 xva_getxoptattr(xvattr_t
*xvap
)
76 xoptattr_t
*xoap
= NULL
;
77 if (xvap
->xva_vattr
.va_mask
& AT_XVATTR
)
78 xoap
= &xvap
->xva_xoptattrs
;