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
b3ea7e6b
Commit
b3ea7e6b
authored
Jul 06, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
4cc77e52
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
36 deletions
+35
-36
fuse/mountstate.go
fuse/mountstate.go
+2
-2
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+8
-8
fuse/switchfs.go
fuse/switchfs.go
+3
-4
fuse/switchfs_test.go
fuse/switchfs_test.go
+21
-21
unionfs/autounion.go
unionfs/autounion.go
+1
-1
No files found.
fuse/mountstate.go
View file @
b3ea7e6b
fuse/pathfilesystem.go
View file @
b3ea7e6b
fuse/switchfs.go
View file @
b3ea7e6b
...
...
@@ -65,7 +65,7 @@ func NewSwitchFileSystem(fsMap []SwitchedFileSystem) *SwitchFileSystem {
// numbers of switched filesystems.
func
(
me
*
SwitchFileSystem
)
findFileSystem
(
path
string
)
(
string
,
*
SwitchedFileSystem
)
{
for
_
,
swFs
:=
range
me
.
fileSystems
{
if
swFs
.
Prefix
==
""
||
swFs
.
Prefix
==
path
||
strings
.
HasPrefix
(
path
,
swFs
.
Prefix
+
string
(
filepath
.
Separator
))
{
if
swFs
.
Prefix
==
""
||
swFs
.
Prefix
==
path
||
strings
.
HasPrefix
(
path
,
swFs
.
Prefix
+
string
(
filepath
.
Separator
))
{
if
swFs
.
StripPrefix
{
path
=
strings
.
TrimLeft
(
path
[
len
(
swFs
.
Prefix
)
:
],
string
(
filepath
.
Separator
))
}
...
...
@@ -271,4 +271,3 @@ func (me *SwitchFileSystem) Flush(name string) Status {
}
return
fs
.
FileSystem
.
Flush
(
name
)
}
fuse/switchfs_test.go
View file @
b3ea7e6b
...
...
@@ -7,12 +7,12 @@ import (
func
TestSwitchFsSlash
(
t
*
testing
.
T
)
{
fsMap
:=
[]
SwitchedFileSystem
{
SwitchedFileSystem
{
Prefix
:
""
},
SwitchedFileSystem
{
Prefix
:
"/home"
},
SwitchedFileSystem
{
Prefix
:
"usr/"
},
SwitchedFileSystem
{
Prefix
:
"/home"
},
SwitchedFileSystem
{
Prefix
:
"usr/"
},
}
sfs
:=
NewSwitchFileSystem
(
fsMap
)
for
path
,
expectPrefix
:=
range
map
[
string
]
string
{
for
path
,
expectPrefix
:=
range
map
[
string
]
string
{
"home/foo/bar"
:
"home"
,
"usr/local"
:
"usr"
,
}
{
...
...
@@ -26,14 +26,14 @@ func TestSwitchFsSlash(t *testing.T) {
func
TestSwitchFs
(
t
*
testing
.
T
)
{
fsMap
:=
[]
SwitchedFileSystem
{
SwitchedFileSystem
{
Prefix
:
""
},
SwitchedFileSystem
{
Prefix
:
"home/foo"
},
SwitchedFileSystem
{
Prefix
:
"home"
},
SwitchedFileSystem
{
Prefix
:
"usr"
},
SwitchedFileSystem
{
Prefix
:
"home/foo"
},
SwitchedFileSystem
{
Prefix
:
"home"
},
SwitchedFileSystem
{
Prefix
:
"usr"
},
}
sfs
:=
NewSwitchFileSystem
(
fsMap
)
for
path
,
expectPrefix
:=
range
map
[
string
]
string
{
for
path
,
expectPrefix
:=
range
map
[
string
]
string
{
"xyz"
:
""
,
"home/foo/bar"
:
"home/foo"
,
"home/fooz/bar"
:
"home"
,
...
...
@@ -53,14 +53,14 @@ func TestSwitchFs(t *testing.T) {
func
TestSwitchFsStrip
(
t
*
testing
.
T
)
{
fsMap
:=
[]
SwitchedFileSystem
{
SwitchedFileSystem
{
Prefix
:
""
},
SwitchedFileSystem
{
Prefix
:
"dev"
,
StripPrefix
:
true
},
SwitchedFileSystem
{
Prefix
:
"home"
,
StripPrefix
:
false
},
SwitchedFileSystem
{
Prefix
:
"dev"
,
StripPrefix
:
true
},
SwitchedFileSystem
{
Prefix
:
"home"
,
StripPrefix
:
false
},
}
sfs
:=
NewSwitchFileSystem
(
fsMap
)
// Don't check for inputs ending in '/' since Go-FUSE never
// generates them.
for
path
,
expectPath
:=
range
map
[
string
]
string
{
for
path
,
expectPath
:=
range
map
[
string
]
string
{
"xyz"
:
"xyz"
,
"home/foo/bar"
:
"home/foo/bar"
,
"home"
:
"home"
,
...
...
unionfs/autounion.go
View file @
b3ea7e6b
...
...
@@ -76,7 +76,7 @@ func (me *AutoUnionFs) addAutomaticFs(roots []string) {
}
}
func
(
me
*
AutoUnionFs
)
createFs
(
name
string
,
roots
[]
string
)
(
fuse
.
Status
)
{
func
(
me
*
AutoUnionFs
)
createFs
(
name
string
,
roots
[]
string
)
fuse
.
Status
{
me
.
lock
.
Lock
()
defer
me
.
lock
.
Unlock
()
...
...
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