Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/lib/tdb/common/traverse.c

    r647 r745  
    77   Copyright (C) Paul `Rusty' Russell              2000
    88   Copyright (C) Jeremy Allison                    2000-2003
    9    
     9
    1010     ** NOTE! The following LGPL license applies to the tdb
    1111     ** library. This does NOT imply that all of Samba is released
    1212     ** under the LGPL
    13    
     13
    1414   This library is free software; you can redistribute it and/or
    1515   modify it under the terms of the GNU Lesser General Public
     
    4545                           hashes are used. In that case we spend most of our
    4646                           time in tdb_brlock(), locking empty hash chains.
    47                            
     47
    4848                           To avoid this, we do an unlocked pre-check to see
    4949                           if the hash chain is empty before starting to look
     
    5353                           lock, so instead we get the lock and re-fetch the
    5454                           value below.
    55                            
     55
    5656                           Notice that not doing this optimisation on the
    5757                           first hash chain is critical. We must guarantee
     
    6363                           could miss them anyway without this trick, so the
    6464                           semantics don't change.
    65                            
     65
    6666                           With a non-indexed ldb search this trick gains us a
    6767                           factor of around 80 in speed on a linux 2.6.x
     
    213213  a write style traverse - temporarily marks the db read only
    214214*/
    215 int tdb_traverse_read(struct tdb_context *tdb,
     215_PUBLIC_ int tdb_traverse_read(struct tdb_context *tdb,
    216216                      tdb_traverse_func fn, void *private_data)
    217217{
    218 
    219218        struct tdb_traverse_lock tl = { NULL, 0, 0, F_RDLCK };
    220219        int ret;
     
    222221        /* we need to get a read lock on the transaction lock here to
    223222           cope with the lock ordering semantics of solaris10 */
    224         if (tdb_transaction_lock(tdb, F_RDLCK)) {
     223        if (tdb_transaction_lock(tdb, F_RDLCK, TDB_LOCK_WAIT)) {
    225224                return -1;
    226225        }
     
    231230        tdb->traverse_read--;
    232231
    233         tdb_transaction_unlock(tdb);
     232        tdb_transaction_unlock(tdb, F_RDLCK);
    234233
    235234        return ret;
     
    243242  alignment restrictions malloc gives you.
    244243*/
    245 int tdb_traverse(struct tdb_context *tdb,
     244_PUBLIC_ int tdb_traverse(struct tdb_context *tdb,
    246245                 tdb_traverse_func fn, void *private_data)
    247246{
     
    253252        }
    254253
    255         if (tdb_transaction_lock(tdb, F_WRLCK)) {
     254        if (tdb_transaction_lock(tdb, F_WRLCK, TDB_LOCK_WAIT)) {
    256255                return -1;
    257256        }
     
    262261        tdb->traverse_write--;
    263262
    264         tdb_transaction_unlock(tdb);
     263        tdb_transaction_unlock(tdb, F_WRLCK);
    265264
    266265        return ret;
     
    269268
    270269/* find the first entry in the database and return its key */
    271 TDB_DATA tdb_firstkey(struct tdb_context *tdb)
     270_PUBLIC_ TDB_DATA tdb_firstkey(struct tdb_context *tdb)
    272271{
    273272        TDB_DATA key;
     
    300299
    301300/* find the next entry in the database, returning its key */
    302 TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA oldkey)
     301_PUBLIC_ TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA oldkey)
    303302{
    304303        uint32_t oldhash;
Note: See TracChangeset for help on using the changeset viewer.