Deleted Added
full compact
dmu_objset.h (207626) dmu_objset.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

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

37#ifdef __cplusplus
38extern "C" {
39#endif
40
41struct dsl_dataset;
42struct dmu_tx;
43struct objset_impl;
44
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

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

37#ifdef __cplusplus
38extern "C" {
39#endif
40
41struct dsl_dataset;
42struct dmu_tx;
43struct objset_impl;
44
45#define OBJSET_PHYS_SIZE 2048
46#define OBJSET_OLD_PHYS_SIZE 1024
47
48#define OBJSET_FLAG_USERACCOUNTING_COMPLETE (1ULL<<0)
49
45typedef struct objset_phys {
46 dnode_phys_t os_meta_dnode;
47 zil_header_t os_zil_header;
48 uint64_t os_type;
50typedef struct objset_phys {
51 dnode_phys_t os_meta_dnode;
52 zil_header_t os_zil_header;
53 uint64_t os_type;
49 char os_pad[1024 - sizeof (dnode_phys_t) - sizeof (zil_header_t) -
50 sizeof (uint64_t)];
54 uint64_t os_flags;
55 char os_pad[OBJSET_PHYS_SIZE - sizeof (dnode_phys_t)*3 -
56 sizeof (zil_header_t) - sizeof (uint64_t)*2];
57 dnode_phys_t os_userused_dnode;
58 dnode_phys_t os_groupused_dnode;
51} objset_phys_t;
52
53struct objset {
54 struct objset_impl *os;
55 int os_mode;
56};
57
58typedef struct objset_impl {
59 /* Immutable: */
60 struct dsl_dataset *os_dsl_dataset;
61 spa_t *os_spa;
62 arc_buf_t *os_phys_buf;
63 objset_phys_t *os_phys;
64 dnode_t *os_meta_dnode;
59} objset_phys_t;
60
61struct objset {
62 struct objset_impl *os;
63 int os_mode;
64};
65
66typedef struct objset_impl {
67 /* Immutable: */
68 struct dsl_dataset *os_dsl_dataset;
69 spa_t *os_spa;
70 arc_buf_t *os_phys_buf;
71 objset_phys_t *os_phys;
72 dnode_t *os_meta_dnode;
73 dnode_t *os_userused_dnode;
74 dnode_t *os_groupused_dnode;
65 zilog_t *os_zil;
66 objset_t os;
67 uint8_t os_checksum; /* can change, under dsl_dir's locks */
68 uint8_t os_compress; /* can change, under dsl_dir's locks */
69 uint8_t os_copies; /* can change, under dsl_dir's locks */
70 uint8_t os_primary_cache; /* can change, under dsl_dir's locks */
71 uint8_t os_secondary_cache; /* can change, under dsl_dir's locks */
72
73 /* no lock needed: */
74 struct dmu_tx *os_synctx; /* XXX sketchy */
75 blkptr_t *os_rootbp;
76 zil_header_t os_zil_header;
75 zilog_t *os_zil;
76 objset_t os;
77 uint8_t os_checksum; /* can change, under dsl_dir's locks */
78 uint8_t os_compress; /* can change, under dsl_dir's locks */
79 uint8_t os_copies; /* can change, under dsl_dir's locks */
80 uint8_t os_primary_cache; /* can change, under dsl_dir's locks */
81 uint8_t os_secondary_cache; /* can change, under dsl_dir's locks */
82
83 /* no lock needed: */
84 struct dmu_tx *os_synctx; /* XXX sketchy */
85 blkptr_t *os_rootbp;
86 zil_header_t os_zil_header;
87 list_t os_synced_dnodes;
88 uint64_t os_flags;
77
78 /* Protected by os_obj_lock */
79 kmutex_t os_obj_lock;
80 uint64_t os_obj_next;
81
82 /* Protected by os_lock */
83 kmutex_t os_lock;
84 list_t os_dirty_dnodes[TXG_SIZE];
85 list_t os_free_dnodes[TXG_SIZE];
86 list_t os_dnodes;
87 list_t os_downgraded_dbufs;
88
89 /* stuff we store for the user */
90 kmutex_t os_user_ptr_lock;
91 void *os_user_ptr;
92} objset_impl_t;
93
94#define DMU_META_DNODE_OBJECT 0
89
90 /* Protected by os_obj_lock */
91 kmutex_t os_obj_lock;
92 uint64_t os_obj_next;
93
94 /* Protected by os_lock */
95 kmutex_t os_lock;
96 list_t os_dirty_dnodes[TXG_SIZE];
97 list_t os_free_dnodes[TXG_SIZE];
98 list_t os_dnodes;
99 list_t os_downgraded_dbufs;
100
101 /* stuff we store for the user */
102 kmutex_t os_user_ptr_lock;
103 void *os_user_ptr;
104} objset_impl_t;
105
106#define DMU_META_DNODE_OBJECT 0
107#define DMU_OBJECT_IS_SPECIAL(obj) ((int64_t)(obj) <= 0)
95
96#define DMU_OS_IS_L2CACHEABLE(os) \
97 ((os)->os_secondary_cache == ZFS_CACHE_ALL || \
98 (os)->os_secondary_cache == ZFS_CACHE_METADATA)
99
100/* called from zpl */
101int dmu_objset_open(const char *name, dmu_objset_type_t type, int mode,
102 objset_t **osp);
103void dmu_objset_close(objset_t *os);
104int dmu_objset_create(const char *name, dmu_objset_type_t type,
105 objset_t *clone_parent, uint64_t flags,
106 void (*func)(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx), void *arg);
107int dmu_objset_destroy(const char *name);
108int dmu_objset_rollback(objset_t *os);
108
109#define DMU_OS_IS_L2CACHEABLE(os) \
110 ((os)->os_secondary_cache == ZFS_CACHE_ALL || \
111 (os)->os_secondary_cache == ZFS_CACHE_METADATA)
112
113/* called from zpl */
114int dmu_objset_open(const char *name, dmu_objset_type_t type, int mode,
115 objset_t **osp);
116void dmu_objset_close(objset_t *os);
117int dmu_objset_create(const char *name, dmu_objset_type_t type,
118 objset_t *clone_parent, uint64_t flags,
119 void (*func)(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx), void *arg);
120int dmu_objset_destroy(const char *name);
121int dmu_objset_rollback(objset_t *os);
109int dmu_objset_snapshot(char *fsname, char *snapname, boolean_t recursive);
122int dmu_objset_snapshot(char *fsname, char *snapname, nvlist_t *props,
123 boolean_t recursive);
110void dmu_objset_stats(objset_t *os, nvlist_t *nv);
111void dmu_objset_fast_stat(objset_t *os, dmu_objset_stats_t *stat);
112void dmu_objset_space(objset_t *os, uint64_t *refdbytesp, uint64_t *availbytesp,
113 uint64_t *usedobjsp, uint64_t *availobjsp);
114uint64_t dmu_objset_fsid_guid(objset_t *os);
115int dmu_objset_find(char *name, int func(char *, void *), void *arg,
116 int flags);
117int dmu_objset_find_spa(spa_t *spa, const char *name,

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

122
123/* called from dsl */
124void dmu_objset_sync(objset_impl_t *os, zio_t *zio, dmu_tx_t *tx);
125objset_impl_t *dmu_objset_create_impl(spa_t *spa, struct dsl_dataset *ds,
126 blkptr_t *bp, dmu_objset_type_t type, dmu_tx_t *tx);
127int dmu_objset_open_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp,
128 objset_impl_t **osip);
129void dmu_objset_evict(struct dsl_dataset *ds, void *arg);
124void dmu_objset_stats(objset_t *os, nvlist_t *nv);
125void dmu_objset_fast_stat(objset_t *os, dmu_objset_stats_t *stat);
126void dmu_objset_space(objset_t *os, uint64_t *refdbytesp, uint64_t *availbytesp,
127 uint64_t *usedobjsp, uint64_t *availobjsp);
128uint64_t dmu_objset_fsid_guid(objset_t *os);
129int dmu_objset_find(char *name, int func(char *, void *), void *arg,
130 int flags);
131int dmu_objset_find_spa(spa_t *spa, const char *name,

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

136
137/* called from dsl */
138void dmu_objset_sync(objset_impl_t *os, zio_t *zio, dmu_tx_t *tx);
139objset_impl_t *dmu_objset_create_impl(spa_t *spa, struct dsl_dataset *ds,
140 blkptr_t *bp, dmu_objset_type_t type, dmu_tx_t *tx);
141int dmu_objset_open_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp,
142 objset_impl_t **osip);
143void dmu_objset_evict(struct dsl_dataset *ds, void *arg);
144void dmu_objset_do_userquota_callbacks(objset_impl_t *os, dmu_tx_t *tx);
145boolean_t dmu_objset_userused_enabled(objset_impl_t *os);
146int dmu_objset_userspace_upgrade(objset_t *os);
147boolean_t dmu_objset_userspace_present(objset_t *os);
130
131#ifdef __cplusplus
132}
133#endif
134
135#endif /* _SYS_DMU_OBJSET_H */
148
149#ifdef __cplusplus
150}
151#endif
152
153#endif /* _SYS_DMU_OBJSET_H */