Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joe Martin
OpenLDAP
Commits
0eac91fc
Commit
0eac91fc
authored
23 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Entry rwlock is no longer needed as concurrency is managed
by the giant rwlock.
parent
7c6afdf7
No related branches found
Branches containing commit
Tags
OPENLDAP_REL_ENG_1_1_0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/back-ldbm/cache.c
+14
-3
14 additions, 3 deletions
servers/slapd/back-ldbm/cache.c
with
14 additions
and
3 deletions
servers/slapd/back-ldbm/cache.c
+
14
−
3
View file @
0eac91fc
...
...
@@ -19,7 +19,9 @@
/* LDBM backend specific entry info -- visible only to the cache */
typedef
struct
ldbm_entry_info
{
#ifdef LDBM_ENTRY_RWLOCK
ldap_pvt_thread_rdwr_t
lei_rdwr
;
/* reader/writer lock */
#endif
/*
* remaining fields require backend cache lock to access
...
...
@@ -45,6 +47,7 @@ static int cache_delete_entry_internal(Cache *cache, Entry *e);
static
void
lru_print
(
Cache
*
cache
);
#endif
#ifdef LDBM_ENTRY_RWLOCK
static
int
cache_entry_rdwr_lock
(
Entry
*
e
,
int
rw
)
{
...
...
@@ -113,6 +116,7 @@ cache_entry_rdwr_destroy(Entry *e)
{
return
ldap_pvt_thread_rdwr_destroy
(
&
LEI
(
e
)
->
lei_rdwr
);
}
#endif
static
int
cache_entry_private_init
(
Entry
*
e
)
...
...
@@ -126,11 +130,13 @@ cache_entry_private_init( Entry*e )
e
->
e_private
=
ch_calloc
(
1
,
sizeof
(
struct
ldbm_entry_info
));
#ifdef LDBM_ENTRY_RWLOCK
if
(
cache_entry_rdwr_init
(
e
)
!=
0
)
{
free
(
LEI
(
e
)
);
e
->
e_private
=
NULL
;
return
1
;
}
#endif
return
0
;
}
...
...
@@ -157,7 +163,9 @@ cache_entry_private_destroy( Entry*e )
{
assert
(
e
->
e_private
);
#ifdef LDBM_ENTRY_RWLOCK
cache_entry_rdwr_destroy
(
e
);
#endif
free
(
e
->
e_private
);
e
->
e_private
=
NULL
;
...
...
@@ -175,7 +183,9 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw )
assert
(
e
->
e_private
);
#ifdef LDBM_ENTRY_RWLOCK
cache_entry_rdwr_unlock
(
e
,
rw
);
#endif
id
=
e
->
e_id
;
refcnt
=
--
LEI
(
e
)
->
lei_refcnt
;
...
...
@@ -367,8 +377,6 @@ cache_add_entry_rw(
e
->
e_id
,
e
->
e_dn
,
0
);
#endif
/* delete from dn tree inserted above */
if
(
avl_delete
(
&
cache
->
c_dntree
,
(
caddr_t
)
e
,
(
AVL_CMP
)
entry_dn_cmp
)
==
NULL
)
...
...
@@ -381,7 +389,6 @@ cache_add_entry_rw(
Debug
(
LDAP_DEBUG_ANY
,
"====> can't delete from dn cache
\n
"
,
0
,
0
,
0
);
#endif
}
cache_entry_private_destroy
(
e
);
...
...
@@ -391,7 +398,9 @@ cache_add_entry_rw(
return
(
-
1
);
}
#ifdef LDBM_ENTRY_RWLOCK
cache_entry_rdwr_lock
(
e
,
rw
);
#endif
/* put the entry into 'CREATING' state */
/* will be marked after when entry is returned */
...
...
@@ -711,6 +720,7 @@ try_again:
goto
try_again
;
}
#ifdef LDBM_ENTRY_RWLOCK
/* acquire reader lock */
if
(
cache_entry_rdwr_trylock
(
ep
,
rw
)
==
LDAP_PVT_THREAD_EBUSY
)
{
/* could not acquire entry lock...
...
...
@@ -735,6 +745,7 @@ try_again:
ldap_pvt_thread_yield
();
goto
try_again
;
}
#endif
/* lru */
LRU_DELETE
(
cache
,
ep
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment