[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C80BC5C.2010804@kernel.org>
Date: Fri, 03 Sep 2010 11:14:04 +0200
From: Tejun Heo <tj@...nel.org>
To: Namhyung Kim <namhyung@...il.com>
CC: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ida: fix up bitmap size calculation
On 09/02/2010 08:07 PM, Namhyung Kim wrote:
> Namhyung Kim <namhyung@...il.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@...nel.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists