dm thin metadata: introduce THIN_MAX_CONCURRENT_LOCKS
authorJoe Thornber <ejt@redhat.com>
Fri, 27 Jul 2012 14:07:58 +0000 (15:07 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:51:00 +0000 (15:51 +0000)
commit 8c971178a788c70e8d6db5c3a813de1a1f54e5b7 upstream.

Introduce THIN_MAX_CONCURRENT_LOCKS into dm-thin-metadata to
give a name to an otherwise "magic" number.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/md/dm-thin-metadata.c

index 237571a..525f560 100644 (file)
 #define THIN_METADATA_CACHE_SIZE 64
 #define SECTOR_TO_BLOCK_SHIFT 3
 
 #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
 
 /* This should be plenty */
 #define SPACE_MAP_ROOT_SIZE 128
 
@@ -669,13 +675,9 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
                return ERR_PTR(-ENOMEM);
        }
 
                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,
        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);
        if (!bm) {
                DMERR("could not create block manager");
                kfree(pmd);