s4:pvfs: use talloc_get_type() to cast from void *
authorStefan Metzmacher <metze@samba.org>
Wed, 4 Feb 2009 07:52:41 +0000 (08:52 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 5 Feb 2009 16:48:07 +0000 (17:48 +0100)
metze

17 files changed:
source4/ntvfs/posix/pvfs_flush.c
source4/ntvfs/posix/pvfs_fsinfo.c
source4/ntvfs/posix/pvfs_ioctl.c
source4/ntvfs/posix/pvfs_lock.c
source4/ntvfs/posix/pvfs_mkdir.c
source4/ntvfs/posix/pvfs_open.c
source4/ntvfs/posix/pvfs_oplock.c
source4/ntvfs/posix/pvfs_qfileinfo.c
source4/ntvfs/posix/pvfs_read.c
source4/ntvfs/posix/pvfs_rename.c
source4/ntvfs/posix/pvfs_search.c
source4/ntvfs/posix/pvfs_seek.c
source4/ntvfs/posix/pvfs_setfileinfo.c
source4/ntvfs/posix/pvfs_unlink.c
source4/ntvfs/posix/pvfs_wait.c
source4/ntvfs/posix/pvfs_write.c
source4/ntvfs/posix/vfs_posix.c

index 6e09c1f34ae35afffd43fc53436ca4d25b305a33..f425fccec759347a8f2362b63366f43c0e882834 100644 (file)
@@ -42,7 +42,8 @@ NTSTATUS pvfs_flush(struct ntvfs_module_context *ntvfs,
                    struct ntvfs_request *req,
                    union smb_flush *io)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f;
 
        switch (io->generic.level) {
index 9a836fac323e31edb1be5d994ee35cd015925b6d..10fb7cf707ee39cf1acd0067d417e01981b72958 100644 (file)
@@ -85,7 +85,8 @@ NTSTATUS pvfs_fsinfo(struct ntvfs_module_context *ntvfs,
                     struct ntvfs_request *req, union smb_fsinfo *fs)
 {
        NTSTATUS status;
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        uint64_t blocks_free, blocks_total;
        uint_t bpunit;
        struct stat st;
index 92d3eae061f2bb487a297f360dc20d158abe7e68..f263e9852b64d090691f4d2e4194d78fd3ba2d57 100644 (file)
@@ -38,7 +38,8 @@ static NTSTATUS pvfs_ioctl_old(struct ntvfs_module_context *ntvfs,
 static NTSTATUS pvfs_ntioctl(struct ntvfs_module_context *ntvfs,
                             struct ntvfs_request *req, union smb_ioctl *io)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f;
 
        f = pvfs_find_fd(pvfs, req, io->ntioctl.in.file.ntvfs);
index 2353baeff4aa38723344ac637145788724afce2b..711c924ae3fbf3289b196f7e5e8c931ccfa595d1 100644 (file)
@@ -90,7 +90,8 @@ static void pvfs_lock_async_failed(struct pvfs_state *pvfs,
 */
 static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice reason)
 {
-       struct pvfs_pending_lock *pending = private_data;
+       struct pvfs_pending_lock *pending = talloc_get_type(private_data,
+                                           struct pvfs_pending_lock);
        struct pvfs_state *pvfs = pending->pvfs;
        struct pvfs_file *f = pending->f;
        struct ntvfs_request *req = pending->req;
@@ -277,7 +278,8 @@ static NTSTATUS pvfs_lock_cancel(struct pvfs_state *pvfs, struct ntvfs_request *
 NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
                   struct ntvfs_request *req, union smb_lock *lck)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f;
        struct smb_lock_entry *locks;
        int i;
index 8cc96173ad625d578c3826fa65fa4e9b95a1af77..6ec9e60955d94fb9b18830e84f3dc416bc02e05f 100644 (file)
@@ -96,7 +96,8 @@ static NTSTATUS pvfs_t2mkdir(struct pvfs_state *pvfs,
 NTSTATUS pvfs_mkdir(struct ntvfs_module_context *ntvfs,
                    struct ntvfs_request *req, union smb_mkdir *md)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        NTSTATUS status;
        struct pvfs_filename *name;
        mode_t mode;
@@ -153,7 +154,8 @@ NTSTATUS pvfs_mkdir(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_rmdir(struct ntvfs_module_context *ntvfs,
                    struct ntvfs_request *req, struct smb_rmdir *rd)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        NTSTATUS status;
        struct pvfs_filename *name;
 
index fe3c915576f9ef3051441f2b9a0db83571b8bfc7..12f50fcc97eb71154978bd43b95588557ba23c38 100644 (file)
@@ -868,7 +868,8 @@ struct pvfs_odb_retry {
 /* destroy a pending request */
 static int pvfs_odb_retry_destructor(struct pvfs_odb_retry *r)
 {
-       struct pvfs_state *pvfs = r->ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(r->ntvfs->private_data,
+                                 struct pvfs_state);
        if (r->odb_locking_key.data) {
                struct odb_lock *lck;
                lck = odb_lock(r->req, pvfs->odb_context, &r->odb_locking_key);
@@ -913,7 +914,8 @@ NTSTATUS pvfs_odb_retry_setup(struct ntvfs_module_context *ntvfs,
                                               void *private_data,
                                               enum pvfs_wait_notice reason))
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_odb_retry *r;
        struct pvfs_wait *wait_handle;
        NTSTATUS status;
@@ -1039,7 +1041,8 @@ static NTSTATUS pvfs_open_deny_dos(struct ntvfs_module_context *ntvfs,
                                   struct ntvfs_request *req, union smb_open *io,
                                   struct pvfs_file *f, struct odb_lock *lck)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f2;
        struct pvfs_filename *name;
        NTSTATUS status;
@@ -1120,7 +1123,8 @@ static NTSTATUS pvfs_open_setup_retry(struct ntvfs_module_context *ntvfs,
                                      struct odb_lock *lck,
                                      NTSTATUS parent_status)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        NTSTATUS status;
        struct timeval end_time;
        struct timeval *final_timeout = NULL;
@@ -1174,7 +1178,8 @@ static NTSTATUS pvfs_open_setup_retry(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
                   struct ntvfs_request *req, union smb_open *io)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        int flags = 0;
        struct pvfs_filename *name;
        struct pvfs_file *f;
@@ -1627,7 +1632,8 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs,
                    struct ntvfs_request *req, union smb_close *io)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f;
 
        if (io->generic.level == RAW_CLOSE_SPLCLOSE) {
@@ -1684,7 +1690,8 @@ NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_logoff(struct ntvfs_module_context *ntvfs,
                     struct ntvfs_request *req)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f, *next;
 
        for (f=pvfs->files.list;f;f=next) {
@@ -1704,7 +1711,8 @@ NTSTATUS pvfs_logoff(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_exit(struct ntvfs_module_context *ntvfs,
                   struct ntvfs_request *req)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f, *next;
 
        for (f=pvfs->files.list;f;f=next) {
index 71add72987ae67226e5436fd4914ae4022bccdde..e5a069addcbf398f8f69947eb455a12147ddee42 100644 (file)
@@ -245,7 +245,8 @@ NTSTATUS pvfs_setup_oplock(struct pvfs_file *f, uint32_t oplock_granted)
 NTSTATUS pvfs_oplock_release(struct ntvfs_module_context *ntvfs,
                             struct ntvfs_request *req, union smb_lock *lck)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f;
        uint8_t oplock_break;
        NTSTATUS status;
index 3196cf2f8d663c459362e9100c91054dbfc20b5a..bfc9a8441cbac429e53a23281ee3c45bb0edac80 100644 (file)
@@ -338,7 +338,8 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
 NTSTATUS pvfs_qpathinfo(struct ntvfs_module_context *ntvfs,
                        struct ntvfs_request *req, union smb_fileinfo *info)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_filename *name;
        NTSTATUS status;
 
@@ -374,7 +375,8 @@ NTSTATUS pvfs_qpathinfo(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_qfileinfo(struct ntvfs_module_context *ntvfs,
                        struct ntvfs_request *req, union smb_fileinfo *info)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f;
        struct pvfs_file_handle *h;
        NTSTATUS status;
index 8e1a59473f2f08cd5c57deff3ef9c3b0e1cb96c0..d9080d632d076f24fd4761f2bff879c395c41703 100644 (file)
@@ -29,7 +29,8 @@
 NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
                   struct ntvfs_request *req, union smb_read *rd)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        ssize_t ret;
        struct pvfs_file *f;
        NTSTATUS status;
index 800142812296fa732d85d8559673361f0db18e35..7f8eab5aa0b6e3c36a323a8025e348149a65e89c 100644 (file)
@@ -249,7 +249,8 @@ static NTSTATUS pvfs_rename_setup_retry(struct ntvfs_module_context *ntvfs,
                                        struct odb_lock *lck,
                                        NTSTATUS status)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct timeval end_time;
 
        if (NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION)) {
@@ -395,7 +396,8 @@ static NTSTATUS pvfs_rename_wildcard(struct pvfs_state *pvfs,
 static NTSTATUS pvfs_rename_mv(struct ntvfs_module_context *ntvfs,
                               struct ntvfs_request *req, union smb_rename *ren)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        NTSTATUS status;
        struct pvfs_filename *name1, *name2;
        struct odb_lock *lck = NULL;
@@ -472,7 +474,8 @@ static NTSTATUS pvfs_rename_stream(struct ntvfs_module_context *ntvfs,
                                   struct ntvfs_request *req, union smb_rename *ren,
                                   struct pvfs_filename *name1)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        NTSTATUS status;
        struct odb_lock *lck = NULL;
 
@@ -524,7 +527,8 @@ static NTSTATUS pvfs_rename_stream(struct ntvfs_module_context *ntvfs,
 static NTSTATUS pvfs_rename_nt(struct ntvfs_module_context *ntvfs,
                               struct ntvfs_request *req, union smb_rename *ren)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        NTSTATUS status;
        struct pvfs_filename *name1, *name2;
        struct odb_lock *lck = NULL;
@@ -632,7 +636,8 @@ static NTSTATUS pvfs_rename_nt(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_rename(struct ntvfs_module_context *ntvfs,
                     struct ntvfs_request *req, union smb_rename *ren)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f;
 
        switch (ren->generic.level) {
index 22aa297210b9af409d51c04a050dba7a21396c17..dc4f86b4d2cbfb4aca5375e6bf12ff604ef5d43a 100644 (file)
@@ -294,8 +294,12 @@ static void pvfs_search_cleanup(struct pvfs_state *pvfs)
        time_t t = time(NULL);
 
        for (i=0;i<MAX_OLD_SEARCHES;i++) {
-               struct pvfs_search_state *search = idr_find(pvfs->search.idtree, i);
-               if (search == NULL) return;
+               struct pvfs_search_state *search;
+               void *p = idr_find(pvfs->search.idtree, i);
+
+               if (p == NULL) return;
+
+               search = talloc_get_type(p, struct pvfs_search_state);
                if (pvfs_list_eos(search->dir, search->current_index) &&
                    search->last_used != 0 &&
                    t > search->last_used + 30) {
@@ -316,7 +320,8 @@ static NTSTATUS pvfs_search_first_old(struct ntvfs_module_context *ntvfs,
                                      bool (*callback)(void *, const union smb_search_data *))
 {
        struct pvfs_dir *dir;
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_search_state *search;
        uint_t reply_count;
        uint16_t search_attrib;
@@ -405,7 +410,9 @@ static NTSTATUS pvfs_search_next_old(struct ntvfs_module_context *ntvfs,
                                     void *search_private, 
                                     bool (*callback)(void *, const union smb_search_data *))
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
+       void *p;
        struct pvfs_search_state *search;
        struct pvfs_dir *dir;
        uint_t reply_count, max_count;
@@ -415,12 +422,14 @@ static NTSTATUS pvfs_search_next_old(struct ntvfs_module_context *ntvfs,
        handle    = io->search_next.in.id.handle | (io->search_next.in.id.reserved<<8);
        max_count = io->search_next.in.max_count;
 
-       search = idr_find(pvfs->search.idtree, handle);
-       if (search == NULL) {
+       p = idr_find(pvfs->search.idtree, handle);
+       if (p == NULL) {
                /* we didn't find the search handle */
                return NT_STATUS_INVALID_HANDLE;
        }
 
+       search = talloc_get_type(p, struct pvfs_search_state);
+
        dir = search->dir;
 
        status = pvfs_list_seek_ofs(dir, io->search_next.in.id.server_cookie, 
@@ -455,7 +464,8 @@ static NTSTATUS pvfs_search_first_trans2(struct ntvfs_module_context *ntvfs,
                                         bool (*callback)(void *, const union smb_search_data *))
 {
        struct pvfs_dir *dir;
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_search_state *search;
        uint_t reply_count;
        uint16_t search_attrib, max_count;
@@ -550,7 +560,9 @@ static NTSTATUS pvfs_search_next_trans2(struct ntvfs_module_context *ntvfs,
                                        void *search_private, 
                                        bool (*callback)(void *, const union smb_search_data *))
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
+       void *p;
        struct pvfs_search_state *search;
        struct pvfs_dir *dir;
        uint_t reply_count;
@@ -559,12 +571,14 @@ static NTSTATUS pvfs_search_next_trans2(struct ntvfs_module_context *ntvfs,
 
        handle = io->t2fnext.in.handle;
 
-       search = idr_find(pvfs->search.idtree, handle);
-       if (search == NULL) {
+       p = idr_find(pvfs->search.idtree, handle);
+       if (p == NULL) {
                /* we didn't find the search handle */
                return NT_STATUS_INVALID_HANDLE;
        }
-       
+
+       search = talloc_get_type(p, struct pvfs_search_state);
+
        dir = search->dir;
        
        status = NT_STATUS_OK;
@@ -612,7 +626,8 @@ static NTSTATUS pvfs_search_first_smb2(struct ntvfs_module_context *ntvfs,
                                       bool (*callback)(void *, const union smb_search_data *))
 {
        struct pvfs_dir *dir;
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_search_state *search;
        uint_t reply_count;
        uint16_t max_count;
@@ -714,7 +729,8 @@ static NTSTATUS pvfs_search_next_smb2(struct ntvfs_module_context *ntvfs,
                                      void *search_private, 
                                      bool (*callback)(void *, const union smb_search_data *))
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_search_state *search;
        uint_t reply_count;
        uint16_t max_count;
@@ -812,7 +828,9 @@ NTSTATUS pvfs_search_next(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_search_close(struct ntvfs_module_context *ntvfs,
                           struct ntvfs_request *req, union smb_search_close *io)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
+       void *p;
        struct pvfs_search_state *search;
        uint16_t handle = INVALID_SEARCH_HANDLE;
 
@@ -829,12 +847,14 @@ NTSTATUS pvfs_search_close(struct ntvfs_module_context *ntvfs,
                break;
        }
 
-       search = idr_find(pvfs->search.idtree, handle);
-       if (search == NULL) {
+       p = idr_find(pvfs->search.idtree, handle);
+       if (p == NULL) {
                /* we didn't find the search handle */
                return NT_STATUS_INVALID_HANDLE;
        }
 
+       search = talloc_get_type(p, struct pvfs_search_state);
+
        talloc_free(search);
 
        return NT_STATUS_OK;
index a3c4024ed7ea532bc8512280470dea68a8a34792..2cd3410876a676e4bb96fa3d3ae09b17594f9dad 100644 (file)
@@ -29,7 +29,8 @@ NTSTATUS pvfs_seek(struct ntvfs_module_context *ntvfs,
                   struct ntvfs_request *req,
                   union smb_seek *io)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f;
        struct pvfs_file_handle *h;
        NTSTATUS status;
index d2604485d45104a1dc1886ba5944d7a7bb0df736..9fe02a8e175eafad6baa7f7ceaaf5355be0b23e2 100644 (file)
@@ -308,7 +308,8 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
                          struct ntvfs_request *req, 
                          union smb_setfileinfo *info)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_file *f;
        struct pvfs_file_handle *h;
        struct pvfs_filename newstats;
@@ -609,7 +610,8 @@ static NTSTATUS pvfs_setpathinfo_setup_retry(struct ntvfs_module_context *ntvfs,
                                             struct odb_lock *lck,
                                             NTSTATUS status)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct timeval end_time;
 
        if (NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION)) {
@@ -632,7 +634,8 @@ static NTSTATUS pvfs_setpathinfo_setup_retry(struct ntvfs_module_context *ntvfs,
 NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
                          struct ntvfs_request *req, union smb_setfileinfo *info)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_filename *name;
        struct pvfs_filename newstats;
        NTSTATUS status;
index 6a5704177041ea9b1b808fa7bda36d9f3bd29ef6..e10b2e3eef8a32a521bb7652611f4603ef8b8491 100644 (file)
@@ -84,7 +84,8 @@ static NTSTATUS pvfs_unlink_setup_retry(struct ntvfs_module_context *ntvfs,
                                        struct odb_lock *lck,
                                        NTSTATUS status)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct timeval end_time;
 
        if (NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION)) {
@@ -191,7 +192,8 @@ NTSTATUS pvfs_unlink(struct ntvfs_module_context *ntvfs,
                     struct ntvfs_request *req,
                     union smb_unlink *unl)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_dir *dir;
        NTSTATUS status;
        uint32_t total_deleted=0;
index d396b94da148ddb6321b8d4fc73a36b0070f2b23..ddfc410becd6559f1bad1980e8097a17cd5db48f 100644 (file)
@@ -185,7 +185,8 @@ struct pvfs_wait *pvfs_wait_message(struct pvfs_state *pvfs,
 */
 NTSTATUS pvfs_cancel(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_wait *pwait;
 
        for (pwait=pvfs->wait_list;pwait;pwait=pwait->next) {
index ba505e61d7cf4f3a2b404175e776aea0bcc0c2df..fb629a87fb30b1c8994f2cbb1af02fc81bef4b23 100644 (file)
@@ -83,7 +83,8 @@ static void pvfs_trigger_write_time_update(struct pvfs_file_handle *h)
 NTSTATUS pvfs_write(struct ntvfs_module_context *ntvfs,
                    struct ntvfs_request *req, union smb_write *wr)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        ssize_t ret;
        struct pvfs_file *f;
        NTSTATUS status;
index 6b0f32e65a84a41ff1a774b7f01ca3cd43c848e0..29ef701deebd846c9f3c01f4692026848ba1682f 100644 (file)
@@ -274,7 +274,8 @@ static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs,
                             struct ntvfs_request *req,
                             union smb_chkpath *cp)
 {
-       struct pvfs_state *pvfs = ntvfs->private_data;
+       struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+                                 struct pvfs_state);
        struct pvfs_filename *name;
        NTSTATUS status;