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