/*
* CDDL HEADER SART
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _LIBFS_IMPL_H
#define _LIBFS_IMPL_H
#include <sys/zfs_ioctl.h>
#include <libuutil.h>
#include <libzfs.h>
#include <libshare.h>
#include <libdevinfo.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef VERIFY
#endif
typedef struct zfs_crypt {
/* Creating, loading, or changed key value */
char *zc_key_data;
/* Private */
} zfs_crypt_t;
typedef struct zprop_table {
int zpt_type;
int zpt_prop_seq;
int zpt_sublist_seq;
int zpt_array_slots;
/* libzfs_flags */
struct libzfs_handle {
int libzfs_error;
int libzfs_fd;
int libzfs_desc_active;
char *libzfs_log_str;
int libzfs_printerr;
int libzfs_flags;
int libzfs_pool_iter;
void *libzfs_spawn_data;
};
struct zfs_handle {
/*
* Cached mountpoint and mount properties
*/
char *zfs_mntopts;
char *zfs_mountp;
/*
* Fields used by libzfs_cache.c
*/
};
/*
* This is different from checking zfs_type, because it will also catch
* snapshots of volumes.
*/
struct zpool_handle {
int zpool_state;
};
typedef enum {
PROTO_NFS = 0,
/*
* The following can be used as a bitmask and any new values
* added must preserve that capability.
*/
typedef enum {
int zfs_error(libzfs_handle_t *, int, const char *);
int zfs_error_fmt(libzfs_handle_t *, int, const char *, ...);
void zfs_error_aux(libzfs_handle_t *, const char *, ...);
char *zfs_asprintf(libzfs_handle_t *, const char *, ...);
char *zfs_strdup(libzfs_handle_t *, const char *);
int no_memory(libzfs_handle_t *);
const char *);
const char *, ...);
int zpool_standard_error(libzfs_handle_t *, int, const char *);
int zpool_standard_error_fmt(libzfs_handle_t *, int, const char *, ...);
void (*)(libzfs_handle_t *, const char *, const char *, int),
void (*)(int), nvlist_t **);
size_t *);
const char *zfs_list_ioctl_typestr(int);
/*
* Use this changelist_gather() flag to force attempting mounts
* on each change node regardless of whether or not it is currently
* mounted.
*/
/*
* changelist_prefix should fail if new sharing problems would be introduced.
*/
/*
* changelist_postfix should not mount filesystems that were not mounted
* before the change and should not activate any sharing
*/
/*
* Use this to avoid mounting during receive when -u is used
*/
void zcmd_free_nvlists(zfs_cmd_t *);
int changelist_prefix(prop_changelist_t *);
int changelist_postfix(prop_changelist_t *);
void changelist_rename(prop_changelist_t *, const char *, const char *);
void changelist_remove(prop_changelist_t *, const char *);
void changelist_free(prop_changelist_t *);
const zpropdef_t *, int, int);
void remove_mountpoint(zfs_handle_t *);
int create_parents(libzfs_handle_t *, char *, int);
char *, char *, size_t);
typedef struct config_node {
char *cn_name;
void namespace_clear(libzfs_handle_t *);
int namespace_reload(libzfs_handle_t *);
/* cache lookup by path */
typedef struct zfs_pathent {
/*
* For "path" based entries, we store a direct link to the "main"
* cache entry for this filesystem. The main entry has zp_name = the
* filesystem's dataset name and its zp_zhp points to the zfs_handle_t
* we are looking for. If something changes in the system that would
* change the mapping from sharepoint to filesystem, then the cache
* must be cleared.
*/
/*
* cache of dataset and share handles (zfs_handle_t)
*/
struct zfs_handle_cache {
};
/*
* Shadow data migration.
*/
extern int zfs_shadow_validate(libzfs_handle_t *, const char *);
extern int zfs_shadow_unmount(zfs_handle_t *);
extern int zfs_shadow_change(zfs_handle_t *);
/*
* Functions related to external property support.
*/
extern void zprop_init(libzfs_handle_t *);
extern void zprop_fini(libzfs_handle_t *);
extern void zprop_set_loaded(libzfs_handle_t *);
/*
* sharing interfaces used internally.
*/
int zfs_sharing_upgrade(zfs_handle_t *);
int zfs_sharing_upgrade_impl(zfs_handle_t *, const char *);
int zfs_share_inherited_name(const char *, const char *, const char *,
char *, size_t);
int zfs_share_rename(zfs_handle_t *, char *);
int zfs_share_remove_one(zfs_handle_t *);
int zfs_share_one_quiet(zfs_handle_t *);
int zfs_share_unpublish_allprotos(zfs_handle_t *, int);
int zfs_specify_share_path(const char *, const char *,
const char *, nvlist_t *, const char **);
int zfs_update_sharing_s2(zfs_handle_t *);
int zfs_unshare_one_impl(zfs_handle_t *);
int zfs_gather_mount_props(zfs_handle_t *);
void zfs_clear_mount_props(zfs_handle_t *);
#ifdef __cplusplus
}
#endif
#endif /* _LIBFS_IMPL_H */