All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: linux-scsi@vger.kernel.org, tomof@acm.org,
	James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH 4/5] scsi_debug: support large non-fake virtual disk
Date: Sat, 29 Mar 2008 14:09:29 -0400	[thread overview]
Message-ID: <47EE85D9.5070803@torque.net> (raw)
In-Reply-To: <1206806398-22205-5-git-send-email-fujita.tomonori@lab.ntt.co.jp>

FUJITA Tomonori wrote:
> Currently, the maximum amount of RAM that scsi_debug can allocate is
> 4GB. This patch increases it to 2TB; scsi_debug can allocates 2TB
> memory and export it as if it were 2TB scsi disk.
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Cc: Douglas Gilbert <dougg@torque.net>
> Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
> ---
>  drivers/scsi/scsi_debug.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index c98559e..1b6a6d8 100644
> --- a/drivers/scsi/scsi_debug.c
> +++ b/drivers/scsi/scsi_debug.c
> @@ -1949,7 +1949,7 @@ static void __init init_all_queued(void)
>  }
>  
>  static void __init sdebug_build_parts(unsigned char *ramp,
> -				      unsigned int store_size)
> +				      unsigned long store_size)
>  {
>  	struct partition * pp;
>  	int starts[SDEBUG_MAX_PARTS + 2];
> @@ -2476,14 +2476,14 @@ static void do_remove_driverfs_files(void)
>  
>  static int __init scsi_debug_init(void)
>  {
> -	unsigned int sz;
> +	unsigned long sz;
>  	int host_to_add;
>  	int k;
>  	int ret;
>  
>  	if (scsi_debug_dev_size_mb < 1)
>  		scsi_debug_dev_size_mb = 1;  /* force minimum 1 MB ramdisk */
> -	sz = (unsigned int)scsi_debug_dev_size_mb * 1048576;
> +	sz = (unsigned long)scsi_debug_dev_size_mb * 1048576;
>  	sdebug_store_sectors = sz / SECT_SIZE;
>  	sdebug_capacity = get_sdebug_capacity();
>  

Tomo,
Unsigned long is 32 bits on i386 (and 64 bits in the LP64
data model). Don't you want 64 bits in all cases? Either
unsigned long long, uint64_t or one of those crappy
kernel typedefs for 64 bits.

BTW I recently removed just about all the "unsigned long"
declarations out of sg3_utils due the uncertainty about the
size of "long".

Doug Gilbert

  parent reply	other threads:[~2008-03-29 19:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-29 15:59 [PATCH 0/5] scsi_debug: increase the amount of ram that scsi_ram can allocate FUJITA Tomonori
2008-03-29 15:59 ` [PATCH 1/5] scsi_debug: remove unnecessary sdebug_store_size FUJITA Tomonori
2008-03-29 15:59   ` [PATCH 2/5] scsi_debug: sweep up sdebug_capacity calculation FUJITA Tomonori
2008-03-29 15:59     ` [PATCH 3/5] scsi_debug: remove the duplicated code in resp_read and resp_write FUJITA Tomonori
2008-03-29 15:59       ` [PATCH 4/5] scsi_debug: support large non-fake virtual disk FUJITA Tomonori
2008-03-29 15:59         ` [PATCH 5/5] scsi_debug: remove unnecessary function declarations FUJITA Tomonori
2008-03-29 18:09         ` Douglas Gilbert [this message]
2008-03-30  2:58           ` [PATCH 4/5] scsi_debug: support large non-fake virtual disk FUJITA Tomonori
2008-03-30 17:11 ` [PATCH 0/5] scsi_debug: increase the amount of ram that scsi_ram can allocate Douglas Gilbert

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=47EE85D9.5070803@torque.net \
    --to=dougg@torque.net \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tomof@acm.org \
    /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.