Ignore:
Timestamp:
Nov 25, 2013, 6:40:10 PM (12 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.5: use fcntl and friends for locking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/lib/tdb/common/transaction.c

    r657 r836  
    495495        /* get a read lock from the freelist to the end of file. This
    496496           is upgraded to a write lock during the commit */
    497 #ifndef __OS2__ // YD the transation lock is an exclusive lock for us, it is enough.
    498497        if (tdb_brlock(tdb, FREELIST_TOP, F_RDLCK, F_SETLKW, 0, 0) == -1) {
    499498                TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_start: failed to get hash locks\n"));
     
    501500                goto fail;
    502501        }
    503 #endif
    504502
    505503        /* setup a copy of the hash table heads so the hash scan in
     
    533531       
    534532fail:
    535 #ifndef __OS2__ // YD the transation lock is an exclusive lock for us, it is enough.
    536533        tdb_brlock(tdb, FREELIST_TOP, F_UNLCK, F_SETLKW, 0, 0);
    537 #endif
    538534        tdb_transaction_unlock(tdb);
    539535        SAFE_FREE(tdb->transaction->blocks);
     
    636632        tdb->methods = tdb->transaction->io_methods;
    637633
    638 #ifndef __OS2__ // YD the transation lock is an exclusive lock for us, it is enough
    639634        tdb_brlock(tdb, FREELIST_TOP, F_UNLCK, F_SETLKW, 0, 0);
    640 #endif
    641635        tdb_transaction_unlock(tdb);
    642636        SAFE_FREE(tdb->transaction->hash_heads);
     
    946940
    947941        /* upgrade the main transaction lock region to a write lock */
    948 #ifndef __OS2__ // YD the global lock is an exclusive lock for us, it is enough
    949942        if (tdb_brlock_upgrade(tdb, FREELIST_TOP, 0) == -1) {
    950943                TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_prepare_commit: failed to upgrade hash locks\n"));
     
    953946                return -1;
    954947        }
    955 #endif
    956948
    957949        /* get the global lock - this prevents new users attaching to the database
Note: See TracChangeset for help on using the changeset viewer.