nvmet: add lba to sect conversion helpers
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Tue, 12 Jan 2021 04:26:16 +0000 (20:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:52 +0000 (10:29 +0200)
commitdbfb2b1682d796b9f7dc8e0f53d530e7ffdfc512
tree6b37d5b0201cd46afd8861cf17d801f80de4f3e3
parenta287cd84e047045f5a4d4da793414e848de627c6
nvmet: add lba to sect conversion helpers

[ Upstream commit 193fcf371f9e3705c14a0bf1d4bfc44af0f7c124 ]

In this preparation patch, we add helpers to convert lbas to sectors &
sectors to lba. This is needed to eliminate code duplication in the ZBD
backend.

Use these helpers in the block device backend.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/target/io-cmd-bdev.c
drivers/nvme/target/nvmet.h