5917 User-mode SMB server
[unleashed.git] / usr / src / lib / smbsrv / libfksmbsrv / common / fake_vnode.c
blob533a40fb2899a1608ef1fc47f7789a70c81e13b9
1 /*
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
5 * 1.0 of the CDDL.
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>
20 #include <sys/cred.h>
21 #include <sys/debug.h>
22 #include <sys/errno.h>
23 #include <sys/file.h>
24 #include <sys/kmem.h>
25 #include <sys/t_lock.h>
26 #include <sys/user.h>
27 #include <sys/uio.h>
28 #include <sys/pathname.h>
29 #include <sys/sysmacros.h>
30 #include <sys/vfs.h>
31 #include <sys/vnode.h>
33 #include <sys/acl.h>
34 #include <sys/nbmlock.h>
35 #include <sys/fcntl.h>
38 * Are vp1 and vp2 the same vnode?
40 int
41 vn_compare(vnode_t *vp1, vnode_t *vp2)
43 vnode_t *realvp;
45 if (vp1 != NULL && VOP_REALVP(vp1, &realvp, NULL) == 0)
46 vp1 = realvp;
47 if (vp2 != NULL && VOP_REALVP(vp2, &realvp, NULL) == 0)
48 vp2 = realvp;
49 return (VN_CMP(vp1, vp2));
52 /* ARGSUSED */
53 vfs_t *
54 vn_mountedvfs(vnode_t *vp)
56 return (NULL);
59 void
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.
73 xoptattr_t *
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;
79 return (xoap);