Print this page
3752 want more verifiable dbuf user eviction
Submitted by:   Justin Gibbs <justing@spectralogic.com>
Submitted by:   Will Andrews <willa@spectralogic.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/dbuf.h
          +++ new/usr/src/uts/common/fs/zfs/sys/dbuf.h
↓ open down ↓ 209 lines elided ↑ open up ↑
 210  210          dbuf_dirty_record_t *db_last_dirty;
 211  211  
 212  212          /*
 213  213           * Our link on the owner dnodes's dn_dbufs list.
 214  214           * Protected by its dn_dbufs_mtx.
 215  215           */
 216  216          list_node_t db_link;
 217  217  
 218  218          /* Data which is unique to data (leaf) blocks: */
 219  219  
 220      -        /* stuff we store for the user (see dmu_buf_set_user) */
 221      -        void *db_user_ptr;
 222      -        void **db_user_data_ptr_ptr;
 223      -        dmu_buf_evict_func_t *db_evict_func;
      220 +        /* User callback information.  See dmu_buf_set_user(). */
      221 +        dmu_buf_user_t *db_user;
 224  222  
 225  223          uint8_t db_immediate_evict;
 226  224          uint8_t db_freed_in_flight;
 227  225  
 228  226          uint8_t db_dirtycnt;
 229  227  } dmu_buf_impl_t;
 230  228  
 231  229  /* Note: the dbuf hash table is exposed only for the mdb module */
 232  230  #define DBUF_MUTEXES 256
 233  231  #define DBUF_HASH_MUTEX(h, idx) (&(h)->hash_mutexes[(idx) & (DBUF_MUTEXES-1)])
↓ open down ↓ 32 lines elided ↑ open up ↑
 266  264  int dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags);
 267  265  void dbuf_will_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx);
 268  266  void dbuf_fill_done(dmu_buf_impl_t *db, dmu_tx_t *tx);
 269  267  void dmu_buf_will_not_fill(dmu_buf_t *db, dmu_tx_t *tx);
 270  268  void dmu_buf_will_fill(dmu_buf_t *db, dmu_tx_t *tx);
 271  269  void dmu_buf_fill_done(dmu_buf_t *db, dmu_tx_t *tx);
 272  270  void dbuf_assign_arcbuf(dmu_buf_impl_t *db, arc_buf_t *buf, dmu_tx_t *tx);
 273  271  dbuf_dirty_record_t *dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx);
 274  272  arc_buf_t *dbuf_loan_arcbuf(dmu_buf_impl_t *db);
 275  273  
 276      -void dbuf_clear(dmu_buf_impl_t *db);
 277      -void dbuf_evict(dmu_buf_impl_t *db);
      274 +void dbuf_clear(dmu_buf_impl_t *db, list_t *evict_list_p);
      275 +void dbuf_evict(dmu_buf_impl_t *db, list_t *evict_list_p);
 278  276  
 279  277  void dbuf_setdirty(dmu_buf_impl_t *db, dmu_tx_t *tx);
 280  278  void dbuf_unoverride(dbuf_dirty_record_t *dr);
 281  279  void dbuf_sync_list(list_t *list, dmu_tx_t *tx);
 282  280  void dbuf_release_bp(dmu_buf_impl_t *db);
 283  281  
 284  282  void dbuf_free_range(struct dnode *dn, uint64_t start, uint64_t end,
 285  283      struct dmu_tx *);
 286  284  
 287  285  void dbuf_new_size(dmu_buf_impl_t *db, int size, dmu_tx_t *tx);
↓ open down ↓ 87 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX