Deleted Added
full compact
libzfs.h (207670) libzfs.h (209962)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 15 unchanged lines hidden (view full) ---

24 * Use is subject to license terms.
25 */
26
27#ifndef _LIBZFS_H
28#define _LIBZFS_H
29
30#include <assert.h>
31#include <libnvpair.h>
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 15 unchanged lines hidden (view full) ---

24 * Use is subject to license terms.
25 */
26
27#ifndef _LIBZFS_H
28#define _LIBZFS_H
29
30#include <assert.h>
31#include <libnvpair.h>
32#include <sys/mnttab.h>
32#include <sys/param.h>
33#include <sys/types.h>
34#include <sys/varargs.h>
35#include <sys/fs/zfs.h>
36#include <sys/avl.h>
37#include <sys/zfs_ioctl.h>
38
39#ifdef __cplusplus

--- 130 unchanged lines hidden (view full) ---

170extern libzfs_handle_t *zpool_get_handle(zpool_handle_t *);
171extern libzfs_handle_t *zfs_get_handle(zfs_handle_t *);
172
173extern void libzfs_print_on_error(libzfs_handle_t *, boolean_t);
174
175extern int libzfs_errno(libzfs_handle_t *);
176extern const char *libzfs_error_action(libzfs_handle_t *);
177extern const char *libzfs_error_description(libzfs_handle_t *);
33#include <sys/param.h>
34#include <sys/types.h>
35#include <sys/varargs.h>
36#include <sys/fs/zfs.h>
37#include <sys/avl.h>
38#include <sys/zfs_ioctl.h>
39
40#ifdef __cplusplus

--- 130 unchanged lines hidden (view full) ---

171extern libzfs_handle_t *zpool_get_handle(zpool_handle_t *);
172extern libzfs_handle_t *zfs_get_handle(zfs_handle_t *);
173
174extern void libzfs_print_on_error(libzfs_handle_t *, boolean_t);
175
176extern int libzfs_errno(libzfs_handle_t *);
177extern const char *libzfs_error_action(libzfs_handle_t *);
178extern const char *libzfs_error_description(libzfs_handle_t *);
179extern void libzfs_mnttab_init(libzfs_handle_t *);
180extern void libzfs_mnttab_fini(libzfs_handle_t *);
181extern void libzfs_mnttab_cache(libzfs_handle_t *, boolean_t);
182extern int libzfs_mnttab_find(libzfs_handle_t *, const char *,
183 struct mnttab *);
184extern void libzfs_mnttab_add(libzfs_handle_t *, const char *,
185 const char *, const char *);
186extern void libzfs_mnttab_remove(libzfs_handle_t *, const char *);
178
179/*
180 * Basic handle functions
181 */
182extern zpool_handle_t *zpool_open(libzfs_handle_t *, const char *);
183extern zpool_handle_t *zpool_open_canfail(libzfs_handle_t *, const char *);
184extern void zpool_close(zpool_handle_t *);
185extern const char *zpool_get_name(zpool_handle_t *);

--- 65 unchanged lines hidden (view full) ---

251 ZPOOL_STATUS_BAD_GUID_SUM, /* sum of device guids didn't match */
252 ZPOOL_STATUS_CORRUPT_POOL, /* pool metadata is corrupted */
253 ZPOOL_STATUS_CORRUPT_DATA, /* data errors in user (meta)data */
254 ZPOOL_STATUS_FAILING_DEV, /* device experiencing errors */
255 ZPOOL_STATUS_VERSION_NEWER, /* newer on-disk version */
256 ZPOOL_STATUS_HOSTID_MISMATCH, /* last accessed by another system */
257 ZPOOL_STATUS_IO_FAILURE_WAIT, /* failed I/O, failmode 'wait' */
258 ZPOOL_STATUS_IO_FAILURE_CONTINUE, /* failed I/O, failmode 'continue' */
187
188/*
189 * Basic handle functions
190 */
191extern zpool_handle_t *zpool_open(libzfs_handle_t *, const char *);
192extern zpool_handle_t *zpool_open_canfail(libzfs_handle_t *, const char *);
193extern void zpool_close(zpool_handle_t *);
194extern const char *zpool_get_name(zpool_handle_t *);

