summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-bio-prison-v1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-bio-prison-v1.c')
-rw-r--r--drivers/md/dm-bio-prison-v1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/dm-bio-prison-v1.c b/drivers/md/dm-bio-prison-v1.c
index 6b726b8b300d..92afdca760ae 100644
--- a/drivers/md/dm-bio-prison-v1.c
+++ b/drivers/md/dm-bio-prison-v1.c
@@ -117,9 +117,10 @@ static int cmp_keys(struct dm_cell_key *lhs,
return 0;
}
-static unsigned lock_nr(struct dm_cell_key *key, unsigned int num_locks)
+static inline unsigned int lock_nr(struct dm_cell_key *key, unsigned int num_locks)
{
- return (key->block_begin >> BIO_PRISON_MAX_RANGE_SHIFT) & (num_locks - 1);
+ return dm_hash_locks_index((key->block_begin >> BIO_PRISON_MAX_RANGE_SHIFT),
+ num_locks);
}
bool dm_cell_key_has_valid_range(struct dm_cell_key *key)