From e34814b27b4a5b80761c166d5827d1c9177fd1fe Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 27 Aug 2010 01:24:30 +0200 Subject: Keep a reference on objects to preserve their content. Modify tmpfs to keep a reference (by mapping it into its own space) to each memory object created by the user, so they don't get inmediately terminated at the end of the current operation. * tmpfs/tmpfs.h (struct disknode): Add `memref' field. * tmpfs/node.c (diskfs_get_filemap): vm_map() the first page of the newly-allocated object, store in `memref' field. (diskfs_free_node) vm_deallocate the page pointed by `memref' field. --- tmpfs/tmpfs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tmpfs/tmpfs.h') diff --git a/tmpfs/tmpfs.h b/tmpfs/tmpfs.h index a0e1f7ad..3d38e2ab 100644 --- a/tmpfs/tmpfs.h +++ b/tmpfs/tmpfs.h @@ -47,6 +47,7 @@ struct disknode struct { mach_port_t memobj; + vm_address_t memref; unsigned int allocpages; /* largest size while memobj was live */ } reg; struct -- cgit v1.2.3