Deleted Added
full compact
arc.c (321610) arc.c (321613)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1329 unchanged lines hidden (view full) ---

1338static kmutex_t l2arc_free_on_write_mtx; /* mutex for list */
1339static uint64_t l2arc_ndev; /* number of devices */
1340
1341typedef struct l2arc_read_callback {
1342 arc_buf_hdr_t *l2rcb_hdr; /* read header */
1343 blkptr_t l2rcb_bp; /* original blkptr */
1344 zbookmark_phys_t l2rcb_zb; /* original bookmark */
1345 int l2rcb_flags; /* original flags */
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1329 unchanged lines hidden (view full) ---

1338static kmutex_t l2arc_free_on_write_mtx; /* mutex for list */
1339static uint64_t l2arc_ndev; /* number of devices */
1340
1341typedef struct l2arc_read_callback {
1342 arc_buf_hdr_t *l2rcb_hdr; /* read header */
1343 blkptr_t l2rcb_bp; /* original blkptr */
1344 zbookmark_phys_t l2rcb_zb; /* original bookmark */
1345 int l2rcb_flags; /* original flags */
1346 void *l2rcb_abd; /* temporary buffer */
1346 abd_t *l2rcb_abd; /* temporary buffer */
1347} l2arc_read_callback_t;
1348
1349typedef struct l2arc_write_callback {
1350 l2arc_dev_t *l2wcb_dev; /* device info */
1351 arc_buf_hdr_t *l2wcb_head; /* head of write buflist */
1352} l2arc_write_callback_t;
1353
1354typedef struct l2arc_data_free {

--- 6125 unchanged lines hidden (view full) ---

7480 mutex_exit(&dev->l2ad_mtx);
7481
7482 (void) refcount_add_many(&dev->l2ad_alloc, size, hdr);
7483
7484 /*
7485 * Normally the L2ARC can use the hdr's data, but if
7486 * we're sharing data between the hdr and one of its
7487 * bufs, L2ARC needs its own copy of the data so that
1347} l2arc_read_callback_t;
1348
1349typedef struct l2arc_write_callback {
1350 l2arc_dev_t *l2wcb_dev; /* device info */
1351 arc_buf_hdr_t *l2wcb_head; /* head of write buflist */
1352} l2arc_write_callback_t;
1353
1354typedef struct l2arc_data_free {

--- 6125 unchanged lines hidden (view full) ---

7480 mutex_exit(&dev->l2ad_mtx);
7481
7482 (void) refcount_add_many(&dev->l2ad_alloc, size, hdr);
7483
7484 /*
7485 * Normally the L2ARC can use the hdr's data, but if
7486 * we're sharing data between the hdr and one of its
7487 * bufs, L2ARC needs its own copy of the data so that
7488 * the ZIO below can't race with the buf consumer. To
7489 * ensure that this copy will be available for the
7488 * the ZIO below can't race with the buf consumer.
7489 * Another case where we need to create a copy of the
7490 * data is when the buffer size is not device-aligned
7491 * and we need to pad the block to make it such.
7492 * That also keeps the clock hand suitably aligned.
7493 *
7494 * To ensure that the copy will be available for the
7490 * lifetime of the ZIO and be cleaned up afterwards, we
7491 * add it to the l2arc_free_on_write queue.
7492 */
7493 abd_t *to_write;
7494 if (!HDR_SHARED_DATA(hdr) && size == asize) {
7495 to_write = hdr->b_l1hdr.b_pabd;
7496 } else {
7497 to_write = abd_alloc_for_io(asize,

--- 326 unchanged lines hidden ---
7495 * lifetime of the ZIO and be cleaned up afterwards, we
7496 * add it to the l2arc_free_on_write queue.
7497 */
7498 abd_t *to_write;
7499 if (!HDR_SHARED_DATA(hdr) && size == asize) {
7500 to_write = hdr->b_l1hdr.b_pabd;
7501 } else {
7502 to_write = abd_alloc_for_io(asize,

--- 326 unchanged lines hidden ---