mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
block: Make protection interval calculation generic
Now that the protection interval has been detached from the sector size we need to be able to handle sizes that are different from 4K and 512. Make the interval calculation generic. Signed-off-by: Martin K. Petersen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
3be91c4a3d
commit
5a2aa87305
1 changed files with 1 additions and 5 deletions
|
|
@ -197,11 +197,7 @@ EXPORT_SYMBOL(bio_integrity_enabled);
|
|||
static inline unsigned int bio_integrity_intervals(struct blk_integrity *bi,
|
||||
unsigned int sectors)
|
||||
{
|
||||
/* At this point there are only 512b or 4096b DIF/EPP devices */
|
||||
if (bi->interval == 4096)
|
||||
return sectors >>= 3;
|
||||
|
||||
return sectors;
|
||||
return sectors >> (ilog2(bi->interval) - 9);
|
||||
}
|
||||
|
||||
static inline unsigned int bio_integrity_bytes(struct blk_integrity *bi,
|
||||
|
|
|
|||
Loading…
Reference in a new issue