summaryrefslogtreecommitdiffstats
path: root/src/util/mmap_cache.h
Commit message (Collapse)AuthorAgeFilesLines
* mmap_cache: Use two chains for hash collision.Lukas Slebodnik2013-09-231-8/+12
| | | | | | | | | | | | | | | | | | | | | | | struct sss_mc_rec had two hash members (hash1 and hash2) but only one next member. This was a big problem in case of higher probability of hash collision. structure sss_mc_rec will have two next members (next1, next2) with this patch. next1 is related to hash1 and next2 is related to hash1. Iterating over chains is changed, because we need to choose right next pointer. Right next pointer will be chosen after comparing record hashes. This behaviour is wrapped in function sss_mc_next_slot_with_hash. Adding new record to chain is also changed. The situation is very similar to iterating. We need to choose right next pointer (next1 or next2). Right next pointer will be chosen after comparing record hashes. Adding reference to next slot is wrapped in function sss_mc_chain_slot_to_record_with_hash Size of structure sss_mc_rec was increased from 32 bytes to 40 bytes. Resolves: https://fedorahosted.org/sssd/ticket/2049
* mmap_cache: Use better checks for corrupted mc in responderMichal Zidek2013-08-191-2/+0
| | | | | We introduced new way to check integrity of memcache in the client code. We should use similiar checks in the responder.
* mmap_cache: Off by one error.Michal Zidek2013-08-191-0/+3
| | | | | Removes off by one error when using macro MC_SIZE_TO_SLOTS and adds new macro MC_SLOT_WITHIN_BOUNDS.
* mmap_cache: Check if slot and name_ptr are not invalid.Michal Zidek2013-08-111-0/+3
| | | | | | | This patch prevents jumping outside of allocated memory in case of corrupted slot or name_ptr values. It is not proper solution, just hotfix until we find out what is the root cause of ticket https://fedorahosted.org/sssd/ticket/2018
* memcache: make MC_PTR_TO_SLOT() more readablePavel Březina2013-01-071-2/+1
|
* memcache: add macro that validates record lengthPavel Březina2013-01-071-0/+6
|
* Carefully check records when forcibly invalidatingSimo Sorce2012-12-201-2/+4
| | | | | | | | | | | | We should never try to invalidate an already invalid record as internal pointers will not be consistent. Carefully test that the record really is valid when we are fishing for free space, and properly invalidate records or return a fatal error if something goes wrong. In order to make the code more robust always invalidate the whole data space on initialization by setting all bits to 1, and make sure to invalidate the whole last allocated slot by converting rec->len to the number of slots instead of just the space used.
* nsssrv: add handling of memory cache group mapSimo Sorce2012-03-191-0/+10
|
* util: Helper headers for shared memory cacheSimo Sorce2012-03-191-0/+117