Add helper to run a function as a routine kmsg
[akaros.git] / kern / include / pagemap.h
index 0707c56..f2ad2f0 100644 (file)
@@ -22,13 +22,13 @@ struct page_map_operations;
  * currently in memory.  It is a map, per object, from index to physical page
  * frame. */
 struct page_map {
+       qlock_t                                         pm_qlock;               /* for the radix tree nr_pgs */
        struct fs_file                          *pm_file;
        struct radix_tree                       pm_tree;                /* tracks present pages */
        unsigned long                           pm_num_pages;   /* how many pages are present */
        struct page_map_operations      *pm_op;
-       spinlock_t                                      pm_lock;
+       spinlock_t                                      pm_lock;                /* for the VMR list */
        struct vmr_tailq                        pm_vmrs;
-       atomic_t                                        pm_removal;
 };
 
 /* Operations performed on a page_map.  These are usually FS specific, which
@@ -58,8 +58,10 @@ int pm_load_page_nowait(struct page_map *pm, unsigned long index,
 void pm_put_page(struct page *page);
 void pm_add_vmr(struct page_map *pm, struct vm_region *vmr);
 void pm_remove_vmr(struct page_map *pm, struct vm_region *vmr);
-int pm_remove_contig(struct page_map *pm, unsigned long index,
-                     unsigned long nr_pgs);
+void pm_remove_or_zero_pages(struct page_map *pm, unsigned long start_idx,
+                             unsigned long nr_pgs);
+void pm_writeback_pages(struct page_map *pm);
+void pm_free_unused_pages(struct page_map *pm);
 void pm_destroy(struct page_map *pm);
 void pm_page_asserter(struct page *page, char *str);
 void print_page_map_info(struct page_map *pm);