summaryrefslogtreecommitdiff
path: root/tmpfs
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-02-26 10:43:05 +0000
committerRoland McGrath <roland@gnu.org>2001-02-26 10:43:05 +0000
commit57248b8f03a1544507034345eeeced1b6c2007b8 (patch)
treebc5cbf7939df007d293123aebd4728ddf2ba7ee0 /tmpfs
parent6d2bd2cd475854c7f85e2401f25f2cc91162cbc4 (diff)
2001-02-26 Roland McGrath <roland@frob.com>
* node.c (diskfs_free_node): Reset hnext's hprevp. (diskfs_node_norefs): Likewise. (diskfs_cached_lookup): Fix insane code for finding existing node ptr.
Diffstat (limited to 'tmpfs')
-rw-r--r--tmpfs/node.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tmpfs/node.c b/tmpfs/node.c
index 59a9bc37..aae59c74 100644
--- a/tmpfs/node.c
+++ b/tmpfs/node.c
@@ -69,6 +69,8 @@ diskfs_free_node (struct node *np, mode_t mode)
break;
}
*np->dn->hprevp = np->dn->hnext;
+ if (np->dn->hnext != 0)
+ np->dn->hnext->dn->hprevp = np->dn->hprevp;
free (np->dn);
np->dn = 0;
@@ -112,6 +114,8 @@ diskfs_node_norefs (struct node *np)
/* Remove this node from the cache list rooted at `all_nodes'. */
*np->dn->hprevp = np->dn->hnext;
+ if (np->dn->hnext != 0)
+ np->dn->hnext->dn->hprevp = np->dn->hprevp;
np->dn->hnext = 0;
np->dn->hprevp = 0;
}
@@ -152,9 +156,9 @@ diskfs_cached_lookup (int inum, struct node **npp)
struct disknode *dn = (void *) inum;
struct node *np;
- if (dn->hnext != 0) /* There is already a node. */
+ if (dn->hprevp != 0) /* There is already a node. */
{
- np = (void *) dn->hnext - offsetof (struct disknode, hnext);
+ np = *dn->hprevp;
assert (np->dn == dn);
assert (*dn->hprevp == np);
spin_lock (&diskfs_node_refcnt_lock);