From: Duck <duck@freescale.com>
To: linux-kernel@vger.kernel.org
Cc: Bruce Schmid <duck@freescale.com>, Dean Nelson <dcn@sgi.com>
Subject: [PATCH] generic pool allocator: allow all chunks to be allocated.
Date: Wed, 16 Apr 2008 06:33:10 -0600 [thread overview]
Message-ID: <1208349190-9650-1-git-send-email-duck@freescale.com> (raw)
From: Bruce Schmid <duck@freescale.com>
gen_pool_alloc() doesn't allocate the last chunk in a pool.
This patch fixes that problem by correcting the calculation
of the number of the last bit in the bitmap.
Cc: Dean Nelson <dcn@sgi.com>
Signed-off-by: Bruce Schmid <duck@freescale.com>
---
lib/genalloc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/genalloc.c b/lib/genalloc.c
index f6d276d..ac00492 100644
--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -127,7 +127,7 @@ unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size)
chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
end_bit = (chunk->end_addr - chunk->start_addr) >> order;
- end_bit -= nbits + 1;
+ end_bit -= (nbits - 1);
spin_lock_irqsave(&chunk->lock, flags);
bit = -1;
--
1.5.4
next reply other threads:[~2008-04-16 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-16 12:33 Duck [this message]
2008-04-16 14:34 ` Dean Nelson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1208349190-9650-1-git-send-email-duck@freescale.com \
--to=duck@freescale.com \
--cc=dcn@sgi.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®