Remove dead code and cleanup scoping in dmu_send.c

This addresses a number of problems with dmu_send.c:

* bp_span is unused which makes clang complain
* dump_write conflicts with FreeBSD's existing core dump code
* range_alloc is private to the file and not declared in any headers
  causing clang to complain

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9432
This commit is contained in:
Matthew Macy 2019-10-13 19:25:19 -07:00 committed by Brian Behlendorf
parent 511fce6b1f
commit 177c79dfbe

View File

@ -112,17 +112,6 @@ overflow_multiply(uint64_t a, uint64_t b, uint64_t *c)
return (B_TRUE);
}
/*
* Return B_TRUE and modifies *out to the span if the span is less than 2^64,
* returns B_FALSE otherwise.
*/
static inline boolean_t
bp_span(uint32_t datablksz, uint8_t indblkshift, uint64_t level, uint64_t *out)
{
uint64_t spanb = bp_span_in_blocks(indblkshift, level);
return (overflow_multiply(spanb, datablksz, out));
}
struct send_thread_arg {
bqueue_t q;
dsl_dataset_t *ds; /* Dataset to traverse */
@ -468,7 +457,7 @@ dump_redact(dmu_send_cookie_t *dscp, uint64_t object, uint64_t offset,
}
static int
dump_write(dmu_send_cookie_t *dscp, dmu_object_type_t type, uint64_t object,
dmu_dump_write(dmu_send_cookie_t *dscp, dmu_object_type_t type, uint64_t object,
uint64_t offset, int lsize, int psize, const blkptr_t *bp, void *data)
{
uint64_t payload_size;
@ -1057,7 +1046,7 @@ do_dump(dmu_send_cookie_t *dscp, struct send_range *range)
while (srdp->datablksz > 0 && err == 0) {
int n = MIN(srdp->datablksz,
SPA_OLD_MAXBLOCKSIZE);
err = dump_write(dscp, srdp->obj_type,
err = dmu_dump_write(dscp, srdp->obj_type,
range->object, offset, n, n, NULL, buf);
offset += n;
buf += n;
@ -1076,8 +1065,8 @@ do_dump(dmu_send_cookie_t *dscp, struct send_range *range)
} else {
psize = BP_GET_PSIZE(bp);
}
err = dump_write(dscp, srdp->obj_type, range->object,
offset, srdp->datablksz, psize, bp,
err = dmu_dump_write(dscp, srdp->obj_type,
range->object, offset, srdp->datablksz, psize, bp,
(abuf == NULL ? NULL : abuf->b_data));
}
if (abuf != NULL)
@ -1116,7 +1105,7 @@ do_dump(dmu_send_cookie_t *dscp, struct send_range *range)
return (err);
}
struct send_range *
static struct send_range *
range_alloc(enum type type, uint64_t object, uint64_t start_blkid,
uint64_t end_blkid, boolean_t eos)
{