diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-02-17 12:18:33 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-02-17 12:18:33 +1030 |
commit | 7ab422d6fbd4f8be02838089a41f872d538ee7a7 (patch) | |
tree | bee48874b28925ba38e2f8049039359c2967fa73 /lib/tdb/common/open.c | |
parent | a6e0ef87d25734760fe77b87a9fd11db56760955 (diff) | |
download | samba-7ab422d6fbd4f8be02838089a41f872d538ee7a7.tar.gz samba-7ab422d6fbd4f8be02838089a41f872d538ee7a7.tar.bz2 samba-7ab422d6fbd4f8be02838089a41f872d538ee7a7.zip |
tdb: cleanup: rename GLOBAL_LOCK to OPEN_LOCK.
The word global is overloaded in tdb. The GLOBAL_LOCK offset is used at
open time to serialize initialization (and by the transaction code to block
open).
Rename it to OPEN_LOCK.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb/common/open.c')
-rw-r--r-- | lib/tdb/common/open.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c index 13d5c94e37..35968c9eaf 100644 --- a/lib/tdb/common/open.c +++ b/lib/tdb/common/open.c @@ -241,8 +241,8 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags, fcntl(tdb->fd, F_SETFD, v | FD_CLOEXEC); /* ensure there is only one process initialising at once */ - if (tdb->methods->brlock(tdb, F_WRLCK, GLOBAL_LOCK, 1, TDB_LOCK_WAIT) == -1) { - TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: failed to get global lock on %s: %s\n", + if (tdb->methods->brlock(tdb, F_WRLCK, OPEN_LOCK, 1, TDB_LOCK_WAIT) == -1) { + TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: failed to get open lock on %s: %s\n", name, strerror(errno))); goto fail; /* errno set by tdb_brlock */ } @@ -356,8 +356,8 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags, internal: /* Internal (memory-only) databases skip all the code above to * do with disk files, and resume here by releasing their - * global lock and hooking into the active list. */ - if (tdb->methods->brunlock(tdb, F_WRLCK, GLOBAL_LOCK, 1) == -1) + * open lock and hooking into the active list. */ + if (tdb->methods->brunlock(tdb, F_WRLCK, OPEN_LOCK, 1) == -1) goto fail; tdb->next = tdbs; tdbs = tdb; |