diff options
| author | Jakob Unterwurzacher | 2026-11-19 21:14:58 +0100 |
|---|---|---|
| committer | Jakob Unterwurzacher | 2026-11-19 21:25:56 +0100 |
| commit | 173e5056ef8beaa461c5a6665b75e1d97503c5ac (patch) | |
| tree | bfff9a1b18a97bac7ee8b6c4f05d2d9b9fd2cc58 /internal/fusefrontend | |
| parent | 52c4864d849cbbb76d49d1a908025b77c7246bda (diff) | |
go-fuse master is now github.com/hanwen/go-fuse/v3. Changes needed:
* Change the import path, also in build.bash and version.go, which
look up the go-fuse module version.
* fuse.Context is gone, and fuse.FromContext() now returns a
fuse.Caller value. Caller has the same Owner and Pid fields, so use
*fuse.Caller in place of *fuse.Context.
* fuse.Status is replaced by syscall.Errno, so ReadResult.Bytes()
returns an Errno now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/fusefrontend')
20 files changed, 41 insertions, 43 deletions
diff --git a/internal/fusefrontend/args.go b/internal/fusefrontend/args.go index 84e34af..e936fd3 100644 --- a/internal/fusefrontend/args.go +++ b/internal/fusefrontend/args.go @@ -1,7 +1,7 @@ package fusefrontend import ( - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fuse" ) // Args is a container for arguments that are passed from main() to fusefrontend diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index 8eee0f8..03eccd7 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -16,8 +16,8 @@ import ( "golang.org/x/sys/unix" - "github.com/hanwen/go-fuse/v2/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fs" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/contentenc" "github.com/rfjakob/gocryptfs/v2/internal/inomap" @@ -26,7 +26,7 @@ import ( "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) -// File implements the go-fuse v2 API (github.com/hanwen/go-fuse/v2/fs) +// File implements the go-fuse v2 API (github.com/hanwen/go-fuse/v3/fs) type File struct { fd *os.File // Has Release() already been called on this file? This also means that the diff --git a/internal/fusefrontend/file_allocate_truncate.go b/internal/fusefrontend/file_allocate_truncate.go index 19b7697..14dfdd0 100644 --- a/internal/fusefrontend/file_allocate_truncate.go +++ b/internal/fusefrontend/file_allocate_truncate.go @@ -13,7 +13,7 @@ import ( "github.com/rfjakob/gocryptfs/v2/internal/contentenc" - "github.com/hanwen/go-fuse/v2/fs" + "github.com/hanwen/go-fuse/v3/fs" "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" "github.com/rfjakob/gocryptfs/v2/internal/tlog" diff --git a/internal/fusefrontend/file_api_check.go b/internal/fusefrontend/file_api_check.go index 019e97f..0416ab1 100644 --- a/internal/fusefrontend/file_api_check.go +++ b/internal/fusefrontend/file_api_check.go @@ -1,7 +1,7 @@ package fusefrontend import ( - "github.com/hanwen/go-fuse/v2/fs" + "github.com/hanwen/go-fuse/v3/fs" ) // Check that we have implemented the fs.File* interfaces diff --git a/internal/fusefrontend/file_dir_ops.go b/internal/fusefrontend/file_dir_ops.go index 683da87..772eed5 100644 --- a/internal/fusefrontend/file_dir_ops.go +++ b/internal/fusefrontend/file_dir_ops.go @@ -4,8 +4,8 @@ import ( "context" "syscall" - "github.com/hanwen/go-fuse/v2/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fs" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/configfile" "github.com/rfjakob/gocryptfs/v2/internal/nametransform" "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" diff --git a/internal/fusefrontend/file_holes.go b/internal/fusefrontend/file_holes.go index fc58898..e63d534 100644 --- a/internal/fusefrontend/file_holes.go +++ b/internal/fusefrontend/file_holes.go @@ -7,7 +7,7 @@ import ( "runtime" "syscall" - "github.com/hanwen/go-fuse/v2/fs" + "github.com/hanwen/go-fuse/v3/fs" "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) diff --git a/internal/fusefrontend/file_setattr.go b/internal/fusefrontend/file_setattr.go index fe4bc47..5afa89b 100644 --- a/internal/fusefrontend/file_setattr.go +++ b/internal/fusefrontend/file_setattr.go @@ -4,8 +4,8 @@ import ( "context" "syscall" - "github.com/hanwen/go-fuse/v2/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fs" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" "github.com/rfjakob/gocryptfs/v2/internal/tlog" diff --git a/internal/fusefrontend/node.go b/internal/fusefrontend/node.go index 4f6ae45..ec0a14e 100644 --- a/internal/fusefrontend/node.go +++ b/internal/fusefrontend/node.go @@ -6,8 +6,8 @@ import ( "golang.org/x/sys/unix" - "github.com/hanwen/go-fuse/v2/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fs" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/nametransform" "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" diff --git a/internal/fusefrontend/node_api_check.go b/internal/fusefrontend/node_api_check.go index 37d4293..e3e7fb0 100644 --- a/internal/fusefrontend/node_api_check.go +++ b/internal/fusefrontend/node_api_check.go @@ -1,7 +1,7 @@ package fusefrontend import ( - "github.com/hanwen/go-fuse/v2/fs" + "github.com/hanwen/go-fuse/v3/fs" ) // Check that we have implemented the fs.Node* interfaces diff --git a/internal/fusefrontend/node_dir_ops.go b/internal/fusefrontend/node_dir_ops.go index 97327ce..fc90c05 100644 --- a/internal/fusefrontend/node_dir_ops.go +++ b/internal/fusefrontend/node_dir_ops.go @@ -9,8 +9,8 @@ import ( "golang.org/x/sys/unix" - "github.com/hanwen/go-fuse/v2/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fs" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/cryptocore" "github.com/rfjakob/gocryptfs/v2/internal/nametransform" @@ -34,7 +34,7 @@ func haveDsstore(entries []fuse.DirEntry) bool { // should be a handle to the parent directory, cName is the name of the new // directory and mode specifies the access permissions to use. // If DeterministicNames is set, the diriv file is NOT created. -func (n *Node) mkdirWithIv(dirfd int, cName string, mode uint32, context *fuse.Context) error { +func (n *Node) mkdirWithIv(dirfd int, cName string, mode uint32, context *fuse.Caller) error { rn := n.rootNode() if rn.args.DeterministicNames { @@ -77,7 +77,7 @@ func (n *Node) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.En defer syscall.Close(dirfd) rn := n.rootNode() - var context *fuse.Context + var context *fuse.Caller if rn.args.PreserveOwner { context = toFuseCtx(ctx) } diff --git a/internal/fusefrontend/node_helpers.go b/internal/fusefrontend/node_helpers.go index 3102275..43a8220 100644 --- a/internal/fusefrontend/node_helpers.go +++ b/internal/fusefrontend/node_helpers.go @@ -4,25 +4,23 @@ import ( "context" "syscall" - "github.com/hanwen/go-fuse/v2/fs" + "github.com/hanwen/go-fuse/v3/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) -// toFuseCtx tries to extract a fuse.Context from a generic context.Context. -func toFuseCtx(ctx context.Context) (ctx2 *fuse.Context) { +// toFuseCtx tries to extract a fuse.Caller from a generic context.Context. +func toFuseCtx(ctx context.Context) *fuse.Caller { if ctx == nil { return nil } if caller, ok := fuse.FromContext(ctx); ok { - ctx2 = &fuse.Context{ - Caller: *caller, - } + return &caller } - return ctx2 + return nil } // toNode casts a generic fs.InodeEmbedder into *Node. Also handles *RootNode diff --git a/internal/fusefrontend/node_open_create.go b/internal/fusefrontend/node_open_create.go index 622d5dc..9825884 100644 --- a/internal/fusefrontend/node_open_create.go +++ b/internal/fusefrontend/node_open_create.go @@ -5,8 +5,8 @@ import ( "os" "syscall" - "github.com/hanwen/go-fuse/v2/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fs" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/nametransform" "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" diff --git a/internal/fusefrontend/node_prepare_syscall.go b/internal/fusefrontend/node_prepare_syscall.go index 03194df..5e439bf 100644 --- a/internal/fusefrontend/node_prepare_syscall.go +++ b/internal/fusefrontend/node_prepare_syscall.go @@ -6,7 +6,7 @@ import ( "github.com/rfjakob/gocryptfs/v2/internal/nametransform" "github.com/rfjakob/gocryptfs/v2/internal/tlog" - "github.com/hanwen/go-fuse/v2/fs" + "github.com/hanwen/go-fuse/v3/fs" "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" ) diff --git a/internal/fusefrontend/node_xattr.go b/internal/fusefrontend/node_xattr.go index cbb0c37..0640943 100644 --- a/internal/fusefrontend/node_xattr.go +++ b/internal/fusefrontend/node_xattr.go @@ -7,7 +7,7 @@ import ( "strings" "syscall" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/tlog" ) @@ -90,7 +90,7 @@ func (n *Node) Setxattr(ctx context.Context, attr string, data []byte, flags uin // ACLs are passed through without encryption if isAcl(attr) { // result of setting an acl depends on the user doing it - var context *fuse.Context + var context *fuse.Caller if rn.args.PreserveOwner { context = toFuseCtx(ctx) } diff --git a/internal/fusefrontend/node_xattr_darwin.go b/internal/fusefrontend/node_xattr_darwin.go index 1d25f3d..420084f 100644 --- a/internal/fusefrontend/node_xattr_darwin.go +++ b/internal/fusefrontend/node_xattr_darwin.go @@ -5,8 +5,8 @@ import ( "golang.org/x/sys/unix" - "github.com/hanwen/go-fuse/v2/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fs" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" ) @@ -44,7 +44,7 @@ func (n *Node) getXAttr(cAttr string) (out []byte, errno syscall.Errno) { return cData, 0 } -func (n *Node) setXAttr(context *fuse.Context, cAttr string, cData []byte, flags uint32) (errno syscall.Errno) { +func (n *Node) setXAttr(context *fuse.Caller, cAttr string, cData []byte, flags uint32) (errno syscall.Errno) { dirfd, cName, errno := n.prepareAtSyscallMyself() if errno != 0 { return diff --git a/internal/fusefrontend/node_xattr_freebsd.go b/internal/fusefrontend/node_xattr_freebsd.go index 9698283..3f9c577 100644 --- a/internal/fusefrontend/node_xattr_freebsd.go +++ b/internal/fusefrontend/node_xattr_freebsd.go @@ -3,7 +3,7 @@ package fusefrontend import ( "golang.org/x/sys/unix" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fuse" ) const noSuchAttributeError = unix.ENOATTR @@ -17,7 +17,7 @@ func (n *Node) getXAttr(cAttr string) (out []byte, errno unix.Errno) { return nil, unix.EOPNOTSUPP } -func (n *Node) setXAttr(context *fuse.Context, cAttr string, cData []byte, flags uint32) (errno unix.Errno) { +func (n *Node) setXAttr(context *fuse.Caller, cAttr string, cData []byte, flags uint32) (errno unix.Errno) { // TODO return unix.EOPNOTSUPP } diff --git a/internal/fusefrontend/node_xattr_linux.go b/internal/fusefrontend/node_xattr_linux.go index 9964212..b1f8f39 100644 --- a/internal/fusefrontend/node_xattr_linux.go +++ b/internal/fusefrontend/node_xattr_linux.go @@ -6,8 +6,8 @@ import ( "golang.org/x/sys/unix" - "github.com/hanwen/go-fuse/v2/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fs" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/internal/syscallcompat" ) @@ -34,7 +34,7 @@ func (n *Node) getXAttr(cAttr string) (out []byte, errno syscall.Errno) { return cData, 0 } -func (n *Node) setXAttr(context *fuse.Context, cAttr string, cData []byte, flags uint32) (errno syscall.Errno) { +func (n *Node) setXAttr(context *fuse.Caller, cAttr string, cData []byte, flags uint32) (errno syscall.Errno) { dirfd, cName, errno := n.prepareAtSyscallMyself() if errno != 0 { return diff --git a/internal/fusefrontend/prepare_syscall_test.go b/internal/fusefrontend/prepare_syscall_test.go index 5945720..fb86592 100644 --- a/internal/fusefrontend/prepare_syscall_test.go +++ b/internal/fusefrontend/prepare_syscall_test.go @@ -8,7 +8,7 @@ import ( "golang.org/x/sys/unix" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fuse" "github.com/rfjakob/gocryptfs/v2/tests/test_helpers" ) diff --git a/internal/fusefrontend/statx_linux.go b/internal/fusefrontend/statx_linux.go index f9f87cf..3afaa05 100644 --- a/internal/fusefrontend/statx_linux.go +++ b/internal/fusefrontend/statx_linux.go @@ -4,8 +4,8 @@ import ( "context" "syscall" - "github.com/hanwen/go-fuse/v2/fs" - "github.com/hanwen/go-fuse/v2/fuse" + "github.com/hanwen/go-fuse/v3/fs" + "github.com/hanwen/go-fuse/v3/fuse" "golang.org/x/sys/unix" "github.com/rfjakob/gocryptfs/v2/internal/inomap" diff --git a/internal/fusefrontend/xattr_unit_test.go b/internal/fusefrontend/xattr_unit_test.go index 7d8e32e..379b0dd 100644 --- a/internal/fusefrontend/xattr_unit_test.go +++ b/internal/fusefrontend/xattr_unit_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/hanwen/go-fuse/v2/fs" + "github.com/hanwen/go-fuse/v3/fs" "github.com/rfjakob/gocryptfs/v2/internal/contentenc" "github.com/rfjakob/gocryptfs/v2/internal/cryptocore" |
