nfs4: minor improvements in VnodeToInode code * removal of now unnecessary NULL check * Clear() is Replace(NULL)

This commit is contained in:
Pawel Dziepak
2013-04-04 15:11:16 +02:00
parent 5f0e4e4a81
commit 46bffd5839
2 changed files with 3 additions and 6 deletions
@@ -27,7 +27,7 @@ void
VnodeToInode::Replace(Inode* newInode)
{
WriteLocker _(fLock);
if (fInode != NULL && !IsRoot())
if (!IsRoot())
delete fInode;
fInode = newInode;
@@ -72,7 +72,7 @@ VnodeToInode::VnodeToInode(ino_t id, FileSystem* fileSystem)
inline
VnodeToInode::~VnodeToInode()
{
Replace(NULL);
Clear();
if (fFileSystem != NULL && !IsRoot())
fFileSystem->InoIdMap()->RemoveEntry(fID);
rw_lock_destroy(&fLock);
@@ -96,10 +96,7 @@ VnodeToInode::Unlock()
inline void
VnodeToInode::Clear()
{
WriteLocker _(fLock);
if (!IsRoot())
delete fInode;
fInode = NULL;
Replace(NULL);
}