Subject: rehashing after "sysctl -w kern.maxvnodes=..."
To: None <tech-kern@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 09/12/2001 23:14:41
--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
hi folks,
attached are diffs which implement resizing of all the various
hash tables whose sizes are calculated from "desiredvnodes" when
that variable is changed via sysctl. there's a new VFS op, vfs_reinit,
which is called after desiredvnodes is updated. each filesystem
does the appropriate thing, usually resizing a hash table, but
for FFS this also includes increasing the number of softdeps.
comments?
-Chuck
--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.vfs_reinit"
Index: adosfs/advfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/adosfs/advfsops.c,v
retrieving revision 1.46
diff -u -r1.46 advfsops.c
--- adosfs/advfsops.c 2001/05/30 11:40:35 1.46
+++ adosfs/advfsops.c 2001/09/13 06:04:25
@@ -53,6 +53,7 @@
#include <adosfs/adosfs.h>
void adosfs_init __P((void));
+void adosfs_reinit __P((void));
void adosfs_done __P((void));
int adosfs_mount __P((struct mount *, const char *, void *, struct nameidata *,
struct proc *));
@@ -848,6 +849,7 @@
adosfs_fhtovp,
adosfs_vptofh,
adosfs_init,
+ NULL,
adosfs_done,
adosfs_sysctl,
NULL, /* vfs_mountroot */
Index: coda/coda_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/coda/coda_vfsops.c,v
retrieving revision 1.12
diff -u -r1.12 coda_vfsops.c
--- coda/coda_vfsops.c 2001/07/18 16:12:31 1.12
+++ coda/coda_vfsops.c 2001/09/13 06:04:26
@@ -109,9 +109,8 @@
eopnotsupp,
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
coda_init,
-#ifdef __NetBSD__
+ NULL,
coda_done,
-#endif
coda_sysctl,
(int (*)(void)) eopnotsupp,
(int (*)(struct mount *, struct mbuf *, int *, struct ucred **))
@@ -538,13 +537,11 @@
ENTRY;
}
-#ifdef __NetBSD__
void
coda_done(void)
{
ENTRY;
}
-#endif
int
coda_sysctl(name, namelen, oldp, oldlp, newp, newl, p)
Index: filecorefs/filecore_extern.h
===================================================================
RCS file: /cvsroot/syssrc/sys/filecorefs/filecore_extern.h,v
retrieving revision 1.6
diff -u -r1.6 filecore_extern.h
--- filecorefs/filecore_extern.h 2000/03/16 18:08:22 1.6
+++ filecorefs/filecore_extern.h 2001/09/13 06:04:27
@@ -86,6 +86,7 @@
struct ucred **));
int filecore_vptofh __P((struct vnode *, struct fid *));
void filecore_init __P((void));
+void filecore_reinit __P((void));
void filecore_done __P((void));
int filecore_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
struct proc *));
Index: filecorefs/filecore_node.c
===================================================================
RCS file: /cvsroot/syssrc/sys/filecorefs/filecore_node.c,v
retrieving revision 1.7
diff -u -r1.7 filecore_node.c
--- filecorefs/filecore_node.c 2001/02/07 12:34:59 1.7
+++ filecorefs/filecore_node.c 2001/09/13 06:04:27
@@ -58,7 +58,7 @@
/*
* Structures associated with filecore_node caching.
*/
-struct filecore_node **filecorehashtbl;
+LIST_HEAD(ihashhead, filecore_node) *filecorehashtbl;
u_long filecorehash;
#define INOHASH(device, inum) (((device) + ((inum)>>12)) & filecorehash)
struct simplelock filecore_ihash_slock;
@@ -82,6 +82,36 @@
}
/*
+ * Reinitialize inode hash table.
+ */
+void
+filecore_reinit()
+{
+ struct filecore_node *ip;
+ struct ihashhead *oldhash, *hash;
+ u_long oldmask, mask, val;
+ int i;
+
+ hash = hashinit(desiredvnodes, HASH_LIST, M_FILECOREMNT, M_WAITOK,
+ &mask);
+
+ simple_lock(&filecore_ihash_slock);
+ oldhash = filecorehashtbl;
+ oldmask = filecorehash;
+ filecorehashtbl = hash;
+ filecorehash = mask;
+ for (i = 0; i <= oldmask; i++) {
+ while ((ip = LIST_FIRST(&oldhash[i])) != NULL) {
+ LIST_REMOVE(ip, i_hash);
+ val = INOHASH(ip->i_dev, ip->i_number);
+ LIST_INSERT_HEAD(&hash[val], ip, i_hash);
+ }
+ }
+ simple_unlock(&filecore_ihash_slock);
+ hashdone(oldhash, M_FILECOREMNT);
+}
+
+/*
* Destroy node pool and hash table.
*/
void
@@ -105,7 +135,7 @@
loop:
simple_lock(&filecore_ihash_slock);
- for (ip = filecorehashtbl[INOHASH(dev, inum)]; ip; ip = ip->i_next) {
+ LIST_FOREACH(ip, &filecorehashtbl[INOHASH(dev, inum)], i_hash) {
if (inum == ip->i_number && dev == ip->i_dev) {
vp = ITOV(ip);
simple_lock(&vp->v_interlock);
@@ -126,16 +156,12 @@
filecore_ihashins(ip)
struct filecore_node *ip;
{
- struct filecore_node **ipp, *iq;
+ struct ihashhead *ipp;
struct vnode *vp;
simple_lock(&filecore_ihash_slock);
ipp = &filecorehashtbl[INOHASH(ip->i_dev, ip->i_number)];
- if ((iq = *ipp) != NULL)
- iq->i_prev = &ip->i_next;
- ip->i_next = iq;
- ip->i_prev = ipp;
- *ipp = ip;
+ LIST_INSERT_HEAD(ipp, ip, i_hash);
simple_unlock(&filecore_ihash_slock);
vp = ip->i_vnode;
@@ -149,16 +175,8 @@
filecore_ihashrem(ip)
struct filecore_node *ip;
{
- struct filecore_node *iq;
-
simple_lock(&filecore_ihash_slock);
- if ((iq = ip->i_next) != NULL)
- iq->i_prev = ip->i_prev;
- *ip->i_prev = iq;
-#ifdef DIAGNOSTIC
- ip->i_next = NULL;
- ip->i_prev = NULL;
-#endif
+ LIST_REMOVE(ip, i_hash);
simple_unlock(&filecore_ihash_slock);
}
Index: filecorefs/filecore_node.h
===================================================================
RCS file: /cvsroot/syssrc/sys/filecorefs/filecore_node.h,v
retrieving revision 1.4
diff -u -r1.4 filecore_node.h
--- filecorefs/filecore_node.h 2001/05/28 02:50:51 1.4
+++ filecorefs/filecore_node.h 2001/09/13 06:04:28
@@ -46,7 +46,7 @@
#define doff_t long
struct filecore_node {
- struct filecore_node *i_next, **i_prev; /* hash chain */
+ LIST_ENTRY(filecore_node) i_hash;
struct vnode *i_vnode; /* vnode associated with this inode */
struct vnode *i_devvp; /* vnode for block I/O */
u_long i_flag; /* see below */
Index: filecorefs/filecore_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/filecorefs/filecore_vfsops.c,v
retrieving revision 1.14
diff -u -r1.14 filecore_vfsops.c
--- filecorefs/filecore_vfsops.c 2001/05/30 11:42:13 1.14
+++ filecorefs/filecore_vfsops.c 2001/09/13 06:04:29
@@ -79,6 +79,7 @@
filecore_fhtovp,
filecore_vptofh,
filecore_init,
+ filecore_reinit,
filecore_done,
filecore_sysctl,
NULL, /* filecore_mountroot */
Index: isofs/cd9660/cd9660_extern.h
===================================================================
RCS file: /cvsroot/syssrc/sys/isofs/cd9660/cd9660_extern.h,v
retrieving revision 1.9
diff -u -r1.9 cd9660_extern.h
--- isofs/cd9660/cd9660_extern.h 2000/05/27 16:03:55 1.9
+++ isofs/cd9660/cd9660_extern.h 2001/09/13 06:04:29
@@ -98,6 +98,7 @@
struct ucred **));
int cd9660_vptofh __P((struct vnode *, struct fid *));
void cd9660_init __P((void));
+void cd9660_reinit __P((void));
void cd9660_done __P((void));
int cd9660_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
struct proc *));
Index: isofs/cd9660/cd9660_node.c
===================================================================
RCS file: /cvsroot/syssrc/sys/isofs/cd9660/cd9660_node.c,v
retrieving revision 1.25
diff -u -r1.25 cd9660_node.c
--- isofs/cd9660/cd9660_node.c 2001/02/03 12:48:43 1.25
+++ isofs/cd9660/cd9660_node.c 2001/09/13 06:04:30
@@ -62,13 +62,13 @@
/*
* Structures associated with iso_node caching.
*/
-struct iso_node **isohashtbl;
+LIST_HEAD(ihashhead, iso_node) *isohashtbl;
u_long isohash;
#define INOHASH(device, inum) (((device) + ((inum)>>12)) & isohash)
struct simplelock cd9660_ihash_slock;
#ifdef ISODEVMAP
-struct iso_node **idvhashtbl;
+LIST_HEAD(idvhashhead, iso_dnode) *idvhashtbl;
u_long idvhash;
#define DNOHASH(device, inum) (((device) + ((inum)>>12)) & idvhash)
#endif
@@ -98,6 +98,62 @@
}
/*
+ * Reinitialize inode hash table.
+ */
+
+void
+cd9660_reinit()
+{
+ struct iso_node *ip;
+ struct ihashhead *oldhash1, *hash1;
+ u_long oldmask1, mask1, val;
+#ifdef ISODEVMAP
+ struct iso_dnode *dp;
+ struct idvhashhead *oldhash2, *hash2;
+ u_long oldmask2, mask2;
+#endif
+ int i;
+
+ hash1 = hashinit(desiredvnodes, HASH_LIST, M_ISOFSMNT, M_WAITOK,
+ &mask1);
+#ifdef ISODEVMAP
+ hash2 = hashinit(desiredvnodes / 8, HASH_LIST, M_ISOFSMNT, M_WAITOK,
+ &mask2);
+#endif
+
+ simple_lock(&cd9660_ihash_slock);
+ oldhash1 = isohashtbl;
+ oldmask1 = isohash;
+ isohashtbl = hash1;
+ isohash = mask1;
+#ifdef ISODEVMAP
+ oldhash2 = idvhashtbl;
+ oldmask2 = idvhash;
+ idvhashtbl = hash2;
+ idvhash = mask2;
+ for (i = 0; i <= oldmask2; i++) {
+ while ((dp = LIST_FIRST(&oldhash2[i])) != NULL) {
+ LIST_REMOVE(dp, d_hash);
+ val = DNOHASH(dp->i_dev, dp->i_number);
+ LIST_INSERT_HEAD(&hash2[val], dp, d_hash);
+ }
+ }
+#endif
+ for (i = 0; i <= oldmask1; i++) {
+ while ((ip = LIST_FIRST(&oldhash1[i])) != NULL) {
+ LIST_REMOVE(ip, i_hash);
+ val = INOHASH(ip->i_dev, ip->i_number);
+ LIST_INSERT_HEAD(&hash1[val], ip, i_hash);
+ }
+ }
+ simple_unlock(&cd9660_ihash_slock);
+ hashdone(oldhash1, M_ISOFSMNT);
+#ifdef ISODEVMAP
+ hashdone(oldhash2, M_ISOFSMNT);
+#endif
+}
+
+/*
* Destroy node pool and hash table.
*/
void
@@ -120,29 +176,23 @@
ino_t inum;
int create;
{
- struct iso_dnode **dpp, *dp, *dq;
+ struct iso_dnode *dp;
+ struct idvhashhead *hp;
- dpp = &idvhashtbl[DNOHASH(device, inum)];
- for (dp = *dpp;; dp = dp->d_next) {
- if (dp == NULL)
- return (NULL);
+ hp = &idvhashtbl[DNOHASH(device, inum)];
+ LIST_FOREACH(dp, hp, d_hash) {
if (inum == dp->i_number && device == dp->i_dev)
return (dp);
+ }
if (!create)
return (NULL);
MALLOC(dp, struct iso_dnode *, sizeof(struct iso_dnode), M_CACHE,
M_WAITOK);
- dp->i_dev = dev;
- dp->i_number = ino;
-
- if (dq = *dpp)
- dq->d_prev = dp->d_next;
- dp->d_next = dq;
- dp->d_prev = dpp;
- *dpp = dp;
-
+ dp->i_dev = device;
+ dp->i_number = inum;
+ LIST_INSERT_HEAD(hp, dp, d_hash);
return (dp);
}
@@ -150,15 +200,14 @@
iso_dunmap(device)
dev_t device;
{
- struct iso_dnode **dpp, *dp, *dq;
+ struct idvhashhead *dpp;
+ struct iso_dnode *dp, *dq;
for (dpp = idvhashtbl; dpp <= idvhashtbl + idvhash; dpp++) {
- for (dp = *dpp; dp != NULL; dp = dq)
- dq = dp->d_next;
+ for (dp = LIST_FIRST(dpp); dp != NULL; dp = dp) {
+ dq = LIST_NEXT(dp, d_hash);
if (device == dp->i_dev) {
- if (dq)
- dq->d_prev = dp->d_prev;
- *dp->d_prev = dq;
+ LIST_REMOVE(dp, d_hash);
FREE(dp, M_CACHE);
}
}
@@ -180,7 +229,7 @@
loop:
simple_lock(&cd9660_ihash_slock);
- for (ip = isohashtbl[INOHASH(dev, inum)]; ip; ip = ip->i_next) {
+ LIST_FOREACH(ip, &isohashtbl[INOHASH(dev, inum)], i_hash) {
if (inum == ip->i_number && dev == ip->i_dev) {
vp = ITOV(ip);
simple_lock(&vp->v_interlock);
@@ -203,15 +252,11 @@
cd9660_ihashins(ip)
struct iso_node *ip;
{
- struct iso_node **ipp, *iq;
+ struct ihashhead *ipp;
simple_lock(&cd9660_ihash_slock);
ipp = &isohashtbl[INOHASH(ip->i_dev, ip->i_number)];
- if ((iq = *ipp) != NULL)
- iq->i_prev = &ip->i_next;
- ip->i_next = iq;
- ip->i_prev = ipp;
- *ipp = ip;
+ LIST_INSERT_HEAD(ipp, ip, i_hash);
simple_unlock(&cd9660_ihash_slock);
lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, &ip->i_vnode->v_interlock);
@@ -224,16 +269,8 @@
cd9660_ihashrem(ip)
struct iso_node *ip;
{
- struct iso_node *iq;
-
simple_lock(&cd9660_ihash_slock);
- if ((iq = ip->i_next) != NULL)
- iq->i_prev = ip->i_prev;
- *ip->i_prev = iq;
-#ifdef DIAGNOSTIC
- ip->i_next = NULL;
- ip->i_prev = NULL;
-#endif
+ LIST_REMOVE(ip, i_hash);
simple_unlock(&cd9660_ihash_slock);
}
Index: isofs/cd9660/cd9660_node.h
===================================================================
RCS file: /cvsroot/syssrc/sys/isofs/cd9660/cd9660_node.h,v
retrieving revision 1.20
diff -u -r1.20 cd9660_node.h
--- isofs/cd9660/cd9660_node.h 2001/05/28 02:50:52 1.20
+++ isofs/cd9660/cd9660_node.h 2001/09/13 06:04:30
@@ -65,7 +65,7 @@
* FOr device# (major,minor) translation table
*/
struct iso_dnode {
- struct iso_dnode *d_next, **d_prev; /* hash chain */
+ LIST_ENTRY(iso_dnode) d_hash;
dev_t i_dev; /* device where dnode resides */
ino_t i_number; /* the identity of the inode */
dev_t d_dev; /* device # for translation */
@@ -73,7 +73,7 @@
#endif
struct iso_node {
- struct iso_node *i_next, **i_prev; /* hash chain */
+ LIST_ENTRY(iso_node) i_hash;
struct vnode *i_vnode; /* vnode associated with this inode */
struct vnode *i_devvp; /* vnode for block I/O */
u_long i_flag; /* see below */
Index: isofs/cd9660/cd9660_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/isofs/cd9660/cd9660_vfsops.c,v
retrieving revision 1.56
diff -u -r1.56 cd9660_vfsops.c
--- isofs/cd9660/cd9660_vfsops.c 2001/07/07 14:53:55 1.56
+++ isofs/cd9660/cd9660_vfsops.c 2001/09/13 06:04:32
@@ -93,6 +93,7 @@
cd9660_fhtovp,
cd9660_vptofh,
cd9660_init,
+ cd9660_reinit,
cd9660_done,
cd9660_sysctl,
cd9660_mountroot,
@@ -742,6 +743,9 @@
{
struct iso_mnt *imp;
struct iso_node *ip;
+#ifdef ISODEVMAP
+ struct iso_dnode *dp;
+#endif
struct buf *bp;
struct vnode *vp, *nvp;
dev_t dev;
@@ -891,7 +895,7 @@
* if device, look at device number table for translation
*/
#ifdef ISODEVMAP
- if (dp = iso_dmap(dev, ino, 0))
+ if ((dp = iso_dmap(dev, ino, 0)) != NULL)
ip->inode.iso_rdev = dp->d_dev;
#endif
vp->v_op = cd9660_specop_p;
Index: kern/kern_sysctl.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/kern_sysctl.c,v
retrieving revision 1.93
diff -u -r1.93 kern_sysctl.c
--- kern/kern_sysctl.c 2001/07/27 21:19:09 1.93
+++ kern/kern_sysctl.c 2001/09/13 06:04:38
@@ -352,6 +352,9 @@
desiredvnodes = old_vnodes;
return (EINVAL);
}
+ if (error == 0) {
+ vfs_reinit();
+ }
return (error);
case KERN_MAXPROC:
return (sysctl_int(oldp, oldlenp, newp, newlen, &maxproc));
Index: kern/vfs_subr.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/vfs_subr.c,v
retrieving revision 1.156
diff -u -r1.156 vfs_subr.c
--- kern/vfs_subr.c 2001/08/03 06:00:13 1.156
+++ kern/vfs_subr.c 2001/09/13 06:04:43
@@ -2631,7 +2631,7 @@
/*
* Make sure this file system doesn't already exist.
*/
- for (v = LIST_FIRST(&vfs_list); v != NULL; v = LIST_NEXT(v, vfs_list)) {
+ LIST_FOREACH(v, &vfs_list, vfs_list) {
if (strcmp(vfs->vfs_name, v->vfs_name) == 0) {
error = EEXIST;
goto out;
@@ -2680,7 +2680,7 @@
/*
* ...and remove it from the kernel's list.
*/
- for (v = LIST_FIRST(&vfs_list); v != NULL; v = LIST_NEXT(v, vfs_list)) {
+ LIST_FOREACH(v, &vfs_list, vfs_list) {
if (v == vfs) {
LIST_REMOVE(v, vfs_list);
break;
@@ -2700,6 +2700,18 @@
*/
vfs_opv_free(vfs->vfs_opv_descs);
return (0);
+}
+
+void
+vfs_reinit(void)
+{
+ struct vfsops *vfs;
+
+ LIST_FOREACH(vfs, &vfs_list, vfs_list) {
+ if (vfs->vfs_reinit) {
+ (*vfs->vfs_reinit)();
+ }
+ }
}
#ifdef DDB
Index: miscfs/fdesc/fdesc_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/fdesc/fdesc_vfsops.c,v
retrieving revision 1.33
diff -u -r1.33 fdesc_vfsops.c
--- miscfs/fdesc/fdesc_vfsops.c 2001/05/30 11:57:16 1.33
+++ miscfs/fdesc/fdesc_vfsops.c 2001/09/13 06:04:43
@@ -344,6 +344,7 @@
fdesc_fhtovp,
fdesc_vptofh,
fdesc_init,
+ NULL,
fdesc_done,
fdesc_sysctl,
NULL, /* vfs_mountroot */
Index: miscfs/kernfs/kernfs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/kernfs/kernfs_vfsops.c,v
retrieving revision 1.40
diff -u -r1.40 kernfs_vfsops.c
--- miscfs/kernfs/kernfs_vfsops.c 2001/05/30 11:57:17 1.40
+++ miscfs/kernfs/kernfs_vfsops.c 2001/09/13 06:04:44
@@ -386,6 +386,7 @@
kernfs_fhtovp,
kernfs_vptofh,
kernfs_init,
+ NULL,
kernfs_done,
kernfs_sysctl,
NULL, /* vfs_mountroot */
Index: miscfs/nullfs/null_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/nullfs/null_vfsops.c,v
retrieving revision 1.31
diff -u -r1.31 null_vfsops.c
--- miscfs/nullfs/null_vfsops.c 2001/08/02 22:40:58 1.31
+++ miscfs/nullfs/null_vfsops.c 2001/09/13 06:04:44
@@ -286,6 +286,7 @@
layerfs_fhtovp,
layerfs_vptofh,
layerfs_init,
+ NULL,
layerfs_done,
layerfs_sysctl,
NULL, /* vfs_mountroot */
Index: miscfs/overlay/overlay_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/overlay/overlay_vfsops.c,v
retrieving revision 1.7
diff -u -r1.7 overlay_vfsops.c
--- miscfs/overlay/overlay_vfsops.c 2001/06/07 13:44:48 1.7
+++ miscfs/overlay/overlay_vfsops.c 2001/09/13 06:04:45
@@ -280,6 +280,7 @@
layerfs_fhtovp,
layerfs_vptofh,
layerfs_init,
+ NULL,
layerfs_done,
layerfs_sysctl,
NULL, /* vfs_mountroot */
Index: miscfs/portal/portal_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/portal/portal_vfsops.c,v
retrieving revision 1.26
diff -u -r1.26 portal_vfsops.c
--- miscfs/portal/portal_vfsops.c 2001/05/30 11:57:17 1.26
+++ miscfs/portal/portal_vfsops.c 2001/09/13 06:04:46
@@ -367,6 +367,7 @@
portal_fhtovp,
portal_vptofh,
portal_init,
+ NULL,
portal_done,
portal_sysctl,
NULL, /* vfs_mountroot */
Index: miscfs/procfs/procfs.h
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/procfs/procfs.h,v
retrieving revision 1.34
diff -u -r1.34 procfs.h
--- miscfs/procfs/procfs.h 2001/03/29 22:41:52 1.34
+++ miscfs/procfs/procfs.h 2001/09/13 06:04:46
@@ -151,6 +151,7 @@
int procfs_checkioperm __P((struct proc *, struct proc *));
void procfs_revoke_vnodes __P((struct proc *, void *));
void procfs_hashinit __P((void));
+void procfs_hashreinit __P((void));
void procfs_hashdone __P((void));
/* functions to check whether or not files should be displayed */
Index: miscfs/procfs/procfs_subr.c
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/procfs/procfs_subr.c,v
retrieving revision 1.37
diff -u -r1.37 procfs_subr.c
--- miscfs/procfs/procfs_subr.c 2001/03/29 22:41:52 1.37
+++ miscfs/procfs/procfs_subr.c 2001/09/13 06:04:47
@@ -57,7 +57,7 @@
LIST_HEAD(pfs_hashhead, pfsnode) *pfs_hashtbl;
u_long pfs_ihash; /* size of hash table - 1 */
-#define PFSPIDHASH(pid) (&pfs_hashtbl[(pid) & pfs_ihash])
+#define PFSPIDHASH(pid) ((pid) & pfs_ihash)
struct lock pfs_hashlock;
struct simplelock pfs_hash_slock;
@@ -333,6 +333,33 @@
simple_lock_init(&pfs_hash_slock);
}
+void
+procfs_hashreinit()
+{
+ struct pfsnode *pp;
+ struct pfs_hashhead *oldhash, *hash;
+ u_long oldmask, mask, val;
+ int i;
+
+ hash = hashinit(desiredvnodes / 4, HASH_LIST, M_UFSMNT, M_WAITOK,
+ &mask);
+
+ simple_lock(&pfs_hash_slock);
+ oldhash = pfs_hashtbl;
+ oldmask = pfs_ihash;
+ pfs_hashtbl = hash;
+ pfs_ihash = mask;
+ for (i = 0; i <= oldmask; i++) {
+ while ((pp = LIST_FIRST(&oldhash[i])) != NULL) {
+ LIST_REMOVE(pp, pfs_hash);
+ val = PFSPIDHASH(pp->pfs_pid);
+ LIST_INSERT_HEAD(&hash[val], pp, pfs_hash);
+ }
+ }
+ simple_unlock(&pfs_hash_slock);
+ hashdone(oldhash, M_UFSMNT);
+}
+
/*
* Free pfsnode hash table.
*/
@@ -348,12 +375,14 @@
pfstype type;
struct mount *mp;
{
+ struct pfs_hashhead *ppp;
struct pfsnode *pp;
struct vnode *vp;
loop:
simple_lock(&pfs_hash_slock);
- for (pp = PFSPIDHASH(pid)->lh_first; pp; pp = pp->pfs_hash.le_next) {
+ ppp = &pfs_hashtbl[PFSPIDHASH(pid)];
+ LIST_FOREACH(pp, ppp, pfs_hash) {
vp = PFSTOV(pp);
if (pid == pp->pfs_pid && pp->pfs_type == type &&
vp->v_mount == mp) {
@@ -381,7 +410,7 @@
lockmgr(&pp->pfs_vnode->v_lock, LK_EXCLUSIVE, (struct simplelock *)0);
simple_lock(&pfs_hash_slock);
- ppp = PFSPIDHASH(pp->pfs_pid);
+ ppp = &pfs_hashtbl[PFSPIDHASH(pp->pfs_pid)];
LIST_INSERT_HEAD(ppp, pp, pfs_hash);
simple_unlock(&pfs_hash_slock);
}
@@ -406,13 +435,15 @@
struct pfsnode *pfs, *pnext;
struct vnode *vp;
struct mount *mp = (struct mount *)arg;
+ struct pfs_hashhead *ppp;
if (!(p->p_flag & P_SUGID))
return;
- for (pfs = PFSPIDHASH(p->p_pid)->lh_first; pfs; pfs = pnext) {
+ ppp = &pfs_hashtbl[PFSPIDHASH(p->p_pid)];
+ for (pfs = LIST_FIRST(ppp); pfs; pfs = pnext) {
vp = PFSTOV(pfs);
- pnext = pfs->pfs_hash.le_next;
+ pnext = LIST_NEXT(pfs, pfs_hash);
if (vp->v_usecount > 0 && pfs->pfs_pid == p->p_pid &&
vp->v_mount == mp)
VOP_REVOKE(vp, REVOKEALL);
Index: miscfs/procfs/procfs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/procfs/procfs_vfsops.c,v
retrieving revision 1.39
diff -u -r1.39 procfs_vfsops.c
--- miscfs/procfs/procfs_vfsops.c 2001/05/30 11:57:17 1.39
+++ miscfs/procfs/procfs_vfsops.c 2001/09/13 06:04:47
@@ -64,6 +64,7 @@
#include <uvm/uvm_extern.h> /* for PAGE_SIZE */
void procfs_init __P((void));
+void procfs_reinit __P((void));
void procfs_done __P((void));
int procfs_mount __P((struct mount *, const char *, void *,
struct nameidata *, struct proc *));
@@ -288,6 +289,12 @@
}
void
+procfs_reinit()
+{
+ procfs_hashreinit();
+}
+
+void
procfs_done()
{
procfs_hashdone();
@@ -326,6 +333,7 @@
procfs_fhtovp,
procfs_vptofh,
procfs_init,
+ procfs_reinit,
procfs_done,
procfs_sysctl,
NULL, /* vfs_mountroot */
Index: miscfs/umapfs/umap_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/umapfs/umap_vfsops.c,v
retrieving revision 1.30
diff -u -r1.30 umap_vfsops.c
--- miscfs/umapfs/umap_vfsops.c 2001/08/16 15:37:06 1.30
+++ miscfs/umapfs/umap_vfsops.c 2001/09/13 06:04:48
@@ -305,6 +305,7 @@
layerfs_fhtovp,
layerfs_vptofh,
layerfs_init,
+ NULL,
layerfs_done,
layerfs_sysctl,
NULL, /* vfs_mountroot */
Index: miscfs/union/union_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/miscfs/union/union_vfsops.c,v
retrieving revision 1.27
diff -u -r1.27 union_vfsops.c
--- miscfs/union/union_vfsops.c 2001/08/02 22:40:59 1.27
+++ miscfs/union/union_vfsops.c 2001/09/13 06:04:49
@@ -578,6 +578,7 @@
union_fhtovp,
union_vptofh,
union_init,
+ NULL,
union_done,
union_sysctl,
NULL, /* vfs_mountroot */
Index: msdosfs/denode.h
===================================================================
RCS file: /cvsroot/syssrc/sys/msdosfs/denode.h,v
retrieving revision 1.32
diff -u -r1.32 denode.h
--- msdosfs/denode.h 2001/05/28 02:50:52 1.32
+++ msdosfs/denode.h 2001/09/13 06:04:50
@@ -134,8 +134,7 @@
* contained within a vnode.
*/
struct denode {
- struct denode *de_next; /* Hash chain forward */
- struct denode **de_prev; /* Hash chain back */
+ LIST_ENTRY(denode) de_hash;
struct vnode *de_vnode; /* addr of vnode we are part of */
struct vnode *de_devvp; /* vnode of blk dev we live on */
u_long de_flag; /* flag bits */
Index: msdosfs/msdosfs_denode.c
===================================================================
RCS file: /cvsroot/syssrc/sys/msdosfs/msdosfs_denode.c,v
retrieving revision 1.50
diff -u -r1.50 msdosfs_denode.c
--- msdosfs/msdosfs_denode.c 2001/02/18 20:17:04 1.50
+++ msdosfs/msdosfs_denode.c 2001/09/13 06:04:51
@@ -67,10 +67,10 @@
#include <msdosfs/denode.h>
#include <msdosfs/fat.h>
-struct denode **dehashtbl;
+LIST_HEAD(ihashhead, denode) *dehashtbl;
u_long dehash; /* size of hash table - 1 */
-#define DEHASH(dev, dcl, doff) (((dev) + (dcl) + (doff) / sizeof(struct direntry)) \
- & dehash)
+#define DEHASH(dev, dcl, doff) \
+ (((dev) + (dcl) + (doff) / sizeof(struct direntry)) & dehash)
struct simplelock msdosfs_ihash_slock;
@@ -93,7 +93,39 @@
M_MSDOSFSNODE);
}
+/*
+ * Reinitialize inode hash table.
+ */
+
void
+msdosfs_reinit()
+{
+ struct denode *dep;
+ struct ihashhead *oldhash, *hash;
+ u_long oldmask, mask, val;
+ int i;
+
+ hash = hashinit(desiredvnodes/2, HASH_LIST, M_MSDOSFSMNT, M_WAITOK,
+ &mask);
+
+ simple_lock(&msdosfs_ihash_slock);
+ oldhash = dehashtbl;
+ oldmask = dehash;
+ dehashtbl = hash;
+ dehash = mask;
+ for (i = 0; i <= oldmask; i++) {
+ while ((dep = LIST_FIRST(&oldhash[i])) != NULL) {
+ LIST_REMOVE(dep, de_hash);
+ val = DEHASH(dep->de_dev, dep->de_dirclust,
+ dep->de_diroffset);
+ LIST_INSERT_HEAD(&hash[val], dep, de_hash);
+ }
+ }
+ simple_unlock(&msdosfs_ihash_slock);
+ hashdone(oldhash, M_MSDOSFSMNT);
+}
+
+void
msdosfs_done()
{
hashdone(dehashtbl, M_MSDOSFSMNT);
@@ -111,8 +143,7 @@
loop:
simple_lock(&msdosfs_ihash_slock);
- for (dep = dehashtbl[DEHASH(dev, dirclust, diroff)]; dep;
- dep = dep->de_next) {
+ LIST_FOREACH(dep, &dehashtbl[DEHASH(dev, dirclust, diroff)], de_hash) {
if (dirclust == dep->de_dirclust &&
diroff == dep->de_diroffset &&
dev == dep->de_dev &&
@@ -133,16 +164,13 @@
msdosfs_hashins(dep)
struct denode *dep;
{
- struct denode **depp, *deq;
+ struct ihashhead *depp;
+ int val;
- /* XXX use queue macros here */
simple_lock(&msdosfs_ihash_slock);
- depp = &dehashtbl[DEHASH(dep->de_dev, dep->de_dirclust, dep->de_diroffset)];
- if ((deq = *depp) != NULL)
- deq->de_prev = &dep->de_next;
- dep->de_next = deq;
- dep->de_prev = depp;
- *depp = dep;
+ val = DEHASH(dep->de_dev, dep->de_dirclust, dep->de_diroffset);
+ depp = &dehashtbl[val];
+ LIST_INSERT_HEAD(depp, dep, de_hash);
simple_unlock(&msdosfs_ihash_slock);
}
@@ -150,17 +178,8 @@
msdosfs_hashrem(dep)
struct denode *dep;
{
- struct denode *deq;
-
- /* XXX use queue macros here */
simple_lock(&msdosfs_ihash_slock);
- if ((deq = dep->de_next) != NULL)
- deq->de_prev = dep->de_prev;
- *dep->de_prev = deq;
-#ifdef DIAGNOSTIC
- dep->de_next = NULL;
- dep->de_prev = NULL;
-#endif
+ LIST_REMOVE(dep, de_hash);
simple_unlock(&msdosfs_ihash_slock);
}
Index: msdosfs/msdosfs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/msdosfs/msdosfs_vfsops.c,v
retrieving revision 1.74
diff -u -r1.74 msdosfs_vfsops.c
--- msdosfs/msdosfs_vfsops.c 2001/05/30 11:42:13 1.74
+++ msdosfs/msdosfs_vfsops.c 2001/09/13 06:04:53
@@ -120,6 +120,7 @@
msdosfs_fhtovp,
msdosfs_vptofh,
msdosfs_init,
+ msdosfs_reinit,
msdosfs_done,
msdosfs_sysctl,
msdosfs_mountroot,
Index: msdosfs/msdosfsmount.h
===================================================================
RCS file: /cvsroot/syssrc/sys/msdosfs/msdosfsmount.h,v
retrieving revision 1.21
diff -u -r1.21 msdosfsmount.h
--- msdosfs/msdosfsmount.h 2000/03/30 02:29:46 1.21
+++ msdosfs/msdosfsmount.h 2001/09/13 06:04:53
@@ -208,6 +208,7 @@
* Prototypes for MSDOSFS virtual filesystem operations
*/
void msdosfs_init __P((void));
+void msdosfs_reinit __P((void));
void msdosfs_done __P((void));
#endif /* _KERNEL */
Index: nfs/nfs.h
===================================================================
RCS file: /cvsroot/syssrc/sys/nfs/nfs.h,v
retrieving revision 1.30
diff -u -r1.30 nfs.h
--- nfs/nfs.h 2001/08/03 06:00:14 1.30
+++ nfs/nfs.h 2001/09/13 06:04:54
@@ -347,8 +347,7 @@
#endif
#define NMUIDHASH(nmp, uid) \
(&(nmp)->nm_uidhashtbl[(uid) % NFS_MUIDHASHSIZ])
-#define NFSNOHASH(fhsum) \
- (&nfsnodehashtbl[(fhsum) & nfsnodehash])
+#define NFSNOHASH(fhsum) ((fhsum) & nfsnodehash)
#ifndef NFS_DIRHASHSIZ
#define NFS_DIRHASHSIZ 64
Index: nfs/nfs_node.c
===================================================================
RCS file: /cvsroot/syssrc/sys/nfs/nfs_node.c,v
retrieving revision 1.44
diff -u -r1.44 nfs_node.c
--- nfs/nfs_node.c 2001/05/03 15:53:04 1.44
+++ nfs/nfs_node.c 2001/09/13 06:04:55
@@ -78,7 +78,6 @@
void
nfs_nhinit()
{
-
nfsnodehashtbl = hashinit(desiredvnodes, HASH_LIST, M_NFSNODE,
M_WAITOK, &nfsnodehash);
lockinit(&nfs_hashlock, PINOD, "nfs_hashlock", 0, 0);
@@ -90,6 +89,37 @@
}
/*
+ * Reinitialize inode hash table.
+ */
+
+void
+nfs_nhreinit()
+{
+ struct nfsnode *np;
+ struct nfsnodehashhead *oldhash, *hash;
+ u_long oldmask, mask, val;
+ int i;
+
+ hash = hashinit(desiredvnodes, HASH_LIST, M_NFSNODE, M_WAITOK,
+ &mask);
+
+ lockmgr(&nfs_hashlock, LK_EXCLUSIVE, NULL);
+ oldhash = nfsnodehashtbl;
+ oldmask = nfsnodehash;
+ nfsnodehashtbl = hash;
+ nfsnodehash = mask;
+ for (i = 0; i <= oldmask; i++) {
+ while ((np = LIST_FIRST(&oldhash[i])) != NULL) {
+ LIST_REMOVE(np, n_hash);
+ val = NFSNOHASH(nfs_hash(np->n_fhp, np->n_fhsize));
+ LIST_INSERT_HEAD(&hash[val], np, n_hash);
+ }
+ }
+ lockmgr(&nfs_hashlock, LK_RELEASE, NULL);
+ hashdone(oldhash, M_NFSNODE);
+}
+
+/*
* Free resources previoslu allocated in nfs_nhinit().
*/
void
@@ -138,9 +168,9 @@
struct vnode *nvp;
int error;
- nhpp = NFSNOHASH(nfs_hash(fhp, fhsize));
+ nhpp = &nfsnodehashtbl[NFSNOHASH(nfs_hash(fhp, fhsize))];
loop:
- for (np = nhpp->lh_first; np != 0; np = np->n_hash.le_next) {
+ LIST_FOREACH(np, nhpp, n_hash) {
if (mntp != NFSTOV(np)->v_mount || np->n_fhsize != fhsize ||
memcmp(fhp, np->n_fhp, fhsize))
continue;
@@ -178,7 +208,7 @@
np->n_accstamp = -1;
np->n_vattr = pool_get(&nfs_vattr_pool, PR_WAITOK);
- lockmgr(&vp->v_lock, LK_EXCLUSIVE, (struct simplelock *)0);
+ lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL);
/*
* XXXUBC doing this while holding the nfs_hashlock is bad,
@@ -193,7 +223,7 @@
}
uvm_vnp_setsize(vp, np->n_vattr->va_size);
- lockmgr(&nfs_hashlock, LK_RELEASE, 0);
+ lockmgr(&nfs_hashlock, LK_RELEASE, NULL);
*npp = np;
return (0);
}
Index: nfs/nfs_subs.c
===================================================================
RCS file: /cvsroot/syssrc/sys/nfs/nfs_subs.c,v
retrieving revision 1.95
diff -u -r1.95 nfs_subs.c
--- nfs/nfs_subs.c 2001/06/07 01:04:40 1.95
+++ nfs/nfs_subs.c 2001/09/13 06:04:59
@@ -1489,14 +1489,13 @@
void
nfs_vfs_init()
{
- int i;
-
- /* Ensure async daemons disabled */
- for (i = 0; i < NFS_MAXASYNCDAEMON; i++) {
- nfs_iodwant[i] = (struct proc *)0;
- nfs_iodmount[i] = (struct nfsmount *)0;
- }
nfs_nhinit(); /* Init the nfsnode table */
+}
+
+void
+nfs_vfs_reinit()
+{
+ nfs_nhreinit();
}
void
Index: nfs/nfs_var.h
===================================================================
RCS file: /cvsroot/syssrc/sys/nfs/nfs_var.h,v
retrieving revision 1.19
diff -u -r1.19 nfs_var.h
--- nfs/nfs_var.h 2000/11/27 08:39:50 1.19
+++ nfs/nfs_var.h 2001/09/13 06:05:00
@@ -82,6 +82,7 @@
/* nfs_node.c */
void nfs_nhinit __P((void));
+void nfs_nhreinit __P((void));
void nfs_nhdone __P((void));
u_long nfs_hash __P((nfsfh_t *, int));
int nfs_nget __P((struct mount *, nfsfh_t *, int, struct nfsnode **));
Index: nfs/nfs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/nfs/nfs_vfsops.c,v
retrieving revision 1.106
diff -u -r1.106 nfs_vfsops.c
--- nfs/nfs_vfsops.c 2001/07/30 22:51:06 1.106
+++ nfs/nfs_vfsops.c 2001/09/13 06:05:02
@@ -108,6 +108,7 @@
nfs_fhtovp,
nfs_vptofh,
nfs_vfs_init,
+ nfs_vfs_reinit,
nfs_vfs_done,
nfs_sysctl,
nfs_mountroot,
Index: nfs/nfsmount.h
===================================================================
RCS file: /cvsroot/syssrc/sys/nfs/nfsmount.h,v
retrieving revision 1.20
diff -u -r1.20 nfsmount.h
--- nfs/nfsmount.h 2001/02/12 20:02:30 1.20
+++ nfs/nfsmount.h 2001/09/13 06:05:02
@@ -191,6 +191,7 @@
int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
struct proc *));
void nfs_vfs_init __P((void));
+void nfs_vfs_reinit __P((void));
void nfs_vfs_done __P((void));
/*
Index: ntfs/ntfs_ihash.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ntfs/ntfs_ihash.c,v
retrieving revision 1.6
diff -u -r1.6 ntfs_ihash.c
--- ntfs/ntfs_ihash.c 2000/03/16 18:08:31 1.6
+++ ntfs/ntfs_ihash.c 2001/09/13 06:05:03
@@ -56,7 +56,7 @@
*/
static LIST_HEAD(nthashhead, ntnode) *ntfs_nthashtbl;
static u_long ntfs_nthash; /* size of hash table - 1 */
-#define NTNOHASH(device, inum) (&ntfs_nthashtbl[(minor(device) + (inum)) & ntfs_nthash])
+#define NTNOHASH(device, inum) ((minor(device) + (inum)) & ntfs_nthash)
#ifndef NULL_SIMPLELOCKS
static struct simplelock ntfs_nthash_slock;
#endif
@@ -76,6 +76,36 @@
#ifdef __NetBSD__
/*
+ * Reinitialize inode hash table.
+ */
+
+void
+ntfs_nthashreinit()
+{
+ struct ntnode *ip;
+ struct nthashhead *oldhash, *hash;
+ u_long oldmask, mask, val;
+ int i;
+
+ hash = HASHINIT(desiredvnodes, M_NTFSNTHASH, M_WAITOK, &mask);
+
+ simple_lock(&ntfs_nthash_slock);
+ oldhash = ntfs_nthashtbl;
+ oldmask = ntfs_nthash;
+ ntfs_nthashtbl = hash;
+ ntfs_nthash = mask;
+ for (i = 0; i <= oldmask; i++) {
+ while ((ip = LIST_FIRST(&oldhash[i])) != NULL) {
+ LIST_REMOVE(ip, i_hash);
+ val = NTNOHASH(ip->i_dev, ip->i_number);
+ LIST_INSERT_HEAD(&hash[val], ip, i_hash);
+ }
+ }
+ simple_unlock(&ntfs_nthash_slock);
+ hashdone(oldhash, M_NTFSNTHASH);
+}
+
+/*
* Free the inode hash table. Called from ntfs_done(), only needed
* on NetBSD.
*/
@@ -96,11 +126,14 @@
ino_t inum;
{
struct ntnode *ip;
+ struct nthashhead *ipp;
simple_lock(&ntfs_nthash_slock);
- for (ip = NTNOHASH(dev, inum)->lh_first; ip; ip = ip->i_hash.le_next)
+ ipp = &ntfs_nthashtbl[NTNOHASH(dev, inum)];
+ LIST_FOREACH(ip, ipp, i_hash) {
if (inum == ip->i_number && dev == ip->i_dev)
break;
+ }
simple_unlock(&ntfs_nthash_slock);
return (ip);
@@ -116,7 +149,7 @@
struct nthashhead *ipp;
simple_lock(&ntfs_nthash_slock);
- ipp = NTNOHASH(ip->i_dev, ip->i_number);
+ ipp = &ntfs_nthashtbl[NTNOHASH(ip->i_dev, ip->i_number)];
LIST_INSERT_HEAD(ipp, ip, i_hash);
ip->i_flag |= IN_HASHED;
simple_unlock(&ntfs_nthash_slock);
@@ -133,10 +166,6 @@
if (ip->i_flag & IN_HASHED) {
ip->i_flag &= ~IN_HASHED;
LIST_REMOVE(ip, i_hash);
-#ifdef DIAGNOSTIC
- ip->i_hash.le_next = NULL;
- ip->i_hash.le_prev = NULL;
-#endif
}
simple_unlock(&ntfs_nthash_slock);
}
Index: ntfs/ntfs_ihash.h
===================================================================
RCS file: /cvsroot/syssrc/sys/ntfs/ntfs_ihash.h,v
retrieving revision 1.6
diff -u -r1.6 ntfs_ihash.h
--- ntfs/ntfs_ihash.h 2000/03/30 12:47:01 1.6
+++ ntfs/ntfs_ihash.h 2001/09/13 06:05:03
@@ -30,6 +30,7 @@
extern struct lock ntfs_hashlock;
void ntfs_nthashinit __P((void));
+void ntfs_nthashreinit __P((void));
void ntfs_nthashdone __P((void));
struct ntnode *ntfs_nthashlookup __P((dev_t, ino_t));
struct ntnode *ntfs_nthashget __P((dev_t, ino_t));
Index: ntfs/ntfs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ntfs/ntfs_vfsops.c,v
retrieving revision 1.36
diff -u -r1.36 ntfs_vfsops.c
--- ntfs/ntfs_vfsops.c 2001/06/19 22:14:14 1.36
+++ ntfs/ntfs_vfsops.c 2001/09/13 06:05:05
@@ -94,6 +94,7 @@
int *, struct ucred **));
#elif defined(__NetBSD__)
static void ntfs_init __P((void));
+static void ntfs_reinit __P((void));
static void ntfs_done __P((void));
static int ntfs_fhtovp __P((struct mount *, struct fid *,
struct vnode **));
@@ -201,6 +202,12 @@
}
static void
+ntfs_reinit()
+{
+ ntfs_nthashreinit();
+}
+
+static void
ntfs_done()
{
ntfs_nthashdone();
@@ -1050,6 +1057,7 @@
ntfs_fhtovp,
ntfs_vptofh,
ntfs_init,
+ ntfs_reinit,
ntfs_done,
ntfs_sysctl,
ntfs_mountroot,
@@ -1057,5 +1065,3 @@
ntfs_vnodeopv_descs,
};
#endif
-
-
Index: sys/mount.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/mount.h,v
retrieving revision 1.90
diff -u -r1.90 mount.h
--- sys/mount.h 2001/06/28 08:15:44 1.90
+++ sys/mount.h 2001/09/13 06:05:06
@@ -317,6 +317,7 @@
struct vnode **vpp));
int (*vfs_vptofh) __P((struct vnode *vp, struct fid *fhp));
void (*vfs_init) __P((void));
+ void (*vfs_reinit) __P((void));
void (*vfs_done) __P((void));
int (*vfs_sysctl) __P((int *, u_int, void *, size_t *, void *,
size_t, struct proc *));
@@ -430,6 +431,7 @@
void vfs_unbusy __P((struct mount *));
int vfs_attach __P((struct vfsops *));
int vfs_detach __P((struct vfsops *));
+void vfs_reinit __P((void));
struct vfsops *vfs_getopsbyname __P((const char *));
int vfs_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
struct proc *));
Index: ufs/ext2fs/ext2fs_extern.h
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ext2fs/ext2fs_extern.h,v
retrieving revision 1.9
diff -u -r1.9 ext2fs_extern.h
--- ufs/ext2fs/ext2fs_extern.h 2000/11/27 08:39:53 1.9
+++ ufs/ext2fs/ext2fs_extern.h 2001/09/13 06:05:08
@@ -103,6 +103,7 @@
/* ext2fs_vfsops.c */
void ext2fs_init __P((void));
+void ext2fs_reinit __P((void));
void ext2fs_done __P((void));
int ext2fs_mountroot __P((void));
int ext2fs_mount __P((struct mount *, const char *, void *, struct nameidata *,
Index: ufs/ext2fs/ext2fs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ext2fs/ext2fs_vfsops.c,v
retrieving revision 1.43
diff -u -r1.43 ext2fs_vfsops.c
--- ufs/ext2fs/ext2fs_vfsops.c 2001/05/30 11:57:19 1.43
+++ ufs/ext2fs/ext2fs_vfsops.c 2001/09/13 06:05:10
@@ -100,6 +100,7 @@
ext2fs_fhtovp,
ext2fs_vptofh,
ext2fs_init,
+ ext2fs_reinit,
ext2fs_done,
ext2fs_sysctl,
ext2fs_mountroot,
@@ -122,6 +123,12 @@
pool_init(&ext2fs_inode_pool, sizeof(struct inode), 0, 0, 0,
"ext2fsinopl", 0, pool_page_alloc_nointr, pool_page_free_nointr,
M_EXT2FSNODE);
+}
+
+void
+ext2fs_reinit()
+{
+ ufs_reinit();
}
void
Index: ufs/ffs/ffs_extern.h
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ffs/ffs_extern.h,v
retrieving revision 1.19
diff -u -r1.19 ffs_extern.h
--- ufs/ffs/ffs_extern.h 2001/08/17 02:18:48 1.19
+++ ufs/ffs/ffs_extern.h 2001/09/13 06:05:10
@@ -114,6 +114,7 @@
/* ffs_vfsops.c */
void ffs_init __P((void));
+void ffs_reinit __P((void));
void ffs_done __P((void));
int ffs_mountroot __P((void));
int ffs_mount __P((struct mount *, const char *, void *, struct nameidata *,
@@ -146,6 +147,7 @@
* Soft dependency function prototypes.
*/
void softdep_initialize __P((void));
+void softdep_reinitialize __P((void));
int softdep_mount __P((struct vnode *, struct mount *, struct fs *,
struct ucred *));
int softdep_flushfiles __P((struct mount *, int, struct proc *));
Index: ufs/ffs/ffs_softdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ffs/ffs_softdep.c,v
retrieving revision 1.14
diff -u -r1.14 ffs_softdep.c
--- ufs/ffs/ffs_softdep.c 2001/08/30 03:55:42 1.14
+++ ufs/ffs/ffs_softdep.c 2001/09/13 06:05:20
@@ -706,8 +706,7 @@
LIST_HEAD(pagedep_hashhead, pagedep) *pagedep_hashtbl;
u_long pagedep_hash; /* size of hash table - 1 */
#define PAGEDEP_HASH(mp, inum, lbn) \
- (&pagedep_hashtbl[((((register_t)(mp)) >> 13) + (inum) + (lbn)) & \
- pagedep_hash])
+ (((((register_t)(mp)) >> 13) + (inum) + (lbn)) & pagedep_hash)
static struct sema pagedep_in_progress;
/*
@@ -733,14 +732,14 @@
panic("pagedep_lookup: lock not held");
#endif
mp = ITOV(ip)->v_mount;
- pagedephd = PAGEDEP_HASH(mp, ip->i_number, lbn);
+ pagedephd = &pagedep_hashtbl[PAGEDEP_HASH(mp, ip->i_number, lbn)];
top:
- for (pagedep = LIST_FIRST(pagedephd); pagedep;
- pagedep = LIST_NEXT(pagedep, pd_hash))
+ LIST_FOREACH(pagedep, pagedephd, pd_hash) {
if (ip->i_number == pagedep->pd_ino &&
lbn == pagedep->pd_lbn &&
mp == pagedep->pd_mnt)
break;
+ }
if (pagedep) {
*pagedeppp = pagedep;
return (1);
@@ -778,7 +777,7 @@
static u_long inodedep_hash; /* size of hash table - 1 */
static long num_inodedep; /* number of inodedep allocated */
#define INODEDEP_HASH(fs, inum) \
- (&inodedep_hashtbl[((((register_t)(fs)) >> 13) + (inum)) & inodedep_hash])
+ (((((register_t)(fs)) >> 13) + (inum)) & inodedep_hash)
static struct sema inodedep_in_progress;
/*
@@ -803,12 +802,12 @@
panic("inodedep_lookup: lock not held");
#endif
firsttry = 1;
- inodedephd = INODEDEP_HASH(fs, inum);
+ inodedephd = &inodedep_hashtbl[INODEDEP_HASH(fs, inum)];
top:
- for (inodedep = LIST_FIRST(inodedephd); inodedep;
- inodedep = LIST_NEXT(inodedep, id_hash))
+ LIST_FOREACH(inodedep, inodedephd, id_hash) {
if (inum == inodedep->id_ino && fs == inodedep->id_fs)
break;
+ }
if (inodedep) {
*inodedeppp = inodedep;
return (1);
@@ -932,6 +931,55 @@
}
/*
+ * Reinitialize pagedep hash table.
+ */
+void
+softdep_reinitialize()
+{
+ struct pagedep_hashhead *oldhash1, *hash1;
+ struct pagedep *pagedep;
+ struct inodedep_hashhead *oldhash2, *hash2;
+ struct inodedep *inodedep;
+ u_long oldmask1, oldmask2, mask1, mask2, val;
+ int i;
+
+ hash1 = hashinit(desiredvnodes / 5, HASH_LIST, M_PAGEDEP, M_WAITOK,
+ &mask1);
+ hash2 = hashinit(desiredvnodes, HASH_LIST, M_INODEDEP, M_WAITOK,
+ &mask2);
+
+ max_softdeps = desiredvnodes * 4;
+
+ ACQUIRE_LOCK(&lk);
+ oldhash1 = pagedep_hashtbl;
+ oldmask1 = pagedep_hash;
+ pagedep_hashtbl = hash1;
+ pagedep_hash = mask1;
+ oldhash2 = inodedep_hashtbl;
+ oldmask2 = inodedep_hash;
+ inodedep_hashtbl = hash2;
+ inodedep_hash = mask2;
+ for (i = 0; i <= oldmask1; i++) {
+ while ((pagedep = LIST_FIRST(&oldhash1[i])) != NULL) {
+ LIST_REMOVE(pagedep, pd_hash);
+ val = PAGEDEP_HASH(pagedep->pd_mnt, pagedep->pd_ino,
+ pagedep->pd_lbn);
+ LIST_INSERT_HEAD(&hash1[val], pagedep, pd_hash);
+ }
+ }
+ for (i = 0; i <= oldmask2; i++) {
+ while ((inodedep = LIST_FIRST(&oldhash2[i])) != NULL) {
+ LIST_REMOVE(inodedep, id_hash);
+ val = INODEDEP_HASH(inodedep->id_fs, inodedep->id_ino);
+ LIST_INSERT_HEAD(&hash2[val], inodedep, id_hash);
+ }
+ }
+ FREE_LOCK(&lk);
+ hashdone(oldhash1, M_PAGEDEP);
+ hashdone(oldhash2, M_INODEDEP);
+}
+
+/*
* Called at mount time to notify the dependency code that a
* filesystem wishes to use it.
*
@@ -4568,8 +4616,7 @@
pagedephd = &pagedep_hashtbl[next++];
if (next >= pagedep_hash)
next = 0;
- for (pagedep = LIST_FIRST(pagedephd); pagedep;
- pagedep = LIST_NEXT(pagedep, pd_hash)) {
+ LIST_FOREACH(pagedep, pagedephd, pd_hash) {
if (LIST_FIRST(&pagedep->pd_dirremhd) == NULL)
continue;
mp = pagedep->pd_mnt;
Index: ufs/ffs/ffs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ffs/ffs_vfsops.c,v
retrieving revision 1.85
diff -u -r1.85 ffs_vfsops.c
--- ufs/ffs/ffs_vfsops.c 2001/09/06 02:16:02 1.85
+++ ufs/ffs/ffs_vfsops.c 2001/09/13 06:05:23
@@ -103,6 +103,7 @@
ffs_fhtovp,
ffs_vptofh,
ffs_init,
+ ffs_reinit,
ffs_done,
ffs_sysctl,
ffs_mountroot,
@@ -1076,6 +1077,7 @@
ip->i_dquot[i] = NODQUOT;
}
#endif
+
/*
* Put it onto its hash chain and lock it so that other requests for
* this inode will block if they arrive while we are sleeping waiting
@@ -1200,6 +1202,13 @@
pool_init(&ffs_inode_pool, sizeof(struct inode), 0, 0, 0, "ffsinopl",
0, pool_page_alloc_nointr, pool_page_free_nointr, M_FFSNODE);
+}
+
+void
+ffs_reinit()
+{
+ softdep_reinitialize();
+ ufs_reinit();
}
void
Index: ufs/lfs/lfs_extern.h
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/lfs/lfs_extern.h,v
retrieving revision 1.25
diff -u -r1.25 lfs_extern.h
--- ufs/lfs/lfs_extern.h 2001/07/13 20:30:23 1.25
+++ ufs/lfs/lfs_extern.h 2001/09/13 06:05:23
@@ -183,6 +183,7 @@
/* lfs_vfsops.c */
void lfs_init(void);
+void lfs_reinit(void);
void lfs_done(void);
int lfs_mountroot(void);
int lfs_mount(struct mount *, const char *, void *, struct nameidata *, struct proc *);
Index: ufs/lfs/lfs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/lfs/lfs_vfsops.c,v
retrieving revision 1.66
diff -u -r1.66 lfs_vfsops.c
--- ufs/lfs/lfs_vfsops.c 2001/07/13 20:30:25 1.66
+++ ufs/lfs/lfs_vfsops.c 2001/09/13 06:05:26
@@ -130,6 +130,7 @@
lfs_fhtovp,
lfs_vptofh,
lfs_init,
+ lfs_reinit,
lfs_done,
lfs_sysctl,
lfs_mountroot,
@@ -156,6 +157,12 @@
pool_init(&lfs_inode_pool, sizeof(struct inode), 0, 0, 0,
"lfsinopl", 0, pool_page_alloc_nointr, pool_page_free_nointr,
M_LFSNODE);
+}
+
+void
+lfs_reinit()
+{
+ ufs_reinit();
}
void
Index: ufs/mfs/mfs_extern.h
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/mfs/mfs_extern.h,v
retrieving revision 1.11
diff -u -r1.11 mfs_extern.h
--- ufs/mfs/mfs_extern.h 2000/05/19 20:42:20 1.11
+++ ufs/mfs/mfs_extern.h 2001/09/13 06:05:26
@@ -57,6 +57,7 @@
struct proc *));
void mfs_init __P((void));
+void mfs_reinit __P((void));
void mfs_done __P((void));
/* mfs_vnops.c */
Index: ufs/mfs/mfs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/mfs/mfs_vfsops.c,v
retrieving revision 1.34
diff -u -r1.34 mfs_vfsops.c
--- ufs/mfs/mfs_vfsops.c 2001/05/30 11:57:19 1.34
+++ ufs/mfs/mfs_vfsops.c 2001/09/13 06:05:27
@@ -94,6 +94,7 @@
ffs_fhtovp,
ffs_vptofh,
mfs_init,
+ mfs_reinit,
mfs_done,
ffs_sysctl,
NULL,
@@ -112,6 +113,12 @@
* only once.
*/
ffs_init();
+}
+
+void
+mfs_reinit()
+{
+ ffs_reinit();
}
void
Index: ufs/ufs/quota.h
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ufs/quota.h,v
retrieving revision 1.9
diff -u -r1.9 quota.h
--- ufs/ufs/quota.h 2001/02/23 02:25:11 1.9
+++ ufs/ufs/quota.h 2001/09/13 06:05:28
@@ -190,6 +190,7 @@
int dqget __P((struct vnode *,
u_long, struct ufsmount *, int, struct dquot **));
void dqinit __P((void));
+void dqreinit __P((void));
void dqdone __P((void));
void dqref __P((struct dquot *));
void dqrele __P((struct vnode *, struct dquot *));
Index: ufs/ufs/ufs_extern.h
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ufs/ufs_extern.h,v
retrieving revision 1.25
diff -u -r1.25 ufs_extern.h
--- ufs/ufs/ufs_extern.h 2001/05/28 02:50:53 1.25
+++ ufs/ufs/ufs_extern.h 2001/09/13 06:05:28
@@ -105,6 +105,7 @@
/* ufs_ihash.c */
void ufs_ihashinit __P((void));
+void ufs_ihashreinit __P((void));
void ufs_ihashdone __P((void));
struct vnode *ufs_ihashlookup __P((dev_t, ino_t));
struct vnode *ufs_ihashget __P((dev_t, ino_t, int));
@@ -149,6 +150,7 @@
/* ufs_vfsops.c */
void ufs_init __P((void));
+void ufs_reinit __P((void));
void ufs_done __P((void));
int ufs_start __P((struct mount *, int, struct proc *));
int ufs_root __P((struct mount *, struct vnode **));
Index: ufs/ufs/ufs_ihash.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ufs/ufs_ihash.c,v
retrieving revision 1.11
diff -u -r1.11 ufs_ihash.c
--- ufs/ufs/ufs_ihash.c 2000/11/08 14:28:16 1.11
+++ ufs/ufs/ufs_ihash.c 2001/09/13 06:05:28
@@ -41,6 +41,7 @@
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/lock.h>
+#include <sys/mount.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
@@ -51,7 +52,7 @@
*/
LIST_HEAD(ihashhead, inode) *ihashtbl;
u_long ihash; /* size of hash table - 1 */
-#define INOHASH(device, inum) (&ihashtbl[((device) + (inum)) & ihash])
+#define INOHASH(device, inum) (((device) + (inum)) & ihash)
struct lock ufs_hashlock;
struct simplelock ufs_ihash_slock;
@@ -69,6 +70,35 @@
}
/*
+ * Reinitialize inode hash table.
+ */
+
+void
+ufs_ihashreinit()
+{
+ struct inode *ip;
+ struct ihashhead *oldhash, *hash;
+ u_long oldmask, mask, val;
+ int i;
+
+ hash = hashinit(desiredvnodes, HASH_LIST, M_UFSMNT, M_WAITOK, &mask);
+ simple_lock(&ufs_ihash_slock);
+ oldhash = ihashtbl;
+ oldmask = ihash;
+ ihashtbl = hash;
+ ihash = mask;
+ for (i = 0; i <= oldmask; i++) {
+ while ((ip = LIST_FIRST(&oldhash[i])) != NULL) {
+ LIST_REMOVE(ip, i_hash);
+ val = INOHASH(ip->i_dev, ip->i_number);
+ LIST_INSERT_HEAD(&hash[val], ip, i_hash);
+ }
+ }
+ simple_unlock(&ufs_ihash_slock);
+ hashdone(oldhash, M_UFSMNT);
+}
+
+/*
* Free inode hash table.
*/
void
@@ -87,9 +117,11 @@
ino_t inum;
{
struct inode *ip;
+ struct ihashhead *ipp;
simple_lock(&ufs_ihash_slock);
- for (ip = INOHASH(dev, inum)->lh_first; ip; ip = ip->i_hash.le_next) {
+ ipp = &ihashtbl[INOHASH(dev, inum)];
+ LIST_FOREACH(ip, ipp, i_hash) {
if (inum == ip->i_number && dev == ip->i_dev)
break;
}
@@ -109,12 +141,14 @@
ino_t inum;
int flags;
{
+ struct ihashhead *ipp;
struct inode *ip;
struct vnode *vp;
loop:
simple_lock(&ufs_ihash_slock);
- for (ip = INOHASH(dev, inum)->lh_first; ip; ip = ip->i_hash.le_next) {
+ ipp = &ihashtbl[INOHASH(dev, inum)];
+ LIST_FOREACH(ip, ipp, i_hash) {
if (inum == ip->i_number && dev == ip->i_dev) {
vp = ITOV(ip);
simple_lock(&vp->v_interlock);
@@ -138,10 +172,10 @@
struct ihashhead *ipp;
/* lock the inode, then put it on the appropriate hash list */
- lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, (struct simplelock *)0);
+ lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, NULL);
simple_lock(&ufs_ihash_slock);
- ipp = INOHASH(ip->i_dev, ip->i_number);
+ ipp = &ihashtbl[INOHASH(ip->i_dev, ip->i_number)];
LIST_INSERT_HEAD(ipp, ip, i_hash);
simple_unlock(&ufs_ihash_slock);
}
@@ -155,9 +189,5 @@
{
simple_lock(&ufs_ihash_slock);
LIST_REMOVE(ip, i_hash);
-#ifdef DIAGNOSTIC
- ip->i_hash.le_next = NULL;
- ip->i_hash.le_prev = NULL;
-#endif
simple_unlock(&ufs_ihash_slock);
}
Index: ufs/ufs/ufs_quota.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ufs/ufs_quota.c,v
retrieving revision 1.20
diff -u -r1.20 ufs_quota.c
--- ufs/ufs/ufs_quota.c 2000/11/08 14:28:16 1.20
+++ ufs/ufs/ufs_quota.c 2001/09/13 06:05:30
@@ -408,8 +408,8 @@
* NB: only need to add dquot's for inodes being modified.
*/
again:
- for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nextvp) {
- nextvp = vp->v_mntvnodes.le_next;
+ for (vp = LIST_FIRST(&mp->mnt_vnodelist); vp != NULL; vp = nextvp) {
+ nextvp = LIST_NEXT(vp, v_mntvnodes);
if (vp->v_type == VNON ||vp->v_writecount == 0)
continue;
if (vget(vp, LK_EXCLUSIVE))
@@ -419,7 +419,7 @@
break;
}
vput(vp);
- if (vp->v_mntvnodes.le_next != nextvp || vp->v_mount != mp)
+ if (LIST_NEXT(vp, v_mntvnodes) != nextvp || vp->v_mount != mp)
goto again;
}
ump->um_qflags[type] &= ~QTF_OPENING;
@@ -452,8 +452,8 @@
* deleting any references to quota file being closed.
*/
again:
- for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nextvp) {
- nextvp = vp->v_mntvnodes.le_next;
+ for (vp = LIST_FIRST(&mp->mnt_vnodelist); vp != NULL; vp = nextvp) {
+ nextvp = LIST_NEXT(vp, v_mntvnodes);
if (vp->v_type == VNON)
continue;
if (vget(vp, LK_EXCLUSIVE))
@@ -463,7 +463,7 @@
ip->i_dquot[type] = NODQUOT;
dqrele(vp, dq);
vput(vp);
- if (vp->v_mntvnodes.le_next != nextvp || vp->v_mount != mp)
+ if (LIST_NEXT(vp, v_mntvnodes) != nextvp || vp->v_mount != mp)
goto again;
}
dqflush(qvp);
@@ -635,10 +635,10 @@
*/
simple_lock(&mntvnode_slock);
again:
- for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nextvp) {
+ for (vp = LIST_FIRST(&mp->mnt_vnodelist); vp != NULL; vp = nextvp) {
if (vp->v_mount != mp)
goto again;
- nextvp = vp->v_mntvnodes.le_next;
+ nextvp = LIST_NEXT(vp, v_mntvnodes);
if (vp->v_type == VNON)
continue;
simple_lock(&vp->v_interlock);
@@ -657,7 +657,7 @@
}
vput(vp);
simple_lock(&mntvnode_slock);
- if (vp->v_mntvnodes.le_next != nextvp)
+ if (LIST_NEXT(vp, v_mntvnodes) != nextvp)
goto again;
}
simple_unlock(&mntvnode_slock);
@@ -668,8 +668,8 @@
* Code pertaining to management of the in-core dquot data structures.
*/
#define DQHASH(dqvp, id) \
- (&dqhashtbl[((((long)(dqvp)) >> 8) + id) & dqhash])
-LIST_HEAD(dqhash, dquot) *dqhashtbl;
+ (((((long)(dqvp)) >> 8) + id) & dqhash)
+LIST_HEAD(dqhashhead, dquot) *dqhashtbl;
u_long dqhash;
/*
@@ -690,6 +690,31 @@
TAILQ_INIT(&dqfreelist);
}
+void
+dqreinit()
+{
+ struct dquot *dq;
+ struct dqhashhead *oldhash, *hash;
+ struct vnode *dqvp;
+ u_long oldmask, mask, hashval;
+ int i;
+
+ hash = hashinit(desiredvnodes, HASH_LIST, M_DQUOT, M_WAITOK, &mask);
+ oldhash = dqhashtbl;
+ oldmask = dqhash;
+ dqhashtbl = hash;
+ dqhash = mask;
+ for (i = 0; i <= oldmask; i++) {
+ while ((dq = LIST_FIRST(&oldhash[i])) != NULL) {
+ dqvp = dq->dq_ump->um_quotas[dq->dq_type];
+ LIST_REMOVE(dq, dq_hash);
+ hashval = DQHASH(dqvp, dq->dq_id);
+ LIST_INSERT_HEAD(&dqhashtbl[hashval], dq, dq_hash);
+ }
+ }
+ hashdone(oldhash, M_DQUOT);
+}
+
/*
* Free resources held by quota system.
*/
@@ -712,7 +737,7 @@
struct dquot **dqp;
{
struct dquot *dq;
- struct dqhash *dqh;
+ struct dqhashhead *dqh;
struct vnode *dqvp;
struct iovec aiov;
struct uio auio;
@@ -726,8 +751,8 @@
/*
* Check the cache first.
*/
- dqh = DQHASH(dqvp, id);
- for (dq = dqh->lh_first; dq; dq = dq->dq_hash.le_next) {
+ dqh = &dqhashtbl[DQHASH(dqvp, id)];
+ LIST_FOREACH(dq, dqh, dq_hash) {
if (dq->dq_id != id ||
dq->dq_ump->um_quotas[dq->dq_type] != dqvp)
continue;
@@ -910,7 +935,7 @@
struct vnode *vp;
{
struct dquot *dq, *nextdq;
- struct dqhash *dqh;
+ struct dqhashhead *dqh;
/*
* Move all dquot's that used to refer to this quota
@@ -918,14 +943,14 @@
* fall off the head of the free list and be re-used).
*/
for (dqh = &dqhashtbl[dqhash]; dqh >= dqhashtbl; dqh--) {
- for (dq = dqh->lh_first; dq; dq = nextdq) {
- nextdq = dq->dq_hash.le_next;
+ for (dq = LIST_FIRST(dqh); dq; dq = nextdq) {
+ nextdq = LIST_NEXT(dq, dq_hash);
if (dq->dq_ump->um_quotas[dq->dq_type] != vp)
continue;
if (dq->dq_cnt)
panic("dqflush: stray dquot");
LIST_REMOVE(dq, dq_hash);
- dq->dq_ump = (struct ufsmount *)0;
+ dq->dq_ump = NULL;
}
}
}
Index: ufs/ufs/ufs_vfsops.c
===================================================================
RCS file: /cvsroot/syssrc/sys/ufs/ufs/ufs_vfsops.c,v
retrieving revision 1.11
diff -u -r1.11 ufs_vfsops.c
--- ufs/ufs/ufs_vfsops.c 2000/03/30 12:41:15 1.11
+++ ufs/ufs/ufs_vfsops.c 2001/09/13 06:05:30
@@ -234,6 +234,15 @@
#endif
}
+void
+ufs_reinit()
+{
+ ufs_ihashreinit();
+#ifdef QUOTA
+ dqreinit();
+#endif
+}
+
/*
* Free UFS filesystem resources, done only once.
*/
--Dxnq1zWXvFF0Q93v--