public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Kurt Garloff <garloff@suse.de>, Andrew Morton <akpm@osdl.org>,
	linux-scsi@vger.kernel.org, Badari Pulavarty <pbadari@us.ibm.com>,
	Matthew Wilcox <willy@debian.org>,
	James Bottomley <James.Bottomley@steeleye.com>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: lots and lots of disks again
Date: Tue, 10 Feb 2004 13:39:32 +0000	[thread overview]
Message-ID: <20040210133932.A3870@infradead.org> (raw)
In-Reply-To: <20040210112658.GC4010@tpkurt.garloff.de>; from garloff@suse.de on Tue, Feb 10, 2004 at 12:26:58PM +0100

On Tue, Feb 10, 2004 at 12:26:58PM +0100, Kurt Garloff wrote:
> +/* sd_index_bits array size / disks
> + * 			32  /    256
> + * 		      4096  /  32768
> + * 		     32768  / 262144
> + */
> +#ifdef CONFIG_EMBEDDED
> +# define SD_DISKS	256
> +#else
> +# define SD_DISKS	32768	// we can raise this to 262144 if needed
> +#endif

Umm, using CONFIG_EMBEDDED doesn't mean no config option - it just mean
another config option which no-one would think of changing the number of
support scsi disks.

Really, any solution that requires huge static allocations is wrong.  The
bitmap either needs to be replaced with a saner algorithm or dynamic
allocation and reallocation on growth.

>  }
>  
> +static int inv_sd_major(int major)
> +{
> +	switch (major) {
> +	case SCSI_DISK0_MAJOR:
> +		return 0;
> +	case SCSI_DISK1_MAJOR ... SCSI_DISK7_MAJOR:
> +		return major + 1 - SCSI_DISK1_MAJOR;
> +	case SCSI_DISK8_MAJOR ... SCSI_DISK15_MAJOR:
> +		return major + 8 - SCSI_DISK8_MAJOR;
> +	default:
> +		BUG();
> +		return 0;	/* shut up gcc */
> +	}
> +}
> +
> +unsigned int dev_to_sd_nr(unsigned int dev) {
> +	return  ((dev >> 4) & 15) | (inv_sd_major(dev >> 20) << 4) |
> +		(dev & 0x3ff00);
> +}
> +unsigned int dev_to_sd_part(unsigned int dev) {
> +	return  (dev & 15) | ((dev >> 14) & 0x30);
> +}
> +

Maybe I missed something but this seems completely unused?

Also please follow the coding style guidelines, that is opening brace
for functions on the next line and non-exported functions always static.


  reply	other threads:[~2004-02-10 13:39 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-04 10:45 lots and lots of disks again Andrew Morton
2004-02-10 11:04 ` Kurt Garloff
2004-02-10 11:26   ` Kurt Garloff
2004-02-10 13:39     ` Christoph Hellwig [this message]
2004-02-10 15:47       ` Kurt Garloff
2004-02-10 15:52         ` Christoph Hellwig
2004-02-10 16:08           ` Kurt Garloff
2004-02-10 20:10             ` Andries Brouwer
2004-02-10 20:11               ` Matthew Wilcox
2004-02-10 20:58               ` Kurt Garloff
2004-02-10 21:21                 ` viro
2004-02-10 21:34                   ` Kurt Garloff
2004-02-10 21:42                     ` viro
2004-02-10 22:28                       ` Kurt Garloff
2004-02-10 18:26         ` Andrew Morton
2004-02-11 14:56           ` Kurt Garloff
2004-02-11 21:28             ` Andrew Morton
2004-02-11 22:09               ` Kurt Garloff
2004-02-11 22:29                 ` Andrew Morton
2004-02-11 22:53                   ` viro
2004-02-12 15:00                     ` Kurt Garloff
2004-02-12 15:20                       ` James Bottomley
2004-02-12 15:57                       ` viro
2004-02-12 16:18                         ` Kurt Garloff
2004-02-12 16:43                           ` James Bottomley
2004-02-16 12:40                             ` Kurt Garloff
2004-02-16 22:57                               ` Andries Brouwer
2004-02-17  0:56                                 ` James Bottomley
2004-02-17  7:57                                   ` Kurt Garloff
2004-02-17 15:08                                     ` James Bottomley
2004-02-17 15:28                                     ` Matthew Wilcox
2004-02-17 14:49                                   ` Andries Brouwer
2004-02-17 15:18                                     ` James Bottomley
2004-02-17 15:27                                       ` Kurt Garloff
2004-02-29 16:41                                         ` James Bottomley
2004-02-29 23:31                                           ` Kurt Garloff
2004-03-03 19:30                                           ` Mike Anderson
2004-03-03 19:55                                             ` Kurt Garloff
2004-02-17 15:50                                       ` Andries Brouwer
2004-02-17 17:57                                         ` James Bottomley
2004-02-17 18:44                                           ` Andries Brouwer
2004-02-13  0:05                       ` Kurt Garloff
2004-02-16 12:31                         ` Kurt Garloff

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=20040210133932.A3870@infradead.org \
    --to=hch@infradead.org \
    --cc=James.Bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=garloff@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    --cc=willy@debian.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox