Commit c558ef96 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 348c4fd4
...@@ -185,20 +185,26 @@ def _pinner(wconn, ctx): ...@@ -185,20 +185,26 @@ def _pinner(wconn, ctx):
return # XXX ok? (EOF - when wcfs closes wlink) return # XXX ok? (EOF - when wcfs closes wlink)
# we received request to pin/unpin file block. perform it # we received request to pin/unpin file block. perform it
trace('lock _filemu ...')
with wconn._filemu: with wconn._filemu:
trace('_filemu locked')
f = wconn._filetab.get(req.foid) f = wconn._filetab.get(req.foid)
if f is None: if f is None:
1/0 # XXX we are not watching the file - why wcfs sent us this update? 1/0 # XXX we are not watching the file - why wcfs sent us this update?
trace(f)
# XXX relock wconn -> f ? # XXX relock wconn -> f ?
for mmap in f.mmaps: # XXX use ↑blk_start for binary search for mmap in f.mmaps: # XXX use ↑blk_start for binary search
trace('\t%s' % mmap)
if not (mmap.blk_start <= req.blk < mmap.blk_stop): if not (mmap.blk_start <= req.blk < mmap.blk_stop):
continue # blk ∉ mmap continue # blk ∉ mmap
trace('\tremmapblk %d @%s' % (req.blk, h(req.at)))
# FIXME check if virtmem did not mapped RW page into this block already # FIXME check if virtmem did not mapped RW page into this block already
mmap._remmapblk(req.blk, req.at) mmap._remmapblk(req.blk, req.at)
trace('\t-> remmaped')
# update f.pinned # update f.pinned
if req.at is None: if req.at is None:
......
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