Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/concat/g_concat.h
Show All 26 Lines | |||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _G_CONCAT_H_ | #ifndef _G_CONCAT_H_ | ||||
#define _G_CONCAT_H_ | #define _G_CONCAT_H_ | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#ifdef _KERNEL | |||||
#include <geom/geom_int.h> | |||||
#endif | |||||
#define G_CONCAT_CLASS_NAME "CONCAT" | #define G_CONCAT_CLASS_NAME "CONCAT" | ||||
#define G_CONCAT_MAGIC "GEOM::CONCAT" | #define G_CONCAT_MAGIC "GEOM::CONCAT" | ||||
/* | /* | ||||
* Version history: | * Version history: | ||||
* 1 - Initial version number. | * 1 - Initial version number. | ||||
* 2 - Added 'stop' command to gconcat(8). | * 2 - Added 'stop' command to gconcat(8). | ||||
* 3 - Added md_provider field to metadata and '-h' option to gconcat(8). | * 3 - Added md_provider field to metadata and '-h' option to gconcat(8). | ||||
* 4 - Added md_provsize field to metadata. | * 4 - Added md_provsize field to metadata. | ||||
*/ | */ | ||||
#define G_CONCAT_VERSION 4 | #define G_CONCAT_VERSION 4 | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#define G_CONCAT_TYPE_MANUAL 0 | #define G_CONCAT_TYPE_MANUAL 0 | ||||
#define G_CONCAT_TYPE_AUTOMATIC 1 | #define G_CONCAT_TYPE_AUTOMATIC 1 | ||||
#define G_CONCAT_DEBUG(lvl, ...) do { \ | #define G_CONCAT_DEBUG(lvl, ...) \ | ||||
if (g_concat_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_CONCAT", g_concat_debug, (lvl), NULL, __VA_ARGS__) | ||||
printf("GEOM_CONCAT"); \ | #define G_CONCAT_LOGREQ(bp, ...) \ | ||||
if (g_concat_debug > 0) \ | _GEOM_DEBUG("GEOM_CONCAT", g_concat_debug, 2, (bp), __VA_ARGS__) | ||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define G_CONCAT_LOGREQ(bp, ...) do { \ | |||||
if (g_concat_debug >= 2) { \ | |||||
printf("GEOM_CONCAT[2]: "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf(" "); \ | |||||
g_print_bio(bp); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
struct g_concat_disk { | struct g_concat_disk { | ||||
struct g_consumer *d_consumer; | struct g_consumer *d_consumer; | ||||
struct g_concat_softc *d_softc; | struct g_concat_softc *d_softc; | ||||
off_t d_start; | off_t d_start; | ||||
off_t d_end; | off_t d_end; | ||||
int d_candelete; | int d_candelete; | ||||
int d_removed; | int d_removed; | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |