Skip to content

Commit

Permalink
dm thin metadata: introduce THIN_MAX_CONCURRENT_LOCKS
Browse files Browse the repository at this point in the history
Introduce THIN_MAX_CONCURRENT_LOCKS into dm-thin-metadata to
give a name to an otherwise "magic" number.

Signed-off-by: Joe Thornber <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Alasdair G Kergon <[email protected]>
  • Loading branch information
jthornber authored and kergon committed Jul 27, 2012
1 parent d973ac1 commit 8c97117
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/md/dm-thin-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
#define THIN_METADATA_CACHE_SIZE 64
#define SECTOR_TO_BLOCK_SHIFT 3

/*
* 3 for btree insert +
* 2 for btree lookup used within space map
*/
#define THIN_MAX_CONCURRENT_LOCKS 5

/* This should be plenty */
#define SPACE_MAP_ROOT_SIZE 128

Expand Down Expand Up @@ -668,13 +674,9 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
return ERR_PTR(-ENOMEM);
}

/*
* Max hex locks:
* 3 for btree insert +
* 2 for btree lookup used within space map
*/
bm = dm_block_manager_create(bdev, THIN_METADATA_BLOCK_SIZE,
THIN_METADATA_CACHE_SIZE, 5);
THIN_METADATA_CACHE_SIZE,
THIN_MAX_CONCURRENT_LOCKS);
if (!bm) {
DMERR("could not create block manager");
kfree(pmd);
Expand Down

0 comments on commit 8c97117

Please sign in to comment.