Index: arlad/dynroot.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/arlad/dynroot.c,v
retrieving revision 1.15
diff -u -r1.15 dynroot.c
--- arlad/dynroot.c	2001/05/28 15:22:26	1.15
+++ arlad/dynroot.c	2001/07/10 22:57:05
@@ -166,7 +166,18 @@
 {
     assert (volume);
     
-    if (cell == 0 && strcmp (volume, "1") == 0)
+    if (cell == 0 && strcmp (volume, "1") == 0) /* will be DYNROOT_CELLID */
+	return TRUE;
+
+    return FALSE;
+}
+
+Bool
+dynroot_isdynrootvolumep (int cell, u_int32_t volume)
+{
+    assert (volume);
+    
+    if (cell == 0 && volume == DYNROOT_ROOTVOLUME) /* will be DYNROOT_CELLID */
 	return TRUE;
 
     return FALSE;
Index: arlad/dynroot.h
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/arlad/dynroot.h,v
retrieving revision 1.3
diff -u -r1.3 dynroot.h
--- arlad/dynroot.h	2001/05/28 15:22:26	1.3
+++ arlad/dynroot.h	2001/07/10 22:57:03
@@ -40,6 +40,7 @@
 int dynroot_fetch_vldbN (nvldbentry *entry);
 
 Bool dynroot_isvolumep (int cell, const char *volume);
+Bool dynroot_isdynrootvolumep (int cell, u_int32_t volume);
 
 int dynroot_get_attr (FCacheEntry *entry, CredCacheEntry *ce);
 
Index: arlad/fcache.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/arlad/fcache.c,v
retrieving revision 1.334
diff -u -r1.334 fcache.c
--- arlad/fcache.c	2001/06/21 15:35:42	1.334
+++ arlad/fcache.c	2001/07/10 23:17:08
@@ -37,7 +37,7 @@
  */
 
 #include "arla_local.h"
-RCSID("$Id: fcache.c,v 1.334 2001/06/21 15:35:42 lha Exp $") ;
+RCSID("$Id: fcache.c,v 1.335 2001/07/10 22:12:04 mattiasa Exp $") ;
 
 /*
  * Prototypes
@@ -3817,7 +3817,9 @@
 	if (ret) {
 	    return ret;
 	}
+	if (!(*e)->flags.datap || !uptodatep(*e)) {
 	(*e)->wanted_length = (*e)->status.Length;
+	}
     }
 
     ret = fcache_verify_data (*e, *ce);
Index: arlad/volcache.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/arlad/volcache.c,v
retrieving revision 1.103
diff -u -r1.103 volcache.c
--- arlad/volcache.c	2001/03/17 18:10:17	1.103
+++ arlad/volcache.c	2001/07/10 23:10:32
@@ -531,6 +531,28 @@
  */
 
 static void
+add_id_to_hashtab (VolCacheEntry *e)
+{
+    e->name_ptr.cell = e->cell;
+    strlcpy (e->name_ptr.name, e->entry.name, sizeof(e->name_ptr.name));
+    e->name_ptr.ptr  = e;
+    hashtabadd (volnamehashtab, (void *)&e->name_ptr);
+
+    if (e->entry.flags & VLF_RWEXISTS)
+	add_clone (e, RWVOL, RWVOL);
+    else
+	add_clone (e, ROVOL, RWVOL);
+    if (e->entry.flags & VLF_ROEXISTS)
+	add_clone (e, ROVOL, ROVOL);
+    if (e->entry.flags & VLF_BOEXISTS)
+	add_clone (e, BACKVOL, BACKVOL);
+}
+
+/*
+ *
+ */
+
+static void
 add_clones_to_hashtab (VolCacheEntry *e)
 {
     if (e->entry.flags & VLF_RWEXISTS)
@@ -794,6 +816,31 @@
 }
 
 /*
+ * Add an entry for (volname, cell) to the hash table.
+ */
+
+static int
+add_entry_byid (VolCacheEntry **ret, u_int32_t id,
+		int32_t cell, CredCacheEntry *ce)
+{
+    int error;
+    VolCacheEntry *e;
+
+    e = get_free_entry ();
+
+    e->cell = cell;
+    e->refcount = 0;
+    e->vol_refs = 0;
+
+    error = get_info_byid (e, id, cell, ce);
+    if (error == 0) {
+	add_id_to_hashtab (e);
+	*ret = e;
+    }
+    return error;
+}
+
+/*
  * Retrieve the entry for (volname, cell).  If it's not in the cache,
  * add it.
  */
@@ -871,8 +918,17 @@
     int error = 0;
     for(;;) {
 	*e = getbyid (volid, cell, type);
-	if (*e == NULL) 
-	    return ENOENT;
+	if (dynroot_isdynrootvolumep(cell, volid)) {
+	    if (*e == NULL) {
+		error = add_entry_byid (e, volid, cell, ce);
+		if (error)
+		    return error;
+		continue;
+	    }
+	} else {
+	    if (*e == NULL) 
+		return ENOENT;
+	}
 
 	if ((*e)->flags.lookupp) {
 	    (*e)->flags.waiting = 1;
Index: xfs/linux/xfs_common.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/linux/xfs_common.c,v
retrieving revision 1.27
diff -u -r1.27 xfs_common.c
--- xfs/linux/xfs_common.c	2000/10/18 01:05:02	1.27
+++ xfs/linux/xfs_common.c	2001/07/10 20:35:03
@@ -95,10 +95,11 @@
 	}
 	dentry = list_entry(alias, struct dentry, d_alias);
 	if (dentry)
-	    XFSDEB(XDEBVFOPS,(" %.*s(%p)",
+	    XFSDEB(XDEBVFOPS,(" %.*s(%p/%i)",
 			      (int)dentry->d_name.len,
 			      dentry->d_name.name,
-			      dentry));
+			      dentry,
+			      xfs_dcount(dentry)));
 	alias = alias->next;
     }
     XFSDEB(XDEBVFOPS,("\n"));
Index: xfs/linux/xfs_inodeops.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/linux/xfs_inodeops.c,v
retrieving revision 1.163
diff -u -r1.163 xfs_inodeops.c
--- xfs/linux/xfs_inodeops.c	2001/06/21 15:36:57	1.163
+++ xfs/linux/xfs_inodeops.c	2001/07/10 23:17:41
@@ -772,6 +772,7 @@
     struct xfs_node *xn = VNODE_TO_XNODE(vp);
     int error = 0;
     u_int32_t offset;
+    struct xfs_message_getdata msg;
     
     do {
 	offset = want_offset;
@@ -784,8 +785,13 @@
 			   (long) offset, (long) xn->offset,
 			   (long) tok, (long) xn->tokens,
 			   (long) xn->attr.xa_size));
