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
Kirill Smelkov
go-fuse
Commits
b8a27afb
Commit
b8a27afb
authored
Jun 28, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: drop Server.ThreadSanitizerSync, and switch on -race tests in all.bash.
parent
7acec635
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
21 deletions
+10
-21
all.bash
all.bash
+1
-1
fuse/nodefs/handle.go
fuse/nodefs/handle.go
+9
-2
fuse/server.go
fuse/server.go
+0
-18
No files found.
all.bash
View file @
b8a27afb
...
...
@@ -15,7 +15,7 @@ done
for
d
in
fuse zipfs unionfs
do
(
cd
$d
&&
go
test
go-fuse/
$d
)
(
cd
$d
&&
go
test
go-fuse/
$d
&&
go
test
-race
go-fuse/
$d
)
done
make
-C
benchmark
...
...
fuse/nodefs/handle.go
View file @
b8a27afb
...
...
@@ -288,7 +288,7 @@ func (m *int64HandleMap) Register(obj *handled) (handle uint64) {
obj
.
handle
=
handle
m
.
handles
[
handle
]
=
obj
}
else
{
handle
=
m
.
H
andle
(
obj
)
handle
=
m
.
h
andle
(
obj
)
}
obj
.
count
++
m
.
mutex
.
Unlock
()
...
...
@@ -296,7 +296,7 @@ func (m *int64HandleMap) Register(obj *handled) (handle uint64) {
return
handle
}
func
(
m
*
int64HandleMap
)
H
andle
(
obj
*
handled
)
(
handle
uint64
)
{
func
(
m
*
int64HandleMap
)
h
andle
(
obj
*
handled
)
(
handle
uint64
)
{
if
obj
.
count
==
0
{
return
0
}
...
...
@@ -307,6 +307,13 @@ func (m *int64HandleMap) Handle(obj *handled) (handle uint64) {
return
handle
}
func
(
m
*
int64HandleMap
)
Handle
(
obj
*
handled
)
(
handle
uint64
)
{
m
.
mutex
.
Lock
()
m
.
mutex
.
Unlock
()
return
m
.
handle
(
obj
)
}
func
(
m
*
int64HandleMap
)
Forget
(
handle
uint64
,
count
int
)
(
forgotten
bool
,
obj
*
handled
)
{
defer
m
.
verify
()
obj
=
m
.
Decode
(
handle
)
...
...
fuse/server.go
View file @
b8a27afb
...
...
@@ -49,24 +49,6 @@ type Server struct {
loops
sync
.
WaitGroup
}
// Use this method to make synchronization between accessing a
// filesystem object through the operating system, and accessing a
// filesystem internally, so thread-sanitizer does not get confused.
//
// fs := SomeFSObj{ReadCalled: false}
// ms := NewServer(fs)
// ms.Mount("/mnt", nil)
// ..
// ioutil.ReadFile("/mnt/file")
//
// mountstate.ThreadSanitizerSync()
// if fs.ReadCalled { ... // no race condition here.
//
func
(
ms
*
Server
)
ThreadSanitizerSync
()
{
ms
.
reqMu
.
Lock
()
ms
.
reqMu
.
Unlock
()
}
func
(
ms
*
Server
)
SetDebug
(
dbg
bool
)
{
ms
.
debug
=
dbg
}
...
...
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