--- old/usr/src/uts/common/fs/zfs/sys/space_map.h Mon Apr 7 00:45:26 2008 +++ new/usr/src/uts/common/fs/zfs/sys/space_map.h Mon Apr 7 00:45:26 2008 @@ -73,23 +73,29 @@ }; /* - * debug entry + * allocation/free entry * - * 1 3 10 50 - * ,---+--------+------------+---------------------------------. - * | 1 | action | syncpass | txg (lower bits) | - * `---+--------+------------+---------------------------------' - * 63 62 60 59 50 49 0 - * - * - * - * non-debug entry - * * 1 47 1 15 - * ,-----------------------------------------------------------. + * ,---+------------------------------+------+-----------------. * | 0 | offset (sm_shift units) | type | run | - * `-----------------------------------------------------------' + * `---+------------------------------+------+-----------------' * 63 62 17 16 15 0 + * + * special entry + * + * 1 1 6 56 + * ,---+---+----------+----------------------------------------. + * | 1 | 1 | action | | + * `---+---+----------+----------------------------------------' + * 63 62 61 56 55 0 + * + * debug entry + * + * 1 1 2 10 50 + * ,---+---+--------+----------+-------------------------------. + * | 1 | 0 | action | syncpass | txg (lower bits) | + * `---+---+--------+----------+-------------------------------' + * 63 62 61 60 59 50 49 0 */ /* All this stuff takes and returns bytes */ @@ -99,15 +105,19 @@ #define SM_TYPE_ENCODE(x) BF64_ENCODE(x, 15, 1) #define SM_OFFSET_DECODE(x) BF64_DECODE(x, 16, 47) #define SM_OFFSET_ENCODE(x) BF64_ENCODE(x, 16, 47) -#define SM_DEBUG_DECODE(x) BF64_DECODE(x, 63, 1) -#define SM_DEBUG_ENCODE(x) BF64_ENCODE(x, 63, 1) +#define SM_IS_SPECIAL(x) (BF64_DECODE(x, 62, 2) == 3) +#define SM_SPECIAL_ENCODE() BF64_ENCODE(3, 62, 2) +#define SM_IS_DEBUG(x) (BF64_DECODE(x, 62, 2) == 2) +#define SM_DEBUG_ENCODE() BF64_ENCODE(2, 62, 2) + +#define SM_SPECIAL_ACTION_DECODE(x) BF64_DECODE(x, 56, 6) +#define SM_SPECIAL_ACTION_ENCODE(x) BF64_ENCODE(x, 56, 6) + #define SM_DEBUG_ACTION_DECODE(x) BF64_DECODE(x, 60, 3) #define SM_DEBUG_ACTION_ENCODE(x) BF64_ENCODE(x, 60, 3) - #define SM_DEBUG_SYNCPASS_DECODE(x) BF64_DECODE(x, 50, 10) #define SM_DEBUG_SYNCPASS_ENCODE(x) BF64_ENCODE(x, 50, 10) - #define SM_DEBUG_TXG_DECODE(x) BF64_DECODE(x, 0, 50) #define SM_DEBUG_TXG_ENCODE(x) BF64_ENCODE(x, 0, 50) @@ -116,6 +126,8 @@ #define SM_ALLOC 0x0 #define SM_FREE 0x1 +#define SM_FOLD 0x01 + /* * The data for a given space map can be kept on blocks of any size. * Larger blocks entail fewer i/o operations, but they also cause the