From 80249479d4cc16f192ae4e01acb73d584a3b0d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 3 Sep 2004 17:06:47 +0000 Subject: [PATCH] No longer needed, we're now using the vnode store in ../cache/vnode_store.cpp. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8831 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/vm/Jamfile | 1 - src/kernel/core/vm/vm_store_vnode.c | 102 ---------------------------- 2 files changed, 103 deletions(-) delete mode 100755 src/kernel/core/vm/vm_store_vnode.c diff --git a/src/kernel/core/vm/Jamfile b/src/kernel/core/vm/Jamfile index 58c70dbae2..755af7dd89 100644 --- a/src/kernel/core/vm/Jamfile +++ b/src/kernel/core/vm/Jamfile @@ -8,7 +8,6 @@ KernelMergeObject kernel_vm.o : vm_store_anonymous_noswap.c vm_store_device.c vm_store_null.c - vm_store_vnode.c vm_tests.c : -fno-pic -Wno-unused -D_KERNEL_MODE=1 diff --git a/src/kernel/core/vm/vm_store_vnode.c b/src/kernel/core/vm/vm_store_vnode.c deleted file mode 100755 index a03814cbf8..0000000000 --- a/src/kernel/core/vm/vm_store_vnode.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. -** Distributed under the terms of the NewOS License. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define STORE_DATA(x) ((struct vnode_store_data *)(x->data)) - -struct vnode_store_data { - void *vn; -}; - -static void vnode_destroy(struct vm_store *store) -{ - if(store) { - free(store); - } -} - -/* vnode_commit - * We're being asked to commit some memory, so record the - * fact here. - */ -static off_t vnode_commit(struct vm_store *store, off_t size) -{ - store->committed_size = size; - return size; -} - -static int vnode_has_page(struct vm_store *store, off_t offset) -{ - return 1; // we always have the page, man -} - -static ssize_t vnode_read(struct vm_store *store, off_t offset, iovecs *vecs) -{ - return vfs_read_page(STORE_DATA(store)->vn, vecs, offset); -} - -static ssize_t vnode_write(struct vm_store *store, off_t offset, iovecs *vecs) -{ - return vfs_write_page(STORE_DATA(store)->vn, vecs, offset); -} - -/* unused -static int vnode_fault(struct vm_store *store, struct vm_address_space *aspace, off_t offset) -{ - return 0; -} -*/ - -static void vnode_acquire_ref(struct vm_store *store) -{ - vfs_vnode_acquire_ref(STORE_DATA(store)->vn); -} - -static void vnode_release_ref(struct vm_store *store) -{ - vfs_vnode_release_ref(STORE_DATA(store)->vn); -} - -static vm_store_ops vnode_ops = { - &vnode_destroy, - &vnode_commit, - &vnode_has_page, - &vnode_read, - &vnode_write, - NULL, - &vnode_acquire_ref, - &vnode_release_ref -}; - -vm_store *vm_store_create_vnode(void *vnode) -{ - vm_store *store; - struct vnode_store_data *d; - - store = malloc(sizeof(vm_store) + sizeof(struct vnode_store_data)); - if(store == NULL) { - vfs_put_vnode_ptr(vnode); - return NULL; - } - - store->ops = &vnode_ops; - store->cache = NULL; - store->data = (void *)((addr)store + sizeof(vm_store)); - store->committed_size = 0; - - d = (struct vnode_store_data *)store->data; - d->vn = vnode; - - return store; -} -