Re: [PATCH 5/6] bsg: replace SG v3 with SG v4

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

 



On Wed, Dec 20 2006, FUJITA Tomonori wrote:
> This patch replaces SG v3 in bsg with SG v4 (except for SG_IO).
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
> ---
>  block/bsg.c |  198 ++++++++++++++++++++++++++++++++++++-----------------------
>  1 files changed, 121 insertions(+), 77 deletions(-)
> 
> diff --git a/block/bsg.c b/block/bsg.c
> index 53a09a5..6d139d2 100644
> --- a/block/bsg.c
> +++ b/block/bsg.c
> @@ -103,8 +103,8 @@ struct bsg_command {
>  	struct request *rq;
>  	struct bio *bio;
>  	int err;
> -	struct sg_io_hdr hdr;
> -	struct sg_io_hdr __user *uhdr;
> +	struct sg_io_v4 hdr;
> +	struct sg_io_v4 __user *uhdr;
>  	char sense[SCSI_SENSE_BUFFERSIZE];
>  };
>  
> @@ -235,57 +235,82 @@ static struct bsg_command *bsg_get_comma
>  	return bc;
>  }
>  
> +static int blk_fill_sgv4_hdr_rq(request_queue_t *q, struct request *rq,
> +				struct sg_io_v4 *hdr, int has_write_perm)
> +{
> +	memset(rq->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
> +
> +	if (copy_from_user(rq->cmd, (void *)(unsigned long)hdr->request,
> +			   hdr->request_len))
> +		return -EFAULT;

Strange casting, that should be cleaned up. Also reminds me that the
sg_io_v4 header needs proper __user annotation.

-- 
Jens Axboe

-
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