diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-01-10 10:52:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:37:23 -0500 |
commit | 1cd4339b9a2786aa26691ca4f02fa93ab0958b88 (patch) | |
tree | 9b09324617e38a651de0a761b3c591fa7deff74a /source4/ntvfs/common/brlock.c | |
parent | 848e236516ccc15864f7c3d2e05a905f6a81678e (diff) | |
download | samba-1cd4339b9a2786aa26691ca4f02fa93ab0958b88.tar.gz samba-1cd4339b9a2786aa26691ca4f02fa93ab0958b88.tar.bz2 samba-1cd4339b9a2786aa26691ca4f02fa93ab0958b88.zip |
r20646: first preparations for cluster enablement. This changes "
uint32_t server_id
to
struct server_id server_id;
which allows a server ID to have an node number. The node number will
be zero in non-clustered case. This is the most basic hook needed for
clustering, and ctdb.
(This used to be commit 2365abaa991d57d68c6ebe9be608e01c907102eb)
Diffstat (limited to 'source4/ntvfs/common/brlock.c')
-rw-r--r-- | source4/ntvfs/common/brlock.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/ntvfs/common/brlock.c b/source4/ntvfs/common/brlock.c index 2816c563b8..d7fb97415f 100644 --- a/source4/ntvfs/common/brlock.c +++ b/source4/ntvfs/common/brlock.c @@ -47,7 +47,7 @@ struct brl_context; lock is the same as another lock */ struct lock_context { - uint32_t server; + struct server_id server; uint16_t smbpid; struct brl_context *ctx; }; @@ -74,7 +74,7 @@ struct brl_handle { /* this struct is typicaly attached to tcon */ struct brl_context { struct tdb_wrap *w; - uint32_t server; + struct server_id server; struct messaging_context *messaging_ctx; }; @@ -83,7 +83,7 @@ struct brl_context { talloc_free(). We need the messaging_ctx to allow for pending lock notifications. */ -struct brl_context *brl_init(TALLOC_CTX *mem_ctx, uint32_t server, +struct brl_context *brl_init(TALLOC_CTX *mem_ctx, struct server_id server, struct messaging_context *messaging_ctx) { char *path; @@ -130,7 +130,7 @@ struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *n */ static BOOL brl_same_context(struct lock_context *ctx1, struct lock_context *ctx2) { - return (ctx1->server == ctx2->server && + return (cluster_id_equal(&ctx1->server, &ctx2->server) && ctx1->smbpid == ctx2->smbpid && ctx1->ctx == ctx2->ctx); } @@ -249,7 +249,7 @@ static NTSTATUS brl_lock_failed(struct brl_handle *brlh, struct lock_struct *loc * if the current lock matches the last failed lock on the file handle * and starts at the same offset, then FILE_LOCK_CONFLICT should be returned */ - if (lock->context.server == brlh->last_lock.context.server && + if (cluster_id_equal(&lock->context.server, &brlh->last_lock.context.server) && lock->context.ctx == brlh->last_lock.context.ctx && lock->ntvfs == brlh->last_lock.ntvfs && lock->start == brlh->last_lock.start) { @@ -535,7 +535,7 @@ NTSTATUS brl_remove_pending(struct brl_context *brl, if (lock->lock_type >= PENDING_READ_LOCK && lock->notify_ptr == notify_ptr && - lock->context.server == brl->server) { + cluster_id_equal(&lock->context.server, &brl->server)) { /* found it - delete it */ if (count == 1) { if (tdb_delete(brl->w->tdb, kbuf) != 0) { @@ -648,7 +648,7 @@ NTSTATUS brl_close(struct brl_context *brl, struct lock_struct *lock = &locks[i]; if (lock->context.ctx == brl && - lock->context.server == brl->server && + cluster_id_equal(&lock->context.server, &brl->server) && lock->ntvfs == brlh->ntvfs) { /* found it - delete it */ if (count > 1 && i < count-1) { |