vfs: drop casts for VFS_ADD_FSP_EXTENSION() callers
authorDavid Disseldorp <ddiss@samba.org>
Tue, 5 Dec 2017 12:21:04 +0000 (13:21 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 6 Dec 2017 02:43:48 +0000 (03:43 +0100)
VFS_ADD_FSP_EXTENSION() now returns a properly typed pointer.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Dec  6 03:43:48 CET 2017 on sn-devel-144

source3/modules/vfs_cacheprime.c
source3/modules/vfs_catia.c
source3/modules/vfs_commit.c
source3/modules/vfs_fruit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_streams_xattr.c

index 526a0574c5f1612d91de4e82a041564c80b738e7..f06ece6a1903748c771db0e59df5f72f29978060 100644 (file)
@@ -56,7 +56,7 @@ static bool prime_cache(
         off_t * last;
         ssize_t nread;
 
-        last = (off_t *)VFS_ADD_FSP_EXTENSION(handle, fsp, off_t, NULL);
+        last = VFS_ADD_FSP_EXTENSION(handle, fsp, off_t, NULL);
         if (!last) {
                 return False;
         }
index 4088affc08974578ad2238c1d3482ec6f08ffa1a..6f90c4d97bca91d9b9ddb43a4439155b8d93b26e 100644 (file)
@@ -397,7 +397,7 @@ static int catia_fetch_fsp_pre_next(TALLOC_CTX *mem_ctx,
        }
 
        if (!make_tmp_cache) {
-               cc = (struct catia_cache *)VFS_ADD_FSP_EXTENSION(
+               cc = VFS_ADD_FSP_EXTENSION(
                        handle, fsp, struct catia_cache, NULL);
                if (cc == NULL) {
                        return -1;
index 340276a79004f43359efe14abb5561867ba1b95e..872b40bd78ca80a197d05eec1759bec16566866f 100644 (file)
@@ -202,7 +202,7 @@ static int commit_open(
                                         MODULE, "eof mode", "none");
 
         if (dthresh > 0 || !strequal(eof_mode, "none")) {
-                c = (struct commit_info *)VFS_ADD_FSP_EXTENSION(
+                c = VFS_ADD_FSP_EXTENSION(
                        handle, fsp, struct commit_info, NULL);
                 /* Process main tunables */
                 if (c) {
index 05a5d396fba8374aa1e36c1f068b173ab4679f3a..6a478574c99a6fd090fd862aa470bd597a77b841 100644 (file)
@@ -3211,7 +3211,7 @@ static int fruit_open_meta(vfs_handle_struct *handle,
                return -1;
        }
 
-       fio = (struct fio *)VFS_ADD_FSP_EXTENSION(handle, fsp, struct fio, NULL);
+       fio = VFS_ADD_FSP_EXTENSION(handle, fsp, struct fio, NULL);
        fio->type = ADOUBLE_META;
        fio->config = config;
 
@@ -3378,7 +3378,7 @@ static int fruit_open_rsrc(vfs_handle_struct *handle,
                return -1;
        }
 
-       fio = (struct fio *)VFS_ADD_FSP_EXTENSION(handle, fsp, struct fio, NULL);
+       fio = VFS_ADD_FSP_EXTENSION(handle, fsp, struct fio, NULL);
        fio->type = ADOUBLE_RSRC;
        fio->config = config;
 
index 9489d9d4990550bc0cf265420183447df8038ee3..cffab7b986eea17a843540c5c359fd397a229ac1 100644 (file)
@@ -573,8 +573,7 @@ static int vfs_gluster_open(struct vfs_handle_struct *handle,
        if (glfd == NULL) {
                return -1;
        }
-       p_tmp = (glfs_fd_t **)VFS_ADD_FSP_EXTENSION(handle, fsp,
-                                                         glfs_fd_t *, NULL);
+       p_tmp = VFS_ADD_FSP_EXTENSION(handle, fsp, glfs_fd_t *, NULL);
        *p_tmp = glfd;
        /* An arbitrary value for error reporting, so you know its us. */
        return 13371337;
index f75f6a18dd6611d571274958f517ef500e79c42b..c126a483f70182890163766c09d0be90b6fd995d 100644 (file)
@@ -493,9 +493,7 @@ static int streams_xattr_open(vfs_handle_struct *handle,
                }
        }
 
-        sio = (struct stream_io *)VFS_ADD_FSP_EXTENSION(handle, fsp,
-                                                       struct stream_io,
-                                                       NULL);
+        sio = VFS_ADD_FSP_EXTENSION(handle, fsp, struct stream_io, NULL);
         if (sio == NULL) {
                 errno = ENOMEM;
                 goto fail;