summaryrefslogtreecommitdiff
path: root/usr/src/cmd/zinject/zinject.c
diff options
context:
space:
mode:
authoreschrock <none@none>2006-05-30 15:47:16 -0700
committereschrock <none@none>2006-05-30 15:47:16 -0700
commit99653d4ee642c6528e88224f12409a5f23060994 (patch)
tree5cbcc540b8ed86b6a008f1084f9ca031368d926f /usr/src/cmd/zinject/zinject.c
parent354a1801a85aa6b61ff4d5e290ab708ba57e56a3 (diff)
downloadillumos-joyent-99653d4ee642c6528e88224f12409a5f23060994.tar.gz
PSARC 2006/223 ZFS Hot Spares
PSARC 2006/303 ZFS Clone Promotion 6276916 support for "clone swap" 6288488 du reports misleading size on RAID-Z 6393490 libzfs should be a real library 6397148 fbufs debug code should be removed from buf_hash_insert() 6405966 Hot Spare support in ZFS 6409302 passing a non-root vdev via zpool_create() panics system 6415739 assertion failed: !(zio->io_flags & 0x00040) 6416759 ::dbufs does not find bonus buffers anymore 6417978 double parity RAID-Z a.k.a. RAID6 6424554 full block re-writes need not read data in 6425111 detaching an offline device can result in import confusion
Diffstat (limited to 'usr/src/cmd/zinject/zinject.c')
-rw-r--r--usr/src/cmd/zinject/zinject.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr/src/cmd/zinject/zinject.c b/usr/src/cmd/zinject/zinject.c
index b584fb0de5..02fc6a16ef 100644
--- a/usr/src/cmd/zinject/zinject.c
+++ b/usr/src/cmd/zinject/zinject.c
@@ -151,6 +151,7 @@
#include "zinject.h"
+libzfs_handle_t *g_zfs;
int zfs_fd;
#define ECKSUM EBADE
@@ -479,6 +480,14 @@ main(int argc, char **argv)
int ret;
int flags = 0;
+ if ((g_zfs = libzfs_init()) == NULL) {
+ (void) fprintf(stderr, "internal error: failed to "
+ "initialize ZFS library\n");
+ return (1);
+ }
+
+ libzfs_print_on_error(g_zfs, B_TRUE);
+
if ((zfs_fd = open(ZFS_DEV, O_RDWR)) < 0) {
(void) fprintf(stderr, "failed to open ZFS device\n");
return (1);
@@ -721,7 +730,7 @@ main(int argc, char **argv)
* time we access the pool.
*/
if (dataset[0] != '\0' && domount) {
- if ((zhp = zfs_open(dataset, ZFS_TYPE_ANY)) == NULL)
+ if ((zhp = zfs_open(g_zfs, dataset, ZFS_TYPE_ANY)) == NULL)
return (1);
if (zfs_unmount(zhp, NULL, 0) != 0)
@@ -735,5 +744,7 @@ main(int argc, char **argv)
if (dataset[0] != '\0' && domount)
ret = (zfs_mount(zhp, NULL, 0) != 0);
+ libzfs_fini(g_zfs);
+
return (ret);
}