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
5a975bb4
Commit
5a975bb4
authored
Dec 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
46b7c62f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
bigfile/_file_zodb.pyx
bigfile/_file_zodb.pyx
+12
-11
bigfile/file_zodb.cpp
bigfile/file_zodb.cpp
+4
-2
No files found.
bigfile/_file_zodb.pyx
View file @
5a975bb4
...
...
@@ -67,19 +67,19 @@ from wendelin.lib.zodb import zconn_at
cdef
public
class
_ZBigFile
(
BigFile
)
[
object
_ZBigFile
,
type
_ZBigFile_Type
]:
cdef
object
zself
# reference to ZBigFile
cdef
wcfs
.
Oid
foid
# = .zself._p_oid
cdef
wcfs
.
Conn
wconn
# WCFS connection XXX -> zconn instead ? XXX wconn is shared between files
cdef
wcfs
.
FileH
wfileh
# WCFS file handle
# XXX Cython does not allow __new__ nor to change arguments passed to __cinit__ / __init__
@
staticmethod
def
_new
(
zself
,
blksize
):
cdef
_ZBigFile
obj
=
_ZBigFile
.
__new__
(
_ZBigFile
,
blksize
)
obj
.
zself
=
zself
obj
.
foid
=
-
1
# Note: zself._p_oid could be yet None for newly created ZBigFile
obj
.
w
conn
=
nil
# XXX
obj
.
zself
=
zself
# obj.foid
= -1 # Note: zself._p_oid could be yet None for newly created ZBigFile
obj
.
w
fileh
=
nil
# opened by blkmmapper
return
obj
def
__dealloc__
(
_ZBigFile
zf
):
zf
.
w
conn
=
nil
zf
.
w
fileh
=
nil
# redirect load/store/mapper to main class
...
...
@@ -91,17 +91,18 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
#
# it is called from PyBigFile.fileh_open(mmap_overlay=True) and .zfile
# should be already associaed with jar and have oid.
def
blkmapper
(
_ZBigFile
zf
):
cdef
wcfs
.
Py
Conn
pywconn
if
zf
.
w
conn
==
nil
:
def
blkm
m
apper
(
_ZBigFile
zf
):
cdef
wcfs
.
Py
FileH
pywfileh
if
zf
.
w
fileh
==
nil
:
zconn
=
zf
.
zself
.
_p_jar
assert
zconn
is
not
None
# XXX locking? or rely on that ZODB objects for must be used from under 1 thread only?
zf
.
foid
=
u64
(
zf
.
zself
.
_p_oid
)
#
zf.foid = u64(zf.zself._p_oid)
# join zconn to wconn; link to wconn from _ZBigFile
pywconn
=
pywconnOf
(
zconn
)
zf
.
wconn
=
pywconn
.
wconn
pywconn
=
pywconnOf
(
zconn
)
pywfileh
=
pywconn
.
open
(
zf
.
zself
.
_p_oid
)
zf
.
wfileh
=
pywfileh
.
wfileh
# functions that we give to virtmem bigfile_ops .mmap*
...
...
bigfile/file_zodb.cpp
View file @
5a975bb4
...
...
@@ -23,8 +23,10 @@
#include "bigfile/_file_zodb.h"
void
*
virt_mmap_setup_read
(
VMA
*
vma
,
BigFile
*
file
,
blk_t
blk
,
size_t
blklen
)
{
_ZBigFile
*
_zfile
=
static_cast
<
_ZBigFile
*>
(
file
);
wcfs
::
FileH
fileh
;
// XXX = ... somehow from file
//_ZBigFile* _zfile = static_cast<_ZBigFile*>(file);
_ZBigFile
*
_zfile
=
NULL
;
// XXX
wcfs
::
FileH
fileh
=
_zfile
->
wfileh
;
wcfs
::
Mapping
mmap
;
error
err
;
...
...
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