Remove and delete the VNode in _WriteVNode()/RemoveVNode() after the client FS
is done with it, since we still need to serve file cache requests. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29587 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -254,6 +254,33 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// VNodeRemover
|
||||||
|
class Volume::VNodeRemover {
|
||||||
|
public:
|
||||||
|
VNodeRemover(Volume* volume, VNode* node)
|
||||||
|
:
|
||||||
|
fVolume(volume),
|
||||||
|
fNode(node)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
~VNodeRemover()
|
||||||
|
{
|
||||||
|
if (fNode != NULL) {
|
||||||
|
MutexLocker locker(fVolume->fLock);
|
||||||
|
fVolume->fVNodes->Remove(fNode);
|
||||||
|
locker.Unlock();
|
||||||
|
|
||||||
|
fNode->Delete(fVolume);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Volume* fVolume;
|
||||||
|
VNode* fNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
Volume::Volume(FileSystem* fileSystem, fs_volume* fsVolume)
|
Volume::Volume(FileSystem* fileSystem, fs_volume* fsVolume)
|
||||||
:
|
:
|
||||||
@@ -1062,13 +1089,12 @@ Volume::RemoveVNode(void* _node, bool reenter)
|
|||||||
{
|
{
|
||||||
VNode* vnode = (VNode*)_node;
|
VNode* vnode = (VNode*)_node;
|
||||||
|
|
||||||
// at any rate remove the vnode from our map and delete it
|
// At any rate remove the vnode from our map and delete it. We don't do that
|
||||||
MutexLocker locker(fLock);
|
// right now, though, since we might still need to serve file cache requests
|
||||||
fVNodes->Remove(vnode);
|
// from the client FS.
|
||||||
locker.Unlock();
|
VNodeRemover nodeRemover(this, vnode);
|
||||||
|
|
||||||
void* clientNode = vnode->clientNode;
|
void* clientNode = vnode->clientNode;
|
||||||
vnode->Delete(this);
|
|
||||||
|
|
||||||
// get a free port
|
// get a free port
|
||||||
RequestPort* port = fFileSystem->GetPortPool()->AcquirePort();
|
RequestPort* port = fFileSystem->GetPortPool()->AcquirePort();
|
||||||
@@ -3731,13 +3757,12 @@ Volume::_WriteVNode(void* _node, bool reenter)
|
|||||||
{
|
{
|
||||||
VNode* vnode = (VNode*)_node;
|
VNode* vnode = (VNode*)_node;
|
||||||
|
|
||||||
// at any rate remove the vnode from our map and delete it
|
// At any rate remove the vnode from our map and delete it. We don't do that
|
||||||
MutexLocker locker(fLock);
|
// right now, though, since we might still need to serve file cache requests
|
||||||
fVNodes->Remove(vnode);
|
// from the client FS.
|
||||||
locker.Unlock();
|
VNodeRemover nodeRemover(this, vnode);
|
||||||
|
|
||||||
void* clientNode = vnode->clientNode;
|
void* clientNode = vnode->clientNode;
|
||||||
vnode->Delete(this);
|
|
||||||
|
|
||||||
// get a free port
|
// get a free port
|
||||||
RequestPort* port = fFileSystem->GetPortPool()->AcquirePort();
|
RequestPort* port = fFileSystem->GetPortPool()->AcquirePort();
|
||||||
|
|||||||
@@ -229,6 +229,8 @@ private:
|
|||||||
class AutoIncrementer;
|
class AutoIncrementer;
|
||||||
class IORequestRemover;
|
class IORequestRemover;
|
||||||
friend class IORequestRemover;
|
friend class IORequestRemover;
|
||||||
|
class VNodeRemover;
|
||||||
|
friend class VNodeRemover;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _InitVolumeOps();
|
void _InitVolumeOps();
|
||||||
|
|||||||
Reference in New Issue
Block a user