summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2016-11-17 15:22:55 +0000
committeravg <avg@FreeBSD.org>2016-11-17 15:22:55 +0000
commit93d8fdda36a1036fc5de8da101edaa42188a0b76 (patch)
tree4befe5f0fd23502caf4e69916c9872b8cd0b6233 /sys/cddl/contrib/opensolaris
parent71785337d916d55ed2b1a575e83623989db524ab (diff)
downloadFreeBSD-src-93d8fdda36a1036fc5de8da101edaa42188a0b76.zip
FreeBSD-src-93d8fdda36a1036fc5de8da101edaa42188a0b76.tar.gz
Revert r308753: some unrelated changes were included into the commit
Diffstat (limited to 'sys/cddl/contrib/opensolaris')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
index 6945fc6..d6ccf3d 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -6945,22 +6945,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
continue;
}
- /*
- * We rely on the L1 portion of the header below, so
- * it's invalid for this header to have been evicted out
- * of the ghost cache, prior to being written out. The
- * ARC_FLAG_L2_WRITING bit ensures this won't happen.
- */
- ASSERT(HDR_HAS_L1HDR(hdr));
-
- ASSERT3U(HDR_GET_PSIZE(hdr), >, 0);
- ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
- ASSERT3U(arc_hdr_size(hdr), >, 0);
- uint64_t size = arc_hdr_size(hdr);
- uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev,
- size);
-
- if ((write_psize + asize) > target_sz) {
+ if ((write_asize + HDR_GET_LSIZE(hdr)) > target_sz) {
full = B_TRUE;
mutex_exit(hash_lock);
ARCSTAT_BUMP(arcstat_l2_write_full);
@@ -6995,6 +6980,21 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
list_insert_head(&dev->l2ad_buflist, hdr);
mutex_exit(&dev->l2ad_mtx);
+ /*
+ * We rely on the L1 portion of the header below, so
+ * it's invalid for this header to have been evicted out
+ * of the ghost cache, prior to being written out. The
+ * ARC_FLAG_L2_WRITING bit ensures this won't happen.
+ */
+ ASSERT(HDR_HAS_L1HDR(hdr));
+
+ ASSERT3U(HDR_GET_PSIZE(hdr), >, 0);
+ ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
+ ASSERT3U(arc_hdr_size(hdr), >, 0);
+ uint64_t size = arc_hdr_size(hdr);
+ uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev,
+ size);
+
(void) refcount_add_many(&dev->l2ad_alloc, size, hdr);
/*
OpenPOWER on IntegriCloud