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
5bc0863d
Commit
5bc0863d
authored
May 23, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix thinko: fold together duplicated variable.
parent
5c0109c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
unionfs/autounion.go
unionfs/autounion.go
+10
-7
unionfs/autounion_test.go
unionfs/autounion_test.go
+2
-1
unionfs/create.go
unionfs/create.go
+0
-2
No files found.
unionfs/autounion.go
View file @
5bc0863d
...
@@ -88,9 +88,10 @@ func (me *AutoUnionFs) createFs(name string, roots []string) (*UnionFs, fuse.Sta
...
@@ -88,9 +88,10 @@ func (me *AutoUnionFs) createFs(name string, roots []string) (*UnionFs, fuse.Sta
}
}
}
}
gofs
:=
me
.
knownFileSystems
[
name
]
ufs
:=
me
.
knownFileSystems
[
name
]
if
gofs
!=
nil
{
if
ufs
!=
nil
{
return
gofs
,
fuse
.
OK
log
.
Println
(
"Already have a workspace:"
,
name
)
return
nil
,
fuse
.
EBUSY
}
}
ufs
,
err
:=
NewUnionFsFromRoots
(
roots
,
&
me
.
options
.
UnionFsOptions
)
ufs
,
err
:=
NewUnionFsFromRoots
(
roots
,
&
me
.
options
.
UnionFsOptions
)
...
@@ -99,10 +100,12 @@ func (me *AutoUnionFs) createFs(name string, roots []string) (*UnionFs, fuse.Sta
...
@@ -99,10 +100,12 @@ func (me *AutoUnionFs) createFs(name string, roots []string) (*UnionFs, fuse.Sta
return
nil
,
fuse
.
EPERM
return
nil
,
fuse
.
EPERM
}
}
log
.
Printf
(
"Adding workspace %v for roots %v"
,
name
,
ufs
.
Name
())
me
.
knownFileSystems
[
name
]
=
ufs
me
.
knownFileSystems
[
name
]
=
ufs
me
.
nameRootMap
[
name
]
=
roots
[
0
]
me
.
nameRootMap
[
name
]
=
roots
[
0
]
return
go
fs
,
fuse
.
OK
return
u
fs
,
fuse
.
OK
}
}
func
(
me
*
AutoUnionFs
)
rmFs
(
name
string
)
(
code
fuse
.
Status
)
{
func
(
me
*
AutoUnionFs
)
rmFs
(
name
string
)
(
code
fuse
.
Status
)
{
...
@@ -130,9 +133,9 @@ func (me *AutoUnionFs) addFs(name string, roots []string) (code fuse.Status) {
...
@@ -130,9 +133,9 @@ func (me *AutoUnionFs) addFs(name string, roots []string) (code fuse.Status) {
log
.
Println
(
"Illegal name for overlay"
,
roots
)
log
.
Println
(
"Illegal name for overlay"
,
roots
)
return
fuse
.
EINVAL
return
fuse
.
EINVAL
}
}
go
fs
,
code
:=
me
.
createFs
(
name
,
roots
)
fs
,
code
:=
me
.
createFs
(
name
,
roots
)
if
go
fs
!=
nil
{
if
code
.
Ok
()
&&
fs
!=
nil
{
me
.
connector
.
Mount
(
"/"
+
name
,
go
fs
,
&
me
.
options
.
FileSystemOptions
)
code
=
me
.
connector
.
Mount
(
"/"
+
name
,
fs
,
&
me
.
options
.
FileSystemOptions
)
}
}
return
code
return
code
}
}
...
...
unionfs/autounion_test.go
View file @
5bc0863d
...
@@ -44,9 +44,10 @@ func setup(t *testing.T) (workdir string, cleanup func()) {
...
@@ -44,9 +44,10 @@ func setup(t *testing.T) (workdir string, cleanup func()) {
WriteFile
(
wd
+
"/ro/file2"
,
"file2"
)
WriteFile
(
wd
+
"/ro/file2"
,
"file2"
)
fs
:=
NewAutoUnionFs
(
wd
+
"/store"
,
testAOpts
)
fs
:=
NewAutoUnionFs
(
wd
+
"/store"
,
testAOpts
)
state
,
_
,
err
:=
fuse
.
MountFileSystem
(
wd
+
"/mount"
,
fs
,
&
testAOpts
.
FileSystemOptions
)
state
,
conn
,
err
:=
fuse
.
MountFileSystem
(
wd
+
"/mount"
,
fs
,
&
testAOpts
.
FileSystemOptions
)
CheckSuccess
(
err
)
CheckSuccess
(
err
)
state
.
Debug
=
true
state
.
Debug
=
true
conn
.
Debug
=
true
go
state
.
Loop
(
false
)
go
state
.
Loop
(
false
)
return
wd
,
func
()
{
return
wd
,
func
()
{
...
...
unionfs/create.go
View file @
5bc0863d
...
@@ -4,7 +4,6 @@ import (
...
@@ -4,7 +4,6 @@ import (
"fmt"
"fmt"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/zipfs"
"github.com/hanwen/go-fuse/zipfs"
"log"
"os"
"os"
)
)
...
@@ -30,6 +29,5 @@ func NewUnionFsFromRoots(roots []string, opts *UnionFsOptions) (*UnionFs, os.Err
...
@@ -30,6 +29,5 @@ func NewUnionFsFromRoots(roots []string, opts *UnionFsOptions) (*UnionFs, os.Err
}
}
identifier
:=
fmt
.
Sprintf
(
"%v"
,
roots
)
identifier
:=
fmt
.
Sprintf
(
"%v"
,
roots
)
log
.
Println
(
"Adding UnionFs for"
,
identifier
)
return
NewUnionFs
(
identifier
,
fses
,
*
opts
),
nil
return
NewUnionFs
(
identifier
,
fses
,
*
opts
),
nil
}
}
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