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
d0f58fe6
Commit
d0f58fe6
authored
May 28, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gofmt.
parent
3aed656d
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
38 additions
and
44 deletions
+38
-44
benchmark/benchmark.go
benchmark/benchmark.go
+4
-4
fuse/api.go
fuse/api.go
+0
-1
fuse/copy.go
fuse/copy.go
+1
-1
fuse/files.go
fuse/files.go
+4
-4
fuse/fsconnector.go
fuse/fsconnector.go
+1
-1
fuse/fsetattr_test.go
fuse/fsetattr_test.go
+4
-6
fuse/inode.go
fuse/inode.go
+2
-2
fuse/loopback_test.go
fuse/loopback_test.go
+13
-13
fuse/mountstate.go
fuse/mountstate.go
+3
-2
fuse/pressure_test.go
fuse/pressure_test.go
+1
-1
fuse/read.go
fuse/read.go
+1
-4
fuse/request.go
fuse/request.go
+1
-1
fuse/types.go
fuse/types.go
+0
-1
raw/print.go
raw/print.go
+0
-1
splice/pool.go
splice/pool.go
+3
-2
No files found.
benchmark/benchmark.go
View file @
d0f58fe6
...
@@ -109,8 +109,8 @@ func AnalyzeBenchmarkRuns(label string, times []float64) {
...
@@ -109,8 +109,8 @@ func AnalyzeBenchmarkRuns(label string, times []float64) {
"avg %.3fms +/- %.0f%% "
+
"avg %.3fms +/- %.0f%% "
+
"median %.3fms, 10%%tiles: [-%.0f%%, +%.0f%%]
\n
"
,
"median %.3fms, 10%%tiles: [-%.0f%%, +%.0f%%]
\n
"
,
label
,
label
,
len
(
times
),
avg
,
100.0
*
2
*
stddev
/
avg
,
len
(
times
),
avg
,
100.0
*
2
*
stddev
/
avg
,
median
,
100
*
(
median
-
perc10
)
/
median
,
100
*
(
perc90
-
median
)
/
median
)
median
,
100
*
(
median
-
perc10
)
/
median
,
100
*
(
perc90
-
median
)
/
median
)
}
}
func
RunBulkStat
(
runs
int
,
threads
int
,
sleepTime
time
.
Duration
,
files
[]
string
)
(
results
[]
float64
)
{
func
RunBulkStat
(
runs
int
,
threads
int
,
sleepTime
time
.
Duration
,
files
[]
string
)
(
results
[]
float64
)
{
...
...
fuse/api.go
View file @
d0f58fe6
...
@@ -144,7 +144,6 @@ type PathNodeFsOptions struct {
...
@@ -144,7 +144,6 @@ type PathNodeFsOptions struct {
ClientInodes
bool
ClientInodes
bool
}
}
// A File object should be returned from FileSystem.Open and
// A File object should be returned from FileSystem.Open and
// FileSystem.Create. Include DefaultFile into the struct to inherit
// FileSystem.Create. Include DefaultFile into the struct to inherit
// a default null implementation.
// a default null implementation.
...
...
fuse/copy.go
View file @
d0f58fe6
...
@@ -17,7 +17,7 @@ func CopyFile(srcFs, destFs FileSystem, srcFile, destFile string, context *Conte
...
@@ -17,7 +17,7 @@ func CopyFile(srcFs, destFs FileSystem, srcFile, destFile string, context *Conte
return
code
return
code
}
}
dst
,
code
:=
destFs
.
Create
(
destFile
,
uint32
(
os
.
O_WRONLY
|
os
.
O_CREATE
|
os
.
O_TRUNC
),
attr
.
Mode
,
context
)
dst
,
code
:=
destFs
.
Create
(
destFile
,
uint32
(
os
.
O_WRONLY
|
os
.
O_CREATE
|
os
.
O_TRUNC
),
attr
.
Mode
,
context
)
if
!
code
.
Ok
()
{
if
!
code
.
Ok
()
{
return
code
return
code
}
}
...
...
fuse/files.go
View file @
d0f58fe6
fuse/fsconnector.go
View file @
d0f58fe6
fuse/fsetattr_test.go
View file @
d0f58fe6
...
@@ -23,7 +23,7 @@ func (f *MutableDataFile) String() string {
...
@@ -23,7 +23,7 @@ func (f *MutableDataFile) String() string {
}
}
func
(
f
*
MutableDataFile
)
Read
(
buf
[]
byte
,
off
int64
)
(
ReadResult
,
Status
)
{
func
(
f
*
MutableDataFile
)
Read
(
buf
[]
byte
,
off
int64
)
(
ReadResult
,
Status
)
{
end
:=
int
(
off
)
+
len
(
buf
)
end
:=
int
(
off
)
+
len
(
buf
)
if
end
>
len
(
f
.
data
)
{
if
end
>
len
(
f
.
data
)
{
end
=
len
(
f
.
data
)
end
=
len
(
f
.
data
)
}
}
...
@@ -158,7 +158,7 @@ func TestDataReadLarge(t *testing.T) {
...
@@ -158,7 +158,7 @@ func TestDataReadLarge(t *testing.T) {
dir
,
clean
:=
setupFAttrTest
(
t
,
fs
)
dir
,
clean
:=
setupFAttrTest
(
t
,
fs
)
defer
clean
()
defer
clean
()
content
:=
RandomData
(
385
*
1023
)
content
:=
RandomData
(
385
*
1023
)
fn
:=
dir
+
"/file"
fn
:=
dir
+
"/file"
err
:=
ioutil
.
WriteFile
(
fn
,
[]
byte
(
content
),
0644
)
err
:=
ioutil
.
WriteFile
(
fn
,
[]
byte
(
content
),
0644
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
...
@@ -168,7 +168,6 @@ func TestDataReadLarge(t *testing.T) {
...
@@ -168,7 +168,6 @@ func TestDataReadLarge(t *testing.T) {
CompareSlices
(
t
,
back
,
content
)
CompareSlices
(
t
,
back
,
content
)
}
}
func
TestFSetAttr
(
t
*
testing
.
T
)
{
func
TestFSetAttr
(
t
*
testing
.
T
)
{
fs
:=
&
FSetAttrFs
{}
fs
:=
&
FSetAttrFs
{}
dir
,
clean
:=
setupFAttrTest
(
t
,
fs
)
dir
,
clean
:=
setupFAttrTest
(
t
,
fs
)
...
@@ -215,4 +214,3 @@ func TestFSetAttr(t *testing.T) {
...
@@ -215,4 +214,3 @@ func TestFSetAttr(t *testing.T) {
}
}
// TODO - test chown if run as root.
// TODO - test chown if run as root.
}
}
fuse/inode.go
View file @
d0f58fe6
fuse/loopback_test.go
View file @
d0f58fe6
...
@@ -121,7 +121,7 @@ func TestTouch(t *testing.T) {
...
@@ -121,7 +121,7 @@ func TestTouch(t *testing.T) {
ts
:=
NewTestCase
(
t
)
ts
:=
NewTestCase
(
t
)
defer
ts
.
Cleanup
()
defer
ts
.
Cleanup
()
contents
:=
[]
byte
{
1
,
2
,
3
}
contents
:=
[]
byte
{
1
,
2
,
3
}
err
:=
ioutil
.
WriteFile
(
ts
.
origFile
,
[]
byte
(
contents
),
0700
)
err
:=
ioutil
.
WriteFile
(
ts
.
origFile
,
[]
byte
(
contents
),
0700
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
err
=
os
.
Chtimes
(
ts
.
mountFile
,
time
.
Unix
(
42
,
0
),
time
.
Unix
(
43
,
0
))
err
=
os
.
Chtimes
(
ts
.
mountFile
,
time
.
Unix
(
42
,
0
),
time
.
Unix
(
43
,
0
))
...
@@ -167,7 +167,7 @@ func TestRemove(t *testing.T) {
...
@@ -167,7 +167,7 @@ func TestRemove(t *testing.T) {
tc
:=
NewTestCase
(
t
)
tc
:=
NewTestCase
(
t
)
defer
tc
.
Cleanup
()
defer
tc
.
Cleanup
()
contents
:=
[]
byte
{
1
,
2
,
3
}
contents
:=
[]
byte
{
1
,
2
,
3
}
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
...
@@ -324,7 +324,7 @@ func TestSymlink(t *testing.T) {
...
@@ -324,7 +324,7 @@ func TestSymlink(t *testing.T) {
defer
tc
.
Cleanup
()
defer
tc
.
Cleanup
()
t
.
Log
(
"testing symlink/readlink."
)
t
.
Log
(
"testing symlink/readlink."
)
contents
:=
[]
byte
{
1
,
2
,
3
}
contents
:=
[]
byte
{
1
,
2
,
3
}
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
...
@@ -355,7 +355,7 @@ func TestRename(t *testing.T) {
...
@@ -355,7 +355,7 @@ func TestRename(t *testing.T) {
tc
:=
NewTestCase
(
t
)
tc
:=
NewTestCase
(
t
)
defer
tc
.
Cleanup
()
defer
tc
.
Cleanup
()
contents
:=
[]
byte
{
1
,
2
,
3
}
contents
:=
[]
byte
{
1
,
2
,
3
}
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
sd
:=
tc
.
mnt
+
"/testRename"
sd
:=
tc
.
mnt
+
"/testRename"
...
@@ -434,7 +434,7 @@ func TestAccess(t *testing.T) {
...
@@ -434,7 +434,7 @@ func TestAccess(t *testing.T) {
tc
:=
NewTestCase
(
t
)
tc
:=
NewTestCase
(
t
)
defer
tc
.
Cleanup
()
defer
tc
.
Cleanup
()
contents
:=
[]
byte
{
1
,
2
,
3
}
contents
:=
[]
byte
{
1
,
2
,
3
}
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
err
=
os
.
Chmod
(
tc
.
origFile
,
0
)
err
=
os
.
Chmod
(
tc
.
origFile
,
0
)
...
@@ -473,7 +473,7 @@ func TestReaddir(t *testing.T) {
...
@@ -473,7 +473,7 @@ func TestReaddir(t *testing.T) {
tc
:=
NewTestCase
(
t
)
tc
:=
NewTestCase
(
t
)
defer
tc
.
Cleanup
()
defer
tc
.
Cleanup
()
contents
:=
[]
byte
{
1
,
2
,
3
}
contents
:=
[]
byte
{
1
,
2
,
3
}
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
err
=
os
.
Mkdir
(
tc
.
origSubdir
,
0777
)
err
=
os
.
Mkdir
(
tc
.
origSubdir
,
0777
)
...
@@ -506,7 +506,7 @@ func TestFSync(t *testing.T) {
...
@@ -506,7 +506,7 @@ func TestFSync(t *testing.T) {
tc
:=
NewTestCase
(
t
)
tc
:=
NewTestCase
(
t
)
defer
tc
.
Cleanup
()
defer
tc
.
Cleanup
()
contents
:=
[]
byte
{
1
,
2
,
3
}
contents
:=
[]
byte
{
1
,
2
,
3
}
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
err
:=
ioutil
.
WriteFile
(
tc
.
origFile
,
[]
byte
(
contents
),
0700
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
...
@@ -576,7 +576,7 @@ func TestReadLargeMemCheck(t *testing.T) {
...
@@ -576,7 +576,7 @@ func TestReadLargeMemCheck(t *testing.T) {
ts
:=
NewTestCase
(
t
)
ts
:=
NewTestCase
(
t
)
defer
ts
.
Cleanup
()
defer
ts
.
Cleanup
()
content
:=
RandomData
(
385
*
1023
)
content
:=
RandomData
(
385
*
1023
)
err
:=
ioutil
.
WriteFile
(
ts
.
origFile
,
[]
byte
(
content
),
0644
)
err
:=
ioutil
.
WriteFile
(
ts
.
origFile
,
[]
byte
(
content
),
0644
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
...
@@ -598,7 +598,7 @@ func TestReadLargeMemCheck(t *testing.T) {
...
@@ -598,7 +598,7 @@ func TestReadLargeMemCheck(t *testing.T) {
}
}
runtime
.
ReadMemStats
(
&
after
)
runtime
.
ReadMemStats
(
&
after
)
delta
:=
int
((
after
.
TotalAlloc
-
before
.
TotalAlloc
))
delta
:=
int
((
after
.
TotalAlloc
-
before
.
TotalAlloc
))
delta
=
(
delta
-
40000
)
/
N
delta
=
(
delta
-
40000
)
/
N
limit
:=
5000
limit
:=
5000
if
delta
>
limit
{
if
delta
>
limit
{
...
@@ -610,7 +610,7 @@ func TestReadLarge(t *testing.T) {
...
@@ -610,7 +610,7 @@ func TestReadLarge(t *testing.T) {
ts
:=
NewTestCase
(
t
)
ts
:=
NewTestCase
(
t
)
defer
ts
.
Cleanup
()
defer
ts
.
Cleanup
()
content
:=
RandomData
(
385
*
1023
)
content
:=
RandomData
(
385
*
1023
)
err
:=
ioutil
.
WriteFile
(
ts
.
origFile
,
[]
byte
(
content
),
0644
)
err
:=
ioutil
.
WriteFile
(
ts
.
origFile
,
[]
byte
(
content
),
0644
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
...
...
fuse/mountstate.go
View file @
d0f58fe6
...
@@ -477,6 +477,7 @@ func (ms *MountState) writeEntryNotify(parent uint64, name string) Status {
...
@@ -477,6 +477,7 @@ func (ms *MountState) writeEntryNotify(parent uint64, name string) Status {
}
}
var
defaultBufferPool
BufferPool
var
defaultBufferPool
BufferPool
func
init
()
{
func
init
()
{
defaultBufferPool
=
NewBufferPool
()
defaultBufferPool
=
NewBufferPool
()
}
}
fuse/pressure_test.go
View file @
d0f58fe6
fuse/read.go
View file @
d0f58fe6
...
@@ -5,8 +5,6 @@ import (
...
@@ -5,8 +5,6 @@ import (
"syscall"
"syscall"
)
)
// ReadResultData is the read return for returning bytes directly.
// ReadResultData is the read return for returning bytes directly.
type
ReadResultData
struct
{
type
ReadResultData
struct
{
// Raw bytes for the read.
// Raw bytes for the read.
...
@@ -53,4 +51,3 @@ func (r *ReadResultFd) Bytes(buf []byte) []byte {
...
@@ -53,4 +51,3 @@ func (r *ReadResultFd) Bytes(buf []byte) []byte {
func
(
r
*
ReadResultFd
)
Size
()
int
{
func
(
r
*
ReadResultFd
)
Size
()
int
{
return
r
.
Sz
return
r
.
Sz
}
}
fuse/request.go
View file @
d0f58fe6
fuse/types.go
View file @
d0f58fe6
...
@@ -48,4 +48,3 @@ type Owner raw.Owner
...
@@ -48,4 +48,3 @@ type Owner raw.Owner
type
Context
raw
.
Context
type
Context
raw
.
Context
type
StatfsOut
raw
.
StatfsOut
type
StatfsOut
raw
.
StatfsOut
raw/print.go
View file @
d0f58fe6
...
@@ -15,7 +15,6 @@ var accessFlagName map[int]string
...
@@ -15,7 +15,6 @@ var accessFlagName map[int]string
var
writeFlagNames
map
[
int
]
string
var
writeFlagNames
map
[
int
]
string
var
readFlagNames
map
[
int
]
string
var
readFlagNames
map
[
int
]
string
func
init
()
{
func
init
()
{
writeFlagNames
=
map
[
int
]
string
{
writeFlagNames
=
map
[
int
]
string
{
WRITE_CACHE
:
"CACHE"
,
WRITE_CACHE
:
"CACHE"
,
...
...
splice/pool.go
View file @
d0f58fe6
...
@@ -63,7 +63,8 @@ func (me *pairPool) get() (p *Pair, err error) {
...
@@ -63,7 +63,8 @@ func (me *pairPool) get() (p *Pair, err error) {
return
newSplicePair
()
return
newSplicePair
()
}
}
var
discardBuffer
[
32
*
1024
]
byte
var
discardBuffer
[
32
*
1024
]
byte
func
DiscardAll
(
r
io
.
Reader
)
{
func
DiscardAll
(
r
io
.
Reader
)
{
buf
:=
discardBuffer
[
:
]
buf
:=
discardBuffer
[
:
]
for
{
for
{
...
...
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