usr/src/lib/libzfs/common/libzfs.h
changeset 13700 2889e2596bd6
parent 13686 4bc0783f6064
child 13743 95aba6e49b9f
equal deleted inserted replaced
13699:733714f4dc24 13700:2889e2596bd6
   289 	ZPOOL_STATUS_IO_FAILURE_WAIT,	/* failed I/O, failmode 'wait' */
   289 	ZPOOL_STATUS_IO_FAILURE_WAIT,	/* failed I/O, failmode 'wait' */
   290 	ZPOOL_STATUS_IO_FAILURE_CONTINUE, /* failed I/O, failmode 'continue' */
   290 	ZPOOL_STATUS_IO_FAILURE_CONTINUE, /* failed I/O, failmode 'continue' */
   291 	ZPOOL_STATUS_BAD_LOG,		/* cannot read log chain(s) */
   291 	ZPOOL_STATUS_BAD_LOG,		/* cannot read log chain(s) */
   292 
   292 
   293 	/*
   293 	/*
       
   294 	 * If the pool has unsupported features but can still be opened in
       
   295 	 * read-only mode, its status is ZPOOL_STATUS_UNSUP_FEAT_WRITE. If the
       
   296 	 * pool has unsupported features but cannot be opened at all, its
       
   297 	 * status is ZPOOL_STATUS_UNSUP_FEAT_READ.
       
   298 	 */
       
   299 	ZPOOL_STATUS_UNSUP_FEAT_READ,	/* unsupported features for read */
       
   300 	ZPOOL_STATUS_UNSUP_FEAT_WRITE,	/* unsupported features for write */
       
   301 
       
   302 	/*
   294 	 * These faults have no corresponding message ID.  At the time we are
   303 	 * These faults have no corresponding message ID.  At the time we are
   295 	 * checking the status, the original reason for the FMA fault (I/O or
   304 	 * checking the status, the original reason for the FMA fault (I/O or
   296 	 * checksum errors) has been lost.
   305 	 * checksum errors) has been lost.
   297 	 */
   306 	 */
   298 	ZPOOL_STATUS_FAULTED_DEV_R,	/* faulted device with replicas */
   307 	ZPOOL_STATUS_FAULTED_DEV_R,	/* faulted device with replicas */
   320 
   329 
   321 /*
   330 /*
   322  * Statistics and configuration functions.
   331  * Statistics and configuration functions.
   323  */
   332  */
   324 extern nvlist_t *zpool_get_config(zpool_handle_t *, nvlist_t **);
   333 extern nvlist_t *zpool_get_config(zpool_handle_t *, nvlist_t **);
       
   334 extern nvlist_t *zpool_get_features(zpool_handle_t *);
   325 extern int zpool_refresh_stats(zpool_handle_t *, boolean_t *);
   335 extern int zpool_refresh_stats(zpool_handle_t *, boolean_t *);
   326 extern int zpool_get_errlog(zpool_handle_t *, nvlist_t **);
   336 extern int zpool_get_errlog(zpool_handle_t *, nvlist_t **);
   327 
   337 
   328 /*
   338 /*
   329  * Import and export functions
   339  * Import and export functions
   332 extern int zpool_export_force(zpool_handle_t *);
   342 extern int zpool_export_force(zpool_handle_t *);
   333 extern int zpool_import(libzfs_handle_t *, nvlist_t *, const char *,
   343 extern int zpool_import(libzfs_handle_t *, nvlist_t *, const char *,
   334     char *altroot);
   344     char *altroot);
   335 extern int zpool_import_props(libzfs_handle_t *, nvlist_t *, const char *,
   345 extern int zpool_import_props(libzfs_handle_t *, nvlist_t *, const char *,
   336     nvlist_t *, int);
   346     nvlist_t *, int);
       
   347 extern void zpool_print_unsup_feat(nvlist_t *config);
   337 
   348 
   338 /*
   349 /*
   339  * Search for pools to import
   350  * Search for pools to import
   340  */
   351  */
   341 
   352 
   421     char *propbuf, int proplen, boolean_t literal);
   432     char *propbuf, int proplen, boolean_t literal);
   422 extern int zfs_prop_get_written_int(zfs_handle_t *zhp, const char *propname,
   433 extern int zfs_prop_get_written_int(zfs_handle_t *zhp, const char *propname,
   423     uint64_t *propvalue);
   434     uint64_t *propvalue);
   424 extern int zfs_prop_get_written(zfs_handle_t *zhp, const char *propname,
   435 extern int zfs_prop_get_written(zfs_handle_t *zhp, const char *propname,
   425     char *propbuf, int proplen, boolean_t literal);
   436     char *propbuf, int proplen, boolean_t literal);
       
   437 extern int zfs_prop_get_feature(zfs_handle_t *zhp, const char *propname,
       
   438     char *buf, size_t len);
   426 extern int zfs_get_snapused_int(zfs_handle_t *firstsnap, zfs_handle_t *lastsnap,
   439 extern int zfs_get_snapused_int(zfs_handle_t *firstsnap, zfs_handle_t *lastsnap,
   427     uint64_t *usedp);
   440     uint64_t *usedp);
   428 extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t);
   441 extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t);
   429 extern int zfs_prop_inherit(zfs_handle_t *, const char *, boolean_t);
   442 extern int zfs_prop_inherit(zfs_handle_t *, const char *, boolean_t);
   430 extern const char *zfs_prop_values(zfs_prop_t);
   443 extern const char *zfs_prop_values(zfs_prop_t);
   448 extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *);
   461 extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *);
   449 
   462 
   450 #define	ZFS_MOUNTPOINT_NONE	"none"
   463 #define	ZFS_MOUNTPOINT_NONE	"none"
   451 #define	ZFS_MOUNTPOINT_LEGACY	"legacy"
   464 #define	ZFS_MOUNTPOINT_LEGACY	"legacy"
   452 
   465 
       
   466 #define	ZFS_FEATURE_DISABLED	"disabled"
       
   467 #define	ZFS_FEATURE_ENABLED	"enabled"
       
   468 #define	ZFS_FEATURE_ACTIVE	"active"
       
   469 
       
   470 #define	ZFS_UNSUPPORTED_INACTIVE	"inactive"
       
   471 #define	ZFS_UNSUPPORTED_READONLY	"readonly"
       
   472 
   453 /*
   473 /*
   454  * zpool property management
   474  * zpool property management
   455  */
   475  */
   456 extern int zpool_expand_proplist(zpool_handle_t *, zprop_list_t **);
   476 extern int zpool_expand_proplist(zpool_handle_t *, zprop_list_t **);
       
   477 extern int zpool_prop_get_feature(zpool_handle_t *, const char *, char *,
       
   478     size_t);
   457 extern const char *zpool_prop_default_string(zpool_prop_t);
   479 extern const char *zpool_prop_default_string(zpool_prop_t);
   458 extern uint64_t zpool_prop_default_numeric(zpool_prop_t);
   480 extern uint64_t zpool_prop_default_numeric(zpool_prop_t);
   459 extern const char *zpool_prop_column_name(zpool_prop_t);
   481 extern const char *zpool_prop_column_name(zpool_prop_t);
   460 extern boolean_t zpool_prop_align_right(zpool_prop_t);
   482 extern boolean_t zpool_prop_align_right(zpool_prop_t);
   461 
   483