summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-bio-prison.c
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2014-09-17 10:17:39 +0100
committerMike Snitzer <snitzer@redhat.com>2014-11-10 15:25:30 -0500
commit5f274d886598c9fd26d2499bf3f68306f170e9db (patch)
treeaf0ded19382c65e832ea51e2b01efb40581c81dd /drivers/md/dm-bio-prison.c
parentf1afb36a6102b52949c2c6d8eb250eddcce3fc5f (diff)
downloadlinux-5f274d886598c9fd26d2499bf3f68306f170e9db.tar.gz
linux-5f274d886598c9fd26d2499bf3f68306f170e9db.tar.bz2
linux-5f274d886598c9fd26d2499bf3f68306f170e9db.zip
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 <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-bio-prison.c')
-rw-r--r--drivers/md/dm-bio-prison.c4
1 files changed, 2 insertions, 2 deletions
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;