Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / cddl / osnet / sys / kern / zfs_stub.c
blob5b5443c83e8a6bec2525203b1d6d9525b9342830
1 #include <sys/zfs_context.h>
2 #include <sys/zfs_ctldir.h>
5 /* zfs_ctldir.c stub routtines */
7 void
8 zfsctl_init(void)
12 void
13 zfsctl_fini(void)
17 vnode_t *
18 zfsctl_root(znode_t *znode)
21 return NULL;
24 int
25 zfsctl_root_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, pathname_t *pnp,
26 int flags, vnode_t *rdir, cred_t *cr, caller_context_t *ct,
27 int *direntflags, pathname_t *realpnp)
30 return ENOENT;
33 void
34 zfsctl_create(zfsvfs_t *zfsvfs)
37 return;
40 void
41 zfsctl_destroy(zfsvfs_t *zfsvfs)
44 return;
47 int
48 zfsctl_lookup_objset(vfs_t *vfsp, uint64_t objsetid, zfsvfs_t **zfsvfsp)
51 return EINVAL;
54 int
55 zfsctl_umount_snapshots(vfs_t *vfsp, int fflags, cred_t *cr)
58 return 0;
61 /* zfs_acl.c */
62 #if 0
64 * Convert unix access mask to v4 access mask
66 static uint32_t
67 zfs_unix_to_v4(uint32_t access_mask)
69 uint32_t new_mask = 0;
71 /* if (access_mask & S_IXOTH)
72 new_mask |= ACE_EXECUTE;
73 if (access_mask & S_IWOTH)
74 new_mask |= ACE_WRITE_DATA;
75 if (access_mask & S_IROTH)
76 new_mask |= ACE_READ_DATA;*/
77 return (new_mask);
80 int
81 zfs_zaccess_rename(znode_t *sdzp, znode_t *szp, znode_t *tdzp,
82 znode_t *tzp, cred_t *cr)
85 return 0;
88 int
89 zfs_setacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr)
92 return ENOTSUP;
95 int
96 zfs_getacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr)
99 return ENOTSUP;
103 zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t *cr,
104 zfs_fuid_info_t **fuidp, dmu_tx_t *tx)
107 return 0;
111 zfs_zaccess_rwx(znode_t *zp, mode_t mode, int flags, cred_t *cr)
113 return (zfs_zaccess(zp, zfs_unix_to_v4(mode >> 6), flags, B_FALSE, cr));
117 zfs_zaccess_unix(znode_t *zp, mode_t mode, cred_t *cr)
119 int v4_mode = zfs_unix_to_v4((uint32_t)mode >> 6);
121 return (zfs_zaccess(zp, v4_mode, 0, B_FALSE, cr));
125 zfs_zaccess_delete(znode_t *dzp, znode_t *zp, cred_t *cr)
128 return 0;
131 void
132 zfs_perm_init(znode_t *zp, znode_t *parent, int flag,
133 vattr_t *vap, dmu_tx_t *tx, cred_t *cr,
134 zfs_acl_t *setaclp, zfs_fuid_info_t **fuidp)
137 return;
140 void
141 zfs_acl_free(zfs_acl_t *aclp)
144 kmem_free(aclp, sizeof(zfs_acl_t));
145 return;
149 zfs_zaccess(znode_t *zp, int mode, int flags, boolean_t skipaclchk, cred_t *cr)
152 /* return ok or EACCES here ? */
153 return 0;
157 zfs_vsec_2_aclp(zfsvfs_t *zfsvfs, vtype_t obj_type,
158 vsecattr_t *vsecp, zfs_acl_t **zaclp)
160 zfs_acl_t *aclp;
161 *zaclp = NULL;
163 aclp = kmem_zalloc(sizeof (zfs_acl_t), KM_SLEEP);
165 *zaclp = aclp;
167 return 0;
171 zfs_acl_chmod_setattr(znode_t *zp, zfs_acl_t **aclp, uint64_t mode)
173 int error;
174 error = 0;
176 *aclp = kmem_zalloc(sizeof (zfs_acl_t), KM_SLEEP);;
178 return (error);
180 #endif /* 0 */