216 /* buffer holding our data */
217 arc_buf_t *db_buf;
218
219 kcondvar_t db_changed;
220 dbuf_dirty_record_t *db_data_pending;
221
222 /* pointer to most recent dirty record for this buffer */
223 dbuf_dirty_record_t *db_last_dirty;
224
225 /*
226 * Our link on the owner dnodes's dn_dbufs list.
227 * Protected by its dn_dbufs_mtx.
228 */
229 avl_node_t db_link;
230
231 /* Data which is unique to data (leaf) blocks: */
232
233 /* User callback information. */
234 dmu_buf_user_t *db_user;
235
236 uint8_t db_immediate_evict;
237 uint8_t db_freed_in_flight;
238
239 uint8_t db_dirtycnt;
240 } dmu_buf_impl_t;
241
242 /* Note: the dbuf hash table is exposed only for the mdb module */
243 #define DBUF_MUTEXES 256
244 #define DBUF_HASH_MUTEX(h, idx) (&(h)->hash_mutexes[(idx) & (DBUF_MUTEXES-1)])
245 typedef struct dbuf_hash_table {
246 uint64_t hash_table_mask;
247 dmu_buf_impl_t **hash_table;
248 kmutex_t hash_mutexes[DBUF_MUTEXES];
249 } dbuf_hash_table_t;
250
251
252 uint64_t dbuf_whichblock(struct dnode *di, uint64_t offset);
253
254 dmu_buf_impl_t *dbuf_create_tlib(struct dnode *dn, char *data);
255 void dbuf_create_bonus(struct dnode *dn);
256 int dbuf_spill_set_blksz(dmu_buf_t *db, uint64_t blksz, dmu_tx_t *tx);
257 void dbuf_spill_hold(struct dnode *dn, dmu_buf_impl_t **dbp, void *tag);
258
|
216 /* buffer holding our data */
217 arc_buf_t *db_buf;
218
219 kcondvar_t db_changed;
220 dbuf_dirty_record_t *db_data_pending;
221
222 /* pointer to most recent dirty record for this buffer */
223 dbuf_dirty_record_t *db_last_dirty;
224
225 /*
226 * Our link on the owner dnodes's dn_dbufs list.
227 * Protected by its dn_dbufs_mtx.
228 */
229 avl_node_t db_link;
230
231 /* Data which is unique to data (leaf) blocks: */
232
233 /* User callback information. */
234 dmu_buf_user_t *db_user;
235
236 /*
237 * Evict user data as soon as the dirty and reference
238 * counts are equal.
239 */
240 uint8_t db_user_immediate_evict;
241
242 /*
243 * This block was freed while a read or write was
244 * active.
245 */
246 uint8_t db_freed_in_flight;
247
248 /*
249 * dnode_evict_dbufs() or dnode_evict_bonus() tried to
250 * evict this dbuf, but couldn't due to outstanding
251 * references. Evict once the refcount drops to 0.
252 */
253 uint8_t db_pending_evict;
254
255 uint8_t db_dirtycnt;
256 } dmu_buf_impl_t;
257
258 /* Note: the dbuf hash table is exposed only for the mdb module */
259 #define DBUF_MUTEXES 256
260 #define DBUF_HASH_MUTEX(h, idx) (&(h)->hash_mutexes[(idx) & (DBUF_MUTEXES-1)])
261 typedef struct dbuf_hash_table {
262 uint64_t hash_table_mask;
263 dmu_buf_impl_t **hash_table;
264 kmutex_t hash_mutexes[DBUF_MUTEXES];
265 } dbuf_hash_table_t;
266
267
268 uint64_t dbuf_whichblock(struct dnode *di, uint64_t offset);
269
270 dmu_buf_impl_t *dbuf_create_tlib(struct dnode *dn, char *data);
271 void dbuf_create_bonus(struct dnode *dn);
272 int dbuf_spill_set_blksz(dmu_buf_t *db, uint64_t blksz, dmu_tx_t *tx);
273 void dbuf_spill_hold(struct dnode *dn, dmu_buf_impl_t **dbp, void *tag);
274
|