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
dcfde02d
Commit
dcfde02d
authored
Dec 12, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f046f723
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
2 deletions
+44
-2
bigfile/_bigfile.c
bigfile/_bigfile.c
+10
-1
bigfile/file_zodb.py
bigfile/file_zodb.py
+9
-1
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+25
-0
No files found.
bigfile/_bigfile.c
View file @
dcfde02d
...
...
@@ -120,6 +120,10 @@ struct PyBigFileH {
PyObject
*
in_weakreflist
;
BigFileH
;
/* if subclass, in addition to .loadblk/.storeblk, defines .mmapper XXX ... */
PyObject
*
pymmapper
;
// python object returned by .mmaper() that is holding virtmem_mapper pycapsule
//virt_mapper *virt_mmap_ops; // XXX ok?
};
typedef
struct
PyBigFileH
PyBigFileH
;
...
...
@@ -968,6 +972,7 @@ out:
static
const
struct
bigfile_ops
pybigfile_ops
=
{
.
loadblk
=
pybigfile_loadblk
,
.
storeblk
=
pybigfile_storeblk
,
// XXX .mmap*
//.release =
};
...
...
@@ -983,9 +988,13 @@ pyfileh_open(PyObject *pyfile0, PyObject *args)
int
err
;
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
// XXX parse mmap_overlay=None (True/False)
return
NULL
;
// XXX verify if pyfile has .mmapper()
// if mmap_overlay or (mmap_overlay==None and has(pyfile.mmapper)):
// mmaper = pyfile.mmapper()
pyfileh
=
PyType_New
(
PyBigFileH
,
&
PyBigFileH_Type
,
NULL
);
if
(
!
pyfileh
)
return
NULL
;
...
...
bigfile/file_zodb.py
View file @
dcfde02d
...
...
@@ -642,6 +642,12 @@ class ZBigFile(LivePersistent):
fileh
.
invalidate_page
(
blk
)
# XXX assumes blksize == pagesize
# mmaper complemnts loadblk/storeblk and returns object with pycapsule with .mmap*
# methods to be used by virtmem to mmap base overlay of the file data. XXX text
def
mmaper
(
self
):
# XXX return wcfileh (= zconn.wconn.open(self._p_oid))
1
/
0
# fileh_open is bigfile-like method that creates new file-handle object
# that is given to user for mmap.
...
...
@@ -763,7 +769,9 @@ class _ZBigFileH(object):
def
__init__
(
self
,
zfile
,
wcfileh
):
self
.
zfile
=
zfile
self
.
wcfileh
=
wcfileh
self
.
zfileh
=
zfile
.
_v_file
.
fileh_open
(
wcfileh
)
# XXX pass wcfileh in
#self.zfileh = zfile._v_file.fileh_open(wcfileh) # XXX pass wcfileh in
# XXX no - BigFile should fetch wcfileh itself from ZBigFile by calling ZBigFile.mmapper()
self
.
zfileh
=
zfile
.
_v_file
.
fileh_open
()
# FIXME zfile._p_jar could be None (ex. ZBigFile is newly created
# before first commit)
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
dcfde02d
...
...
@@ -349,9 +349,34 @@ pair<Mapping, error> _FileH::mmap(int64_t blk_start, int64_t blk_len, VMA *vma)
f
.
_mmaps
.
push_back
(
mmap
);
// XXX keep f._mmaps ↑blk_start
if
(
vma
!=
NULL
)
{
vma
->
mmap_overlay_server
=
mmap
.
_ptr
();
// XXX +giveref
}
return
make_pair
(
mmap
,
nil
);
}
// functions that we give to virtmem bigfile_ops .mmap*
void
*
virt_mmap_setup_read
(
VMA
*
vma
,
BigFile
*
file
,
blk_t
blk
,
size_t
blklen
)
{
FileH
fileh
;
// XXX = ...
Mapping
mmap
;
error
err
;
tie
(
mmap
,
err
)
=
fileh
->
mmap
(
blk
,
blklen
,
vma
);
if
(
err
!=
nil
)
panic
(
"TODO"
);
// XXX
panic
(
"TODO"
);
}
// XXX virt_remmap_blk_read(VMA *vma, BigFile *file, blk_t blk)
void
virt_munmap
(
VMA
*
vma
,
BigFile
*
file
)
{
Mapping
mmap
=
adoptref
(
static_cast
<
_Mapping
*>
(
vma
->
mmap_overlay_server
));
// NOTE taking 1 ref back
vma
->
mmap_overlay_server
=
NULL
;
mmap
->
unmap
();
}
// resync resyncs connection and its mappings onto different database view.
error
_Conn
::
resync
(
zodb
::
Tid
at
)
{
_Conn
&
wconn
=
*
this
;
...
...
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