Skip to content

Commit

Permalink
dm integrity: use previously calculated log2 of sectors_per_block
Browse files Browse the repository at this point in the history
The log2 of sectors_per_block was already calculated, so we don't have
to use the ilog2 function.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Mikulas Patocka authored and Mike Snitzer committed Apr 27, 2017
1 parent 6625d90 commit 84ff1bc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/md/dm-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <linux/rbtree.h>
#include <linux/delay.h>
#include <linux/random.h>
#include <linux/log2.h>
#include <crypto/hash.h>
#include <crypto/skcipher.h>
#include <linux/async_tx.h>
Expand Down Expand Up @@ -2369,7 +2368,7 @@ static void dm_integrity_set(struct dm_target *ti, struct dm_integrity_c *ic)
bi.profile = &dm_integrity_profile;
bi.tuple_size = ic->tag_size;
bi.tag_size = bi.tuple_size;
bi.interval_exp = ilog2(ic->sectors_per_block << SECTOR_SHIFT);
bi.interval_exp = ic->sb->log2_sectors_per_block + SECTOR_SHIFT;

blk_integrity_register(disk, &bi);
blk_queue_max_integrity_segments(disk->queue, UINT_MAX);
Expand Down

0 comments on commit 84ff1bc

Please sign in to comment.