Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
jacobsa-fuse
Commits
497407fd
Commit
497407fd
authored
Jul 24, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better debug logging for getattr.
parent
85cd1cb2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
2 deletions
+28
-2
connection.go
connection.go
+2
-2
fuseops/common_op.go
fuseops/common_op.go
+5
-0
fuseops/ops.go
fuseops/ops.go
+11
-0
fuseops/simple_types.go
fuseops/simple_types.go
+10
-0
No files found.
connection.go
View file @
497407fd
...
...
@@ -248,9 +248,9 @@ func (c *Connection) ReadOp() (op fuseops.Op, err error) {
// Debug logging
if
c
.
debugLogger
!=
nil
{
if
opErr
==
nil
{
op
.
Logf
(
"->
%s OK"
,
op
.
ShortDesc
())
op
.
Logf
(
"->
OK: %s"
,
op
.
DebugString
())
}
else
{
op
.
Logf
(
"->
%s error: %v"
,
op
.
ShortDesc
()
,
opErr
)
op
.
Logf
(
"->
error: %v"
,
opErr
)
}
}
...
...
fuseops/common_op.go
View file @
497407fd
...
...
@@ -90,6 +90,11 @@ func (o *commonOp) ShortDesc() (desc string) {
return
}
func
(
o
*
commonOp
)
DebugString
()
string
{
// By default, defer to ShortDesc.
return
o
.
op
.
ShortDesc
()
}
func
(
o
*
commonOp
)
init
(
ctx
context
.
Context
,
op
internalOp
,
...
...
fuseops/ops.go
View file @
497407fd
...
...
@@ -32,6 +32,9 @@ type Op interface {
// A short description of the op, to be used in logging.
ShortDesc
()
string
// A long description of the op, to be used in debug logging.
DebugString
()
string
// A context that can be used for long-running operations.
Context
()
context
.
Context
...
...
@@ -122,6 +125,14 @@ func (o *GetInodeAttributesOp) kernelResponse() (msg []byte) {
return
}
func
(
o
*
GetInodeAttributesOp
)
DebugString
()
string
{
return
fmt
.
Sprintf
(
"Inode: %d, Exp: %v, Attr: %s"
,
o
.
Inode
,
o
.
AttributesExpiration
,
o
.
Attributes
.
DebugString
())
}
// Change attributes for an inode.
//
// The kernel sends this for obvious cases like chmod(2), and for less obvious
...
...
fuseops/simple_types.go
View file @
497407fd
...
...
@@ -97,6 +97,16 @@ type InodeAttributes struct {
Gid
uint32
}
func
(
a
*
InodeAttributes
)
DebugString
()
string
{
return
fmt
.
Sprintf
(
"%d %d %v %d %d"
,
a
.
Size
,
a
.
Nlink
,
a
.
Mode
,
a
.
Uid
,
a
.
Gid
)
}
// A generation number for an inode. Irrelevant for file systems that won't be
// exported over NFS. For those that will and that reuse inode IDs when they
// become free, the generation number must change when an ID is reused.
...
...
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