summaryrefslogtreecommitdiff
path: root/source4/ntvfs/common
diff options
context:
space:
mode:
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 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) {
diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c
index 19a60a51a9..13fd44abf0 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 c63a677847..e1766d670e 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)) *