summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/ext/disklayout/inode.go
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2019-07-24 17:58:28 -0700
committergVisor bot <gvisor-bot@google.com>2019-07-24 17:59:57 -0700
commit417096f781c4fe74ff8a6db5c0fa0d46ba08e81d (patch)
tree709927e1455b973a47c9687db75843444c9b9939 /pkg/sentry/fs/ext/disklayout/inode.go
parent2ed832ff86ee29970d0a3991297de818bda67b9c (diff)
ext: Add tests for root directory inode.
PiperOrigin-RevId: 259856442
Diffstat (limited to 'pkg/sentry/fs/ext/disklayout/inode.go')
-rw-r--r--pkg/sentry/fs/ext/disklayout/inode.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/fs/ext/disklayout/inode.go b/pkg/sentry/fs/ext/disklayout/inode.go
index 9ab9a4988..88ae913f5 100644
--- a/pkg/sentry/fs/ext/disklayout/inode.go
+++ b/pkg/sentry/fs/ext/disklayout/inode.go
@@ -20,6 +20,12 @@ import (
"gvisor.dev/gvisor/pkg/sentry/kernel/time"
)
+// Special inodes. See https://www.kernel.org/doc/html/latest/filesystems/ext4/overview.html#special-inodes.
+const (
+ // RootDirInode is the inode number of the root directory inode.
+ RootDirInode = 2
+)
+
// The Inode interface must be implemented by structs representing ext inodes.
// The inode stores all the metadata pertaining to the file (except for the
// file name which is held by the directory entry). It does NOT expose all