Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/stripe/g_stripe.h
Show All 26 Lines | |||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _G_STRIPE_H_ | #ifndef _G_STRIPE_H_ | ||||
#define _G_STRIPE_H_ | #define _G_STRIPE_H_ | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#ifdef _KERNEL | |||||
#include <geom/geom_int.h> | |||||
#endif | |||||
#define G_STRIPE_CLASS_NAME "STRIPE" | #define G_STRIPE_CLASS_NAME "STRIPE" | ||||
#define G_STRIPE_MAGIC "GEOM::STRIPE" | #define G_STRIPE_MAGIC "GEOM::STRIPE" | ||||
/* | /* | ||||
* Version history: | * Version history: | ||||
* 0 - Initial version number. | * 0 - Initial version number. | ||||
* 1 - Added 'stop' command for gstripe(8). | * 1 - Added 'stop' command for gstripe(8). | ||||
* 2 - Added md_provider field to metadata and '-h' option for gstripe(8). | * 2 - Added md_provider field to metadata and '-h' option for gstripe(8). | ||||
* 3 - Added md_provsize field to metadata. | * 3 - Added md_provsize field to metadata. | ||||
*/ | */ | ||||
#define G_STRIPE_VERSION 3 | #define G_STRIPE_VERSION 3 | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#define G_STRIPE_TYPE_MANUAL 0 | #define G_STRIPE_TYPE_MANUAL 0 | ||||
#define G_STRIPE_TYPE_AUTOMATIC 1 | #define G_STRIPE_TYPE_AUTOMATIC 1 | ||||
#define G_STRIPE_DEBUG(lvl, ...) do { \ | #define G_STRIPE_DEBUG(lvl, ...) \ | ||||
if (g_stripe_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_STRIPE", g_stripe_debug, (lvl), NULL, __VA_ARGS__) | ||||
printf("GEOM_STRIPE"); \ | #define G_STRIPE_LOGREQ(bp, ...) \ | ||||
if (g_stripe_debug > 0) \ | _GEOM_DEBUG("GEOM_STRIPE", g_stripe_debug, 2, (bp), __VA_ARGS__) | ||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define G_STRIPE_LOGREQ(bp, ...) do { \ | |||||
if (g_stripe_debug >= 2) { \ | |||||
printf("GEOM_STRIPE[2]: "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf(" "); \ | |||||
g_print_bio(bp); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
struct g_stripe_softc { | struct g_stripe_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; /* stripe unique ID */ | uint32_t sc_id; /* stripe 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 48 Lines • Show Last 20 Lines |