summaryrefslogtreecommitdiffstats
path: root/source4/ntvfs/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-01-10 10:52:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:37:23 -0500
commit1cd4339b9a2786aa26691ca4f02fa93ab0958b88 (patch)
tree9b09324617e38a651de0a761b3c591fa7deff74a /source4/ntvfs/common
parent848e236516ccc15864f7c3d2e05a905f6a81678e (diff)
downloadsamba-1cd4339b9a2786aa26691ca4f02fa93ab0958b88.tar.gz
samba-1cd4339b9a2786aa26691ca4f02fa93ab0958b88.tar.xz
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')
-rw-r--r--source4/ntvfs/common/brlock.c14
-rw-r--r--source4/ntvfs/common/notify.c12
-rw-r--r--source4/ntvfs/common/opendb.c4
3 files changed, 15 insertions, 15 deletions
diff --git a/source4/ntvfs/common/brlock.c b/source4/ntvfs/common/brlock.c
index 2816c563b8e..d7fb97415f5 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) {
diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c
index 19a60a51a97..13fd44abf03 100644
--- a/source4/ntvfs/common/notify.c
+++ b/source4/ntvfs/common/notify.c
@@ -37,7 +37,7 @@
struct notify_context {
struct tdb_wrap *w;
- uint32_t server;
+ struct server_id server;
struct messaging_context *messaging_ctx;
struct notify_list *list;
struct notify_array *array;
@@ -61,7 +61,7 @@ struct notify_list {
static NTSTATUS notify_remove_all(struct notify_context *notify);
static void notify_handler(struct messaging_context *msg_ctx, void *private,
- uint32_t msg_type, uint32_t server_id, DATA_BLOB *data);
+ uint32_t msg_type, struct server_id server_id, DATA_BLOB *data);
/*
destroy the notify context
@@ -78,7 +78,7 @@ static int notify_destructor(struct notify_context *notify)
talloc_free(). We need the messaging_ctx to allow for notifications
via internal messages
*/
-struct notify_context *notify_init(TALLOC_CTX *mem_ctx, uint32_t server,
+struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
struct messaging_context *messaging_ctx,
struct event_context *ev,
struct share_config *scfg)
@@ -241,7 +241,7 @@ static NTSTATUS notify_save(struct notify_context *notify)
handle incoming notify messages
*/
static void notify_handler(struct messaging_context *msg_ctx, void *private,
- uint32_t msg_type, uint32_t server_id, DATA_BLOB *data)
+ uint32_t msg_type, struct server_id server_id, DATA_BLOB *data)
{
struct notify_context *notify = talloc_get_type(private, struct notify_context);
NTSTATUS status;
@@ -460,7 +460,7 @@ NTSTATUS notify_remove(struct notify_context *notify, void *private)
for (i=0;i<d->num_entries;i++) {
if (private == d->entries[i].private &&
- notify->server == d->entries[i].server) {
+ cluster_id_equal(&notify->server, &d->entries[i].server)) {
break;
}
}
@@ -508,7 +508,7 @@ static NTSTATUS notify_remove_all(struct notify_context *notify)
for (depth=0;depth<notify->array->num_depths;depth++) {
struct notify_depth *d = &notify->array->depth[depth];
for (i=0;i<d->num_entries;i++) {
- if (notify->server == d->entries[i].server) {
+ if (cluster_id_equal(&notify->server, &d->entries[i].server)) {
if (i < d->num_entries-1) {
memmove(&d->entries[i], &d->entries[i+1],
sizeof(d->entries[i])*(d->num_entries-(i+1)));
diff --git a/source4/ntvfs/common/opendb.c b/source4/ntvfs/common/opendb.c
index c63a677847c..e1766d670e9 100644
--- a/source4/ntvfs/common/opendb.c
+++ b/source4/ntvfs/common/opendb.c
@@ -408,7 +408,7 @@ _PUBLIC_ NTSTATUS odb_close_file(struct odb_lock *lck, void *file_handle)
/* find the entry, and delete it */
for (i=0;i<file.num_entries;i++) {
if (file_handle == file.entries[i].file_handle &&
- odb->ntvfs_ctx->server_id == file.entries[i].server) {
+ cluster_id_equal(&odb->ntvfs_ctx->server_id, &file.entries[i].server)) {
if (file.entries[i].delete_on_close) {
file.delete_on_close = True;
}
@@ -455,7 +455,7 @@ _PUBLIC_ NTSTATUS odb_remove_pending(struct odb_lock *lck, void *private)
/* find the entry, and delete it */
for (i=0;i<file.num_pending;i++) {
if (private == file.pending[i].notify_ptr &&
- odb->ntvfs_ctx->server_id == file.pending[i].server) {
+ cluster_id_equal(&odb->ntvfs_ctx->server_id, &file.pending[i].server)) {
if (i < file.num_pending-1) {
memmove(file.pending+i, file.pending+i+1,
(file.num_pending - (i+1)) *