Commit 09632ad8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0f93dd0c
...@@ -171,7 +171,7 @@ def mmap(wconn, foid, offset, size): # -> Mapping XXX offset, size -> blko ...@@ -171,7 +171,7 @@ def mmap(wconn, foid, offset, size): # -> Mapping XXX offset, size -> blko
with wconn._filemu: with wconn._filemu:
f = wconn._filetab.get(foid) f = wconn._filetab.get(foid)
if f is None: if f is None:
headf = wconn._wc._open("head/%s" % (ashex(foid),), "rb") headf = wconn._wc._open("head/bigfile/%s" % (ashex(foid),), "rb")
f = _File(headf) f = _File(headf)
wconn._filetab[foid] = f wconn._filetab[foid] = f
...@@ -202,7 +202,7 @@ def _remmapblk(mmap, blk, at): ...@@ -202,7 +202,7 @@ def _remmapblk(mmap, blk, at):
fsfile = f.headf fsfile = f.headf
else: else:
# TODO share @rev fd until wconn is resynced? # TODO share @rev fd until wconn is resynced?
fsfile = f.wconn._wc._open("@%s/%s" % (ashex(at), ashex(f.foid)), "rb") fsfile = f.wconn._wc._open("@%s/bigfile/%s" % (ashex(at), ashex(f.foid)), "rb")
defer(fsfile.close) defer(fsfile.close)
mm.mmap_into_ro(mmap.mem[(blk-mmap.blk_start)*blksize:][:blksize], fsfile.fileno(), blk*blksize) mm.mmap_into_ro(mmap.mem[(blk-mmap.blk_start)*blksize:][:blksize], fsfile.fileno(), blk*blksize)
......
...@@ -1691,12 +1691,14 @@ def test_wcfspy_virtmem(): ...@@ -1691,12 +1691,14 @@ def test_wcfspy_virtmem():
t = tDB(); zf = t.zfile t = tDB(); zf = t.zfile
defer(t.close) defer(t.close)
at1 = t.commit(zf, {2:'c1'}) at1 = t.commit(zf, {2:'c1', 3:'d1'})
at2 = t.commit(zf, {2:'c2'}) at2 = t.commit(zf, {2:'c2'})
wconn = t.wc.connect(at1) wconn = t.wc.connect(at1)
defer(wconn.close) defer(wconn.close)
m1 = wconn.mmap(zf._p_oid, 2, 2)
# ---- misc --- # ---- misc ---
......
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