mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Change namespace cloning so that it clones mounts depth-first.
This saves on allocations. This change is a subset of the changes in cl/563529897 and cl/563752003. Committing this change in more discrete parts will help narrow down the causes of b/299603749. PiperOrigin-RevId: 565484026
This commit is contained in:
committed by
gVisor bot
parent
c0a9bb7b3a
commit
73f4b821a1
@@ -180,8 +180,8 @@ func (vfs *VirtualFilesystem) CloneMountNamespace(
|
||||
|
||||
queue := []cloneEntry{cloneEntry{ns.root, newns.root}}
|
||||
for len(queue) != 0 {
|
||||
p := queue[0]
|
||||
queue = queue[1:]
|
||||
p := queue[len(queue)-1]
|
||||
queue = queue[:len(queue)-1]
|
||||
for c := range p.prevMount.children {
|
||||
m := vfs.cloneMount(c, c.root, nil)
|
||||
vd := VirtualDentry{
|
||||
|
||||
Reference in New Issue
Block a user