Rebase master to b108
[zfs.git] / lib / libzfs / include / libzfs.h
index c650865..a259fb4 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -29,6 +29,7 @@
 
 #include <assert.h>
 #include <libnvpair.h>
+#include <sys/mnttab.h>
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/varargs.h>
@@ -175,6 +176,13 @@ extern void libzfs_print_on_error(libzfs_handle_t *, boolean_t);
 extern int libzfs_errno(libzfs_handle_t *);
 extern const char *libzfs_error_action(libzfs_handle_t *);
 extern const char *libzfs_error_description(libzfs_handle_t *);
+extern void libzfs_mnttab_init(libzfs_handle_t *);
+extern void libzfs_mnttab_fini(libzfs_handle_t *);
+extern int libzfs_mnttab_find(libzfs_handle_t *, const char *,
+    struct mnttab *);
+extern void libzfs_mnttab_add(libzfs_handle_t *, const char *,
+    const char *, const char *);
+extern void libzfs_mnttab_remove(libzfs_handle_t *, const char *);
 
 /*
  * Basic handle functions
@@ -256,9 +264,15 @@ typedef enum {
        ZPOOL_STATUS_HOSTID_MISMATCH,   /* last accessed by another system */
        ZPOOL_STATUS_IO_FAILURE_WAIT,   /* failed I/O, failmode 'wait' */
        ZPOOL_STATUS_IO_FAILURE_CONTINUE, /* failed I/O, failmode 'continue' */
+       ZPOOL_STATUS_BAD_LOG,           /* cannot read log chain(s) */
+
+       /*
+        * These faults have no corresponding message ID.  At the time we are
+        * checking the status, the original reason for the FMA fault (I/O or
+        * checksum errors) has been lost.
+        */
        ZPOOL_STATUS_FAULTED_DEV_R,     /* faulted device with replicas */
        ZPOOL_STATUS_FAULTED_DEV_NR,    /* faulted device with no replicas */
-       ZPOOL_STATUS_BAD_LOG,           /* cannot read log chain(s) */
 
        /*
         * The following are not faults per se, but still an error possibly
@@ -289,6 +303,7 @@ extern int zpool_get_errlog(zpool_handle_t *, nvlist_t **);
  * Import and export functions
  */
 extern int zpool_export(zpool_handle_t *, boolean_t);
+extern int zpool_export_force(zpool_handle_t *);
 extern int zpool_import(libzfs_handle_t *, nvlist_t *, const char *,
     char *altroot);
 extern int zpool_import_props(libzfs_handle_t *, nvlist_t *, const char *,
@@ -457,6 +472,9 @@ typedef struct recvflags {
 
        /* byteswap flag is used internally; callers need not specify */
        int byteswap : 1;
+
+       /* do not mount file systems as they are extracted (private) */
+       int nomount : 1;
 } recvflags_t;
 
 extern int zfs_receive(libzfs_handle_t *, const char *, recvflags_t,