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
90981c86
Commit
90981c86
authored
Aug 12, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UnionFs: handle mkdir after rmdir.
parent
24b35705
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
unionfs/unionfs.go
unionfs/unionfs.go
+12
-3
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+16
-1
No files found.
unionfs/unionfs.go
View file @
90981c86
...
...
@@ -105,6 +105,8 @@ func NewUnionFs(fileSystems []fuse.FileSystem, options UnionFsOptions) *UnionFs
////////////////
// Deal with all the caches.
// The isDeleted() method tells us if a path has a marker in the deletion store.
// It may return an error code if the store could not be accessed.
func
(
me
*
UnionFs
)
isDeleted
(
name
string
)
(
deleted
bool
,
code
fuse
.
Status
)
{
marker
:=
me
.
deletionPath
(
name
)
haveCache
,
found
:=
me
.
deletionCache
.
HasEntry
(
filepath
.
Base
(
marker
))
...
...
@@ -322,9 +324,16 @@ func (me *UnionFs) Rmdir(path string) (code fuse.Status) {
}
func
(
me
*
UnionFs
)
Mkdir
(
path
string
,
mode
uint32
)
(
code
fuse
.
Status
)
{
r
:=
me
.
getBranch
(
path
)
if
r
.
code
!=
fuse
.
ENOENT
{
return
syscall
.
EEXIST
deleted
,
code
:=
me
.
isDeleted
(
path
)
if
!
code
.
Ok
()
{
return
code
}
if
!
deleted
{
r
:=
me
.
getBranch
(
path
)
if
r
.
code
!=
fuse
.
ENOENT
{
return
syscall
.
EEXIST
}
}
code
=
me
.
promoteDirsTo
(
path
)
...
...
unionfs/unionfs_test.go
View file @
90981c86
...
...
@@ -351,6 +351,21 @@ func TestMkdirPromote(t *testing.T) {
}
}
func
TestRmdirMkdir
(
t
*
testing
.
T
)
{
wd
,
clean
:=
setupUfs
(
t
)
defer
clean
()
err
:=
os
.
Mkdir
(
wd
+
"/ro/subdir"
,
0755
)
CheckSuccess
(
err
)
dirname
:=
wd
+
"/mount/subdir"
err
=
os
.
Remove
(
dirname
)
CheckSuccess
(
err
)
err
=
os
.
Mkdir
(
dirname
,
0755
)
CheckSuccess
(
err
)
}
func
TestRename
(
t
*
testing
.
T
)
{
type
Config
struct
{
f1_ro
bool
...
...
@@ -409,7 +424,7 @@ func TestRename(t *testing.T) {
}
}
func
TestRenameDir
(
t
*
testing
.
T
)
{
func
TestRenameDir
Basic
(
t
*
testing
.
T
)
{
wd
,
clean
:=
setupUfs
(
t
)
defer
clean
()
...
...
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