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
0ba056ea
Commit
0ba056ea
authored
Mar 29, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: make debug string more verbose
parent
72219aef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
nodefs/inode.go
nodefs/inode.go
+17
-3
No files found.
nodefs/inode.go
View file @
0ba056ea
...
...
@@ -130,14 +130,28 @@ func (n *Inode) Root() *Inode {
return
n
.
bridge
.
root
}
func
modeStr
(
m
uint32
)
string
{
return
map
[
uint32
]
string
{
syscall
.
S_IFREG
:
"reg"
,
syscall
.
S_IFLNK
:
"lnk"
,
syscall
.
S_IFDIR
:
"dir"
,
syscall
.
S_IFSOCK
:
"soc"
,
syscall
.
S_IFIFO
:
"pip"
,
syscall
.
S_IFCHR
:
"chr"
,
syscall
.
S_IFBLK
:
"blk"
,
}[
m
]
}
// debugString is used for debugging. Racy.
func
(
n
*
Inode
)
debugString
()
string
{
func
(
n
*
Inode
)
String
()
string
{
n
.
mu
.
Lock
()
defer
n
.
mu
.
Unlock
()
var
ss
[]
string
for
nm
,
ch
:=
range
n
.
children
{
ss
=
append
(
ss
,
fmt
.
Sprintf
(
"%q=%d
"
,
nm
,
ch
.
nodeAttr
.
Ino
))
ss
=
append
(
ss
,
fmt
.
Sprintf
(
"%q=%d
[%s]"
,
nm
,
ch
.
nodeAttr
.
Ino
,
modeStr
(
ch
.
nodeAttr
.
Mode
)
))
}
return
fmt
.
Sprintf
(
"%d
: %s"
,
n
.
nodeAttr
,
strings
.
Join
(
ss
,
","
))
return
fmt
.
Sprintf
(
"%d
[%s]: %s"
,
n
.
nodeAttr
.
Ino
,
modeStr
(
n
.
nodeAttr
.
Mode
)
,
strings
.
Join
(
ss
,
","
))
}
// sortNodes rearranges inode group in consistent order.
...
...
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