From 3ea925a423ed2c195498fac63b200b8a1a302f4c Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Tue, 15 Sep 2020 13:51:18 -0700 Subject: 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 --- pkg/sentry/fsimpl/fuse/directory.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg') 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 } -- cgit v1.2.3