Lines Matching refs:b_l1hdr

944 	l1arc_buf_hdr_t		b_l1hdr;
991 #define HDR_L2ONLY_SIZE ((int64_t)offsetof(arc_buf_hdr_t, b_l1hdr))
1283 cv_init(&hdr->b_l1hdr.b_cv, NULL, CV_DEFAULT, NULL);
1284 refcount_create(&hdr->b_l1hdr.b_refcnt);
1285 mutex_init(&hdr->b_l1hdr.b_freeze_lock, NULL, MUTEX_DEFAULT, NULL);
1286 multilist_link_init(&hdr->b_l1hdr.b_arc_node);
1328 cv_destroy(&hdr->b_l1hdr.b_cv);
1329 refcount_destroy(&hdr->b_l1hdr.b_refcnt);
1330 mutex_destroy(&hdr->b_l1hdr.b_freeze_lock);
1331 ASSERT(!multilist_link_active(&hdr->b_l1hdr.b_arc_node));
1445 buf->b_data == buf->b_hdr->b_l1hdr.b_pdata);
1466 mutex_enter(&hdr->b_l1hdr.b_freeze_lock);
1467 if (hdr->b_l1hdr.b_freeze_cksum != NULL) {
1468 kmem_free(hdr->b_l1hdr.b_freeze_cksum, sizeof (zio_cksum_t));
1469 hdr->b_l1hdr.b_freeze_cksum = NULL;
1471 mutex_exit(&hdr->b_l1hdr.b_freeze_lock);
1480 for (arc_buf_t *b = hdr->b_l1hdr.b_buf; b != NULL; b = b->b_next) {
1503 ASSERT(hdr->b_l1hdr.b_freeze_cksum == NULL ||
1510 mutex_enter(&hdr->b_l1hdr.b_freeze_lock);
1511 if (hdr->b_l1hdr.b_freeze_cksum == NULL || HDR_IO_ERROR(hdr)) {
1512 mutex_exit(&hdr->b_l1hdr.b_freeze_lock);
1517 if (!ZIO_CHECKSUM_EQUAL(*hdr->b_l1hdr.b_freeze_cksum, zc))
1519 mutex_exit(&hdr->b_l1hdr.b_freeze_lock);
1606 mutex_enter(&buf->b_hdr->b_l1hdr.b_freeze_lock);
1607 if (hdr->b_l1hdr.b_freeze_cksum != NULL) {
1609 mutex_exit(&hdr->b_l1hdr.b_freeze_lock);
1612 mutex_exit(&hdr->b_l1hdr.b_freeze_lock);
1617 hdr->b_l1hdr.b_freeze_cksum = kmem_alloc(sizeof (zio_cksum_t),
1620 hdr->b_l1hdr.b_freeze_cksum);
1621 mutex_exit(&hdr->b_l1hdr.b_freeze_lock);
1708 ASSERT3P(hdr->b_l1hdr.b_state, ==, arc_anon);
1718 ASSERT(hdr->b_l1hdr.b_freeze_cksum == NULL ||
1726 mutex_enter(&hdr->b_l1hdr.b_freeze_lock);
1729 if (hdr->b_l1hdr.b_thawed != NULL)
1730 kmem_free(hdr->b_l1hdr.b_thawed, 1);
1731 hdr->b_l1hdr.b_thawed = kmem_alloc(1, KM_SLEEP);
1735 mutex_exit(&hdr->b_l1hdr.b_freeze_lock);
1750 ASSERT(hdr->b_l1hdr.b_freeze_cksum == NULL ||
1759 ASSERT(hdr->b_l1hdr.b_freeze_cksum != NULL ||
1760 hdr->b_l1hdr.b_state == arc_anon);
1833 for (arc_buf_t *from = hdr->b_l1hdr.b_buf; from != NULL;
1851 EQUIV(!copied, hdr->b_l1hdr.b_freeze_cksum == NULL);
1874 dmu_object_byteswap_t bswap = hdr->b_l1hdr.b_byteswap;
1882 bcopy(hdr->b_l1hdr.b_pdata, buf->b_data,
1930 ASSERT3P(hdr->b_l1hdr.b_freeze_cksum, !=, NULL);
1934 hdr->b_l1hdr.b_pdata, buf->b_data,
2001 ASSERT0(hdr->b_l1hdr.b_bufcnt);
2002 ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL);
2003 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
2010 if (hdr->b_l1hdr.b_pdata != NULL) {
2014 for (arc_buf_t *buf = hdr->b_l1hdr.b_buf; buf != NULL;
2036 ASSERT0(hdr->b_l1hdr.b_bufcnt);
2037 ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL);
2038 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
2045 if (hdr->b_l1hdr.b_pdata != NULL) {
2049 for (arc_buf_t *buf = hdr->b_l1hdr.b_buf; buf != NULL;
2069 ASSERT(hdr->b_l1hdr.b_state == arc_anon);
2070 ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
2071 ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL);
2074 arc_state_t *state = hdr->b_l1hdr.b_state;
2076 if ((refcount_add(&hdr->b_l1hdr.b_refcnt, tag) == 1) &&
2098 arc_state_t *state = hdr->b_l1hdr.b_state;
2108 if (((cnt = refcount_remove(&hdr->b_l1hdr.b_refcnt, tag)) == 0) &&
2111 ASSERT3U(hdr->b_l1hdr.b_bufcnt, >, 0);
2139 old_state = hdr->b_l1hdr.b_state;
2140 refcnt = refcount_count(&hdr->b_l1hdr.b_refcnt);
2141 bufcnt = hdr->b_l1hdr.b_bufcnt;
2142 update_old = (bufcnt > 0 || hdr->b_l1hdr.b_pdata != NULL);
2167 ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL);
2185 ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL);
2212 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
2221 for (arc_buf_t *buf = hdr->b_l1hdr.b_buf; buf != NULL;
2241 if (hdr->b_l1hdr.b_pdata != NULL) {
2254 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
2274 for (arc_buf_t *buf = hdr->b_l1hdr.b_buf; buf != NULL;
2294 ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
2301 hdr->b_l1hdr.b_state = new_state;
2406 hdr->b_l1hdr.b_byteswap == DMU_BSWAP_NUMFUNCS &&
2432 buf->b_next = hdr->b_l1hdr.b_buf;
2466 buf->b_data = hdr->b_l1hdr.b_pdata;
2476 hdr->b_l1hdr.b_buf = buf;
2477 hdr->b_l1hdr.b_bufcnt += 1;
2541 (void) refcount_add(&hdr->b_l1hdr.b_refcnt, tag);
2542 (void) refcount_remove(&hdr->b_l1hdr.b_refcnt, arc_onloan_tag);
2555 (void) refcount_add(&hdr->b_l1hdr.b_refcnt, arc_onloan_tag);
2556 (void) refcount_remove(&hdr->b_l1hdr.b_refcnt, tag);
2577 arc_state_t *state = hdr->b_l1hdr.b_state;
2582 if (multilist_link_active(&hdr->b_l1hdr.b_arc_node)) {
2583 ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
2591 l2arc_free_data_on_write(hdr->b_l1hdr.b_pdata, size, type);
2602 arc_state_t *state = hdr->b_l1hdr.b_state;
2605 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
2614 hdr->b_l1hdr.b_pdata = buf->b_data;
2631 arc_state_t *state = hdr->b_l1hdr.b_state;
2634 ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
2643 hdr->b_l1hdr.b_pdata = NULL;
2666 arc_buf_t **bufp = &hdr->b_l1hdr.b_buf;
2689 IMPLY(hdr->b_l1hdr.b_bufcnt > 0, lastbuf != NULL);
2690 IMPLY(hdr->b_l1hdr.b_bufcnt > 0, hdr->b_l1hdr.b_buf != NULL);
2729 ASSERT(hdr->b_l1hdr.b_bufcnt > 0);
2730 hdr->b_l1hdr.b_bufcnt -= 1;
2753 ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
2798 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
2799 hdr->b_l1hdr.b_pdata = arc_get_data_buf(hdr, arc_hdr_size(hdr), hdr);
2800 hdr->b_l1hdr.b_byteswap = DMU_BSWAP_NUMFUNCS;
2801 ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
2811 ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
2823 arc_free_data_buf(hdr, hdr->b_l1hdr.b_pdata,
2826 hdr->b_l1hdr.b_pdata = NULL;
2827 hdr->b_l1hdr.b_byteswap = DMU_BSWAP_NUMFUNCS;
2843 ASSERT3P(hdr->b_l1hdr.b_freeze_cksum, ==, NULL);
2844 ASSERT3P(hdr->b_l1hdr.b_thawed, ==, NULL);
2853 hdr->b_l1hdr.b_state = arc_anon;
2854 hdr->b_l1hdr.b_arc_access = 0;
2855 hdr->b_l1hdr.b_bufcnt = 0;
2856 hdr->b_l1hdr.b_buf = NULL;
2864 ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
2901 nhdr->b_l1hdr.b_state = arc_l2c_only;
2904 ASSERT3P(nhdr->b_l1hdr.b_pdata, ==, NULL);
2906 ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL);
2907 ASSERT0(hdr->b_l1hdr.b_bufcnt);
2908 ASSERT3P(hdr->b_l1hdr.b_freeze_cksum, ==, NULL);
2917 ASSERT(!multilist_link_active(&hdr->b_l1hdr.b_arc_node));
2922 * l2arc device. Otherwise, the b_l1hdr.b_pdata field
2926 VERIFY3P(hdr->b_l1hdr.b_pdata, ==, NULL);
2929 if (hdr->b_l1hdr.b_thawed != NULL) {
2930 kmem_free(hdr->b_l1hdr.b_thawed, 1);
2931 hdr->b_l1hdr.b_thawed = NULL;
3013 ASSERT3P(hdr->b_l1hdr.b_freeze_cksum, ==, NULL);
3043 ASSERT(hdr->b_l1hdr.b_buf == NULL ||
3044 hdr->b_l1hdr.b_bufcnt > 0);
3045 ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
3046 ASSERT3P(hdr->b_l1hdr.b_state, ==, arc_anon);
3080 while (hdr->b_l1hdr.b_buf != NULL)
3081 arc_buf_destroy_impl(hdr->b_l1hdr.b_buf);
3084 if (hdr->b_l1hdr.b_thawed != NULL) {
3085 kmem_free(hdr->b_l1hdr.b_thawed, 1);
3086 hdr->b_l1hdr.b_thawed = NULL;
3090 if (hdr->b_l1hdr.b_pdata != NULL) {
3097 ASSERT(!multilist_link_active(&hdr->b_l1hdr.b_arc_node));
3098 ASSERT3P(hdr->b_l1hdr.b_acb, ==, NULL);
3111 if (hdr->b_l1hdr.b_state == arc_anon) {
3112 ASSERT3U(hdr->b_l1hdr.b_bufcnt, ==, 1);
3121 ASSERT(hdr->b_l1hdr.b_bufcnt > 0);
3123 ASSERT3P(hdr->b_l1hdr.b_state, !=, arc_anon);
3152 state = hdr->b_l1hdr.b_state;
3155 ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL);
3174 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
3200 ddi_get_lbolt() - hdr->b_l1hdr.b_arc_access <
3206 ASSERT0(refcount_count(&hdr->b_l1hdr.b_refcnt));
3207 while (hdr->b_l1hdr.b_buf) {
3208 arc_buf_t *buf = hdr->b_l1hdr.b_buf;
3231 if (hdr->b_l1hdr.b_bufcnt == 0) {
3636 if (data_hdr->b_l1hdr.b_arc_access <
3637 meta_hdr->b_l1hdr.b_arc_access) {
4258 arc_state_t *state = hdr->b_l1hdr.b_state;
4326 if (multilist_link_active(&hdr->b_l1hdr.b_arc_node)) {
4327 ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
4336 if (arc_size < arc_c && hdr->b_l1hdr.b_state == arc_anon &&
4350 arc_state_t *state = hdr->b_l1hdr.b_state;
4354 if (multilist_link_active(&hdr->b_l1hdr.b_arc_node)) {
4355 ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
4386 if (hdr->b_l1hdr.b_state == arc_anon) {
4393 ASSERT0(hdr->b_l1hdr.b_arc_access);
4394 hdr->b_l1hdr.b_arc_access = ddi_get_lbolt();
4398 } else if (hdr->b_l1hdr.b_state == arc_mru) {
4410 if (refcount_count(&hdr->b_l1hdr.b_refcnt) == 0) {
4413 &hdr->b_l1hdr.b_arc_node));
4418 hdr->b_l1hdr.b_arc_access = now;
4427 if (now > hdr->b_l1hdr.b_arc_access + ARC_MINTIME) {
4433 hdr->b_l1hdr.b_arc_access = now;
4438 } else if (hdr->b_l1hdr.b_state == arc_mru_ghost) {
4448 if (refcount_count(&hdr->b_l1hdr.b_refcnt) > 0)
4456 hdr->b_l1hdr.b_arc_access = ddi_get_lbolt();
4460 } else if (hdr->b_l1hdr.b_state == arc_mfu) {
4471 ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
4473 ASSERT(multilist_link_active(&hdr->b_l1hdr.b_arc_node));
4476 hdr->b_l1hdr.b_arc_access = ddi_get_lbolt();
4477 } else if (hdr->b_l1hdr.b_state == arc_mfu_ghost) {
4490 ASSERT0(refcount_count(&hdr->b_l1hdr.b_refcnt));
4494 hdr->b_l1hdr.b_arc_access = ddi_get_lbolt();
4499 } else if (hdr->b_l1hdr.b_state == arc_l2c_only) {
4504 hdr->b_l1hdr.b_arc_access = ddi_get_lbolt();
4590 hdr->b_l1hdr.b_byteswap = DMU_BSWAP_UINT64;
4592 hdr->b_l1hdr.b_byteswap =
4596 hdr->b_l1hdr.b_byteswap = DMU_BSWAP_NUMFUNCS;
4604 callback_list = hdr->b_l1hdr.b_acb;
4607 if (hash_lock && no_zio_error && hdr->b_l1hdr.b_state == arc_anon) {
4637 hdr->b_l1hdr.b_acb = NULL;
4641 ASSERT0(hdr->b_l1hdr.b_bufcnt);
4642 ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
4645 ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt) ||
4652 if (hdr->b_l1hdr.b_state != arc_anon)
4656 freeable = refcount_is_zero(&hdr->b_l1hdr.b_refcnt);
4664 cv_broadcast(&hdr->b_l1hdr.b_cv);
4675 ASSERT3P(hdr->b_l1hdr.b_state, ==, arc_anon);
4676 freeable = refcount_is_zero(&hdr->b_l1hdr.b_refcnt);
4738 if (hdr != NULL && HDR_HAS_L1HDR(hdr) && hdr->b_l1hdr.b_pdata != NULL) {
4776 cv_wait(&hdr->b_l1hdr.b_cv, hash_lock);
4795 acb->acb_next = hdr->b_l1hdr.b_acb;
4796 hdr->b_l1hdr.b_acb = acb;
4804 ASSERT(hdr->b_l1hdr.b_state == arc_mru ||
4805 hdr->b_l1hdr.b_state == arc_mfu);
4828 refcount_count(&hdr->b_l1hdr.b_refcnt) == 0) {
4881 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
4882 ASSERT(GHOST_STATE(hdr->b_l1hdr.b_state));
4884 ASSERT(refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
4885 ASSERT3P(hdr->b_l1hdr.b_buf, ==, NULL);
4886 ASSERT3P(hdr->b_l1hdr.b_freeze_cksum, ==, NULL);
4901 ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
4922 ASSERT(!GHOST_STATE(hdr->b_l1hdr.b_state));
4929 ASSERT3P(hdr->b_l1hdr.b_acb, ==, NULL);
4930 hdr->b_l1hdr.b_acb = acb;
5004 size, hdr->b_l1hdr.b_pdata,
5043 rzio = zio_read(pio, spa, bp, hdr->b_l1hdr.b_pdata, size,
5094 refcount_is_zero(&hdr->b_l1hdr.b_refcnt))) {
5130 if (hdr->b_l1hdr.b_state == arc_anon) {
5137 ASSERT3U(hdr->b_l1hdr.b_bufcnt, ==, 1);
5138 ASSERT3S(refcount_count(&hdr->b_l1hdr.b_refcnt), ==, 1);
5139 ASSERT(!list_link_active(&hdr->b_l1hdr.b_arc_node));
5141 hdr->b_l1hdr.b_arc_access = 0;
5161 arc_state_t *state = hdr->b_l1hdr.b_state;
5166 ASSERT3S(refcount_count(&hdr->b_l1hdr.b_refcnt), >, 0);
5188 if (hdr->b_l1hdr.b_bufcnt > 1) {
5197 ASSERT(hdr->b_l1hdr.b_buf != buf || buf->b_next != NULL);
5201 ASSERT3P(hdr->b_l1hdr.b_buf, !=, buf);
5236 bcopy(buf->b_data, hdr->b_l1hdr.b_pdata, psize);
5252 ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
5258 if (refcount_is_zero(&hdr->b_l1hdr.b_refcnt)) {
5264 hdr->b_l1hdr.b_bufcnt -= 1;
5275 ASSERT3P(nhdr->b_l1hdr.b_buf, ==, NULL);
5276 ASSERT0(nhdr->b_l1hdr.b_bufcnt);
5277 ASSERT0(refcount_count(&nhdr->b_l1hdr.b_refcnt));
5281 nhdr->b_l1hdr.b_buf = buf;
5282 nhdr->b_l1hdr.b_bufcnt = 1;
5283 (void) refcount_add(&nhdr->b_l1hdr.b_refcnt, tag);
5291 ASSERT(refcount_count(&hdr->b_l1hdr.b_refcnt) == 1);
5293 ASSERT(!multilist_link_active(&hdr->b_l1hdr.b_arc_node));
5296 hdr->b_l1hdr.b_arc_access = 0;
5311 buf->b_hdr->b_l1hdr.b_state == arc_anon);
5323 referenced = (refcount_count(&buf->b_hdr->b_l1hdr.b_refcnt));
5338 ASSERT(!refcount_is_zero(&buf->b_hdr->b_l1hdr.b_refcnt));
5339 ASSERT(hdr->b_l1hdr.b_bufcnt > 0);
5349 if (hdr->b_l1hdr.b_pdata != NULL) {
5357 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
5392 bcopy(zio->io_data, hdr->b_l1hdr.b_pdata, psize);
5396 ASSERT3U(hdr->b_l1hdr.b_bufcnt, ==, 1);
5403 ASSERT0(bcmp(zio->io_orig_data, hdr->b_l1hdr.b_pdata,
5437 ASSERT3P(hdr->b_l1hdr.b_acb, ==, NULL);
5478 &exists->b_l1hdr.b_refcnt));
5492 ASSERT(hdr->b_l1hdr.b_bufcnt == 1);
5493 ASSERT(hdr->b_l1hdr.b_state == arc_anon);
5500 if (exists == NULL && hdr->b_l1hdr.b_state == arc_anon)
5507 ASSERT(!refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
5528 ASSERT3P(hdr->b_l1hdr.b_acb, ==, NULL);
5529 ASSERT3U(hdr->b_l1hdr.b_bufcnt, >, 0);
5549 if (hdr->b_l1hdr.b_pdata != NULL) {
5565 ASSERT3P(hdr->b_l1hdr.b_pdata, ==, NULL);
5771 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
5775 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
5779 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
5783 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
5787 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
5791 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
5795 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
5799 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
5803 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
5807 offsetof(arc_buf_hdr_t, b_l1hdr.b_arc_node),
6487 ASSERT3P(zio->io_data, ==, hdr->b_l1hdr.b_pdata);
6521 hdr->b_l1hdr.b_pdata, zio->io_size, arc_read_done,
6664 ASSERT(hdr->b_l1hdr.b_state != arc_l2c_only);
6809 ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
6826 to_write = hdr->b_l1hdr.b_pdata;
6836 bcopy(hdr->b_l1hdr.b_pdata, to_write, size);