]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - zfs/include/sys/dbuf.h
UBUNTU: SAUCE: (noup) Update spl to 0.7.3-1ubuntu1, zfs to 0.7.3-1ubuntu1
[mirror_ubuntu-bionic-kernel.git] / zfs / include / sys / dbuf.h
index 0d262e87b5bc9fca09073783719b75eab25a83c5..6262f012e7ab64a498ce7340c0355faa3f919e2e 100644 (file)
@@ -36,6 +36,7 @@
 #include <sys/zfs_context.h>
 #include <sys/refcount.h>
 #include <sys/zrlock.h>
+#include <sys/multilist.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -121,6 +122,9 @@ typedef struct dbuf_dirty_record {
        /* How much space was changed to dsl_pool_dirty_space() for this? */
        unsigned int dr_accounted;
 
+       /* A copy of the bp that points to us */
+       blkptr_t dr_bp_copy;
+
        union dirty_types {
                struct dirty_indirect {
 
@@ -225,6 +229,11 @@ typedef struct dmu_buf_impl {
         */
        avl_node_t db_link;
 
+       /*
+        * Link in dbuf_cache.
+        */
+       multilist_node_t db_cache_link;
+
        /* Data which is unique to data (leaf) blocks: */
 
        /* User callback information. */
@@ -261,8 +270,8 @@ typedef struct dbuf_hash_table {
        kmutex_t hash_mutexes[DBUF_MUTEXES];
 } dbuf_hash_table_t;
 
-
-uint64_t dbuf_whichblock(struct dnode *di, uint64_t offset);
+uint64_t dbuf_whichblock(const struct dnode *di, const int64_t level,
+    const uint64_t offset);
 
 void dbuf_create_bonus(struct dnode *dn);
 int dbuf_spill_set_blksz(dmu_buf_t *db, uint64_t blksz, dmu_tx_t *tx);
@@ -272,10 +281,12 @@ void dbuf_rm_spill(struct dnode *dn, dmu_tx_t *tx);
 dmu_buf_impl_t *dbuf_hold(struct dnode *dn, uint64_t blkid, void *tag);
 dmu_buf_impl_t *dbuf_hold_level(struct dnode *dn, int level, uint64_t blkid,
     void *tag);
-int dbuf_hold_impl(struct dnode *dn, uint8_t level, uint64_t blkid, int create,
+int dbuf_hold_impl(struct dnode *dn, uint8_t level, uint64_t blkid,
+    boolean_t fail_sparse, boolean_t fail_uncached,
     void *tag, dmu_buf_impl_t **dbp);
 
-void dbuf_prefetch(struct dnode *dn, uint64_t blkid, zio_priority_t prio);
+void dbuf_prefetch(struct dnode *dn, int64_t level, uint64_t blkid,
+    zio_priority_t prio, arc_flags_t aflags);
 
 void dbuf_add_ref(dmu_buf_impl_t *db, void *tag);
 boolean_t dbuf_try_add_ref(dmu_buf_t *db, objset_t *os, uint64_t obj,
@@ -299,8 +310,7 @@ void dmu_buf_write_embedded(dmu_buf_t *dbuf, void *data,
     bp_embedded_type_t etype, enum zio_compress comp,
     int uncompressed_size, int compressed_size, int byteorder, dmu_tx_t *tx);
 
-void dbuf_clear(dmu_buf_impl_t *db);
-void dbuf_evict(dmu_buf_impl_t *db);
+void dbuf_destroy(dmu_buf_impl_t *db);
 
 void dbuf_unoverride(dbuf_dirty_record_t *dr);
 void dbuf_sync_list(list_t *list, int level, dmu_tx_t *tx);
@@ -338,10 +348,6 @@ boolean_t dbuf_is_metadata(dmu_buf_impl_t *db);
        (dbuf_is_metadata(_db) &&                                       \
        ((_db)->db_objset->os_secondary_cache == ZFS_CACHE_METADATA)))
 
-#define        DBUF_IS_L2COMPRESSIBLE(_db)                                     \
-       ((_db)->db_objset->os_compress != ZIO_COMPRESS_OFF ||           \
-       (dbuf_is_metadata(_db) && zfs_mdcomp_disable == B_FALSE))
-
 #ifdef ZFS_DEBUG
 
 /*