1 #include <sys/zfs_context.h>
2 #include <sys/zfs_ctldir.h>
5 /* zfs_ctldir.c stub routtines */
18 zfsctl_root(znode_t
*znode
)
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
)
34 zfsctl_create(zfsvfs_t
*zfsvfs
)
41 zfsctl_destroy(zfsvfs_t
*zfsvfs
)
48 zfsctl_lookup_objset(vfs_t
*vfsp
, uint64_t objsetid
, zfsvfs_t
**zfsvfsp
)
55 zfsctl_umount_snapshots(vfs_t
*vfsp
, int fflags
, cred_t
*cr
)
64 * Convert unix access mask to v4 access mask
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;*/
81 zfs_zaccess_rename(znode_t
*sdzp
, znode_t
*szp
, znode_t
*tdzp
,
82 znode_t
*tzp
, cred_t
*cr
)
89 zfs_setacl(znode_t
*zp
, vsecattr_t
*vsecp
, boolean_t skipaclchk
, cred_t
*cr
)
96 zfs_getacl(znode_t
*zp
, vsecattr_t
*vsecp
, boolean_t skipaclchk
, cred_t
*cr
)
103 zfs_aclset_common(znode_t
*zp
, zfs_acl_t
*aclp
, cred_t
*cr
,
104 zfs_fuid_info_t
**fuidp
, dmu_tx_t
*tx
)
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
)
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
)
141 zfs_acl_free(zfs_acl_t
*aclp
)
144 kmem_free(aclp
, sizeof(zfs_acl_t
));
149 zfs_zaccess(znode_t
*zp
, int mode
, int flags
, boolean_t skipaclchk
, cred_t
*cr
)
152 /* return ok or EACCES here ? */
157 zfs_vsec_2_aclp(zfsvfs_t
*zfsvfs
, vtype_t obj_type
,
158 vsecattr_t
*vsecp
, zfs_acl_t
**zaclp
)
163 aclp
= kmem_zalloc(sizeof (zfs_acl_t
), KM_SLEEP
);
171 zfs_acl_chmod_setattr(znode_t
*zp
, zfs_acl_t
**aclp
, uint64_t mode
)
176 *aclp
= kmem_zalloc(sizeof (zfs_acl_t
), KM_SLEEP
);;