[SCM] Samba Shared Repository - branch v4-0-test updated -
release-4-0-0alpha2-994-g3b70331
Stefan Metzmacher
metze at samba.org
Mon Feb 25 06:56:54 GMT 2008
The branch, v4-0-test has been updated
via 3b70331536d2402814db13a9f1f226a39373313a (commit)
via 16a7d0cc37614fc41245fdcdf3b5a4a4a421f31d (commit)
from 6820da44828172769d9fdfa161acf762e3937a88 (commit)
http://gitweb.samba.org/?samba.git;a=shortlog;h=v4-0-test
- Log -----------------------------------------------------------------
commit 3b70331536d2402814db13a9f1f226a39373313a
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Feb 21 09:02:17 2008 +0100
pvfs_wait: use struct pvfs_wait * instead of void *
metze
commit 16a7d0cc37614fc41245fdcdf3b5a4a4a421f31d
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Feb 21 08:59:21 2008 +0100
pvfs_wait: 'private' -> 'private_data' and use talloc_get_type()
metze
-----------------------------------------------------------------------
Summary of changes:
source/ntvfs/posix/pvfs_lock.c | 2 +-
source/ntvfs/posix/pvfs_notify.c | 8 +++++---
source/ntvfs/posix/pvfs_open.c | 2 +-
source/ntvfs/posix/pvfs_wait.c | 37 +++++++++++++++++++++----------------
source/ntvfs/posix/vfs_posix.h | 2 ++
5 files changed, 30 insertions(+), 21 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/ntvfs/posix/pvfs_lock.c b/source/ntvfs/posix/pvfs_lock.c
index b9bb58c..df85b2b 100644
--- a/source/ntvfs/posix/pvfs_lock.c
+++ b/source/ntvfs/posix/pvfs_lock.c
@@ -53,7 +53,7 @@ struct pvfs_pending_lock {
struct pvfs_file *f;
struct ntvfs_request *req;
int pending_lock;
- void *wait_handle;
+ struct pvfs_wait *wait_handle;
struct timeval end_time;
};
diff --git a/source/ntvfs/posix/pvfs_notify.c b/source/ntvfs/posix/pvfs_notify.c
index 210f949..06d2bc8 100644
--- a/source/ntvfs/posix/pvfs_notify.c
+++ b/source/ntvfs/posix/pvfs_notify.c
@@ -268,9 +268,11 @@ NTSTATUS pvfs_notify(struct ntvfs_module_context *ntvfs,
/* if the buffer is empty then start waiting */
if (f->notify_buffer->num_changes == 0) {
- void *wait_handle =
- pvfs_wait_message(pvfs, req, -1, timeval_zero(),
- pvfs_notify_end, f->notify_buffer);
+ struct pvfs_wait *wait_handle;
+ wait_handle = pvfs_wait_message(pvfs, req, -1,
+ timeval_zero(),
+ pvfs_notify_end,
+ f->notify_buffer);
NT_STATUS_HAVE_NO_MEMORY(wait_handle);
talloc_steal(req, wait_handle);
return NT_STATUS_OK;
diff --git a/source/ntvfs/posix/pvfs_open.c b/source/ntvfs/posix/pvfs_open.c
index 8558f04..3ccd239 100644
--- a/source/ntvfs/posix/pvfs_open.c
+++ b/source/ntvfs/posix/pvfs_open.c
@@ -756,7 +756,7 @@ struct pvfs_open_retry {
struct ntvfs_module_context *ntvfs;
struct ntvfs_request *req;
union smb_open *io;
- void *wait_handle;
+ struct pvfs_wait *wait_handle;
DATA_BLOB odb_locking_key;
};
diff --git a/source/ntvfs/posix/pvfs_wait.c b/source/ntvfs/posix/pvfs_wait.c
index 989985a..291250b 100644
--- a/source/ntvfs/posix/pvfs_wait.c
+++ b/source/ntvfs/posix/pvfs_wait.c
@@ -31,7 +31,7 @@ struct pvfs_wait {
struct pvfs_wait *next, *prev;
struct pvfs_state *pvfs;
void (*handler)(void *, enum pvfs_wait_notice);
- void *private;
+ void *private_data;
int msg_type;
struct messaging_context *msg_ctx;
struct event_context *ev;
@@ -45,20 +45,23 @@ struct pvfs_wait {
previous ntvfs handlers in the chain (such as security context)
*/
NTSTATUS pvfs_async_setup(struct ntvfs_module_context *ntvfs,
- struct ntvfs_request *req, void *private)
+ struct ntvfs_request *req, void *private_data)
{
- struct pvfs_wait *pwait = private;
- pwait->handler(pwait->private, pwait->reason);
+ struct pvfs_wait *pwait = talloc_get_type(private_data,
+ struct pvfs_wait);
+ pwait->handler(pwait->private_data, pwait->reason);
return NT_STATUS_OK;
}
/*
receive a completion message for a wait
*/
-static void pvfs_wait_dispatch(struct messaging_context *msg, void *private, uint32_t msg_type,
+static void pvfs_wait_dispatch(struct messaging_context *msg,
+ void *private_data, uint32_t msg_type,
struct server_id src, DATA_BLOB *data)
{
- struct pvfs_wait *pwait = private;
+ struct pvfs_wait *pwait = talloc_get_type(private_data,
+ struct pvfs_wait);
struct ntvfs_request *req;
void *p = NULL;
@@ -70,7 +73,7 @@ static void pvfs_wait_dispatch(struct messaging_context *msg, void *private, uin
pp = (void **)data->data;
p = *pp;
}
- if (p == NULL || p != pwait->private) {
+ if (p == NULL || p != pwait->private_data) {
return;
}
@@ -91,9 +94,11 @@ static void pvfs_wait_dispatch(struct messaging_context *msg, void *private, uin
receive a timeout on a message wait
*/
static void pvfs_wait_timeout(struct event_context *ev,
- struct timed_event *te, struct timeval t, void *private)
+ struct timed_event *te, struct timeval t,
+ void *private_data)
{
- struct pvfs_wait *pwait = talloc_get_type(private, struct pvfs_wait);
+ struct pvfs_wait *pwait = talloc_get_type(private_data,
+ struct pvfs_wait);
struct ntvfs_request *req = pwait->req;
pwait->reason = PVFS_WAIT_TIMEOUT;
@@ -126,12 +131,12 @@ static int pvfs_wait_destructor(struct pvfs_wait *pwait)
if msg_type == -1 then no message is registered, and it is assumed
that the caller handles any messaging setup needed
*/
-void *pvfs_wait_message(struct pvfs_state *pvfs,
- struct ntvfs_request *req,
- int msg_type,
- struct timeval end_time,
- void (*fn)(void *, enum pvfs_wait_notice),
- void *private)
+struct pvfs_wait *pvfs_wait_message(struct pvfs_state *pvfs,
+ struct ntvfs_request *req,
+ int msg_type,
+ struct timeval end_time,
+ void (*fn)(void *, enum pvfs_wait_notice),
+ void *private_data)
{
struct pvfs_wait *pwait;
@@ -140,7 +145,7 @@ void *pvfs_wait_message(struct pvfs_state *pvfs,
return NULL;
}
- pwait->private = private;
+ pwait->private_data = private_data;
pwait->handler = fn;
pwait->msg_ctx = pvfs->ntvfs->ctx->msg_ctx;
pwait->ev = pvfs->ntvfs->ctx->event_ctx;
diff --git a/source/ntvfs/posix/vfs_posix.h b/source/ntvfs/posix/vfs_posix.h
index a660da3..84c456d 100644
--- a/source/ntvfs/posix/vfs_posix.h
+++ b/source/ntvfs/posix/vfs_posix.h
@@ -28,6 +28,8 @@
#include "ntvfs/common/ntvfs_common.h"
#include "dsdb/samdb/samdb.h"
+struct pvfs_wait;
+
/* this is the private structure for the posix vfs backend. It is used
to hold per-connection (per tree connect) state information */
struct pvfs_state {
--
Samba Shared Repository
More information about the samba-cvs
mailing list