VFS: Remove SMB_VFS_CHFLAGS, not used anymore
authorNoel Power <noel.power@suse.com>
Fri, 11 Jun 2021 15:58:24 +0000 (16:58 +0100)
committerNoel Power <npower@samba.org>
Tue, 29 Jun 2021 08:21:38 +0000 (08:21 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_not_implemented.c
source3/modules/vfs_time_audit.c
source3/smbd/vfs.c

index 44bc5687543fed7174fda2e898fcaa377cae5428..a65deaf3204033496373144279b3590b1cc0b1ca 100644 (file)
@@ -506,14 +506,6 @@ static struct smb_filename *skel_realpath(vfs_handle_struct *handle,
        return NULL;
 }
 
-static int skel_chflags(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       uint flags)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_fchflags(vfs_handle_struct *handle,
                        struct files_struct *fsp,
                        uint flags)
@@ -1036,7 +1028,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .linkat_fn = skel_linkat,
        .mknodat_fn = skel_mknodat,
        .realpath_fn = skel_realpath,
-       .chflags_fn = skel_chflags,
        .fchflags_fn = skel_fchflags,
        .file_id_create_fn = skel_file_id_create,
        .fs_file_id_fn = skel_fs_file_id,
index fd7aac4d6a750dc0efe70ebec87a57d9556ef536..87f974c214b450033b3e485c53a5ff6a0dad3e07 100644 (file)
@@ -642,13 +642,6 @@ static struct smb_filename *skel_realpath(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname);
 }
 
-static int skel_chflags(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       uint flags)
-{
-       return SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags);
-}
-
 static int skel_fchflags(vfs_handle_struct *handle,
                        struct files_struct *fsp,
                        uint flags)
@@ -1340,7 +1333,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .linkat_fn = skel_linkat,
        .mknodat_fn = skel_mknodat,
        .realpath_fn = skel_realpath,
-       .chflags_fn = skel_chflags,
        .fchflags_fn = skel_fchflags,
        .file_id_create_fn = skel_file_id_create,
        .fs_file_id_fn = skel_fs_file_id,
