git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve the wording about hot spares
[zfs.git]
/
lib
/
libzfs
/
libzfs_sendrecv.c
diff --git
a/lib/libzfs/libzfs_sendrecv.c
b/lib/libzfs/libzfs_sendrecv.c
index
48e7717
..
94e64e6
100644
(file)
--- a/
lib/libzfs/libzfs_sendrecv.c
+++ b/
lib/libzfs/libzfs_sendrecv.c
@@
-34,6
+34,11
@@
#include <stddef.h>
#include <fcntl.h>
#include <sys/mount.h>
#include <stddef.h>
#include <fcntl.h>
#include <sys/mount.h>
+#include <sys/mntent.h>
+#include <sys/mnttab.h>
+#include <sys/avl.h>
+#include <sys/debug.h>
+#include <stddef.h>
#include <pthread.h>
#include <umem.h>
#include <pthread.h>
#include <umem.h>
@@
-43,7
+48,6
@@
#include "zfs_prop.h"
#include "zfs_fletcher.h"
#include "libzfs_impl.h"
#include "zfs_prop.h"
#include "zfs_fletcher.h"
#include "libzfs_impl.h"
-#include <sha2.h>
#include <sys/zio_checksum.h>
#include <sys/ddt.h>
#include <sys/zio_checksum.h>
#include <sys/ddt.h>
@@
-336,12
+340,11
@@
cksummer(void *arg)
if (ZIO_CHECKSUM_EQUAL(drrw->drr_key.ddk_cksum,
zero_cksum) ||
!DRR_IS_DEDUP_CAPABLE(drrw->drr_checksumflags)) {
if (ZIO_CHECKSUM_EQUAL(drrw->drr_key.ddk_cksum,
zero_cksum) ||
!DRR_IS_DEDUP_CAPABLE(drrw->drr_checksumflags)) {
- SHA256_CTX ctx;
- zio_cksum_t tmpsha256;
+ zio_cksum_t tmpsha256;
+
+ zio_checksum_SHA256(buf,
+ drrw->drr_length, &tmpsha256);
- SHA256Init(&ctx);
- SHA256Update(&ctx, buf, drrw->drr_length);
- SHA256Final(&tmpsha256, &ctx);
drrw->drr_key.ddk_cksum.zc_word[0] =
BE_64(tmpsha256.zc_word[0]);
drrw->drr_key.ddk_cksum.zc_word[1] =
drrw->drr_key.ddk_cksum.zc_word[0] =
BE_64(tmpsha256.zc_word[0]);
drrw->drr_key.ddk_cksum.zc_word[1] =
@@
-2610,6
+2613,12
@@
zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
return (-1);
}
}
return (-1);
}
}
+ if (!flags.dryrun && zhp->zfs_type == ZFS_TYPE_VOLUME &&
+ zvol_remove_link(hdl, zhp->zfs_name) != 0) {
+ zfs_close(zhp);
+ zcmd_free_nvlists(&zc);
+ return (-1);
+ }
zfs_close(zhp);
} else {
/*
zfs_close(zhp);
} else {
/*
@@
-2815,6
+2824,10
@@
zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
if (h != NULL) {
if (h->zfs_type == ZFS_TYPE_VOLUME) {
*cp = '@';
if (h != NULL) {
if (h->zfs_type == ZFS_TYPE_VOLUME) {
*cp = '@';
+ err = zvol_create_link(hdl, h->zfs_name);
+ if (err == 0 && ioctl_err == 0)
+ err = zvol_create_link(hdl,
+ zc.zc_value);
} else if (newfs || stream_avl) {
/*
* Track the first/top of hierarchy fs,
} else if (newfs || stream_avl) {
/*
* Track the first/top of hierarchy fs,