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
1dbaf6ba
Commit
1dbaf6ba
authored
Jul 07, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raw: hide String() methods to reduce API clutter.
parent
0a37ff0d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
41 deletions
+46
-41
fuse/request.go
fuse/request.go
+3
-8
fuse/typeprint.go
fuse/typeprint.go
+1
-1
raw/print.go
raw/print.go
+34
-24
raw/print_darwin.go
raw/print_darwin.go
+4
-4
raw/print_linux.go
raw/print_linux.go
+4
-4
No files found.
fuse/request.go
View file @
1dbaf6ba
...
...
@@ -75,7 +75,7 @@ func (r *request) clear() {
func
(
r
*
request
)
InputDebug
()
string
{
val
:=
" "
if
r
.
handler
.
DecodeIn
!=
nil
{
val
=
fmt
.
Sprintf
(
" data: %v "
,
r
.
handler
.
DecodeIn
(
r
.
inData
))
val
=
fmt
.
Sprintf
(
" data: %v "
,
r
aw
.
Print
(
r
.
handler
.
DecodeIn
(
r
.
inData
)
))
}
names
:=
""
...
...
@@ -92,14 +92,9 @@ func (r *request) InputDebug() string {
}
func
(
r
*
request
)
OutputDebug
()
string
{
var
val
interface
{}
var
dataStr
string
if
r
.
handler
.
DecodeOut
!=
nil
&&
r
.
outData
!=
nil
{
val
=
r
.
handler
.
DecodeOut
(
r
.
outData
)
}
dataStr
:=
""
if
val
!=
nil
{
dataStr
=
fmt
.
Sprintf
(
"%v"
,
val
)
dataStr
=
raw
.
Print
(
r
.
handler
.
DecodeOut
(
r
.
outData
))
}
max
:=
1024
...
...
fuse/typeprint.go
View file @
1dbaf6ba
...
...
@@ -5,5 +5,5 @@ import (
)
func
(
a
*
Attr
)
String
()
string
{
return
((
*
raw
.
Attr
)(
a
))
.
String
(
)
return
raw
.
Print
((
*
raw
.
Attr
)(
a
)
)
}
raw/print.go
View file @
1dbaf6ba
...
...
@@ -89,23 +89,23 @@ func FlagString(names map[int64]string, fl int64, def string) string {
return
strings
.
Join
(
s
,
","
)
}
func
(
me
*
ForgetIn
)
S
tring
()
string
{
func
(
me
*
ForgetIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{%d}"
,
me
.
Nlookup
)
}
func
(
me
*
BatchForgetIn
)
S
tring
()
string
{
func
(
me
*
BatchForgetIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{%d}"
,
me
.
Count
)
}
func
(
me
*
MkdirIn
)
S
tring
()
string
{
func
(
me
*
MkdirIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{0%o (0%o)}"
,
me
.
Mode
,
me
.
Umask
)
}
func
(
me
*
MknodIn
)
S
tring
()
string
{
func
(
me
*
MknodIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{0%o (0%o), %d}"
,
me
.
Mode
,
me
.
Umask
,
me
.
Rdev
)
}
func
(
me
*
SetAttrIn
)
S
tring
()
string
{
func
(
me
*
SetAttrIn
)
s
tring
()
string
{
s
:=
[]
string
{}
if
me
.
Valid
&
FATTR_MODE
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"mode 0%o"
,
me
.
Mode
))
...
...
@@ -132,96 +132,106 @@ func (me *SetAttrIn) String() string {
return
fmt
.
Sprintf
(
"{%s}"
,
strings
.
Join
(
s
,
", "
))
}
func
(
me
*
ReleaseIn
)
S
tring
()
string
{
func
(
me
*
ReleaseIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d %s %s L%d}"
,
me
.
Fh
,
FlagString
(
OpenFlagNames
,
int64
(
me
.
Flags
),
""
),
FlagString
(
releaseFlagNames
,
int64
(
me
.
ReleaseFlags
),
""
),
me
.
LockOwner
)
}
func
(
me
*
OpenIn
)
S
tring
()
string
{
func
(
me
*
OpenIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{%s}"
,
FlagString
(
OpenFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
))
}
func
(
me
*
OpenOut
)
S
tring
()
string
{
func
(
me
*
OpenOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d %s}"
,
me
.
Fh
,
FlagString
(
FuseOpenFlagNames
,
int64
(
me
.
OpenFlags
),
""
))
}
func
(
me
*
InitIn
)
S
tring
()
string
{
func
(
me
*
InitIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{%d.%d Ra 0x%x %s}"
,
me
.
Major
,
me
.
Minor
,
me
.
MaxReadAhead
,
FlagString
(
initFlagNames
,
int64
(
me
.
Flags
),
""
))
}
func
(
me
*
InitOut
)
S
tring
()
string
{
func
(
me
*
InitOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{%d.%d Ra 0x%x %s %d/%d Wr 0x%x}"
,
me
.
Major
,
me
.
Minor
,
me
.
MaxReadAhead
,
FlagString
(
initFlagNames
,
int64
(
me
.
Flags
),
""
),
me
.
CongestionThreshold
,
me
.
MaxBackground
,
me
.
MaxWrite
)
}
func
(
me
*
SetXAttrIn
)
S
tring
()
string
{
func
(
me
*
SetXAttrIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{sz %d f%o}"
,
me
.
Size
,
me
.
Flags
)
}
func
(
me
*
GetXAttrIn
)
S
tring
()
string
{
func
(
me
*
GetXAttrIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
}
func
(
me
*
GetXAttrOut
)
S
tring
()
string
{
func
(
me
*
GetXAttrOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
}
func
(
me
*
AccessIn
)
S
tring
()
string
{
func
(
me
*
AccessIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{%s}"
,
FlagString
(
accessFlagName
,
int64
(
me
.
Mask
),
""
))
}
func
(
me
*
CreateIn
)
S
tring
()
string
{
func
(
me
*
CreateIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{0%o [%s] (0%o)}"
,
me
.
Mode
,
FlagString
(
OpenFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
),
me
.
Umask
)
}
func
(
me
*
FlushIn
)
S
tring
()
string
{
func
(
me
*
FlushIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d}"
,
me
.
Fh
)
}
func
(
me
*
AttrOut
)
S
tring
()
string
{
func
(
me
*
AttrOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{A%d.%09d %v}"
,
me
.
AttrValid
,
me
.
AttrValidNsec
,
&
me
.
Attr
)
}
func
(
me
*
EntryOut
)
S
tring
()
string
{
func
(
me
*
EntryOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{%d E%d.%09d A%d.%09d %v}"
,
me
.
NodeId
,
me
.
EntryValid
,
me
.
EntryValidNsec
,
me
.
AttrValid
,
me
.
AttrValidNsec
,
&
me
.
Attr
)
}
func
(
me
*
CreateOut
)
S
tring
()
string
{
func
(
me
*
CreateOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{%v %v}"
,
&
me
.
EntryOut
,
&
me
.
OpenOut
)
}
func
(
me
*
StatfsOut
)
S
tring
()
string
{
func
(
me
*
StatfsOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{b%d f%d fs%d ff%d bs%d nl%d frs%d}"
,
me
.
Blocks
,
me
.
Bfree
,
me
.
Bavail
,
me
.
Files
,
me
.
Ffree
,
me
.
Bsize
,
me
.
NameLen
,
me
.
Frsize
)
}
func
(
o
*
NotifyInvalEntryOut
)
S
tring
()
string
{
func
(
o
*
NotifyInvalEntryOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{parent %d sz %d}"
,
o
.
Parent
,
o
.
NameLen
)
}
func
(
o
*
NotifyInvalInodeOut
)
S
tring
()
string
{
func
(
o
*
NotifyInvalInodeOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{ino %d off %d sz %d}"
,
o
.
Ino
,
o
.
Off
,
o
.
Length
)
}
func
(
o
*
NotifyInvalDeleteOut
)
S
tring
()
string
{
func
(
o
*
NotifyInvalDeleteOut
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{parent %d ch %d sz %d}"
,
o
.
Parent
,
o
.
Child
,
o
.
NameLen
)
}
func
(
f
*
FallocateIn
)
S
tring
()
string
{
func
(
f
*
FallocateIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d off %d sz %d mod 0%o}"
,
f
.
Fh
,
f
.
Offset
,
f
.
Length
,
f
.
Mode
)
}
func
Print
(
obj
interface
{})
string
{
t
,
ok
:=
obj
.
(
interface
{
string
()
string
})
if
ok
{
return
t
.
string
()
}
return
fmt
.
Sprintf
(
"%v"
,
obj
)
}
raw/print_darwin.go
View file @
1dbaf6ba
...
...
@@ -10,7 +10,7 @@ func init() {
initFlagNames
[
CAP_CASE_INSENSITIVE
]
=
"CASE_INSENSITIVE"
}
func
(
a
*
Attr
)
S
tring
()
string
{
func
(
a
*
Attr
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{M0%o SZ=%d L=%d "
+
"%d:%d "
+
...
...
@@ -25,15 +25,15 @@ func (a *Attr) String() string {
a
.
Ctime
,
a
.
Ctimensec
)
}
func
(
me
*
GetAttrIn
)
S
tring
()
string
{
return
""
}
func
(
me
*
GetAttrIn
)
s
tring
()
string
{
return
""
}
func
(
me
*
ReadIn
)
S
tring
()
string
{
func
(
me
*
ReadIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d off %d sz %d %s L %d %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
FlagString
(
readFlagNames
,
int64
(
me
.
ReadFlags
),
""
))
}
func
(
me
*
WriteIn
)
S
tring
()
string
{
func
(
me
*
WriteIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d off %d sz %d %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
FlagString
(
writeFlagNames
,
int64
(
me
.
WriteFlags
),
""
))
...
...
raw/print_linux.go
View file @
1dbaf6ba
...
...
@@ -12,7 +12,7 @@ func init() {
}
func
(
a
*
Attr
)
S
tring
()
string
{
func
(
a
*
Attr
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{M0%o SZ=%d L=%d "
+
"%d:%d "
+
...
...
@@ -27,11 +27,11 @@ func (a *Attr) String() string {
a
.
Ctime
,
a
.
Ctimensec
)
}
func
(
me
*
GetAttrIn
)
S
tring
()
string
{
func
(
me
*
GetAttrIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d}"
,
me
.
Fh_
)
}
func
(
me
*
ReadIn
)
S
tring
()
string
{
func
(
me
*
ReadIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d off %d sz %d %s L %d %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
FlagString
(
readFlagNames
,
int64
(
me
.
ReadFlags
),
""
),
...
...
@@ -39,7 +39,7 @@ func (me *ReadIn) String() string {
FlagString
(
OpenFlagNames
,
int64
(
me
.
Flags
),
"RDONLY"
))
}
func
(
me
*
WriteIn
)
S
tring
()
string
{
func
(
me
*
WriteIn
)
s
tring
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d off %d sz %d %s L %d %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
FlagString
(
writeFlagNames
,
int64
(
me
.
WriteFlags
),
""
),
...
...
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