inodes: shave 8 byte off of the size of InodeBase

Summary:
The structure had 2 padding of 4 bytes each due to the alignment requirement of
the EdenMount pointer and of the location_ field. Moving the EdenMount pointer
allows the padding to go away.

Reviewed By: fanzeyi

Differential Revision: D28476945

fbshipit-source-id: b521b4184d3924480ef54f840389156faab3988d
This commit is contained in:
Xavier Deguillard 2021-05-17 11:53:45 -07:00 committed by Facebook GitHub Bot
parent 4fb70336da
commit 13f9edb209
2 changed files with 10 additions and 10 deletions

View File

@ -26,8 +26,8 @@ namespace eden {
InodeBase::InodeBase(EdenMount* mount)
: ino_{kRootNodeId},
initialMode_{S_IFDIR | 0755},
mount_{mount},
initialMode_{S_IFDIR | 0755},
// The root inode always starts with an implicit reference from FUSE.
numFsReferences_{1},
location_{LocationInfo{
@ -49,8 +49,8 @@ InodeBase::InodeBase(
TreeInodePtr parent,
PathComponentPiece name)
: ino_{ino},
initialMode_{initialMode},
mount_{parent->mount_},
initialMode_{initialMode},
location_{LocationInfo{std::move(parent), name}} {
// Inode numbers generally shouldn't be 0.
// Older versions of glibc have bugs handling files with an inode number of 0

View File

@ -447,14 +447,6 @@ class InodeBase {
InodeNumber const ino_;
/**
* The initial mode bits specified when this inode was first created
* or instantiated from version control. Primarily used when lazily
* writing metadata into this inode's metadata storage. The type
* bits can never change - they can be accessed via getType().
*/
mode_t const initialMode_;
/**
* The EdenMount object that this inode belongs to.
*
@ -464,6 +456,14 @@ class InodeBase {
*/
EdenMount* const mount_;
/**
* The initial mode bits specified when this inode was first created
* or instantiated from version control. Primarily used when lazily
* writing metadata into this inode's metadata storage. The type
* bits can never change - they can be accessed via getType().
*/
mode_t const initialMode_;
/**
* A reference count tracking the outstanding lookups that the kernel's FUSE
* API has performed on this inode. We must remember this inode number