diff options
Diffstat (limited to 'fatfs')
-rw-r--r-- | fatfs/pager.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/fatfs/pager.c b/fatfs/pager.c index 84376bd7..bef8dbeb 100644 --- a/fatfs/pager.c +++ b/fatfs/pager.c @@ -747,8 +747,6 @@ pager_clear_user_data (struct user_pager_info *upi) diskfs_nrele_light (upi->node); } - - free (upi); } /* This will be called when the ports library wants to drop weak @@ -839,22 +837,21 @@ diskfs_get_filemap (struct node *node, vm_prot_t prot) } else { - struct user_pager_info *upi = - malloc (sizeof (struct user_pager_info)); - upi->type = FILE_DATA; - upi->node = node; - upi->max_prot = prot; - diskfs_nref_light (node); + struct user_pager_info *upi; node->dn->pager = - pager_create (upi, file_pager_bucket, MAY_CACHE, - MEMORY_OBJECT_COPY_DELAY, 0); - if (node->dn->pager == 0) + pager_create_alloc (sizeof *upi, file_pager_bucket, MAY_CACHE, + MEMORY_OBJECT_COPY_DELAY, 0); + if (node->dn->pager == NULL) { diskfs_nrele_light (node); - free (upi); pthread_spin_unlock (&node_to_page_lock); return MACH_PORT_NULL; } + upi = pager_get_upi (node->dn->pager); + upi->type = FILE_DATA; + upi->node = node; + upi->max_prot = prot; + diskfs_nref_light (node); right = pager_get_port (node->dn->pager); ports_port_deref (node->dn->pager); |