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
1f8ad317
Commit
1f8ad317
authored
Feb 19, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a0062f59
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+8
-9
wcfs/client/wcfs_misc.cpp
wcfs/client/wcfs_misc.cpp
+1
-1
wcfs/client/wcfs_misc.h
wcfs/client/wcfs_misc.h
+5
-4
No files found.
wcfs/client/wcfs.cpp
View file @
1f8ad317
...
...
@@ -330,7 +330,7 @@ error _Conn::__pin1(PinReq *req) {
pair
<
FileH
,
error
>
_Conn
::
open
(
zodb
::
Oid
foid
)
{
_Conn
&
wconn
=
*
this
;
error
err
;
xerr
::
Contextf
E
(
"
wcfs %s: conn @%s: open f<%s>"
,
v
(
wconn
.
_wc
->
mountpoint
),
v
(
wconn
.
at
),
v
(
foid
));
xerr
::
Contextf
E
(
"
%s: open f<%s>"
,
v
(
wconn
),
v
(
foid
));
// XXX wconn._atMu.RLock()
// XXX defer wconn._atMu.RUnlock()
...
...
@@ -429,7 +429,7 @@ error _FileH::_open() {
error
_FileH
::
close
()
{
_FileH
&
fileh
=
*
this
;
Conn
wconn
=
fileh
.
wconn
;
xerr
::
Contextf
E
(
"
wcfs %s: conn @%s: close f<%s>"
,
v
(
wconn
->
_wc
->
mountpoint
),
v
(
wconn
->
at
),
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 "watch foid -" -> wconn.wlink (stop watchingthe file)
...
...
@@ -452,8 +452,7 @@ error _FileH::close() {
// virtmem calls FileH::mmap under virtmem lock when virtmem fileh is mmapped into vma.
pair
<
Mapping
,
error
>
_FileH
::
mmap
(
int64_t
blk_start
,
int64_t
blk_len
,
VMA
*
vma
)
{
_FileH
&
f
=
*
this
;
xerr
::
Contextf
E
(
"wcfs %s: conn @%s: mmap f<%s> [blk%ld +blk%ld)"
,
v
(
f
.
wconn
->
_wc
->
mountpoint
),
v
(
f
.
wconn
->
at
),
v
(
f
.
foid
),
blk_start
,
blk_len
);
xerr
::
Contextf
E
(
"%s: mmap f<%s> [blk%ld +blk%ld)"
,
v
(
f
.
wconn
),
v
(
f
.
foid
),
blk_start
,
blk_len
);
error
err
;
...
...
@@ -541,8 +540,7 @@ pair<Mapping, error> _FileH::mmap(int64_t blk_start, int64_t blk_len, VMA *vma)
error
_Mapping
::
unmap
()
{
Mapping
mmap
=
newref
(
this
);
// XXX newref for std::remove
FileH
f
=
mmap
->
fileh
;
xerr
::
Contextf
E
(
"wcfs %s: conn @%s: f<%s>: unmap"
,
v
(
f
->
wconn
->
_wc
->
mountpoint
),
v
(
f
->
wconn
->
at
),
v
(
f
->
foid
));
xerr
::
Contextf
E
(
"%s: f<%s>: unmap"
,
v
(
f
->
wconn
),
v
(
f
->
foid
));
// NOTE virtmem lock is held by virtmem caller
// XXX locking
...
...
@@ -576,12 +574,13 @@ error _Mapping::unmap() {
// resync resyncs connection and its mappings onto different database view.
error
_Conn
::
resync
(
zodb
::
Tid
at
)
{
_Conn
&
wconn
=
*
this
;
xerr
::
Contextf
E
(
"wcfs %s: conn @%s: resync -> @%s"
,
v
(
wconn
.
_wc
->
mountpoint
),
v
(
wconn
.
at
),
v
(
at
));
// XXX locking
// wconn.atMu.Lock()
// defer wconn.atMu.Unlock()
xerr
::
Contextf
E
(
"%s: resync -> @%s"
,
v
(
wconn
),
v
(
at
));
error
err
;
// wconn._downMu.lock(); XXX
...
...
@@ -660,8 +659,7 @@ error _Conn::resync(zodb::Tid at) {
error
_Mapping
::
_remmapblk
(
int64_t
blk
,
zodb
::
Tid
at
)
{
_Mapping
*
mmap
=
this
;
FileH
f
=
mmap
->
fileh
;
xerr
::
Contextf
E
(
"wcfs %s: conn @%s: f<%s>: remmapblk #%ld @%s"
,
v
(
f
->
wconn
->
_wc
->
mountpoint
),
v
(
f
->
wconn
->
at
),
v
(
f
->
foid
),
blk
,
v
(
at
));
xerr
::
Contextf
E
(
"%s: f<%s>: remmapblk #%ld @%s"
,
v
(
f
->
wconn
),
v
(
f
->
foid
),
blk
,
v
(
at
));
ASSERT
(
mmap
->
blk_start
<=
blk
&&
blk
<
mmap
->
blk_stop
());
error
err
;
...
...
@@ -819,6 +817,7 @@ string WCFS::String() const {
return
fmt
::
sprintf
(
"wcfs %s"
,
v
(
wc
.
mountpoint
));
}
// NOTE String must be called with Conn.atMu locked.
string
_Conn
::
String
()
const
{
const
_Conn
&
wconn
=
*
this
;
return
fmt
::
sprintf
(
"%s: conn%d @%s"
,
v
(
wconn
.
_wc
),
wconn
.
_wlink
->
fd
(),
v
(
wconn
.
at
));
...
...
wcfs/client/wcfs_misc.cpp
View file @
1f8ad317
...
...
@@ -282,7 +282,7 @@ void __Logf(const char *file, int line, char level, const char *format, ...) {
// wcfs::
namespace
wcfs
{
template
<
>
string
v_
(
const
error
&
err
)
{
template
<
>
string
v_
(
error
err
)
{
return
(
err
!=
nil
)
?
err
->
Error
()
:
"nil"
;
}
...
...
wcfs/client/wcfs_misc.h
View file @
1f8ad317
...
...
@@ -202,9 +202,10 @@ const zodb::Tid TidHead = -1ULL;
template
<
typename
T
>
string
v_
(
T
*
obj
)
{
return
obj
->
String
();
}
template
<
typename
T
>
string
v_
(
const
T
*
obj
)
{
return
obj
->
String
();
}
template
<
typename
T
>
string
v_
(
const
T
&
obj
)
{
return
obj
.
String
();
}
template
<
typename
T
>
string
v_
(
refptr
<
T
>
obj
)
{
return
obj
->
String
();
}
template
<
>
inline
string
v_
(
const
string
&
s
)
{
return
s
;
}
template
<
>
string
v_
(
const
error
&
);
template
<
>
string
v_
(
error
);
template
<
>
string
v_
(
const
zodb
::
Tid
&
);
template
<
>
string
v_
(
const
zodb
::
Oid
&
);
...
...
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