summaryrefslogtreecommitdiffhomepage
path: root/runsc
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2021-10-26 16:57:12 -0700
committergVisor bot <gvisor-bot@google.com>2021-10-26 17:00:07 -0700
commit7b8f19dc76a9fecbf4d2e5f43a47c6d47d53e100 (patch)
tree632c24c56d874298eb2cca543ec5e5aee01df30f /runsc
parentf54a25c1f03e705f2fb65be7389ddeb37bc5e64e (diff)
Simplify vfs.NewDisconnectedMount signature and callpoints.
vfs.NewDisconnectedMount has no error paths. Its much prettier without the error return value. Also simplify MountDisconnected which would immediately drop the refs taken by NewDisconnectedMount. Instead make it directly call newMount. PiperOrigin-RevId: 405767966
Diffstat (limited to 'runsc')
-rw-r--r--runsc/boot/loader.go6
-rw-r--r--runsc/boot/vfs.go5
2 files changed, 2 insertions, 9 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index dbb02fdf4..247f0d54a 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -411,11 +411,7 @@ func New(args Args) (*Loader, error) {
return nil, fmt.Errorf("failed to create hostfs filesystem: %w", err)
}
defer hostFilesystem.DecRef(k.SupervisorContext())
- hostMount, err := k.VFS().NewDisconnectedMount(hostFilesystem, nil, &vfs.MountOptions{})
- if err != nil {
- return nil, fmt.Errorf("failed to create hostfs mount: %w", err)
- }
- k.SetHostMount(hostMount)
+ k.SetHostMount(k.VFS().NewDisconnectedMount(hostFilesystem, nil, &vfs.MountOptions{}))
}
eid := execID{cid: args.ID}
diff --git a/runsc/boot/vfs.go b/runsc/boot/vfs.go
index 9f0d1ae36..4d0cfc94a 100644
--- a/runsc/boot/vfs.go
+++ b/runsc/boot/vfs.go
@@ -769,10 +769,7 @@ func (c *containerMounter) mountSharedSubmountVFS2(ctx context.Context, conf *co
if err != nil {
return nil, err
}
- newMnt, err := c.k.VFS().NewDisconnectedMount(source.vfsMount.Filesystem(), source.vfsMount.Root(), opts)
- if err != nil {
- return nil, err
- }
+ newMnt := c.k.VFS().NewDisconnectedMount(source.vfsMount.Filesystem(), source.vfsMount.Root(), opts)
defer newMnt.DecRef(ctx)
root := mns.Root()