diff options
| author | chrislu <chris.lu@gmail.com> | 2021-12-28 12:22:56 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2021-12-28 12:22:56 -0800 |
| commit | 0da2dfd640a3d915cbfbd9ecf10ebaee895855a3 (patch) | |
| tree | 28d1b6de11aa5323d638f30113643eb2e532670a /weed/filesys/file.go | |
| parent | 3fd4da34a4070371c43e18ac45b568cdb94a520e (diff) | |
| download | seaweedfs-0da2dfd640a3d915cbfbd9ecf10ebaee895855a3.tar.xz seaweedfs-0da2dfd640a3d915cbfbd9ecf10ebaee895855a3.zip | |
fuse: change to direct io mode
before and after:
chrislu$ time dd if=/dev/random of=/Users/chrislu/tmp/mm/testfile bs=131072 count=8192
8192+0 records in
8192+0 records out
1073741824 bytes transferred in 4.534068 secs (236816430 bytes/sec)
dd if=/dev/random of=/Users/chrislu/tmp/mm/testfile bs=131072 count=8192 0.01s user 3.86s system 84% cpu 4.561 total
chrislu$ time dd if=/dev/random of=/Users/chrislu/tmp/mm/testfile bs=131072 count=8192
8192+0 records in
8192+0 records out
1073741824 bytes transferred in 3.824072 secs (280784948 bytes/sec)
dd if=/dev/random of=/Users/chrislu/tmp/mm/testfile bs=131072 count=8192 0.01s user 3.22s system 83% cpu 3.857 total
Diffstat (limited to 'weed/filesys/file.go')
| -rw-r--r-- | weed/filesys/file.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/weed/filesys/file.go b/weed/filesys/file.go index bbc5c8e21..6cf52ba60 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -96,6 +96,7 @@ func (file *File) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error) { glog.V(4).Infof("file %v open %+v", file.fullpath(), req) + resp.Flags |= fuse.OpenDirectIO handle := file.wfs.AcquireHandle(file, req.Uid, req.Gid) |