index 012a47e7ff7f44dda5fddf3f95418422a04a1984..aa2801054b2d879ce0fba1521cfa3108e92fb8be 100644 (file)
@@ -1067,9 +1067,6 @@ struct vfs_fn_pointers {
        struct smb_filename *(*realpath_fn)(struct vfs_handle_struct *handle,
                                TALLOC_CTX *ctx,
                                const struct smb_filename *smb_fname);
-       int (*chflags_fn)(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               unsigned int flags);
        int (*fchflags_fn)(struct vfs_handle_struct *handle,
                                struct files_struct *fsp,
                                unsigned int flags);
index be594166f04e6bc8d8e26dcc620a411e466c2bcb..0c7ce1c5d61878029f9af3f5cbb1dd77564264f7 100644 (file)
 #define SMB_VFS_NEXT_REALPATH(handle, ctx, smb_fname) \
        smb_vfs_call_realpath((handle)->next, (ctx), (smb_fname))
 
-#define SMB_VFS_CHFLAGS(conn, smb_fname, flags) \
-       smb_vfs_call_chflags((conn)->vfs_handles, (smb_fname), (flags))
-#define SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags) \
-       smb_vfs_call_chflags((handle)->next, (smb_fname), (flags))
-
 #define SMB_VFS_FCHFLAGS(fsp, flags) \
        smb_vfs_call_fchflags((fsp)->conn->vfs_handles, (fsp), (flags))
 #define SMB_VFS_NEXT_FCHFLAGS(handle, fsp, flags) \
index f1f84aeaa35d3fd8a0fbbffb68cb5b84323b9261..648950bf73099aad55e2b03bdcb4aaab6ee44080 100644 (file)
@@ -3065,18 +3065,6 @@ static struct smb_filename *vfswrap_realpath(vfs_handle_struct *handle,
        return result_fname;
 }
 
-static int vfswrap_chflags(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       unsigned int flags)
-{
-#ifdef HAVE_CHFLAGS
-       return chflags(smb_fname->base_name, flags);
-#else
-       errno = ENOSYS;
-       return -1;
-#endif
-}
-
 static int vfswrap_fchflags(vfs_handle_struct *handle,
                        struct files_struct *fsp,
                        unsigned int flags)
@@ -3880,7 +3868,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .linkat_fn = vfswrap_linkat,
        .mknodat_fn = vfswrap_mknodat,
        .realpath_fn = vfswrap_realpath,
-       .chflags_fn = vfswrap_chflags,
        .fchflags_fn = vfswrap_fchflags,
        .file_id_create_fn = vfswrap_file_id_create,
        .fs_file_id_fn = vfswrap_fs_file_id,
index d9c387a89631911d85602938b5c8238200c7f121..1c11737964ea7ff1be2a3a921596c816acc43d9e 100644 (file)
@@ -160,7 +160,6 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_LINKAT,
        SMB_VFS_OP_MKNODAT,
        SMB_VFS_OP_REALPATH,
-       SMB_VFS_OP_CHFLAGS,
        SMB_VFS_OP_FCHFLAGS,
        SMB_VFS_OP_FILE_ID_CREATE,
        SMB_VFS_OP_FS_FILE_ID,
@@ -298,7 +297,6 @@ static struct {
        { SMB_VFS_OP_LINKAT,    "linkat" },
        { SMB_VFS_OP_MKNODAT,   "mknodat" },
        { SMB_VFS_OP_REALPATH,  "realpath" },
-       { SMB_VFS_OP_CHFLAGS,   "chflags" },
        { SMB_VFS_OP_FCHFLAGS,  "fchflags" },
        { SMB_VFS_OP_FILE_ID_CREATE,    "file_id_create" },
        { SMB_VFS_OP_FS_FILE_ID,        "fs_file_id" },
@@ -1983,23 +1981,6 @@ static struct smb_filename *smb_full_audit_realpath(vfs_handle_struct *handle,
        return result_fname;
 }
 
-static int smb_full_audit_chflags(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       unsigned int flags)
-{
-       int result;
-
-       result = SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags);
-
-       do_log(SMB_VFS_OP_CHFLAGS,
-              (result != 0),
-              handle,
-              "%s",
-              smb_fname_str_do_log(handle->conn, smb_fname));
-
-       return result;
-}
-
 static int smb_full_audit_fchflags(vfs_handle_struct *handle,
                        struct files_struct *fsp,
                        unsigned int flags)
@@ -2977,7 +2958,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .linkat_fn = smb_full_audit_linkat,
        .mknodat_fn = smb_full_audit_mknodat,
        .realpath_fn = smb_full_audit_realpath,
-       .chflags_fn = smb_full_audit_chflags,
        .fchflags_fn = smb_full_audit_fchflags,
        .file_id_create_fn = smb_full_audit_file_id_create,
        .fs_file_id_fn = smb_full_audit_fs_file_id,
index e616a56b017398c78433ac56793d5677b3fcff0c..8e1d9af3870c20bb299c4b45dbd7ea6804d601e0 100644 (file)
@@ -504,14 +504,6 @@ struct smb_filename *vfs_not_implemented_realpath(vfs_handle_struct *handle,
        return NULL;
 }
 
-int vfs_not_implemented_chflags(vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               uint flags)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 int vfs_not_implemented_fchflags(vfs_handle_struct *handle,
                                struct files_struct *fsp,
                                uint flags)
@@ -1040,7 +1032,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .linkat_fn = vfs_not_implemented_linkat,
        .mknodat_fn = vfs_not_implemented_mknodat,
        .realpath_fn = vfs_not_implemented_realpath,
-       .chflags_fn = vfs_not_implemented_chflags,
        .fchflags_fn = vfs_not_implemented_fchflags,
        .file_id_create_fn = vfs_not_implemented_file_id_create,
        .fs_file_id_fn = vfs_not_implemented_fs_file_id,
index efc9133250a459f6b4786c02c2cd55990d4ff107..aef3ad6db7cda6552caa759f5bfe06e1f857bf3f 100644 (file)
@@ -1595,26 +1595,6 @@ static struct smb_filename *smb_time_audit_realpath(vfs_handle_struct *handle,
        return result_fname;
 }
 
-static int smb_time_audit_chflags(vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               unsigned int flags)
-{
-       int result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_smb_fname("chflags", timediff, smb_fname);
-       }
-
-       return result;
-}
-
 static int smb_time_audit_fchflags(vfs_handle_struct *handle,
                                struct files_struct *fsp,
                                unsigned int flags)
@@ -2787,7 +2767,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .linkat_fn = smb_time_audit_linkat,
        .mknodat_fn = smb_time_audit_mknodat,
        .realpath_fn = smb_time_audit_realpath,
-       .chflags_fn = smb_time_audit_chflags,
        .fchflags_fn = smb_time_audit_fchflags,
        .file_id_create_fn = smb_time_audit_file_id_create,
        .fs_file_id_fn = smb_time_audit_fs_file_id,
index 8a9a858400f3d1168890a13c32f2fab2325c7177..eafe3cca24297bb9fdd20188f5d8d06c80f24853 100644 (file)
@@ -2378,14 +2378,6 @@ struct smb_filename *smb_vfs_call_realpath(struct vfs_handle_struct *handle,
        return handle->fns->realpath_fn(handle, ctx, smb_fname);
 }
 
-int smb_vfs_call_chflags(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       unsigned int flags)
-{
-       VFS_FIND(chflags);
-       return handle->fns->chflags_fn(handle, smb_fname, flags);
-}
-
 int smb_vfs_call_fchflags(struct vfs_handle_struct *handle,
                        struct files_struct *fsp,
                        unsigned int flags)