From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [PATCH 14/15] scsi: lpfc: Switch to scsi_get_block_count()
Date: Tue, 8 Jun 2021 23:39:28 -0400 [thread overview]
Message-ID: <20210609033929.3815-15-martin.petersen@oracle.com> (raw)
In-Reply-To: <20210609033929.3815-1-martin.petersen@oracle.com>
Use scsi_get_block_count() for places where the I/O size needs to be
expressed in units of the logical block size.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
drivers/scsi/lpfc/lpfc_scsi.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index ca2e00e512f4..5f19eccaad24 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -2959,7 +2959,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
" 0x%x lba 0x%llx blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
(unsigned long long)scsi_get_lba(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
}
if (lpfc_bgs_get_reftag_err(bgstat)) {
@@ -2974,7 +2974,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
" 0x%x lba 0x%llx blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
(unsigned long long)scsi_get_lba(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
}
if (lpfc_bgs_get_apptag_err(bgstat)) {
@@ -2989,7 +2989,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
" 0x%x lba 0x%llx blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
(unsigned long long)scsi_get_lba(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
}
if (lpfc_bgs_get_hi_water_mark_present(bgstat)) {
@@ -3033,7 +3033,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
" 0x%x lba 0x%llx blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
(unsigned long long)scsi_get_lba(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
/* Calcuate what type of error it was */
lpfc_calc_bg_err(phba, lpfc_cmd);
@@ -3071,7 +3071,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"0x%x reftag 0x%x blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
scsi_prot_ref_tag(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
ret = (-1);
goto out;
}
@@ -3083,7 +3083,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"0x%x reftag 0x%x blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
scsi_prot_ref_tag(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
ret = (-1);
goto out;
}
@@ -3099,7 +3099,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"0x%x reftag 0x%x blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
scsi_prot_ref_tag(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
}
if (lpfc_bgs_get_reftag_err(bgstat)) {
@@ -3114,7 +3114,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"0x%x reftag 0x%x blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
scsi_prot_ref_tag(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
}
if (lpfc_bgs_get_apptag_err(bgstat)) {
@@ -3129,7 +3129,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"0x%x reftag 0x%x blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
scsi_prot_ref_tag(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
}
if (lpfc_bgs_get_hi_water_mark_present(bgstat)) {
@@ -3173,7 +3173,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
"0x%x reftag 0x%x blk cnt 0x%x "
"bgstat=x%x bghm=x%x\n", cmd->cmnd[0],
scsi_prot_ref_tag(cmd),
- blk_rq_sectors(cmd->request), bgstat, bghm);
+ scsi_get_block_count(cmd), bgstat, bghm);
/* Calcuate what type of error it was */
lpfc_calc_bg_err(phba, lpfc_cmd);
@@ -5261,7 +5261,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
dif_op_str[scsi_get_prot_op(cmnd)],
cmnd->cmnd[0],
scsi_prot_ref_tag(cmnd),
- blk_rq_sectors(cmnd->request),
+ scsi_get_block_count(cmnd),
(cmnd->cmnd[1]>>5));
}
err = lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd);
@@ -5273,7 +5273,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
"x%x reftag x%x cnt %u pt %x\n",
cmnd->cmnd[0],
scsi_prot_ref_tag(cmnd),
- blk_rq_sectors(cmnd->request),
+ scsi_get_block_count(cmnd),
(cmnd->cmnd[1]>>5));
}
err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd);
--
2.31.1
next prev parent reply other threads:[~2021-06-09 3:39 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 3:39 [PATCH 00/15] Subject: Protection information and block size cleanup Martin K. Petersen
2021-06-09 3:39 ` [PATCH 01/15] scsi: core: Add scsi_prot_ref_tag() helper Martin K. Petersen
2021-06-09 19:55 ` Bart Van Assche
2021-06-14 14:33 ` Benjamin Block
2021-06-09 3:39 ` [PATCH 02/15] scsi: lpfc: Use the proper SCSI midlayer interfaces for PI Martin K. Petersen
2021-06-09 3:39 ` [PATCH 03/15] scsi: qla2xxx: " Martin K. Petersen
2021-06-17 0:15 ` Arun Easi
2021-06-09 3:39 ` [PATCH 04/15] scsi: mpt3sas: " Martin K. Petersen
2021-06-09 3:39 ` [PATCH 05/15] scsi: mpi3mr: " Martin K. Petersen
2021-06-09 3:39 ` [PATCH 06/15] scsi: zfcp: " Martin K. Petersen
2021-06-14 14:33 ` Benjamin Block
2021-06-15 2:27 ` Martin K. Petersen
2021-06-15 9:31 ` Benjamin Block
2021-06-09 3:39 ` [PATCH 07/15] scsi: isci: " Martin K. Petersen
2021-06-09 3:39 ` [PATCH 08/15] scsi: scsi_debug: Remove dump_sector() Martin K. Petersen
2021-06-09 19:55 ` Bart Van Assche
2021-06-14 22:06 ` Douglas Gilbert
2021-06-09 3:39 ` [PATCH 09/15] scsi: scsi_debug: Improve RDPROTECT/WRPROTECT handling Martin K. Petersen
2021-06-14 22:07 ` Douglas Gilbert
2021-06-09 3:39 ` [PATCH 10/15] scsi: core: Introduce scsi_get_sector() Martin K. Petersen
2021-06-14 14:48 ` Benjamin Block
2021-06-15 2:28 ` Martin K. Petersen
2021-06-15 9:33 ` Benjamin Block
2021-06-09 3:39 ` [PATCH 11/15] scsi: iser: Use scsi_get_sector() instead of scsi_get_lba() Martin K. Petersen
2021-06-09 3:39 ` [PATCH 12/15] scsi: core: Make scsi_get_lba() return the LBA Martin K. Petersen
2021-06-09 19:57 ` Bart Van Assche
2021-06-14 14:50 ` Benjamin Block
2021-06-15 9:34 ` Benjamin Block
2021-06-09 3:39 ` [PATCH 13/15] scsi: core: Add helper to return number of logical blocks in a request Martin K. Petersen
2021-06-09 19:58 ` Bart Van Assche
2021-06-10 3:19 ` Martin K. Petersen
2021-06-10 3:40 ` Bart Van Assche
2021-06-09 3:39 ` Martin K. Petersen [this message]
2021-06-09 3:39 ` [PATCH 15/15] scsi: ufs: core: Use scsi_get_lba() to get LBA Martin K. Petersen
2021-06-09 19:59 ` Bart Van Assche
2021-07-16 21:27 ` [PATCH 00/15] Subject: Protection information and block size cleanup Bart Van Assche
2021-07-19 1:43 ` Martin K. Petersen
2021-07-21 3:53 ` Bart Van Assche
2021-07-24 2:13 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210609033929.3815-15-martin.petersen@oracle.com \
--to=martin.petersen@oracle.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).