--- 65 unchanged lines hidden (view full) ---

260 ZPOOL_STATUS_BAD_GUID_SUM, /* sum of device guids didn't match */
261 ZPOOL_STATUS_CORRUPT_POOL, /* pool metadata is corrupted */
262 ZPOOL_STATUS_CORRUPT_DATA, /* data errors in user (meta)data */
263 ZPOOL_STATUS_FAILING_DEV, /* device experiencing errors */
264 ZPOOL_STATUS_VERSION_NEWER, /* newer on-disk version */
265 ZPOOL_STATUS_HOSTID_MISMATCH, /* last accessed by another system */
266 ZPOOL_STATUS_IO_FAILURE_WAIT, /* failed I/O, failmode 'wait' */
267 ZPOOL_STATUS_IO_FAILURE_CONTINUE, /* failed I/O, failmode 'continue' */
268 ZPOOL_STATUS_BAD_LOG, /* cannot read log chain(s) */
269
270 /*
271 * These faults have no corresponding message ID. At the time we are
272 * checking the status, the original reason for the FMA fault (I/O or
273 * checksum errors) has been lost.
274 */
259 ZPOOL_STATUS_FAULTED_DEV_R, /* faulted device with replicas */
260 ZPOOL_STATUS_FAULTED_DEV_NR, /* faulted device with no replicas */
275 ZPOOL_STATUS_FAULTED_DEV_R, /* faulted device with replicas */
276 ZPOOL_STATUS_FAULTED_DEV_NR, /* faulted device with no replicas */
261 ZPOOL_STATUS_BAD_LOG, /* cannot read log chain(s) */
262
263 /*
264 * The following are not faults per se, but still an error possibly
265 * requiring administrative attention. There is no corresponding
266 * message ID.
267 */
268 ZPOOL_STATUS_VERSION_OLDER, /* older on-disk version */
269 ZPOOL_STATUS_RESILVERING, /* device being resilvered */

--- 79 unchanged lines hidden (view full) ---

349 nvlist_t *, uint64_t, zfs_handle_t *, const char *);
350
351extern const char *zfs_prop_to_name(zfs_prop_t);
352extern int zfs_prop_set(zfs_handle_t *, const char *, const char *);
353extern int zfs_prop_get(zfs_handle_t *, zfs_prop_t, char *, size_t,
354 zprop_source_t *, char *, size_t, boolean_t);
355extern int zfs_prop_get_numeric(zfs_handle_t *, zfs_prop_t, uint64_t *,
356 zprop_source_t *, char *, size_t);
277
278 /*
279 * The following are not faults per se, but still an error possibly
280 * requiring administrative attention. There is no corresponding
281 * message ID.
282 */
283 ZPOOL_STATUS_VERSION_OLDER, /* older on-disk version */
284 ZPOOL_STATUS_RESILVERING, /* device being resilvered */

--- 79 unchanged lines hidden (view full) ---

