Merge commit 'refs/top-bases/linux-kernel-disk' into linux-kernel-disk
This commit is contained in:
commit
5200db236f
|
@ -956,6 +956,28 @@ dmu_recv_abort_cleanup(dmu_recv_cookie_t *drc)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute checksum of drr_begin record
|
||||
*/
|
||||
static void
|
||||
dmu_recv_stream_cksum(struct restorearg *ra)
|
||||
{
|
||||
dmu_replay_record_t *drr;
|
||||
|
||||
drr = kmem_zalloc(sizeof (dmu_replay_record_t), KM_SLEEP);
|
||||
|
||||
drr->drr_type = DRR_BEGIN;
|
||||
drr->drr_u.drr_begin = *drc->drc_drrb;
|
||||
if (ra->byteswap) {
|
||||
fletcher_4_incremental_byteswap(drr,
|
||||
sizeof (dmu_replay_record_t), &(ra->cksum));
|
||||
} else {
|
||||
fletcher_4_incremental_native(drr,
|
||||
sizeof (dmu_replay_record_t), &(ra->cksum));
|
||||
}
|
||||
kmem_free(drr, sizeof (dmu_replay_record_t));
|
||||
}
|
||||
|
||||
/*
|
||||
* NB: callers *must* call dmu_recv_end() if this succeeds.
|
||||
*/
|
||||
|
@ -970,22 +992,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, vnode_t *vp, offset_t *voffp)
|
|||
if (drc->drc_drrb->drr_magic == BSWAP_64(DMU_BACKUP_MAGIC))
|
||||
ra.byteswap = TRUE;
|
||||
|
||||
{
|
||||
/* compute checksum of drr_begin record */
|
||||
dmu_replay_record_t *drr;
|
||||
drr = kmem_zalloc(sizeof (dmu_replay_record_t), KM_SLEEP);
|
||||
|
||||
drr->drr_type = DRR_BEGIN;
|
||||
drr->drr_u.drr_begin = *drc->drc_drrb;
|
||||
if (ra.byteswap) {
|
||||
fletcher_4_incremental_byteswap(drr,
|
||||
sizeof (dmu_replay_record_t), &ra.cksum);
|
||||
} else {
|
||||
fletcher_4_incremental_native(drr,
|
||||
sizeof (dmu_replay_record_t), &ra.cksum);
|
||||
}
|
||||
kmem_free(drr, sizeof (dmu_replay_record_t));
|
||||
}
|
||||
dmu_recv_stream_cksum(&ra);
|
||||
|
||||
if (ra.byteswap) {
|
||||
struct drr_begin *drrb = drc->drc_drrb;
|
||||
|
|
Loading…
Reference in New Issue