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
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
Joshua
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() {
...
@@ -329,9 +329,11 @@ error _Conn::close() {
// - virt_lock
// - virt_lock
// - wconn.atMu.R
// - wconn.atMu.R
// - wconn.filehMu unlocked
// - wconn.filehMu unlocked
err
=
f
->
_closeLocked
();
if
(
!
closing
)
{
if
(
err
!=
nil
)
err
=
f
->
_closeLocked
(
/*force=*/
true
);
reterr1
(
err
);
if
(
err
!=
nil
)
reterr1
(
err
);
}
// wait for f close to complete, as it might be that f.close was called
// 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
// simultaneously to us or just before. f is removed from
...
@@ -868,7 +870,7 @@ error _FileH::close() {
...
@@ -868,7 +870,7 @@ error _FileH::close() {
wconn
->
_atMu
.
RUnlock
();
wconn
->
_atMu
.
RUnlock
();
});
});
return
fileh
.
_closeLocked
();
return
fileh
.
_closeLocked
(
/*force=*/
false
);
}
}
// _closeLocked serves FileH.close and Conn.close.
// _closeLocked serves FileH.close and Conn.close.
...
@@ -876,7 +878,7 @@ error _FileH::close() {
...
@@ -876,7 +878,7 @@ error _FileH::close() {
// Must be called with the following locks held by caller:
// Must be called with the following locks held by caller:
// - virt_lock
// - virt_lock
// - wconn.atMu
// - wconn.atMu
error
_FileH
::
_closeLocked
()
{
error
_FileH
::
_closeLocked
(
bool
force
)
{
_FileH
&
fileh
=
*
this
;
_FileH
&
fileh
=
*
this
;
Conn
wconn
=
fileh
.
wconn
;
Conn
wconn
=
fileh
.
wconn
;
...
@@ -893,7 +895,7 @@ error _FileH::_closeLocked() {
...
@@ -893,7 +895,7 @@ error _FileH::_closeLocked() {
if
(
fileh
.
_nopen
<=
0
)
if
(
fileh
.
_nopen
<=
0
)
panic
(
"BUG: fileh.close: fileh._nopen <= 0"
);
panic
(
"BUG: fileh.close: fileh._nopen <= 0"
);
fileh
.
_nopen
--
;
fileh
.
_nopen
--
;
if
(
fileh
.
_nopen
>
0
)
if
(
fileh
.
_nopen
>
0
&&
!
force
)
return
nil
;
return
nil
;
// last open went away - real close.
// last open went away - real close.
...
...
wcfs/client/wcfs.h
View file @
744dc883
...
@@ -264,7 +264,7 @@ public:
...
@@ -264,7 +264,7 @@ public:
string
String
()
const
;
string
String
()
const
;
error
_open
();
error
_open
();
error
_closeLocked
();
error
_closeLocked
(
bool
force
);
};
};
// Mapping represents one memory mapping of FileH.
// 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