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
4673f8b4
Commit
4673f8b4
authored
Sep 08, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make considerDropInode() in FileSystemConnector.ReleaseDir() take the
treeLock.
parent
2003d2b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
fuse/fsconnector.go
fuse/fsconnector.go
+12
-3
fuse/fsops.go
fuse/fsops.go
+2
-2
No files found.
fuse/fsconnector.go
View file @
4673f8b4
...
...
@@ -134,13 +134,22 @@ func (me *FileSystemConnector) forgetUpdate(nodeId uint64, forgetCount int) {
defer
node
.
treeLock
.
Unlock
()
node
.
addLookupCount
(
-
forgetCount
)
me
.
c
onsiderDropInode
(
node
)
me
.
recursiveC
onsiderDropInode
(
node
)
}
func
(
me
*
FileSystemConnector
)
considerDropInode
(
n
*
Inode
)
(
drop
bool
)
{
func
(
me
*
FileSystemConnector
)
considerDropInode
(
node
*
Inode
)
{
node
.
treeLock
.
Lock
()
defer
node
.
treeLock
.
Unlock
()
me
.
recursiveConsiderDropInode
(
node
)
}
// Must hold treeLock.
func
(
me
*
FileSystemConnector
)
recursiveConsiderDropInode
(
n
*
Inode
)
(
drop
bool
)
{
delChildren
:=
[]
string
{}
for
k
,
v
:=
range
n
.
children
{
if
v
.
mountPoint
==
nil
&&
me
.
considerDropInode
(
v
)
{
// Only consider children from the same mount, or
// already unmounted mountpoints.
if
v
.
mountPoint
==
nil
&&
me
.
recursiveConsiderDropInode
(
v
)
{
delChildren
=
append
(
delChildren
,
k
)
}
}
...
...
fuse/fsops.go
View file @
4673f8b4
...
...
@@ -334,8 +334,8 @@ func (me *FileSystemConnector) Create(header *InHeader, input *CreateIn, name st
func
(
me
*
FileSystemConnector
)
Release
(
header
*
InHeader
,
input
*
ReleaseIn
)
{
node
:=
me
.
getInodeData
(
header
.
NodeId
)
me
.
getOpenedFile
(
input
.
Fh
)
.
WithFlags
.
File
.
Release
(
)
node
.
mount
.
unregisterFileHandle
(
input
.
Fh
,
node
)
opened
:=
node
.
mount
.
unregisterFileHandle
(
input
.
Fh
,
node
)
opened
.
WithFlags
.
File
.
Release
(
)
}
func
(
me
*
FileSystemConnector
)
Flush
(
header
*
InHeader
,
input
*
FlushIn
)
Status
{
...
...
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