X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=src%2Flibcaptive%2Fcc%2Fsharedcachemap-priv.h;h=7a7cf07da3485264e983d372ccc062b66bf43f60;hb=a2dd38f86df22c46ae18f3ad7d9850eaacb02b92;hp=0d697179a81c9ad8a397f58ca322c37e1592e21d;hpb=4cae44e24abc4cbb6fbce484275ff9e0a1e7e3b1;p=captive.git diff --git a/src/libcaptive/cc/sharedcachemap-priv.h b/src/libcaptive/cc/sharedcachemap-priv.h index 0d69717..7a7cf07 100644 --- a/src/libcaptive/cc/sharedcachemap-priv.h +++ b/src/libcaptive/cc/sharedcachemap-priv.h @@ -42,15 +42,35 @@ struct _CaptiveSharedCacheMapObject { gint w32_ref_count; FILE_OBJECT *FileObject; - SECTION_OBJECT_POINTERS *SectionObjectPointers; + SECTION_OBJECT_POINTERS *SectionObjectPointer; /* ValidDataLength<=FileSize<=AllocationSize */ + /* 'AllocationSize' sets the mmap(2)ed area of buffers of this SharedCacheMap. + * We must reallocate this area if 'AllocationSize' changes and in such case + * there must exist no map-Bcb or pin-Bcbs for it. + * We would cope with 'buffer' change with existing Bcbs but W32 client could not. + */ guint64 AllocationSize; /* ==CC_FILE_SIZES.AllocationSize.QuadPart */ + /* We generally check against CAPTIVE_ROUND_UP64(FileSize,PAGE_SIZE) + * as the offsets are usually PAGE_SIZE aligned due to pin-Bcb expectations. + */ guint64 FileSize; /* ==CC_FILE_SIZES.FileSize.QuadPart */ + /* We use do not use 'ValidDataLength' as I assume W32 + * automatically increases 'ValidDataLength' during Cache Manager write operations. + * We do not increase it and therefore it is mostly useless for us. + * In some cases (during NTFS mount) there may be also invalid 'ValidDataLength' at all: + * CcSetFileSizes(AllocationSize=0x1000000,FileSize=0xf80208,ValidDataLength=0x23b801a0) + */ guint64 ValidDataLength; /* ==CC_FILE_SIZES.ValidDataLength.QuadPart */ + /* The real allocation size of 'buffer' and 'pages'. + * Maintained by captive_shared_cache_map_object_FileSizes_changed() + * to prevent continous reallocation to (n+1) size. + * We use (n*2) sizes for logaritmic time complexity. + */ + guint64 alloc_length; CACHE_MANAGER_CALLBACKS CallBacks; VOID *LazyWriterContext; gboolean PinAccess; - CaptivePrivateBcbMapObject *map; + CaptivePrivateBcbMapObject *map; /* 'map' will g_object_ref(CaptiveSharedCacheMapObject). */ GHashTable *pin_hash; /* map: (guint64 *) -> (CaptivePrivateBcbPinObject *) */ gboolean LogHandle_set; gboolean FlushToLsnRoutine_set;