nvmet-loop: use nr_phys_segments when map rq to sgl
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Fri, 11 May 2018 06:38:15 +0000 (02:38 -0400)
committerChristoph Hellwig <hch@lst.de>
Fri, 25 May 2018 14:50:12 +0000 (16:50 +0200)
commiteb464833a2e787996474ad33dafa2c5336d4c477
treed3a1f124fd3bb2931219016457fa997c1d090b40
parent17d78252ee568ecf94df6829c81578c0602991eb
nvmet-loop: use nr_phys_segments when map rq to sgl

Use blk_rq_nr_phys_segments() instead of blk_rq_payload_bytes() to check
if a command contains data to me mapped.  This fixes the case where
a struct requests contains LBAs, but no data will actually be send,
e.g. the pending Write Zeroes support.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/loop.c