Lines Matching refs:bit

37 static bool wnd_is_free_hlp(struct wnd_bitmap *wnd, size_t bit, size_t bits);
231 static void wnd_add_free_ext(struct wnd_bitmap *wnd, size_t bit, size_t len, in wnd_add_free_ext() argument
235 size_t ib, end_in = bit + len; in wnd_add_free_ext()
247 n = rb_lookup(&wnd->start_tree, bit); in wnd_add_free_ext()
254 if (e->start.key + e->count.key == bit) { in wnd_add_free_ext()
256 bit = e->start.key; in wnd_add_free_ext()
290 bit < wnd->zone_end ? in wnd_add_free_ext()
294 while (bit > ib && wnd_is_free_hlp(wnd, bit - 1, 1)) { in wnd_add_free_ext()
295 bit -= 1; in wnd_add_free_ext()
347 e->start.key = bit; in wnd_add_free_ext()
362 static void wnd_remove_free_ext(struct wnd_bitmap *wnd, size_t bit, size_t len) in wnd_remove_free_ext() argument
366 size_t end_in = bit + len; in wnd_remove_free_ext()
370 n = rb_lookup(&wnd->start_tree, bit); in wnd_remove_free_ext()
382 if (e->start.key > bit) in wnd_remove_free_ext()
388 len = bit - e->start.key; in wnd_remove_free_ext()
389 } else if (bit > end) { in wnd_remove_free_ext()
709 int wnd_set_free(struct wnd_bitmap *wnd, size_t bit, size_t bits) in wnd_set_free() argument
715 size_t iw = bit >> (sb->s_blocksize_bits + 3); in wnd_set_free()
716 u32 wbit = bit & (wbits - 1); in wnd_set_free()
751 wnd_add_free_ext(wnd, bit, bits0, false); in wnd_set_free()
759 int wnd_set_used(struct wnd_bitmap *wnd, size_t bit, size_t bits) in wnd_set_used() argument
764 size_t iw = bit >> (sb->s_blocksize_bits + 3); in wnd_set_used()
766 u32 wbit = bit & (wbits - 1); in wnd_set_used()
801 wnd_remove_free_ext(wnd, bit, bits0); in wnd_set_used()
815 int wnd_set_used_safe(struct wnd_bitmap *wnd, size_t bit, size_t bits, in wnd_set_used_safe() argument
823 if (wnd_is_free(wnd, bit + i, 1)) { in wnd_set_used_safe()
825 from = bit + i; in wnd_set_used_safe()
849 static bool wnd_is_free_hlp(struct wnd_bitmap *wnd, size_t bit, size_t bits) in wnd_is_free_hlp() argument
852 size_t iw = bit >> (sb->s_blocksize_bits + 3); in wnd_is_free_hlp()
854 u32 wbit = bit & (wbits - 1); in wnd_is_free_hlp()
892 bool wnd_is_free(struct wnd_bitmap *wnd, size_t bit, size_t bits) in wnd_is_free() argument
902 n = rb_lookup(&wnd->start_tree, bit); in wnd_is_free()
910 if (bit < end && bit + bits <= end) in wnd_is_free()
914 ret = wnd_is_free_hlp(wnd, bit, bits); in wnd_is_free()
924 bool wnd_is_used(struct wnd_bitmap *wnd, size_t bit, size_t bits) in wnd_is_used() argument
928 size_t iw = bit >> (sb->s_blocksize_bits + 3); in wnd_is_used()
930 u32 wbit = bit & (wbits - 1); in wnd_is_used()
938 end = bit + bits; in wnd_is_used()
944 if (e->start.key + e->count.key > bit) in wnd_is_used()