summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-05-24 07:34:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:32 -0500
commit971d30bb201f5c3faff5f575d26882eb79f7955a (patch)
treeaad4df492eb9c8bf1e105c8bac65dc315b27a1cd /source4/ntvfs
parentcdc64c448df49676c96f87d106af8de0c467651f (diff)
downloadsamba-971d30bb201f5c3faff5f575d26882eb79f7955a.tar.gz
samba-971d30bb201f5c3faff5f575d26882eb79f7955a.tar.bz2
samba-971d30bb201f5c3faff5f575d26882eb79f7955a.zip
r15854: more talloc_set_destructor() typesafe fixes
(This used to be commit 61c6100617589ac6df4f527877241464cacbf8b3)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/cifs/vfs_cifs.c3
-rw-r--r--source4/ntvfs/common/notify.c3
-rw-r--r--source4/ntvfs/common/opendb.c3
-rw-r--r--source4/ntvfs/ipc/vfs_ipc.c3
-rw-r--r--source4/ntvfs/posix/pvfs_dirlist.c3
-rw-r--r--source4/ntvfs/posix/pvfs_notify.c3
-rw-r--r--source4/ntvfs/posix/pvfs_open.c17
7 files changed, 11 insertions, 24 deletions
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c
index 2b4f9bb8c5..47b89ff662 100644
--- a/source4/ntvfs/cifs/vfs_cifs.c
+++ b/source4/ntvfs/cifs/vfs_cifs.c
@@ -237,9 +237,8 @@ static NTSTATUS cvfs_disconnect(struct ntvfs_module_context *ntvfs)
/*
destroy an async info structure
*/
-static int async_info_destructor(void *p)
+static int async_info_destructor(struct async_info *async)
{
- struct async_info *async = talloc_get_type(p, struct async_info);
DLIST_REMOVE(async->cvfs->pending, async);
return 0;
}
diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c
index 57cbce3863..222bd7a927 100644
--- a/source4/ntvfs/common/notify.c
+++ b/source4/ntvfs/common/notify.c
@@ -63,9 +63,8 @@ static void notify_handler(struct messaging_context *msg_ctx, void *private,
/*
destroy the notify context
*/
-static int notify_destructor(void *p)
+static int notify_destructor(struct notify_context *notify)
{
- struct notify_context *notify = talloc_get_type(p, struct notify_context);
messaging_deregister(notify->messaging_ctx, MSG_PVFS_NOTIFY, notify);
notify_remove_all(notify);
return 0;
diff --git a/source4/ntvfs/common/opendb.c b/source4/ntvfs/common/opendb.c
index 395e6c6dbf..d83ecdc6f2 100644
--- a/source4/ntvfs/common/opendb.c
+++ b/source4/ntvfs/common/opendb.c
@@ -100,9 +100,8 @@ _PUBLIC_ struct odb_context *odb_init(TALLOC_CTX *mem_ctx,
/*
destroy a lock on the database
*/
-static int odb_lock_destructor(void *ptr)
+static int odb_lock_destructor(struct odb_lock *lck)
{
- struct odb_lock *lck = ptr;
tdb_chainunlock(lck->odb->w->tdb, lck->key);
return 0;
}
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c
index 2e7c538c3f..03e026e423 100644
--- a/source4/ntvfs/ipc/vfs_ipc.c
+++ b/source4/ntvfs/ipc/vfs_ipc.c
@@ -174,9 +174,8 @@ static NTSTATUS ipc_setpathinfo(struct ntvfs_module_context *ntvfs,
/*
destroy a open pipe structure
*/
-static int ipc_fd_destructor(void *ptr)
+static int ipc_fd_destructor(struct pipe_state *p)
{
- struct pipe_state *p = ptr;
DLIST_REMOVE(p->private->pipe_list, p);
return 0;
}
diff --git a/source4/ntvfs/posix/pvfs_dirlist.c b/source4/ntvfs/posix/pvfs_dirlist.c
index 517f5b68d0..c351f6ba41 100644
--- a/source4/ntvfs/posix/pvfs_dirlist.c
+++ b/source4/ntvfs/posix/pvfs_dirlist.c
@@ -84,9 +84,8 @@ static NTSTATUS pvfs_list_no_wildcard(struct pvfs_state *pvfs, struct pvfs_filen
/*
destroy an open search
*/
-static int pvfs_dirlist_destructor(void *ptr)
+static int pvfs_dirlist_destructor(struct pvfs_dir *dir)
{
- struct pvfs_dir *dir = ptr;
if (dir->dir) closedir(dir->dir);
return 0;
}
diff --git a/source4/ntvfs/posix/pvfs_notify.c b/source4/ntvfs/posix/pvfs_notify.c
index bd1e1b9d89..64aeac0696 100644
--- a/source4/ntvfs/posix/pvfs_notify.c
+++ b/source4/ntvfs/posix/pvfs_notify.c
@@ -117,9 +117,8 @@ static void pvfs_notify_send(struct pvfs_notify_buffer *notify_buffer,
/*
destroy a notify buffer. Called when the handle is closed
*/
-static int pvfs_notify_destructor(void *ptr)
+static int pvfs_notify_destructor(struct pvfs_notify_buffer *n)
{
- struct pvfs_notify_buffer *n = talloc_get_type(ptr, struct pvfs_notify_buffer);
notify_remove(n->f->pvfs->notify_context, n);
n->f->notify_buffer = NULL;
pvfs_notify_send(n, NT_STATUS_OK, True);
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index 2102de29f5..74f9b44c5c 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -54,9 +54,8 @@ struct pvfs_file *pvfs_find_fd(struct pvfs_state *pvfs,
/*
cleanup a open directory handle
*/
-static int pvfs_dir_handle_destructor(void *p)
+static int pvfs_dir_handle_destructor(struct pvfs_file_handle *h)
{
- struct pvfs_file_handle *h = p;
int open_count;
char *path = NULL;
@@ -102,10 +101,8 @@ static int pvfs_dir_handle_destructor(void *p)
/*
cleanup a open directory fnum
*/
-static int pvfs_dir_fnum_destructor(void *p)
+static int pvfs_dir_fnum_destructor(struct pvfs_file *f)
{
- struct pvfs_file *f = p;
-
DLIST_REMOVE(f->pvfs->files.list, f);
ntvfs_handle_remove_backend_data(f->ntvfs, f->pvfs->ntvfs);
@@ -412,9 +409,8 @@ cleanup_delete:
/*
destroy a struct pvfs_file_handle
*/
-static int pvfs_handle_destructor(void *p)
+static int pvfs_handle_destructor(struct pvfs_file_handle *h)
{
- struct pvfs_file_handle *h = p;
int open_count;
char *path = NULL;
@@ -494,10 +490,8 @@ static int pvfs_handle_destructor(void *p)
/*
destroy a struct pvfs_file
*/
-static int pvfs_fnum_destructor(void *p)
+static int pvfs_fnum_destructor(struct pvfs_file *f)
{
- struct pvfs_file *f = talloc_get_type(p, struct pvfs_file);
-
DLIST_REMOVE(f->pvfs->files.list, f);
pvfs_lock_close(f->pvfs, f);
ntvfs_handle_remove_backend_data(f->ntvfs, f->pvfs->ntvfs);
@@ -768,9 +762,8 @@ struct pvfs_open_retry {
};
/* destroy a pending open request */
-static int pvfs_retry_destructor(void *ptr)
+static int pvfs_retry_destructor(struct pvfs_open_retry *r)
{
- struct pvfs_open_retry *r = ptr;
struct pvfs_state *pvfs = r->ntvfs->private_data;
if (r->odb_locking_key.data) {
struct odb_lock *lck;