Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/virstor/g_virstor.h
Show All 25 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _G_VIRSTOR_H_ | #ifndef _G_VIRSTOR_H_ | ||||
#define _G_VIRSTOR_H_ | #define _G_VIRSTOR_H_ | ||||
#ifdef _KERNEL | |||||
#include <geom/geom_int.h> | |||||
#endif | |||||
#define G_VIRSTOR_CLASS_NAME "VIRSTOR" | #define G_VIRSTOR_CLASS_NAME "VIRSTOR" | ||||
#define VIRSTOR_MAP_ALLOCATED 1 | #define VIRSTOR_MAP_ALLOCATED 1 | ||||
struct virstor_map_entry { | struct virstor_map_entry { | ||||
uint16_t flags; | uint16_t flags; | ||||
uint16_t provider_no; | uint16_t provider_no; | ||||
uint32_t provider_chunk; | uint32_t provider_chunk; | ||||
}; | }; | ||||
#define VIRSTOR_MAP_ENTRY_SIZE (sizeof(struct virstor_map_entry)) | #define VIRSTOR_MAP_ENTRY_SIZE (sizeof(struct virstor_map_entry)) | ||||
#define VIRSTOR_MAP_BLOCK_ENTRIES (MAXPHYS / VIRSTOR_MAP_ENTRY_SIZE) | #define VIRSTOR_MAP_BLOCK_ENTRIES (MAXPHYS / VIRSTOR_MAP_ENTRY_SIZE) | ||||
/* Struct size is guarded by CTASSERT in main source */ | /* Struct size is guarded by CTASSERT in main source */ | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#define LOG_MSG(lvl, ...) do { \ | #define LOG_MSG(lvl, ...) \ | ||||
if (g_virstor_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_VIRSTOR", g_virstor_debug, (lvl), NULL, __VA_ARGS__) | ||||
printf("GEOM_" G_VIRSTOR_CLASS_NAME); \ | |||||
if ((lvl) > 0) \ | |||||
printf("[%u]", (lvl)); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define LOG_MESSAGE LOG_MSG | #define LOG_MESSAGE LOG_MSG | ||||
#define LOG_REQ(lvl, bp, ...) do { \ | #define LOG_REQ(lvl, bp, ...) \ | ||||
if (g_virstor_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_VIRSTOR", g_virstor_debug, (lvl), (bp), __VA_ARGS__) | ||||
printf("GEOM_" G_VIRSTOR_CLASS_NAME); \ | |||||
if ((lvl) > 0) \ | |||||
printf("[%u]", (lvl)); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf(" "); \ | |||||
g_print_bio(bp); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define LOG_REQUEST LOG_REQ | #define LOG_REQUEST LOG_REQ | ||||
/* "critical" system announcements (e.g. "geom is up") */ | /* "critical" system announcements (e.g. "geom is up") */ | ||||
#define LVL_ANNOUNCE 0 | #define LVL_ANNOUNCE 0 | ||||
/* errors */ | /* errors */ | ||||
#define LVL_ERROR 1 | #define LVL_ERROR 1 | ||||
/* warnings */ | /* warnings */ | ||||
#define LVL_WARNING 2 | #define LVL_WARNING 2 | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |