Re: [PATCH v2] binder: use bitmap for faster descriptor lookup

From: Alice Ryhl
Date: Wed May 15 2024 - 11:30:10 EST


On Tue, May 14, 2024 at 6:09 PM Carlos Llamas <cmllamas@xxxxxxxxxx> wrote:
> +static inline int
> +dbitmap_get_first_zero_bit(struct dbitmap *dmap, unsigned long *bit)
> +{
> + unsigned long n;
> +
> + n = find_first_zero_bit(dmap->map, dmap->nbits);
> + if (unlikely(n == dmap->nbits))
> + return -ENOSPC;
> +
> + *bit = n;
> + set_bit(n, dmap->map);
> +
> + return 0;
> +}

Could we rename this method to something that makes it more clear that
it's not just a getter, but that it actually also sets the bit?

Alice