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
b16becb1
Commit
b16becb1
authored
Apr 03, 2015
by
Daniel Martí
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix building (go build ./...)
parent
1104e6ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
example/statfs/main.go
example/statfs/main.go
+8
-8
No files found.
example/statfs/main.go
View file @
b16becb1
...
...
@@ -3,8 +3,6 @@ package main
import
(
"flag"
"fmt"
"github.com/hanwen/go-fuse/benchmark"
"github.com/hanwen/go-fuse/fuse"
"io"
"log"
"os"
...
...
@@ -13,12 +11,15 @@ import (
"runtime/pprof"
"strings"
"time"
"github.com/hanwen/go-fuse/benchmark"
"github.com/hanwen/go-fuse/fuse/nodefs"
"github.com/hanwen/go-fuse/fuse/pathfs"
)
func
main
()
{
// Scans the arg list and sets up flags
debug
:=
flag
.
Bool
(
"debug"
,
false
,
"print debugging messages."
)
latencies
:=
flag
.
Bool
(
"latencies"
,
false
,
"record operation latencies."
)
profile
:=
flag
.
String
(
"profile"
,
""
,
"record cpu profile."
)
mem_profile
:=
flag
.
String
(
"mem-profile"
,
""
,
"record memory profile."
)
command
:=
flag
.
String
(
"run"
,
""
,
"run this command after mounting."
)
...
...
@@ -48,18 +49,17 @@ func main() {
for
_
,
l
:=
range
lines
{
fs
.
AddFile
(
l
)
}
nfs
:=
fuse
.
NewPathNodeFs
(
fs
,
nil
)
opts
:=
&
fuse
.
FileSystem
Options
{
nfs
:=
pathfs
.
NewPathNodeFs
(
fs
,
nil
)
opts
:=
&
nodefs
.
Options
{
AttrTimeout
:
time
.
Duration
(
*
ttl
*
float64
(
time
.
Second
)),
EntryTimeout
:
time
.
Duration
(
*
ttl
*
float64
(
time
.
Second
)),
}
state
,
_
,
err
:=
fuse
.
MountNodeFileSystem
(
flag
.
Arg
(
0
),
nfs
,
opts
)
state
,
_
,
err
:=
nodefs
.
MountRoot
(
flag
.
Arg
(
0
),
nfs
.
Root
()
,
opts
)
if
err
!=
nil
{
fmt
.
Printf
(
"Mount fail: %v
\n
"
,
err
)
os
.
Exit
(
1
)
}
state
.
SetRecordStatistics
(
*
latencies
)
state
.
SetDebug
(
*
debug
)
runtime
.
GC
()
if
profFile
!=
nil
{
...
...
@@ -74,7 +74,7 @@ func main() {
cmd
.
Start
()
}
state
.
Loop
()
state
.
Serve
()
if
memProfFile
!=
nil
{
pprof
.
WriteHeapProfile
(
memProfFile
)
}
...
...
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