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
3e687784
Commit
3e687784
authored
Jun 30, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not register filesystem if mount failed.
parent
c07e64b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
unionfs/autounion.go
unionfs/autounion.go
+11
-14
No files found.
unionfs/autounion.go
View file @
3e687784
...
...
@@ -76,7 +76,7 @@ func (me *AutoUnionFs) addAutomaticFs(roots []string) {
}
}
func
(
me
*
AutoUnionFs
)
createFs
(
name
string
,
roots
[]
string
)
(
*
UnionFs
,
fuse
.
Status
)
{
func
(
me
*
AutoUnionFs
)
createFs
(
name
string
,
roots
[]
string
)
(
fuse
.
Status
)
{
me
.
lock
.
Lock
()
defer
me
.
lock
.
Unlock
()
...
...
@@ -84,28 +84,29 @@ func (me *AutoUnionFs) createFs(name string, roots []string) (*UnionFs, fuse.Sta
if
root
==
roots
[
0
]
&&
workspace
!=
name
{
log
.
Printf
(
"Already have a union FS for directory %s in workspace %s"
,
roots
[
0
],
workspace
)
return
nil
,
fuse
.
EBUSY
return
fuse
.
EBUSY
}
}
ufs
:=
me
.
knownFileSystems
[
name
]
if
ufs
!=
nil
{
log
.
Println
(
"Already have a workspace:"
,
name
)
return
nil
,
fuse
.
EBUSY
return
fuse
.
EBUSY
}
ufs
,
err
:=
NewUnionFsFromRoots
(
roots
,
&
me
.
options
.
UnionFsOptions
)
if
err
!=
nil
{
log
.
Println
(
"Could not create UnionFs:"
,
err
)
return
nil
,
fuse
.
EPERM
return
fuse
.
EPERM
}
log
.
Printf
(
"Adding workspace %v for roots %v"
,
name
,
ufs
.
Name
())
me
.
knownFileSystems
[
name
]
=
ufs
me
.
nameRootMap
[
name
]
=
roots
[
0
]
return
ufs
,
fuse
.
OK
code
:=
me
.
connector
.
Mount
(
"/"
+
name
,
ufs
,
&
me
.
options
.
FileSystemOptions
)
if
code
.
Ok
()
{
me
.
knownFileSystems
[
name
]
=
ufs
me
.
nameRootMap
[
name
]
=
roots
[
0
]
}
return
code
}
func
(
me
*
AutoUnionFs
)
rmFs
(
name
string
)
(
code
fuse
.
Status
)
{
...
...
@@ -133,11 +134,7 @@ func (me *AutoUnionFs) addFs(name string, roots []string) (code fuse.Status) {
log
.
Println
(
"Illegal name for overlay"
,
roots
)
return
fuse
.
EINVAL
}
fs
,
code
:=
me
.
createFs
(
name
,
roots
)
if
code
.
Ok
()
&&
fs
!=
nil
{
code
=
me
.
connector
.
Mount
(
"/"
+
name
,
fs
,
&
me
.
options
.
FileSystemOptions
)
}
return
code
return
me
.
createFs
(
name
,
roots
)
}
// TODO - should hide these methods.
...
...
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