diff options
author | phk <phk@FreeBSD.org> | 2004-07-30 22:08:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-07-30 22:08:52 +0000 |
commit | 2d868d02cfcc9af8da398c52add2f28fe1c493bc (patch) | |
tree | af2a6b4c3e63a13443b647b947b57d5b31690b5a /sys/kern/vfs_init.c | |
parent | 941a15ae99cc0252acd241ea5e407eb00a540858 (diff) | |
download | FreeBSD-src-2d868d02cfcc9af8da398c52add2f28fe1c493bc.zip FreeBSD-src-2d868d02cfcc9af8da398c52add2f28fe1c493bc.tar.gz |
Put a version element in the VFS filesystem configuration structure
and refuse initializing filesystems with a wrong version. This will
aid maintenance activites on the 5-stable branch.
s/vfs_mount/vfs_omount/
s/vfs_nmount/vfs_mount/
Name our filesystems mount function consistently.
Eliminate the namiedata argument to both vfs_mount and vfs_omount.
It was originally there to save stack space. A few places abused
it to get hold of some credentials to pass around. Effectively
it is unused.
Reorganize the root filesystem selection code.
Diffstat (limited to 'sys/kern/vfs_init.c')
-rw-r--r-- | sys/kern/vfs_init.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 999764a..be8f2af 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -379,6 +379,11 @@ vfs_register(struct vfsconf *vfc) struct sysctl_oid *oidp; struct vfsops *vfsops; + if (vfc->vfc_version != VFS_VERSION) { + printf("ERROR: filesystem %s, unsupported ABI version %x\n", + vfc->vfc_name, vfc->vfc_version); + return (EINVAL); + } if (vfs_byname(vfc->vfc_name) != NULL) return EEXIST; @@ -414,8 +419,8 @@ vfs_register(struct vfsconf *vfc) * Check the mount and unmount operations. */ vfsops = vfc->vfc_vfsops; - KASSERT(vfsops->vfs_mount != NULL || vfsops->vfs_nmount != NULL, - ("Filesystem %s has no (n)mount op", vfc->vfc_name)); + KASSERT(vfsops->vfs_mount != NULL || vfsops->vfs_omount != NULL, + ("Filesystem %s has no (o)mount op", vfc->vfc_name)); KASSERT(vfsops->vfs_unmount != NULL, ("Filesystem %s has no unmount op", vfc->vfc_name)); |