Browse Source
Enable writeback_cache and async_dio FUSE options (#7980 )
* Enable writeback_cache and async_dio FUSE options
Fixes #7978
- Update mount_std.go to use EnableWriteback and EnableAsyncDio from go-fuse
- Add go.mod replace directive to use local go-fuse with capability support
- Remove temporary workaround that disabled these options
This enables proper FUSE kernel capability negotiation for writeback cache
and async direct I/O, improving performance for small writes and concurrent
direct I/O operations.
* Address PR review comments
- Remove redundant nil checks for writebackCache and asyncDio flags
- Update go.mod replace directive to use seaweedfs/go-fuse fork instead of local path
* Add TODO comment for go.mod replace directive
The replace directive must use a local path until seaweedfs/go-fuse#1 is merged.
After merge, this should be updated to use the proper version.
* Use seaweedfs/go-fuse v2.9.0 instead of local repository
Replace local path with seaweedfs/go-fuse v2.9.0 fork which includes
the writeback_cache and async_dio capability support.
* Use github.com/seaweedfs/go-fuse/v2 directly without replace directive
- Updated all imports to use github.com/seaweedfs/go-fuse/v2
- Removed replace directive from go.mod
- Using seaweedfs/go-fuse v2.0.0-20260106181308-87f90219ce09 which includes:
* writeback_cache and async_dio support
* Corrected module path
* Update to seaweedfs/go-fuse v2.9.1
Use v2.9.1 tag which includes the corrected module path
(github.com/seaweedfs/go-fuse/v2) along with writeback_cache
and async_dio support.
pull/7875/head
Chris Lu
4 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with
34 additions and
38 deletions
go.mod
go.sum
weed/command/mount_std.go
weed/mount/error_classifier.go
weed/mount/inode_to_path.go
weed/mount/weedfs.go
weed/mount/weedfs_attr.go
weed/mount/weedfs_attr_darwin.go
weed/mount/weedfs_attr_freebsd.go
weed/mount/weedfs_attr_linux.go
weed/mount/weedfs_dir_lookup.go
weed/mount/weedfs_dir_mkrm.go
weed/mount/weedfs_dir_read.go
weed/mount/weedfs_file_copy_range.go
weed/mount/weedfs_file_io.go
weed/mount/weedfs_file_lseek.go
weed/mount/weedfs_file_mkrm.go
weed/mount/weedfs_file_read.go
weed/mount/weedfs_file_sync.go
weed/mount/weedfs_file_write.go
weed/mount/weedfs_filehandle.go
weed/mount/weedfs_link.go
weed/mount/weedfs_rename.go
weed/mount/weedfs_stats.go
weed/mount/weedfs_symlink.go
weed/mount/weedfs_unsupported.go
weed/mount/weedfs_xattr.go
weed/mount/weedfs_xattr_freebsd.go
weed/mount/wfs_save.go
@ -135,7 +135,6 @@ require (
github . com / gin - gonic / gin v1 . 11.0
github . com / golang - jwt / jwt / v5 v5 . 3.0
github . com / google / flatbuffers / go v0 . 0.0 - 20230108230133 - 3 b8644d32c50
github . com / hanwen / go - fuse / v2 v2 . 9.0
github . com / hashicorp / raft v1 . 7.3
github . com / hashicorp / raft - boltdb / v2 v2 . 3.1
github . com / hashicorp / vault / api v1 . 22.0
@ -152,6 +151,7 @@ require (
github . com / rdleal / intervalst v1 . 5.0
github . com / redis / go - redis / v9 v9 . 17.2
github . com / schollz / progressbar / v3 v3 . 19.0
github . com / seaweedfs / go - fuse / v2 v2 . 9.1
github . com / shirou / gopsutil / v4 v4 . 25.11
github . com / tarantool / go - tarantool / v2 v2 . 4.1
github . com / tikv / client - go / v2 v2 . 0.7
@ -1187,8 +1187,6 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 h1:X5VWvz21y3gzm9Nw/kaUeku/1+u
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1/go.mod h1:Zanoh4+gvIgluNqcfMVTJueD4wSS5hT7zTt4Mrutd90=
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4=
github.com/hanwen/go-fuse/v2 v2.9.0 h1:0AOGUkHtbOVeyGLr0tXupiid1Vg7QB7M6YUcdmVdC58=
github.com/hanwen/go-fuse/v2 v2.9.0/go.mod h1:yE6D2PqWwm3CbYRxFXV9xUd8Md5d6NG0WBs5spCswmI=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
@ -1621,6 +1619,8 @@ github.com/schollz/progressbar/v3 v3.19.0 h1:Ea18xuIRQXLAUidVDox3AbwfUhD0/1Ivohy
github.com/schollz/progressbar/v3 v3.19.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec=
github.com/seaweedfs/cockroachdb-parser v0.0.0-20251021184156-909763b17138 h1:bX1vBF7GQjPeFQsCAZ8gCQGS/nJQnekL7gZ4Qg/pF4E=
github.com/seaweedfs/cockroachdb-parser v0.0.0-20251021184156-909763b17138/go.mod h1:JSKCh6uCHBz91lQYFYHCyTrSVIPge4SUFVn28iwMNB0=
github.com/seaweedfs/go-fuse/v2 v2.9.1 h1:gnKmfrKreCRGJmekGz5WMnNZqXEf9s9+V2hdWQdvx88=
github.com/seaweedfs/go-fuse/v2 v2.9.1/go.mod h1:zABdmWEa6A0bwaBeEOBUeUkGIZlxUhcdv+V1Dcc/U/I=
github.com/seaweedfs/goexif v1.0.3 h1:ve/OjI7dxPW8X9YQsv3JuVMaxEyF9Rvfd04ouL+Bz30=
github.com/seaweedfs/goexif v1.0.3/go.mod h1:Oni780Z236sXpIQzk1XoJlTwqrJ02smEin9zQeff7Fk=
github.com/seaweedfs/raft v1.1.6 h1:e83Xn0boscPnuSiBllUPeWRVS6JKrqJPYBozgFyBiC0=
@ -18,7 +18,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util/version"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/mount"
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
@ -216,12 +216,8 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
fuseMountOptions . Options = append ( fuseMountOptions . Options , fmt . Sprintf ( "iosize=%d" , ioSizeMB * 1024 * 1024 ) )
}
if option . writebackCache != nil && * option . writebackCache {
fuseMountOptions . Options = append ( fuseMountOptions . Options , "writeback_cache" )
}
if option . asyncDio != nil && * option . asyncDio {
fuseMountOptions . Options = append ( fuseMountOptions . Options , "async_dio" )
}
fuseMountOptions . EnableWriteback = * option . writebackCache
fuseMountOptions . EnableAsyncDio = * option . asyncDio
if option . cacheSymlink != nil && * option . cacheSymlink {
fuseMountOptions . EnableSymlinkCaching = true
}
@ -4,7 +4,7 @@ import (
"strings"
"syscall"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
@ -4,7 +4,7 @@ import (
"sync"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/util"
)
@ -10,7 +10,7 @@ import (
"sync/atomic"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"google.golang.org/grpc"
"github.com/seaweedfs/seaweedfs/weed/filer"
@ -26,7 +26,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util/version"
"github.com/seaweedfs/seaweedfs/weed/wdclient"
"github.com/hanwen /go-fuse/v2/fs"
"github.com/seaweedfs /go-fuse/v2/fs"
)
type Option struct {
@ -5,7 +5,7 @@ import (
"syscall"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
)
func setBlksize ( out * fuse . Attr , size uint32 ) {
@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
)
func setBlksize ( out * fuse . Attr , size uint32 ) {
@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
)
func setBlksize ( out * fuse . Attr , size uint32 ) {
@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
@ -8,7 +8,7 @@ import (
"syscall"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
@ -4,7 +4,7 @@ import (
"context"
"sync"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
@ -4,7 +4,7 @@ import (
"net/http"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/util"
@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
)
@ -6,7 +6,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
@ -6,7 +6,7 @@ import (
"syscall"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@ -8,7 +8,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
)
@ -6,7 +6,7 @@ import (
"syscall"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@ -5,7 +5,7 @@ import (
"syscall"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/util"
)
@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)
@ -6,7 +6,7 @@ import (
"syscall"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
@ -7,8 +7,8 @@ import (
"strings"
"syscall"
"github.com/hanwen /go-fuse/v2/fs"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fs"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@ -3,7 +3,7 @@ package mount
import (
"context"
"fmt"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"math"
@ -7,7 +7,7 @@ import (
"syscall"
"time"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
@ -1,6 +1,6 @@
package mount
import "github.com/hanwen /go-fuse/v2/fuse"
import "github.com/seaweedfs /go-fuse/v2/fuse"
// https://github.com/libfuse/libfuse/blob/48ae2e72b39b6a31cb2194f6f11786b7ca06aac6/include/fuse.h#L778
@ -8,7 +8,7 @@ import (
"strings"
"syscall"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
sys "golang.org/x/sys/unix"
)
@ -3,7 +3,7 @@ package mount
import (
"syscall"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
)
func ( wfs * WFS ) GetXAttr ( cancel <- chan struct { } , header * fuse . InHeader , attr string , dest [ ] byte ) ( size uint32 , code fuse . Status ) {
@ -5,7 +5,7 @@ import (
"fmt"
"syscall"
"github.com/hanwen /go-fuse/v2/fuse"
"github.com/seaweedfs /go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"