Skip to content

Commit e0d56e7

Browse files
calebsanderkeithbusch
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 1029298 commit e0d56e7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/nvme/target/io-cmd-bdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id)
3030
id->nacwu = lpp0b;
3131

3232
/*
33-
* Bit 4 indicates that the fields NPWG, NPWA, NPDG, NPDA, and
33+
* OPTPERF = 01b indicates that the fields NPWG, NPWA, NPDG, NPDA, and
3434
* NOWS are defined for this namespace and should be used by
3535
* the host for I/O optimization.
3636
*/
37-
id->nsfeat |= 1 << 4;
37+
id->nsfeat |= 0x1 << NVME_NS_FEAT_OPTPERF_SHIFT;
3838
/* NPWG = Namespace Preferred Write Granularity. 0's based */
3939
id->npwg = to0based(bdev_io_min(bdev) / bdev_logical_block_size(bdev));
4040
/* NPWA = Namespace Preferred Write Alignment. 0's based */

0 commit comments

Comments
 (0)