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
14272431
Commit
14272431
authored
Mar 23, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
7e4c459b
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
21 additions
and
28 deletions
+21
-28
example/bulkstat/bulkstat.go
example/bulkstat/bulkstat.go
+4
-4
example/loopback/loopback.go
example/loopback/loopback.go
+1
-1
examplelib/misc.go
examplelib/misc.go
+0
-1
examplelib/multizip.go
examplelib/multizip.go
+0
-2
examplelib/multizip_test.go
examplelib/multizip_test.go
+4
-4
examplelib/zipfs_test.go
examplelib/zipfs_test.go
+1
-1
fuse/fuse.go
fuse/fuse.go
+6
-6
fuse/misc.go
fuse/misc.go
+3
-3
fuse/mount.go
fuse/mount.go
+2
-2
fuse/timingrawfs.go
fuse/timingrawfs.go
+0
-1
fuse/wrappedfs.go
fuse/wrappedfs.go
+0
-3
No files found.
example/bulkstat/bulkstat.go
View file @
14272431
...
@@ -17,7 +17,7 @@ func main() {
...
@@ -17,7 +17,7 @@ func main() {
filename
:=
flag
.
Args
()[
0
]
filename
:=
flag
.
Args
()[
0
]
f
,
err
:=
os
.
Open
(
filename
,
os
.
O_RDONLY
,
0
)
f
,
err
:=
os
.
Open
(
filename
,
os
.
O_RDONLY
,
0
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
"err"
+
err
.
String
())
panic
(
"err"
+
err
.
String
())
}
}
linelen
:=
1000
linelen
:=
1000
...
@@ -37,7 +37,7 @@ func main() {
...
@@ -37,7 +37,7 @@ func main() {
dts
:=
make
(
chan
int64
,
parallel
)
dts
:=
make
(
chan
int64
,
parallel
)
fmt
.
Printf
(
"Statting %d files with %d threads
\n
"
,
len
(
files
),
parallel
)
fmt
.
Printf
(
"Statting %d files with %d threads
\n
"
,
len
(
files
),
parallel
)
for
i
:=
0
;
i
<
parallel
;
i
++
{
for
i
:=
0
;
i
<
parallel
;
i
++
{
go
func
()
{
go
func
()
{
for
{
for
{
fn
:=
<-
todo
fn
:=
<-
todo
...
@@ -57,7 +57,7 @@ func main() {
...
@@ -57,7 +57,7 @@ func main() {
}
}
total
:=
0.0
total
:=
0.0
for
i
:=
0
;
i
<
len
(
files
);
i
++
{
for
i
:=
0
;
i
<
len
(
files
);
i
++
{
total
+=
float64
(
<-
dts
)
*
1e-6
total
+=
float64
(
<-
dts
)
*
1e-6
}
}
...
...
example/loopback/loopback.go
View file @
14272431
...
@@ -71,7 +71,7 @@ func main() {
...
@@ -71,7 +71,7 @@ func main() {
hot
,
unique
:=
timing
.
HotPaths
(
"GetAttr"
)
hot
,
unique
:=
timing
.
HotPaths
(
"GetAttr"
)
top
:=
20
top
:=
20
start
:=
len
(
hot
)
-
top
start
:=
len
(
hot
)
-
top
if
start
<
0
{
if
start
<
0
{
start
=
0
start
=
0
}
}
...
...
examplelib/misc.go
View file @
14272431
...
@@ -27,4 +27,3 @@ func CheckSuccess(e os.Error) {
...
@@ -27,4 +27,3 @@ func CheckSuccess(e os.Error) {
panic
(
fmt
.
Sprintf
(
"Unexpected error: %v"
,
e
))
panic
(
fmt
.
Sprintf
(
"Unexpected error: %v"
,
e
))
}
}
}
}
examplelib/multizip.go
View file @
14272431
...
@@ -223,5 +223,3 @@ func (me *MultiZipFs) Create(name string, flags uint32, mode uint32) (file fuse.
...
@@ -223,5 +223,3 @@ func (me *MultiZipFs) Create(name string, flags uint32, mode uint32) (file fuse.
return
z
,
fuse
.
OK
return
z
,
fuse
.
OK
}
}
examplelib/multizip_test.go
View file @
14272431
...
@@ -23,7 +23,7 @@ func TestMultiZipFs(t *testing.T) {
...
@@ -23,7 +23,7 @@ func TestMultiZipFs(t *testing.T) {
go
state
.
Loop
(
true
)
go
state
.
Loop
(
true
)
f
,
err
:=
os
.
Open
(
mountPoint
+
""
,
os
.
O_RDONLY
,
0
)
f
,
err
:=
os
.
Open
(
mountPoint
+
""
,
os
.
O_RDONLY
,
0
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
names
,
err
:=
f
.
Readdirnames
(
-
1
)
names
,
err
:=
f
.
Readdirnames
(
-
1
)
...
@@ -35,16 +35,16 @@ func TestMultiZipFs(t *testing.T) {
...
@@ -35,16 +35,16 @@ func TestMultiZipFs(t *testing.T) {
err
=
f
.
Close
()
err
=
f
.
Close
()
CheckSuccess
(
err
)
CheckSuccess
(
err
)
f
,
err
=
os
.
Open
(
mountPoint
+
"/random"
,
os
.
O_WRONLY
|
os
.
O_CREATE
,
0
)
f
,
err
=
os
.
Open
(
mountPoint
+
"/random"
,
os
.
O_WRONLY
|
os
.
O_CREATE
,
0
)
if
err
==
nil
{
if
err
==
nil
{
t
.
Error
(
"Must fail writing in root."
)
t
.
Error
(
"Must fail writing in root."
)
}
}
f
,
err
=
os
.
Open
(
mountPoint
+
"/config/zipmount"
,
os
.
O_WRONLY
,
0
)
f
,
err
=
os
.
Open
(
mountPoint
+
"/config/zipmount"
,
os
.
O_WRONLY
,
0
)
if
err
==
nil
{
if
err
==
nil
{
t
.
Error
(
"Must fail without O_CREATE"
)
t
.
Error
(
"Must fail without O_CREATE"
)
}
}
f
,
err
=
os
.
Open
(
mountPoint
+
"/config/zipmount"
,
os
.
O_WRONLY
|
os
.
O_CREATE
,
0
)
f
,
err
=
os
.
Open
(
mountPoint
+
"/config/zipmount"
,
os
.
O_WRONLY
|
os
.
O_CREATE
,
0
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
// Directory exists, but is empty.
// Directory exists, but is empty.
...
...
examplelib/zipfs_test.go
View file @
14272431
...
@@ -43,7 +43,7 @@ func TestZipFs(t *testing.T) {
...
@@ -43,7 +43,7 @@ func TestZipFs(t *testing.T) {
t
.
Error
(
"file type"
,
fi
)
t
.
Error
(
"file type"
,
fi
)
}
}
f
,
err
:=
os
.
Open
(
mountPoint
+
"/file.txt"
,
os
.
O_RDONLY
,
0
)
f
,
err
:=
os
.
Open
(
mountPoint
+
"/file.txt"
,
os
.
O_RDONLY
,
0
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
b
:=
make
([]
byte
,
1024
)
b
:=
make
([]
byte
,
1024
)
...
...
fuse/fuse.go
View file @
14272431
...
@@ -254,7 +254,7 @@ func (me *MountState) Stats() string {
...
@@ -254,7 +254,7 @@ func (me *MountState) Stats() string {
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// Logic for the control loop.
// Logic for the control loop.
func
(
me
*
MountState
)
newFuseRequest
()
(
*
fuseRequest
)
{
func
(
me
*
MountState
)
newFuseRequest
()
*
fuseRequest
{
req
:=
new
(
fuseRequest
)
req
:=
new
(
fuseRequest
)
req
.
status
=
OK
req
.
status
=
OK
req
.
inputBuf
=
me
.
buffers
.
AllocBuffer
(
bufSize
)
req
.
inputBuf
=
me
.
buffers
.
AllocBuffer
(
bufSize
)
...
...
fuse/misc.go
View file @
14272431
...
@@ -18,7 +18,7 @@ import (
...
@@ -18,7 +18,7 @@ import (
// Make a temporary directory securely.
// Make a temporary directory securely.
func
MakeTempDir
()
string
{
func
MakeTempDir
()
string
{
nm
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
;
nm
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
"TempDir() failed: "
+
err
.
String
())
panic
(
"TempDir() failed: "
+
err
.
String
())
}
}
...
...
fuse/mount.go
View file @
14272431
...
@@ -53,7 +53,7 @@ func mount(mountPoint string) (f *os.File, finalMountPoint string, err os.Error)
...
@@ -53,7 +53,7 @@ func mount(mountPoint string) (f *os.File, finalMountPoint string, err os.Error)
proc
,
err
:=
os
.
StartProcess
(
"/bin/fusermount"
,
proc
,
err
:=
os
.
StartProcess
(
"/bin/fusermount"
,
[]
string
{
"/bin/fusermount"
,
mountPoint
},
[]
string
{
"/bin/fusermount"
,
mountPoint
},
&
os
.
ProcAttr
{
&
os
.
ProcAttr
{
Env
:
[]
string
{
"_FUSE_COMMFD=3"
},
Env
:
[]
string
{
"_FUSE_COMMFD=3"
},
Files
:
[]
*
os
.
File
{
os
.
Stdin
,
os
.
Stdout
,
os
.
Stderr
,
remote
}})
Files
:
[]
*
os
.
File
{
os
.
Stdin
,
os
.
Stdout
,
os
.
Stderr
,
remote
}})
if
err
!=
nil
{
if
err
!=
nil
{
...
...
fuse/timingrawfs.go
View file @
14272431
...
@@ -170,4 +170,3 @@ func (me *TimingRawFilesystem) ReleaseDir(header *InHeader, f RawFuseDir) {
...
@@ -170,4 +170,3 @@ func (me *TimingRawFilesystem) ReleaseDir(header *InHeader, f RawFuseDir) {
defer
me
.
startTimer
(
"ReleaseDir"
)()
defer
me
.
startTimer
(
"ReleaseDir"
)()
me
.
original
.
ReleaseDir
(
header
,
f
)
me
.
original
.
ReleaseDir
(
header
,
f
)
}
}
fuse/wrappedfs.go
View file @
14272431
...
@@ -188,6 +188,3 @@ func (me *WrappingRawFilesystem) Release(header *InHeader, f RawFuseFile) {
...
@@ -188,6 +188,3 @@ func (me *WrappingRawFilesystem) Release(header *InHeader, f RawFuseFile) {
func
(
me
*
WrappingRawFilesystem
)
ReleaseDir
(
header
*
InHeader
,
f
RawFuseDir
)
{
func
(
me
*
WrappingRawFilesystem
)
ReleaseDir
(
header
*
InHeader
,
f
RawFuseDir
)
{
me
.
original
.
ReleaseDir
(
header
,
f
)
me
.
original
.
ReleaseDir
(
header
,
f
)
}
}
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