Re: [PATCH 1/19] add data buffer accessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2007-05-12 at 19:05 +0900, FUJITA Tomonori wrote:
> Add a set of accessors for the scsi data buffer. This is in
> preparation for chaining sg lists and bidirectional requests (and
> possibly, the mid-layer dma mapping).
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
> ---
>  drivers/scsi/scsi_lib.c  |   26 ++++++++++++++++++++++++++
>  include/scsi/scsi_cmnd.h |   11 +++++++++++
>  2 files changed, 37 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 1f5a07b..a2ebe61 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -2290,3 +2290,29 @@ void scsi_kunmap_atomic_sg(void *virt)
>  	kunmap_atomic(virt, KM_BIO_SRC_IRQ);
>  }
>  EXPORT_SYMBOL(scsi_kunmap_atomic_sg);
> +
> +int scsi_dma_map(struct device *dev, struct scsi_cmnd *cmd)

Actually, this is redundant.  We make sure the
shost->shost_gendev.parent is the device which should have been passed
in to scsi_add_host().

> +{
> +	int nseg = 0;
> +
> +	if (cmd->use_sg) {
> +		struct scatterlist *sg =
> +			(struct scatterlist *) cmd->request_buffer;
> +
> +		nseg = dma_map_sg(dev, sg, cmd->use_sg, cmd->sc_data_direction);
> +		if (unlikely(!nseg))
> +			return -ENOMEM;
> +	}
> +	return nseg;
> +}
> +EXPORT_SYMBOL(scsi_dma_map);
> +
> +void scsi_dma_unmap(struct device *dev, struct scsi_cmnd *cmd)

Same here.

James


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux