Added handy function volume_for_vnode() which returns the fs_volume for

a given given fs_vnode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26669 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-07-28 23:33:49 +00:00
parent db191ade9a
commit 7df40c23f6
2 changed files with 12 additions and 0 deletions

View File

@ -313,6 +313,7 @@ extern status_t remove_vnode(fs_volume *volume, ino_t vnodeID);
extern status_t unremove_vnode(fs_volume *volume, ino_t vnodeID);
extern status_t get_vnode_removed(fs_volume *volume, ino_t vnodeID,
bool *removed);
extern fs_volume* volume_for_vnode(fs_vnode *vnode);
extern status_t read_pages(int fd, off_t pos, const struct iovec *vecs,
size_t count, size_t *_numBytes);

View File

@ -3280,6 +3280,17 @@ get_vnode_removed(fs_volume *volume, ino_t vnodeID, bool* removed)
}
extern "C" fs_volume*
volume_for_vnode(fs_vnode *_vnode)
{
if (_vnode == NULL)
return NULL;
struct vnode* vnode = static_cast<struct vnode*>(_vnode);
return vnode->mount->volume;
}
extern "C" status_t
read_pages(int fd, off_t pos, const iovec *vecs, size_t count,
size_t *_numBytes)