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
b45c5aaf
Commit
b45c5aaf
authored
Feb 21, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e8f67851
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+19
-5
No files found.
wcfs/client/wcfs.cpp
View file @
b45c5aaf
...
@@ -514,7 +514,7 @@ error _Conn::resync(zodb::Tid at) {
...
@@ -514,7 +514,7 @@ error _Conn::resync(zodb::Tid at) {
// TODO if file has no mappings and was not used during whole prev
// TODO if file has no mappings and was not used during whole prev
// cycle - forget and stop watching it
// cycle - forget and stop watching it
// XXX not yet ready f
?
// XXX not yet ready f
// update f._headfsize and remmap to head/f zero regions that are now covered by head/f
// update f._headfsize and remmap to head/f zero regions that are now covered by head/f
struct
stat
st
;
struct
stat
st
;
...
@@ -618,7 +618,7 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
...
@@ -618,7 +618,7 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
}
}
// create in-flight-opening FileH entry and perform open with wconn._mu released
// create in-flight-opening FileH entry and perform open with wconn._mu released
// NOTE wconn._atMu
is still held because
open relies on wconn.at being stable.
// NOTE wconn._atMu
.R is still held because FileH._
open relies on wconn.at being stable.
f
=
adoptref
(
new
_FileH
());
f
=
adoptref
(
new
_FileH
());
f
->
wconn
=
newref
(
&
wconn
);
f
->
wconn
=
newref
(
&
wconn
);
f
->
foid
=
foid
;
f
->
foid
=
foid
;
...
@@ -688,9 +688,8 @@ error _FileH::_open() {
...
@@ -688,9 +688,8 @@ error _FileH::_open() {
tie
(
ack
,
err
)
=
wconn
->
_wlink
->
sendReq
(
context
::
background
(),
fmt
::
sprintf
(
"watch %s @%s"
,
v
(
foid
),
v
(
wconn
->
at
)));
tie
(
ack
,
err
)
=
wconn
->
_wlink
->
sendReq
(
context
::
background
(),
fmt
::
sprintf
(
"watch %s @%s"
,
v
(
foid
),
v
(
wconn
->
at
)));
if
(
err
!=
nil
)
if
(
err
!=
nil
)
return
err
;
return
err
;
if
(
ack
!=
"ok"
)
{
if
(
ack
!=
"ok"
)
return
fmt
::
errorf
(
"watch: %s"
,
v
(
ack
));
return
fmt
::
errorf
(
"watch: %s"
,
v
(
ack
));
}
retok
=
true
;
retok
=
true
;
return
nil
;
return
nil
;
...
@@ -702,10 +701,25 @@ error _FileH::_open() {
...
@@ -702,10 +701,25 @@ error _FileH::_open() {
error
_FileH
::
close
()
{
error
_FileH
::
close
()
{
_FileH
&
fileh
=
*
this
;
_FileH
&
fileh
=
*
this
;
Conn
wconn
=
fileh
.
wconn
;
Conn
wconn
=
fileh
.
wconn
;
// XXX locking ok?
wconn
->
_atMu
.
RLock
();
defer
([
&
]()
{
wconn
->
_atMu
.
RUnlock
();
});
xerr
::
Contextf
E
(
"%s: close f<%s>"
,
v
(
wconn
),
v
(
fileh
.
foid
));
xerr
::
Contextf
E
(
"%s: close f<%s>"
,
v
(
wconn
),
v
(
fileh
.
foid
));
// XXX change all fileh.mmaps to cause EFAULT on any access after fileh.close
// XXX change all fileh.mmaps to cause EFAULT on any access after fileh.close
// XXX "watch foid -" -> wconn.wlink (stop watching the file)
// stop watching f
string
ack
;
error
err
;
tie
(
ack
,
err
)
=
wconn
->
_wlink
->
sendReq
(
context
::
background
(),
fmt
::
sprintf
(
"watch %s -"
,
v
(
foid
)));
if
(
err
!=
nil
)
return
E
(
err
);
if
(
ack
!=
"ok"
)
return
E
(
fmt
::
errorf
(
"unwatch: %s"
,
v
(
ack
)));
// remove fileh from wconn._filehTab
// remove fileh from wconn._filehTab
// fileh.close can be called several times and after first call another
// fileh.close can be called several times and after first call another
...
...
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