+void pcache_release_page(struct pcache* pcache, struct pcache_pg* page);
+void pcache_set_dirty(struct pcache* pcache, struct pcache_pg* pg);
+
+static bcache_zone_t pagecached_zone = NULL;
+
+static void
+__pcache_sync(struct bcache* bc, unsigned long tag, void* data)
+{
+ struct pcache* cache;
+
+ cache = pcache_obj(bc);
+ pcache_commit(cache->master, (struct pcache_pg*)data);
+}
+
+static void
+__pcache_try_release(struct bcache* bc, void* data)
+{
+ struct pcache_pg* page;
+
+ page = (struct pcache_pg*)data;
+ pcache_release_page(pcache_obj(bc), page);
+}
+
+static struct bcache_ops cache_ops = {
+ .release_on_evict = __pcache_try_release,
+ .sync_cached = __pcache_sync
+};
+
+static void*
+pcache_alloc_page()
+{
+ int i = 0;
+ ptr_t va = 0;
+ struct leaflet* leaflet = alloc_leaflet(0);
+
+ if (!leaflet) {
+ return NULL;
+ }
+
+ if (!(va = (ptr_t)vmap(leaflet, KERNEL_DATA))) {
+ leaflet_return(leaflet);
+ return NULL;
+ }
+
+ return (void*)va;
+}
+
+static void
+pcache_free_page(void* va)