Skip to content

Commit 9bcf156

Browse files
damien-lemoalkeithbusch
authored andcommitted
nvmet: use PAGE_SECTORS_SHIFT
Replace occurences of the pattern "PAGE_SHIFT - 9" in the passthru and loop targets with PAGE_SECTORS_SHIFT. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent e5bb098 commit 9bcf156

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/nvme/target/loop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl)
373373
goto out_cleanup_tagset;
374374

375375
ctrl->ctrl.max_hw_sectors =
376-
(NVME_LOOP_MAX_SEGMENTS - 1) << (PAGE_SHIFT - 9);
376+
(NVME_LOOP_MAX_SEGMENTS - 1) << PAGE_SECTORS_SHIFT;
377377

378378
nvme_unquiesce_admin_queue(&ctrl->ctrl);
379379

drivers/nvme/target/passthru.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ static u16 nvmet_passthru_override_id_ctrl(struct nvmet_req *req)
102102
* which depends on the host's memory fragementation. To solve this,
103103
* ensure mdts is limited to the pages equal to the number of segments.
104104
*/
105-
max_hw_sectors = min_not_zero(pctrl->max_segments << (PAGE_SHIFT - 9),
105+
max_hw_sectors = min_not_zero(pctrl->max_segments << PAGE_SECTORS_SHIFT,
106106
pctrl->max_hw_sectors);
107107

108108
/*
109109
* nvmet_passthru_map_sg is limitted to using a single bio so limit
110110
* the mdts based on BIO_MAX_VECS as well
111111
*/
112-
max_hw_sectors = min_not_zero(BIO_MAX_VECS << (PAGE_SHIFT - 9),
112+
max_hw_sectors = min_not_zero(BIO_MAX_VECS << PAGE_SECTORS_SHIFT,
113113
max_hw_sectors);
114114

115115
page_shift = NVME_CAP_MPSMIN(ctrl->cap) + 12;

0 commit comments

Comments
 (0)