frontend->backend interface.
be->be_config = ldbm_back_config;
be->be_init = ldbm_back_init;
be->be_close = ldbm_back_close;
- be->be_startup = ldbm_back_startup;
- be->be_shutdown = ldbm_back_shutdown;
#ifdef SLAPD_ACLGROUPS
be->be_group = ldbm_back_group;
#endif
return result == 0;
}
-void
-be_startup( void )
-{
- int i;
-
- for ( i = 0; i < nbackends; i++ ) {
- if ( backends[i].be_startup != NULL ) {
- (*backends[i].be_startup)( &backends[i] );
- }
- }
-}
-
-
-void
-be_shutdown( void )
-{
- int i;
-
- for ( i = 0; i < nbackends; i++ ) {
- if ( backends[i].be_shutdown != NULL ) {
- (*backends[i].be_shutdown)( &backends[i] );
- }
- }
-}
-
-
void
be_close( void )
{
static char *strtok_quote(char *line, char *sep);
-/* the old interface for tools */
void
read_config( char *fname, Backend **bep, FILE *pfp )
-{
- read_config_env( fname, bep, pfp, 0 );
-}
-
-/* the new interface for slapd */
-void
-read_config_env( char *fname, Backend **bep, FILE *pfp, int startup )
{
FILE *fp;
char *line, *savefname;
}
}
fclose( fp );
-
- if ( startup ) be_startup();
}
static void
int be_isroot_pw LDAP_P(( Backend *be, char *ndn, struct berval *cred ));
char* be_root_dn LDAP_P(( Backend *be ));
void be_close LDAP_P(( void ));
-void be_startup LDAP_P(( void ));
-void be_shutdown LDAP_P(( void ));
/*
* ch_malloc.c
*/
void read_config LDAP_P(( char *fname, Backend **bep, FILE *pfp ));
-void read_config_env LDAP_P(( char *fname, Backend **bep, FILE *pfp, int up ));
/*
* connection.c
int entry_rdwr_lock LDAP_P(( Entry *e, int rw ));
int entry_rdwr_rlock LDAP_P(( Entry *e ));
int entry_rdwr_wlock LDAP_P(( Entry *e ));
+int entry_rdwr_trylock LDAP_P(( Entry *e, int rw ));
int entry_rdwr_unlock LDAP_P(( Entry *e, int rw ));
int entry_rdwr_runlock LDAP_P(( Entry *e ));
int entry_rdwr_wunlock LDAP_P(( Entry *e ));
extern int ldbm_back_group LDAP_P((Backend *be, Entry *target,
char *gr_ndn, char *op_ndn,
char *objectclassValue, char *groupattrName ));
-extern void ldbm_back_startup LDAP_P((Backend *be));
-extern void ldbm_back_shutdown LDAP_P((Backend *be));
#endif
#ifdef SLAPD_PASSWD
extern int slap_debug;
-#ifdef SLAPD_BDB2
-extern int bdb2i_do_timing;
-#endif
-
struct slap_op;
struct slap_conn;
* represents an entry in core
*/
typedef struct entry {
+ ldap_pvt_thread_rdwr_t e_rdwr; /* reader/writer lock */
+
char *e_dn; /* DN of this entry */
char *e_ndn; /* normalized DN of this entry */
Attribute *e_attrs; /* list of attributes + values */
+
+ /*
+ * The ID field should only be changed before entry is
+ * inserted into a cache. The ID value is backend
+ * specific.
+ */
ID e_id; /* id of this entry - this should */
/* really be private to back-ldbm */
- char e_state; /* for the cache */
-
- ldap_pvt_thread_rdwr_t e_rdwr; /* reader/writer lock */
-#define ENTRY_STATE_DELETED 1
+ /*
+ * remaining fields require backend cache lock to access
+ * These items are specific to the LDBM backend and should
+ * and should be hidden.
+ */
+ char e_state; /* for the cache */
+#define ENTRY_STATE_DELETED 1
#define ENTRY_STATE_CREATING 2
+
int e_refcnt; /* # threads ref'ing this entry */
struct entry *e_lrunext; /* for cache lru list */
struct entry *e_lruprev;
void (*be_config) LDAP_P((Backend *be,
char *fname, int lineno, int argc, char **argv ));
void (*be_init) LDAP_P((Backend *be));
- void (*be_startup) LDAP_P((Backend *be));
- void (*be_shutdown) LDAP_P((Backend *be));
void (*be_close) LDAP_P((Backend *be));
#ifdef SLAPD_ACLGROUPS