All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 1/5] scsi: core: Add helper to return number of logical blocks in a request
Date: Mon, 9 Aug 2021 14:54:51 -0700	[thread overview]
Message-ID: <88c5ecd4-7020-5eaa-65cc-b105b850a1e5@acm.org> (raw)
In-Reply-To: <20210806040023.5355-2-martin.petersen@oracle.com>

On 8/5/21 9:00 PM, Martin K. Petersen wrote:
> Cc: Bart Van Assche <bvanassche@acm.org>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> ---
>  include/scsi/scsi_cmnd.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
> index 90da9617d28a..804b2b33da4a 100644
> --- a/include/scsi/scsi_cmnd.h
> +++ b/include/scsi/scsi_cmnd.h
> @@ -232,6 +232,13 @@ static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd)
>  	return blk_rq_pos(scmd->request) >> shift;
>  }
>  
> +static inline unsigned int scsi_logical_block_count(struct scsi_cmnd *scmd)
> +{
> +	unsigned int shift = ilog2(scmd->device->sector_size) - SECTOR_SHIFT;
> +
> +	return blk_rq_bytes(scmd->request) >> shift;
> +}

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

  reply	other threads:[~2021-08-09 21:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06  4:00 Use the proper SCSI midlayer interface for PI Martin K. Petersen
2021-08-06  4:00 ` [PATCH v2 1/5] scsi: core: Add helper to return number of logical blocks in a request Martin K. Petersen
2021-08-09 21:54   ` Bart Van Assche [this message]
2021-08-17  3:17   ` Martin K. Petersen
2021-08-06  4:00 ` [PATCH v2 2/5] scsi: isci: Use the proper SCSI midlayer interfaces for PI Martin K. Petersen
2021-08-09 21:57   ` Bart Van Assche
2021-08-06  4:00 ` [PATCH v2 3/5] scsi: mpi3mr: " Martin K. Petersen
2021-08-12  8:51   ` Kashyap Desai
2021-08-06  4:00 ` [PATCH v2 4/5] scsi: mpt3sas: " Martin K. Petersen
2021-08-07  3:43   ` kernel test robot
2021-08-07  3:43     ` kernel test robot
2021-08-06  4:00 ` [PATCH v2 5/5] scsi: lpfc: " Martin K. Petersen
2021-08-24 15:11   ` James Smart

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=88c5ecd4-7020-5eaa-65cc-b105b850a1e5@acm.org \
    --to=bvanassche@acm.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.