amoralej / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 years ago
Clone

Blame SOURCES/0009-Ticket-47750-Creating-a-glue-fails-if-one-above-leve.patch

f92ce9
From 1ccde69d778878e331311839d1c5d6be0bbfad26 Mon Sep 17 00:00:00 2001
f92ce9
From: Noriko Hosoi <nhosoi@redhat.com>
f92ce9
Date: Mon, 22 Sep 2014 14:34:58 -0700
f92ce9
Subject: [PATCH 09/14] Ticket #47750 - Creating a glue fails if one above
f92ce9
 level is a conflict or missing
f92ce9
f92ce9
Description: Poring changes made to 1.2.11 branch to newer versions.
f92ce9
1) Enabiling cache lock in cache_is_in_cache and cache_has_otherref.
f92ce9
2) Removing unused field new_entry_in_cache from "struct _modify_context".
f92ce9
f92ce9
(cherry picked from commit 5ae13072330e9a769a5949b2e8a91085b38ac4e1)
f92ce9
(cherry picked from commit ef766784ed7d09aa81e82316b621e8490a368dc6)
f92ce9
---
f92ce9
 ldap/servers/slapd/back-ldbm/back-ldbm.h |  1 -
f92ce9
 ldap/servers/slapd/back-ldbm/cache.c     | 10 ++++++----
f92ce9
 2 files changed, 6 insertions(+), 5 deletions(-)
f92ce9
f92ce9
diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h
f92ce9
index 938d261..fd17453 100644
f92ce9
--- a/ldap/servers/slapd/back-ldbm/back-ldbm.h
f92ce9
+++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h
f92ce9
@@ -705,7 +705,6 @@ typedef struct _import_subcount_stuff import_subcount_stuff;
f92ce9
 /* Handy structures for modify operations */
f92ce9
 
f92ce9
 struct _modify_context {
f92ce9
-	int new_entry_in_cache;
f92ce9
 	struct backentry *old_entry;
f92ce9
 	struct backentry *new_entry;
f92ce9
 	Slapi_Mods *smods;
f92ce9
diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c
f92ce9
index a98cf0c..4746204 100644
f92ce9
--- a/ldap/servers/slapd/back-ldbm/cache.c
f92ce9
+++ b/ldap/servers/slapd/back-ldbm/cache.c
f92ce9
@@ -1506,10 +1506,12 @@ int cache_add_tentative(struct cache *cache, struct backentry *e,
f92ce9
 {
f92ce9
     return entrycache_add_int(cache, e, ENTRY_STATE_CREATING, alt);
f92ce9
 }
f92ce9
+
f92ce9
 void cache_lock(struct cache *cache)
f92ce9
 {
f92ce9
     PR_EnterMonitor(cache->c_mutex);
f92ce9
 }
f92ce9
+
f92ce9
 void cache_unlock(struct cache *cache)
f92ce9
 {
f92ce9
     PR_ExitMonitor(cache->c_mutex);
f92ce9
@@ -2095,9 +2097,9 @@ cache_has_otherref(struct cache *cache, void *ptr)
f92ce9
         return hasref;
f92ce9
     }
f92ce9
     bep = (struct backcommon *)ptr;
f92ce9
-    /* slows down too much? PR_Lock(cache->c_mutex); */
f92ce9
+    cache_lock(cache);
f92ce9
     hasref = bep->ep_refcnt;
f92ce9
-    /* PR_Unlock(cache->c_mutex); */
f92ce9
+    cache_unlock(cache);
f92ce9
     return (hasref>1)?1:0;
f92ce9
 }
f92ce9
 
f92ce9
@@ -2111,8 +2113,8 @@ cache_is_in_cache(struct cache *cache, void *ptr)
f92ce9
         return in_cache;
f92ce9
     }
f92ce9
     bep = (struct backcommon *)ptr;
f92ce9
-    /* slows down too much? PR_Lock(cache->c_mutex); */
f92ce9
+    cache_lock(cache);
f92ce9
     in_cache = (bep->ep_state & (ENTRY_STATE_DELETED|ENTRY_STATE_NOTINCACHE))?0:1;
f92ce9
-    /* PR_Unlock(cache->c_mutex); */
f92ce9
+    cache_unlock(cache);
f92ce9
     return in_cache;
f92ce9
 }
f92ce9
-- 
f92ce9
1.9.3
f92ce9