Skip to content

Commit 6bd0880

Browse files
tranji-cloudgvisor-bot
authored andcommitted
Hard links Support Phase 1: Gofer Client dentry/inode refactor
- **Decoupled dentry and inode**: Cleanly separated dentry fields from the file's actual metadata (permissions, size, etc.), now residing in the inode. - **Dentry now holds inode pointer**: The dentry struct embeds a pointer to the shared inode, reflecting the many-to-one relationship of hard links. - **impl logic moved to inode**: The backend-specific logic (LISA FS vs. Direct FS) is no longer part of the dentry struct. Instead, the inode struct is extended to handle these implementations. - **Refactored Gofer client fs**: Updated the Gofer client filesystem logic to work with the new dentry -> inode pointer structure. - **Renamed files**: dentry_impl.go becomes inode_impl.go, and {directfs/lisafs}_dentry.go are now {directfs/lisafs}_inode.go to match the new design. - **Disabled Save/Restore in link::IsSameFile**: Disabled save/restore in this specific check due to complexities in maintaining inode consistency across save/restore cycles. See comment in link.cc:45 for details. - **New Link Tests**: - HardLinkChangeMode: Verifies hard link behavior, including mode changes across save/restore. PiperOrigin-RevId: 750748327
1 parent a9049fb commit 6bd0880

20 files changed

+2077
-1895
lines changed

pkg/sentry/fsimpl/gofer/BUILD

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ package(default_applicable_licenses = ["//:license"])
55

66
licenses(["notice"])
77

8+
go_template_instance(
9+
name = "inode_refs",
10+
out = "inode_refs.go",
11+
package = "gofer",
12+
prefix = "inode",
13+
template = "//pkg/refs:refs_template",
14+
types = {
15+
"T": "inode",
16+
},
17+
)
18+
819
go_template_instance(
920
name = "string_list",
1021
out = "string_list.go",
@@ -56,16 +67,17 @@ go_template_instance(
5667
go_library(
5768
name = "gofer",
5869
srcs = [
59-
"dentry_impl.go",
6070
"dentry_list.go",
61-
"directfs_dentry.go",
71+
"directfs_inode.go",
6272
"directory.go",
6373
"filesystem.go",
6474
"fstree.go",
6575
"gofer.go",
6676
"handle.go",
6777
"host_named_pipe.go",
68-
"lisafs_dentry.go",
78+
"inode_impl.go",
79+
"inode_refs.go",
80+
"lisafs_inode.go",
6981
"regular_file.go",
7082
"revalidate.go",
7183
"save_restore.go",

0 commit comments

Comments
 (0)