Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/mirror/g_mirror.h
Show All 28 Lines | |||||
*/ | */ | ||||
#ifndef _G_MIRROR_H_ | #ifndef _G_MIRROR_H_ | ||||
#define _G_MIRROR_H_ | #define _G_MIRROR_H_ | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#include <sys/md5.h> | #include <sys/md5.h> | ||||
#ifdef _KERNEL | |||||
#include <geom/geom_int.h> | |||||
#endif | |||||
#define G_MIRROR_CLASS_NAME "MIRROR" | #define G_MIRROR_CLASS_NAME "MIRROR" | ||||
#define G_MIRROR_MAGIC "GEOM::MIRROR" | #define G_MIRROR_MAGIC "GEOM::MIRROR" | ||||
/* | /* | ||||
* Version history: | * Version history: | ||||
* 0 - Initial version number. | * 0 - Initial version number. | ||||
* 1 - Added 'prefer' balance algorithm. | * 1 - Added 'prefer' balance algorithm. | ||||
* 2 - Added md_genid field to metadata. | * 2 - Added md_genid field to metadata. | ||||
Show All 36 Lines | |||||
#define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL | #define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL | ||||
#define G_MIRROR_DEVICE_FLAG_DRAIN 0x0200000000000000ULL | #define G_MIRROR_DEVICE_FLAG_DRAIN 0x0200000000000000ULL | ||||
#define G_MIRROR_DEVICE_FLAG_CLOSEWAIT 0x0400000000000000ULL | #define G_MIRROR_DEVICE_FLAG_CLOSEWAIT 0x0400000000000000ULL | ||||
#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL | #define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL | ||||
#define G_MIRROR_DEVICE_FLAG_WIPE 0x1000000000000000ULL | #define G_MIRROR_DEVICE_FLAG_WIPE 0x1000000000000000ULL | ||||
extern int g_mirror_debug; | extern int g_mirror_debug; | ||||
#define G_MIRROR_DEBUG(lvl, ...) do { \ | #define G_MIRROR_DEBUG(lvl, ...) \ | ||||
if (g_mirror_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_MIRROR", g_mirror_debug, (lvl), NULL, __VA_ARGS__) | ||||
printf("GEOM_MIRROR"); \ | #define G_MIRROR_LOGREQ(lvl, bp, ...) \ | ||||
if (g_mirror_debug > 0) \ | _GEOM_DEBUG("GEOM_MIRROR", g_mirror_debug, (lvl), (bp), __VA_ARGS__) | ||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define G_MIRROR_LOGREQ(lvl, bp, ...) do { \ | |||||
if (g_mirror_debug >= (lvl)) { \ | |||||
printf("GEOM_MIRROR"); \ | |||||
if (g_mirror_debug > 0) \ | |||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf(" "); \ | |||||
g_print_bio(bp); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define G_MIRROR_BIO_FLAG_REGULAR 0x01 | #define G_MIRROR_BIO_FLAG_REGULAR 0x01 | ||||
#define G_MIRROR_BIO_FLAG_SYNC 0x02 | #define G_MIRROR_BIO_FLAG_SYNC 0x02 | ||||
/* | /* | ||||
* Informations needed for synchronization. | * Informations needed for synchronization. | ||||
*/ | */ | ||||
struct g_mirror_disk_sync { | struct g_mirror_disk_sync { | ||||
▲ Show 20 Lines • Show All 400 Lines • Show Last 20 Lines |