Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8defd83084c3ce46d314c038f7c0f0ed7156d6f8
Commit:     8defd83084c3ce46d314c038f7c0f0ed7156d6f8
Parent:     82d601dc076deb5f348cc3a70f57248bc976ae0c
Author:     Robert P. J. Day <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 02:10:06 2008 +0000
Committer:  Alasdair G Kergon <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 02:10:06 2008 +0000

    dm snapshot: use rounddown_pow_of_two
    
    Since the source file already includes the log2.h header file, it
    seems pointless to re-invent the necessary routine.
    
    Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]>
    Signed-off-by: Alasdair G Kergon <[EMAIL PROTECTED]>
---
 drivers/md/dm-snap.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index cee16fa..fad8465 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -334,16 +334,6 @@ static int calc_max_buckets(void)
 }
 
 /*
- * 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.
  */
 static int init_hash_tables(struct dm_snapshot *s)
@@ -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;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to