Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 2000 11:25:38 -0500 (EST)
From:      Bosko Milekic <bmilekic@dsuper.net>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        iedowse@maths.tcd.ie, freebsd-net@freebsd.org
Subject:   Re: M_RDONLY: review & comment
Message-ID:  <Pine.BSF.4.21.0011121119030.11341-100000@jehovah.technokratis.com>
In-Reply-To: <200011121310.aa19093@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 12 Nov 2000, David Malone wrote:

> Ahhh, crap, I ment to reply to you about this before you committed it,
> but I've been too busy. (I'm also not on freebsd-net, so I didn't notice
> the post until Ian pointed it out ;-()
> 
> I was talking to Ian about the ext_type stuff, and there is a
> problem with it. The problem is that you need to allocate a static
> number for each type in question, which is not good for loadable
> modules which might define their own types. In general people are
> trying to get away from fixed things like major device numbers and
> this seems to be just another of these things.

	Not necessarily. If you'll notice, I changed the type for if_ti,
  if_wb, etc. to have only ONE type, EXT_NET_DRV. The only real important
  type is EXT_CLUSTER, because that's the one we always check to see if
  it's "this one, or all the others." The others are there mainly for
  debugging purposes.

> I can think of two possible alternatives. One is to get rid of the
> ext_type stuff, as it doesn't really buy us anything, except maybe
> slightly clearer code or being able to tell the type while debugging.
> 
> The other option I thought of is to use a char *. You could point
> to a static string describing the type of external storage. This
> way is still fast comparing types, just compare the pointers.  If
> you want to know what the type is in human readable format (for
> debugging) you just look at the string it points at. Also the
> kernel allocates different addresses for different strings, so
> it automatically solves the problem of allocating unique numbers
> to each type.
> 
> 	David.

	There are flaws with this. One is that there's no way to know ahead
  of time what type has what address associated to it. I think what we
  should do is maybe add EXT_MOD_TYPE and all the modules adding their own
  ext_buf's that are _not_ network drivers can use that. Seems much simpler
  to me. Note that this is unlike major/minor numbers in that each type
  does not have to be unique.

	Note that I will change the short ext_type to an int. It's typically
  faster on the alpha and it doesn't cost us anything.

  Cheers,
  Bosko Milekic
  bmilekic@technokratis.com




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0011121119030.11341-100000>