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
0149d7c8
Commit
0149d7c8
authored
Dec 06, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
77cd4f01
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
19 deletions
+46
-19
bigfile/file_zodb.py
bigfile/file_zodb.py
+9
-11
bigfile/virtmem.c
bigfile/virtmem.c
+1
-1
include/wendelin/bigfile/file.h
include/wendelin/bigfile/file.h
+1
-1
wcfs/internal/_wcfs.pyx
wcfs/internal/_wcfs.pyx
+3
-3
wcfs/internal/wcfs.h
wcfs/internal/wcfs.h
+6
-0
wcfs/internal/wcfs_misc.h
wcfs/internal/wcfs_misc.h
+6
-0
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+6
-3
wcfs/internal/wcfs_watchlink.cpp
wcfs/internal/wcfs_watchlink.cpp
+8
-0
wcfs/internal/wcfs_watchlink.h
wcfs/internal/wcfs_watchlink.h
+6
-0
No files found.
bigfile/file_zodb.py
View file @
0149d7c8
...
...
@@ -563,10 +563,13 @@ class ZBigFile(LivePersistent):
wcfileh
=
None
if
_use_wcfs
:
# TODO maintain zconn -> wconn in sync (p_jar -> wconn)
zstor
=
self
.
_p_jar
.
db
().
storage
zurl
=
wcfs
.
zstor_2zurl
(
zstor
)
wc
=
wcfs
.
join
(
zurl
,
shared
=
True
)
wcfileh
=
wc
.
open
(
self
)
wconn
=
wc
.
connect
(
p_jar
.
at
())
wcfileh
=
wconn
.
open
(
self
.
_p_oid
)
#wcfileh_mmap = lambda blk_start, blk_len: wconn.mmap(self._p_oid, blk_start, blk_len)
fileh
=
_ZBigFileH
(
self
,
wcfileh
)
self
.
_v_filehset
.
add
(
fileh
)
...
...
@@ -654,19 +657,14 @@ Connection.open = Connection_open
@
implementer
(
ISynchronizer
)
class
_ZBigFileH
(
object
):
# .zfile ZBigFile we were opened for
# .wcfileh handle for ZBigFile in wcfs | None
#
# .wcfileh handle for ZBigFile in wcfs | None
# .zfileh handle for ZBigFile (overlayed over .wcfileh if .wcfile != ø)
def
__init__
(
self
,
zfile
,
wcfileh
):
# def __init__(self, zfile, wcfileh):
def
__init__
(
self
,
zfile
,
wc
):
# wc: wcfs.WCFS | None
self
.
zfile
=
zfile
self
.
wcfileh
=
wcfileh
# FIXME for now we use only wcfs handle
# TODO setup overlaying
if
wcfileh
is
not
None
:
self
.
zfileh
=
wcfileh
else
:
# XXX
self
.
zfileh
=
zfile
.
_v_file
.
fileh_open
()
# self.wcfileh = wcfileh
self
.
zfileh
=
zfile
.
_v_file
.
fileh_open
()
# XXX pass wcfileh in
# FIXME zfile._p_jar could be None (ex. ZBigFile is newly created
# before first commit)
...
...
bigfile/virtmem.c
View file @
0149d7c8
...
...
@@ -335,7 +335,7 @@ void vma_unmap(VMA *vma)
/* unmap whole vma at once - the kernel unmaps each mapping in turn.
* NOTE error here would mean something is broken */
if
(
fileh
->
mmap_overlay
)
{
fileh
->
file
->
file_ops
->
munmap
(
fileh
->
file
,
vma
);
fileh
->
file
->
file_ops
->
munmap
(
vma
,
fileh
->
file
);
}
else
{
xmunmap
((
void
*
)
vma
->
addr_start
,
len
);
}
...
...
include/wendelin/bigfile/file.h
View file @
0149d7c8
...
...
@@ -124,7 +124,7 @@ struct bigfile_ops {
* XXX called under virtmem lock?
* Must not fail.
*/
void
(
*
munmap
)
(
BigFile
*
file
,
VMA
*
vma
);
void
(
*
munmap
)
(
VMA
*
vma
,
BigFile
*
file
);
/* release is called to release resources associated with file.
...
...
wcfs/internal/_wcfs.pyx
View file @
0149d7c8
...
...
@@ -50,11 +50,11 @@ cdef extern from "wcfs_misc.h" namespace "zodb" nogil:
ctypedef
uint64_t
Tid
ctypedef
uint64_t
Oid
cdef
extern
from
"wcfs_misc.h"
nogil
:
cdef
extern
from
"wcfs_misc.h"
n
amespace
"wcfs"
n
ogil
:
const
Tid
TidHead
cdef
extern
from
"wcfs_watchlink.h"
nogil
:
cdef
extern
from
"wcfs_watchlink.h"
n
amespace
"wcfs"
n
ogil
:
cppclass
_WatchLink
:
error
close
()
error
closeWrite
()
...
...
@@ -85,7 +85,7 @@ cdef extern from "wcfs_watchlink.h" nogil:
error
_twlinkwrite
(
WatchLink
wlink
,
const
string
&
pkt
)
cdef
extern
from
"wcfs.h"
nogil
:
cdef
extern
from
"wcfs.h"
n
amespace
"wcfs"
n
ogil
:
cppclass
WCFS
:
string
mountpoint
...
...
wcfs/internal/wcfs.h
View file @
0149d7c8
...
...
@@ -40,6 +40,9 @@ using std::pair;
#include "wcfs_misc.h"
// wcfs::
namespace
wcfs
{
struct
_File
;
struct
_Mapping
;
struct
PinReq
;
...
...
@@ -92,6 +95,7 @@ public:
public:
error
close
();
// XXX move mmap -> _FileH ?
pair
<
_Mapping
*
,
error
>
mmap
(
zodb
::
Oid
foid
,
int64_t
blk_start
,
int64_t
blk_len
);
error
resync
(
zodb
::
Tid
at
);
...
...
@@ -101,4 +105,6 @@ private:
};
}
// wcfs::
#endif
wcfs/internal/wcfs_misc.h
View file @
0149d7c8
...
...
@@ -149,7 +149,13 @@ typedef uint64_t Oid;
}
// zodb::
// wcfs::
namespace
wcfs
{
// TidHead is invalid Tid which is largest Tid value and means @head.
const
zodb
::
Tid
TidHead
=
-
1ULL
;
}
// wcfs::
#endif
wcfs/internal/wcfs_virtmem.cpp
View file @
0149d7c8
...
...
@@ -29,7 +29,6 @@
#include <wendelin/bigfile/virtmem.h>
#include <wendelin/bigfile/ram.h>
//#include <wendelin/bug.h>
#include <golang/fmt.h>
...
...
@@ -42,12 +41,13 @@
#include <sys/stat.h>
#include <unistd.h>
using
std
::
min
;
using
std
::
max
;
using
std
::
vector
;
// wcfs::
namespace
wcfs
{
static
string
h
(
uint64_t
v
);
// v -> 016x hex representation
#define h_(v) (h(v).c_str())
static
error
mmap_zero_into_ro
(
void
*
addr
,
size_t
size
);
...
...
@@ -570,3 +570,6 @@ void _Conn::decref() {
if
(
__decref
())
delete
this
;
}
}
// wcfs::
wcfs/internal/wcfs_watchlink.cpp
View file @
0149d7c8
...
...
@@ -25,6 +25,11 @@
#include <golang/strings.h>
#include <string.h>
// wcfs::
namespace
wcfs
{
// XXX temp, place, ok=?
const
char
*
v
(
error
err
)
{
if
(
err
!=
nil
)
...
...
@@ -468,3 +473,6 @@ string rxPkt::to_string() const {
const
rxPkt
&
pkt
=
*
this
;
return
string
(
pkt
.
data
,
pkt
.
datalen
);
}
}
// wcfs::
wcfs/internal/wcfs_watchlink.h
View file @
0149d7c8
...
...
@@ -34,6 +34,9 @@ using cxx::set;
#include "wcfs.h"
#include "wcfs_misc.h"
// wcfs::
namespace
wcfs
{
struct
PinReq
;
...
...
@@ -131,4 +134,7 @@ struct PinReq {
// for testing
error
_twlinkwrite
(
WatchLink
wlink
,
const
string
&
pkt
);
}
// wcfs::
#endif
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