fix dep, impl nonempty
This commit is contained in:
parent
c8c18403e4
commit
a5d237df2a
24 changed files with 286 additions and 215 deletions
34
vendor/github.com/hanwen/go-fuse/fuse/pathfs/pathfs.go
generated
vendored
34
vendor/github.com/hanwen/go-fuse/fuse/pathfs/pathfs.go
generated
vendored
|
|
@ -276,7 +276,6 @@ func (n *pathInode) GetPath() string {
|
|||
// them, them, but since this is a hot path, we take some
|
||||
// effort to avoid allocations.
|
||||
|
||||
n.pathFs.pathLock.RLock()
|
||||
walkUp := n.Inode()
|
||||
|
||||
// TODO - guess depth?
|
||||
|
|
@ -299,7 +298,6 @@ func (n *pathInode) GetPath() string {
|
|||
pathBytes = append(pathBytes, '/')
|
||||
}
|
||||
}
|
||||
n.pathFs.pathLock.RUnlock()
|
||||
|
||||
path := string(pathBytes)
|
||||
if n.pathFs.debug {
|
||||
|
|
@ -585,26 +583,34 @@ func (n *pathInode) GetAttr(out *fuse.Attr, file nodefs.File, context *fuse.Cont
|
|||
// an open fd.
|
||||
file = n.Inode().AnyFile()
|
||||
}
|
||||
|
||||
// If we have found an open file, try to fstat it.
|
||||
if file != nil {
|
||||
code = file.GetAttr(out)
|
||||
if code.Ok() {
|
||||
return code
|
||||
}
|
||||
}
|
||||
|
||||
// If we don't have an open file, or fstat on it failed due to an internal
|
||||
// error, stat by path.
|
||||
if file == nil || code == fuse.ENOSYS || code == fuse.EBADF {
|
||||
fi, code = n.fs.GetAttr(n.GetPath(), context)
|
||||
if !code.Ok() {
|
||||
return code
|
||||
}
|
||||
// This is a bug in the filesystem implementation, but let's not
|
||||
// crash.
|
||||
if fi == nil {
|
||||
log.Printf("Bug: fs.GetAttr returned OK with nil data")
|
||||
return fuse.EINVAL
|
||||
}
|
||||
}
|
||||
|
||||
if fi != nil {
|
||||
n.setClientInode(fi.Ino)
|
||||
}
|
||||
|
||||
if fi != nil && !fi.IsDir() && fi.Nlink == 0 {
|
||||
// Set inode number (unless already set or disabled).
|
||||
n.setClientInode(fi.Ino)
|
||||
// Help filesystems that forget to set Nlink.
|
||||
if !fi.IsDir() && fi.Nlink == 0 {
|
||||
fi.Nlink = 1
|
||||
}
|
||||
|
||||
if fi != nil {
|
||||
*out = *fi
|
||||
}
|
||||
*out = *fi
|
||||
return code
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue