diff options
author | Andrei Vagin <avagin@google.com> | 2020-09-15 13:51:18 -0700 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-16 12:22:17 -0700 |
commit | 3ea925a423ed2c195498fac63b200b8a1a302f4c (patch) | |
tree | 20ece161b081f74a486079cfd5df7f063eb938ce /pkg/sentry | |
parent | 92a020c798fe237fb7038f3da71f24c5a88bb744 (diff) |
fuse: don't pass lock by value
copylocks: directory.go:34:7: Allocate passes lock by value:
fuse/fuse.directoryFD contains fuse/fuse.fileDescription contains
pkg/sentry/vfs/vfs.FileDescription contains pkg/sync/sync.Mutex
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/fsimpl/fuse/directory.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/sentry/fsimpl/fuse/directory.go b/pkg/sentry/fsimpl/fuse/directory.go index 798c4a6f3..ee77dbaa3 100644 --- a/pkg/sentry/fsimpl/fuse/directory.go +++ b/pkg/sentry/fsimpl/fuse/directory.go @@ -31,27 +31,27 @@ type directoryFD struct { } // Allocate implements directoryFD.Allocate. -func (directoryFD) Allocate(ctx context.Context, mode, offset, length uint64) error { +func (*directoryFD) Allocate(ctx context.Context, mode, offset, length uint64) error { return syserror.EISDIR } // PRead implements FileDescriptionImpl.PRead. -func (directoryFD) PRead(ctx context.Context, dst usermem.IOSequence, offset int64, opts vfs.ReadOptions) (int64, error) { +func (*directoryFD) PRead(ctx context.Context, dst usermem.IOSequence, offset int64, opts vfs.ReadOptions) (int64, error) { return 0, syserror.EISDIR } // Read implements FileDescriptionImpl.Read. -func (directoryFD) Read(ctx context.Context, dst usermem.IOSequence, opts vfs.ReadOptions) (int64, error) { +func (*directoryFD) Read(ctx context.Context, dst usermem.IOSequence, opts vfs.ReadOptions) (int64, error) { return 0, syserror.EISDIR } // PWrite implements FileDescriptionImpl.PWrite. -func (directoryFD) PWrite(ctx context.Context, src usermem.IOSequence, offset int64, opts vfs.WriteOptions) (int64, error) { +func (*directoryFD) PWrite(ctx context.Context, src usermem.IOSequence, offset int64, opts vfs.WriteOptions) (int64, error) { return 0, syserror.EISDIR } // Write implements FileDescriptionImpl.Write. -func (directoryFD) Write(ctx context.Context, src usermem.IOSequence, opts vfs.WriteOptions) (int64, error) { +func (*directoryFD) Write(ctx context.Context, src usermem.IOSequence, opts vfs.WriteOptions) (int64, error) { return 0, syserror.EISDIR } |