View | Details | Raw Unified | Return to bug 203473 | Differences between
and this patch

Collapse All | Expand All

(-)sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c (working copy) (-10 / +21 lines)
Lines 1134-1139 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
static void
1137
l2arc_trim(const arc_buf_hdr_t *hdr)
1138
{
1139
       l2arc_dev_t *dev = hdr->b_l2hdr.b_dev;
1140
1141
       ASSERT(HDR_HAS_L2HDR(hdr));
1142
       ASSERT(MUTEX_HELD(&dev->l2ad_mtx));
1143
1144
       if (hdr->b_l2hdr.b_daddr == L2ARC_ADDR_UNSET)
1145
               return;
1146
       if (hdr->b_l2hdr.b_asize != 0) {
1147
               trim_map_free(dev->l2ad_vdev, hdr->b_l2hdr.b_daddr,
1148
                   hdr->b_l2hdr.b_asize, 0);
1149
       } else {
1150
               ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_EMPTY);
1151
       }
1152
}
1153
1136
static uint64_t
1154
static uint64_t
1137
buf_hash(uint64_t spa, const dva_t *dva, uint64_t birth)
1155
buf_hash(uint64_t spa, const dva_t *dva, uint64_t birth)
1138
{
1156
{
Lines 2406-2415 Link Here
2406
                * want to re-destroy the header's L2 portion.
2424
                * want to re-destroy the header's L2 portion.
2407
                */
2425
                */
2408
               if (HDR_HAS_L2HDR(hdr)) {
2426
               if (HDR_HAS_L2HDR(hdr)) {
2409
                       if (hdr->b_l2hdr.b_daddr != L2ARC_ADDR_UNSET)
2427
                       l2arc_trim(hdr);
2410
                               trim_map_free(dev->l2ad_vdev,
2411
                                   hdr->b_l2hdr.b_daddr,
2412
                                   hdr->b_l2hdr.b_asize, 0);
2413
                       arc_hdr_l2hdr_destroy(hdr);
2428
                       arc_hdr_l2hdr_destroy(hdr);
2414
               }
2429
               }
Lines 4779-4788 Link Here
4779
                * to acquire the l2ad_mtx.
4794
                * to acquire the l2ad_mtx.
4780
                */
4795
                */
4781
               if (HDR_HAS_L2HDR(hdr)) {
4796
               if (HDR_HAS_L2HDR(hdr)) {
4782
                       if (hdr->b_l2hdr.b_daddr != L2ARC_ADDR_UNSET)
4797
                       l2arc_trim(hdr);
4783
                               trim_map_free(hdr->b_l2hdr.b_dev->l2ad_vdev,
4784
                                   hdr->b_l2hdr.b_daddr,
4785
                                   hdr->b_l2hdr.b_asize, 0);
4786
                       arc_hdr_l2hdr_destroy(hdr);
4798
                       arc_hdr_l2hdr_destroy(hdr);
4787
               }
4799
               }
Lines 5959-5966 Link Here
5959
                        * Error - drop L2ARC entry.
5971
                        * Error - drop L2ARC entry.
5960
                        */
5972
                        */
5961
                       list_remove(buflist, hdr);
5973
                       list_remove(buflist, hdr);
5962
                       trim_map_free(hdr->b_l2hdr.b_dev->l2ad_vdev,
5974
                       l2arc_trim(hdr);
5963
                           hdr->b_l2hdr.b_daddr, hdr->b_l2hdr.b_asize, 0);
5964
                       hdr->b_flags &= ~ARC_FLAG_HAS_L2HDR;
5975
                       hdr->b_flags &= ~ARC_FLAG_HAS_L2HDR;
5965
                       ARCSTAT_INCR(arcstat_l2_asize, -hdr->b_l2hdr.b_asize);
5976
                       ARCSTAT_INCR(arcstat_l2_asize, -hdr->b_l2hdr.b_asize);

Return to bug 203473