From be8959b44e8d70ca28173a5f2b7eafb0cda47c5d Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Fri, 8 Feb 2008 02:10:06 +0000 Subject: [PATCH] --- yaml --- r: 84562 b: refs/heads/master c: 8defd83084c3ce46d314c038f7c0f0ed7156d6f8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/md/dm-snap.c | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 35003fe37db5..18e39cf49e62 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 82d601dc076deb5f348cc3a70f57248bc976ae0c +refs/heads/master: 8defd83084c3ce46d314c038f7c0f0ed7156d6f8 diff --git a/trunk/drivers/md/dm-snap.c b/trunk/drivers/md/dm-snap.c index cee16fadd9ee..fad84654b045 100644 --- a/trunk/drivers/md/dm-snap.c +++ b/trunk/drivers/md/dm-snap.c @@ -333,16 +333,6 @@ static int calc_max_buckets(void) return mem; } -/* - * Rounds a number down to a power of 2. - */ -static uint32_t round_down(uint32_t n) -{ - while (n & (n - 1)) - n &= (n - 1); - return n; -} - /* * Allocate room for a suitable hash table. */ @@ -361,8 +351,7 @@ static int init_hash_tables(struct dm_snapshot *s) hash_size = min(origin_dev_size, cow_dev_size) >> s->chunk_shift; hash_size = min(hash_size, max_buckets); - /* Round it down to a power of 2 */ - hash_size = round_down(hash_size); + hash_size = rounddown_pow_of_two(hash_size); if (init_exception_table(&s->complete, hash_size)) return -ENOMEM;