Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
744dc883
Commit
744dc883
authored
Mar 04, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c3e1d21f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+8
-6
wcfs/client/wcfs.h
wcfs/client/wcfs.h
+1
-1
No files found.
wcfs/client/wcfs.cpp
View file @
744dc883
...
...
@@ -329,9 +329,11 @@ error _Conn::close() {
// - virt_lock
// - wconn.atMu.R
// - wconn.filehMu unlocked
err
=
f
->
_closeLocked
();
if
(
err
!=
nil
)
reterr1
(
err
);
if
(
!
closing
)
{
err
=
f
->
_closeLocked
(
/*force=*/
true
);
if
(
err
!=
nil
)
reterr1
(
err
);
}
// wait for f close to complete, as it might be that f.close was called
// simultaneously to us or just before. f is removed from
...
...
@@ -868,7 +870,7 @@ error _FileH::close() {
wconn
->
_atMu
.
RUnlock
();
});
return
fileh
.
_closeLocked
();
return
fileh
.
_closeLocked
(
/*force=*/
false
);
}
// _closeLocked serves FileH.close and Conn.close.
...
...
@@ -876,7 +878,7 @@ error _FileH::close() {
// Must be called with the following locks held by caller:
// - virt_lock
// - wconn.atMu
error
_FileH
::
_closeLocked
()
{
error
_FileH
::
_closeLocked
(
bool
force
)
{
_FileH
&
fileh
=
*
this
;
Conn
wconn
=
fileh
.
wconn
;
...
...
@@ -893,7 +895,7 @@ error _FileH::_closeLocked() {
if
(
fileh
.
_nopen
<=
0
)
panic
(
"BUG: fileh.close: fileh._nopen <= 0"
);
fileh
.
_nopen
--
;
if
(
fileh
.
_nopen
>
0
)
if
(
fileh
.
_nopen
>
0
&&
!
force
)
return
nil
;
// last open went away - real close.
...
...
wcfs/client/wcfs.h
View file @
744dc883
...
...
@@ -264,7 +264,7 @@ public:
string
String
()
const
;
error
_open
();
error
_closeLocked
();
error
_closeLocked
(
bool
force
);
};
// Mapping represents one memory mapping of FileH.
...
...
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