Skip to contentSkip to conversation

RFC/Patch - Implode devfs

DISCUSSION Adam J. Richter 1 participant 1 message Jan 1, 2003 VFS

lore
Share & tools
lore
#0 lore raw

I have made a new version of my mini-devfs (attached below).
I have also made a first version of my devfs_helper program to handle the functionality of devfsd on systems that use my mini-devfs. devfs_helper is avaiable from the following location:

ftp://ftp.yggdrasil.com/pub/dist/device_control/devfs_helper/devfs_helper-0.1.tar.gz

This version of devfs_helper only supports "EXECUTE" and
"MODLOAD" actions, which may be the only events that are really necessary. In the future, I envision eliminating the "MODLOAD" action, since it is equivalent to
"EXECUTE modprobe -C /etc/modprobe.devfs $devname".

devfs_helper is currently 211 lines of C code. In comparison,
devfsd-1.3.25/*.[ch] is 3143 lines.

Also, here is version 2 of my mini-devfs. I am embarassed
to say that I omitted Richard Gooch's copyright notice on his code that I copoied into mini-devfs/numspace.c. This patch corrects that and fixes a variety of other little problems. It also changes the directory of this facility to fs/mini-devfs/. One change that is necessary for operation with devfs_helper is that the event names are now in all capitals ("REGISTER" and "LOOKUP") to match the format of /etc/devfsd.conf.

mini-devfs has grown by 21 lines, mostly due to my restoring
Richard's copyright notice. Here is an updated size comparison in case anyone is interested:

devfs 3614 lines 25,863 bytes
mini-devfs 650 lines 5,562 bytes
Reduction 5.6x 4.6x

Signature · 4 lines
Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."
include/linux/devfs_fs_kernel.h +4 -0
@@ -24,7 +24,11 @@
 #define DEVFS_SPECIAL_CHR     0
 #define DEVFS_SPECIAL_BLK     1
 
+#ifdef CONFIG_DEVFS_SMALL
+typedef struct dentry * devfs_handle_t;
+#else
 typedef struct devfs_entry * devfs_handle_t;
+#endif
 
 #ifdef CONFIG_DEVFS_FS
 
fs/namei.c +19 -4
@@ -1377,9 +1377,9 @@
 }
 
 /* SMP-safe */
-static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
+struct dentry *lookup_create(struct nameidata *nd, int is_dir)
 {
 	struct dentry *dentry;
 
--- linux-2.5.53/fs/Kconfig	2002-12-23 21:20:32.000000000 -0800
+++ linux/fs/Kconfig	2002-12-31 18:45:59.000000000 -0800
@@ -847,7 +847,21 @@
 
 	  If unsure, say N.
 
+config DEVFS_SMALL
+	bool "Smaller /dev file system (EXPERIMENTAL)"
+	depends on EXPERIMENTAL && DEVFS_FS
+	---help---
+	  New smaller devfs without automatic partition rereading
+	  (which impeded user level partition handling) and currently
+	  without some features used by arch/ia64/sn.
+
+	  If unsure, say N.
+
+config DEVFS_BIG
+	bool
+	depends on DEVFS_FS && !DEVFS_SMALL
+
 config DEVFS_MOUNT
 	bool "Automatically mount at boot"
 	depends on DEVFS_FS
--- linux-2.5.53/fs/Makefile	2002-12-23 21:20:32.000000000 -0800
+++ linux/fs/Makefile	2002-12-31 18:45:59.000000000 -0800
@@ -65,7 +65,8 @@
 obj-$(CONFIG_VFAT_FS)		+= vfat/
 obj-$(CONFIG_BFS_FS)		+= bfs/
 obj-$(CONFIG_ISO9660_FS)	+= isofs/
-obj-$(CONFIG_DEVFS_FS)		+= devfs/
+obj-$(CONFIG_DEVFS_BIG)		+= devfs/
+obj-$(CONFIG_DEVFS_SMALL)	+= mini-devfs/
 obj-$(CONFIG_HFS_FS)		+= hfs/
 obj-$(CONFIG_VXFS_FS)		+= freevxfs/
 obj-$(CONFIG_NFS_FS)		+= nfs/
fs/mini-devfs/Makefile +9 -0
@@ -0,0 +1,9 @@
+#
+# Makefile for the linux ramfs routines.
+#
+
+export-objs := inode.o numspace.o
+
+obj-$(CONFIG_RAMFS) += ramfs.o
+
+ramfs-objs := inode.o numspace.o
fs/mini-devfs/inode.c +550 -0

550 lines not on this page · raw message

fs/mini-devfs/numspace.c +100 -0

100 lines not on this page · raw message