From: Caleb Sander Mateos Date: Fri, 27 Feb 2026 20:23:52 +0000 (-0700) Subject: nvmet: use NVME_NS_FEAT_OPTPERF_SHIFT X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0d56e7055d3762732504eddc059a4a142227e0f;p=thirdparty%2Fkernel%2Flinux.git nvmet: use NVME_NS_FEAT_OPTPERF_SHIFT Use the NVME_NS_FEAT_OPTPERF_SHIFT constant in nvmet_bdev_set_limits() to set the OPTPERF bits of the nvme_id_ns NSFEAT field instead of the magic number 4. Signed-off-by: Caleb Sander Mateos Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch --- diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c index f15d1c213bc6b..a8a7d3a88ef20 100644 --- a/drivers/nvme/target/io-cmd-bdev.c +++ b/drivers/nvme/target/io-cmd-bdev.c @@ -30,11 +30,11 @@ void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id) id->nacwu = lpp0b; /* - * Bit 4 indicates that the fields NPWG, NPWA, NPDG, NPDA, and + * OPTPERF = 01b indicates that the fields NPWG, NPWA, NPDG, NPDA, and * NOWS are defined for this namespace and should be used by * the host for I/O optimization. */ - id->nsfeat |= 1 << 4; + id->nsfeat |= 0x1 << NVME_NS_FEAT_OPTPERF_SHIFT; /* NPWG = Namespace Preferred Write Granularity. 0's based */ id->npwg = to0based(bdev_io_min(bdev) / bdev_logical_block_size(bdev)); /* NPWA = Namespace Preferred Write Alignment. 0's based */