Lines 1134-1139
static boolean_t l2arc_transform_buf(arc_buf_hdr_t *, boolean_t);
Link Here
|
1134 |
static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); |
1134 |
static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); |
1135 |
static void l2arc_release_cdata_buf(arc_buf_hdr_t *); |
1135 |
static void l2arc_release_cdata_buf(arc_buf_hdr_t *); |
1136 |
|
1136 |
|
|
|
1137 |
static void |
1138 |
l2arc_trim(const arc_buf_hdr_t *hdr) |
1139 |
{ |
1140 |
l2arc_dev_t *dev = hdr->b_l2hdr.b_dev; |
1141 |
|
1142 |
ASSERT(HDR_HAS_L2HDR(hdr)); |
1143 |
ASSERT(MUTEX_HELD(&dev->l2ad_mtx)); |
1144 |
|
1145 |
if (hdr->b_l2hdr.b_daddr == L2ARC_ADDR_UNSET) |
1146 |
return; |
1147 |
if (hdr->b_l2hdr.b_asize != 0) { |
1148 |
trim_map_free(dev->l2ad_vdev, hdr->b_l2hdr.b_daddr, |
1149 |
hdr->b_l2hdr.b_asize, 0); |
1150 |
} else { |
1151 |
ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_EMPTY); |
1152 |
} |
1153 |
} |
1154 |
|
1137 |
static uint64_t |
1155 |
static uint64_t |
1138 |
buf_hash(uint64_t spa, const dva_t *dva, uint64_t birth) |
1156 |
buf_hash(uint64_t spa, const dva_t *dva, uint64_t birth) |
1139 |
{ |
1157 |
{ |
Lines 2449-2458
arc_hdr_destroy(arc_buf_hdr_t *hdr)
Link Here
|
2449 |
* want to re-destroy the header's L2 portion. |
2467 |
* want to re-destroy the header's L2 portion. |
2450 |
*/ |
2468 |
*/ |
2451 |
if (HDR_HAS_L2HDR(hdr)) { |
2469 |
if (HDR_HAS_L2HDR(hdr)) { |
2452 |
if (hdr->b_l2hdr.b_daddr != L2ARC_ADDR_UNSET) |
2470 |
l2arc_trim(hdr); |
2453 |
trim_map_free(dev->l2ad_vdev, |
|
|
2454 |
hdr->b_l2hdr.b_daddr, |
2455 |
hdr->b_l2hdr.b_asize, 0); |
2456 |
arc_hdr_l2hdr_destroy(hdr); |
2471 |
arc_hdr_l2hdr_destroy(hdr); |
2457 |
} |
2472 |
} |
2458 |
|
2473 |
|
Lines 4831-4840
arc_release(arc_buf_t *buf, void *tag)
Link Here
|
4831 |
* to acquire the l2ad_mtx. |
4846 |
* to acquire the l2ad_mtx. |
4832 |
*/ |
4847 |
*/ |
4833 |
if (HDR_HAS_L2HDR(hdr)) { |
4848 |
if (HDR_HAS_L2HDR(hdr)) { |
4834 |
if (hdr->b_l2hdr.b_daddr != L2ARC_ADDR_UNSET) |
4849 |
l2arc_trim(hdr); |
4835 |
trim_map_free(hdr->b_l2hdr.b_dev->l2ad_vdev, |
|
|
4836 |
hdr->b_l2hdr.b_daddr, |
4837 |
hdr->b_l2hdr.b_asize, 0); |
4838 |
arc_hdr_l2hdr_destroy(hdr); |
4850 |
arc_hdr_l2hdr_destroy(hdr); |
4839 |
} |
4851 |
} |
4840 |
|
4852 |
|
Lines 5996-6003
top:
Link Here
|
5996 |
* Error - drop L2ARC entry. |
6008 |
* Error - drop L2ARC entry. |
5997 |
*/ |
6009 |
*/ |
5998 |
list_remove(buflist, hdr); |
6010 |
list_remove(buflist, hdr); |
5999 |
trim_map_free(hdr->b_l2hdr.b_dev->l2ad_vdev, |
6011 |
l2arc_trim(hdr); |
6000 |
hdr->b_l2hdr.b_daddr, hdr->b_l2hdr.b_asize, 0); |
|
|
6001 |
hdr->b_flags &= ~ARC_FLAG_HAS_L2HDR; |
6012 |
hdr->b_flags &= ~ARC_FLAG_HAS_L2HDR; |
6002 |
|
6013 |
|
6003 |
ARCSTAT_INCR(arcstat_l2_asize, -hdr->b_l2hdr.b_asize); |
6014 |
ARCSTAT_INCR(arcstat_l2_asize, -hdr->b_l2hdr.b_asize); |