77 struct space_map_ops {
78 void (*smop_load)(space_map_t *sm);
79 void (*smop_unload)(space_map_t *sm);
80 uint64_t (*smop_alloc)(space_map_t *sm, uint64_t size);
81 void (*smop_claim)(space_map_t *sm, uint64_t start, uint64_t size);
82 void (*smop_free)(space_map_t *sm, uint64_t start, uint64_t size);
83 uint64_t (*smop_max)(space_map_t *sm);
84 boolean_t (*smop_fragmented)(space_map_t *sm);
85 };
86
87 /*
88 * debug entry
89 *
90 * 1 3 10 50
91 * ,---+--------+------------+---------------------------------.
92 * | 1 | action | syncpass | txg (lower bits) |
93 * `---+--------+------------+---------------------------------'
94 * 63 62 60 59 50 49 0
95 *
96 *
97 *
98 * non-debug entry
99 *
100 * 1 47 1 15
101 * ,-----------------------------------------------------------.
102 * | 0 | offset (sm_shift units) | type | run |
103 * `-----------------------------------------------------------'
104 * 63 62 17 16 15 0
105 */
106
107 /* All this stuff takes and returns bytes */
108 #define SM_RUN_DECODE(x) (BF64_DECODE(x, 0, 15) + 1)
109 #define SM_RUN_ENCODE(x) BF64_ENCODE((x) - 1, 0, 15)
110 #define SM_TYPE_DECODE(x) BF64_DECODE(x, 15, 1)
111 #define SM_TYPE_ENCODE(x) BF64_ENCODE(x, 15, 1)
112 #define SM_OFFSET_DECODE(x) BF64_DECODE(x, 16, 47)
113 #define SM_OFFSET_ENCODE(x) BF64_ENCODE(x, 16, 47)
114 #define SM_DEBUG_DECODE(x) BF64_DECODE(x, 63, 1)
115 #define SM_DEBUG_ENCODE(x) BF64_ENCODE(x, 63, 1)
116
117 #define SM_DEBUG_ACTION_DECODE(x) BF64_DECODE(x, 60, 3)
|
77 struct space_map_ops {
78 void (*smop_load)(space_map_t *sm);
79 void (*smop_unload)(space_map_t *sm);
80 uint64_t (*smop_alloc)(space_map_t *sm, uint64_t size);
81 void (*smop_claim)(space_map_t *sm, uint64_t start, uint64_t size);
82 void (*smop_free)(space_map_t *sm, uint64_t start, uint64_t size);
83 uint64_t (*smop_max)(space_map_t *sm);
84 boolean_t (*smop_fragmented)(space_map_t *sm);
85 };
86
87 /*
88 * debug entry
89 *
90 * 1 3 10 50
91 * ,---+--------+------------+---------------------------------.
92 * | 1 | action | syncpass | txg (lower bits) |
93 * `---+--------+------------+---------------------------------'
94 * 63 62 60 59 50 49 0
95 *
96 *
97 * non-debug entry
98 *
99 * 1 47 1 15
100 * ,-----------------------------------------------------------.
101 * | 0 | offset (sm_shift units) | type | run |
102 * `-----------------------------------------------------------'
103 * 63 62 17 16 15 0
104 */
105
106 /* All this stuff takes and returns bytes */
107 #define SM_RUN_DECODE(x) (BF64_DECODE(x, 0, 15) + 1)
108 #define SM_RUN_ENCODE(x) BF64_ENCODE((x) - 1, 0, 15)
109 #define SM_TYPE_DECODE(x) BF64_DECODE(x, 15, 1)
110 #define SM_TYPE_ENCODE(x) BF64_ENCODE(x, 15, 1)
111 #define SM_OFFSET_DECODE(x) BF64_DECODE(x, 16, 47)
112 #define SM_OFFSET_ENCODE(x) BF64_ENCODE(x, 16, 47)
113 #define SM_DEBUG_DECODE(x) BF64_DECODE(x, 63, 1)
114 #define SM_DEBUG_ENCODE(x) BF64_ENCODE(x, 63, 1)
115
116 #define SM_DEBUG_ACTION_DECODE(x) BF64_DECODE(x, 60, 3)
|