| 1612 | } |
| 1613 | |
| 1614 | static void |
| 1615 | issue_data_read(struct send_reader_thread_arg *srta, struct send_range *range) |
| 1616 | { |
| 1617 | struct srd *srdp = &range->sru.data; |
| 1618 | blkptr_t *bp = &srdp->bp; |
| 1619 | objset_t *os = srta->smta->os; |
| 1620 | |
| 1621 | ASSERT3U(range->type, ==, DATA); |
| 1622 | ASSERT3U(range->start_blkid + 1, ==, range->end_blkid); |
| 1623 | /* |
| 1624 | * If we have large blocks stored on disk but |
| 1625 | * the send flags don't allow us to send large |
| 1626 | * blocks, we split the data from the arc buf |
| 1627 | * into chunks. |
| 1628 | */ |
| 1629 | boolean_t split_large_blocks = |
| 1630 | srdp->datablksz > SPA_OLD_MAXBLOCKSIZE && |
| 1631 | !(srta->featureflags & DMU_BACKUP_FEATURE_LARGE_BLOCKS); |
| 1632 | /* |
| 1633 | * We should only request compressed data from the ARC if all |
| 1634 | * the following are true: |
| 1635 | * - stream compression was requested |
| 1636 | * - we aren't splitting large blocks into smaller chunks |
| 1637 | * - the data won't need to be byteswapped before sending |
| 1638 | * - this isn't an embedded block |
| 1639 | * - this isn't metadata (if receiving on a different endian |
| 1640 | * system it can be byteswapped more easily) |
| 1641 | */ |
| 1642 | boolean_t request_compressed = |
| 1643 | (srta->featureflags & DMU_BACKUP_FEATURE_COMPRESSED) && |
| 1644 | !split_large_blocks && !BP_SHOULD_BYTESWAP(bp) && |
| 1645 | !BP_IS_EMBEDDED(bp) && !DMU_OT_IS_METADATA(BP_GET_TYPE(bp)); |
| 1646 | |
| 1647 | enum zio_flag zioflags = ZIO_FLAG_CANFAIL; |
| 1648 | |
| 1649 | if (srta->featureflags & DMU_BACKUP_FEATURE_RAW) |
| 1650 | zioflags |= ZIO_FLAG_RAW; |
| 1651 | else if (request_compressed) |
| 1652 | zioflags |= ZIO_FLAG_RAW_COMPRESS; |
| 1653 | |
| 1654 | srdp->datasz = (zioflags & ZIO_FLAG_RAW_COMPRESS) ? |
| 1655 | BP_GET_PSIZE(bp) : BP_GET_LSIZE(bp); |
| 1656 | |
| 1657 | if (!srta->issue_reads) |
| 1658 | return; |
| 1659 | if (BP_IS_REDACTED(bp)) |
| 1660 | return; |
| 1661 | if (send_do_embed(bp, srta->featureflags)) |
| 1662 | return; |
| 1663 | |
| 1664 | zbookmark_phys_t zb = { |
| 1665 | .zb_objset = dmu_objset_id(os), |
| 1666 | .zb_object = range->object, |
| 1667 | .zb_level = 0, |
| 1668 | .zb_blkid = range->start_blkid, |
| 1669 | }; |
| 1670 | |
| 1671 | arc_flags_t aflags = ARC_FLAG_CACHED_ONLY; |
no test coverage detected