nfs4: Do not create new Inode object when deleting a vnode

This commit is contained in:
Pawel Dziepak
2013-01-02 20:18:32 +01:00
parent 47e68f1c7a
commit 345a659337
2 changed files with 12 additions and 4 deletions
@@ -23,13 +23,14 @@ public:
inline void Lock();
inline void Unlock();
inline Inode* GetPointer() const;
Inode* Get();
void Replace(Inode* newInode);
inline void Remove();
inline void Clear();
inline ino_t ID();
inline ino_t ID() const;
private:
ino_t fID;
rw_lock fLock;
@@ -105,8 +106,15 @@ VnodeToInode::Clear()
}
inline Inode*
VnodeToInode::GetPointer() const
{
return fInode;
}
inline ino_t
VnodeToInode::ID()
VnodeToInode::ID() const
{
return fID;
}
@@ -339,10 +339,10 @@ nfs4_remove_vnode(fs_volume* volume, fs_vnode* vnode, bool reenter)
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu", volume, vti->ID());
if (fs->Root() == vti->Get())
if (fs->Root() == vti->GetPointer())
return B_OK;
ASSERT(vti->Get() == NULL);
ASSERT(vti->GetPointer() == NULL);
delete vti;
return B_OK;