Renamed vfs_vnode_acquire_ref() to vnode_acquire_vnode().

Removed vfs_vnode_release_ref(), as vfs_put_vnode() already does the same thing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13867 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-08-01 14:32:23 +00:00
parent 186857529e
commit b72cf2601f
5 changed files with 15 additions and 21 deletions

View File

@ -70,8 +70,7 @@ status_t vfs_get_vnode_from_path(const char *path, bool kernel, void **vnode);
status_t vfs_get_vnode(mount_id mountID, vnode_id vnodeID, void **_vnode);
status_t vfs_lookup_vnode(mount_id mountID, vnode_id vnodeID, void **_vnode);
void vfs_put_vnode(void *vnode);
void vfs_vnode_acquire_ref(void *vnode);
void vfs_vnode_release_ref(void *vnode);
void vfs_acquire_vnode(void *vnode);
status_t vfs_get_cookie_from_fd(int fd, void **_cookie);
bool vfs_can_page(void *vnode, void *cookie);
status_t vfs_read_pages(void *vnode, void *cookie, off_t pos, const iovec *vecs, size_t count, size_t *_numBytes);

View File

@ -615,7 +615,7 @@ cache_prefetch_vnode(void *vnode, off_t offset, size_t size)
{
vm_cache_ref *cache;
if (vfs_get_vnode_cache(vnode, &cache) != B_OK) {
vfs_vnode_release_ref(vnode);
vfs_put_vnode(vnode);
return;
}
@ -685,7 +685,7 @@ cache_prefetch(mount_id mountID, vnode_id vnodeID, off_t offset, size_t size)
return;
cache_prefetch_vnode(vnode, offset, size);
vfs_vnode_release_ref(vnode);
vfs_put_vnode(vnode);
}
@ -776,9 +776,9 @@ file_cache_create(mount_id mountID, vnode_id vnodeID, off_t size, int fd)
return ref;
err3:
vfs_vnode_release_ref(ref->vnode);
vfs_put_vnode(ref->vnode);
err2:
vfs_vnode_release_ref(ref->device);
vfs_put_vnode(ref->device);
err1:
delete ref;
return NULL;
@ -795,7 +795,7 @@ file_cache_delete(void *_cacheRef)
TRACE(("file_cache_delete(ref = %p)\n", ref));
vfs_vnode_release_ref(ref->device);
vfs_put_vnode(ref->device);
delete ref;
}

View File

@ -81,7 +81,7 @@ static void
store_acquire_ref(struct vm_store *_store)
{
vnode_store *store = (vnode_store *)_store;
vfs_vnode_acquire_ref(store->vnode);
vfs_acquire_vnode(store->vnode);
}
@ -89,7 +89,7 @@ static void
store_release_ref(struct vm_store *_store)
{
vnode_store *store = (vnode_store *)_store;
vfs_vnode_release_ref(store->vnode);
vfs_put_vnode(store->vnode);
}
@ -113,7 +113,7 @@ vm_create_vnode_store(void *vnode)
{
vnode_store *store = (vnode_store *)malloc(sizeof(struct vnode_store));
if (store == NULL) {
vfs_vnode_release_ref(vnode);
vfs_put_vnode(vnode);
return NULL;
}

View File

@ -2112,19 +2112,14 @@ unremove_vnode(mount_id mountID, vnode_id vnodeID)
// Functions the VFS exports for other parts of the kernel
void
vfs_vnode_acquire_ref(void *vnode)
{
FUNCTION(("vfs_vnode_acquire_ref: vnode 0x%p\n", vnode));
inc_vnode_ref_count((struct vnode *)vnode);
}
/** Acquires another reference to the vnode that has to be released
* by calling vfs_put_vnode().
*/
void
vfs_vnode_release_ref(void *vnode)
vfs_acquire_vnode(void *_vnode)
{
FUNCTION(("vfs_vnode_release_ref: vnode 0x%p\n", vnode));
dec_vnode_ref_count((struct vnode *)vnode, false);
inc_vnode_ref_count((struct vnode *)_vnode);
}

View File

@ -1118,7 +1118,7 @@ _vm_map_file(aspace_id aid, const char *name, void **_address, uint32 addressSpe
return area->id;
err2:
vfs_vnode_release_ref(vnode);
vfs_put_vnode(vnode);
err1:
vm_put_aspace(aspace);
return status;