scsi: target/core: Use the SECTOR_SHIFT constant
authorBart Van Assche <bvanassche@acm.org>
Mon, 15 Oct 2018 15:51:37 +0000 (08:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Sep 2019 06:22:16 +0000 (08:22 +0200)
[ Upstream commit 80b045b385cfef10939c913fbfeb19ce5491c1f2 ]

Instead of duplicating the SECTOR_SHIFT definition from <linux/blkdev.h>,
use it. This patch does not change any functionality.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/target/target_core_iblock.c
drivers/target/target_core_iblock.h

index ce1321a..1bc9b14 100644 (file)
@@ -514,7 +514,7 @@ iblock_execute_write_same(struct se_cmd *cmd)
                }
 
                /* Always in 512 byte units for Linux/Block */
-               block_lba += sg->length >> IBLOCK_LBA_SHIFT;
+               block_lba += sg->length >> SECTOR_SHIFT;
                sectors -= 1;
        }
 
@@ -757,7 +757,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
                }
 
                /* Always in 512 byte units for Linux/Block */
-               block_lba += sg->length >> IBLOCK_LBA_SHIFT;
+               block_lba += sg->length >> SECTOR_SHIFT;
                sg_num--;
        }
 
index 9cc3843..cefc641 100644 (file)
@@ -9,7 +9,6 @@
 #define IBLOCK_VERSION         "4.0"
 
 #define IBLOCK_MAX_CDBS                16
-#define IBLOCK_LBA_SHIFT       9
 
 struct iblock_req {
        refcount_t pending;