summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/mount.go
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2019-05-08 14:34:01 -0700
committerShentubot <shentubot@google.com>2019-05-08 14:35:06 -0700
commitbfd9f75ba4390de824d2c3d44c15bdca9dd0ff35 (patch)
tree8f5b2aca671216bb586e6d6bf2f463dc954a4746 /pkg/sentry/fs/mount.go
parentcbf6ab96970f29694ee4732f10c0515105b68449 (diff)
Set the FilesytemType in MountSource from the Filesystem.
And stop storing the Filesystem in the MountSource. This allows us to decouple the MountSource filesystem type from the name of the filesystem. PiperOrigin-RevId: 247292982 Change-Id: I49cbcce3c17883b7aa918ba76203dfd6d1b03cc8
Diffstat (limited to 'pkg/sentry/fs/mount.go')
-rw-r--r--pkg/sentry/fs/mount.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkg/sentry/fs/mount.go b/pkg/sentry/fs/mount.go
index a169ea4c9..9740f1fc6 100644
--- a/pkg/sentry/fs/mount.go
+++ b/pkg/sentry/fs/mount.go
@@ -110,9 +110,8 @@ type MountSource struct {
// MountSourceOperations defines filesystem specific behavior.
MountSourceOperations
- // Filesystem is the filesystem backing the mount. Can be nil if there
- // is no filesystem backing the mount.
- Filesystem Filesystem
+ // FilesystemType is the type of the filesystem backing this mount.
+ FilesystemType string
// Flags are the flags that this filesystem was mounted with.
Flags MountSourceFlags
@@ -158,10 +157,14 @@ const DefaultDirentCacheSize uint64 = 1000
// NewMountSource returns a new MountSource. Filesystem may be nil if there is no
// filesystem backing the mount.
func NewMountSource(mops MountSourceOperations, filesystem Filesystem, flags MountSourceFlags) *MountSource {
+ fsType := "none"
+ if filesystem != nil {
+ fsType = filesystem.Name()
+ }
return &MountSource{
MountSourceOperations: mops,
Flags: flags,
- Filesystem: filesystem,
+ FilesystemType: fsType,
fscache: NewDirentCache(DefaultDirentCacheSize),
children: make(map[*MountSource]struct{}),
}