sapling/eden/fs/inodes/overlay.thrift
Chad Austin c80f10ad03 decouple whether an entry has an inode number from materialization status
Summary:
Decouple inode number assignment from materialization status.
The idea is that we will always assign entries an inode number and
track whether an entry is materialized otherwise.  This is necessary
to give consistent inode values across remounts.

Reviewed By: simpkins

Differential Revision: D7052470

fbshipit-source-id: 80d3f2a2938463198a3132182537e6223c79d509
2018-03-23 18:21:21 -07:00

36 lines
1.3 KiB
Thrift

namespace cpp2 facebook.eden.overlay
namespace py facebook.eden.overlay
typedef binary Hash
typedef string PathComponent
typedef string RelativePath
// An entry can be in one of three states:
//
// 1. Non-materialized, unknown inode number
// 2. Non-materialized, known inode number
// 3. Materialized (inode number must be known)
//
// Eventually, once legacy data has been migrated, only states #2 and #3 will
// occur. All tree entries will be given an inode number upon allocation,
// regardless of whether the entry exists in the overlay.
struct OverlayEntry {
// Holds the mode_t data, which encodes the file type and permissions
// Note: eventually this data will be obsoleted by the InodeMetadata table.
1: i32 mode
// The child's inode number. Until legacy data is migrated, this may be zero
// or unset. It should never be the case that hash is unset (indicating
// materialized) and inodeNumber is zero or unset.
2: i64 inodeNumber
// If not materialized, then this child is identical to an existing
// source control Tree or Blob. This contains the hash of that Tree or Blob.
// If materialized, the hash is either unset or has zero length.
3: optional Hash hash
}
struct OverlayDir {
// The contents of this dir.
1: map<PathComponent, OverlayEntry> entries
}