* struct vnode is an opaque type now, removed void* where it was used incorrectly.
* Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22461 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+7
-8
@@ -62,8 +62,8 @@ struct file_map {
|
||||
|
||||
struct file_cache_ref {
|
||||
vm_cache *cache;
|
||||
void *vnode;
|
||||
void *device;
|
||||
struct vnode *vnode;
|
||||
struct vnode *device;
|
||||
void *cookie;
|
||||
file_map map;
|
||||
};
|
||||
@@ -1063,7 +1063,7 @@ file_cache_control(const char *subsystem, uint32 function, void *buffer,
|
||||
|
||||
|
||||
extern "C" void
|
||||
cache_prefetch_vnode(void *vnode, off_t offset, size_t size)
|
||||
cache_prefetch_vnode(struct vnode *vnode, off_t offset, size_t size)
|
||||
{
|
||||
vm_cache *cache;
|
||||
if (vfs_get_vnode_cache(vnode, &cache, false) != B_OK)
|
||||
@@ -1137,13 +1137,12 @@ out:
|
||||
extern "C" void
|
||||
cache_prefetch(dev_t mountID, ino_t vnodeID, off_t offset, size_t size)
|
||||
{
|
||||
void *vnode;
|
||||
|
||||
// ToDo: schedule prefetch
|
||||
|
||||
TRACE(("cache_prefetch(vnode %ld:%Ld)\n", mountID, vnodeID));
|
||||
|
||||
// get the vnode for the object, this also grabs a ref to it
|
||||
struct vnode *vnode;
|
||||
if (vfs_get_vnode(mountID, vnodeID, &vnode) != B_OK)
|
||||
return;
|
||||
|
||||
@@ -1153,8 +1152,8 @@ cache_prefetch(dev_t mountID, ino_t vnodeID, off_t offset, size_t size)
|
||||
|
||||
|
||||
extern "C" void
|
||||
cache_node_opened(void *vnode, int32 fdType, vm_cache *cache, dev_t mountID,
|
||||
ino_t parentID, ino_t vnodeID, const char *name)
|
||||
cache_node_opened(struct vnode *vnode, int32 fdType, vm_cache *cache,
|
||||
dev_t mountID, ino_t parentID, ino_t vnodeID, const char *name)
|
||||
{
|
||||
if (sCacheModule == NULL || sCacheModule->node_opened == NULL)
|
||||
return;
|
||||
@@ -1173,7 +1172,7 @@ cache_node_opened(void *vnode, int32 fdType, vm_cache *cache, dev_t mountID,
|
||||
|
||||
|
||||
extern "C" void
|
||||
cache_node_closed(void *vnode, int32 fdType, vm_cache *cache,
|
||||
cache_node_closed(struct vnode *vnode, int32 fdType, vm_cache *cache,
|
||||
dev_t mountID, ino_t vnodeID)
|
||||
{
|
||||
if (sCacheModule == NULL || sCacheModule->node_closed == NULL)
|
||||
|
||||
@@ -1193,20 +1193,19 @@ load_kernel_add_on(const char *path)
|
||||
struct Elf32_Ehdr *elfHeader;
|
||||
struct elf_image_info *image;
|
||||
const char *fileName;
|
||||
void *vnode = NULL;
|
||||
void *reservedAddress;
|
||||
addr_t start;
|
||||
size_t reservedSize;
|
||||
status_t status;
|
||||
int fd;
|
||||
ssize_t length;
|
||||
|
||||
TRACE(("elf_load_kspace: entry path '%s'\n", path));
|
||||
|
||||
fd = _kern_open(-1, path, O_RDONLY, 0);
|
||||
int fd = _kern_open(-1, path, O_RDONLY, 0);
|
||||
if (fd < 0)
|
||||
return fd;
|
||||
|
||||
struct vnode *vnode;
|
||||
status = vfs_get_vnode_from_fd(fd, true, &vnode);
|
||||
if (status < B_OK)
|
||||
goto error0;
|
||||
|
||||
+409
-458
File diff suppressed because it is too large
Load Diff
@@ -1812,11 +1812,6 @@ _vm_map_file(team_id team, const char *name, void **_address, uint32 addressSpec
|
||||
size_t size, uint32 protection, uint32 mapping, const char *path,
|
||||
off_t offset, bool kernel)
|
||||
{
|
||||
vm_cache *cache;
|
||||
vm_area *area;
|
||||
void *vnode;
|
||||
status_t status;
|
||||
|
||||
// ToDo: maybe attach to an FD, not a path (or both, like VFS calls)
|
||||
// ToDo: check file access permissions (would be already done if the above were true)
|
||||
// ToDo: for binary files, we want to make sure that they get the
|
||||
@@ -1830,7 +1825,8 @@ _vm_map_file(team_id team, const char *name, void **_address, uint32 addressSpec
|
||||
size = PAGE_ALIGN(size);
|
||||
|
||||
// get the vnode for the object, this also grabs a ref to it
|
||||
status = vfs_get_vnode_from_path(path, kernel, &vnode);
|
||||
struct vnode *vnode;
|
||||
status_t status = vfs_get_vnode_from_path(path, kernel, &vnode);
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
|
||||
@@ -1841,6 +1837,7 @@ _vm_map_file(team_id team, const char *name, void **_address, uint32 addressSpec
|
||||
}
|
||||
|
||||
// ToDo: this only works for file systems that use the file cache
|
||||
vm_cache *cache;
|
||||
status = vfs_get_vnode_cache(vnode, &cache, false);
|
||||
if (status < B_OK) {
|
||||
vfs_put_vnode(vnode);
|
||||
@@ -1849,6 +1846,7 @@ _vm_map_file(team_id team, const char *name, void **_address, uint32 addressSpec
|
||||
|
||||
mutex_lock(&cache->lock);
|
||||
|
||||
vm_area *area;
|
||||
status = map_backing_store(locker.AddressSpace(), cache, _address,
|
||||
offset, size, addressSpec, 0, protection, mapping, &area, name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user