Commit 0273dfef authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 25f07b48
......@@ -596,6 +596,19 @@ class ZBigFile(LivePersistent):
# invalidate data .blktab[blk] invalidated -> invalidate page
def invalidateblk(self, blk):
for fileh in self._v_filehset:
# wcfs: there is no need to propagate ZODB -> fileh invalidation by
# client since WCFS handles invalidations from ZODB by itself.
#
# More: the algorythm to compute δ(ZODB) -> δ(blk) is more complex
# than 1-1 ZBlk <-> blk mapping: ZBlk could stay constant, but if
# ZBigFile.blktab topology is changed, affected file blocks have to
# be invalidated. Currently both !wcfs and wcfs codepaths fail to
# handle that, but wcfs will be improved and !wcfs will be deprecated.
#
# -> don't propagate ZODB -> WCFS invalidation by client to fully
# rely on and test wcfs subsystem.
if fileh.uses_mmap_overlay():
continue
fileh.invalidate_page(blk) # XXX assumes blksize == pagesize
......
......@@ -1633,7 +1633,7 @@ void test_file_access_mmapoverlay(void)
ok1(!M(vma, 2)); CHECK_NOPAGE( 102 );
ok1(!M(vma, 3)); CHECK_NOPAGE( 103 );
// XXX invalidation ?
/* no invalidation - fileh_invalidate_page is forbidden for "mmap overlay" mode */
/* free resources */
......
......@@ -551,9 +551,15 @@ void fileh_invalidate_page(BigFileH *fileh, pgoff_t pgoffset)
/* it's an error to invalidate fileh while writeout is in progress */
BUG_ON(fileh->writeout_inprogress);
// XXX wcfs: invalidate_page must not be called (wcfs handles invalidations itself)
// XXX or allow invalidate anyway (e.g. DIRTY -> base) ?
// XXX yes -> allow invalidate for wcfs too - means forget in-ram page and mmap to base memory
/* wcfs: even though the operation to invalidate a page is well defined (it
* is subset of discard), we forbid it since wcfs handles invalidations
* from ZODB by itself inside wcfs server.
*
* It was kind of mistake to expose in 92bfd03e (bigfile: ZODB -> BigFileH
* invalidate propagation) fileh_invalidate_page as public API, since such
* invalidation should be handled by a BigFile instance internally. */
BUG_ON(fileh->mmap_overlay);
page = pagemap_get(&fileh->pagemap, pgoffset);
if (page) {
......
......@@ -320,7 +320,7 @@ VIRTMEM_API void fileh_dirty_discard(BigFileH *fileh);
* file was changed externally )
*
* it's an error to call fileh_invalidate_page() while writeout for fileh is in
* progress.
* progress, or for fileh opened in MMAP_OVERLAY mode.
*/
VIRTMEM_API void fileh_invalidate_page(BigFileH *fileh, pgoff_t pgoffset);
......
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