From 417096f781c4fe74ff8a6db5c0fa0d46ba08e81d Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Wed, 24 Jul 2019 17:58:28 -0700 Subject: ext: Add tests for root directory inode. PiperOrigin-RevId: 259856442 --- pkg/sentry/fs/ext/disklayout/inode.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkg/sentry/fs/ext/disklayout') 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 -- cgit v1.2.3