summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs/vfs.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-12-30 19:49:38 +0000
committergVisor bot <gvisor-bot@google.com>2019-12-30 19:49:38 +0000
commitc1bd9a4168d31d1ad540cf37a1a0ad8a8f94c510 (patch)
tree04adcb2ff91876e34218df3f922dbdc696674763 /pkg/sentry/vfs/vfs.go
parent9c8909c933e58af2b9d20dc805b4d599317389d4 (diff)
parent1f384ac42b9ee8b52000dc2bff79d975853519ed (diff)
Merge release-20191213.0-56-g1f384ac (automated)
Diffstat (limited to 'pkg/sentry/vfs/vfs.go')
-rwxr-xr-xpkg/sentry/vfs/vfs.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/vfs/vfs.go b/pkg/sentry/vfs/vfs.go
index a3bdb5805..ea2db7031 100755
--- a/pkg/sentry/vfs/vfs.go
+++ b/pkg/sentry/vfs/vfs.go
@@ -75,6 +75,11 @@ type VirtualFilesystem struct {
// mountpoints is analogous to Linux's mountpoint_hashtable.
mountpoints map[*Dentry]map[*Mount]struct{}
+ // devices contains all registered Devices. devices is protected by
+ // devicesMu.
+ devicesMu sync.RWMutex
+ devices map[devTuple]*registeredDevice
+
// fsTypes contains all registered FilesystemTypes. fsTypes is protected by
// fsTypesMu.
fsTypesMu sync.RWMutex
@@ -90,6 +95,7 @@ type VirtualFilesystem struct {
func New() *VirtualFilesystem {
vfs := &VirtualFilesystem{
mountpoints: make(map[*Dentry]map[*Mount]struct{}),
+ devices: make(map[devTuple]*registeredDevice),
fsTypes: make(map[string]*registeredFilesystemType),
filesystems: make(map[*Filesystem]struct{}),
}