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
James Lowden
OpenLDAP
Commits
8f02c3f5
Commit
8f02c3f5
authored
14 years ago
by
Quanah Gibson-Mount
Browse files
Options
Downloads
Patches
Plain Diff
Use refcnt instead of keeping entry locked in Add response
parent
83ec5a0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servers/slapd/back-bdb/add.c
+3
-7
3 additions, 7 deletions
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/cache.c
+12
-0
12 additions, 0 deletions
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/proto-bdb.h
+2
-0
2 additions, 0 deletions
servers/slapd/back-bdb/proto-bdb.h
with
17 additions
and
7 deletions
servers/slapd/back-bdb/add.c
+
3
−
7
View file @
8f02c3f5
...
...
@@ -32,7 +32,7 @@ bdb_add(Operation *op, SlapReply *rs )
size_t
textlen
=
sizeof
textbuf
;
AttributeDescription
*
children
=
slap_schema
.
si_ad_children
;
AttributeDescription
*
entry
=
slap_schema
.
si_ad_entry
;
DB_TXN
*
ltid
=
NULL
,
*
lt2
,
*
rtxn
;
DB_TXN
*
ltid
=
NULL
,
*
lt2
;
ID
eid
=
NOID
;
struct
bdb_op_info
opinfo
=
{{{
0
}}};
int
subentry
;
...
...
@@ -121,9 +121,6 @@ txnReturn:
subentry
=
is_entry_subentry
(
op
->
ora_e
);
/* Get our reader TXN */
rs
->
sr_err
=
bdb_reader_get
(
op
,
bdb
->
bi_dbenv
,
&
rtxn
);
if
(
0
)
{
retry:
/* transaction retry */
if
(
p
)
{
...
...
@@ -459,8 +456,7 @@ retry: /* transaction retry */
nrdn
=
op
->
ora_e
->
e_nname
;
}
/* Use the reader txn here, outside the add txn */
bdb_cache_add
(
bdb
,
ei
,
op
->
ora_e
,
&
nrdn
,
rtxn
,
&
lock
);
bdb_cache_add
(
bdb
,
ei
,
op
->
ora_e
,
&
nrdn
,
ltid
,
&
lock
);
if
((
rs
->
sr_err
=
TXN_COMMIT
(
ltid
,
0
))
!=
0
)
{
rs
->
sr_text
=
"txn_commit failed"
;
...
...
@@ -506,7 +502,7 @@ return_results:
* Possibly a callback may have mucked with it, although
* in general callbacks should treat the entry as read-only.
*/
bdb_cache_
return_entry_r
(
bdb
,
oe
,
&
lock
);
bdb_cache_
deref
(
oe
->
e_private
);
if
(
op
->
ora_e
==
oe
)
op
->
ora_e
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-bdb/cache.c
+
12
−
0
View file @
8f02c3f5
...
...
@@ -1146,6 +1146,7 @@ bdb_cache_add(
ei
.
bei_nrdn
=
*
nrdn
;
ei
.
bei_lockpad
=
0
;
#if 0
/* Lock this entry so that bdb_add can run to completion.
* It can only fail if BDB has run out of lock resources.
*/
...
...
@@ -1154,6 +1155,7 @@ bdb_cache_add(
bdb_cache_entryinfo_unlock( eip );
return rc;
}
#endif
#ifdef BDB_HIER
if
(
nrdn
->
bv_len
!=
e
->
e_nname
.
bv_len
)
{
...
...
@@ -1197,6 +1199,7 @@ bdb_cache_add(
}
ldap_pvt_thread_mutex_unlock
(
&
bdb
->
bi_cache
.
c_count_mutex
);
new
->
bei_finders
=
1
;
bdb_cache_lru_link
(
bdb
,
new
);
if
(
purge
)
...
...
@@ -1205,6 +1208,15 @@ bdb_cache_add(
return
rc
;
}
void
bdb_cache_deref
(
EntryInfo
*
ei
)
{
bdb_cache_entryinfo_lock
(
ei
);
ei
->
bei_finders
--
;
bdb_cache_entryinfo_unlock
(
ei
);
}
int
bdb_cache_modify
(
struct
bdb_info
*
bdb
,
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-bdb/proto-bdb.h
+
2
−
0
View file @
8f02c3f5
...
...
@@ -507,6 +507,7 @@ void bdb_unlocked_cache_return_entry_rw( struct bdb_info *bdb, Entry *e, int rw
#define bdb_cache_modrdn BDB_SYMBOL(cache_modrdn)
#define bdb_cache_release_all BDB_SYMBOL(cache_release_all)
#define bdb_cache_delete_entry BDB_SYMBOL(cache_delete_entry)
#define bdb_cache_deref BDB_SYMBOL(cache_deref)
int
bdb_cache_children
(
Operation
*
op
,
...
...
@@ -574,6 +575,7 @@ void bdb_cache_delete_cleanup(
EntryInfo
*
ei
);
void
bdb_cache_release_all
(
Cache
*
cache
);
void
bdb_cache_deref
(
EntryInfo
*
ei
);
#ifdef BDB_HIER
int
hdb_cache_load
(
...
...
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