From 5f274d886598c9fd26d2499bf3f68306f170e9db Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 17 Sep 2014 10:17:39 +0100 Subject: dm bio prison: introduce support for locking ranges of blocks Ranges will be placed in the same cell if they overlap. Range locking is a prerequisite for more efficient multi-block discard support in both the cache and thin-provisioning targets. Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer --- drivers/md/dm-bio-prison.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/md/dm-bio-prison.c') diff --git a/drivers/md/dm-bio-prison.c b/drivers/md/dm-bio-prison.c index bbe22a5dc06b..be065300e93c 100644 --- a/drivers/md/dm-bio-prison.c +++ b/drivers/md/dm-bio-prison.c @@ -95,10 +95,10 @@ static int cmp_keys(struct dm_cell_key *lhs, if (lhs->dev > rhs->dev) return 1; - if (lhs->block < rhs->block) + if (lhs->block_end <= rhs->block_begin) return -1; - if (lhs->block > rhs->block) + if (lhs->block_begin >= rhs->block_end) return 1; return 0; -- cgit v1.2.3