summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2009-09-25 08:44:51 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2009-09-25 08:44:51 +1000
commit48b17e1d9e1db0aa32cacf082460b5ae14ec8f71 (patch)
tree0d5d245bc875f2ad11b513d8acdd63407bc4fa96
parent4df6dc45f8b7bb4a31ec5044205490901de09329 (diff)
dm-snapshot-simplify-sector_to_chunk-expression
Removed unnecessary 'and' masking --- right shift discards the lower bits anyway, so there is no need to clear them. This is also needed for the correctness of the following patch dm-snapshot-32bit-chunk-size.patch, that makes chunk_mask 32-bit. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Reviewed-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r--drivers/md/dm-exception-store.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
index 812c71872ba0..3e8fa029d476 100644
--- a/drivers/md/dm-exception-store.h
+++ b/drivers/md/dm-exception-store.h
@@ -162,7 +162,7 @@ static inline sector_t get_dev_size(struct block_device *bdev)
static inline chunk_t sector_to_chunk(struct dm_exception_store *store,
sector_t sector)
{
- return (sector & ~store->chunk_mask) >> store->chunk_shift;
+ return sector >> store->chunk_shift;
}
int dm_exception_store_type_register(struct dm_exception_store_type *type);