Date: Wed, 24 Jul 1996 20:26:07 +1000 From: Bruce Evans <bde@zeta.org.au> To: CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sys@freefall.freebsd.org, phk@freefall.freebsd.org Subject: Re: cvs commit: src/sys/dev/ccd ccd.c src/sys/dev/vn vn.c src/sys/sys conf.h src/sys/i386/isa fd.c mcd.c scd.c wcd.c wd.c wt.c src/sys/i386/isa/matcd matcd.c src/sys/kern kern_conf.c src/sys/scsi cd.c od.c sd.c st.c Message-ID: <199607241026.UAA21158@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
> Modified: sys/dev/ccd ccd.c > sys/dev/vn vn.c > sys/i386/isa fd.c mcd.c scd.c wcd.c wd.c wt.c > sys/i386/isa/matcd matcd.c > sys/kern kern_conf.c > sys/scsi cd.c od.c sd.c st.c > sys/sys conf.h > Log: > Make a "DWIM" function for adding [bc]devsw entries for bdev drivers. > > Saves about 280 butes of source per driver, 56 bytes in object size > and another 56 bytes moves from data to bss. This broke wcd, which has bogusly different open and close functions for cdevs and bdevs. Compiling LINT gives a nice warning that the cdev open and close functions are no longer used. This change interferes with the correct change, which is to nuke the SYSINIT()s and call bdevsw_add() and cdevsw_add() in the device attach functions. These functions should eventually have a different interface that doesn't involve the driver knowing its own device number. The main wastages in the previous interface were the makedevs and the always-NULL pointers. Changing [bc]devsw_add() to take args (int major, struct [bc]devsw *new) would save about the same amount of space as using the new generic interface for bdev drivers, and more space for cdev-only drivers. However, this might break the intended final interface, which may involve passing back the `old' devsw pointer and a reconstructed device number. Changing to bdevsw_add_generic() has already broken it. However^2, the final interface should involve device descriptors instead of numbers, and overwriting an in-use device descriptor should be an error so `old' pointers should be useless (they would always point to a garbage devsw). Thus the current interface is not worth preserving. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607241026.UAA21158>