Date: Wed, 28 Jun 2000 10:21:30 -0700 (PDT) From: John Baldwin <jhb@freebsd.org> To: Adrian Chadd <adrian@freebsd.org> Cc: arch@freebsd.org, Alfred Perlstein <bright@wintelcom.net> Subject: Re: dynamic filetypes. please comment. Message-ID: <200006281721.KAA03677@john.baldwin.cx> In-Reply-To: <20000628102839.H58428@zoe.bastard.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
On 28-Jun-00 Adrian Chadd wrote: > On Tue, Jun 27, 2000, John Baldwin wrote: >> >> On 26-Jun-00 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. >> >> Ummm, what happened to fixing the kernel code to not need a type >> but to add the appropriate vfsops as Peter suggested during the >> BSDi hospitality thingie at Usenix? That solution avoids the need >> for filetypes at all and provides the cleaner solution. IIRC, the >> primary offender was sendfile(). > > Hrm. Can you go into a little more detail for us non-USENIXians? Apparently, one of the reasons for dynamic file types were that some functions, such as sendfile(), actually used a switch() on the fd type to determine what action to take. Thus, every time you add a file type, you have to modify sendfile() to teach it about the new type. Peter's suggestion was that instead of adding in support for dynamic fd types (and I presume some callout mechanism whereby new fd type modules can register handlers or something for sendfile()), just add a VOP to each fd type's functions for sendfile(). (Well, my terminology is somewhat sketchy since I'm not a VFS expert, but hopefully the general point is made.) Ideally, each fd should know how to manage itself and the kernel should be able to call methods of the fd (oop-ish, I know) rather than requiring the system to know about all the various fd types. Of course, with this method you require each fd type to know all the basic operations must be performed, but that doesn't seem unreasonable IMHO. > Adrian -- John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006281721.KAA03677>