diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source4/ntvfs/common | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source4/ntvfs/common')
-rw-r--r-- | source4/ntvfs/common/brlock.c | 26 | ||||
-rw-r--r-- | source4/ntvfs/common/brlock.h | 4 | ||||
-rw-r--r-- | source4/ntvfs/common/brlock_tdb.c | 28 | ||||
-rw-r--r-- | source4/ntvfs/common/notify.c | 24 | ||||
-rw-r--r-- | source4/ntvfs/common/opendb.c | 2 | ||||
-rw-r--r-- | source4/ntvfs/common/opendb_tdb.c | 18 |
6 files changed, 51 insertions, 51 deletions
diff --git a/source4/ntvfs/common/brlock.c b/source4/ntvfs/common/brlock.c index 94041d2014..a6232f8596 100644 --- a/source4/ntvfs/common/brlock.c +++ b/source4/ntvfs/common/brlock.c @@ -26,7 +26,7 @@ #include "includes.h" #include "system/filesys.h" -#include <tdb.h> +#include "tdb_compat.h" #include "messaging/messaging.h" #include "lib/messaging/irpc.h" #include "libcli/libcli.h" @@ -38,26 +38,26 @@ static const struct brlock_ops *ops; /* set the brl backend ops */ -void brl_set_ops(const struct brlock_ops *new_ops) +void brlock_set_ops(const struct brlock_ops *new_ops) { ops = new_ops; } /* Open up the brlock database. Close it down using talloc_free(). We - need the messaging_ctx to allow for pending lock notifications. + need the imessaging_ctx to allow for pending lock notifications. */ -struct brl_context *brl_init(TALLOC_CTX *mem_ctx, struct server_id server, +struct brl_context *brlock_init(TALLOC_CTX *mem_ctx, struct server_id server, struct loadparm_context *lp_ctx, - struct messaging_context *messaging_ctx) + struct imessaging_context *imessaging_ctx) { if (ops == NULL) { brl_tdb_init_ops(); } - return ops->brl_init(mem_ctx, server, lp_ctx, messaging_ctx); + return ops->brl_init(mem_ctx, server, lp_ctx, imessaging_ctx); } -struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key) +struct brl_handle *brlock_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key) { return ops->brl_create_handle(mem_ctx, ntvfs, file_key); } @@ -69,7 +69,7 @@ struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *n someone else closing an overlapping lock range) a messaging notification is sent, identified by the notify_ptr */ -NTSTATUS brl_lock(struct brl_context *brl, +NTSTATUS brlock_lock(struct brl_context *brl, struct brl_handle *brlh, uint32_t smbpid, uint64_t start, uint64_t size, @@ -83,7 +83,7 @@ NTSTATUS brl_lock(struct brl_context *brl, /* Unlock a range of bytes. */ -NTSTATUS brl_unlock(struct brl_context *brl, +NTSTATUS brlock_unlock(struct brl_context *brl, struct brl_handle *brlh, uint32_t smbpid, uint64_t start, uint64_t size) @@ -96,7 +96,7 @@ NTSTATUS brl_unlock(struct brl_context *brl, given up trying to establish a lock or when they have succeeded in getting it. In either case they no longer need to be notified. */ -NTSTATUS brl_remove_pending(struct brl_context *brl, +NTSTATUS brlock_remove_pending(struct brl_context *brl, struct brl_handle *brlh, void *notify_ptr) { @@ -107,7 +107,7 @@ NTSTATUS brl_remove_pending(struct brl_context *brl, /* Test if we are allowed to perform IO on a region of an open file */ -NTSTATUS brl_locktest(struct brl_context *brl, +NTSTATUS brlock_locktest(struct brl_context *brl, struct brl_handle *brlh, uint32_t smbpid, uint64_t start, uint64_t size, @@ -120,7 +120,7 @@ NTSTATUS brl_locktest(struct brl_context *brl, /* Remove any locks associated with a open file. */ -NTSTATUS brl_close(struct brl_context *brl, +NTSTATUS brlock_close(struct brl_context *brl, struct brl_handle *brlh) { return ops->brl_close(brl, brlh); @@ -129,7 +129,7 @@ NTSTATUS brl_close(struct brl_context *brl, /* Get a number of locks associated with a open file. */ -NTSTATUS brl_count(struct brl_context *brl, +NTSTATUS brlock_count(struct brl_context *brl, struct brl_handle *brlh, int *count) { diff --git a/source4/ntvfs/common/brlock.h b/source4/ntvfs/common/brlock.h index e5e618d045..703538f073 100644 --- a/source4/ntvfs/common/brlock.h +++ b/source4/ntvfs/common/brlock.h @@ -24,7 +24,7 @@ struct brlock_ops { struct brl_context *(*brl_init)(TALLOC_CTX *, struct server_id , struct loadparm_context *lp_ctx, - struct messaging_context *); + struct imessaging_context *); struct brl_handle *(*brl_create_handle)(TALLOC_CTX *, struct ntvfs_handle *, DATA_BLOB *); NTSTATUS (*brl_lock)(struct brl_context *, struct brl_handle *, @@ -52,7 +52,7 @@ struct brlock_ops { }; -void brl_set_ops(const struct brlock_ops *new_ops); +void brlock_set_ops(const struct brlock_ops *new_ops); void brl_tdb_init_ops(void); void brl_ctdb_init_ops(void); diff --git a/source4/ntvfs/common/brlock_tdb.c b/source4/ntvfs/common/brlock_tdb.c index 35d4c27d0f..817448377c 100644 --- a/source4/ntvfs/common/brlock_tdb.c +++ b/source4/ntvfs/common/brlock_tdb.c @@ -26,9 +26,9 @@ #include "includes.h" #include "system/filesys.h" -#include <tdb.h> +#include "tdb_compat.h" #include "messaging/messaging.h" -#include "tdb_wrap.h" +#include "lib/util/tdb_wrap.h" #include "lib/messaging/irpc.h" #include "libcli/libcli.h" #include "cluster/cluster.h" @@ -48,7 +48,7 @@ struct brl_context { struct tdb_wrap *w; struct server_id server; - struct messaging_context *messaging_ctx; + struct imessaging_context *imessaging_ctx; }; /* @@ -89,12 +89,12 @@ static bool brl_invalid_lock_range(uint64_t start, uint64_t size) /* Open up the brlock.tdb database. Close it down using - talloc_free(). We need the messaging_ctx to allow for + talloc_free(). We need the imessaging_ctx to allow for pending lock notifications. */ static struct brl_context *brl_tdb_init(TALLOC_CTX *mem_ctx, struct server_id server, struct loadparm_context *lp_ctx, - struct messaging_context *messaging_ctx) + struct imessaging_context *imessaging_ctx) { struct brl_context *brl; @@ -110,7 +110,7 @@ static struct brl_context *brl_tdb_init(TALLOC_CTX *mem_ctx, struct server_id se } brl->server = server; - brl->messaging_ctx = messaging_ctx; + brl->imessaging_ctx = imessaging_ctx; return brl; } @@ -333,7 +333,7 @@ static NTSTATUS brl_tdb_lock(struct brl_context *brl, } } - dbuf = tdb_fetch(brl->w->tdb, kbuf); + dbuf = tdb_fetch_compat(brl->w->tdb, kbuf); lock.context.smbpid = smbpid; lock.context.server = brl->server; @@ -419,7 +419,7 @@ static void brl_tdb_notify_unlock(struct brl_context *brl, if (locks[i].lock_type == PENDING_WRITE_LOCK) { last_notice = i; } - messaging_send_ptr(brl->messaging_ctx, locks[i].context.server, + imessaging_send_ptr(brl->imessaging_ctx, locks[i].context.server, MSG_BRL_RETRY, locks[i].notify_ptr); } } @@ -468,7 +468,7 @@ static NTSTATUS brl_tdb_unlock(struct brl_context *brl, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - dbuf = tdb_fetch(brl->w->tdb, kbuf); + dbuf = tdb_fetch_compat(brl->w->tdb, kbuf); if (!dbuf.dptr) { tdb_chainunlock(brl->w->tdb, kbuf); return NT_STATUS_RANGE_NOT_LOCKED; @@ -568,7 +568,7 @@ static NTSTATUS brl_tdb_remove_pending(struct brl_context *brl, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - dbuf = tdb_fetch(brl->w->tdb, kbuf); + dbuf = tdb_fetch_compat(brl->w->tdb, kbuf); if (!dbuf.dptr) { tdb_chainunlock(brl->w->tdb, kbuf); return NT_STATUS_RANGE_NOT_LOCKED; @@ -639,7 +639,7 @@ static NTSTATUS brl_tdb_locktest(struct brl_context *brl, return NT_STATUS_INVALID_LOCK_RANGE; } - dbuf = tdb_fetch(brl->w->tdb, kbuf); + dbuf = tdb_fetch_compat(brl->w->tdb, kbuf); if (dbuf.dptr == NULL) { return NT_STATUS_OK; } @@ -686,7 +686,7 @@ static NTSTATUS brl_tdb_close(struct brl_context *brl, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - dbuf = tdb_fetch(brl->w->tdb, kbuf); + dbuf = tdb_fetch_compat(brl->w->tdb, kbuf); if (!dbuf.dptr) { tdb_chainunlock(brl->w->tdb, kbuf); return NT_STATUS_OK; @@ -751,7 +751,7 @@ static NTSTATUS brl_tdb_count(struct brl_context *brl, struct brl_handle *brlh, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - dbuf = tdb_fetch(brl->w->tdb, kbuf); + dbuf = tdb_fetch_compat(brl->w->tdb, kbuf); if (!dbuf.dptr) { tdb_chainunlock(brl->w->tdb, kbuf); return NT_STATUS_OK; @@ -779,5 +779,5 @@ static const struct brlock_ops brlock_tdb_ops = { void brl_tdb_init_ops(void) { - brl_set_ops(&brlock_tdb_ops); + brlock_set_ops(&brlock_tdb_ops); } diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c index 0b5f91bfe1..98f17a6565 100644 --- a/source4/ntvfs/common/notify.c +++ b/source4/ntvfs/common/notify.c @@ -25,12 +25,12 @@ #include "includes.h" #include "system/filesys.h" -#include <tdb.h> +#include "../lib/tdb_compat/tdb_compat.h" #include "../lib/util/util_tdb.h" #include "messaging/messaging.h" -#include "tdb_wrap.h" +#include "lib/util/tdb_wrap.h" #include "lib/messaging/irpc.h" -#include "librpc/gen_ndr/ndr_s4_notify.h" +#include "librpc/gen_ndr/ndr_notify.h" #include "../lib/util/dlinklist.h" #include "ntvfs/common/ntvfs_common.h" #include "ntvfs/sysdep/sys_notify.h" @@ -41,7 +41,7 @@ struct notify_context { struct tdb_wrap *w; struct server_id server; - struct messaging_context *messaging_ctx; + struct imessaging_context *imessaging_ctx; struct notify_list *list; struct notify_array *array; int seqnum; @@ -63,7 +63,7 @@ struct notify_list { #define NOTIFY_ENABLE_DEFAULT true static NTSTATUS notify_remove_all(struct notify_context *notify); -static void notify_handler(struct messaging_context *msg_ctx, void *private_data, +static void notify_handler(struct imessaging_context *msg_ctx, void *private_data, uint32_t msg_type, struct server_id server_id, DATA_BLOB *data); /* @@ -71,18 +71,18 @@ static void notify_handler(struct messaging_context *msg_ctx, void *private_data */ static int notify_destructor(struct notify_context *notify) { - messaging_deregister(notify->messaging_ctx, MSG_PVFS_NOTIFY, notify); + imessaging_deregister(notify->imessaging_ctx, MSG_PVFS_NOTIFY, notify); notify_remove_all(notify); return 0; } /* Open up the notify.tdb database. You should close it down using - talloc_free(). We need the messaging_ctx to allow for notifications + talloc_free(). We need the imessaging_ctx to allow for notifications via internal messages */ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server, - struct messaging_context *messaging_ctx, + struct imessaging_context *imessaging_ctx, struct loadparm_context *lp_ctx, struct tevent_context *ev, struct share_config *scfg) @@ -109,7 +109,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server, } notify->server = server; - notify->messaging_ctx = messaging_ctx; + notify->imessaging_ctx = imessaging_ctx; notify->list = NULL; notify->array = NULL; notify->seqnum = tdb_get_seqnum(notify->w->tdb); @@ -118,7 +118,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server, /* register with the messaging subsystem for the notify message type */ - messaging_register(notify->messaging_ctx, notify, + imessaging_register(notify->imessaging_ctx, notify, MSG_PVFS_NOTIFY, notify_handler); notify->sys_notify_ctx = sys_notify_context_create(scfg, notify, ev); @@ -247,7 +247,7 @@ static NTSTATUS notify_save(struct notify_context *notify) /* handle incoming notify messages */ -static void notify_handler(struct messaging_context *msg_ctx, void *private_data, +static void notify_handler(struct imessaging_context *msg_ctx, void *private_data, uint32_t msg_type, struct server_id server_id, DATA_BLOB *data) { struct notify_context *notify = talloc_get_type(private_data, struct notify_context); @@ -563,7 +563,7 @@ static void notify_send(struct notify_context *notify, struct notify_entry *e, return; } - status = messaging_send(notify->messaging_ctx, e->server, + status = imessaging_send(notify->imessaging_ctx, e->server, MSG_PVFS_NOTIFY, &data); talloc_free(tmp_ctx); } diff --git a/source4/ntvfs/common/opendb.c b/source4/ntvfs/common/opendb.c index 12fe7015a7..29081ef7d6 100644 --- a/source4/ntvfs/common/opendb.c +++ b/source4/ntvfs/common/opendb.c @@ -55,7 +55,7 @@ void odb_set_ops(const struct opendb_ops *new_ops) /* Open up the openfiles.tdb database. Close it down using - talloc_free(). We need the messaging_ctx to allow for pending open + talloc_free(). We need the imessaging_ctx to allow for pending open notifications. */ struct odb_context *odb_init(TALLOC_CTX *mem_ctx, diff --git a/source4/ntvfs/common/opendb_tdb.c b/source4/ntvfs/common/opendb_tdb.c index 881fd5b57a..9884e1f8b0 100644 --- a/source4/ntvfs/common/opendb_tdb.c +++ b/source4/ntvfs/common/opendb_tdb.c @@ -40,9 +40,9 @@ #include "includes.h" #include "system/filesys.h" -#include <tdb.h> +#include "../lib/tdb_compat/tdb_compat.h" #include "messaging/messaging.h" -#include "tdb_wrap.h" +#include "lib/util/tdb_wrap.h" #include "lib/messaging/irpc.h" #include "librpc/gen_ndr/ndr_opendb.h" #include "ntvfs/ntvfs.h" @@ -74,13 +74,13 @@ struct odb_lock { } can_open; }; -static NTSTATUS odb_oplock_break_send(struct messaging_context *msg_ctx, +static NTSTATUS odb_oplock_break_send(struct imessaging_context *msg_ctx, struct opendb_entry *e, uint8_t level); /* Open up the openfiles.tdb database. Close it down using - talloc_free(). We need the messaging_ctx to allow for pending open + talloc_free(). We need the imessaging_ctx to allow for pending open notifications. */ static struct odb_context *odb_tdb_init(TALLOC_CTX *mem_ctx, @@ -238,7 +238,7 @@ static NTSTATUS odb_pull_record(struct odb_lock *lck, struct opendb_file *file) DATA_BLOB blob; enum ndr_err_code ndr_err; - dbuf = tdb_fetch(odb->w->tdb, lck->key); + dbuf = tdb_fetch_compat(odb->w->tdb, lck->key); if (dbuf.dptr == NULL) { return NT_STATUS_OBJECT_NAME_NOT_FOUND; } @@ -294,7 +294,7 @@ static NTSTATUS odb_push_record(struct odb_lock *lck, struct opendb_file *file) /* send an oplock break to a client */ -static NTSTATUS odb_oplock_break_send(struct messaging_context *msg_ctx, +static NTSTATUS odb_oplock_break_send(struct imessaging_context *msg_ctx, struct opendb_entry *e, uint8_t level) { @@ -311,7 +311,7 @@ static NTSTATUS odb_oplock_break_send(struct messaging_context *msg_ctx, blob = data_blob_const(&op_break, sizeof(op_break)); - status = messaging_send(msg_ctx, e->server, + status = imessaging_send(msg_ctx, e->server, MSG_NTVFS_OPLOCK_BREAK, &blob); NT_STATUS_NOT_OK_RETURN(status); @@ -611,7 +611,7 @@ static NTSTATUS odb_tdb_close_file(struct odb_lock *lck, void *file_handle, /* send any pending notifications, removing them once sent */ for (i=0;i<lck->file.num_pending;i++) { - messaging_send_ptr(odb->ntvfs_ctx->msg_ctx, + imessaging_send_ptr(odb->ntvfs_ctx->msg_ctx, lck->file.pending[i].server, MSG_PVFS_RETRY_OPEN, lck->file.pending[i].notify_ptr); @@ -666,7 +666,7 @@ static NTSTATUS odb_tdb_update_oplock(struct odb_lock *lck, void *file_handle, /* send any pending notifications, removing them once sent */ for (i=0;i<lck->file.num_pending;i++) { - messaging_send_ptr(odb->ntvfs_ctx->msg_ctx, + imessaging_send_ptr(odb->ntvfs_ctx->msg_ctx, lck->file.pending[i].server, MSG_PVFS_RETRY_OPEN, lck->file.pending[i].notify_ptr); |