summaryrefslogtreecommitdiff
path: root/usr/src/lib/libzfs/common/libzfs_impl.h
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/lib/libzfs/common/libzfs_impl.h
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/lib/libzfs/common/libzfs_impl.h')
-rw-r--r--usr/src/lib/libzfs/common/libzfs_impl.h49
1 files changed, 31 insertions, 18 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_impl.h b/usr/src/lib/libzfs/common/libzfs_impl.h
index 76bca21242..2c5e890767 100644
--- a/usr/src/lib/libzfs/common/libzfs_impl.h
+++ b/usr/src/lib/libzfs/common/libzfs_impl.h
@@ -34,13 +34,29 @@
#include <sys/zfs_acl.h>
#include <sys/nvpair.h>
+#include <libuutil.h>
#include <libzfs.h>
#ifdef __cplusplus
extern "C" {
#endif
+struct libzfs_handle {
+ int libzfs_error;
+ int libzfs_fd;
+ FILE *libzfs_mnttab;
+ FILE *libzfs_sharetab;
+ uu_avl_pool_t *libzfs_ns_avlpool;
+ uu_avl_t *libzfs_ns_avl;
+ uint64_t libzfs_ns_gen;
+ int libzfs_desc_active;
+ char libzfs_action[1024];
+ char libzfs_desc[1024];
+ int libzfs_printerr;
+};
+
struct zfs_handle {
+ libzfs_handle_t *zfs_hdl;
char zfs_name[ZFS_MAXNAMELEN];
zfs_type_t zfs_type;
dmu_objset_stats_t zfs_dmustats;
@@ -52,6 +68,7 @@ struct zfs_handle {
};
struct zpool_handle {
+ libzfs_handle_t *zpool_hdl;
char zpool_name[ZPOOL_MAXNAMELEN];
int zpool_state;
size_t zpool_config_size;
@@ -61,18 +78,16 @@ struct zpool_handle {
size_t zpool_error_count;
};
-void zfs_error(const char *, ...);
-void zfs_fatal(const char *, ...);
-void *zfs_malloc(size_t);
-char *zfs_strdup(const char *);
-void no_memory(void);
+int zfs_error(libzfs_handle_t *, int, const char *, ...);
+void zfs_error_aux(libzfs_handle_t *, const char *, ...);
+void *zfs_alloc(libzfs_handle_t *, size_t);
+char *zfs_strdup(libzfs_handle_t *, const char *);
+int no_memory(libzfs_handle_t *);
-#define zfs_baderror(err) \
- (zfs_fatal(dgettext(TEXT_DOMAIN, \
- "internal error: unexpected error %d at line %d of %s"), \
- (err), (__LINE__), (__FILE__)))
+int zfs_standard_error(libzfs_handle_t *, int, const char *, ...);
+int zpool_standard_error(libzfs_handle_t *, int, const char *, ...);
-char **get_dependents(const char *, size_t *);
+char **get_dependents(libzfs_handle_t *, const char *, size_t *);
typedef struct prop_changelist prop_changelist_t;
@@ -87,17 +102,15 @@ int changelist_haszonedchild(prop_changelist_t *);
void remove_mountpoint(zfs_handle_t *);
-zfs_handle_t *make_dataset_handle(const char *);
-void set_pool_health(nvlist_t *);
+zfs_handle_t *make_dataset_handle(libzfs_handle_t *, const char *);
+int set_pool_health(nvlist_t *);
-zpool_handle_t *zpool_open_silent(const char *);
+zpool_handle_t *zpool_open_silent(libzfs_handle_t *, const char *);
-int zvol_create_link(const char *);
-int zvol_remove_link(const char *);
+int zvol_create_link(libzfs_handle_t *, const char *);
+int zvol_remove_link(libzfs_handle_t *, const char *);
-int zfs_ioctl(int, zfs_cmd_t *);
-FILE *zfs_mnttab(void);
-FILE *zfs_sharetab(void);
+void namespace_clear(libzfs_handle_t *);
#ifdef __cplusplus
}