Print this page
expandable RAID-Z

*** 71,123 **** void (*smop_claim)(space_map_t *sm, uint64_t start, uint64_t size); void (*smop_free)(space_map_t *sm, uint64_t start, uint64_t size); }; /* ! * debug 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 */ /* All this stuff takes and returns bytes */ #define SM_RUN_DECODE(x) (BF64_DECODE(x, 0, 15) + 1) #define SM_RUN_ENCODE(x) BF64_ENCODE((x) - 1, 0, 15) #define SM_TYPE_DECODE(x) BF64_DECODE(x, 15, 1) #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_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) #define SM_RUN_MAX SM_RUN_DECODE(~0ULL) #define SM_ALLOC 0x0 #define SM_FREE 0x1 /* * 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 * DMU to keep more data in-core, and also to waste more i/o bandwidth * when only a few blocks have changed since the last transaction group. --- 71,135 ---- void (*smop_claim)(space_map_t *sm, uint64_t start, uint64_t size); void (*smop_free)(space_map_t *sm, uint64_t start, uint64_t size); }; /* ! * allocation/free 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 | <action specific> | + * `---+---+----------+----------------------------------------' + * 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 */ #define SM_RUN_DECODE(x) (BF64_DECODE(x, 0, 15) + 1) #define SM_RUN_ENCODE(x) BF64_ENCODE((x) - 1, 0, 15) #define SM_TYPE_DECODE(x) BF64_DECODE(x, 15, 1) #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_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) #define SM_RUN_MAX SM_RUN_DECODE(~0ULL) #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 * DMU to keep more data in-core, and also to waste more i/o bandwidth * when only a few blocks have changed since the last transaction group.