lkml.org 
[lkml]   [2009]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] scsi: add scsi_device->alt_capacity
From
Date
On Sat, 2009-05-09 at 09:13 +0900, Tejun Heo wrote:
> Add scsi_device->alt_capacity and let sd pass it over to genhd. This
> is to allow SCSI low level drivers to configure alt_capacity via
> slave_configure().
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Jens Axboe <jens.axboe@oracle.com>
> Cc: Dan Williams <dan.j.williams@gmail.com>
> Cc: Jeff Garzik <jeff@garzik.org>
> Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
> ---
> drivers/scsi/sd.c | 1 +
> include/scsi/scsi_device.h | 1 +
> 2 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 3fcb64b..f3448bf 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -1839,6 +1839,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
> blk_queue_ordered(sdkp->disk->queue, ordered, sd_prepare_flush);
>
> set_capacity(disk, sdkp->capacity);
> + set_alt_capacity(disk, sdp->alt_capacity);
> kfree(buffer);
>
> out:
> diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
> index 3f566af..b24fdeb 100644
> --- a/include/scsi/scsi_device.h
> +++ b/include/scsi/scsi_device.h
> @@ -92,6 +92,7 @@ struct scsi_device {
> unsigned int manufacturer; /* Manufacturer of device, for using
> * vendor-specific cmd's */
> unsigned sector_size; /* size in bytes */
> + size_t alt_capacity; /* alternative capacity, used by sd */
>
> void *hostdata; /* available to low-level driver */
> char type;

This is done at slightly the wrong level. Capacity is actually a
property of struct scsi_disk not struct scsi_device ... shouldn't
alt_capacity be at the same level?

James




\
 
 \ /
  Last update: 2009-05-09 06:27    [W:0.080 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site