summaryrefslogtreecommitdiff
path: root/src/responder/nss
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-09-11 09:29:06 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-09-23 17:04:18 +0200
commitb2c1b9904f50c34f1e1bf1c2e4d82d53ff7496e6 (patch)
tree5186f3ba4224bc34cc826f6cc9cc3e83a385ff85 /src/responder/nss
parentb9dadaa81c2d08fc6857442d557a145c45a93b52 (diff)
downloadsssd-b2c1b9904f50c34f1e1bf1c2e4d82d53ff7496e6.tar.gz
sssd-b2c1b9904f50c34f1e1bf1c2e4d82d53ff7496e6.tar.bz2
sssd-b2c1b9904f50c34f1e1bf1c2e4d82d53ff7496e6.zip
Revert "mmap_cache: Skip records which doesn't have same hash"
This reverts commit 4662725ffef62b3b2502481438effa7c8fef9f80.
Diffstat (limited to 'src/responder/nss')
-rw-r--r--src/responder/nss/nsssrv_mmap_cache.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/responder/nss/nsssrv_mmap_cache.c b/src/responder/nss/nsssrv_mmap_cache.c
index 4e45405a..69fe2078 100644
--- a/src/responder/nss/nsssrv_mmap_cache.c
+++ b/src/responder/nss/nsssrv_mmap_cache.c
@@ -205,27 +205,6 @@ static void sss_mc_add_rec_to_chain(struct sss_mc_ctx *mcc,
cur->next = MC_PTR_TO_SLOT(mcc->data_table, rec);
}
-static inline uint32_t
-sss_mc_get_next_slot_with_hash(struct sss_mc_ctx *mcc,
- struct sss_mc_rec *start_rec,
- uint32_t hash)
-{
- struct sss_mc_rec *rec;
- uint32_t slot;
-
- slot = start_rec->next;
- while (slot != MC_INVALID_VAL) {
- rec = MC_SLOT_TO_PTR(mcc->data_table, slot, struct sss_mc_rec);
- if (rec->hash1 == hash || rec->hash2 == hash) {
- break;
- }
-
- slot = rec->next;
- }
-
- return slot;
-}
-
static void sss_mc_rm_rec_from_chain(struct sss_mc_ctx *mcc,
struct sss_mc_rec *rec,
uint32_t hash)
@@ -251,11 +230,7 @@ static void sss_mc_rm_rec_from_chain(struct sss_mc_ctx *mcc,
}
cur = MC_SLOT_TO_PTR(mcc->data_table, slot, struct sss_mc_rec);
if (cur == rec) {
- /* rec->next can refer to record without matching hashes.
- * We need to skip this(those) records, because
- * mcc->hash_table[hash] have to refer to valid start of the chain.
- */
- mcc->hash_table[hash] = sss_mc_get_next_slot_with_hash(mcc, rec, hash);
+ mcc->hash_table[hash] = rec->next;
} else {
slot = cur->next;
while (slot != MC_INVALID_VAL) {
@@ -263,14 +238,7 @@ static void sss_mc_rm_rec_from_chain(struct sss_mc_ctx *mcc,
cur = MC_SLOT_TO_PTR(mcc->data_table, slot, struct sss_mc_rec);
if (cur == rec) {
/* changing a single uint32_t is atomic, so there is no
- * need to use barriers in this case.
- *
- * This situation is different to the removing record from
- * the beggining of the chain. The record have to only be
- * removed from chain, because this chain can be
- * subset or supperset of another chain and we don't want
- * to break another chains.
- */
+ * need to use barriers in this case */
prev->next = cur->next;
slot = MC_INVALID_VAL;
} else {