[PATCH 06/14] Add parent inode number for directories
Zach Brown
zab at zabbo.net
Fri Feb 28 14:35:43 PST 2025
On Thu, Feb 27, 2025 at 03:16:15PM +0100, Valerie Aurora wrote:
> Add a parent inode field to the inode to give us back references for
> directories. For non-directories, this field is 0 and back references
> will go in a per-inode btree (TODO).
> @@ -91,6 +91,7 @@ struct ngnfs_inode {
> __le64 gen;
> __le64 size;
> __le64 version;
> + __le64 parent_ino; /* only valid for directories */
> __le32 nlink;
> __le32 uid;
> __le32 gid;
To be more specific, this is adding is a reference to a specific
instance of an inode. If we bit the bullet and introduced a persistent
inode/gen reference struct we could use it here.
The nice result of that is that we could return the target inode for
lookup of ".." without having to actually read the referenced parent
inode to get its gen. (As we'll see later.)
Maybe we make it something like:
struct ngnfs_ino_gen {
__le64 ino;
__le64 gen;
};
Too literal?
- z
More information about the ngnfs-devel
mailing list