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
cb9381c5
Commit
cb9381c5
authored
Feb 02, 2016
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse/nodefs: Set all fields in memNode before making it available.
This fixes the data race in TestDeleteNotify.
parent
cb68d31a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
fuse/nodefs/memnode.go
fuse/nodefs/memnode.go
+6
-10
No files found.
fuse/nodefs/memnode.go
View file @
cb9381c5
...
...
@@ -75,12 +75,6 @@ type memNode struct {
info
fuse
.
Attr
}
func
(
n
*
memNode
)
newNode
(
name
string
,
isDir
bool
)
*
memNode
{
newNode
:=
n
.
fs
.
newNode
()
n
.
Inode
()
.
NewChild
(
name
,
isDir
,
newNode
)
return
newNode
}
func
(
n
*
memNode
)
filename
()
string
{
return
fmt
.
Sprintf
(
"%s%d"
,
n
.
fs
.
backingStorePrefix
,
n
.
id
)
}
...
...
@@ -98,8 +92,9 @@ func (n *memNode) StatFs() *fuse.StatfsOut {
}
func
(
n
*
memNode
)
Mkdir
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
(
newNode
*
Inode
,
code
fuse
.
Status
)
{
ch
:=
n
.
newNode
(
name
,
true
)
ch
:=
n
.
fs
.
newNode
(
)
ch
.
info
.
Mode
=
mode
|
fuse
.
S_IFDIR
n
.
Inode
()
.
NewChild
(
name
,
true
,
ch
)
return
ch
.
Inode
(),
fuse
.
OK
}
...
...
@@ -116,10 +111,10 @@ func (n *memNode) Rmdir(name string, context *fuse.Context) (code fuse.Status) {
}
func
(
n
*
memNode
)
Symlink
(
name
string
,
content
string
,
context
*
fuse
.
Context
)
(
newNode
*
Inode
,
code
fuse
.
Status
)
{
ch
:=
n
.
newNode
(
name
,
false
)
ch
:=
n
.
fs
.
newNode
(
)
ch
.
info
.
Mode
=
fuse
.
S_IFLNK
|
0777
ch
.
link
=
content
n
.
Inode
()
.
NewChild
(
name
,
false
,
ch
)
return
ch
.
Inode
(),
fuse
.
OK
}
...
...
@@ -136,13 +131,14 @@ func (n *memNode) Link(name string, existing Node, context *fuse.Context) (*Inod
}
func
(
n
*
memNode
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
,
context
*
fuse
.
Context
)
(
file
File
,
node
*
Inode
,
code
fuse
.
Status
)
{
ch
:=
n
.
newNode
(
name
,
false
)
ch
:=
n
.
fs
.
newNode
(
)
ch
.
info
.
Mode
=
mode
|
fuse
.
S_IFREG
f
,
err
:=
os
.
Create
(
ch
.
filename
())
if
err
!=
nil
{
return
nil
,
nil
,
fuse
.
ToStatus
(
err
)
}
n
.
Inode
()
.
NewChild
(
name
,
false
,
ch
)
return
ch
.
newFile
(
f
),
ch
.
Inode
(),
fuse
.
OK
}
...
...
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