Deleted Added
full compact
137a138,145
> #ifdef illumos
> #ifndef _KERNEL
> /* set with ZFS_DEBUG=watch, to enable watchpoints on frozen buffers */
> boolean_t arc_watch = B_FALSE;
> int arc_procfd;
> #endif
> #endif /* illumos */
>
536a545,547
> #ifdef illumos
> static void arc_buf_watch(arc_buf_t *buf);
> #endif /* illumos */
1071a1083,1085
> #ifdef illumos
> arc_buf_watch(buf);
> #endif /* illumos */
1073a1088,1132
> #ifdef illumos
> #ifndef _KERNEL
> typedef struct procctl {
> long cmd;
> prwatch_t prwatch;
> } procctl_t;
> #endif
>
> /* ARGSUSED */
> static void
> arc_buf_unwatch(arc_buf_t *buf)
> {
> #ifndef _KERNEL
> if (arc_watch) {
> int result;
> procctl_t ctl;
> ctl.cmd = PCWATCH;
> ctl.prwatch.pr_vaddr = (uintptr_t)buf->b_data;
> ctl.prwatch.pr_size = 0;
> ctl.prwatch.pr_wflags = 0;
> result = write(arc_procfd, &ctl, sizeof (ctl));
> ASSERT3U(result, ==, sizeof (ctl));
> }
> #endif
> }
>
> /* ARGSUSED */
> static void
> arc_buf_watch(arc_buf_t *buf)
> {
> #ifndef _KERNEL
> if (arc_watch) {
> int result;
> procctl_t ctl;
> ctl.cmd = PCWATCH;
> ctl.prwatch.pr_vaddr = (uintptr_t)buf->b_data;
> ctl.prwatch.pr_size = buf->b_hdr->b_size;
> ctl.prwatch.pr_wflags = WA_WRITE;
> result = write(arc_procfd, &ctl, sizeof (ctl));
> ASSERT3U(result, ==, sizeof (ctl));
> }
> #endif
> }
> #endif /* illumos */
>
1097a1157,1160
>
> #ifdef illumos
> arc_buf_unwatch(buf);
> #endif /* illumos */
1114a1178
>
1152c1216
< ASSERT3U(ab->b_datacnt, ==, 0);
---
> ASSERT0(ab->b_datacnt);
1499,1500c1563
< arc_buf_data_free(arc_buf_hdr_t *hdr, void (*free_func)(void *, size_t),
< void *data, size_t size)
---
> arc_buf_data_free(arc_buf_t *buf, void (*free_func)(void *, size_t))
1501a1565,1566
> arc_buf_hdr_t *hdr = buf->b_hdr;
>
1505,1506c1570,1571
< df->l2df_data = data;
< df->l2df_size = size;
---
> df->l2df_data = buf->b_data;
> df->l2df_size = hdr->b_size;
1513c1578
< free_func(data, size);
---
> free_func(buf->b_data, hdr->b_size);
1528a1594,1596
> #ifdef illumos
> arc_buf_unwatch(buf);
> #endif /* illumos */
1532,1533c1600
< arc_buf_data_free(buf->b_hdr, zio_buf_free,
< buf->b_data, size);
---
> arc_buf_data_free(buf, zio_buf_free);
1537,1538c1604
< arc_buf_data_free(buf->b_hdr,
< zio_data_buf_free, buf->b_data, size);
---
> arc_buf_data_free(buf, zio_data_buf_free);
1815c1881
< ASSERT3U(refcount_count(&ab->b_refcnt), ==, 0);
---
> ASSERT0(refcount_count(&ab->b_refcnt));
2715c2781
< ASSERT3U(refcount_count(&buf->b_refcnt), ==, 0);
---
> ASSERT0(refcount_count(&buf->b_refcnt));
2796a2863,2864
> dmu_object_byteswap_t bswap =
> DMU_OT_BYTESWAP(BP_GET_TYPE(zio->io_bp));
2799c2867
< dmu_ot[BP_GET_TYPE(zio->io_bp)].ot_byteswap;
---
> dmu_ot_byteswap[bswap].ob_func;
2803a2872,2874
> #ifdef illumos
> arc_buf_watch(buf);
> #endif /* illumos */
3054c3125
< ASSERT3U(refcount_count(&hdr->b_refcnt), ==, 0);
---
> ASSERT0(refcount_count(&hdr->b_refcnt));
3367a3439,3441
> #ifdef illumos
> arc_buf_unwatch(buf);
> #endif /* illumos */
4748c4822
< ASSERT3U(write_sz, ==, 0);
---
> ASSERT0(write_sz);