vendor: update bazil.org/fuse to fix FreeBSD 12.1 - fixes #3697
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2013-2015 Tommi Virtanen.
|
||||
Copyright (c) 2013-2019 Tommi Virtanen.
|
||||
Copyright (c) 2009, 2011, 2012 The Go Authors.
|
||||
All rights reserved.
|
||||
|
||||
|
||||
+9
-11
@@ -3,6 +3,8 @@
|
||||
package fs // import "bazil.org/fuse/fs"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"hash/fnv"
|
||||
@@ -14,12 +16,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"bazil.org/fuse"
|
||||
"bazil.org/fuse/fuseutil"
|
||||
)
|
||||
@@ -71,6 +67,9 @@ type FSInodeGenerator interface {
|
||||
//
|
||||
// Implementing this is useful to e.g. constrain the range of
|
||||
// inode values used for dynamic inodes.
|
||||
//
|
||||
// Non-zero return values should be greater than 1, as that is
|
||||
// always used for the root inode.
|
||||
GenerateInode(parentInode uint64, name string) uint64
|
||||
}
|
||||
|
||||
@@ -435,8 +434,6 @@ func Serve(c *fuse.Conn, fs FS) error {
|
||||
return server.Serve(fs)
|
||||
}
|
||||
|
||||
type nothing struct{}
|
||||
|
||||
type serveRequest struct {
|
||||
Request fuse.Request
|
||||
cancel func()
|
||||
@@ -1557,11 +1554,12 @@ func GenerateDynamicInode(parent uint64, name string) uint64 {
|
||||
var inode uint64
|
||||
for {
|
||||
inode = h.Sum64()
|
||||
if inode != 0 {
|
||||
if inode > 1 {
|
||||
break
|
||||
}
|
||||
// there's a tiny probability that result is zero; change the
|
||||
// input a little and try again
|
||||
// there's a tiny probability that result is zero or the
|
||||
// hardcoded root inode 1; change the input a little and try
|
||||
// again
|
||||
_, _ = h.Write([]byte{'x'})
|
||||
}
|
||||
return inode
|
||||
|
||||
+1
-4
@@ -3,14 +3,11 @@
|
||||
package fs
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
pathpkg "path"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
import (
|
||||
"bazil.org/fuse"
|
||||
)
|
||||
|
||||
|
||||
+25
-11
@@ -495,9 +495,15 @@ func fileMode(unixMode uint32) os.FileMode {
|
||||
mode |= os.ModeSymlink
|
||||
case syscall.S_IFSOCK:
|
||||
mode |= os.ModeSocket
|
||||
case 0:
|
||||
// apparently there's plenty of times when the FUSE request
|
||||
// does not contain the file type
|
||||
mode |= os.ModeIrregular
|
||||
default:
|
||||
// no idea
|
||||
mode |= os.ModeDevice
|
||||
// not just unavailable in the kernel codepath; known to
|
||||
// kernel but unrecognized by us
|
||||
Debug(fmt.Sprintf("unrecognized file mode type: %04o", unixMode))
|
||||
mode |= os.ModeIrregular
|
||||
}
|
||||
if unixMode&syscall.S_ISUID != 0 {
|
||||
mode |= os.ModeSetuid
|
||||
@@ -1004,7 +1010,12 @@ loop:
|
||||
}
|
||||
|
||||
case opBmap:
|
||||
panic("opBmap")
|
||||
// bmap asks to map a byte offset within a file to a single
|
||||
// uint64. On Linux, it triggers only with blkdev fuse mounts,
|
||||
// that claim to be backed by an actual block device. FreeBSD
|
||||
// seems to send it for just any fuse mount, whether there's a
|
||||
// block device involved or not.
|
||||
goto unrecognized
|
||||
|
||||
case opDestroy:
|
||||
req = &DestroyRequest{
|
||||
@@ -1384,8 +1395,6 @@ func (a *Attr) attr(out *attr, proto Protocol) {
|
||||
if proto.GE(Protocol{7, 9}) {
|
||||
out.Blksize = a.BlockSize
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// A GetattrRequest asks for the metadata for the file denoted by r.Node.
|
||||
@@ -1464,7 +1473,7 @@ type GetxattrResponse struct {
|
||||
}
|
||||
|
||||
func (r *GetxattrResponse) String() string {
|
||||
return fmt.Sprintf("Getxattr %x", r.Xattr)
|
||||
return fmt.Sprintf("Getxattr %q", r.Xattr)
|
||||
}
|
||||
|
||||
// A ListxattrRequest asks to list the extended attributes associated with r.Node.
|
||||
@@ -1500,7 +1509,7 @@ type ListxattrResponse struct {
|
||||
}
|
||||
|
||||
func (r *ListxattrResponse) String() string {
|
||||
return fmt.Sprintf("Listxattr %x", r.Xattr)
|
||||
return fmt.Sprintf("Listxattr %q", r.Xattr)
|
||||
}
|
||||
|
||||
// Append adds an extended attribute name to the response.
|
||||
@@ -1565,7 +1574,7 @@ func trunc(b []byte, max int) ([]byte, string) {
|
||||
|
||||
func (r *SetxattrRequest) String() string {
|
||||
xattr, tail := trunc(r.Xattr, 16)
|
||||
return fmt.Sprintf("Setxattr [%s] %q %x%s fl=%v @%#x", &r.Header, r.Name, xattr, tail, r.Flags, r.Position)
|
||||
return fmt.Sprintf("Setxattr [%s] %q %q%s fl=%v @%#x", &r.Header, r.Name, xattr, tail, r.Flags, r.Position)
|
||||
}
|
||||
|
||||
// Respond replies to the request, indicating that the extended attribute was set.
|
||||
@@ -1986,9 +1995,14 @@ type SetattrRequest struct {
|
||||
Size uint64
|
||||
Atime time.Time
|
||||
Mtime time.Time
|
||||
Mode os.FileMode
|
||||
Uid uint32
|
||||
Gid uint32
|
||||
// Mode is the file mode to set (when valid).
|
||||
//
|
||||
// The type of the node (as in os.ModeType, os.ModeDir etc) is not
|
||||
// guaranteed to be sent by the kernel, in which case
|
||||
// os.ModeIrregular will be set.
|
||||
Mode os.FileMode
|
||||
Uid uint32
|
||||
Gid uint32
|
||||
|
||||
// OS X only
|
||||
Bkuptime time.Time
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ type OpenResponseFlags uint32
|
||||
const (
|
||||
OpenDirectIO OpenResponseFlags = 1 << 0 // bypass page cache for this open file
|
||||
OpenKeepCache OpenResponseFlags = 1 << 1 // don't invalidate the data cache on open
|
||||
OpenNonSeekable OpenResponseFlags = 1 << 2 // mark the file as non-seekable (not supported on OS X)
|
||||
OpenNonSeekable OpenResponseFlags = 1 << 2 // mark the file as non-seekable (not supported on OS X or FreeBSD)
|
||||
|
||||
OpenPurgeAttr OpenResponseFlags = 1 << 30 // OS X
|
||||
OpenPurgeUBC OpenResponseFlags = 1 << 31 // OS X
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ type attr struct {
|
||||
Gid uint32
|
||||
Rdev uint32
|
||||
Blksize uint32
|
||||
padding uint32
|
||||
_ uint32
|
||||
}
|
||||
|
||||
func (a *attr) Crtime() time.Time {
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
module bazil.org/fuse
|
||||
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c
|
||||
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449
|
||||
)
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ=
|
||||
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM=
|
||||
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ=
|
||||
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
+10
-1
@@ -106,6 +106,14 @@ func NoAppleXattr() MountOption {
|
||||
return noAppleXattr
|
||||
}
|
||||
|
||||
// NoBrowse makes OSXFUSE mark the volume as non-browsable, so that
|
||||
// Finder won't automatically browse it.
|
||||
//
|
||||
// OS X only. Others ignore this option.
|
||||
func NoBrowse() MountOption {
|
||||
return noBrowse
|
||||
}
|
||||
|
||||
// ExclCreate causes O_EXCL flag to be set for only "truly" exclusive creates,
|
||||
// i.e. create calls for which the initiator explicitly set the O_EXCL flag.
|
||||
//
|
||||
@@ -155,7 +163,8 @@ func AllowOther() MountOption {
|
||||
}
|
||||
}
|
||||
|
||||
// AllowRoot allows other users to access the file system.
|
||||
// AllowRoot allows root (but not just everyone) to access the file
|
||||
// system.
|
||||
//
|
||||
// Only one of AllowOther or AllowRoot can be used.
|
||||
//
|
||||
|
||||
+5
@@ -33,3 +33,8 @@ func exclCreate(conf *mountConfig) error {
|
||||
conf.options["excl_create"] = ""
|
||||
return nil
|
||||
}
|
||||
|
||||
func noBrowse(conf *mountConfig) error {
|
||||
conf.options["nobrowse"] = ""
|
||||
return nil
|
||||
}
|
||||
|
||||
+4
@@ -26,3 +26,7 @@ func noAppleDouble(conf *mountConfig) error {
|
||||
func exclCreate(conf *mountConfig) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func noBrowse(conf *mountConfig) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
+4
@@ -23,3 +23,7 @@ func noAppleDouble(conf *mountConfig) error {
|
||||
func exclCreate(conf *mountConfig) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func noBrowse(conf *mountConfig) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user