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
95bb0f93
Commit
95bb0f93
authored
Mar 23, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: hide FlagString and OpenFlagNames/FuseOpenFlagNames
parent
eea9afa9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
50 deletions
+23
-50
fuse/nodefs/print.go
fuse/nodefs/print.go
+0
-18
fuse/print.go
fuse/print.go
+12
-20
fuse/print_darwin.go
fuse/print_darwin.go
+3
-3
fuse/print_linux.go
fuse/print_linux.go
+8
-9
No files found.
fuse/nodefs/print.go
deleted
100644 → 0
View file @
eea9afa9
// Copyright 2016 the Go-FUSE Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
nodefs
import
(
"fmt"
"github.com/hanwen/go-fuse/fuse"
)
// String provides a debug string for the given file.
func
(
f
*
WithFlags
)
String
()
string
{
return
fmt
.
Sprintf
(
"File %s (%s) %s %s"
,
f
.
File
,
f
.
Description
,
fuse
.
FlagString
(
fuse
.
OpenFlagNames
,
int64
(
f
.
OpenFlags
),
"O_RDONLY"
),
fuse
.
FlagString
(
fuse
.
FuseOpenFlagNames
,
int64
(
f
.
FuseFlags
),
""
))
}
fuse/print.go
View file @
95bb0f93
...
...
@@ -11,15 +11,7 @@ import (
"syscall"
)
var
initFlagNames
map
[
int64
]
string
var
releaseFlagNames
map
[
int64
]
string
var
OpenFlagNames
map
[
int64
]
string
var
FuseOpenFlagNames
map
[
int64
]
string
var
accessFlagName
map
[
int64
]
string
var
writeFlagNames
map
[
int64
]
string
var
readFlagNames
map
[
int64
]
string
func
init
()
{
var
(
writeFlagNames
=
map
[
int64
]
string
{
WRITE_CACHE
:
"CACHE"
,
WRITE_LOCKOWNER
:
"LOCKOWNER"
,
...
...
@@ -57,7 +49,7 @@ func init() {
releaseFlagNames
=
map
[
int64
]
string
{
RELEASE_FLUSH
:
"FLUSH"
,
}
O
penFlagNames
=
map
[
int64
]
string
{
o
penFlagNames
=
map
[
int64
]
string
{
int64
(
os
.
O_WRONLY
)
:
"WRONLY"
,
int64
(
os
.
O_RDWR
)
:
"RDWR"
,
int64
(
os
.
O_APPEND
)
:
"APPEND"
,
...
...
@@ -72,7 +64,7 @@ func init() {
int64
(
syscall
.
O_CLOEXEC
)
:
"CLOEXEC"
,
int64
(
syscall
.
O_DIRECTORY
)
:
"DIRECTORY"
,
}
F
useOpenFlagNames
=
map
[
int64
]
string
{
f
useOpenFlagNames
=
map
[
int64
]
string
{
FOPEN_DIRECT_IO
:
"DIRECT"
,
FOPEN_KEEP_CACHE
:
"CACHE"
,
FOPEN_NONSEEKABLE
:
"NONSEEK"
,
...
...
@@ -82,9 +74,9 @@ func init() {
W_OK
:
"w"
,
R_OK
:
"r"
,
}
}
)
func
F
lagString
(
names
map
[
int64
]
string
,
fl
int64
,
def
string
)
string
{
func
f
lagString
(
names
map
[
int64
]
string
,
fl
int64
,
def
string
)
string
{
s
:=
[]
string
{}
for
k
,
v
:=
range
names
{
if
fl
&
k
!=
0
{
...
...
@@ -151,30 +143,30 @@ func (me *SetAttrIn) string() string {
func
(
me
*
ReleaseIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d %s %s L%d}"
,
me
.
Fh
,
FlagString
(
O
penFlagNames
,
int64
(
me
.
Flags
),
""
),
F
lagString
(
releaseFlagNames
,
int64
(
me
.
ReleaseFlags
),
""
),
me
.
Fh
,
flagString
(
o
penFlagNames
,
int64
(
me
.
Flags
),
""
),
f
lagString
(
releaseFlagNames
,
int64
(
me
.
ReleaseFlags
),
""
),
me
.
LockOwner
)
}
func
(
me
*
OpenIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{%s}"
,
FlagString
(
O
penFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
))
return
fmt
.
Sprintf
(
"{%s}"
,
flagString
(
o
penFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
))
}
func
(
me
*
OpenOut
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d %s}"
,
me
.
Fh
,
FlagString
(
F
useOpenFlagNames
,
int64
(
me
.
OpenFlags
),
""
))
flagString
(
f
useOpenFlagNames
,
int64
(
me
.
OpenFlags
),
""
))
}
func
(
me
*
InitIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{%d.%d Ra 0x%x %s}"
,
me
.
Major
,
me
.
Minor
,
me
.
MaxReadAhead
,
F
lagString
(
initFlagNames
,
int64
(
me
.
Flags
),
""
))
f
lagString
(
initFlagNames
,
int64
(
me
.
Flags
),
""
))
}
func
(
me
*
InitOut
)
string
()
string
{
return
fmt
.
Sprintf
(
"{%d.%d Ra 0x%x %s %d/%d Wr 0x%x Tg 0x%x}"
,
me
.
Major
,
me
.
Minor
,
me
.
MaxReadAhead
,
F
lagString
(
initFlagNames
,
int64
(
me
.
Flags
),
""
),
f
lagString
(
initFlagNames
,
int64
(
me
.
Flags
),
""
),
me
.
CongestionThreshold
,
me
.
MaxBackground
,
me
.
MaxWrite
,
me
.
TimeGran
)
}
...
...
@@ -199,7 +191,7 @@ func (me *AccessIn) string() string {
return
fmt
.
Sprintf
(
"{u=%d g=%d %s}"
,
me
.
Uid
,
me
.
Gid
,
F
lagString
(
accessFlagName
,
int64
(
me
.
Mask
),
""
))
f
lagString
(
accessFlagName
,
int64
(
me
.
Mask
),
""
))
}
func
(
me
*
FlushIn
)
string
()
string
{
...
...
fuse/print_darwin.go
View file @
95bb0f93
...
...
@@ -32,7 +32,7 @@ func (a *Attr) string() string {
func
(
me
*
CreateIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{0%o [%s]}"
,
me
.
Mode
,
FlagString
(
O
penFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
))
flagString
(
o
penFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
))
}
func
(
me
*
GetAttrIn
)
string
()
string
{
return
""
}
...
...
@@ -44,11 +44,11 @@ func (me *MknodIn) string() string {
func
(
me
*
ReadIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d [%d +%d) %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
F
lagString
(
readFlagNames
,
int64
(
me
.
ReadFlags
),
""
))
f
lagString
(
readFlagNames
,
int64
(
me
.
ReadFlags
),
""
))
}
func
(
me
*
WriteIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d [%d +%d) %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
F
lagString
(
writeFlagNames
,
int64
(
me
.
WriteFlags
),
""
))
f
lagString
(
writeFlagNames
,
int64
(
me
.
WriteFlags
),
""
))
}
fuse/print_linux.go
View file @
95bb0f93
...
...
@@ -10,10 +10,9 @@ import (
)
func
init
()
{
OpenFlagNames
[
syscall
.
O_DIRECT
]
=
"DIRECT"
OpenFlagNames
[
syscall
.
O_LARGEFILE
]
=
"LARGEFILE"
OpenFlagNames
[
syscall_O_NOATIME
]
=
"NOATIME"
openFlagNames
[
syscall
.
O_DIRECT
]
=
"DIRECT"
openFlagNames
[
syscall
.
O_LARGEFILE
]
=
"LARGEFILE"
openFlagNames
[
syscall_O_NOATIME
]
=
"NOATIME"
}
func
(
a
*
Attr
)
string
()
string
{
...
...
@@ -34,7 +33,7 @@ func (a *Attr) string() string {
func
(
me
*
CreateIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{0%o [%s] (0%o)}"
,
me
.
Mode
,
FlagString
(
O
penFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
),
me
.
Umask
)
flagString
(
o
penFlagNames
,
int64
(
me
.
Flags
),
"O_RDONLY"
),
me
.
Umask
)
}
func
(
me
*
GetAttrIn
)
string
()
string
{
...
...
@@ -48,15 +47,15 @@ func (me *MknodIn) string() string {
func
(
me
*
ReadIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d [%d +%d) %s L %d %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
F
lagString
(
readFlagNames
,
int64
(
me
.
ReadFlags
),
""
),
f
lagString
(
readFlagNames
,
int64
(
me
.
ReadFlags
),
""
),
me
.
LockOwner
,
FlagString
(
O
penFlagNames
,
int64
(
me
.
Flags
),
"RDONLY"
))
flagString
(
o
penFlagNames
,
int64
(
me
.
Flags
),
"RDONLY"
))
}
func
(
me
*
WriteIn
)
string
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d [%d +%d) %s L %d %s}"
,
me
.
Fh
,
me
.
Offset
,
me
.
Size
,
F
lagString
(
writeFlagNames
,
int64
(
me
.
WriteFlags
),
""
),
f
lagString
(
writeFlagNames
,
int64
(
me
.
WriteFlags
),
""
),
me
.
LockOwner
,
FlagString
(
O
penFlagNames
,
int64
(
me
.
Flags
),
"RDONLY"
))
flagString
(
o
penFlagNames
,
int64
(
me
.
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