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
b8458b82
Commit
b8458b82
authored
May 11, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run Gofmt.
parent
39d680ab
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
91 additions
and
95 deletions
+91
-95
fuse/api.go
fuse/api.go
+5
-5
fuse/bufferpool.go
fuse/bufferpool.go
+1
-0
fuse/files.go
fuse/files.go
+1
-1
fuse/fsetattr_test.go
fuse/fsetattr_test.go
+1
-1
fuse/fuse.go
fuse/fuse.go
+3
-3
fuse/loopback_test.go
fuse/loopback_test.go
+0
-1
fuse/misc.go
fuse/misc.go
+1
-1
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+7
-7
fuse/pathops.go
fuse/pathops.go
+4
-5
fuse/request.go
fuse/request.go
+7
-7
fuse/types.go
fuse/types.go
+0
-2
unionfs/autounion.go
unionfs/autounion.go
+25
-25
unionfs/autounion_test.go
unionfs/autounion_test.go
+7
-7
unionfs/cachingfs.go
unionfs/cachingfs.go
+6
-6
unionfs/cachingfs_test.go
unionfs/cachingfs_test.go
+4
-5
unionfs/timedcache.go
unionfs/timedcache.go
+2
-2
unionfs/unionfs.go
unionfs/unionfs.go
+6
-6
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+11
-11
No files found.
fuse/api.go
View file @
b8458b82
// The fuse package provides APIs to implement filesystems in
// userspace, using libfuse on Linux.
package
fuse
import
(
"os"
)
...
...
@@ -89,7 +90,6 @@ type MountOptions struct {
EntryTimeout
float64
AttrTimeout
float64
NegativeTimeout
float64
}
// DefaultFileSystem implements a FileSystem that returns ENOSYS for every operation.
...
...
fuse/bufferpool.go
View file @
b8458b82
...
...
@@ -15,6 +15,7 @@ type BufferPool interface {
}
type
GcBufferPool
struct
{
}
// NewGcBufferPool is just a fallback to the standard allocation routines.
...
...
fuse/files.go
View file @
b8458b82
package
fuse
import
(
"os"
"syscall"
...
...
@@ -108,4 +109,3 @@ func (me *LoopbackFile) GetAttr() (*os.FileInfo, Status) {
}
return
fi
,
OK
}
fuse/fsetattr_test.go
View file @
b8458b82
fuse/fuse.go
View file @
b8458b82
fuse/loopback_test.go
View file @
b8458b82
...
...
@@ -664,4 +664,3 @@ func TestRecursiveMount(t *testing.T) {
ts
.
Cleanup
()
}
fuse/misc.go
View file @
b8458b82
fuse/pathfilesystem.go
View file @
b8458b82
...
...
@@ -215,7 +215,7 @@ func (me *FileSystemConnector) Statistics() string {
len
(
me
.
openFiles
),
len
(
me
.
inodeMap
))
}
func
(
me
*
FileSystemConnector
)
unregisterFile
(
node
*
inode
,
handle
uint64
)
(
interface
{})
{
func
(
me
*
FileSystemConnector
)
unregisterFile
(
node
*
inode
,
handle
uint64
)
interface
{}
{
me
.
fileLock
.
Lock
()
defer
me
.
fileLock
.
Unlock
()
b
,
ok
:=
me
.
openFiles
[
handle
]
...
...
@@ -248,7 +248,7 @@ func (me *FileSystemConnector) registerFile(node *inode, mount *mountData, f int
return
h
}
func
(
me
*
FileSystemConnector
)
decodeFileHandle
(
h
uint64
)
(
*
fileBridge
)
{
func
(
me
*
FileSystemConnector
)
decodeFileHandle
(
h
uint64
)
*
fileBridge
{
b
:=
(
*
fileBridge
)(
unsafe
.
Pointer
(
uintptr
(
h
)))
return
b
}
...
...
fuse/pathops.go
View file @
b8458b82
...
...
@@ -385,7 +385,7 @@ func (me *FileSystemConnector) Flush(input *FlushIn) Status {
f
,
b
:=
me
.
getFile
(
input
.
Fh
)
code
:=
f
.
Flush
()
if
code
.
Ok
()
&&
b
.
Flags
&
O_ANYWRITE
!=
0
{
if
code
.
Ok
()
&&
b
.
Flags
&
O_ANYWRITE
!=
0
{
// We only signal releases to the FS if the
// open could have changed things.
var
path
string
...
...
@@ -491,4 +491,3 @@ func (me *FileSystemConnector) Ioctl(header *InHeader, input *IoctlIn) (out *Ioc
}
return
f
.
Ioctl
(
input
)
}
fuse/request.go
View file @
b8458b82
fuse/types.go
View file @
b8458b82
...
...
@@ -453,5 +453,3 @@ type NotifyInvalEntryOut struct {
NameLen
uint32
Padding
uint32
}
unionfs/autounion.go
View file @
b8458b82
unionfs/autounion_test.go
View file @
b8458b82
...
...
@@ -68,25 +68,25 @@ func TestAutoFsSymlink(t *testing.T) {
err
=
os
.
Symlink
(
wd
+
"/store/foo"
,
wd
+
"/mount/config/bar"
)
CheckSuccess
(
err
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/mount/bar/file1"
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/mount/bar/file1"
)
CheckSuccess
(
err
)
err
=
os
.
Remove
(
wd
+
"/mount/config/bar"
)
err
=
os
.
Remove
(
wd
+
"/mount/config/bar"
)
CheckSuccess
(
err
)
// Need time for the unmount to be noticed.
log
.
Println
(
"sleeping..."
)
time
.
Sleep
(
entryTtl
*
2e9
)
time
.
Sleep
(
entryTtl
*
2e9
)
fi
,
_
=
os
.
Lstat
(
wd
+
"/mount/foo"
)
fi
,
_
=
os
.
Lstat
(
wd
+
"/mount/foo"
)
if
fi
!=
nil
{
t
.
Error
(
"Should not have file:"
,
fi
)
}
_
,
err
=
ioutil
.
ReadDir
(
wd
+
"/mount/config"
)
_
,
err
=
ioutil
.
ReadDir
(
wd
+
"/mount/config"
)
CheckSuccess
(
err
)
_
,
err
=
os
.
Lstat
(
wd
+
"/mount/foo/file1"
)
_
,
err
=
os
.
Lstat
(
wd
+
"/mount/foo/file1"
)
CheckSuccess
(
err
)
}
...
...
unionfs/cachingfs.go
View file @
b8458b82
...
...
@@ -89,7 +89,7 @@ func openFile(fs fuse.FileSystem, name string) (result *openResponse) {
buf
:=
bytes
.
NewBuffer
(
nil
)
input
:=
fuse
.
ReadIn
{
Offset
:
0
,
Size
:
128
*
(
1
<<
10
),
Size
:
128
*
(
1
<<
10
),
Flags
:
flags
,
}
...
...
@@ -181,7 +181,7 @@ func (me *CachingFileSystem) OpenDir(name string) (stream chan fuse.DirEntry, st
// Caching file contents easily overflows available memory.
func
(
me
*
CachingFileSystem
)
DisabledOpen
(
name
string
,
flags
uint32
)
(
f
fuse
.
File
,
status
fuse
.
Status
)
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
return
nil
,
fuse
.
EPERM
}
...
...
unionfs/cachingfs_test.go
View file @
b8458b82
...
...
@@ -70,4 +70,3 @@ func TestCachingFs(t *testing.T) {
t
.
Error
(
"Unexpected readdir result"
,
results
,
expected
)
}
}
unionfs/timedcache.go
View file @
b8458b82
...
...
@@ -94,12 +94,12 @@ func (me *TimedCache) Purge() {
}
func
(
me
*
TimedCache
)
RecurringPurge
()
{
if
(
me
.
ttlNs
<=
0
)
{
if
me
.
ttlNs
<=
0
{
return
}
me
.
Purge
()
me
.
PurgeTimer
=
time
.
AfterFunc
(
me
.
ttlNs
*
5
,
me
.
PurgeTimer
=
time
.
AfterFunc
(
me
.
ttlNs
*
5
,
func
()
{
me
.
RecurringPurge
()
})
}
...
...
unionfs/unionfs.go
View file @
b8458b82
...
...
@@ -497,7 +497,7 @@ func (me *UnionFs) promoteDirsTo(filename string) fuse.Status {
if
r
.
code
!=
fuse
.
OK
{
log
.
Println
(
"path component does not exist"
,
filename
,
dirName
)
}
if
r
.
attr
.
Mode
&
fuse
.
S_IFDIR
==
0
{
if
r
.
attr
.
Mode
&
fuse
.
S_IFDIR
==
0
{
log
.
Println
(
"path component is not a directory."
,
dirName
,
r
)
return
fuse
.
EPERM
}
...
...
@@ -511,7 +511,7 @@ func (me *UnionFs) promoteDirsTo(filename string) fuse.Status {
}
for
i
,
_
:=
range
todo
{
j
:=
len
(
todo
)
-
i
-
1
j
:=
len
(
todo
)
-
i
-
1
d
:=
todo
[
j
]
log
.
Println
(
"Promoting directory"
,
d
)
code
:=
me
.
fileSystems
[
0
]
.
Mkdir
(
d
,
0755
)
...
...
unionfs/unionfs_test.go
View file @
b8458b82
...
...
@@ -140,13 +140,13 @@ func TestChtimes(t *testing.T) {
defer
clean
()
writeToFile
(
wd
+
"/ro/file"
,
"a"
)
err
:=
os
.
Chtimes
(
wd
+
"/ro/file"
,
42e9
,
43e9
)
err
:=
os
.
Chtimes
(
wd
+
"/ro/file"
,
42e9
,
43e9
)
CheckSuccess
(
err
)
err
=
os
.
Chtimes
(
wd
+
"/mount/file"
,
82e9
,
83e9
)
err
=
os
.
Chtimes
(
wd
+
"/mount/file"
,
82e9
,
83e9
)
CheckSuccess
(
err
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/mount/file"
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/mount/file"
)
if
fi
.
Atime_ns
!=
82e9
||
fi
.
Mtime_ns
!=
83e9
{
t
.
Error
(
"Incorrect timestamp"
,
fi
)
}
...
...
@@ -199,7 +199,7 @@ func TestBasic(t *testing.T) {
t
.
Errorf
(
"missing file in rw layer"
,
names
)
}
contents
:=
readFromFile
(
wd
+
"/mount/new"
)
contents
:=
readFromFile
(
wd
+
"/mount/new"
)
if
contents
!=
"new contents"
{
t
.
Errorf
(
"read mismatch: '%v'"
,
contents
)
}
...
...
@@ -297,7 +297,7 @@ func TestMkdirPromote(t *testing.T) {
err
=
os
.
Mkdir
(
wd
+
"/mount/subdir/subdir2/dir3"
,
0755
)
CheckSuccess
(
err
)
fi
,
_
:=
os
.
Lstat
(
wd
+
"/rw/subdir/subdir2/dir3"
)
fi
,
_
:=
os
.
Lstat
(
wd
+
"/rw/subdir/subdir2/dir3"
)
CheckSuccess
(
err
)
if
fi
==
nil
||
!
fi
.
IsDirectory
()
{
t
.
Error
(
"is not a directory: "
,
fi
)
...
...
@@ -409,13 +409,13 @@ func TestCopyChmod(t *testing.T) {
fi
,
err
:=
os
.
Lstat
(
fn
)
CheckSuccess
(
err
)
if
fi
.
Mode
&
0111
==
0
{
if
fi
.
Mode
&
0111
==
0
{
t
.
Errorf
(
"1st attr error %o"
,
fi
.
Mode
)
}
time
.
Sleep
(
entryTtl
*
1.1e9
)
fi
,
err
=
os
.
Lstat
(
fn
)
CheckSuccess
(
err
)
if
fi
.
Mode
&
0111
==
0
{
if
fi
.
Mode
&
0111
==
0
{
t
.
Errorf
(
"uncached attr error %o"
,
fi
.
Mode
)
}
}
...
...
@@ -445,7 +445,7 @@ func TestTruncateTimestamp(t *testing.T) {
fi
,
err
:=
os
.
Lstat
(
fn
)
CheckSuccess
(
err
)
if
abs
(
truncTs
-
fi
.
Mtime_ns
)
>
0.1e9
{
if
abs
(
truncTs
-
fi
.
Mtime_ns
)
>
0.1e9
{
t
.
Error
(
"timestamp drift"
,
truncTs
,
fi
.
Mtime_ns
)
}
}
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