Re: [RFC][PATCH 2/6] CART Implementation

Rik van Riel
2005-08-29T03:02:31Z

On Sat, 27 Aug 2005, a.p.zijlstra@chello.nl wrote:

> +static void bucket_stats(struct nr_bucket * nr_bucket, int * b1, int * b2)
> +{
> + unsigned int i, b[2] = {0, 0};
> + for (i = 0; i < 2; ++i) {
> + unsigned int j = nr_bucket->hand[i];
> + do
> + {
> + u32 *slot = &nr_bucket->slot[j];
> + if (!!(GET_FLAGS(*slot) & NR_list) != !!i)
> + break;
> +
> + j = GET_INDEX(*slot);
> + ++b[i];
> + } while (j != nr_bucket->hand[i]);

Does this properly skip empty slots ?

Remember that a page that got paged in leaves a zeroed
out slot in the bucket...

--
All Rights Reversed