diff options
author | Garrett Wollman <wollman@FreeBSD.org> | 1994-09-21 03:47:43 +0000 |
---|---|---|
committer | Garrett Wollman <wollman@FreeBSD.org> | 1994-09-21 03:47:43 +0000 |
commit | c901836c143aeb5695c20bb3a7c28d297e5829d3 (patch) | |
tree | 1c73df5527fa425afd9acc6b6f44948163165c7b /sys/sys | |
parent | 84cc2dc3328a37262a2dcd994aab6c0f479a1dc3 (diff) | |
download | src-c901836c143aeb5695c20bb3a7c28d297e5829d3.tar.gz src-c901836c143aeb5695c20bb3a7c28d297e5829d3.zip |
Implemented loadable VFS modules, and made most existing filesystems
loadable. (NFS is a notable exception.)
Notes
Notes:
svn path=/head/; revision=2946
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/lkm.h | 10 | ||||
-rw-r--r-- | sys/sys/mount.h | 51 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 12 | ||||
-rw-r--r-- | sys/sys/vnode.h | 8 |
4 files changed, 74 insertions, 7 deletions
diff --git a/sys/sys/lkm.h b/sys/sys/lkm.h index 24702b9de35b..cd89fd050c44 100644 --- a/sys/sys/lkm.h +++ b/sys/sys/lkm.h @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: lkm.h,v 1.1 1994/08/20 02:23:40 davidg Exp $ */ #ifndef _SYS_LKM_H_ @@ -80,7 +80,8 @@ struct lkm_vfs { int lkm_ver; char *lkm_name; u_long lkm_offset; - struct vfsops *lkm_vfsops; + struct linker_set *lkm_vnodeops; + struct vfsconf *lkm_vfsconf; }; /* @@ -215,13 +216,14 @@ struct lkm_table { sysentp \ }; -#define MOD_VFS(name,vfsslot,vfsopsp) \ +#define MOD_VFS(name,vfsslot,vnodeops,vfsconf) \ static struct lkm_vfs _module = { \ LM_VFS, \ LKM_VERSION, \ name, \ vfsslot, \ - vfsopsp \ + vnodeops, \ + vfsconf \ }; #define MOD_DEV(name,devtype,devslot,devp) \ diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 1136343f1703..721ec83f2acc 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mount.h 8.13 (Berkeley) 3/27/94 - * $Id: mount.h,v 1.6 1994/09/15 20:24:26 bde Exp $ + * $Id: mount.h,v 1.7 1994/09/19 15:41:56 dfr Exp $ */ #ifndef _SYS_MOUNT_H_ @@ -135,6 +135,7 @@ struct mount { int mnt_maxsymlinklen; /* max size of short symlink */ struct statfs mnt_stat; /* cache of filesystem stats */ qaddr_t mnt_data; /* private data */ + struct vfsconf *mnt_vfc; /* configuration info */ }; /* @@ -191,9 +192,24 @@ struct mount { #define MNT_WANTRDWR 0x02000000 /* want upgrade to read/write */ /* + * used to get configured filesystems information + */ +#define VFS_MAXNAMELEN 32 +struct vfsconf { + void *vfc_vfsops; + char vfc_name[VFS_MAXNAMELEN]; + int vfc_index; + int vfc_refcount; + int vfc_flags; +}; + +/* * Operations supported on mounted file system. */ #ifdef KERNEL + +extern struct vfsconf *vfsconf[]; + #ifdef __STDC__ struct nameidata; struct mbuf; @@ -234,6 +250,39 @@ struct vfsops { #define VFS_FHTOVP(MP, FIDP, NAM, VPP, EXFLG, CRED) \ (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, NAM, VPP, EXFLG, CRED) #define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP) + +#ifdef VFS_LKM +#include <sys/conf.h> +#include <sys/exec.h> +#include <sys/sysent.h> +#include <sys/lkm.h> + +#define VFS_SET(vfsops, fsname, index, flags) \ + static struct vfsconf _fs_vfsops = { \ + &vfsops, \ + #fsname, \ + index, \ + 1, \ + flags \ + }; \ + extern struct linker_set MODVNOPS; \ + MOD_VFS(#fsname,index,&MODVNOPS,&_fs_vfsops); \ + int \ + fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \ + DISPATCH(lkmtp, cmd, ver, nosys, nosys, nosys); } +#else + +#define VFS_SET(vfsops, fsname, index, flags) \ + static struct vfsconf _fs_vfsops = { \ + &vfsops, \ + #fsname, \ + index, \ + 1, \ + flags \ + }; \ + DATA_SET(vfs_set,_fs_vfsops) +#endif /* VFS_LKM */ + #endif /* KERNEL */ /* diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 1fd75d6c5b0b..d76779e21a07 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 - * $Id: sysctl.h,v 1.9 1994/09/16 01:09:42 ache Exp $ + * $Id: sysctl.h,v 1.10 1994/09/18 20:40:00 wollman Exp $ */ #ifndef _SYS_SYSCTL_H_ @@ -163,6 +163,16 @@ struct ctlname { { "ntp_pll", CTLTYPE_NODE }, \ } +/* + * CTL_FS identifiers + */ +#define FS_VFSCONF 0 /* get configured filesystems */ +#define FS_MAXID 1 /* number of items */ + +#define CTL_FS_NAMES { \ + { "vfsconf", CTLTYPE_STRUCT }, \ +} + /* * KERN_PROC subtypes */ diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index e20b71ce692e..db3793292002 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 - * $Id: vnode.h,v 1.5 1994/09/15 20:24:29 bde Exp $ + * $Id: vnode.h,v 1.6 1994/09/19 15:41:57 dfr Exp $ */ #ifndef _SYS_VNODE_H_ @@ -211,6 +211,12 @@ void vref __P((struct vnode *)); #define NULLVP ((struct vnode *)NULL) +#ifdef VFS_LKM +#define VNODEOP_SET(f) DATA_SET(MODVNOPS,f) +#else +#define VNODEOP_SET(f) DATA_SET(vfs_opv_descs_,f) +#endif + /* * Global vnode data. */ |