zfs_fuid.h revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * CDDL HEADER START
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * The contents of this file are subject to the terms of the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Common Development and Distribution License (the "License").
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * You may not use this file except in compliance with the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * See the License for the specific language governing permissions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * and limitations under the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * When distributing Covered Code, include this CDDL HEADER in each
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * If applicable, add the following below this CDDL HEADER, with the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * fields enclosed by brackets "[]" replaced with your own identifying
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * information: Portions Copyright [yyyy] [name of copyright owner]
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * CDDL HEADER END
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Use is subject to license terms.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#pragma ident "%Z%%M% %I% %E% SMI"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintypedef struct zfs_fuid_hdl {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintypedef enum {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * FUIDs cause problems for the intent log
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * we need to replay the creation of the FUID,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * but we can't count on the idmapper to be around
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * and during replay the FUID index may be different than
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * before. Also, if an ACL has 100 ACEs and 12 different
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * domains we don't want to log 100 domain strings, but rather
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * just the unique 12.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * The FUIDs in the log will index into
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * domain string table and the bottom half will be the rid.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Used for mapping ephemeral uid/gid during ACL setting to FUIDs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintypedef struct zfs_fuid {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* list of unique domains */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintypedef struct zfs_fuid_domain {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * FUID information necessary for logging create, setattr, and setacl.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintypedef struct zfs_fuid_info {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin size_t z_domain_str_sz; /* len of domain strings z_domain list */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void zfs_fuid_map_id(zfsvfs_t *, uint64_t, zfs_fuid_type_t, uid_t *);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern uint64_t zfs_fuid_create_cred(zfsvfs_t *, uint64_t, zfs_fuid_type_t,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern uint64_t zfs_fuid_create(zfsvfs_t *, uint64_t, zfs_fuid_type_t,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void zfs_fuid_queue_map_id(zfsvfs_t *zfsvfs, zfs_fuid_hdl_t *,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern void zfs_fuid_map_ids(struct znode *zp, uid_t *uid, uid_t *gid);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern char *zfs_fuid_find_by_idx(zfsvfs_t *, uint64_t);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinint zfs_fuid_find_by_domain(zfsvfs_t *, const char *, char **, dmu_tx_t *);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern boolean_t zfs_groupmember(zfsvfs_t *, uint64_t, cred_t *);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern "C" {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif /* _SYS_FS_ZFS_FUID_H */