Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go-fuse
Commits
ba7cc06b
Commit
ba7cc06b
authored
Apr 26, 2023
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs: document FileHandle argument for Getattr
Change-Id: I48236bf879939537944e617baa620884e7601055
parent
daaa0cfa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
fs/api.go
fs/api.go
+4
-1
fs/bridge.go
fs/bridge.go
+4
-9
No files found.
fs/api.go
View file @
ba7cc06b
...
@@ -225,7 +225,10 @@ type NodeAccesser interface {
...
@@ -225,7 +225,10 @@ type NodeAccesser interface {
// returning zeroed permissions, the default behavior is to change the
// returning zeroed permissions, the default behavior is to change the
// mode of 0755 (directory) or 0644 (files). This can be switched off
// mode of 0755 (directory) or 0644 (files). This can be switched off
// with the Options.NullPermissions setting. If blksize is unset, 4096
// with the Options.NullPermissions setting. If blksize is unset, 4096
// is assumed, and the 'blocks' field is set accordingly.
// is assumed, and the 'blocks' field is set accordingly. The 'f'
// argument is provided for consistency, however, in practice the
// kernel never sends a file handle, even if the Getattr call
// originated from a fstat system call.
type
NodeGetattrer
interface
{
type
NodeGetattrer
interface
{
Getattr
(
ctx
context
.
Context
,
f
FileHandle
,
out
*
fuse
.
AttrOut
)
syscall
.
Errno
Getattr
(
ctx
context
.
Context
,
f
FileHandle
,
out
*
fuse
.
AttrOut
)
syscall
.
Errno
}
}
...
...
fs/bridge.go
View file @
ba7cc06b
...
@@ -548,15 +548,10 @@ func (b *rawBridge) GetAttr(cancel <-chan struct{}, input *fuse.GetAttrIn, out *
...
@@ -548,15 +548,10 @@ func (b *rawBridge) GetAttr(cancel <-chan struct{}, input *fuse.GetAttrIn, out *
func
(
b
*
rawBridge
)
getattr
(
ctx
context
.
Context
,
n
*
Inode
,
f
FileHandle
,
out
*
fuse
.
AttrOut
)
syscall
.
Errno
{
func
(
b
*
rawBridge
)
getattr
(
ctx
context
.
Context
,
n
*
Inode
,
f
FileHandle
,
out
*
fuse
.
AttrOut
)
syscall
.
Errno
{
var
errno
syscall
.
Errno
var
errno
syscall
.
Errno
var
fg
FileGetattrer
if
nodeOps
,
ok
:=
n
.
ops
.
(
NodeGetattrer
);
ok
{
if
f
!=
nil
{
errno
=
nodeOps
.
Getattr
(
ctx
,
f
,
out
)
fg
,
_
=
f
.
(
FileGetattrer
)
}
else
if
fileOps
,
ok
:=
f
.
(
FileGetattrer
);
ok
{
}
errno
=
fileOps
.
Getattr
(
ctx
,
out
)
if
fops
,
ok
:=
n
.
ops
.
(
NodeGetattrer
);
ok
{
errno
=
fops
.
Getattr
(
ctx
,
f
,
out
)
}
else
if
fg
!=
nil
{
errno
=
fg
.
Getattr
(
ctx
,
out
)
}
else
{
}
else
{
// We set Mode below, which is the minimum for success
// We set Mode below, which is the minimum for success
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment