ext2: access the parent variable once checked it's non null

* cleanup
* add some inode flags we don't use
This commit is contained in:
Jérôme Duval
2013-09-14 11:00:07 +02:00
parent aba841d810
commit 0ce7ab1ebe
2 changed files with 25 additions and 21 deletions
@@ -633,7 +633,8 @@ Inode::Create(Transaction& transaction, Inode* parent, const char* name,
inode->SetAccessTime(&timespec);
inode->SetCreationTime(&timespec);
inode->SetModificationTime(&timespec);
node.SetFlags(parent->Flags() & EXT2_INODE_INHERITED);
if (parent != NULL)
node.SetFlags(parent->Flags() & EXT2_INODE_INHERITED);
if (volume->HasExtentsFeature()
&& (inode->IsDirectory() || inode->IsFile())) {
node.SetFlag(EXT2_INODE_EXTENTS);
@@ -935,4 +936,3 @@ Inode::IncrementNumLinks(Transaction& transaction)
fVolume->ActivateDirNLink(transaction);
}
}
@@ -654,6 +654,10 @@ struct ext2_inode {
#define EXT2_INODE_DIR_SYNCH 0x00010000
#define EXT2_INODE_HUGE_FILE 0x00040000
#define EXT2_INODE_EXTENTS 0x00080000
#define EXT2_INODE_LARGE_EA 0x00200000
#define EXT2_INODE_EOF_BLOCKS 0x00400000
#define EXT2_INODE_INLINE_DATA 0x10000000
#define EXT2_INODE_RESERVED 0x80000000
#define EXT2_INODE_INHERITED (EXT2_INODE_SECURE_DELETION | EXT2_INODE_UNDELETE \
| EXT2_INODE_COMPRESSED | EXT2_INODE_SYNCHRONOUS | EXT2_INODE_IMMUTABLE \