@@ -78,6 +78,7 @@ static int zio_deadman_log_all = B_FALSE;
78
78
*/
79
79
static kmem_cache_t * zio_cache ;
80
80
static kmem_cache_t * zio_link_cache ;
81
+ static kmem_cache_t * zio_bp_cache ;
81
82
kmem_cache_t * zio_buf_cache [SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT ];
82
83
kmem_cache_t * zio_data_buf_cache [SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT ];
83
84
#if defined(ZFS_DEBUG ) && !defined(_KERNEL )
@@ -202,6 +203,8 @@ zio_init(void)
202
203
sizeof (zio_t ), 0 , NULL , NULL , NULL , NULL , NULL , 0 );
203
204
zio_link_cache = kmem_cache_create ("zio_link_cache" ,
204
205
sizeof (zio_link_t ), 0 , NULL , NULL , NULL , NULL , NULL , 0 );
206
+ zio_bp_cache = kmem_cache_create ("zio_bp_cache" ,
207
+ sizeof (blkptr_t ), 0 , NULL , NULL , NULL , NULL , NULL , 0 );
205
208
206
209
wmsum_init (& ziostat_sums .ziostat_total_allocations , 0 );
207
210
wmsum_init (& ziostat_sums .ziostat_alloc_class_fallbacks , 0 );
@@ -353,6 +356,7 @@ zio_fini(void)
353
356
wmsum_fini (& ziostat_sums .ziostat_gang_writes );
354
357
wmsum_fini (& ziostat_sums .ziostat_gang_multilevel );
355
358
359
+ kmem_cache_destroy (zio_bp_cache );
356
360
kmem_cache_destroy (zio_link_cache );
357
361
kmem_cache_destroy (zio_cache );
358
362
@@ -939,6 +943,14 @@ zio_bookmark_compare(const void *x1, const void *x2)
939
943
return (0 );
940
944
}
941
945
946
+ static inline blkptr_t *
947
+ zio_dup_bp (const blkptr_t * bp )
948
+ {
949
+ blkptr_t * nbp = kmem_cache_alloc (zio_bp_cache , KM_SLEEP );
950
+ * nbp = * bp ;
951
+ return (nbp );
952
+ }
953
+
942
954
/*
943
955
* ==========================================================================
944
956
* Create the various types of I/O (read, write, free, etc)
0 commit comments