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
c07e64b1
Commit
c07e64b1
authored
Jun 30, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
4a79a89d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
20 deletions
+19
-20
fuse/handle.go
fuse/handle.go
+2
-2
fuse/loopback_test.go
fuse/loopback_test.go
+0
-1
fuse/mount_test.go
fuse/mount_test.go
+5
-5
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+3
-3
fuse/pathops.go
fuse/pathops.go
+1
-1
unionfs/autounion_test.go
unionfs/autounion_test.go
+2
-2
zipfs/multizip_test.go
zipfs/multizip_test.go
+6
-6
No files found.
fuse/handle.go
View file @
c07e64b1
...
...
@@ -64,11 +64,11 @@ func (me *HandleMap) Register(obj *Handled) (handle uint64) {
if
unsafe
.
Sizeof
(
obj
)
==
8
{
me
.
nextFree
=
me
.
nextFree
&
(
1
<<
(
64
-
48
+
3
)
-
1
)
rest
:=
(
handle
&^
(
1
<<
48
-
1
))
rest
:=
(
handle
&^
(
1
<<
48
-
1
))
if
rest
!=
0
{
panic
(
"more than 48 bits in address"
)
}
if
handle
&
0x7
!=
0
{
if
handle
&
0x7
!=
0
{
panic
(
"unaligned ptr"
)
}
handle
>>=
3
...
...
fuse/loopback_test.go
View file @
c07e64b1
...
...
@@ -657,4 +657,3 @@ func TestIoctl(t *testing.T) {
v
,
e
:=
ioctl
(
f
.
Fd
(),
0x5401
,
42
)
fmt
.
Println
(
"ioctl"
,
v
,
e
)
}
fuse/mount_test.go
View file @
c07e64b1
...
...
@@ -8,13 +8,13 @@ import (
"path/filepath"
"io/ioutil"
)
func
TestMountOnExisting
(
t
*
testing
.
T
)
{
ts
:=
new
(
testCase
)
ts
.
Setup
(
t
)
defer
ts
.
Cleanup
()
err
:=
os
.
Mkdir
(
ts
.
mountPoint
+
"/mnt"
,
0777
)
err
:=
os
.
Mkdir
(
ts
.
mountPoint
+
"/mnt"
,
0777
)
CheckSuccess
(
err
)
fs
:=
&
DefaultFileSystem
{}
code
:=
ts
.
connector
.
Mount
(
"/mnt"
,
fs
,
nil
)
...
...
@@ -39,7 +39,7 @@ func TestUnmountNoExist(t *testing.T) {
if
code
!=
EINVAL
{
t
.
Fatal
(
"expect EINVAL"
,
code
)
}
}
}
func
TestMountRename
(
t
*
testing
.
T
)
{
ts
:=
new
(
testCase
)
...
...
@@ -80,9 +80,9 @@ func TestRecursiveMount(t *testing.T) {
ts
.
Setup
(
t
)
defer
ts
.
Cleanup
()
err
:=
ioutil
.
WriteFile
(
ts
.
origDir
+
"/hello.txt"
,
[]
byte
(
"blabla"
),
0644
)
err
:=
ioutil
.
WriteFile
(
ts
.
origDir
+
"/hello.txt"
,
[]
byte
(
"blabla"
),
0644
)
CheckSuccess
(
err
)
fs
:=
NewLoopbackFileSystem
(
ts
.
origDir
)
code
:=
ts
.
connector
.
Mount
(
"/mnt"
,
fs
,
nil
)
if
!
code
.
Ok
()
{
...
...
fuse/pathfilesystem.go
View file @
c07e64b1
...
...
@@ -108,7 +108,7 @@ type inode struct {
Handled
// Constant during lifetime.
NodeId
uint64
NodeId
uint64
// Number of open files and its protection.
OpenCountMutex
sync
.
Mutex
...
...
@@ -174,8 +174,8 @@ func (me *inode) GetMountDirEntries() (out []DirEntry) {
for
k
,
_
:=
range
me
.
Mounts
{
out
=
append
(
out
,
DirEntry
{
Name
:
k
,
Mode
:
S_IFDIR
,
Name
:
k
,
Mode
:
S_IFDIR
,
})
}
return
out
...
...
fuse/pathops.go
View file @
c07e64b1
...
...
@@ -141,7 +141,7 @@ func (me *FileSystemConnector) OpenDir(header *InHeader, input *OpenIn) (flags u
}
de
:=
&
Dir
{
extra
:
node
.
GetMountDirEntries
(),
extra
:
node
.
GetMountDirEntries
(),
stream
:
stream
,
}
h
:=
mount
.
registerFileHandle
(
node
,
de
,
nil
,
input
.
Flags
)
...
...
unionfs/autounion_test.go
View file @
c07e64b1
...
...
@@ -74,7 +74,7 @@ func TestAutoFsSymlink(t *testing.T) {
err
:=
os
.
Mkdir
(
wd
+
"/store/backing1"
,
0755
)
CheckSuccess
(
err
)
os
.
Symlink
(
wd
+
"/ro"
,
wd
+
"/store/backing1/READONLY"
)
CheckSuccess
(
err
)
...
...
@@ -89,7 +89,7 @@ func TestAutoFsSymlink(t *testing.T) {
if
len
(
entries
)
!=
3
{
t
.
Error
(
"readdir mismatch"
,
entries
)
}
err
=
os
.
Remove
(
wd
+
"/mount/config/manual1"
)
CheckSuccess
(
err
)
...
...
zipfs/multizip_test.go
View file @
c07e64b1
...
...
@@ -36,7 +36,7 @@ func setupMzfs() (mountPoint string, cleanup func()) {
func
TestMultiZipReadonly
(
t
*
testing
.
T
)
{
mountPoint
,
cleanup
:=
setupMzfs
()
defer
cleanup
()
_
,
err
:=
os
.
Create
(
mountPoint
+
"/random"
)
if
err
==
nil
{
t
.
Error
(
"Must fail writing in root."
)
...
...
@@ -61,7 +61,7 @@ func TestMultiZipFs(t *testing.T) {
t
.
Errorf
(
"wrong names return. %v"
,
entries
)
}
err
=
os
.
Symlink
(
zipFile
,
mountPoint
+
"/config/zipmount"
)
err
=
os
.
Symlink
(
zipFile
,
mountPoint
+
"/config/zipmount"
)
CheckSuccess
(
err
)
fi
,
err
:=
os
.
Lstat
(
mountPoint
+
"/zipmount"
)
...
...
@@ -74,24 +74,24 @@ func TestMultiZipFs(t *testing.T) {
if
len
(
entries
)
!=
2
{
t
.
Error
(
"Expect 2 entries"
,
entries
)
}
val
,
err
:=
os
.
Readlink
(
mountPoint
+
"/config/zipmount"
)
CheckSuccess
(
err
)
if
val
!=
zipFile
{
t
.
Errorf
(
"expected %v got %v"
,
zipFile
,
val
)
}
// Check that zipfs itself works.
fi
,
err
=
os
.
Stat
(
mountPoint
+
"/zipmount/subdir"
)
CheckSuccess
(
err
)
if
!
fi
.
IsDirectory
()
{
t
.
Error
(
"directory type"
,
fi
)
}
}
// Removing the config dir unmount
err
=
os
.
Remove
(
mountPoint
+
"/config/zipmount"
)
CheckSuccess
(
err
)
// This is ugly but necessary: We don't have ways to signal
// back to FUSE that the file disappeared.
time
.
Sleep
(
1.5e9
*
testTtl
)
...
...
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