Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/journal/g_journal.h
Show All 29 Lines | |||||
#ifndef _G_JOURNAL_H_ | #ifndef _G_JOURNAL_H_ | ||||
#define _G_JOURNAL_H_ | #define _G_JOURNAL_H_ | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#include <sys/md5.h> | #include <sys/md5.h> | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <sys/bio.h> | #include <sys/bio.h> | ||||
#include <geom/geom_int.h> | |||||
#endif | #endif | ||||
#define G_JOURNAL_CLASS_NAME "JOURNAL" | #define G_JOURNAL_CLASS_NAME "JOURNAL" | ||||
#define G_JOURNAL_MAGIC "GEOM::JOURNAL" | #define G_JOURNAL_MAGIC "GEOM::JOURNAL" | ||||
/* | /* | ||||
* Version history: | * Version history: | ||||
* 0 - Initial version number. | * 0 - Initial version number. | ||||
*/ | */ | ||||
#define G_JOURNAL_VERSION 0 | #define G_JOURNAL_VERSION 0 | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
extern int g_journal_debug; | extern int g_journal_debug; | ||||
#define GJ_DEBUG(lvl, ...) do { \ | #define GJ_DEBUG(lvl, ...) \ | ||||
if (g_journal_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_JOURNAL", g_journal_debug, (lvl), NULL, __VA_ARGS__) | ||||
printf("GEOM_JOURNAL"); \ | #define GJ_LOGREQ(lvl, bp, ...) \ | ||||
if (g_journal_debug > 0) \ | _GEOM_DEBUG("GEOM_JOURNAL", g_journal_debug, (lvl), (bp), __VA_ARGS__) | ||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define GJ_LOGREQ(lvl, bp, ...) do { \ | |||||
if (g_journal_debug >= (lvl)) { \ | |||||
printf("GEOM_JOURNAL"); \ | |||||
if (g_journal_debug > 0) \ | |||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf(" "); \ | |||||
g_print_bio(bp); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define JEMPTY(sc) ((sc)->sc_journal_offset - \ | #define JEMPTY(sc) ((sc)->sc_journal_offset - \ | ||||
(sc)->sc_jprovider->sectorsize == \ | (sc)->sc_jprovider->sectorsize == \ | ||||
(sc)->sc_active.jj_offset && \ | (sc)->sc_active.jj_offset && \ | ||||
(sc)->sc_current_count == 0) | (sc)->sc_current_count == 0) | ||||
#define GJ_BIO_REGULAR 0x00 | #define GJ_BIO_REGULAR 0x00 | ||||
#define GJ_BIO_READ 0x01 | #define GJ_BIO_READ 0x01 | ||||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |