summaryrefslogtreecommitdiff
path: root/drivers/scsi/sd.h
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-10-29 13:26:04 +0800
committerAlex Shi <alex.shi@linaro.org>2016-10-29 13:26:04 +0800
commitc11a255c622e7a2d312f4080c6ef529dd67b3c38 (patch)
treec7d36f8014e9da35e4b772cfdc1779ec0449d657 /drivers/scsi/sd.h
parent273daee0be36235886622396eedb618fc5de0213 (diff)
parent25f89e269f5c5d06594098cc3b1d97554249f3f9 (diff)
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Diffstat (limited to 'drivers/scsi/sd.h')
-rw-r--r--drivers/scsi/sd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index 654630bb7d0e..765a6f1ac1b7 100644
--- a/drivers/scsi/sd.h
+++ b/drivers/scsi/sd.h
@@ -151,6 +151,11 @@ static inline sector_t logical_to_sectors(struct scsi_device *sdev, sector_t blo
return blocks << (ilog2(sdev->sector_size) - 9);
}
+static inline unsigned int logical_to_bytes(struct scsi_device *sdev, sector_t blocks)
+{
+ return blocks * sdev->sector_size;
+}
+
/*
* A DIF-capable target device can be formatted with different
* protection schemes. Currently 0 through 3 are defined: