Commit 116d5481 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 76cf581c
/_file_zodb.cpp /_file_zodb.cpp
/_file_zodb.h
...@@ -50,10 +50,13 @@ cdef extern from *: ...@@ -50,10 +50,13 @@ cdef extern from *:
ctypedef extern class wendelin.bigfile._bigfile.BigFile[object cxxPyBigFile]: ctypedef extern class wendelin.bigfile._bigfile.BigFile[object cxxPyBigFile]:
pass pass
import wcfs as pywcfs
from wcfs.internal cimport _wcfs as wcfs from wcfs.internal cimport _wcfs as wcfs
from golang cimport nil from golang cimport nil
from ZODB.Connection import Connection as ZConnection
from ZODB.utils import u64 from ZODB.utils import u64
from wendelin.lib.zodb import zconn_at
# _ZBigFile is helper for ZBigFile - just redirect loadblk/storeblk back # _ZBigFile is helper for ZBigFile - just redirect loadblk/storeblk back
...@@ -61,7 +64,7 @@ from ZODB.utils import u64 ...@@ -61,7 +64,7 @@ from ZODB.utils import u64
# the same time - see below) # the same time - see below)
# #
# XXX + wcfs # XXX + wcfs
cdef class _ZBigFile(BigFile): cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
cdef object zself # reference to ZBigFile cdef object zself # reference to ZBigFile
cdef wcfs.Oid foid # = .zself._p_oid cdef wcfs.Oid foid # = .zself._p_oid
cdef wcfs.Conn wconn # WCFS connection XXX -> zconn instead ? XXX wconn is shared between files cdef wcfs.Conn wconn # WCFS connection XXX -> zconn instead ? XXX wconn is shared between files
...@@ -101,6 +104,7 @@ cdef class _ZBigFile(BigFile): ...@@ -101,6 +104,7 @@ cdef class _ZBigFile(BigFile):
# functions that we give to virtmem bigfile_ops .mmap* # functions that we give to virtmem bigfile_ops .mmap*
"""
cdef nogil: cdef nogil:
void* virt_mmap_setup_read(VMA *vma, BigFile *file, blk_t blk, size_t blklen) { void* virt_mmap_setup_read(VMA *vma, BigFile *file, blk_t blk, size_t blklen) {
...@@ -139,7 +143,7 @@ cdef nogil: ...@@ -139,7 +143,7 @@ cdef nogil:
// XXX close mmap->fileh // XXX close mmap->fileh
} }
"""
...@@ -148,7 +152,7 @@ cdef nogil: ...@@ -148,7 +152,7 @@ cdef nogil:
# XXX simultaneous call? # XXX simultaneous call?
# XXX move -> .py ? # XXX move -> .py ?
cdef pywconnOf(zconn): cdef pywconnOf(zconn):
assert isinstance(zconn, zodbConnection) assert isinstance(zconn, ZConnection)
assert zconn.opened # XXX needed assert zconn.opened # XXX needed
# XXX locking # XXX locking
...@@ -158,8 +162,8 @@ cdef pywconnOf(zconn): ...@@ -158,8 +162,8 @@ cdef pywconnOf(zconn):
# zconn is not yet associated with wconn # zconn is not yet associated with wconn
zstor = zconn.db().storage zstor = zconn.db().storage
zurl = wcfs.zstor_2zurl(zstor) zurl = pywcfs.zstor_2zurl(zstor)
wc = wcfs.join(zurl) wc = pywcfs.join(zurl)
wconn = wc.connect(zconn_at(zconn)) wconn = wc.connect(zconn_at(zconn))
zconn._wcfs_wconn = wconn zconn._wcfs_wconn = wconn
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment