summaryrefslogtreecommitdiff
path: root/source4/cluster
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-10-06 22:25:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:07:54 -0500
commit05e7c481465e3065effaf21b43636d6605d7c313 (patch)
tree6dd94046fbf6b2f2c61cb6cbde91841fa78f7e20 /source4/cluster
parent3642f3b40d755209a843745f160a9d7962a6deca (diff)
downloadsamba-05e7c481465e3065effaf21b43636d6605d7c313.tar.gz
r25553: Convert to standard bool type.
(This used to be commit b7371f1a191fb86834c0d586d094f39f0b04544b)
Diffstat (limited to 'source4/cluster')
-rw-r--r--source4/cluster/ctdb/brlock_ctdb.c26
-rw-r--r--source4/cluster/ctdb/client/ctdb_client.c8
-rw-r--r--source4/cluster/ctdb/opendb_ctdb.c16
3 files changed, 25 insertions, 25 deletions
diff --git a/source4/cluster/ctdb/brlock_ctdb.c b/source4/cluster/ctdb/brlock_ctdb.c
index fecc88da45a..8b633358a3b 100644
--- a/source4/cluster/ctdb/brlock_ctdb.c
+++ b/source4/cluster/ctdb/brlock_ctdb.c
@@ -148,7 +148,7 @@ static struct brl_handle *brl_ctdb_create_handle(TALLOC_CTX *mem_ctx, struct ntv
/*
see if two locking contexts are equal
*/
-static BOOL brl_ctdb_same_context(struct lock_context *ctx1, struct lock_context *ctx2)
+static bool brl_ctdb_same_context(struct lock_context *ctx1, struct lock_context *ctx2)
{
return (cluster_id_equal(&ctx1->server, &ctx2->server) &&
ctx1->smbpid == ctx2->smbpid &&
@@ -158,7 +158,7 @@ static BOOL brl_ctdb_same_context(struct lock_context *ctx1, struct lock_context
/*
see if lck1 and lck2 overlap
*/
-static BOOL brl_ctdb_overlap(struct lock_struct *lck1,
+static bool brl_ctdb_overlap(struct lock_struct *lck1,
struct lock_struct *lck2)
{
/* this extra check is not redundent - it copes with locks
@@ -166,35 +166,35 @@ static BOOL brl_ctdb_overlap(struct lock_struct *lck1,
if (lck1->size != 0 &&
lck1->start == lck2->start &&
lck1->size == lck2->size) {
- return True;
+ return true;
}
if (lck1->start >= (lck2->start+lck2->size) ||
lck2->start >= (lck1->start+lck1->size)) {
- return False;
+ return false;
}
- return True;
+ return true;
}
/*
See if lock2 can be added when lock1 is in place.
*/
-static BOOL brl_ctdb_conflict(struct lock_struct *lck1,
+static bool brl_ctdb_conflict(struct lock_struct *lck1,
struct lock_struct *lck2)
{
/* pending locks don't conflict with anything */
if (lck1->lock_type >= PENDING_READ_LOCK ||
lck2->lock_type >= PENDING_READ_LOCK) {
- return False;
+ return false;
}
if (lck1->lock_type == READ_LOCK && lck2->lock_type == READ_LOCK) {
- return False;
+ return false;
}
if (brl_ctdb_same_context(&lck1->context, &lck2->context) &&
lck2->lock_type == READ_LOCK && lck1->ntvfs == lck2->ntvfs) {
- return False;
+ return false;
}
return brl_ctdb_overlap(lck1, lck2);
@@ -205,16 +205,16 @@ static BOOL brl_ctdb_conflict(struct lock_struct *lck1,
Check to see if this lock conflicts, but ignore our own locks on the
same fnum only.
*/
-static BOOL brl_ctdb_conflict_other(struct lock_struct *lck1, struct lock_struct *lck2)
+static bool brl_ctdb_conflict_other(struct lock_struct *lck1, struct lock_struct *lck2)
{
/* pending locks don't conflict with anything */
if (lck1->lock_type >= PENDING_READ_LOCK ||
lck2->lock_type >= PENDING_READ_LOCK) {
- return False;
+ return false;
}
if (lck1->lock_type == READ_LOCK && lck2->lock_type == READ_LOCK)
- return False;
+ return false;
/*
* note that incoming write calls conflict with existing READ
@@ -224,7 +224,7 @@ static BOOL brl_ctdb_conflict_other(struct lock_struct *lck1, struct lock_struct
if (brl_ctdb_same_context(&lck1->context, &lck2->context) &&
lck1->ntvfs == lck2->ntvfs &&
(lck2->lock_type == READ_LOCK || lck1->lock_type == WRITE_LOCK)) {
- return False;
+ return false;
}
return brl_ctdb_overlap(lck1, lck2);
diff --git a/source4/cluster/ctdb/client/ctdb_client.c b/source4/cluster/ctdb/client/ctdb_client.c
index 7525b296d6f..84c095ec8a6 100644
--- a/source4/cluster/ctdb/client/ctdb_client.c
+++ b/source4/cluster/ctdb/client/ctdb_client.c
@@ -1558,7 +1558,7 @@ static void traverse_handler(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA
if (data.dsize < sizeof(uint32_t) ||
d->length != data.dsize) {
DEBUG(0,("Bad data size %u in traverse_handler\n", (unsigned)data.dsize));
- state->done = True;
+ state->done = true;
return;
}
@@ -1569,12 +1569,12 @@ static void traverse_handler(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA
if (key.dsize == 0 && data.dsize == 0) {
/* end of traverse */
- state->done = True;
+ state->done = true;
return;
}
if (state->fn(ctdb, key, data, state->private_data) != 0) {
- state->done = True;
+ state->done = true;
}
state->count++;
@@ -1594,7 +1594,7 @@ int ctdb_traverse(struct ctdb_db_context *ctdb_db, ctdb_traverse_func fn, void *
uint64_t srvid = (getpid() | 0xFLL<<60);
struct traverse_state state;
- state.done = False;
+ state.done = false;
state.count = 0;
state.private_data = private_data;
state.fn = fn;
diff --git a/source4/cluster/ctdb/opendb_ctdb.c b/source4/cluster/ctdb/opendb_ctdb.c
index ae174ea01db..7753992df85 100644
--- a/source4/cluster/ctdb/opendb_ctdb.c
+++ b/source4/cluster/ctdb/opendb_ctdb.c
@@ -55,7 +55,7 @@ struct odb_context {
struct ctdb_context *ctdb;
struct ctdb_db_context *ctdb_db;
struct ntvfs_context *ntvfs_ctx;
- BOOL oplocks;
+ bool oplocks;
};
/*
@@ -264,7 +264,7 @@ static NTSTATUS odb_oplock_break_send(struct odb_context *odb, struct opendb_ent
*/
static NTSTATUS odb_ctdb_open_file(struct odb_lock *lck, void *file_handle,
uint32_t stream_id, uint32_t share_access,
- uint32_t access_mask, BOOL delete_on_close,
+ uint32_t access_mask, bool delete_on_close,
const char *path,
uint32_t oplock_level, uint32_t *oplock_granted)
{
@@ -274,7 +274,7 @@ static NTSTATUS odb_ctdb_open_file(struct odb_lock *lck, void *file_handle,
struct opendb_file file;
NTSTATUS status;
- if (odb->oplocks == False) {
+ if (odb->oplocks == false) {
oplock_level = OPLOCK_NONE;
}
@@ -405,7 +405,7 @@ static NTSTATUS odb_ctdb_close_file(struct odb_lock *lck, void *file_handle)
if (file_handle == file.entries[i].file_handle &&
cluster_id_equal(&odb->ntvfs_ctx->server_id, &file.entries[i].server)) {
if (file.entries[i].delete_on_close) {
- file.delete_on_close = True;
+ file.delete_on_close = true;
}
if (i < file.num_entries-1) {
memmove(file.entries+i, file.entries+i+1,
@@ -492,7 +492,7 @@ static NTSTATUS odb_ctdb_rename(struct odb_lock *lck, const char *path)
/*
update delete on close flag on an open file
*/
-static NTSTATUS odb_ctdb_set_delete_on_close(struct odb_lock *lck, BOOL del_on_close)
+static NTSTATUS odb_ctdb_set_delete_on_close(struct odb_lock *lck, bool del_on_close)
{
NTSTATUS status;
struct opendb_file file;
@@ -510,7 +510,7 @@ static NTSTATUS odb_ctdb_set_delete_on_close(struct odb_lock *lck, BOOL del_on_c
people still have the file open
*/
static NTSTATUS odb_ctdb_get_delete_on_close(struct odb_context *odb,
- DATA_BLOB *key, BOOL *del_on_close,
+ DATA_BLOB *key, bool *del_on_close,
int *open_count, char **path)
{
NTSTATUS status;
@@ -523,7 +523,7 @@ static NTSTATUS odb_ctdb_get_delete_on_close(struct odb_context *odb,
status = odb_pull_record(lck, &file);
if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_NOT_FOUND, status)) {
talloc_free(lck);
- (*del_on_close) = False;
+ (*del_on_close) = false;
return NT_STATUS_OK;
}
if (!NT_STATUS_IS_OK(status)) {
@@ -539,7 +539,7 @@ static NTSTATUS odb_ctdb_get_delete_on_close(struct odb_context *odb,
*path = talloc_strdup(odb, file.path);
NT_STATUS_HAVE_NO_MEMORY(*path);
if (file.num_entries == 1 && file.entries[0].delete_on_close) {
- (*del_on_close) = True;
+ (*del_on_close) = true;
}
}