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
10241e3f
Commit
10241e3f
authored
Jan 15, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7203f542
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
wcfs/internal/wcfs.cpp
wcfs/internal/wcfs.cpp
+16
-7
wcfs/internal/wcfs.h
wcfs/internal/wcfs.h
+1
-1
No files found.
wcfs/internal/wcfs.cpp
View file @
10241e3f
...
...
@@ -124,7 +124,7 @@ error _Conn::close() {
wconn
.
_pinCancel
();
err
=
wconn
.
_pinWG
->
wait
();
if
(
err
!=
context
::
canceled
)
// canceled - ok
reterr1
(
fmt
::
errorf
(
"pinwg.wait: %s"
,
v
(
err
)));
// XXX remove errctx
reterr1
(
err
);
// close all files - both that have no mappings and that still have opened mappings.
// XXX after file is closed mappings continue to survive, but we can no
...
...
@@ -151,8 +151,9 @@ error _Conn::close() {
}
// _pinner receives pin messages from wcfs and adjusts wconn mappings.
error
_Conn
::
_pinner
(
context
::
Context
ctx
)
{
// XXX error -> where?
error
_Conn
::
_pinner
(
context
::
Context
ctx
)
{
_Conn
&
wconn
=
*
this
;
xerr
::
Contextf
E
(
"pinner"
);
// NOTE pinner error goes to Conn::close who has its own context
// XXX panic/exc -> log.CRITICAL
#if 0
...
...
@@ -177,25 +178,33 @@ error _Conn::_pinner(context::Context ctx) { // XXX error -> where?
err
=
wconn
.
_wlink
->
recvReq
(
ctx
,
&
req
);
if
(
err
!=
nil
)
{
// XXX -> err, handle EOF, abort on *
return
err
;
// XXX ok? (EOF - when wcfs closes wlink)
return
E
(
err
)
;
// XXX ok? (EOF - when wcfs closes wlink)
}
// we received request to pin/unpin file block. handle it
wconn
.
_pin1
(
&
req
);
err
=
wconn
.
_pin1
(
&
req
);
if
(
err
!=
nil
)
{
return
E
(
err
);
}
}
}
// pin1 handles one pin request received from wcfs.
// XXX return error?
void
_Conn
::
_pin1
(
PinReq
*
req
)
{
error
_Conn
::
_pin1
(
PinReq
*
req
)
{
_Conn
&
wconn
=
*
this
;
xerr
::
Contextf
E
(
"pin f<%s> #%ld @%s"
,
v
(
req
->
foid
),
req
->
blk
,
v
(
req
->
at
));
error
err
=
wconn
.
__pin1
(
req
);
// reply either ack or nak on error
string
ack
=
"ack"
;
if
(
err
!=
nil
)
ack
=
fmt
::
sprintf
(
"nak: %s"
,
v
(
err
));
wconn
.
_wlink
->
replyReq
(
context
::
background
(),
req
,
ack
);
// XXX ctx ok?
error
err2
=
wconn
.
_wlink
->
replyReq
(
context
::
background
(),
req
,
ack
);
// XXX ctx ok?
if
(
err
==
nil
)
err
=
err2
;
return
E
(
err
);
}
error
_Conn
::
__pin1
(
PinReq
*
req
)
{
...
...
wcfs/internal/wcfs.h
View file @
10241e3f
...
...
@@ -125,7 +125,7 @@ public:
private:
error
_pinner
(
context
::
Context
ctx
);
void
_pin1
(
PinReq
*
req
);
error
_pin1
(
PinReq
*
req
);
error
__pin1
(
PinReq
*
req
);
};
...
...
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