364 nvlist_t *, uint64_t, zfs_handle_t *, const char *);
365
366extern const char *zfs_prop_to_name(zfs_prop_t);
367extern int zfs_prop_set(zfs_handle_t *, const char *, const char *);
368extern int zfs_prop_get(zfs_handle_t *, zfs_prop_t, char *, size_t,
369 zprop_source_t *, char *, size_t, boolean_t);
370extern int zfs_prop_get_numeric(zfs_handle_t *, zfs_prop_t, uint64_t *,
371 zprop_source_t *, char *, size_t);
372extern int zfs_prop_get_userquota_int(zfs_handle_t *zhp, const char *propname,
373 uint64_t *propvalue);
374extern int zfs_prop_get_userquota(zfs_handle_t *zhp, const char *propname,
375 char *propbuf, int proplen, boolean_t literal);
357extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t);
358extern int zfs_prop_inherit(zfs_handle_t *, const char *);
359extern const char *zfs_prop_values(zfs_prop_t);
360extern int zfs_prop_is_string(zfs_prop_t prop);
361extern nvlist_t *zfs_get_user_props(zfs_handle_t *);
362
363typedef struct zprop_list {
364 int pl_prop;

--- 71 unchanged lines hidden (view full) ---

436extern int zfs_clone(zfs_handle_t *, const char *, nvlist_t *);
437extern int zfs_snapshot(libzfs_handle_t *, const char *, boolean_t, nvlist_t *);
438extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t);
439extern int zfs_rename(zfs_handle_t *, const char *, boolean_t);
440extern int zfs_send(zfs_handle_t *, const char *, const char *,
441 boolean_t, boolean_t, boolean_t, boolean_t, int);
442extern int zfs_promote(zfs_handle_t *);
443
376extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t);
377extern int zfs_prop_inherit(zfs_handle_t *, const char *);
378extern const char *zfs_prop_values(zfs_prop_t);
379extern int zfs_prop_is_string(zfs_prop_t prop);
380extern nvlist_t *zfs_get_user_props(zfs_handle_t *);
381
382typedef struct zprop_list {
383 int pl_prop;

--- 71 unchanged lines hidden (view full) ---

455extern int zfs_clone(zfs_handle_t *, const char *, nvlist_t *);
456extern int zfs_snapshot(libzfs_handle_t *, const char *, boolean_t, nvlist_t *);
457extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t);
458extern int zfs_rename(zfs_handle_t *, const char *, boolean_t);
459extern int zfs_send(zfs_handle_t *, const char *, const char *,
460 boolean_t, boolean_t, boolean_t, boolean_t, int);
461extern int zfs_promote(zfs_handle_t *);
462
463typedef int (*zfs_userspace_cb_t)(void *arg, const char *domain,
464 uid_t rid, uint64_t space);
465
466extern int zfs_userspace(zfs_handle_t *zhp, zfs_userquota_prop_t type,
467 zfs_userspace_cb_t func, void *arg);
468
444typedef struct recvflags {
445 /* print informational messages (ie, -v was specified) */
446 int verbose : 1;
447
448 /* the destination is a prefix, not the exact fs (ie, -d) */
449 int isprefix : 1;
450
451 /* do not actually do the recv, just check if it would work (ie, -n) */

--- 22 unchanged lines hidden (view full) ---

474extern void zfs_refresh_properties(zfs_handle_t *);
475extern int zfs_name_valid(const char *, zfs_type_t);
476extern zfs_handle_t *zfs_path_to_zhandle(libzfs_handle_t *, char *, zfs_type_t);
477extern boolean_t zfs_dataset_exists(libzfs_handle_t *, const char *,
478 zfs_type_t);
479extern int zfs_spa_version(zfs_handle_t *, int *);
480
481/*
469typedef struct recvflags {
470 /* print informational messages (ie, -v was specified) */
471 int verbose : 1;
472
473 /* the destination is a prefix, not the exact fs (ie, -d) */
474 int isprefix : 1;
475
476 /* do not actually do the recv, just check if it would work (ie, -n) */

--- 22 unchanged lines hidden (view full) ---

499extern void zfs_refresh_properties(zfs_handle_t *);
500extern int zfs_name_valid(const char *, zfs_type_t);
501extern zfs_handle_t *zfs_path_to_zhandle(libzfs_handle_t *, char *, zfs_type_t);
502extern boolean_t zfs_dataset_exists(libzfs_handle_t *, const char *,
503 zfs_type_t);
504extern int zfs_spa_version(zfs_handle_t *, int *);
505
506/*
482 * dataset permission functions.
483 */
484extern int zfs_perm_set(zfs_handle_t *, nvlist_t *);
485extern int zfs_perm_remove(zfs_handle_t *, nvlist_t *);
486extern int zfs_build_perms(zfs_handle_t *, char *, char *,
487 zfs_deleg_who_type_t, zfs_deleg_inherit_t, nvlist_t **nvlist_t);
488extern int zfs_perm_get(zfs_handle_t *, zfs_allow_t **);
489extern void zfs_free_allows(zfs_allow_t *);
490extern void zfs_deleg_permissions(void);
491
492/*
493 * Mount support functions.
494 */
495extern boolean_t is_mounted(libzfs_handle_t *, const char *special, char **);
496extern boolean_t zfs_is_mounted(zfs_handle_t *, char **);
497extern int zfs_mount(zfs_handle_t *, const char *, int);
498extern int zfs_unmount(zfs_handle_t *, const char *, int);
499extern int zfs_unmountall(zfs_handle_t *, int);
500

--- 19 unchanged lines hidden (view full) ---

520extern int zfs_unshareall_bypath(zfs_handle_t *, const char *);
521extern int zfs_unshareall(zfs_handle_t *);
522extern boolean_t zfs_is_shared_iscsi(zfs_handle_t *);
523extern int zfs_share_iscsi(zfs_handle_t *);
524extern int zfs_unshare_iscsi(zfs_handle_t *);
525#ifdef TODO
526extern int zfs_iscsi_perm_check(libzfs_handle_t *, char *, ucred_t *);
527#endif
507 * Mount support functions.
508 */
509extern boolean_t is_mounted(libzfs_handle_t *, const char *special, char **);
510extern boolean_t zfs_is_mounted(zfs_handle_t *, char **);
511extern int zfs_mount(zfs_handle_t *, const char *, int);
512extern int zfs_unmount(zfs_handle_t *, const char *, int);
513extern int zfs_unmountall(zfs_handle_t *, int);
514

--- 19 unchanged lines hidden (view full) ---

534extern int zfs_unshareall_bypath(zfs_handle_t *, const char *);
535extern int zfs_unshareall(zfs_handle_t *);
536extern boolean_t zfs_is_shared_iscsi(zfs_handle_t *);
537extern int zfs_share_iscsi(zfs_handle_t *);
538extern int zfs_unshare_iscsi(zfs_handle_t *);
539#ifdef TODO
540extern int zfs_iscsi_perm_check(libzfs_handle_t *, char *, ucred_t *);
541#endif
528extern int zfs_deleg_share_nfs(libzfs_handle_t *, char *, char *,
542extern int zfs_deleg_share_nfs(libzfs_handle_t *, char *, char *, char *,
529 void *, void *, int, zfs_share_op_t);
530
531/*
532 * FreeBSD-specific jail support function.
533 */
534extern int zfs_jail(zfs_handle_t *, int, int);
535
536/*

--- 29 unchanged lines hidden (view full) ---

566 */
567extern int zpool_create_zvol_links(zpool_handle_t *);
568extern int zpool_remove_zvol_links(zpool_handle_t *);
569
570/* is this zvol valid for use as a dump device? */
571extern int zvol_check_dump_config(char *);
572
573/*
543 void *, void *, int, zfs_share_op_t);
544
545/*
546 * FreeBSD-specific jail support function.
547 */
548extern int zfs_jail(zfs_handle_t *, int, int);
549
550/*

--- 29 unchanged lines hidden (view full) ---

580 */
581extern int zpool_create_zvol_links(zpool_handle_t *);
582extern int zpool_remove_zvol_links(zpool_handle_t *);
583
584/* is this zvol valid for use as a dump device? */
585extern int zvol_check_dump_config(char *);
586
587/*
588 * Management interfaces for SMB ACL files
589 */
590
591int zfs_smb_acl_add(libzfs_handle_t *, char *, char *, char *);
592int zfs_smb_acl_remove(libzfs_handle_t *, char *, char *, char *);
593int zfs_smb_acl_purge(libzfs_handle_t *, char *, char *);
594int zfs_smb_acl_rename(libzfs_handle_t *, char *, char *, char *, char *);
595
596/*
574 * Enable and disable datasets within a pool by mounting/unmounting and
575 * sharing/unsharing them.
576 */
577extern int zpool_enable_datasets(zpool_handle_t *, const char *, int);
578extern int zpool_disable_datasets(zpool_handle_t *, boolean_t);
579
580#ifdef __FreeBSD__
581extern int zmount(const char *, const char *, int, char *, char *, int, char *,
582 int);
583#endif
584
585#ifdef __cplusplus
586}
587#endif
588
589#endif /* _LIBZFS_H */
597 * Enable and disable datasets within a pool by mounting/unmounting and
598 * sharing/unsharing them.
599 */
600extern int zpool_enable_datasets(zpool_handle_t *, const char *, int);
601extern int zpool_disable_datasets(zpool_handle_t *, boolean_t);
602
603#ifdef __FreeBSD__
604extern int zmount(const char *, const char *, int, char *, char *, int, char *,
605 int);
606#endif
607
608#ifdef __cplusplus
609}
610#endif
611
612#endif /* _LIBZFS_H */