Re-sync with internal repository
[hiphop-php.git] / third-party / watchman / src / eden / fs / inodes / overlay / overlay.thrift
blob42d4c50897d859832bad4a433682e75b32981960
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This software may be used and distributed according to the terms of the
5  * GNU General Public License version 2.
6  */
8 namespace cpp2 facebook.eden.overlay
9 namespace py facebook.eden.overlay
11 typedef binary Hash
12 typedef string PathComponent
13 typedef string RelativePath
15 // An entry can be in one of three states:
17 // 1. Non-materialized, unknown inode number
18 // 2. Non-materialized, known inode number
19 // 3. Materialized (inode number must be known)
21 // Eventually, once legacy data has been migrated, only states #2 and #3 will
22 // occur. All tree entries will be given an inode number upon allocation,
23 // regardless of whether the entry exists in the overlay.
25 struct OverlayEntry {
26   // Holds the mode_t data, which encodes the file type and permissions
27   // Note: eventually this data will be obsoleted by the InodeMetadata table.
28   1: i32 mode;
29   // The child's inode number.  Until legacy data is migrated, this may be zero
30   // or unset.  It should never be the case that hash is unset (indicating
31   // materialized) and inodeNumber is zero or unset.
32   2: i64 inodeNumber;
33   // If not materialized, then this child is identical to an existing
34   // source control Tree or Blob.  This contains the hash of that Tree or Blob.
35   // If materialized, the hash is either unset or has zero length.
36   3: optional Hash hash;
39 struct OverlayDir {
40   // The contents of this dir.
41   1: map<PathComponent, OverlayEntry> entries;