summaryrefslogtreecommitdiff
path: root/lib/tdb2/private.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:38:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:38:13 +0930
commitbdd46e4513c7157a67408fcbd1e24b822cdbb960 (patch)
tree4ff8bb11db364f7781f15ee85f4b6b032644a376 /lib/tdb2/private.h
parentc5b7c4aea8a1d2be1d61c3b909177cb5ef07fd62 (diff)
downloadsamba-bdd46e4513c7157a67408fcbd1e24b822cdbb960.tar.gz
samba-bdd46e4513c7157a67408fcbd1e24b822cdbb960.tar.bz2
samba-bdd46e4513c7157a67408fcbd1e24b822cdbb960.zip
tdb2: make tdb1 use same low-level lock functions.
This means they will use the TDB_ATTRIBUTE_FLOCK functions, and get automatic reopen support. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit fbad02b680b6cbc33ae305ae1cbcdead4eedc7b1)
Diffstat (limited to 'lib/tdb2/private.h')
-rw-r--r--lib/tdb2/private.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/tdb2/private.h b/lib/tdb2/private.h
index 52dad3dc5d..5d16de179f 100644
--- a/lib/tdb2/private.h
+++ b/lib/tdb2/private.h
@@ -557,7 +557,7 @@ bool tdb_has_hash_locks(struct tdb_context *tdb);
enum TDB_ERROR tdb_allrecord_lock(struct tdb_context *tdb, int ltype,
enum tdb_lock_flags flags, bool upgradable);
void tdb_allrecord_unlock(struct tdb_context *tdb, int ltype);
-enum TDB_ERROR tdb_allrecord_upgrade(struct tdb_context *tdb);
+enum TDB_ERROR tdb_allrecord_upgrade(struct tdb_context *tdb, off_t start);
/* Serialize db open. */
enum TDB_ERROR tdb_lock_open(struct tdb_context *tdb,
@@ -573,6 +573,25 @@ bool tdb_has_expansion_lock(struct tdb_context *tdb);
/* If it needs recovery, grab all the locks and do it. */
enum TDB_ERROR tdb_lock_and_recover(struct tdb_context *tdb);
+/* Byte-range lock wrappers for TDB1 to access. */
+enum TDB_ERROR tdb_brlock(struct tdb_context *tdb,
+ int rw_type, tdb_off_t offset, tdb_off_t len,
+ enum tdb_lock_flags flags);
+
+enum TDB_ERROR tdb_brunlock(struct tdb_context *tdb,
+ int rw_type, tdb_off_t offset, size_t len);
+
+enum TDB_ERROR tdb_nest_lock(struct tdb_context *tdb,
+ tdb_off_t offset, int ltype,
+ enum tdb_lock_flags flags);
+
+enum TDB_ERROR tdb_nest_unlock(struct tdb_context *tdb,
+ tdb_off_t off, int ltype);
+
+enum TDB_ERROR tdb_lock_gradual(struct tdb_context *tdb,
+ int ltype, enum tdb_lock_flags flags,
+ tdb_off_t off, tdb_off_t len);
+
/* Default lock and unlock functions. */
int tdb_fcntl_lock(int fd, int rw, off_t off, off_t len, bool waitflag, void *);
int tdb_fcntl_unlock(int fd, int rw, off_t off, off_t len, void *);