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 81ce1848898ee9efb7f6e454969458b871b811fc..94795957fbdfb264e42415215c94ed539d5e84b2 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 418ee24f97eca18cdd39804ba47c3bff805e9e3b..f60131257ae9d325709e8de9c16dddce33803a4b 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 dca6cef8704c297ffcb803529b4b8e0a8773f594..0810fc29fc87a598cd2ed6ea71f2c7394d416b94 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 c3c9a1716e926611a4b5ea15e724e10144a2407f..40c93f8a3b3be857f8ab247990143369c68a2613 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 59e9b9cf9b3e8e5313a20823994fcacf9e4b4168..8e0268378043f93fcc714c0bde0d436a04a8b726 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 edff3950ce3ceb34a1899504510177e7177b2f62..613ce6cc62ad690bcae9c7b0fa73a929ed327154 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 732ca51e3a7a71f673323bc49e9f7bf21484f81f..b0ff0f61ca35454d6bf82f1df83e7a5d54719075 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 dbbb55a1844738ad0b5336377bc1e417552ceef0..28da8e21e46582d5b14344896a85b3c14440d7ae 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 8f80221677192a38ad3ab92d98ec426ad3ce049f..d6a93f8445f4a76fa001e2dcf67a89a8ecaa8e07 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 b3610ee07ba4b8001522c75166907603c94803f6..986fe798d7f8461900634585404e83d30d9043ac 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 3b3493d013f7bc7ff7d7a2e63657b5801956ccd1..d8191e115996f8f905f657fe244c88139ccd5e78 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 45562eedebe2a1973a89ce23bf368b7b428d4b82..35f560b86763ac92db29a7869f6a5d406ce7c455 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,