Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84562
b: refs/heads/master
c: 8defd83
h: refs/heads/master
v: v3
  • Loading branch information
Robert P. J. Day authored and Alasdair G Kergon committed Feb 8, 2008
1 parent 2de38fd commit be8959b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 82d601dc076deb5f348cc3a70f57248bc976ae0c
refs/heads/master: 8defd83084c3ce46d314c038f7c0f0ed7156d6f8
13 changes: 1 addition & 12 deletions trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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;

Expand Down

0 comments on commit be8959b

Please sign in to comment.