From deddb7cba8ef29f7a1366a064df9ae50ec14f01d Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Sun, 27 Apr 2003 03:47:05 -0700 Subject: [PATCH] simple_fill_super() New libfs.c helper - simple_fill_super(). Abstracted from nfsd/nfsctl.c, couple of filesystems converted to it (nfsctl, binfmt_misc). Function takes an array of triples (name, file_operations, mode), superblock and value for its ->s_magic. It acts as fill_super() - populates superblock or fails. We get a ramfs-style flat tree - root directory and a bunch of files in it. That animal allows to put together a simple filesystem without touching any directory-related stuff - now it's as easy as implementing file_operations for files you want to have and telling what to call them. --- include/linux/fs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/fs.h b/include/linux/fs.h index ce89b15c54a1..00ddb3866b15 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1292,6 +1292,8 @@ extern struct dentry *simple_lookup(struct inode *, struct dentry *); extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *); extern struct file_operations simple_dir_operations; extern struct inode_operations simple_dir_inode_operations; +struct tree_descr { char *name; struct file_operations *ops; int mode; }; +extern int simple_fill_super(struct super_block *, int, struct tree_descr *); #ifdef CONFIG_BLK_DEV_INITRD extern unsigned int real_root_dev; -- cgit v1.2.3