Re: [PATCH 4/4] Replace scmd->transfersize with scsi_transfer_size()

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

 



On 18 Oct, Matthew Wilcox wrote:
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
...
> @@ -2355,3 +2354,18 @@ void scsi_kunmap_atomic_sg(void *virt)
>  	kunmap_atomic(virt, KM_BIO_SRC_IRQ);
>  }
>  EXPORT_SYMBOL(scsi_kunmap_atomic_sg);
> +
> +/*
> + * Returns the minimum size that must be transferred in one go.  For
> + * normal commands, this is the sector size of the device.  For special
> + * commands, the whole command must be transferred at once.  If a driver
> + * cannot transfer at least this much, it should fail the command.
> + */


As it is an exported symbol, kerneldoc format for the description is
appropriate:

/**
 * scsi_transfer_size - returns the minimum size that must be transferred in one go
 * @cmd: command for which to get the transfer size
 *
 * For normal commands, this is the sector size of the device.  For special
 * commands, the whole command must be transferred at once.  If a driver
 * cannot transfer at least this much, it should fail the command.
 */

IMO the last paragraph could be condensed to

 * If a driver cannot transfer at least this much, it should fail the command.
 */

> +unsigned int scsi_transfer_size(struct scsi_cmnd *cmd)
> +{
> +	struct request *req = cmd->request;

Whitespace police says:  Here goes a blank line.

> +	if (req->cmd_type == REQ_TYPE_BLOCK_PC)
> +		return req->data_len;
> +	return cmd->device->sector_size;
> +}
> +EXPORT_SYMBOL(scsi_transfer_size);


-- 
Stefan Richter
-=====-=-=== =-=- =--==
http://arcgraph.de/sr/


-
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