mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zstream: consolidate shared code
zstream currently contains three identical copies of dump_record(), which appear to all be drawn from libzfs_sendrecv.c. The original is marked internal. This PR adds zstream_util.[hc] and puts the shared code there along with a couple of other items in common. No functional changes. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Garth Snyder <garth@garthsnyder.com> Closes #18284
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include <sys/zio.h>
|
||||
#include <zfs_fletcher.h>
|
||||
#include "zstream.h"
|
||||
#include "zstream_util.h"
|
||||
|
||||
/*
|
||||
* If dump mode is enabled, the number of bytes to print per line
|
||||
@@ -60,18 +61,6 @@ static FILE *send_stream = 0;
|
||||
static boolean_t do_byteswap = B_FALSE;
|
||||
static boolean_t do_cksum = B_TRUE;
|
||||
|
||||
void *
|
||||
safe_malloc(size_t size)
|
||||
{
|
||||
void *rv = malloc(size);
|
||||
if (rv == NULL) {
|
||||
(void) fprintf(stderr, "ERROR; failed to allocate %zu bytes\n",
|
||||
size);
|
||||
abort();
|
||||
}
|
||||
return (rv);
|
||||
}
|
||||
|
||||
/*
|
||||
* ssread - send stream read.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user