Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -261,7 +261,6 @@ #endif #include #include -#include #include #include @@ -1372,20 +1371,6 @@ static boolean_t l2arc_write_eligible(uint64_t, arc_buf_hdr_t *); static void l2arc_read_done(zio_t *); -static void -l2arc_trim(const arc_buf_hdr_t *hdr) -{ - l2arc_dev_t *dev = hdr->b_l2hdr.b_dev; - - ASSERT(HDR_HAS_L2HDR(hdr)); - ASSERT(MUTEX_HELD(&dev->l2ad_mtx)); - - if (HDR_GET_PSIZE(hdr) != 0) { - trim_map_free(dev->l2ad_vdev, hdr->b_l2hdr.b_daddr, - HDR_GET_PSIZE(hdr), 0); - } -} - static uint64_t buf_hash(uint64_t spa, const dva_t *dva, uint64_t birth) { @@ -3031,10 +3016,8 @@ * to acquire the l2ad_mtx. If that happens, we don't * want to re-destroy the header's L2 portion. */ - if (HDR_HAS_L2HDR(hdr)) { - l2arc_trim(hdr); + if (HDR_HAS_L2HDR(hdr)) arc_hdr_l2hdr_destroy(hdr); - } if (!buflist_held) mutex_exit(&dev->l2ad_mtx); @@ -5284,10 +5267,8 @@ * destroyed the header's L2 portion as we were waiting * to acquire the l2ad_mtx. */ - if (HDR_HAS_L2HDR(hdr)) { - l2arc_trim(hdr); + if (HDR_HAS_L2HDR(hdr)) arc_hdr_l2hdr_destroy(hdr); - } mutex_exit(&hdr->b_l2hdr.b_dev->l2ad_mtx); } @@ -6645,7 +6626,6 @@ * Error - drop L2ARC entry. */ list_remove(buflist, hdr); - l2arc_trim(hdr); arc_hdr_clear_flags(hdr, ARC_FLAG_HAS_L2HDR); ARCSTAT_INCR(arcstat_l2_asize, -arc_hdr_size(hdr));