From owner-freebsd-arch Mon Jun 26 14:32:33 2000 Delivered-To: freebsd-arch@freebsd.org Received: from mail.bastard.co.uk (node16292.a2000.nl [24.132.98.146]) by hub.freebsd.org (Postfix) with ESMTP id AD29437BCBB for ; Mon, 26 Jun 2000 14:32:26 -0700 (PDT) (envelope-from adrian@bastard.co.uk) Received: from adrian by mail.bastard.co.uk with local (Exim 3.14 #1) id 136gU7-000E5m-00; Mon, 26 Jun 2000 23:32:03 +0200 Date: Mon, 26 Jun 2000 23:32:03 +0200 From: Adrian Chadd To: Alfred Perlstein Cc: arch@freebsd.org Subject: Re: dynamic filetypes. please comment. Message-ID: <20000626233203.Y36017@zoe.bastard.co.uk> References: <20000626142428.A275@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000626142428.A275@fw.wintelcom.net>; from bright@wintelcom.net on Mon, Jun 26, 2000 at 02:24:28PM -0700 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Jun 26, 2000, Alfred Perlstein wrote: > In order to have a kld add a new filetype (DTYPE_VNODE, DTYPE_PIPE, > etc.) it needs to generate a unique number. > > My inclination is to just add a DTYPE_MAX(*) and provide a function > for the kld initializers to call "short getnewdtype(void)" which > returns the next available number. This does limit us to about > 32764 module driver loads before getnewdtype will return -1 (error). > > This idea leads us to a generic api for seqeunce number generation > that we can use when a subsystem needs an increasing unique number, > the api would look something like: > > (void)sequence_register("filetypes", starting_number); > mynum = sequence_next("filetypes"); /* to be used for f_type */ The debug gods might like: mynum = sequence_next("filetypes", "DTYPE_FOO", "A foo-type file"); ? Adrian -- Adrian Chadd Build a man a fire, and he's warm for the rest of the evening. Set a man on fire and he's warm for the rest of his life. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message