Changeset View
Changeset View
Standalone View
Standalone View
stand/libsa/zfs/libzfs.h
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
/* nvp implementation version */ | /* nvp implementation version */ | ||||
#define NV_VERSION 0 | #define NV_VERSION 0 | ||||
/* nvlist persistent unique name flags, stored in nvl_nvflags */ | /* nvlist persistent unique name flags, stored in nvl_nvflags */ | ||||
#define NV_UNIQUE_NAME 0x1 | #define NV_UNIQUE_NAME 0x1 | ||||
#define NV_UNIQUE_NAME_TYPE 0x2 | #define NV_UNIQUE_NAME_TYPE 0x2 | ||||
#define NV_ALIGN4(x) (((x) + 3) & ~3) | #define NV_ALIGN4(x) (((x) + 3) & ~3) | ||||
#define NV_ALIGN(x) (((x) + 7) & ~7) | |||||
/* | /* | ||||
* nvlist header. | * nvlist header. | ||||
* nvlist has 4 bytes header followed by version and flags, then nvpairs | * nvlist has 4 bytes header followed by version and flags, then nvpairs | ||||
* and the list is terminated by double zero. | * and the list is terminated by double zero. | ||||
*/ | */ | ||||
typedef struct { | typedef struct { | ||||
char nvh_encoding; | char nvh_encoding; | ||||
Show All 40 Lines | typedef struct { | ||||
unsigned nv_type; /* data_type_t */ | unsigned nv_type; /* data_type_t */ | ||||
unsigned nv_nelem; /* number of elements */ | unsigned nv_nelem; /* number of elements */ | ||||
uint8_t nv_data[]; /* data stream */ | uint8_t nv_data[]; /* data stream */ | ||||
} nv_pair_data_t; | } nv_pair_data_t; | ||||
nvlist_t *nvlist_create(int); | nvlist_t *nvlist_create(int); | ||||
void nvlist_destroy(nvlist_t *); | void nvlist_destroy(nvlist_t *); | ||||
nvlist_t *nvlist_import(const uint8_t *, char, char); | nvlist_t *nvlist_import(const uint8_t *, char, char); | ||||
int nvlist_export(nvlist_t *); | |||||
int nvlist_remove(nvlist_t *, const char *, data_type_t); | int nvlist_remove(nvlist_t *, const char *, data_type_t); | ||||
void nvlist_print(nvlist_t *, unsigned int); | void nvlist_print(nvlist_t *, unsigned int); | ||||
int nvlist_find(const nvlist_t *, const char *, data_type_t, | int nvlist_find(const nvlist_t *, const char *, data_type_t, | ||||
int *, void *, int *); | int *, void *, int *); | ||||
int nvlist_next(nvlist_t *); | int nvlist_next(nvlist_t *); | ||||
int nvlist_add_string(nvlist_t *, const char *, const char *); | |||||
int zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, | int zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, | ||||
const char **path); | const char **path); | ||||
char *zfs_fmtdev(void *vdev); | char *zfs_fmtdev(void *vdev); | ||||
int zfs_nextboot(void *vdev, char *buf, size_t size); | int zfs_nextboot(void *vdev, char *buf, size_t size); | ||||
int zfs_probe_dev(const char *devname, uint64_t *pool_guid); | int zfs_probe_dev(const char *devname, uint64_t *pool_guid); | ||||
int zfs_list(const char *name); | int zfs_list(const char *name); | ||||
uint64_t ldi_get_size(void *); | uint64_t ldi_get_size(void *); | ||||
void init_zfs_bootenv(const char *currdev); | void init_zfs_bootenv(const char *currdev); | ||||
int zfs_bootenv(const char *name); | int zfs_bootenv(const char *name); | ||||
int zfs_belist_add(const char *name, uint64_t __unused); | int zfs_belist_add(const char *name, uint64_t __unused); | ||||
int zfs_set_env(void); | int zfs_set_env(void); | ||||
nvlist_t *vdev_read_bootenv(vdev_t *); | |||||
extern struct devsw zfs_dev; | extern struct devsw zfs_dev; | ||||
extern struct fs_ops zfs_fsops; | extern struct fs_ops zfs_fsops; | ||||
#endif /*_BOOT_LIBZFS_H_*/ | #endif /*_BOOT_LIBZFS_H_*/ |