Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/nop/g_nop.h
Show All 25 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _G_NOP_H_ | #ifndef _G_NOP_H_ | ||||
#define _G_NOP_H_ | #define _G_NOP_H_ | ||||
#ifdef _KERNEL | |||||
#include <geom/geom_int.h> | |||||
#endif | |||||
#define G_NOP_CLASS_NAME "NOP" | #define G_NOP_CLASS_NAME "NOP" | ||||
#define G_NOP_VERSION 4 | #define G_NOP_VERSION 4 | ||||
#define G_NOP_SUFFIX ".nop" | #define G_NOP_SUFFIX ".nop" | ||||
/* | /* | ||||
* Special flag to instruct gnop to passthrough the underlying provider's | * Special flag to instruct gnop to passthrough the underlying provider's | ||||
* physical path | * physical path | ||||
*/ | */ | ||||
#define G_NOP_PHYSPATH_PASSTHROUGH "\255" | #define G_NOP_PHYSPATH_PASSTHROUGH "\255" | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#define G_NOP_DEBUG(lvl, ...) do { \ | #define G_NOP_DEBUG(lvl, ...) \ | ||||
if (g_nop_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_NOP", g_nop_debug, (lvl), NULL, __VA_ARGS__) | ||||
printf("GEOM_NOP"); \ | #define G_NOP_LOGREQLVL(lvl, bp, ...) \ | ||||
if (g_nop_debug > 0) \ | _GEOM_DEBUG("GEOM_NOP", g_nop_debug, (lvl), (bp), __VA_ARGS__) | ||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define G_NOP_LOGREQ(bp, ...) G_NOP_LOGREQLVL(2, bp, __VA_ARGS__) | #define G_NOP_LOGREQ(bp, ...) G_NOP_LOGREQLVL(2, bp, __VA_ARGS__) | ||||
#define G_NOP_LOGREQLVL(lvl, bp, ...) do { \ | |||||
if (g_nop_debug >= (lvl)) { \ | |||||
printf("GEOM_NOP[%d]: ", (lvl)); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf(" "); \ | |||||
g_print_bio(bp); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
struct g_nop_softc { | struct g_nop_softc { | ||||
int sc_error; | int sc_error; | ||||
off_t sc_offset; | off_t sc_offset; | ||||
off_t sc_explicitsize; | off_t sc_explicitsize; | ||||
off_t sc_stripesize; | off_t sc_stripesize; | ||||
off_t sc_stripeoffset; | off_t sc_stripeoffset; | ||||
u_int sc_rfailprob; | u_int sc_rfailprob; | ||||
Show All 17 Lines |