s3/vfs: remove now unused is_offline/set_offline VFS functions
authorRalph Boehme <slow@samba.org>
Mon, 10 Oct 2016 15:10:43 +0000 (17:10 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 11 Oct 2016 12:44:01 +0000 (14:44 +0200)
The previous commit removed all callers of this, so lets remove it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Oct 11 14:44:03 CEST 2016 on sn-devel-144

12 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_ceph.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_time_audit.c
source3/modules/vfs_unityed_media.c
source3/smbd/vfs.c

index 81ce184..9479595 100644 (file)
@@ -860,21 +860,6 @@ static bool skel_aio_force(struct vfs_handle_struct *handle,
        return false;
 }
 
-static bool skel_is_offline(struct vfs_handle_struct *handle,
-                           const struct smb_filename *fname,
-                           SMB_STRUCT_STAT *sbuf)
-{
-       errno = ENOSYS;
-       return false;
-}
-
-static int skel_set_offline(struct vfs_handle_struct *handle,
-                           const struct smb_filename *fname)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 /* VFS operations structure */
 
 struct vfs_fn_pointers skel_opaque_fns = {
@@ -1006,10 +991,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
 
        /* aio operations */
        .aio_force_fn = skel_aio_force,
-
-       /* offline operations */
-       .is_offline_fn = skel_is_offline,
-       .set_offline_fn = skel_set_offline
 };
 
 static_decl_vfs;
index 418ee24..f601312 100644 (file)
@@ -985,19 +985,6 @@ static bool skel_aio_force(struct vfs_handle_struct *handle,
        return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
 }
 
-static bool skel_is_offline(struct vfs_handle_struct *handle,
-                           const struct smb_filename *fname,
-                           SMB_STRUCT_STAT *sbuf)
-{
-       return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
-}
-
-static int skel_set_offline(struct vfs_handle_struct *handle,
-                           const struct smb_filename *fname)
-{
-       return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
-}
-
 /* VFS operations structure */
 
 struct vfs_fn_pointers skel_transparent_fns = {
@@ -1129,10 +1116,6 @@ struct vfs_fn_pointers skel_transparent_fns = {
 
        /* aio operations */
        .aio_force_fn = skel_aio_force,
-
-       /* offline operations */
-       .is_offline_fn = skel_is_offline,
-       .set_offline_fn = skel_set_offline
 };
 
 static_decl_vfs;
index dca6cef..0810fc2 100644 (file)
 /* Version 35 - Add uint32_t flags to struct smb_filename */
 /* Version 35 - Add get/set/fget/fset dos attribute functions. */
 /* Version 35 - Add bool use_ofd_locks to struct files_struct */
+/* Bump to version 36 - Samba 4.6 will ship with that */
+/* Version 36 - Remove is_offline and set_offline */
 
-#define SMB_VFS_INTERFACE_VERSION 35
+#define SMB_VFS_INTERFACE_VERSION 36
 
 /*
     All intercepted VFS operations must be declared as static functions inside module source
@@ -868,13 +870,6 @@ struct vfs_fn_pointers {
        /* aio operations */
        bool (*aio_force_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp);
 
-       /* offline operations */
-       bool (*is_offline_fn)(struct vfs_handle_struct *handle,
-                          const struct smb_filename *fname,
-                          SMB_STRUCT_STAT *sbuf);
-       int (*set_offline_fn)(struct vfs_handle_struct *handle,
-                          const struct smb_filename *fname);
-
        /* durable handle operations */
        NTSTATUS (*durable_cookie_fn)(struct vfs_handle_struct *handle,
                                      struct files_struct *fsp,
index c3c9a17..40c93f8 100644 (file)
 #define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \
        smb_vfs_call_aio_force((handle)->next,(fsp))
 
-#define SMB_VFS_IS_OFFLINE(conn,fname,sbuf) \
-       smb_vfs_call_is_offline((conn)->vfs_handles,(fname),(sbuf))
-#define SMB_VFS_NEXT_IS_OFFLINE(handle,fname,sbuf) \
-       smb_vfs_call_is_offline((handle)->next,(fname),(sbuf))
-
-#define SMB_VFS_SET_OFFLINE(conn,fname) \
-       smb_vfs_call_set_offline((conn)->vfs_handles,(fname))
-#define SMB_VFS_NEXT_SET_OFFLINE(handle,fname) \
-       smb_vfs_call_set_offline((handle)->next, (fname))
-
 /* durable handle operations */
 
 #define SMB_VFS_DURABLE_COOKIE(fsp, mem_ctx, cookie) \
index 59e9b9c..8e02683 100644 (file)
@@ -1204,20 +1204,6 @@ static bool cephwrap_aio_force(struct vfs_handle_struct *handle, struct files_st
        return false;
 }
 
-static bool cephwrap_is_offline(struct vfs_handle_struct *handle,
-                               const struct smb_filename *fname,
-                               SMB_STRUCT_STAT *sbuf)
-{
-       return false;
-}
-
-static int cephwrap_set_offline(struct vfs_handle_struct *handle,
-                               const struct smb_filename *fname)
-{
-       errno = ENOTSUP;
-       return -1;
-}
-
 static struct vfs_fn_pointers ceph_fns = {
        /* Disk operations */
 
@@ -1300,10 +1286,6 @@ static struct vfs_fn_pointers ceph_fns = {
 
        /* aio operations */
        .aio_force_fn = cephwrap_aio_force,
-
-       /* offline operations */
-       .is_offline_fn = cephwrap_is_offline,
-       .set_offline_fn = cephwrap_set_offline
 };
 
 NTSTATUS vfs_ceph_init(void);
index edff395..613ce6c 100644 (file)
@@ -2376,29 +2376,6 @@ static bool smb_full_audit_aio_force(struct vfs_handle_struct *handle,
        return result;
 }
 
-static bool smb_full_audit_is_offline(struct vfs_handle_struct *handle,
-                                     const struct smb_filename *fname,
-                                     SMB_STRUCT_STAT *sbuf)
-{
-       bool result;
-
-       result = SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
-       do_log(SMB_VFS_OP_IS_OFFLINE, result, handle, "%s",
-              smb_fname_str_do_log(fname));
-       return result;
-}
-
-static int smb_full_audit_set_offline(struct vfs_handle_struct *handle,
-                                     const struct smb_filename *fname)
-{
-       int result;
-
-       result = SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
-       do_log(SMB_VFS_OP_SET_OFFLINE, result >= 0, handle, "%s",
-              smb_fname_str_do_log(fname));
-       return result;
-}
-
 static NTSTATUS smb_full_audit_durable_cookie(struct vfs_handle_struct *handle,
                                struct files_struct *fsp,
                                TALLOC_CTX *mem_ctx,
@@ -2575,8 +2552,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .setxattr_fn = smb_full_audit_setxattr,
        .fsetxattr_fn = smb_full_audit_fsetxattr,
        .aio_force_fn = smb_full_audit_aio_force,
-       .is_offline_fn = smb_full_audit_is_offline,
-       .set_offline_fn = smb_full_audit_set_offline,
        .durable_cookie_fn = smb_full_audit_durable_cookie,
        .durable_disconnect_fn = smb_full_audit_durable_disconnect,
        .durable_reconnect_fn = smb_full_audit_durable_reconnect,
index 732ca51..b0ff0f6 100644 (file)
@@ -1246,22 +1246,6 @@ static bool vfs_gluster_aio_force(struct vfs_handle_struct *handle,
        return false;
 }
 
-/* Offline Operations */
-
-static bool vfs_gluster_is_offline(struct vfs_handle_struct *handle,
-                                  const struct smb_filename *fname,
-                                  SMB_STRUCT_STAT *sbuf)
-{
-       return false;
-}
-
-static int vfs_gluster_set_offline(struct vfs_handle_struct *handle,
-                                  const struct smb_filename *fname)
-{
-       errno = ENOTSUP;
-       return -1;
-}
-
 static struct vfs_fn_pointers glusterfs_fns = {
 
        /* Disk Operations */
@@ -1381,10 +1365,6 @@ static struct vfs_fn_pointers glusterfs_fns = {
        /* AIO Operations */
        .aio_force_fn = vfs_gluster_aio_force,
 
-       /* Offline Operations */
-       .is_offline_fn = vfs_gluster_is_offline,
-       .set_offline_fn = vfs_gluster_set_offline,
-
        /* Durable handle Operations */
        .durable_cookie_fn = NULL,
        .durable_disconnect_fn = NULL,
index dbbb55a..28da8e2 100644 (file)
@@ -2575,7 +2575,6 @@ static struct vfs_fn_pointers vfs_gpfs_fns = {
        .fstat_fn = vfs_gpfs_fstat,
        .lstat_fn = vfs_gpfs_lstat,
        .ntimes_fn = vfs_gpfs_ntimes,
-       .is_offline_fn = vfs_gpfs_is_offline,
        .aio_force_fn = vfs_gpfs_aio_force,
        .sendfile_fn = vfs_gpfs_sendfile,
        .fallocate_fn = vfs_gpfs_fallocate,
index 8f80221..d6a93f8 100644 (file)
@@ -2368,79 +2368,6 @@ out:
        return status;
 }
 
-/*
- * Success: return true
- * Failure: set errno, return false
- */
-static bool mh_is_offline(struct vfs_handle_struct *handle,
-               const struct smb_filename *fname,
-               SMB_STRUCT_STAT *sbuf)
-{
-       // check if sbuf is modified further down the chain.
-       bool ret;
-       struct smb_filename *clientFname;
-       TALLOC_CTX *ctx;
-
-       DEBUG(MH_INFO_DEBUG, ("Entering mh_is_offline\n"));
-       if (!is_in_media_files(fname->base_name))
-       {
-               ret = SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
-               goto out;
-       }
-
-       clientFname = NULL;
-       ctx = talloc_tos();
-
-       if(alloc_get_client_smb_fname(handle, ctx,
-                               fname,
-                               &clientFname))
-       {
-               ret = -1;
-               goto err;
-       }
-
-       ret = SMB_VFS_NEXT_IS_OFFLINE(handle, clientFname, sbuf);
-err:
-       TALLOC_FREE(clientFname);
-out:
-       return ret;
-}
-
-/*
- * Success: return 0 (?)
- * Failure: set errno, return -1
- */
-static int mh_set_offline(struct vfs_handle_struct *handle,
-               const struct smb_filename *fname)
-{
-       int status;
-       struct smb_filename *clientFname;
-       TALLOC_CTX *ctx;
-
-       DEBUG(MH_INFO_DEBUG, ("Entering mh_set_offline\n"));
-       if (!is_in_media_files(fname->base_name))
-       {
-               status = SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
-               goto out;
-       }
-
-       clientFname = NULL;
-       ctx = talloc_tos();
-
-       if ((status = alloc_get_client_smb_fname(handle, ctx,
-                               fname,
-                               &clientFname)))
-       {
-               goto err;
-       }
-
-       status = SMB_VFS_NEXT_SET_OFFLINE(handle, clientFname);
-err:
-       TALLOC_FREE(clientFname);
-out:
-       return status;
-}
-
 /* VFS operations structure */
 
 static struct vfs_fn_pointers vfs_mh_fns = {
@@ -2502,10 +2429,6 @@ static struct vfs_fn_pointers vfs_mh_fns = {
        .setxattr_fn = mh_setxattr,
 
        /* aio operations */
-
-       /* offline operations */
-       .is_offline_fn = mh_is_offline,
-       .set_offline_fn = mh_set_offline
 };
 
 NTSTATUS vfs_media_harmony_init(void);
index b3610ee..986fe79 100644 (file)
@@ -2495,45 +2495,6 @@ static bool smb_time_audit_aio_force(struct vfs_handle_struct *handle,
        return result;
 }
 
-static bool smb_time_audit_is_offline(struct vfs_handle_struct *handle,
-                                     const struct smb_filename *fname,
-                                     SMB_STRUCT_STAT *sbuf)
-{
-       bool result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_smb_fname("is_offline", timediff, fname);
-       }
-
-       return result;
-}
-
-static int smb_time_audit_set_offline(struct vfs_handle_struct *handle,
-                                     const struct smb_filename *fname)
-{
-       int result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_smb_fname("set_offline", timediff, fname);
-       }
-
-       return result;
-}
-
 static NTSTATUS smb_time_audit_durable_cookie(struct vfs_handle_struct *handle,
                                              struct files_struct *fsp,
                                              TALLOC_CTX *mem_ctx,
@@ -2712,8 +2673,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .setxattr_fn = smb_time_audit_setxattr,
        .fsetxattr_fn = smb_time_audit_fsetxattr,
        .aio_force_fn = smb_time_audit_aio_force,
-       .is_offline_fn = smb_time_audit_is_offline,
-       .set_offline_fn = smb_time_audit_set_offline,
        .durable_cookie_fn = smb_time_audit_durable_cookie,
        .durable_disconnect_fn = smb_time_audit_durable_disconnect,
        .durable_reconnect_fn = smb_time_audit_durable_reconnect,
index 3b3493d..d8191e1 100644 (file)
@@ -1806,59 +1806,6 @@ err:
        return status;
 }
 
-static bool um_is_offline(struct vfs_handle_struct *handle,
-                         const struct smb_filename *fname,
-                         SMB_STRUCT_STAT *sbuf)
-{
-       bool ret;
-       struct smb_filename *client_fname = NULL;
-       int status;
-
-       DEBUG(10, ("Entering um_is_offline\n"));
-
-       if (!is_in_media_files(fname->base_name)) {
-               return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
-       }
-
-       status = alloc_get_client_smb_fname(handle, talloc_tos(),
-                                           fname, &client_fname);
-       if (status != 0) {
-               ret = false;
-               goto err;
-       }
-
-       ret = SMB_VFS_NEXT_IS_OFFLINE(handle, client_fname, sbuf);
-
-err:
-       TALLOC_FREE(client_fname);
-       return ret;
-}
-
-static int um_set_offline(struct vfs_handle_struct *handle,
-                         const struct smb_filename *fname)
-{
-       int status;
-       struct smb_filename *client_fname = NULL;
-
-       DEBUG(10, ("Entering um_set_offline\n"));
-
-       if (!is_in_media_files(fname->base_name)) {
-               return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
-       }
-
-       status = alloc_get_client_smb_fname(handle, talloc_tos(),
-                                           fname, &client_fname);
-       if (status != 0) {
-               goto err;
-       }
-
-       status = SMB_VFS_NEXT_SET_OFFLINE(handle, client_fname);
-
-err:
-       TALLOC_FREE(client_fname);
-       return status;
-}
-
 static int um_connect(vfs_handle_struct *handle,
                         const char *service,
                         const char *user)
@@ -1956,12 +1903,6 @@ static struct vfs_fn_pointers vfs_um_fns = {
        .listxattr_fn = um_listxattr,
        .removexattr_fn = um_removexattr,
        .setxattr_fn = um_setxattr,
-
-       /* aio operations */
-
-       /* offline operations */
-       .is_offline_fn = um_is_offline,
-       .set_offline_fn = um_set_offline
 };
 
 NTSTATUS vfs_unityed_media_init(void);
index 45562ee..35f560b 100644 (file)
@@ -2531,21 +2531,6 @@ bool smb_vfs_call_aio_force(struct vfs_handle_struct *handle,
        return handle->fns->aio_force_fn(handle, fsp);
 }
 
-bool smb_vfs_call_is_offline(struct vfs_handle_struct *handle,
-                            const struct smb_filename *fname,
-                            SMB_STRUCT_STAT *sbuf)
-{
-       VFS_FIND(is_offline);
-       return handle->fns->is_offline_fn(handle, fname, sbuf);
-}
-
-int smb_vfs_call_set_offline(struct vfs_handle_struct *handle,
-                             const struct smb_filename *fname)
-{
-       VFS_FIND(set_offline);
-       return handle->fns->set_offline_fn(handle, fname);
-}
-
 NTSTATUS smb_vfs_call_durable_cookie(struct vfs_handle_struct *handle,
                                     struct files_struct *fsp,
                                     TALLOC_CTX *mem_ctx,