diff options
| author | Bruce Evans <bde@FreeBSD.org> | 1998-10-25 10:52:34 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 1998-10-25 10:52:34 +0000 |
| commit | a6cda5b68fd51a3005550227c8ff541b395afcc2 (patch) | |
| tree | 7972e551b6c56da76259c8cf98fb98a80bbf2729 /sys/kern/vfs_init.c | |
| parent | 858bb1f5b564ac6e627ad304c29f5e780de454c0 (diff) | |
Notes
Diffstat (limited to 'sys/kern/vfs_init.c')
| -rw-r--r-- | sys/kern/vfs_init.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 39900c612c64..147c4fd880a1 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.34 1998/10/05 11:10:55 obrien Exp $ + * $Id: vfs_init.c,v 1.35 1998/10/16 03:55:00 peter Exp $ */ @@ -278,7 +278,6 @@ vfs_register(vfc) int error, i, maxtypenum, exists; vfsp = NULL; - exists = 0; l = &sysctl__vfs; if (vfsconf) for (vfsp = vfsconf; vfsp->vfc_next; vfsp = vfsp->vfc_next) @@ -287,23 +286,33 @@ vfs_register(vfc) vfc->vfc_typenum = maxvfsconf++; if (vfc->vfc_vfsops->vfs_oid != NULL) { - oidpp = (struct sysctl_oid **)l->ls_items; - for (i = l->ls_length; i-- && !exists; oidpp++) - if (*oidpp == vfc->vfc_vfsops->vfs_oid) + /* + * Attach the oid to the "vfs" node of the sysctl tree if + * it isn't already there (it will be there for statically + * configured vfs's). + */ + exists = 0; + for (i = l->ls_length, + oidpp = (struct sysctl_oid **)l->ls_items; + i-- != 0; oidpp++) + if (*oidpp == vfc->vfc_vfsops->vfs_oid) { exists = 1; - } - if (exists == 0 && vfc->vfc_vfsops->vfs_oid != NULL) { - oidpp = (struct sysctl_oid **)l->ls_items; - for (i = l->ls_length; i--; oidpp++) { - if (*oidpp == NULL || - *oidpp == &sysctl___vfs_mod0 || - *oidpp == &sysctl___vfs_mod1) { - *oidpp = vfc->vfc_vfsops->vfs_oid; - (*oidpp)->oid_number = vfc->vfc_typenum; - sysctl_order_all(); break; } - } + if (exists == 0) + for (i = l->ls_length, + oidpp = (struct sysctl_oid **)l->ls_items; + i-- != 0; oidpp++) { + if (*oidpp == NULL || + *oidpp == &sysctl___vfs_mod0 || + *oidpp == &sysctl___vfs_mod1) { + *oidpp = vfc->vfc_vfsops->vfs_oid; + break; + } + } + + vfc->vfc_vfsops->vfs_oid->oid_number = vfc->vfc_typenum; + sysctl_order_all(); } if (vfsp) vfsp->vfc_next = vfc; |
