Re: [patch] dynamic char and block devices

Oliver Xymoron (oxymoron@waste.org)
Wed, 13 Oct 1999 14:09:45 -0500 (CDT)


On Wed, 13 Oct 1999, Jeff Garzik wrote:

> Linus and other penguins--
>
> The attached patch against 2.3.21 updates fs/devices.c to be dynamic,
> instead of using two static arrays indexed by major number.

I wrote this patch a couple months ago (you may have seen my recent post
describing it). It was a side-effect of the major piece of my patch, which
allows minors to conveniently subclass majors without having a big nasty
switch statement. Look at drivers/char/mem.c or drivers/char/misc.c for an
example.

I realized when I'd finished this that resource trees were an even better
way to go. It allows us to say things like major x minors a-b use these
fileops while major x minors c-d use these other fileops. It also allows
register_device to be _much_ smarter about how it allocates things - you
can say "please give me a whole major", "please give me 8 minors", any
granularity you'd like. The divide between majors and minors becomes a
continuum. Think of it as CIDR for device space.

--
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/