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
a3347006
Commit
a3347006
authored
Jun 30, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
0bf98e92
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
30 additions
and
32 deletions
+30
-32
benchmark/latencymap.go
benchmark/latencymap.go
+0
-1
benchmark/latencymap_test.go
benchmark/latencymap_test.go
+3
-3
benchmark/statfs.go
benchmark/statfs.go
+2
-2
example/loopback/main.go
example/loopback/main.go
+1
-1
example/memfs/main.go
example/memfs/main.go
+1
-1
fuse/nodefs/handle.go
fuse/nodefs/handle.go
+0
-1
fuse/nodefs/lockingfile.go
fuse/nodefs/lockingfile.go
+4
-4
fuse/nodefs/memnode_test.go
fuse/nodefs/memnode_test.go
+1
-1
fuse/server.go
fuse/server.go
+3
-3
fuse/test/fsetattr_test.go
fuse/test/fsetattr_test.go
+4
-4
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+11
-11
No files found.
benchmark/latencymap.go
View file @
a3347006
...
...
@@ -50,4 +50,3 @@ func (m *LatencyMap) Counts() map[string]int {
return
r
}
benchmark/latencymap_test.go
View file @
a3347006
...
...
@@ -7,10 +7,10 @@ import (
func
TestLatencyMap
(
t
*
testing
.
T
)
{
m
:=
NewLatencyMap
()
m
.
Add
(
"foo"
,
100
*
time
.
Millisecond
)
m
.
Add
(
"foo"
,
200
*
time
.
Millisecond
)
m
.
Add
(
"foo"
,
100
*
time
.
Millisecond
)
m
.
Add
(
"foo"
,
200
*
time
.
Millisecond
)
c
,
d
:=
m
.
Get
(
"foo"
)
if
c
!=
2
||
d
!=
300
*
time
.
Millisecond
{
if
c
!=
2
||
d
!=
300
*
time
.
Millisecond
{
t
.
Errorf
(
"got %v, %d, want 2, 150ms"
,
c
,
d
)
}
}
benchmark/statfs.go
View file @
a3347006
...
...
@@ -63,7 +63,7 @@ func (me *StatFs) OpenDir(name string, context *fuse.Context) (stream []fuse.Dir
func
NewStatFs
()
*
StatFs
{
return
&
StatFs
{
FileSystem
:
pathfs
.
NewDefaultFileSystem
(),
entries
:
make
(
map
[
string
]
*
fuse
.
Attr
),
dirs
:
make
(
map
[
string
][]
fuse
.
DirEntry
),
entries
:
make
(
map
[
string
]
*
fuse
.
Attr
),
dirs
:
make
(
map
[
string
][]
fuse
.
DirEntry
),
}
}
example/loopback/main.go
View file @
a3347006
...
...
@@ -48,7 +48,7 @@ func main() {
mOpts
:=
&
fuse
.
MountOptions
{
AllowOther
:
*
other
,
}
state
,
err
:=
fuse
.
NewServer
(
conn
.
RawFS
(),
mountPoint
,
mOpts
)
state
,
err
:=
fuse
.
NewServer
(
conn
.
RawFS
(),
mountPoint
,
mOpts
)
if
err
!=
nil
{
fmt
.
Printf
(
"Mount fail: %v
\n
"
,
err
)
os
.
Exit
(
1
)
...
...
example/memfs/main.go
View file @
a3347006
...
...
@@ -25,7 +25,7 @@ func main() {
prefix
:=
flag
.
Arg
(
1
)
fs
:=
nodefs
.
NewMemNodeFs
(
prefix
)
conn
:=
nodefs
.
NewFileSystemConnector
(
fs
,
nil
)
server
,
err
:=
fuse
.
NewServer
(
conn
.
RawFS
(),
mountPoint
,
nil
)
server
,
err
:=
fuse
.
NewServer
(
conn
.
RawFS
(),
mountPoint
,
nil
)
if
err
!=
nil
{
fmt
.
Printf
(
"Mount fail: %v
\n
"
,
err
)
os
.
Exit
(
1
)
...
...
fuse/nodefs/handle.go
View file @
a3347006
...
...
@@ -313,7 +313,6 @@ func (m *int64HandleMap) Handle(obj *handled) (handle uint64) {
return
m
.
handle
(
obj
)
}
func
(
m
*
int64HandleMap
)
Forget
(
handle
uint64
,
count
int
)
(
forgotten
bool
,
obj
*
handled
)
{
defer
m
.
verify
()
obj
=
m
.
Decode
(
handle
)
...
...
fuse/nodefs/lockingfile.go
View file @
a3347006
...
...
@@ -2,14 +2,14 @@ package nodefs
import
(
"fmt"
"time"
"sync"
"time"
"github.com/hanwen/go-fuse/fuse"
)
type
lockingFile
struct
{
mu
*
sync
.
Mutex
mu
*
sync
.
Mutex
file
File
}
...
...
@@ -17,8 +17,8 @@ type lockingFile struct {
// every operation.
func
NewLockingFile
(
mu
*
sync
.
Mutex
,
f
File
)
File
{
return
&
lockingFile
{
mu
:
mu
,
file
:
f
,
mu
:
mu
,
file
:
f
,
}
}
...
...
fuse/nodefs/memnode_test.go
View file @
a3347006
...
...
@@ -36,7 +36,7 @@ func setupMemNodeTest(t *testing.T) (wd string, fs FileSystem, clean func()) {
if
err
!=
nil
{
t
.
Fatal
(
"NewServer"
,
err
)
}
//me.state.SetDebug(false)
state
.
SetDebug
(
fuse
.
VerboseTest
())
...
...
fuse/server.go
View file @
a3347006
...
...
@@ -127,10 +127,10 @@ func NewServer(fs RawFileSystem, mountPoint string, opts *MountOptions) (*Server
opts
=
&
o
ms
:=
&
Server
{
fileSystem
:
fs
,
started
:
make
(
chan
struct
{}),
opts
:
&
o
,
started
:
make
(
chan
struct
{}),
opts
:
&
o
,
}
optStrs
:=
opts
.
Options
if
opts
.
AllowOther
{
optStrs
=
append
(
optStrs
,
"allow_other"
)
...
...
fuse/test/fsetattr_test.go
View file @
a3347006
...
...
@@ -154,10 +154,10 @@ func setupFAttrTest(t *testing.T, fs pathfs.FileSystem) (dir string, clean func(
}
return
dir
,
func
()
{
if
state
.
Unmount
()
==
nil
{
os
.
RemoveAll
(
dir
)
}
if
state
.
Unmount
()
==
nil
{
os
.
RemoveAll
(
dir
)
}
}
}
func
TestDataReadLarge
(
t
*
testing
.
T
)
{
...
...
@@ -222,7 +222,7 @@ func TestFSetAttr(t *testing.T) {
a
,
status
=
fs
.
GetAttr
(
"file"
,
nil
)
if
!
status
.
Ok
()
||
a
.
Mode
&
07777
!=
024
{
t
.
Errorf
(
"chmod: %o, status %v"
,
a
.
Mode
&
0777
,
status
)
t
.
Errorf
(
"chmod: %o, status %v"
,
a
.
Mode
&
0777
,
status
)
}
err
=
os
.
Chtimes
(
fn
,
time
.
Unix
(
0
,
100e3
),
time
.
Unix
(
0
,
101e3
))
...
...
unionfs/unionfs_test.go
View file @
a3347006
...
...
@@ -1083,11 +1083,11 @@ func TestUnionFsDropCache(t *testing.T) {
type
disappearingFS
struct
{
pathfs
.
FileSystem
normal
pathfs
.
FileSystem
nop
pathfs
.
FileSystem
visible
bool
visibleChan
chan
bool
normal
pathfs
.
FileSystem
nop
pathfs
.
FileSystem
visible
bool
visibleChan
chan
bool
}
func
(
d
*
disappearingFS
)
fs
()
pathfs
.
FileSystem
{
...
...
@@ -1111,14 +1111,14 @@ func (d *disappearingFS) GetAttr(name string, context *fuse.Context) (a *fuse.At
func
(
d
*
disappearingFS
)
OpenDir
(
name
string
,
context
*
fuse
.
Context
)
([]
fuse
.
DirEntry
,
fuse
.
Status
)
{
return
d
.
fs
()
.
OpenDir
(
name
,
context
)
}
func
newDisappearingFS
(
fs
,
nop
pathfs
.
FileSystem
)
*
disappearingFS
{
return
&
disappearingFS
{
visibleChan
:
make
(
chan
bool
,
1
),
visible
:
true
,
normal
:
fs
,
nop
:
nop
,
FileSystem
:
fs
,
visible
:
true
,
normal
:
fs
,
nop
:
nop
,
FileSystem
:
fs
,
}
}
...
...
@@ -1142,7 +1142,7 @@ func TestUnionFsDisappearing(t *testing.T) {
t
.
Fatalf
(
"Mkdir failed: %v"
,
err
)
}
wrFs
:=
newDisappearingFS
(
pathfs
.
NewLoopbackFileSystem
(
wd
+
"/rw"
),
wrFs
:=
newDisappearingFS
(
pathfs
.
NewLoopbackFileSystem
(
wd
+
"/rw"
),
pathfs
.
NewLoopbackFileSystem
(
"/dev/null"
))
var
fses
[]
pathfs
.
FileSystem
fses
=
append
(
fses
,
pathfs
.
NewLockingFileSystem
(
wrFs
))
...
...
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