128 uint8_t dn_checksum; /* ZIO_CHECKSUM type */
129 uint8_t dn_compress; /* ZIO_COMPRESS type */
130 uint8_t dn_flags; /* DNODE_FLAG_* */
131 uint16_t dn_datablkszsec; /* data block size in 512b sectors */
132 uint16_t dn_bonuslen; /* length of dn_bonus */
133 uint8_t dn_pad2[4];
134
135 /* accounting is protected by dn_dirty_mtx */
136 uint64_t dn_maxblkid; /* largest allocated block ID */
137 uint64_t dn_used; /* bytes (or sectors) of disk space */
138
139 uint64_t dn_pad3[4];
140
141 blkptr_t dn_blkptr[1];
142 uint8_t dn_bonus[DN_MAX_BONUSLEN - sizeof (blkptr_t)];
143 blkptr_t dn_spill;
144 } dnode_phys_t;
145
146 typedef struct dnode {
147 /*
148 * dn_struct_rwlock protects the structure of the dnode,
149 * including the number of levels of indirection (dn_nlevels),
150 * dn_maxblkid, and dn_next_*
151 */
152 krwlock_t dn_struct_rwlock;
153
154 /* Our link on dn_objset->os_dnodes list; protected by os_lock. */
155 list_node_t dn_link;
156
157 /* immutable: */
158 struct objset *dn_objset;
159 uint64_t dn_object;
160 struct dmu_buf_impl *dn_dbuf;
161 struct dnode_handle *dn_handle;
162 dnode_phys_t *dn_phys; /* pointer into dn->dn_dbuf->db.db_data */
163
164 /*
165 * Copies of stuff in dn_phys. They're valid in the open
166 * context (eg. even before the dnode is first synced).
167 * Where necessary, these are protected by dn_struct_rwlock.
168 */
169 dmu_object_type_t dn_type; /* object type */
170 uint16_t dn_bonuslen; /* bonus length */
|
128 uint8_t dn_checksum; /* ZIO_CHECKSUM type */
129 uint8_t dn_compress; /* ZIO_COMPRESS type */
130 uint8_t dn_flags; /* DNODE_FLAG_* */
131 uint16_t dn_datablkszsec; /* data block size in 512b sectors */
132 uint16_t dn_bonuslen; /* length of dn_bonus */
133 uint8_t dn_pad2[4];
134
135 /* accounting is protected by dn_dirty_mtx */
136 uint64_t dn_maxblkid; /* largest allocated block ID */
137 uint64_t dn_used; /* bytes (or sectors) of disk space */
138
139 uint64_t dn_pad3[4];
140
141 blkptr_t dn_blkptr[1];
142 uint8_t dn_bonus[DN_MAX_BONUSLEN - sizeof (blkptr_t)];
143 blkptr_t dn_spill;
144 } dnode_phys_t;
145
146 typedef struct dnode {
147 /*
148 * Protects the structure of the dnode, including the number of levels
149 * of indirection (dn_nlevels), dn_maxblkid, and dn_next_*
150 */
151 krwlock_t dn_struct_rwlock;
152
153 /* Our link on dn_objset->os_dnodes list; protected by os_lock. */
154 list_node_t dn_link;
155
156 /* immutable: */
157 struct objset *dn_objset;
158 uint64_t dn_object;
159 struct dmu_buf_impl *dn_dbuf;
160 struct dnode_handle *dn_handle;
161 dnode_phys_t *dn_phys; /* pointer into dn->dn_dbuf->db.db_data */
162
163 /*
164 * Copies of stuff in dn_phys. They're valid in the open
165 * context (eg. even before the dnode is first synced).
166 * Where necessary, these are protected by dn_struct_rwlock.
167 */
168 dmu_object_type_t dn_type; /* object type */
169 uint16_t dn_bonuslen; /* bonus length */
|