38 #include <linux/module.h> 45 #include <sys/types.h> 67 .oe_range = 0xfffffffffffffeffUL,
91 uint64_t start2, uint64_t range2)
94 if (start1 > start2 && start1 < start2 + range2)
97 if (start2 > start1 && start2 < start1 + range1)
123 next->oe_prev = prev;
144 uint64_t s_oid, uint64_t nr_oids,
151 if (direction == 0) {
199 if (lhp->
oe_start == s_oid + nr_oids
283 }
else if (oe->
oe_start == s_oid + nr_oids) {
309 for (
i = 0;
i < nr_id;
i++) {
310 oids[
i].
u_hi = 0x0UL;
324 uint64_t nr_allocated;
346 nr_allocated += nr_wanted;
359 }
while (oe != lhp && nr_wanted != 0);
375 uint64_t nr_allocated;
378 if (nr_allocated == 0)
399 uint64_t nr_allocated;
402 if (nr_allocated == 0)
413 for (
i = 0;
i < nr_oids; ) {
415 for (j =
i + 1; j < nr_oids; j++) {
417 || oids[j].
u_lo != oids[j-1].
u_lo + 1)
static void oid_extent_lock(void)
static uint64_t oid_alloc(struct m0_uint128 *oids, uint64_t nr_oids)
static pthread_mutex_t oid_extent_list_lock
uint64_t oid_get_many(struct m0_uint128 *oids, uint64_t nr_oids)
static struct m0_atomic64 allocated
int oid_allocator_fini(void)
static struct oid_extent oid_extent_lh
static int oid_extent_is_overlapped(uint64_t start1, uint64_t range1, uint64_t start2, uint64_t range2)
static void oid_extent_insert_head(uint64_t s_oid, uint64_t nr_oids)
int oid_get(struct m0_uint128 *oid)
static void oid_extent_delete(struct oid_extent *oe)
struct oid_extent * oe_next
static m0_bindex_t offset
static void mem_free(const struct m0_be_btree *btree, struct m0_be_tx *tx, void *ptr)
void oid_put_many(struct m0_uint128 *oids, uint64_t nr_oids)
struct oid_extent * oe_prev
static void oid_extent_merge(struct oid_extent *oe, uint64_t s_oid, uint64_t nr_oids, int direction)
static void * mem_alloc(const struct m0_be_btree *btree, struct m0_be_tx *tx, m0_bcount_t size, uint64_t zonemask)
static void oid_fill(struct m0_uint128 *oids, uint64_t s_id, int nr_id)
int oid_allocator_init(void)
static void oid_extent_split(struct oid_extent *oe, uint64_t wanted)
void oid_put(struct m0_uint128 oid)
static void oid_extent_insert(uint64_t s_oid, uint64_t nr_oids)
static void oid_extent_unlock(void)