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
8effbf7f
Commit
8effbf7f
authored
Mar 26, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve debug output.
parent
4e25045b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
fuse/fuse.go
fuse/fuse.go
+11
-3
fuse/misc.go
fuse/misc.go
+8
-0
No files found.
fuse/fuse.go
View file @
8effbf7f
...
@@ -390,6 +390,10 @@ func (me *MountState) dispatch(req *fuseRequest) {
...
@@ -390,6 +390,10 @@ func (me *MountState) dispatch(req *fuseRequest) {
if
filename
!=
""
{
if
filename
!=
""
{
nm
=
"n: '"
+
filename
+
"'"
nm
=
"n: '"
+
filename
+
"'"
}
}
if
h
.
Opcode
==
FUSE_RENAME
{
nm
=
"n: '"
+
string
(
data
)
+
"'"
}
log
.
Printf
(
"Dispatch: %v, NodeId: %v %s
\n
"
,
operationName
(
h
.
Opcode
),
h
.
NodeId
,
nm
)
log
.
Printf
(
"Dispatch: %v, NodeId: %v %s
\n
"
,
operationName
(
h
.
Opcode
),
h
.
NodeId
,
nm
)
}
}
...
@@ -539,14 +543,18 @@ func serialize(req *fuseRequest, debug bool) {
...
@@ -539,14 +543,18 @@ func serialize(req *fuseRequest, debug bool) {
copy
(
req
.
outHeaderBytes
[
sizeOfOutHeader
:
],
asSlice
(
req
.
data
,
dataLength
))
copy
(
req
.
outHeaderBytes
[
sizeOfOutHeader
:
],
asSlice
(
req
.
data
,
dataLength
))
if
debug
{
if
debug
{
val
:=
fmt
.
Sprintf
(
"%v"
,
re
q
.
outHeaderBytes
)
val
:=
fmt
.
Sprintf
(
"%v"
,
re
plyString
(
req
.
inHeader
.
Opcode
,
req
.
data
)
)
max
:=
1024
max
:=
1024
if
len
(
val
)
>
max
{
if
len
(
val
)
>
max
{
val
=
val
[
:
max
]
+
fmt
.
Sprintf
(
" ...trimmed (response size %d)"
,
outHeader
.
Length
)
val
=
val
[
:
max
]
+
fmt
.
Sprintf
(
" ...trimmed (response size %d)"
,
outHeader
.
Length
)
}
}
log
.
Printf
(
"Serialize: %v code: %v value: %v flat: %d
\n
"
,
msg
:=
""
operationName
(
req
.
inHeader
.
Opcode
),
req
.
status
,
val
,
len
(
req
.
flatData
))
if
len
(
req
.
flatData
)
>
0
{
msg
=
fmt
.
Sprintf
(
" flat: %d
\n
"
,
len
(
req
.
flatData
))
}
log
.
Printf
(
"Serialize: %v code: %v value: %v%v"
,
operationName
(
req
.
inHeader
.
Opcode
),
req
.
status
,
val
,
msg
)
}
}
}
}
...
...
fuse/misc.go
View file @
8effbf7f
...
@@ -53,6 +53,14 @@ func OsErrorToFuseError(err os.Error) Status {
...
@@ -53,6 +53,14 @@ func OsErrorToFuseError(err os.Error) Status {
return
OK
return
OK
}
}
func
replyString
(
opcode
uint32
,
ptr
unsafe
.
Pointer
)
string
{
switch
opcode
{
case
FUSE_LOOKUP
:
return
fmt
.
Sprintf
(
"%v"
,
(
*
EntryOut
)(
ptr
))
}
return
""
}
func
operationName
(
opcode
uint32
)
string
{
func
operationName
(
opcode
uint32
)
string
{
switch
opcode
{
switch
opcode
{
case
FUSE_LOOKUP
:
case
FUSE_LOOKUP
:
...
...
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