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

@@ -3,10 +3,11 @@ package mount
import (
"context"
"fmt"
"io"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"io"
)
func (fh *FileHandle) lockForRead(startOffset int64, size int) {
@@ -25,9 +26,6 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) {
fileFullPath := fh.FullPath()
fh.entryLock.Lock()
defer fh.entryLock.Unlock()
entry := fh.entry
if entry == nil {
return 0, io.EOF