Skip to content

Commit

Permalink
Remove unnecessary abd_t object
Browse files Browse the repository at this point in the history
Signed-off-by: George Amanakis <gamanakis@gmail.com>
  • Loading branch information
gamanakis committed Nov 16, 2019
1 parent f271399 commit 5d81157
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion include/sys/arc_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ typedef struct l2arc_write_callback {
list_t l2wcb_log_blk_buflist; /* in-flight log blocks */
abd_t *abd;
abd_t *abd2;
abd_t *abd3;
} l2arc_write_callback_t;

struct arc_buf_hdr {
Expand Down
12 changes: 5 additions & 7 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7908,8 +7908,6 @@ l2arc_write_done(zio_t *zio)
abd_put(cb->abd);
if (cb->abd2 != NULL)
abd_put(cb->abd2);
if (cb->abd3 != NULL)
abd_put(cb->abd3);
list_destroy(&cb->l2wcb_log_blk_buflist);
kmem_free(cb, sizeof (l2arc_write_callback_t));
}
Expand Down Expand Up @@ -8597,7 +8595,6 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
offsetof(l2arc_log_blk_buf_t, lbb_node));
cb->abd = NULL;
cb->abd2 = NULL;
cb->abd3 = NULL;
pio = zio_root(spa, l2arc_write_done, cb,
ZIO_FLAG_CANFAIL);
}
Expand Down Expand Up @@ -9581,10 +9578,10 @@ l2arc_dev_hdr_update(l2arc_dev_t *dev, zio_t *pio,

/* checksum operation goes last */
l2arc_dev_hdr_checksum(hdr, &hdr->dh_self_cksum);
cb->abd3 = abd_get_from_buf(hdr, hdr_asize);
cb->abd2 = abd_get_from_buf(hdr, hdr_asize);

wzio = zio_write_phys(pio, dev->l2ad_vdev, VDEV_LABEL_START_SIZE,
hdr_asize, cb->abd3, ZIO_CHECKSUM_OFF,
hdr_asize, cb->abd2, ZIO_CHECKSUM_OFF,
NULL, NULL, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_CANFAIL, B_FALSE);
DTRACE_PROBE2(l2arc__write, vdev_t *, dev->l2ad_vdev, zio_t *, wzio);
(void) zio_nowait(wzio);
Expand Down Expand Up @@ -9655,9 +9652,10 @@ l2arc_log_blk_commit(l2arc_dev_t *dev, zio_t *pio,
/* perform the write itself */
CTASSERT(L2ARC_LOG_BLK_SIZE >= SPA_MINBLOCKSIZE &&
L2ARC_LOG_BLK_SIZE <= SPA_MAXBLOCKSIZE);
cb->abd2 = abd_get_from_buf(lb_buf->lbb_log_blk, asize);
abd_put(cb->abd);
cb->abd = abd_get_from_buf(lb_buf->lbb_log_blk, asize);
wzio = zio_write_phys(pio, dev->l2ad_vdev, dev->l2ad_hand,
asize, cb->abd2, ZIO_CHECKSUM_OFF, NULL, NULL,
asize, cb->abd, ZIO_CHECKSUM_OFF, NULL, NULL,
ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_CANFAIL, B_FALSE);
DTRACE_PROBE2(l2arc__write, vdev_t *, dev->l2ad_vdev, zio_t *, wzio);
(void) zio_nowait(wzio);
Expand Down

0 comments on commit 5d81157

Please sign in to comment.