diff options
| author | Doug Rabson <dfr@FreeBSD.org> | 1999-03-07 16:06:41 +0000 |
|---|---|---|
| committer | Doug Rabson <dfr@FreeBSD.org> | 1999-03-07 16:06:41 +0000 |
| commit | a199ed3cc3d1d1c3860b38c9f43ba478e2512145 (patch) | |
| tree | e2e18b8ed13157423b526442e164c2ab63d833a2 /sys | |
| parent | b862eda467a796b5e3a1377ddf671cd41b871c27 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/kern_linker.c | 4 | ||||
| -rw-r--r-- | sys/kern/vfs_init.c | 23 |
2 files changed, 23 insertions, 4 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 687f66c619b3e..5b6c39544b0ac 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_linker.c,v 1.26 1999/02/16 10:49:48 dfr Exp $ + * $Id: kern_linker.c,v 1.27 1999/02/20 21:22:00 dfr Exp $ */ #include "opt_ddb.h" @@ -306,8 +306,8 @@ linker_load_file(const char* filename, linker_file_t* result) if (error != ENOENT) foundfile = 1; if (lf) { - linker_file_sysinit(lf); linker_file_register_sysctls(lf); + linker_file_sysinit(lf); *result = lf; error = 0; diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 1cbe2d43ad5c5..d88deca3a8703 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_init.c 8.3 (Berkeley) 1/4/94 - * $Id: vfs_init.c,v 1.43 1999/01/28 17:32:00 dillon Exp $ + * $Id: vfs_init.c,v 1.44 1999/02/16 10:49:49 dfr Exp $ */ @@ -331,13 +331,14 @@ int vfs_register(struct vfsconf *vfc) { struct linker_set *l; + struct sysctl_oid *oidp; struct vfsconf *vfsp; vfsp = NULL; l = &sysctl__vfs; if (vfsconf) for (vfsp = vfsconf; vfsp->vfc_next; vfsp = vfsp->vfc_next) - if (!strcmp(vfc->vfc_name, vfsp->vfc_name)) + if (strcmp(vfc->vfc_name, vfsp->vfc_name) == 0) return EEXIST; vfc->vfc_typenum = maxvfsconf++; @@ -348,6 +349,24 @@ vfs_register(struct vfsconf *vfc) vfc->vfc_next = NULL; /* + * If this filesystem has a sysctl node under vfs + * (i.e. vfs.xxfs), then change the oid number of that node to + * match the filesystem's type number. This allows user code + * which uses the type number to read sysctl variables defined + * by the filesystem to continue working. Since the oids are + * in a sorted list, we need to make sure the order is + * preserved by re-registering the oid after modifying its + * number. + */ + for (oidp = SLIST_FIRST(&sysctl__vfs_children); oidp; + oidp = SLIST_NEXT(oidp, oid_link)) + if (strcmp(oidp->oid_name, vfc->vfc_name) == 0) { + sysctl_unregister_oid(oidp); + oidp->oid_number = vfc->vfc_typenum; + sysctl_register_oid(oidp); + } + + /* * Call init function for this VFS... */ (*(vfc->vfc_vfsops->vfs_init))(vfc); |
