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
Levin Zimmermann
go-fuse
Commits
f1ff19a7
Commit
f1ff19a7
authored
Mar 23, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: stop using 'me' as receiver name
parent
95bb0f93
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
81 deletions
+81
-81
fuse/print.go
fuse/print.go
+64
-64
fuse/print_linux.go
fuse/print_linux.go
+17
-17
No files found.
fuse/print.go
View file @
f1ff19a7
...
@@ -94,114 +94,114 @@ func flagString(names map[int64]string, fl int64, def string) string {
...
@@ -94,114 +94,114 @@ func flagString(names map[int64]string, fl int64, def string) string {
return
strings
.
Join
(
s
,
","
)
return
strings
.
Join
(
s
,
","
)
}
}
func
(
me
*
ForgetIn
)
string
()
string
{
func
(
in
*
ForgetIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Nlookup=%d}"
,
me
.
Nlookup
)
return
fmt
.
Sprintf
(
"{Nlookup=%d}"
,
in
.
Nlookup
)
}
}
func
(
me
*
_BatchForgetIn
)
string
()
string
{
func
(
in
*
_BatchForgetIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Count=%d}"
,
me
.
Count
)
return
fmt
.
Sprintf
(
"{Count=%d}"
,
in
.
Count
)
}
}
func
(
me
*
MkdirIn
)
string
()
string
{
func
(
in
*
MkdirIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{0%o (0%o)}"
,
me
.
Mode
,
me
.
Umask
)
return
fmt
.
Sprintf
(
"{0%o (0%o)}"
,
in
.
Mode
,
in
.
Umask
)
}
}
func
(
me
*
Rename1In
)
string
()
string
{
func
(
in
*
Rename1In
)
string
()
string
{
return
fmt
.
Sprintf
(
"{i%d}"
,
me
.
Newdir
)
return
fmt
.
Sprintf
(
"{i%d}"
,
in
.
Newdir
)
}
}
func
(
me
*
RenameIn
)
string
()
string
{
func
(
in
*
RenameIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{i%d %x}"
,
me
.
Newdir
,
me
.
Flags
)
return
fmt
.
Sprintf
(
"{i%d %x}"
,
in
.
Newdir
,
in
.
Flags
)
}
}
func
(
me
*
SetAttrIn
)
string
()
string
{
func
(
in
*
SetAttrIn
)
string
()
string
{
s
:=
[]
string
{}
s
:=
[]
string
{}
if
me
.
Valid
&
FATTR_MODE
!=
0
{
if
in
.
Valid
&
FATTR_MODE
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"mode 0%o"
,
me
.
Mode
))
s
=
append
(
s
,
fmt
.
Sprintf
(
"mode 0%o"
,
in
.
Mode
))
}
}
if
me
.
Valid
&
FATTR_UID
!=
0
{
if
in
.
Valid
&
FATTR_UID
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"uid %d"
,
me
.
Uid
))
s
=
append
(
s
,
fmt
.
Sprintf
(
"uid %d"
,
in
.
Uid
))
}
}
if
me
.
Valid
&
FATTR_GID
!=
0
{
if
in
.
Valid
&
FATTR_GID
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"gid %d"
,
me
.
Gid
))
s
=
append
(
s
,
fmt
.
Sprintf
(
"gid %d"
,
in
.
Gid
))
}
}
if
me
.
Valid
&
FATTR_SIZE
!=
0
{
if
in
.
Valid
&
FATTR_SIZE
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"size %d"
,
me
.
Size
))
s
=
append
(
s
,
fmt
.
Sprintf
(
"size %d"
,
in
.
Size
))
}
}
if
me
.
Valid
&
FATTR_ATIME
!=
0
{
if
in
.
Valid
&
FATTR_ATIME
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"atime %d.%09d"
,
me
.
Atime
,
me
.
Atimensec
))
s
=
append
(
s
,
fmt
.
Sprintf
(
"atime %d.%09d"
,
in
.
Atime
,
in
.
Atimensec
))
}
}
if
me
.
Valid
&
FATTR_MTIME
!=
0
{
if
in
.
Valid
&
FATTR_MTIME
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"mtime %d.%09d"
,
me
.
Mtime
,
me
.
Mtimensec
))
s
=
append
(
s
,
fmt
.
Sprintf
(
"mtime %d.%09d"
,
in
.
Mtime
,
in
.
Mtimensec
))
}
}
if
me
.
Valid
&
FATTR_FH
!=
0
{
if
in
.
Valid
&
FATTR_FH
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"fh %d"
,
me
.
Fh
))
s
=
append
(
s
,
fmt
.
Sprintf
(
"fh %d"
,
in
.
Fh
))
}
}
// TODO - FATTR_ATIME_NOW = (1 << 7), FATTR_MTIME_NOW = (1 << 8), FATTR_LOCKOWNER = (1 << 9)
// TODO - FATTR_ATIME_NOW = (1 << 7), FATTR_MTIME_NOW = (1 << 8), FATTR_LOCKOWNER = (1 << 9)
return
fmt
.
Sprintf
(
"{%s}"
,
strings
.
Join
(
s
,
", "
))
return
fmt
.
Sprintf
(
"{%s}"
,
strings
.
Join
(
s
,
", "
))
}
}
func
(
me
*
ReleaseIn
)
string
()
string
{
func
(
in
*
ReleaseIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d %s %s L%d}"
,
return
fmt
.
Sprintf
(
"{Fh %d %s %s L%d}"
,
me
.
Fh
,
flagString
(
openFlagNames
,
int64
(
me
.
Flags
),
""
),
in
.
Fh
,
flagString
(
openFlagNames
,
int64
(
in
.
Flags
),
""
),
flagString
(
releaseFlagNames
,
int64
(
me
.
ReleaseFlags
),
""
),
flagString
(
releaseFlagNames
,
int64
(
in
.
ReleaseFlags
),
""
),
me
.
LockOwner
)
in
.
LockOwner
)
}
}
func
(
me
*
OpenIn
)
string
()
string
{
func
(
in
*
OpenIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{%s}"
,
flagString
(
openFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
))
return
fmt
.
Sprintf
(
"{%s}"
,
flagString
(
openFlagNames
,
int64
(
in
.
Flags
),
"O_RDONLY"
))
}
}
func
(
me
*
OpenOut
)
string
()
string
{
func
(
in
*
OpenOut
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d %s}"
,
me
.
Fh
,
return
fmt
.
Sprintf
(
"{Fh %d %s}"
,
in
.
Fh
,
flagString
(
fuseOpenFlagNames
,
int64
(
me
.
OpenFlags
),
""
))
flagString
(
fuseOpenFlagNames
,
int64
(
in
.
OpenFlags
),
""
))
}
}
func
(
me
*
InitIn
)
string
()
string
{
func
(
in
*
InitIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{%d.%d Ra 0x%x %s}"
,
return
fmt
.
Sprintf
(
"{%d.%d Ra 0x%x %s}"
,
me
.
Major
,
me
.
Minor
,
me
.
MaxReadAhead
,
in
.
Major
,
in
.
Minor
,
in
.
MaxReadAhead
,
flagString
(
initFlagNames
,
int64
(
me
.
Flags
),
""
))
flagString
(
initFlagNames
,
int64
(
in
.
Flags
),
""
))
}
}
func
(
me
*
InitOut
)
string
()
string
{
func
(
o
*
InitOut
)
string
()
string
{
return
fmt
.
Sprintf
(
"{%d.%d Ra 0x%x %s %d/%d Wr 0x%x Tg 0x%x}"
,
return
fmt
.
Sprintf
(
"{%d.%d Ra 0x%x %s %d/%d Wr 0x%x Tg 0x%x}"
,
me
.
Major
,
me
.
Minor
,
me
.
MaxReadAhead
,
o
.
Major
,
o
.
Minor
,
o
.
MaxReadAhead
,
flagString
(
initFlagNames
,
int64
(
me
.
Flags
),
""
),
flagString
(
initFlagNames
,
int64
(
o
.
Flags
),
""
),
me
.
CongestionThreshold
,
me
.
MaxBackground
,
me
.
MaxWrite
,
o
.
CongestionThreshold
,
o
.
MaxBackground
,
o
.
MaxWrite
,
me
.
TimeGran
)
o
.
TimeGran
)
}
}
func
(
s
*
FsyncIn
)
string
()
string
{
func
(
s
*
FsyncIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d Flags %x}"
,
s
.
Fh
,
s
.
FsyncFlags
)
return
fmt
.
Sprintf
(
"{Fh %d Flags %x}"
,
s
.
Fh
,
s
.
FsyncFlags
)
}
}
func
(
me
*
SetXAttrIn
)
string
()
string
{
func
(
in
*
SetXAttrIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{sz %d f%o}"
,
me
.
Size
,
me
.
Flags
)
return
fmt
.
Sprintf
(
"{sz %d f%o}"
,
in
.
Size
,
in
.
Flags
)
}
}
func
(
me
*
GetXAttrIn
)
string
()
string
{
func
(
in
*
GetXAttrIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
return
fmt
.
Sprintf
(
"{sz %d}"
,
in
.
Size
)
}
}
func
(
me
*
GetXAttrOut
)
string
()
string
{
func
(
o
*
GetXAttrOut
)
string
()
string
{
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
return
fmt
.
Sprintf
(
"{sz %d}"
,
o
.
Size
)
}
}
func
(
me
*
AccessIn
)
string
()
string
{
func
(
in
*
AccessIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{u=%d g=%d %s}"
,
return
fmt
.
Sprintf
(
"{u=%d g=%d %s}"
,
me
.
Uid
,
in
.
Uid
,
me
.
Gid
,
in
.
Gid
,
flagString
(
accessFlagName
,
int64
(
me
.
Mask
),
""
))
flagString
(
accessFlagName
,
int64
(
in
.
Mask
),
""
))
}
}
func
(
me
*
FlushIn
)
string
()
string
{
func
(
in
*
FlushIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d}"
,
me
.
Fh
)
return
fmt
.
Sprintf
(
"{Fh %d}"
,
in
.
Fh
)
}
}
func
(
me
*
AttrOut
)
string
()
string
{
func
(
o
*
AttrOut
)
string
()
string
{
return
fmt
.
Sprintf
(
return
fmt
.
Sprintf
(
"{tA=%gs %v}"
,
"{tA=%gs %v}"
,
ft
(
me
.
AttrValid
,
me
.
AttrValidNsec
),
&
me
.
Attr
)
ft
(
o
.
AttrValid
,
o
.
AttrValidNsec
),
&
o
.
Attr
)
}
}
// ft converts (seconds , nanoseconds) -> float(seconds)
// ft converts (seconds , nanoseconds) -> float(seconds)
...
@@ -210,21 +210,21 @@ func ft(tsec uint64, tnsec uint32) float64 {
...
@@ -210,21 +210,21 @@ func ft(tsec uint64, tnsec uint32) float64 {
}
}
// Returned by LOOKUP
// Returned by LOOKUP
func
(
me
*
EntryOut
)
string
()
string
{
func
(
o
*
EntryOut
)
string
()
string
{
return
fmt
.
Sprintf
(
"{i%d g%d tE=%gs tA=%gs %v}"
,
return
fmt
.
Sprintf
(
"{i%d g%d tE=%gs tA=%gs %v}"
,
me
.
NodeId
,
me
.
Generation
,
ft
(
me
.
EntryValid
,
me
.
EntryValidNsec
),
o
.
NodeId
,
o
.
Generation
,
ft
(
o
.
EntryValid
,
o
.
EntryValidNsec
),
ft
(
me
.
AttrValid
,
me
.
AttrValidNsec
),
&
me
.
Attr
)
ft
(
o
.
AttrValid
,
o
.
AttrValidNsec
),
&
o
.
Attr
)
}
}
func
(
me
*
CreateOut
)
string
()
string
{
func
(
o
*
CreateOut
)
string
()
string
{
return
fmt
.
Sprintf
(
"{i%d g%d %v %v}"
,
me
.
NodeId
,
me
.
Generation
,
&
me
.
EntryOut
,
&
me
.
OpenOut
)
return
fmt
.
Sprintf
(
"{i%d g%d %v %v}"
,
o
.
NodeId
,
o
.
Generation
,
&
o
.
EntryOut
,
&
o
.
OpenOut
)
}
}
func
(
me
*
StatfsOut
)
string
()
string
{
func
(
o
*
StatfsOut
)
string
()
string
{
return
fmt
.
Sprintf
(
return
fmt
.
Sprintf
(
"{blocks (%d,%d)/%d files %d/%d bs%d nl%d frs%d}"
,
"{blocks (%d,%d)/%d files %d/%d bs%d nl%d frs%d}"
,
me
.
Bfree
,
me
.
Bavail
,
me
.
Blocks
,
me
.
Ffree
,
me
.
Files
,
o
.
Bfree
,
o
.
Bavail
,
o
.
Blocks
,
o
.
Ffree
,
o
.
Files
,
me
.
Bsize
,
me
.
NameLen
,
me
.
Frsize
)
o
.
Bsize
,
o
.
NameLen
,
o
.
Frsize
)
}
}
func
(
o
*
NotifyInvalEntryOut
)
string
()
string
{
func
(
o
*
NotifyInvalEntryOut
)
string
()
string
{
...
...
fuse/print_linux.go
View file @
f1ff19a7
...
@@ -30,32 +30,32 @@ func (a *Attr) string() string {
...
@@ -30,32 +30,32 @@ func (a *Attr) string() string {
ft
(
a
.
Ctime
,
a
.
Ctimensec
))
ft
(
a
.
Ctime
,
a
.
Ctimensec
))
}
}
func
(
me
*
CreateIn
)
string
()
string
{
func
(
in
*
CreateIn
)
string
()
string
{
return
fmt
.
Sprintf
(
return
fmt
.
Sprintf
(
"{0%o [%s] (0%o)}"
,
me
.
Mode
,
"{0%o [%s] (0%o)}"
,
in
.
Mode
,
flagString
(
openFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
),
me
.
Umask
)
flagString
(
openFlagNames
,
int64
(
in
.
Flags
),
"O_RDONLY"
),
in
.
Umask
)
}
}
func
(
me
*
GetAttrIn
)
string
()
string
{
func
(
in
*
GetAttrIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d}"
,
me
.
Fh_
)
return
fmt
.
Sprintf
(
"{Fh %d}"
,
in
.
Fh_
)
}
}
func
(
me
*
MknodIn
)
string
()
string
{
func
(
in
*
MknodIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{0%o (0%o), %d}"
,
me
.
Mode
,
me
.
Umask
,
me
.
Rdev
)
return
fmt
.
Sprintf
(
"{0%o (0%o), %d}"
,
in
.
Mode
,
in
.
Umask
,
in
.
Rdev
)
}
}
func
(
me
*
ReadIn
)
string
()
string
{
func
(
in
*
ReadIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d [%d +%d) %s L %d %s}"
,
return
fmt
.
Sprintf
(
"{Fh %d [%d +%d) %s L %d %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
in
.
Fh
,
in
.
Offset
,
in
.
Size
,
flagString
(
readFlagNames
,
int64
(
me
.
ReadFlags
),
""
),
flagString
(
readFlagNames
,
int64
(
in
.
ReadFlags
),
""
),
me
.
LockOwner
,
in
.
LockOwner
,
flagString
(
openFlagNames
,
int64
(
me
.
Flags
),
"RDONLY"
))
flagString
(
openFlagNames
,
int64
(
in
.
Flags
),
"RDONLY"
))
}
}
func
(
me
*
WriteIn
)
string
()
string
{
func
(
in
*
WriteIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d [%d +%d) %s L %d %s}"
,
return
fmt
.
Sprintf
(
"{Fh %d [%d +%d) %s L %d %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
in
.
Fh
,
in
.
Offset
,
in
.
Size
,
flagString
(
writeFlagNames
,
int64
(
me
.
WriteFlags
),
""
),
flagString
(
writeFlagNames
,
int64
(
in
.
WriteFlags
),
""
),
me
.
LockOwner
,
in
.
LockOwner
,
flagString
(
openFlagNames
,
int64
(
me
.
Flags
),
"RDONLY"
))
flagString
(
openFlagNames
,
int64
(
in
.
Flags
),
"RDONLY"
))
}
}
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