~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to servers/slapd/back-bdb/monitor.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-09-07 13:41:10 UTC
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: james.westby@ubuntu.com-20090907134110-jsdrvn0atu1fex4m
Tags: upstream-2.4.18
ImportĀ upstreamĀ versionĀ 2.4.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* monitor.c - monitor bdb backend */
2
 
/* $OpenLDAP: pkg/ldap/servers/slapd/back-bdb/monitor.c,v 1.19.2.11 2009/01/22 00:01:05 kurt Exp $ */
 
2
/* $OpenLDAP: pkg/ldap/servers/slapd/back-bdb/monitor.c,v 1.19.2.13 2009/08/17 21:52:54 quanah Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
 *
5
5
 * Copyright 2000-2009 The OpenLDAP Foundation.
158
158
        a = attr_find( e->e_attrs, ad_olmBDBEntryCache );
159
159
        assert( a != NULL );
160
160
        bv.bv_val = buf;
161
 
        bv.bv_len = snprintf( buf, sizeof( buf ), "%d", bdb->bi_cache.c_cursize );
 
161
        bv.bv_len = snprintf( buf, sizeof( buf ), "%lu", bdb->bi_cache.c_cursize );
162
162
        ber_bvreplace( &a->a_vals[ 0 ], &bv );
163
163
 
164
164
        a = attr_find( e->e_attrs, ad_olmBDBDNCache );
165
165
        assert( a != NULL );
166
 
        bv.bv_len = snprintf( buf, sizeof( buf ), "%d", bdb->bi_cache.c_eiused );
 
166
        bv.bv_len = snprintf( buf, sizeof( buf ), "%lu", bdb->bi_cache.c_eiused );
167
167
        ber_bvreplace( &a->a_vals[ 0 ], &bv );
168
168
 
169
169
        a = attr_find( e->e_attrs, ad_olmBDBIDLCache );
170
170
        assert( a != NULL );
171
 
        bv.bv_len = snprintf( buf, sizeof( buf ), "%d", bdb->bi_idl_cache_size );
 
171
        bv.bv_len = snprintf( buf, sizeof( buf ), "%lu", bdb->bi_idl_cache_size );
172
172
        ber_bvreplace( &a->a_vals[ 0 ], &bv );
173
173
        
174
174
#ifdef BDB_MONITOR_IDX
305
305
{
306
306
        struct bdb_info         *bdb = (struct bdb_info *) be->be_private;
307
307
 
308
 
        if ( SLAP_GLUE_SUBORDINATE( be ) ) {
309
 
                return 0;
310
 
        }
311
 
 
312
308
        if ( bdb_monitor_initialize() == LDAP_SUCCESS ) {
313
309
                /* monitoring in back-bdb is on by default */
314
310
                SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_MONITORING;
340
336
                return 0;
341
337
        }
342
338
 
343
 
        if ( SLAP_GLUE_SUBORDINATE( be ) ) {
344
 
                return 0;
345
 
        }
346
 
 
347
339
        mi = backend_info( "monitor" );
348
340
        if ( !mi || !mi->bi_extra ) {
349
341
                SLAP_DBFLAGS( be ) ^= SLAP_DBFLAG_MONITORING;
491
483
{
492
484
        struct bdb_info         *bdb = (struct bdb_info *) be->be_private;
493
485
 
494
 
        if ( SLAP_GLUE_SUBORDINATE( be ) ) {
495
 
                return 0;
496
 
        }
497
 
 
498
486
        if ( !BER_BVISNULL( &bdb->bi_monitor.bdm_ndn ) ) {
499
487
                BackendInfo             *mi = backend_info( "monitor" );
500
488
                monitor_extra_t         *mbe;
518
506
int
519
507
bdb_monitor_db_destroy( BackendDB *be )
520
508
{
521
 
        if ( SLAP_GLUE_SUBORDINATE( be ) ) {
522
 
                return 0;
523
 
        }
524
 
 
525
509
#ifdef BDB_MONITOR_IDX
526
 
        {
527
 
                struct bdb_info         *bdb = (struct bdb_info *) be->be_private;
 
510
        struct bdb_info         *bdb = (struct bdb_info *) be->be_private;
528
511
 
529
 
                /* TODO: free tree */
530
 
                ldap_pvt_thread_mutex_destroy( &bdb->bi_idx_mutex );
531
 
                avl_free( bdb->bi_idx, ch_free );
532
 
        }
 
512
        /* TODO: free tree */
 
513
        ldap_pvt_thread_mutex_destroy( &bdb->bi_idx_mutex );
 
514
        avl_free( bdb->bi_idx, ch_free );
533
515
#endif /* BDB_MONITOR_IDX */
534
516
 
535
517
        return 0;