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
4bc4f55c
Commit
4bc4f55c
authored
Apr 21, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maybe drop inode on closing file as well.
parent
6ff9f82d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+16
-10
No files found.
fuse/pathfilesystem.go
View file @
4bc4f55c
...
...
@@ -279,17 +279,21 @@ func (me *PathFileSystemConnector) forgetUpdate(nodeId uint64, forgetCount int)
data
,
ok
:=
me
.
inodeMap
[
nodeId
]
if
ok
{
data
.
LookupCount
-=
forgetCount
me
.
considerDropInode
(
data
)
}
}
if
data
.
mount
!=
nil
{
data
.
mount
.
mutex
.
RLock
()
defer
data
.
mount
.
mutex
.
RUnlock
()
}
// TODO - this should probably not happen at all.
if
data
.
LookupCount
<=
0
&&
len
(
data
.
Children
)
==
0
&&
(
data
.
mount
==
nil
||
data
.
mount
.
unmountPending
)
{
data
.
setParent
(
nil
)
me
.
inodeMap
[
nodeId
]
=
nil
,
false
}
func
(
me
*
PathFileSystemConnector
)
considerDropInode
(
n
*
inode
)
{
if
n
.
mount
!=
nil
{
n
.
mount
.
mutex
.
RLock
()
defer
n
.
mount
.
mutex
.
RUnlock
()
}
// TODO - this should probably not happen at all.
if
(
n
.
LookupCount
<=
0
&&
len
(
n
.
Children
)
==
0
&&
(
n
.
mount
==
nil
||
n
.
mount
.
unmountPending
)
&&
n
.
OpenCount
<=
0
)
{
n
.
setParent
(
nil
)
me
.
inodeMap
[
n
.
NodeId
]
=
nil
,
false
}
}
...
...
@@ -769,12 +773,14 @@ func (me *PathFileSystemConnector) Release(header *InHeader, input *ReleaseIn) {
_
,
_
,
node
:=
me
.
GetPath
(
header
.
NodeId
)
f
:=
me
.
unregisterFile
(
node
,
input
.
Fh
)
.
(
FuseFile
)
f
.
Release
()
me
.
considerDropInode
(
node
)
}
func
(
me
*
PathFileSystemConnector
)
ReleaseDir
(
header
*
InHeader
,
input
*
ReleaseIn
)
{
_
,
_
,
node
:=
me
.
GetPath
(
header
.
NodeId
)
d
:=
me
.
unregisterFile
(
node
,
input
.
Fh
)
.
(
RawFuseDir
)
d
.
Release
()
me
.
considerDropInode
(
node
)
}
func
(
me
*
PathFileSystemConnector
)
FsyncDir
(
header
*
InHeader
,
input
*
FsyncIn
)
(
code
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