Messages in this thread Patch in this message | | | Date | Fri, 03 Sep 2010 11:14:04 +0200 | From | Tejun Heo <> | Subject | Re: [PATCH] ida: fix up bitmap size calculation |
| |
On 09/02/2010 08:07 PM, Namhyung Kim wrote: > Namhyung Kim <namhyung@gmail.com> writes: >> Got it. :-) I'll prepare new patch with that comment, then. >> Thank you for the explanation. > > How about this?
I'd prefer something with a bit more brevity. If this looks good, can you please send it to trivial@kernel.org?
Thanks.
diff --git a/include/linux/idr.h b/include/linux/idr.h index e968db7..1208528 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h @@ -117,9 +117,12 @@ void idr_init(struct idr *idp); /* * IDA - IDR based id allocator, use when translation from id to * pointer isn't necessary. + * + * IDA_BITMAP_LONGS is calculated to be one less to accomodate + * ida_bitmap->nr_busy so that the whole struct fits in 128 bytes. */ #define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */ -#define IDA_BITMAP_LONGS (128 / sizeof(long) - 1) +#define IDA_BITMAP_LONGS (IDA_CHUNK_SIZE / sizeof(long) - 1) #define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8)
struct ida_bitmap {
-- tejun
| |