]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dm snapshot: simplify sector_to_chunk expression
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 10 Dec 2009 23:52:08 +0000 (23:52 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:11:20 +0000 (11:11 -0700)
commit 102c6ddb1d081a6a1fede38c43a42c9811313ec7 upstream.

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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-exception-store.h

index 8a223a48802c0c867f79818045399937e650bf5e..5f9315b32a42aed67da57a7de2caf97bfdcb8fd1 100644 (file)
@@ -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);