Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/shsec/g_shsec.h
Show All 26 Lines | |||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _G_SHSEC_H_ | #ifndef _G_SHSEC_H_ | ||||
#define _G_SHSEC_H_ | #define _G_SHSEC_H_ | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#ifdef _KERNEL | |||||
#include <geom/geom_int.h> | |||||
#endif | |||||
#define G_SHSEC_CLASS_NAME "SHSEC" | #define G_SHSEC_CLASS_NAME "SHSEC" | ||||
#define G_SHSEC_MAGIC "GEOM::SHSEC" | #define G_SHSEC_MAGIC "GEOM::SHSEC" | ||||
/* | /* | ||||
* Version history: | * Version history: | ||||
* 0 - Initial version number. | * 0 - Initial version number. | ||||
* 1 - Added md_provsize field to metadata. | * 1 - Added md_provsize field to metadata. | ||||
*/ | */ | ||||
#define G_SHSEC_VERSION 1 | #define G_SHSEC_VERSION 1 | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#define G_SHSEC_BFLAG_FIRST 0x1 | #define G_SHSEC_BFLAG_FIRST 0x1 | ||||
#define G_SHSEC_DEBUG(lvl, ...) do { \ | #define G_SHSEC_DEBUG(lvl, ...) \ | ||||
if (g_shsec_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_SHSEC", g_shsec_debug, (lvl), NULL, __VA_ARGS__) | ||||
printf("GEOM_SHSEC"); \ | #define G_SHSEC_LOGREQ(lvl, bp, ...) \ | ||||
if (g_shsec_debug > 0) \ | _GEOM_DEBUG("GEOM_SHSEC", g_shsec_debug, (lvl), (bp), __VA_ARGS__) | ||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define G_SHSEC_LOGREQ(lvl, bp, ...) do { \ | |||||
if (g_shsec_debug >= (lvl)) { \ | |||||
printf("GEOM_SHSEC"); \ | |||||
if (g_shsec_debug > 0) \ | |||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf(" "); \ | |||||
g_print_bio(bp); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
struct g_shsec_softc { | struct g_shsec_softc { | ||||
u_int sc_type; /* provider type */ | u_int sc_type; /* provider type */ | ||||
struct g_geom *sc_geom; | struct g_geom *sc_geom; | ||||
struct g_provider *sc_provider; | struct g_provider *sc_provider; | ||||
uint32_t sc_id; /* device unique ID */ | uint32_t sc_id; /* device unique ID */ | ||||
struct g_consumer **sc_disks; | struct g_consumer **sc_disks; | ||||
uint16_t sc_ndisks; | uint16_t sc_ndisks; | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |