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
7b36fe41
Commit
7b36fe41
authored
Mar 04, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9f829258
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+5
-4
wcfs/client/wcfs.h
wcfs/client/wcfs.h
+1
-0
No files found.
wcfs/client/wcfs.cpp
View file @
7b36fe41
...
...
@@ -967,18 +967,19 @@ pair<Mapping, error> _FileH::mmap(int64_t blk_start, int64_t blk_len, VMA *vma)
_FileH
&
f
=
*
this
;
// NOTE virtmem lock is held by virtmem caller
// XXX locking ok?
f
.
wconn
->
_
atMu
.
RLock
();
// e.g. f._headfsiz
e
f
.
_mmapMu
.
lock
();
// f._pinned, f._mmaps
f
.
wconn
->
_atMu
.
RLock
();
// e.g. f._headfsize
f
.
wconn
->
_
filehMu
.
RLock
();
// f._state FIXME too coars
e
f
.
_mmapMu
.
lock
();
// f._pinned, f._mmaps
defer
([
&
]()
{
f
.
_mmapMu
.
unlock
();
f
.
wconn
->
_filehMu
.
RUnlock
();
f
.
wconn
->
_atMu
.
RUnlock
();
});
xerr
::
Contextf
E
(
"%s: %s: mmap [#%ld +%ld)"
,
v
(
f
.
wconn
),
v
(
f
),
blk_start
,
blk_len
);
etrace
(
""
);
if
(
f
.
_state
>=
_FileHClosing
)
// XXX locking
if
(
f
.
_state
>=
_FileHClosing
)
return
make_pair
(
nil
,
E
(
os
::
ErrClosed
));
error
err
;
...
...
wcfs/client/wcfs.h
View file @
7b36fe41
...
...
@@ -221,6 +221,7 @@ private:
//
// It is safe to use FileH from multiple threads simultaneously.
enum
_FileHState
{
// NOTE order of states is semantically important
_FileHOpening
=
0
,
// FileH open is in progress
_FileHOpened
=
1
,
// FileH is opened and can be used
_FileHClosing
=
2
,
// FileH close is in progress
...
...
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