Removing DTYPE macros from the fdesc file system

and a few other changes, too

Chris Costello

            chris@FreeBSD.org
          

September 2000

The File Descriptor table file system (fdescfs) has been my project for the past couple of months, off and on. I've recently gotten around to updating this file system to make it cleaner, with the intent of including it into the devfs project.


1. The DTYPE Macros

DTYPE macros are used to differentiate between different types in the file descriptor table. There are currently five such macros--DTYPE_VNODE, DTYPE_SOCKET, DTYPE_PIPE, DTYPE_FIFO, and DTYPE_KQUEUE. There are two very large problems with this technique:

  1. To add any new file type to the system, for example, for the kqueue mechanism, fdescfs and other code using DTYPE macros to report a file table need to be modified and recompiled.

  2. Should any driver register itself a new file type (by means of a new fileops entry), fdescfs would probably report inaccurate information for it, if not just plain garbage.