mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 15:28:58 +01:00
fat, exfat: Add acquire_vnode/put_vnode calls in the I/O hooks.
Same as was done in BFS.
This commit is contained in:
parent
9708b08060
commit
fe0e833f1f
@ -71,6 +71,7 @@ iterative_io_finished_hook(void* cookie, io_request* request, status_t status,
|
|||||||
{
|
{
|
||||||
Inode* inode = (Inode*)cookie;
|
Inode* inode = (Inode*)cookie;
|
||||||
rw_lock_read_unlock(inode->Lock());
|
rw_lock_read_unlock(inode->Lock());
|
||||||
|
put_vnode(inode->GetVolume()->FSVolume(), inode->ID());
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,6 +329,8 @@ exfat_io(fs_volume* _volume, fs_vnode* _node, void* _cookie,
|
|||||||
// We lock the node here and will unlock it in the "finished" hook.
|
// We lock the node here and will unlock it in the "finished" hook.
|
||||||
rw_lock_read_lock(inode->Lock());
|
rw_lock_read_lock(inode->Lock());
|
||||||
|
|
||||||
|
acquire_vnode(_volume, inode->ID());
|
||||||
|
|
||||||
return do_iterative_fd_io(volume->Device(), request,
|
return do_iterative_fd_io(volume->Device(), request,
|
||||||
iterative_io_get_vecs_hook, iterative_io_finished_hook, inode);
|
iterative_io_get_vecs_hook, iterative_io_finished_hook, inode);
|
||||||
}
|
}
|
||||||
|
@ -1031,6 +1031,7 @@ dosfs_io(fs_volume* volume, fs_vnode* vnode, void* cookie, io_request* request)
|
|||||||
mount* bsdVolume = reinterpret_cast<mount*>(volume->private_volume);
|
mount* bsdVolume = reinterpret_cast<mount*>(volume->private_volume);
|
||||||
msdosfsmount* fatVolume = reinterpret_cast<msdosfsmount*>(bsdVolume->mnt_data);
|
msdosfsmount* fatVolume = reinterpret_cast<msdosfsmount*>(bsdVolume->mnt_data);
|
||||||
struct vnode* bsdNode = reinterpret_cast<struct vnode*>(vnode->private_node);
|
struct vnode* bsdNode = reinterpret_cast<struct vnode*>(vnode->private_node);
|
||||||
|
denode* fatNode = reinterpret_cast<denode*>(bsdNode->v_data);
|
||||||
|
|
||||||
#ifndef FS_SHELL
|
#ifndef FS_SHELL
|
||||||
if (io_request_is_write(request) && MOUNTED_READ_ONLY(fatVolume) != 0) {
|
if (io_request_is_write(request) && MOUNTED_READ_ONLY(fatVolume) != 0) {
|
||||||
@ -1053,6 +1054,8 @@ dosfs_io(fs_volume* volume, fs_vnode* vnode, void* cookie, io_request* request)
|
|||||||
|
|
||||||
rw_lock_read_lock(&bsdNode->v_vnlock->haikuRW);
|
rw_lock_read_lock(&bsdNode->v_vnlock->haikuRW);
|
||||||
|
|
||||||
|
acquire_vnode(volume, fatNode->de_inode);
|
||||||
|
|
||||||
RETURN_ERROR(do_iterative_fd_io(fatVolume->pm_dev->si_fd, request, iterative_io_get_vecs_hook,
|
RETURN_ERROR(do_iterative_fd_io(fatVolume->pm_dev->si_fd, request, iterative_io_get_vecs_hook,
|
||||||
iterative_io_finished_hook, bsdNode));
|
iterative_io_finished_hook, bsdNode));
|
||||||
}
|
}
|
||||||
@ -3870,8 +3873,10 @@ iterative_io_finished_hook(void* cookie, io_request* request, status_t status, b
|
|||||||
size_t bytesTransferred)
|
size_t bytesTransferred)
|
||||||
{
|
{
|
||||||
vnode* bsdNode = reinterpret_cast<vnode*>(cookie);
|
vnode* bsdNode = reinterpret_cast<vnode*>(cookie);
|
||||||
|
denode* fatNode = reinterpret_cast<denode*>(bsdNode->v_data);
|
||||||
|
|
||||||
rw_lock_read_unlock(&bsdNode->v_vnlock->haikuRW);
|
rw_lock_read_unlock(&bsdNode->v_vnlock->haikuRW);
|
||||||
|
put_vnode(bsdNode->v_mount->mnt_fsvolume, fatNode->de_inode);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user