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
ec46e594
Commit
ec46e594
authored
May 25, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gofmt.
parent
bf30f7b8
Changes
39
Show whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
107 additions
and
130 deletions
+107
-130
benchmark/benchmark.go
benchmark/benchmark.go
+0
-1
benchmark/stat_test.go
benchmark/stat_test.go
+1
-1
example/autounionfs/main.go
example/autounionfs/main.go
+1
-1
example/statfs/main.go
example/statfs/main.go
+4
-4
example/zipfs/main.go
example/zipfs/main.go
+4
-4
fuse/api.go
fuse/api.go
+3
-4
fuse/bufferpool.go
fuse/bufferpool.go
+0
-1
fuse/cache_test.go
fuse/cache_test.go
+1
-1
fuse/copy.go
fuse/copy.go
+2
-2
fuse/defaultnode.go
fuse/defaultnode.go
+1
-1
fuse/defaultraw.go
fuse/defaultraw.go
+1
-2
fuse/direntry.go
fuse/direntry.go
+11
-10
fuse/files.go
fuse/files.go
+3
-3
fuse/fsconnector.go
fuse/fsconnector.go
+4
-4
fuse/fsetattr_test.go
fuse/fsetattr_test.go
+1
-1
fuse/fsmount.go
fuse/fsmount.go
+2
-2
fuse/fsops.go
fuse/fsops.go
+4
-5
fuse/handle.go
fuse/handle.go
+1
-1
fuse/lockingfs.go
fuse/lockingfs.go
+1
-1
fuse/loopback_test.go
fuse/loopback_test.go
+1
-1
fuse/memnode_test.go
fuse/memnode_test.go
+1
-1
fuse/misc_test.go
fuse/misc_test.go
+0
-1
fuse/mountstate.go
fuse/mountstate.go
+10
-11
fuse/opcode.go
fuse/opcode.go
+10
-10
fuse/pathfs.go
fuse/pathfs.go
+5
-5
fuse/pressure_test.go
fuse/pressure_test.go
+2
-3
fuse/read.go
fuse/read.go
+1
-1
fuse/request.go
fuse/request.go
+10
-11
fuse/types.go
fuse/types.go
+1
-3
fuse/xattr_test.go
fuse/xattr_test.go
+1
-2
raw/print.go
raw/print.go
+5
-6
raw/types.go
raw/types.go
+1
-6
splice/pool.go
splice/pool.go
+2
-2
splice/splice.go
splice/splice.go
+1
-3
splice/splice_test.go
splice/splice_test.go
+2
-6
unionfs/autounion.go
unionfs/autounion.go
+5
-5
unionfs/cachingfs.go
unionfs/cachingfs.go
+1
-1
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+1
-1
zipfs/memtree.go
zipfs/memtree.go
+2
-2
No files found.
benchmark/benchmark.go
View file @
ec46e594
...
...
@@ -13,7 +13,6 @@ import (
"time"
)
func
ReadLines
(
name
string
)
[]
string
{
f
,
err
:=
os
.
Open
(
name
)
if
err
!=
nil
{
...
...
benchmark/stat_test.go
View file @
ec46e594
...
...
@@ -157,7 +157,7 @@ func BenchmarkCFuseThreadedStat(b *testing.B) {
mountPoint
)
cmd
.
Env
=
append
(
os
.
Environ
(),
fmt
.
Sprintf
(
"STATFS_INPUT=%s"
,
f
.
Name
()),
fmt
.
Sprintf
(
"STATFS_DELAY_USEC=%d"
,
delay
/
time
.
Microsecond
))
fmt
.
Sprintf
(
"STATFS_DELAY_USEC=%d"
,
delay
/
time
.
Microsecond
))
cmd
.
Start
()
bin
,
err
:=
exec
.
LookPath
(
"fusermount"
)
...
...
example/autounionfs/main.go
View file @
ec46e594
...
...
@@ -73,5 +73,5 @@ func main() {
gofs
.
SetFileSystemConnector
(
conn
)
state
.
Loop
()
time
.
Sleep
(
1
*
time
.
Second
)
time
.
Sleep
(
1
*
time
.
Second
)
}
example/statfs/main.go
View file @
ec46e594
...
...
@@ -3,8 +3,8 @@ package main
import
(
"flag"
"fmt"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/benchmark"
"github.com/hanwen/go-fuse/fuse"
"io"
"log"
"os"
...
...
example/zipfs/main.go
View file @
ec46e594
fuse/api.go
View file @
ec46e594
...
...
@@ -77,7 +77,6 @@ type FsNode interface {
StatFs
()
*
StatfsOut
}
// A filesystem API that uses paths rather than inodes. A minimal
// file system should have at least a functional GetAttr method.
// Typically, each call happens in its own goroutine, so take care to
...
...
@@ -171,7 +170,7 @@ type File interface {
// The methods below may be called on closed files, due to
// concurrency. In that case, you should return EBADF.
Truncate
(
size
uint64
)
Status
GetAttr
(
out
*
Attr
)
(
Status
)
GetAttr
(
out
*
Attr
)
Status
Chown
(
uid
uint32
,
gid
uint32
)
Status
Chmod
(
perms
uint32
)
Status
Utimens
(
atimeNs
int64
,
mtimeNs
int64
)
Status
...
...
@@ -288,7 +287,7 @@ type RawFileSystem interface {
// Directory handling
OpenDir
(
out
*
raw
.
OpenOut
,
header
*
raw
.
InHeader
,
input
*
raw
.
OpenIn
)
(
status
Status
)
ReadDir
(
out
*
DirEntryList
,
header
*
raw
.
InHeader
,
input
*
ReadIn
)
(
Status
)
ReadDir
(
out
*
DirEntryList
,
header
*
raw
.
InHeader
,
input
*
ReadIn
)
Status
ReleaseDir
(
header
*
raw
.
InHeader
,
input
*
raw
.
ReleaseIn
)
FsyncDir
(
header
*
raw
.
InHeader
,
input
*
raw
.
FsyncIn
)
(
code
Status
)
...
...
fuse/bufferpool.go
View file @
ec46e594
...
...
@@ -122,7 +122,6 @@ func (p *BufferPoolImpl) AllocBuffer(size uint32) []byte {
}
p
.
lock
.
Unlock
()
return
b
}
...
...
fuse/cache_test.go
View file @
ec46e594
...
...
@@ -2,12 +2,12 @@ package fuse
import
(
"bytes"
"github.com/hanwen/go-fuse/raw"
"io/ioutil"
"log"
"os"
"sync"
"testing"
"github.com/hanwen/go-fuse/raw"
)
var
_
=
log
.
Println
...
...
fuse/copy.go
View file @
ec46e594
...
...
@@ -27,7 +27,7 @@ func CopyFile(srcFs, destFs FileSystem, srcFile, destFile string, context *Conte
defer
dst
.
Release
()
defer
dst
.
Flush
()
buf
:=
make
([]
byte
,
128
*
(
1
<<
10
))
buf
:=
make
([]
byte
,
128
*
(
1
<<
10
))
off
:=
int64
(
0
)
for
{
res
:=
src
.
Read
(
buf
,
off
)
...
...
fuse/defaultnode.go
View file @
ec46e594
fuse/defaultraw.go
View file @
ec46e594
...
...
@@ -6,7 +6,6 @@ import (
var
_
=
RawFileSystem
((
*
DefaultRawFileSystem
)(
nil
))
func
(
fs
*
DefaultRawFileSystem
)
Init
(
init
*
RawFsInit
)
{
}
...
...
@@ -116,7 +115,7 @@ func (fs *DefaultRawFileSystem) Fsync(header *raw.InHeader, input *raw.FsyncIn)
return
ENOSYS
}
func
(
fs
*
DefaultRawFileSystem
)
ReadDir
(
l
*
DirEntryList
,
header
*
raw
.
InHeader
,
input
*
ReadIn
)
(
Status
)
{
func
(
fs
*
DefaultRawFileSystem
)
ReadDir
(
l
*
DirEntryList
,
header
*
raw
.
InHeader
,
input
*
ReadIn
)
Status
{
return
ENOSYS
}
...
...
fuse/direntry.go
View file @
ec46e594
...
...
@@ -11,6 +11,7 @@ import (
var
_
=
log
.
Print
var
eightPadding
[
8
]
byte
const
direntSize
=
int
(
unsafe
.
Sizeof
(
raw
.
Dirent
{}))
// DirEntry is a type for PathFileSystem and NodeFileSystem to return
...
...
@@ -37,7 +38,7 @@ func (l *DirEntryList) AddDirEntry(e DirEntry) bool {
}
func
(
l
*
DirEntryList
)
Add
(
name
string
,
inode
uint64
,
mode
uint32
)
bool
{
padding
:=
(
8
-
len
(
name
)
&
7
)
&
7
padding
:=
(
8
-
len
(
name
)
&
7
)
&
7
delta
:=
padding
+
direntSize
+
len
(
name
)
oldLen
:=
len
(
l
.
buf
)
newLen
:=
delta
+
oldLen
...
...
@@ -47,9 +48,9 @@ func (l *DirEntryList) Add(name string, inode uint64, mode uint32) bool {
}
l
.
buf
=
l
.
buf
[
:
newLen
]
dirent
:=
(
*
raw
.
Dirent
)(
unsafe
.
Pointer
(
&
l
.
buf
[
oldLen
]))
dirent
.
Off
=
l
.
offset
+
1
dirent
.
Off
=
l
.
offset
+
1
dirent
.
Ino
=
inode
dirent
.
NameLen
=
uint32
(
len
(
name
))
dirent
.
NameLen
=
uint32
(
len
(
name
))
dirent
.
Typ
=
ModeToType
(
mode
)
oldLen
+=
direntSize
copy
(
l
.
buf
[
oldLen
:
],
name
)
...
...
@@ -70,7 +71,7 @@ func (l *DirEntryList) Bytes() []byte {
////////////////////////////////////////////////////////////////
type
rawDir
interface
{
ReadDir
(
out
*
DirEntryList
,
input
*
ReadIn
)
(
Status
)
ReadDir
(
out
*
DirEntryList
,
input
*
ReadIn
)
Status
Release
()
}
...
...
fuse/files.go
View file @
ec46e594
...
...
@@ -104,7 +104,7 @@ func (f *LoopbackFile) Read(buf []byte, off int64) (res ReadResult) {
return
ReadResult
{
Fd
:
f
.
File
.
Fd
(),
FdOff
:
off
,
FdSize
:
len
(
buf
),
FdSize
:
len
(
buf
),
Status
:
OK
,
}
}
...
...
fuse/fsconnector.go
View file @
ec46e594
fuse/fsetattr_test.go
View file @
ec46e594
fuse/fsmount.go
View file @
ec46e594
...
...
@@ -65,7 +65,7 @@ func (m *fileSystemMount) fillEntry(out *raw.EntryOut) {
splitDuration
(
m
.
options
.
EntryTimeout
,
&
out
.
EntryValid
,
&
out
.
EntryValidNsec
)
splitDuration
(
m
.
options
.
AttrTimeout
,
&
out
.
AttrValid
,
&
out
.
AttrValidNsec
)
m
.
setOwner
(
&
out
.
Attr
)
if
out
.
Mode
&
S_IFDIR
==
0
&&
out
.
Nlink
==
0
{
if
out
.
Mode
&
S_IFDIR
==
0
&&
out
.
Nlink
==
0
{
out
.
Nlink
=
1
}
}
...
...
fuse/fsops.go
View file @
ec46e594
...
...
@@ -123,7 +123,7 @@ func (c *FileSystemConnector) OpenDir(out *raw.OpenOut, header *raw.InHeader, in
return
OK
}
func
(
c
*
FileSystemConnector
)
ReadDir
(
l
*
DirEntryList
,
header
*
raw
.
InHeader
,
input
*
ReadIn
)
(
Status
)
{
func
(
c
*
FileSystemConnector
)
ReadDir
(
l
*
DirEntryList
,
header
*
raw
.
InHeader
,
input
*
ReadIn
)
Status
{
node
:=
c
.
toInode
(
header
.
NodeId
)
opened
:=
node
.
mount
.
getOpenedFile
(
input
.
Fh
)
return
opened
.
dir
.
ReadDir
(
l
,
input
)
...
...
@@ -350,7 +350,7 @@ func (c *FileSystemConnector) Write(header *raw.InHeader, input *WriteIn, data [
return
opened
.
WithFlags
.
File
.
Write
(
data
,
int64
(
input
.
Offset
))
}
func
(
c
*
FileSystemConnector
)
Read
(
header
*
raw
.
InHeader
,
input
*
ReadIn
,
buf
[]
byte
)
(
ReadResult
)
{
func
(
c
*
FileSystemConnector
)
Read
(
header
*
raw
.
InHeader
,
input
*
ReadIn
,
buf
[]
byte
)
ReadResult
{
node
:=
c
.
toInode
(
header
.
NodeId
)
opened
:=
node
.
mount
.
getOpenedFile
(
input
.
Fh
)
...
...
@@ -372,4 +372,3 @@ func (c *FileSystemConnector) Flush(header *raw.InHeader, input *raw.FlushIn) St
opened
:=
node
.
mount
.
getOpenedFile
(
input
.
Fh
)
return
opened
.
WithFlags
.
File
.
Flush
()
}
fuse/handle.go
View file @
ec46e594
fuse/lockingfs.go
View file @
ec46e594
...
...
@@ -296,7 +296,7 @@ func (fs *LockingRawFileSystem) Fsync(header *raw.InHeader, input *raw.FsyncIn)
return
fs
.
RawFileSystem
.
Fsync
(
header
,
input
)
}
func
(
fs
*
LockingRawFileSystem
)
ReadDir
(
out
*
DirEntryList
,
header
*
raw
.
InHeader
,
input
*
ReadIn
)
(
Status
)
{
func
(
fs
*
LockingRawFileSystem
)
ReadDir
(
out
*
DirEntryList
,
header
*
raw
.
InHeader
,
input
*
ReadIn
)
Status
{
defer
fs
.
locked
()()
return
fs
.
RawFileSystem
.
ReadDir
(
out
,
header
,
input
)
}
...
...
fuse/loopback_test.go
View file @
ec46e594
...
...
@@ -140,7 +140,7 @@ func TestReadLarge(t *testing.T) {
defer
ts
.
Cleanup
()
// Add a bit more to test the splicing at the end.
content
:=
make
([]
byte
,
1024
*
1024
+
43
)
content
:=
make
([]
byte
,
1024
*
1024
+
43
)
for
i
:=
range
content
{
content
[
i
]
=
byte
(
i
)
}
...
...
fuse/memnode_test.go
View file @
ec46e594
...
...
@@ -48,7 +48,7 @@ func TestMemNodeFsWrite(t *testing.T) {
err
:=
ioutil
.
WriteFile
(
wd
+
"/test"
,
[]
byte
(
want
),
0644
)
CheckSuccess
(
err
)
content
,
err
:=
ioutil
.
ReadFile
(
wd
+
"/test"
)
content
,
err
:=
ioutil
.
ReadFile
(
wd
+
"/test"
)
if
string
(
content
)
!=
want
{
t
.
Fatalf
(
"content mismatch: got %q, want %q"
,
content
,
want
)
}
...
...
fuse/misc_test.go
View file @
ec46e594
...
...
@@ -49,4 +49,3 @@ func TestLinkAt(t *testing.T) {
t
.
Fatal
(
"Ino mismatch"
,
s1
,
s2
)
}
}
fuse/mountstate.go
View file @
ec46e594
...
...
@@ -2,8 +2,8 @@ package fuse
import
(
"fmt"
"log"
"io"
"log"
"os"
"strings"
"sync"
...
...
@@ -163,7 +163,7 @@ func (ms *MountState) BufferPoolStats() string {
ms
.
reqMu
.
Unlock
()
s
+=
fmt
.
Sprintf
(
" read buffers: %d (sz %d )"
,
r
,
ms
.
opts
.
MaxWrite
/
PAGESIZE
+
1
)
r
,
ms
.
opts
.
MaxWrite
/
PAGESIZE
+
1
)
return
s
}
...
...
@@ -192,7 +192,7 @@ func (ms *MountState) readRequest(exitIdle bool) (req *request, code Status) {
dest
=
ms
.
readPool
[
l
-
1
]
ms
.
readPool
=
ms
.
readPool
[
:
l
-
1
]
}
else
{
dest
=
make
([]
byte
,
ms
.
opts
.
MaxWrite
+
PAGESIZE
)
dest
=
make
([]
byte
,
ms
.
opts
.
MaxWrite
+
PAGESIZE
)
}
ms
.
outstandingReadBufs
++
ms
.
reqReaders
++
...
...
@@ -272,7 +272,7 @@ func (ms *MountState) Loop() {
func
(
ms
*
MountState
)
loop
(
exitIdle
bool
)
{
defer
ms
.
loops
.
Done
()
exit
:
exit
:
for
{
req
,
errNo
:=
ms
.
readRequest
(
exitIdle
)
switch
errNo
{
...
...
@@ -336,7 +336,6 @@ func (ms *MountState) AllocOut(req *request, size uint32) []byte {
return
req
.
bufferPoolOutputBuf
}
func
(
ms
*
MountState
)
write
(
req
*
request
)
Status
{
// Forget does not wait for reply.
if
req
.
inHeader
.
Opcode
==
_OP_FORGET
||
req
.
inHeader
.
Opcode
==
_OP_BATCH_FORGET
{
...
...
fuse/opcode.go
View file @
ec46e594
...
...
@@ -216,7 +216,7 @@ func doForget(state *MountState, req *request) {
func
doBatchForget
(
state
*
MountState
,
req
*
request
)
{
in
:=
(
*
raw
.
BatchForgetIn
)(
req
.
inData
)
wantBytes
:=
uintptr
(
in
.
Count
)
*
unsafe
.
Sizeof
(
raw
.
BatchForgetIn
{})
wantBytes
:=
uintptr
(
in
.
Count
)
*
unsafe
.
Sizeof
(
raw
.
BatchForgetIn
{})
if
uintptr
(
len
(
req
.
arg
))
<
wantBytes
{
// We have no return value to complain, so log an error.
log
.
Printf
(
"Too few bytes for batch forget. Got %d bytes, want %d (%d entries)"
,
...
...
@@ -568,7 +568,7 @@ func init() {
var
r
request
sizeOfOutHeader
:=
unsafe
.
Sizeof
(
raw
.
OutHeader
{})
for
code
,
h
:=
range
operationHandlers
{
if
h
.
OutputSize
+
sizeOfOutHeader
>
unsafe
.
Sizeof
(
r
.
outBuf
)
{
if
h
.
OutputSize
+
sizeOfOutHeader
>
unsafe
.
Sizeof
(
r
.
outBuf
)
{
log
.
Panicf
(
"request output buffer too small: code %v, sz %d + %d %v"
,
code
,
h
.
OutputSize
,
sizeOfOutHeader
,
h
)
}
}
...
...
fuse/pathfs.go
View file @
ec46e594
...
...
@@ -246,7 +246,7 @@ func (n *pathInode) GetPath() string {
end
:=
len
(
pathBytes
)
for
p
=
n
;
p
.
Parent
!=
nil
;
p
=
p
.
Parent
{
l
:=
len
(
p
.
Name
)
copy
(
pathBytes
[
end
-
l
:
],
p
.
Name
)
copy
(
pathBytes
[
end
-
l
:
],
p
.
Name
)
end
-=
len
(
p
.
Name
)
+
1
if
end
>
0
{
pathBytes
[
end
]
=
'/'
...
...
fuse/pressure_test.go
View file @
ec46e594
...
...
@@ -46,7 +46,7 @@ func TestMemoryPressure(t *testing.T) {
os
.
Lstat
(
dir
)
var
wg
sync
.
WaitGroup
for
i
:=
0
;
i
<
10
*
_MAX_READERS
;
i
++
{
for
i
:=
0
;
i
<
10
*
_MAX_READERS
;
i
++
{
wg
.
Add
(
1
)
go
func
(
x
int
)
{
fn
:=
fmt
.
Sprintf
(
"%s/%ddir/file%d"
,
dir
,
x
,
x
)
...
...
@@ -60,10 +60,9 @@ func TestMemoryPressure(t *testing.T) {
time
.
Sleep
(
100
*
time
.
Millisecond
)
created
:=
state
.
buffers
.
createdBuffers
+
state
.
outstandingReadBufs
t
.
Logf
(
"Have %d read bufs"
,
state
.
outstandingReadBufs
)
if
created
>
2
*
_MAX_READERS
{
if
created
>
2
*
_MAX_READERS
{
t
.
Errorf
(
"created %d buffers, max reader %d"
,
created
,
_MAX_READERS
)
}
wg
.
Wait
()
}
fuse/read.go
View file @
ec46e594
fuse/request.go
View file @
ec46e594
...
...
@@ -198,4 +198,3 @@ func (r *request) serializeHeader() (header []byte) {
copy
(
header
[
sizeOfOutHeader
:
],
asSlice
)
return
header
}
fuse/types.go
View file @
ec46e594
package
fuse
import
(
"github.com/hanwen/go-fuse/raw"
"os"
"syscall"
"github.com/hanwen/go-fuse/raw"
)
const
(
...
...
@@ -41,7 +41,6 @@ const (
EROFS
=
Status
(
syscall
.
EROFS
)
)
type
Attr
raw
.
Attr
type
Owner
raw
.
Owner
...
...
@@ -78,4 +77,3 @@ type WriteIn struct {
Flags
uint32
Padding
uint32
}
fuse/xattr_test.go
View file @
ec46e594
...
...
@@ -17,7 +17,6 @@ var xattrGolden = map[string][]byte{
"user.attr2"
:
[]
byte
(
"val2"
)}
var
xattrFilename
=
"filename"
type
XAttrTestFs
struct
{
tester
*
testing
.
T
filename
string
...
...
raw/print.go
View file @
ec46e594
package
raw
import
(
"fmt"
"os"
...
...
@@ -87,7 +88,6 @@ func (me *BatchForgetIn) String() string {
return
fmt
.
Sprintf
(
"{%d}"
,
me
.
Count
)
}
func
(
me
*
MkdirIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{0%o (0%o)}"
,
me
.
Mode
,
me
.
Umask
)
}
...
...
@@ -127,7 +127,6 @@ func (me *GetAttrIn) String() string {
return
fmt
.
Sprintf
(
"{Fh %d}"
,
me
.
Fh
)
}
func
(
me
*
ReleaseIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{Fh %d %s %s L%d}"
,
me
.
Fh
,
FlagString
(
OpenFlagNames
,
int
(
me
.
Flags
),
""
),
...
...
raw/types.go
View file @
ec46e594
...
...
@@ -3,7 +3,6 @@
package
raw
type
ForgetIn
struct
{
Nlookup
uint64
}
...
...
@@ -18,7 +17,6 @@ type BatchForgetIn struct {
Dummy
uint32
}
type
MkdirIn
struct
{
Mode
uint32
Umask
uint32
...
...
@@ -86,7 +84,6 @@ type GetAttrIn struct {
Fh
uint64
}
const
RELEASE_FLUSH
=
(
1
<<
0
)
type
ReleaseIn
struct
{
...
...
@@ -289,7 +286,6 @@ type CreateIn struct {
Padding
uint32
}
type
NotifyInvalInodeOut
struct
{
Ino
uint64
Off
int64
...
...
@@ -370,7 +366,6 @@ type InHeader struct {
Padding
uint32
}
type
Kstatfs
struct
{
Blocks
uint64
Bfree
uint64
...
...
splice/pool.go
View file @
ec46e594
package
splice
import
(
"sync"
)
...
...
@@ -46,7 +47,6 @@ func (me *pairPool) used() int {
return
me
.
usedCount
}
func
(
me
*
pairPool
)
get
()
(
p
*
Pair
,
err
error
)
{
me
.
Lock
()
defer
me
.
Unlock
()
...
...
splice/splice.go
View file @
ec46e594
...
...
@@ -12,7 +12,6 @@ import (
var
_
=
log
.
Println
var
maxPipeSize
int
var
resizable
bool
...
...
@@ -86,4 +85,3 @@ func newSplicePair() (p *Pair, err error) {
}
return
p
,
nil
}
splice/splice_test.go
View file @
ec46e594
...
...
@@ -9,7 +9,7 @@ func TestPairSize(t *testing.T) {
p
,
_
:=
Get
()
defer
Done
(
p
)
p
.
MaxGrow
()
b
:=
make
([]
byte
,
p
.
Cap
()
+
100
)
b
:=
make
([]
byte
,
p
.
Cap
()
+
100
)
for
i
:=
range
b
{
b
[
i
]
=
byte
(
i
)
}
...
...
@@ -26,7 +26,3 @@ func TestPairSize(t *testing.T) {
}
}
unionfs/autounion.go
View file @
ec46e594
...
...
@@ -424,7 +424,7 @@ func (fs *AutoUnionFs) OpenDir(name string, context *fuse.Context) (stream []fus
fs
.
lock
.
RLock
()
defer
fs
.
lock
.
RUnlock
()
stream
=
make
(
[]
fuse
.
DirEntry
,
0
,
len
(
fs
.
knownFileSystems
)
+
5
)
stream
=
make
([]
fuse
.
DirEntry
,
0
,
len
(
fs
.
knownFileSystems
)
+
5
)
if
name
==
_CONFIG
{
for
k
:=
range
fs
.
knownFileSystems
{
stream
=
append
(
stream
,
fuse
.
DirEntry
{
...
...
unionfs/cachingfs.go
View file @
ec46e594
unionfs/unionfs_test.go
View file @
ec46e594
zipfs/memtree.go
View file @
ec46e594
...
...
@@ -89,9 +89,9 @@ func (n *memNode) Deletable() bool {
return
false
}
func
(
n
*
memNode
)
GetAttr
(
out
*
fuse
.
Attr
,
file
fuse
.
File
,
context
*
fuse
.
Context
)
(
fuse
.
Status
)
{
func
(
n
*
memNode
)
GetAttr
(
out
*
fuse
.
Attr
,
file
fuse
.
File
,
context
*
fuse
.
Context
)
fuse
.
Status
{
if
n
.
Inode
()
.
IsDir
()
{
out
.
Mode
=
fuse
.
S_IFDIR
|
0777
out
.
Mode
=
fuse
.
S_IFDIR
|
0777
return
fuse
.
OK
}
n
.
file
.
Stat
(
out
)
...
...
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