Add linux topology support
[zfs.git] / lib / libzfs / libzfs_sendrecv.c
index 95c4b35..87ffd12 100644 (file)
@@ -43,7 +43,6 @@
 #include "zfs_prop.h"
 #include "zfs_fletcher.h"
 #include "libzfs_impl.h"
-#include <sha2.h>
 #include <sys/zio_checksum.h>
 #include <sys/ddt.h>
 
@@ -336,12 +335,11 @@ cksummer(void *arg)
                        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] =
@@ -1413,7 +1411,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
                ++holdseq;
                (void) snprintf(sdd.holdtag, sizeof (sdd.holdtag),
                    ".send-%d-%llu", getpid(), (u_longlong_t)holdseq);
-               sdd.cleanup_fd = open(ZFS_DEV, O_RDWR|O_EXCL);
+               sdd.cleanup_fd = open(ZFS_DEV, O_RDWR);
                if (sdd.cleanup_fd < 0) {
                        err = errno;
                        goto stderr_out;
@@ -2988,7 +2986,7 @@ zfs_receive(libzfs_handle_t *hdl, const char *tosnap, recvflags_t flags,
        int cleanup_fd;
        uint64_t action_handle = 0;
 
-       cleanup_fd = open(ZFS_DEV, O_RDWR|O_EXCL);
+       cleanup_fd = open(ZFS_DEV, O_RDWR);
        VERIFY(cleanup_fd >= 0);
 
        err = zfs_receive_impl(hdl, tosnap, flags, infd, NULL, NULL,