Deleted Added
full compact
zfs_fuid.h (185029) zfs_fuid.h (209962)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 5 unchanged lines hidden (view full) ---

14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 5 unchanged lines hidden (view full) ---

14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#ifndef _SYS_FS_ZFS_FUID_H
27#define _SYS_FS_ZFS_FUID_H
28
23 * Use is subject to license terms.
24 */
25
26#ifndef _SYS_FS_ZFS_FUID_H
27#define _SYS_FS_ZFS_FUID_H
28
29#pragma ident "%Z%%M% %I% %E% SMI"
30
31#include <sys/types.h>
32#ifdef _KERNEL
33#include <sys/kidmap.h>
34#include <sys/dmu.h>
35#include <sys/zfs_vfsops.h>
36#endif
37#include <sys/avl.h>
38

--- 7 unchanged lines hidden (view full) ---

46 ZFS_ACE_USER,
47 ZFS_ACE_GROUP
48} zfs_fuid_type_t;
49
50/*
51 * Estimate space needed for one more fuid table entry.
52 * for now assume its current size + 1K
53 */
29#include <sys/types.h>
30#ifdef _KERNEL
31#include <sys/kidmap.h>
32#include <sys/dmu.h>
33#include <sys/zfs_vfsops.h>
34#endif
35#include <sys/avl.h>
36

--- 7 unchanged lines hidden (view full) ---

44 ZFS_ACE_USER,
45 ZFS_ACE_GROUP
46} zfs_fuid_type_t;
47
48/*
49 * Estimate space needed for one more fuid table entry.
50 * for now assume its current size + 1K
51 */
54#define FUID_SIZE_ESTIMATE(z) (z->z_fuid_size + (SPA_MINBLOCKSIZE << 1))
52#define FUID_SIZE_ESTIMATE(z) ((z)->z_fuid_size + (SPA_MINBLOCKSIZE << 1))
55
53
56#define FUID_INDEX(x) (x >> 32)
57#define FUID_RID(x) (x & 0xffffffff)
58#define FUID_ENCODE(idx, rid) ((idx << 32) | rid)
54#define FUID_INDEX(x) ((x) >> 32)
55#define FUID_RID(x) ((x) & 0xffffffff)
56#define FUID_ENCODE(idx, rid) (((uint64_t)(idx) << 32) | (rid))
59/*
60 * FUIDs cause problems for the intent log
61 * we need to replay the creation of the FUID,
62 * but we can't count on the idmapper to be around
63 * and during replay the FUID index may be different than
64 * before. Also, if an ACL has 100 ACEs and 12 different
65 * domains we don't want to log 100 domain strings, but rather
66 * just the unique 12.

--- 32 unchanged lines hidden (view full) ---

99 size_t z_domain_str_sz; /* len of domain strings z_domain list */
100} zfs_fuid_info_t;
101
102#ifdef _KERNEL
103struct znode;
104extern uid_t zfs_fuid_map_id(zfsvfs_t *, uint64_t, cred_t *, zfs_fuid_type_t);
105extern void zfs_fuid_destroy(zfsvfs_t *);
106extern uint64_t zfs_fuid_create_cred(zfsvfs_t *, zfs_fuid_type_t,
57/*
58 * FUIDs cause problems for the intent log
59 * we need to replay the creation of the FUID,
60 * but we can't count on the idmapper to be around
61 * and during replay the FUID index may be different than
62 * before. Also, if an ACL has 100 ACEs and 12 different
63 * domains we don't want to log 100 domain strings, but rather
64 * just the unique 12.

--- 32 unchanged lines hidden (view full) ---

97 size_t z_domain_str_sz; /* len of domain strings z_domain list */
98} zfs_fuid_info_t;
99
100#ifdef _KERNEL
101struct znode;
102extern uid_t zfs_fuid_map_id(zfsvfs_t *, uint64_t, cred_t *, zfs_fuid_type_t);
103extern void zfs_fuid_destroy(zfsvfs_t *);
104extern uint64_t zfs_fuid_create_cred(zfsvfs_t *, zfs_fuid_type_t,
107 dmu_tx_t *, cred_t *, zfs_fuid_info_t **);
105 cred_t *, zfs_fuid_info_t **);
108extern uint64_t zfs_fuid_create(zfsvfs_t *, uint64_t, cred_t *, zfs_fuid_type_t,
106extern uint64_t zfs_fuid_create(zfsvfs_t *, uint64_t, cred_t *, zfs_fuid_type_t,
109 dmu_tx_t *, zfs_fuid_info_t **);
110extern void zfs_fuid_map_ids(struct znode *zp, cred_t *cr, uid_t *uid,
111 uid_t *gid);
107 zfs_fuid_info_t **);
108extern void zfs_fuid_map_ids(struct znode *zp, cred_t *cr,
109 uid_t *uid, uid_t *gid);
112extern zfs_fuid_info_t *zfs_fuid_info_alloc(void);
110extern zfs_fuid_info_t *zfs_fuid_info_alloc(void);
113extern void zfs_fuid_info_free();
111extern void zfs_fuid_info_free(zfs_fuid_info_t *);
114extern boolean_t zfs_groupmember(zfsvfs_t *, uint64_t, cred_t *);
112extern boolean_t zfs_groupmember(zfsvfs_t *, uint64_t, cred_t *);
113void zfs_fuid_sync(zfsvfs_t *, dmu_tx_t *);
114extern int zfs_fuid_find_by_domain(zfsvfs_t *, const char *domain,
115 char **retdomain, boolean_t addok);
116extern const char *zfs_fuid_find_by_idx(zfsvfs_t *zfsvfs, uint32_t idx);
117extern void zfs_fuid_txhold(zfsvfs_t *zfsvfs, dmu_tx_t *tx);
115#endif
116
117char *zfs_fuid_idx_domain(avl_tree_t *, uint32_t);
118#endif
119
120char *zfs_fuid_idx_domain(avl_tree_t *, uint32_t);
121void zfs_fuid_avl_tree_create(avl_tree_t *, avl_tree_t *);
118uint64_t zfs_fuid_table_load(objset_t *, uint64_t, avl_tree_t *, avl_tree_t *);
119void zfs_fuid_table_destroy(avl_tree_t *, avl_tree_t *);
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif /* _SYS_FS_ZFS_FUID_H */
122uint64_t zfs_fuid_table_load(objset_t *, uint64_t, avl_tree_t *, avl_tree_t *);
123void zfs_fuid_table_destroy(avl_tree_t *, avl_tree_t *);
124
125#ifdef __cplusplus
126}
127#endif
128
129#endif /* _SYS_FS_ZFS_FUID_H */