Pārlūkot izejas kodu

Ticket #47750 - Creating a glue fails if one above level is a conflict or missing

Description: Poring changes made to 1.2.11 branch to newer versions.
1) Enabiling cache lock in cache_is_in_cache and cache_has_otherref.
2) Removing unused field new_entry_in_cache from "struct _modify_context".
Noriko Hosoi 11 gadi atpakaļ
vecāks
revīzija
5ae1307233

+ 0 - 1
ldap/servers/slapd/back-ldbm/back-ldbm.h

@@ -705,7 +705,6 @@ typedef struct _import_subcount_stuff import_subcount_stuff;
 /* Handy structures for modify operations */
 /* Handy structures for modify operations */
 
 
 struct _modify_context {
 struct _modify_context {
-	int new_entry_in_cache;
 	struct backentry *old_entry;
 	struct backentry *old_entry;
 	struct backentry *new_entry;
 	struct backentry *new_entry;
 	Slapi_Mods *smods;
 	Slapi_Mods *smods;

+ 6 - 4
ldap/servers/slapd/back-ldbm/cache.c

@@ -1506,10 +1506,12 @@ int cache_add_tentative(struct cache *cache, struct backentry *e,
 {
 {
     return entrycache_add_int(cache, e, ENTRY_STATE_CREATING, alt);
     return entrycache_add_int(cache, e, ENTRY_STATE_CREATING, alt);
 }
 }
+
 void cache_lock(struct cache *cache)
 void cache_lock(struct cache *cache)
 {
 {
     PR_EnterMonitor(cache->c_mutex);
     PR_EnterMonitor(cache->c_mutex);
 }
 }
+
 void cache_unlock(struct cache *cache)
 void cache_unlock(struct cache *cache)
 {
 {
     PR_ExitMonitor(cache->c_mutex);
     PR_ExitMonitor(cache->c_mutex);
@@ -2095,9 +2097,9 @@ cache_has_otherref(struct cache *cache, void *ptr)
         return hasref;
         return hasref;
     }
     }
     bep = (struct backcommon *)ptr;
     bep = (struct backcommon *)ptr;
-    /* slows down too much? PR_Lock(cache->c_mutex); */
+    cache_lock(cache);
     hasref = bep->ep_refcnt;
     hasref = bep->ep_refcnt;
-    /* PR_Unlock(cache->c_mutex); */
+    cache_unlock(cache);
     return (hasref>1)?1:0;
     return (hasref>1)?1:0;
 }
 }
 
 
@@ -2111,8 +2113,8 @@ cache_is_in_cache(struct cache *cache, void *ptr)
         return in_cache;
         return in_cache;
     }
     }
     bep = (struct backcommon *)ptr;
     bep = (struct backcommon *)ptr;
-    /* slows down too much? PR_Lock(cache->c_mutex); */
+    cache_lock(cache);
     in_cache = (bep->ep_state & (ENTRY_STATE_DELETED|ENTRY_STATE_NOTINCACHE))?0:1;
     in_cache = (bep->ep_state & (ENTRY_STATE_DELETED|ENTRY_STATE_NOTINCACHE))?0:1;
-    /* PR_Unlock(cache->c_mutex); */
+    cache_unlock(cache);
     return in_cache;
     return in_cache;
 }
 }