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:13:14 +0000 (10:13 +0200)
commitf8ae879b776c28fb8fc47ae97c4ad45edac0be24
treeb5a5d78e7581e48483a7e91b8c33a6e9d7c93691
parent54dbe2d2c1fcabf650c7a8b747601da355cd7f9f
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