X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftdb1_lock.c;h=f21a22cacd10457a0191fcf7bd9c8b9065ca8ae2;hb=b2555a868e3ee58d1b31f9558e3623d49ed2b2f1;hp=7cc17d7a7e1777a3384c92ef442b90af39630e1d;hpb=bbeb528e74c0e234e1f724ac8d54be404cfc6f9a;p=ccan diff --git a/ccan/tdb2/tdb1_lock.c b/ccan/tdb2/tdb1_lock.c index 7cc17d7a..f21a22ca 100644 --- a/ccan/tdb2/tdb1_lock.c +++ b/ccan/tdb2/tdb1_lock.c @@ -306,7 +306,7 @@ int tdb1_allrecord_lock(struct tdb_context *tdb, int ltype, } /* FIXME: Temporary cast. */ - tdb->file->allrecord_lock.owner = (void *)(struct tdb1_context *)tdb; + tdb->file->allrecord_lock.owner = (void *)(struct tdb_context *)tdb; tdb->file->allrecord_lock.count = 1; /* If it's upgradable, it's actually exclusive so we can treat * it as a write lock. */ @@ -364,30 +364,6 @@ int tdb1_allrecord_unlock(struct tdb_context *tdb, int ltype) return 0; } -/* lock entire database with write lock */ -int tdb1_lockall(struct tdb_context *tdb) -{ - return tdb1_allrecord_lock(tdb, F_WRLCK, TDB_LOCK_WAIT, false); -} - -/* unlock entire database with write lock */ -int tdb1_unlockall(struct tdb_context *tdb) -{ - return tdb1_allrecord_unlock(tdb, F_WRLCK); -} - -/* lock entire database with read lock */ -int tdb1_lockall_read(struct tdb_context *tdb) -{ - return tdb1_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false); -} - -/* unlock entire database with read lock */ -int tdb1_unlockall_read(struct tdb_context *tdb) -{ - return tdb1_allrecord_unlock(tdb, F_RDLCK); -} - /* lock/unlock one hash chain. This is meant to be used to reduce contention - it cannot guarantee how many records will be locked */ int tdb1_chainlock(struct tdb_context *tdb, TDB_DATA key)