Commit 102c6ddb authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon

dm snapshot: simplify sector_to_chunk expression

Removed unnecessary 'and' masking: The right shift discards the lower
bits so there is no need to clear them.

(A later patch needs this change to support a 32-bit chunk_mask.)
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Reviewed-by: default avatarMike Snitzer <snitzer@redhat.com>
Reviewed-by: default avatarJonathan Brassow <jbrassow@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent f5acc834
...@@ -162,7 +162,7 @@ static inline sector_t get_dev_size(struct block_device *bdev) ...@@ -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, static inline chunk_t sector_to_chunk(struct dm_exception_store *store,
sector_t sector) 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); int dm_exception_store_type_register(struct dm_exception_store_type *type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment