Implement copy_file_range syscall in FUSE (#3475)

See the man page of copy_file_range:
https://man7.org/linux/man-pages/man2/copy_file_range.2.html
This commit is contained in:
Patrick Schmidt
2022-08-22 02:11:43 +02:00
committed by GitHub
parent fef9c6a520
commit 3a75d7f7aa
4 changed files with 129 additions and 22 deletions

View File

@@ -1,9 +1,11 @@
package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"io"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
)
/**
@@ -37,6 +39,9 @@ func (wfs *WFS) Read(cancel <-chan struct{}, in *fuse.ReadIn, buff []byte) (fuse
return nil, fuse.ENOENT
}
fh.entryLock.Lock()
defer fh.entryLock.Unlock()
offset := int64(in.Offset)
fh.lockForRead(offset, len(buff))
defer fh.unlockForRead(offset, len(buff))