summaryrefslogtreecommitdiff
path: root/ext2fs/pager.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-05-02 22:30:11 +0000
committerMiles Bader <miles@gnu.org>1995-05-02 22:30:11 +0000
commitbeac671d529be0f4d25440ca03d4135fd80bf187 (patch)
tree7fd839021d72b0875d63e542d2d345f16f9e9c2d /ext2fs/pager.c
parent62e4ef2263946e464c379478176987a082ba5837 (diff)
Formerly pager.c.~26~
Diffstat (limited to 'ext2fs/pager.c')
-rw-r--r--ext2fs/pager.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext2fs/pager.c b/ext2fs/pager.c
index be88d29d..c451d7ae 100644
--- a/ext2fs/pager.c
+++ b/ext2fs/pager.c
@@ -593,9 +593,11 @@ pager_clear_user_data (struct user_pager_info *upi)
diskfs_nrele_light (upi->node);
+ spin_lock (&pager_list_lock);
*upi->prevp = upi->next;
if (upi->next)
upi->next->prevp = upi->prevp;
+ spin_unlock (&pager_list_lock);
free (upi);
}
@@ -717,6 +719,9 @@ pager_traverse (void (*func)(struct user_pager_info *))
spin_lock (&pager_list_lock);
for (p = file_pager_list; p; p = p->next)
+ /* XXXXXXX THIS CHECK IS A HACK TO MAKE A RACE WITH DEPARTING PAGERS
+ RARER, UNTIL MIB FIXES PORTS TO HAVE SOFT REFERENCES!!!! XXXXX */
+ if (((struct port_info *)p->p)->refcnt > 0)
{
i = alloca (sizeof (struct item));
i->next = list;
@@ -735,6 +740,8 @@ pager_traverse (void (*func)(struct user_pager_info *))
(*func)(disk_pager);
}
+static struct ext2_super_block final_sblock;
+
/* Shutdown all the pagers. */
void
diskfs_shutdown_pager ()
@@ -745,6 +752,12 @@ diskfs_shutdown_pager ()
}
write_all_disknodes ();
+
+ /* Because the superblock lives in the disk pager, we copy out the last
+ known value just before we shut it down. */
+ bcopy (sblock, &final_sblock, sizeof (final_sblock));
+ sblock = &final_sblock;
+
pager_traverse (shutdown_one);
}