diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-13 13:56:44 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-13 13:56:44 +0200 |
commit | 73909f7a665991013dcff42a815fda76d3a7300a (patch) | |
tree | 84bb9899e2204bf6af6fd4f249bb909c2a89faf8 /lib/bitmap.c | |
parent | d6672c501852d577097f6757c311d937aca0b04b (diff) | |
parent | 30a2f3c60a84092c8084dfe788b710f8d0768cd4 (diff) | |
download | talos-op-linux-73909f7a665991013dcff42a815fda76d3a7300a.tar.gz talos-op-linux-73909f7a665991013dcff42a815fda76d3a7300a.zip |
Merge commit 'v2.6.27-rc3' into core/urgent
Diffstat (limited to 'lib/bitmap.c')
-rw-r--r-- | lib/bitmap.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index 482df94ea21e..06fb57c86de0 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -316,6 +316,17 @@ int bitmap_scnprintf(char *buf, unsigned int buflen, EXPORT_SYMBOL(bitmap_scnprintf); /** + * bitmap_scnprintf_len - return buffer length needed to convert + * bitmap to an ASCII hex string + * @nr_bits: number of bits to be converted + */ +int bitmap_scnprintf_len(unsigned int nr_bits) +{ + unsigned int nr_nibbles = ALIGN(nr_bits, 4) / 4; + return nr_nibbles + ALIGN(nr_nibbles, CHUNKSZ / 4) / (CHUNKSZ / 4) - 1; +} + +/** * __bitmap_parse - convert an ASCII hex string into a bitmap. * @buf: pointer to buffer containing string. * @buflen: buffer size in bytes. If string is smaller than this |