diff options
author | Roland McGrath <roland@gnu.org> | 1999-05-15 23:13:32 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-05-15 23:13:32 +0000 |
commit | 69fce3bb002e52d96dfcf700a95d6abe71537a01 (patch) | |
tree | 33a680c3c9ef73614d7f0924e11fd0c1815e8ce7 /serverboot | |
parent | 0605a5a60dad2d494dfb72a04cd7e481c072223d (diff) |
1999-05-15 Roland McGrath <roland@baalperazim.frob.com>
* default_pager.c (new_partition): Check if requested partition is
already in our list, and refuse it.
Diffstat (limited to 'serverboot')
-rw-r--r-- | serverboot/default_pager.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/serverboot/default_pager.c b/serverboot/default_pager.c index 8fb8dfe1..66ff94a0 100644 --- a/serverboot/default_pager.c +++ b/serverboot/default_pager.c @@ -171,6 +171,24 @@ new_partition (const char *name, struct file_direct *fdp, vm_offset_t raddr; mach_msg_type_number_t rsize; int rc; + unsigned int id = part_id(name); + + mutex_lock(&all_partitions.lock); + { + unsigned int i; + for (i = 0; i < all_partitions.n_partitions; i++) + { + part = partition_of(i); + if (part && part->id == id) + { + printf ("(default pager): Already paging to partition %s!\n", + name); + mutex_unlock(&all_partitions.lock); + return 0; + } + } + } + mutex_unlock(&all_partitions.lock); size = atop(fdp->fd_size * fdp->fd_bsize); bmsize = howmany(size, NB_BM) * sizeof(bm_entry_t); @@ -179,7 +197,7 @@ new_partition (const char *name, struct file_direct *fdp, mutex_init(&part->p_lock); part->total_size = size; part->free = size; - part->id = part_id(name); + part->id = id; part->bitmap = (bm_entry_t *)kalloc(bmsize); part->going_away= FALSE; part->file = fdp; |