-	if (!XFS_TOKEN_GOT(xn, tok) || offset > xn->offset) {
-	    struct xfs_message_getdata msg;
+
+	if (XFS_TOKEN_GOT(xn, tok)) {
+	    if(offset <= xn->offset || xn->attr.xa_type == XFS_FILE_DIR) {
+		break;
+	    }
+	}
+
 	    msg.header.opcode = XFS_MSG_GETDATA;
 	    msg.cred.uid = current->uid;
 	    msg.cred.pag = xfs_get_pag();
@@ -795,8 +801,7 @@
 	    error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
 	    if (error == 0)
 		error = ((struct xfs_message_wakeup *) &msg)->error;
-	} else
-	    break;
+	
     } while (error == 0);
     
     return error;
Index: xfs/linux/xfs_vfsops.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/linux/xfs_vfsops.c,v
retrieving revision 1.74
diff -u -r1.74 xfs_vfsops.c
--- xfs/linux/xfs_vfsops.c	2001/05/15 04:25:19	1.74
+++ xfs/linux/xfs_vfsops.c	2001/07/10 20:35:03
@@ -391,5 +391,28 @@
 void
 print_nodes(int i)
 {
+    struct xfs_node *entry;
+    int total = 0;
+    int used = 0;
+
     printk("%d nodes\n", xfs[i].nnodes);
+
+    entry = xfs[i].nodes;
+    while (entry) {
+	if (xfs_icount(XNODE_TO_VNODE(entry)))
+	    used ++;
+	total++;
+	printk("(%d, %u, %u, %u)%s%s icount %d\n",
+	       entry->handle.a,
+	       entry->handle.b,
+	       entry->handle.c,
+	       entry->handle.d,
+	       XFS_TOKEN_GOT(entry, XFS_ATTR_MASK)?"A":"",
+	       XFS_TOKEN_GOT(entry, XFS_DATA_MASK)?"D":"",
+	       xfs_icount(XNODE_TO_VNODE(entry)));
+	print_aliases(XNODE_TO_VNODE(entry));
+	entry = entry->next;
+    }
+    printk("%d used nodes\n", used);
+    printk("%d counted nodes\n", total);
 }
