Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv16195
Modified Files:
Tag: b_lustre
inode.c
Log Message:
merge Lee Ward's i_ref fix on HEAD.
Index: inode.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v
retrieving revision 1.7.2.2
retrieving revision 1.7.2.3
diff -u -w -b -B -p -r1.7.2.2 -r1.7.2.3
--- inode.c 15 Aug 2003 07:43:15 -0000 1.7.2.2
+++ inode.c 16 Sep 2003 10:09:40 -0000 1.7.2.3
@@ -636,6 +636,30 @@ _sysio_p_find_alias(struct pnode *parent
}
/*
+ * Prune idle path base nodes freom the passed sub-tree, including the root.
+ */
+static void
+_sysio_prune(struct pnode_base *rpb)
+{
+ struct pnode_base *nxtpb, *pb;
+
+ nxtpb = rpb->pb_children.lh_first;
+ while ((pb = nxtpb)) {
+ nxtpb = pb->pb_sibs.le_next;
+ if (pb->pb_aliases.lh_first)
+ continue;
+ if (pb->pb_children.lh_first) {
+ _sysio_prune(pb);
+ continue;
+ }
+ _sysio_pb_gone(pb);
+ }
+ if (rpb->pb_children.lh_first)
+ return;
+ _sysio_pb_gone(rpb);
+}
+
+/*
* Prune idle nodes from the passed sub-tree, including the root.
*
* Returns the number of aliases on the same mount that could not be pruned.
@@ -653,6 +677,10 @@ _sysio_p_prune(struct pnode *root)
while ((pb = nxtpb)) {
nxtpb = pb->pb_sibs.le_next;
nxtpno = pb->pb_aliases.lh_first;
+ if (!nxtpno) {
+ _sysio_prune(pb);
+ continue;
+ }
while ((pno = nxtpno)) {
nxtpno = pno->p_links.le_next;
if (pno->p_mount != root->p_mount) {
@@ -694,10 +722,10 @@ _sysio_p_prune(struct pnode *root)
if (_sysio_do_unmount(pno->p_mount) != 0) {
P_RELE(pno);
count++;
- continue;
}
+ continue;
#endif
- } else
+ }
_sysio_p_gone(pno);
}
}
@@ -712,9 +740,9 @@ _sysio_p_prune(struct pnode *root)
/*
* All that is left is the root. Try for it too.
*/
- if (root->p_ref)
+ if (root->p_ref) {
count++;
- else if (root->p_mount->mnt_root == root) {
+ } else if (root->p_mount->mnt_root == root) {
#ifndef AUTOMOUNT_FILE_NAME
count++;
#else
|