summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs/anonfs.go
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2020-03-27 16:53:28 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-27 16:56:16 -0700
commit10f2c8db915df14102e3f4d9efcfce372c90707a (patch)
tree04fd485ab80b8d0a49d2e241fe153afc8e56ec48 /pkg/sentry/vfs/anonfs.go
parent2a4aff7f7ea62e4aae1b175262b68a8212826176 (diff)
Add FilesystemType.Name method, and FilesystemType field to Filesystem struct.
Both have analogues in Linux: * struct file_system_type has a char *name field. * struct super_block keeps a pointer to the file_system_type. These fields are necessary to support the `filesystem type` field in /proc/[pid]/mountinfo. PiperOrigin-RevId: 303434063
Diffstat (limited to 'pkg/sentry/vfs/anonfs.go')
-rw-r--r--pkg/sentry/vfs/anonfs.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/sentry/vfs/anonfs.go b/pkg/sentry/vfs/anonfs.go
index f58867066..d1f6dfb45 100644
--- a/pkg/sentry/vfs/anonfs.go
+++ b/pkg/sentry/vfs/anonfs.go
@@ -51,6 +51,19 @@ const (
anonFileGID = auth.RootKGID
)
+// anonFilesystemType implements FilesystemType.
+type anonFilesystemType struct{}
+
+// GetFilesystem implements FilesystemType.GetFilesystem.
+func (anonFilesystemType) GetFilesystem(context.Context, *VirtualFilesystem, *auth.Credentials, string, GetFilesystemOptions) (*Filesystem, *Dentry, error) {
+ panic("cannot instaniate an anon filesystem")
+}
+
+// Name implemenents FilesystemType.Name.
+func (anonFilesystemType) Name() string {
+ return "none"
+}
+
// anonFilesystem is the implementation of FilesystemImpl that backs
// VirtualDentries returned by VirtualFilesystem.NewAnonVirtualDentry().
//