For consistency with other variants of chain locking. This (read+nonblock) case was missing...
Cc: [email protected] Signed-off-by: Kirill Smelkov <[email protected]> --- lib/tdb/common/lock.c | 7 +++++++ lib/tdb/include/tdb.h | 1 + lib/tdb/tdb.exports | 1 + lib/tdb/tdb.signatures | 1 + 4 files changed, 10 insertions(+), 0 deletions(-) diff --git a/lib/tdb/common/lock.c b/lib/tdb/common/lock.c index 803feee..a7bdfee 100644 --- a/lib/tdb/common/lock.c +++ b/lib/tdb/common/lock.c @@ -751,6 +751,13 @@ int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key) return ret; } +int tdb_chainlock_read_nonblock(struct tdb_context *tdb, TDB_DATA key) +{ + int ret = tdb_lock_nonblock(tdb, BUCKET(tdb->hash_fn(&key)), F_RDLCK); + tdb_trace_1rec(tdb, "tdb_chainlock_read_nonblock", key); + return ret; +} + int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key) { tdb_trace_1rec(tdb, "tdb_chainunlock_read", key); diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h index 050f398..1262d8a 100644 --- a/lib/tdb/include/tdb.h +++ b/lib/tdb/include/tdb.h @@ -151,6 +151,7 @@ _PUBLIC_ int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key); _PUBLIC_ int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key); _PUBLIC_ int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key); _PUBLIC_ int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key); +_PUBLIC_ int tdb_chainlock_read_nonblock(struct tdb_context *tdb, TDB_DATA key); _PUBLIC_ int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key); _PUBLIC_ int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key); _PUBLIC_ int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key); diff --git a/lib/tdb/tdb.exports b/lib/tdb/tdb.exports index 73b8fd6..dd3c9c3 100644 --- a/lib/tdb/tdb.exports +++ b/lib/tdb/tdb.exports @@ -6,6 +6,7 @@ tdb_chainlock_mark; tdb_chainlock_nonblock; tdb_chainlock_read; + tdb_chainlock_read_nonblock; tdb_chainlock_unmark; tdb_chainunlock; tdb_chainunlock_read; diff --git a/lib/tdb/tdb.signatures b/lib/tdb/tdb.signatures index 7706d18..f7a03e0 100644 --- a/lib/tdb/tdb.signatures +++ b/lib/tdb/tdb.signatures @@ -5,6 +5,7 @@ int tdb_append (struct tdb_context *, TDB_DATA, TDB_DATA); int tdb_chainlock_mark (struct tdb_context *, TDB_DATA); int tdb_chainlock_nonblock (struct tdb_context *, TDB_DATA); int tdb_chainlock_read (struct tdb_context *, TDB_DATA); +int tdb_chainlock_read_nonblock (struct tdb_context *, TDB_DATA); int tdb_chainlock (struct tdb_context *, TDB_DATA); int tdb_chainlock_unmark (struct tdb_context *, TDB_DATA); int tdb_chainunlock_read (struct tdb_context *, TDB_DATA); -- 1.7.3.rc2 -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

