diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/sentry/fs/mount.go | 11 | ||||
-rw-r--r-- | pkg/sentry/fs/proc/mounts.go | 12 | ||||
-rw-r--r-- | pkg/tcpip/link/muxed/BUILD | 4 | ||||
-rw-r--r-- | pkg/tcpip/transport/raw/BUILD | 4 |
4 files changed, 15 insertions, 16 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{}), } diff --git a/pkg/sentry/fs/proc/mounts.go b/pkg/sentry/fs/proc/mounts.go index 37ed30724..b5e01301f 100644 --- a/pkg/sentry/fs/proc/mounts.go +++ b/pkg/sentry/fs/proc/mounts.go @@ -139,11 +139,7 @@ func (mif *mountInfoFile) ReadSeqFileData(ctx context.Context, handle seqfile.Se fmt.Fprintf(&buf, "- ") // (9) Filesystem type. - name := "none" - if m.Filesystem != nil { - name = m.Filesystem.Name() - } - fmt.Fprintf(&buf, "%s ", name) + fmt.Fprintf(&buf, "%s ", m.FilesystemType) // (10) Mount source: filesystem-specific information or "none". fmt.Fprintf(&buf, "none ") @@ -190,11 +186,7 @@ func (mf *mountsFile) ReadSeqFileData(ctx context.Context, handle seqfile.SeqHan if m.Flags.ReadOnly { opts = "ro" } - name := "none" - if m.Filesystem != nil { - name = m.Filesystem.Name() - } - fmt.Fprintf(&buf, "%s %s %s %s %d %d\n", "none", mountPath, name, opts, 0, 0) + fmt.Fprintf(&buf, "%s %s %s %s %d %d\n", "none", mountPath, m.FilesystemType, opts, 0, 0) }) return []seqfile.SeqData{{Buf: buf.Bytes(), Handle: (*mountsFile)(nil)}}, 0 diff --git a/pkg/tcpip/link/muxed/BUILD b/pkg/tcpip/link/muxed/BUILD index f991dca83..84cfae784 100644 --- a/pkg/tcpip/link/muxed/BUILD +++ b/pkg/tcpip/link/muxed/BUILD @@ -1,6 +1,8 @@ load("//tools/go_stateify:defs.bzl", "go_library", "go_test") -package(licenses = ["notice"]) # Apache 2.0 +package( + licenses = ["notice"], # Apache 2.0 +) go_library( name = "muxed", diff --git a/pkg/tcpip/transport/raw/BUILD b/pkg/tcpip/transport/raw/BUILD index 52f6b9759..6d3f0130e 100644 --- a/pkg/tcpip/transport/raw/BUILD +++ b/pkg/tcpip/transport/raw/BUILD @@ -1,4 +1,6 @@ -package(licenses = ["notice"]) # Apache 2.0 +package( + licenses = ["notice"], # Apache 2.0 +) load("//tools/go_generics:defs.bzl", "go_template_instance") load("//tools/go_stateify:defs.bzl", "go_library") |