s3: VFS: Remove SMB_VFS_STREAMINFO(), no longer used
authorNoel Power <noel.power@suse.com>
Wed, 28 Apr 2021 16:55:35 +0000 (17:55 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 11 May 2021 15:49:28 +0000 (15:49 +0000)
                   ---------------
                  /               \
                 /      REST       \
                /        IN         \
               /        PEACE        \
              /                       \
              |                       |
              |   SMB_VFS_STREAMINFO  |
              |                       |
              |                       |
              |       28 April        |
              |         2021          |
              |                       |
              |                       |
             *|     *  *  *           | *
    _________)/\\_//(\/(/\)/\//\/\////|_)_______

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/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 ce3672c752fe98a180517d83bc995b2c1f84275b..256ab2a5e415c1d3e1043a34c2cd4ffb282cff0a 100644 (file)
@@ -628,16 +628,6 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
        return NT_STATUS_INVALID_DEVICE_REQUEST;
 }
 
-static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
-                               struct files_struct *fsp,
-                               const struct smb_filename *smb_fname,
-                               TALLOC_CTX *mem_ctx,
-                               unsigned int *num_streams,
-                               struct stream_struct **streams)
-{
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
 static NTSTATUS skel_fstreaminfo(struct vfs_handle_struct *handle,
                                 struct files_struct *fsp,
                                 TALLOC_CTX *mem_ctx,
@@ -1066,7 +1056,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .fget_compression_fn = skel_fget_compression,
        .set_compression_fn = skel_set_compression,
 
-       .streaminfo_fn = skel_streaminfo,
        .fstreaminfo_fn = skel_fstreaminfo,
        .get_real_filename_fn = skel_get_real_filename,
        .connectpath_fn = skel_connectpath,
index 02b3c75969f6e8fb77161aa38d2598650f65db5d..dfb324d52a3b252c9d624bdb80ca70394a59e0ba 100644 (file)
@@ -840,21 +840,6 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
                                            compression_fmt);
 }
 
-static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
-                               struct files_struct *fsp,
-                               const struct smb_filename *smb_fname,
-                               TALLOC_CTX *mem_ctx,
-                               unsigned int *num_streams,
-                               struct stream_struct **streams)
-{
-       return SMB_VFS_NEXT_STREAMINFO(handle,
-                               fsp,
-                               smb_fname,
-                               mem_ctx,
-                               num_streams,
-                               streams);
-}
-
 static NTSTATUS skel_fstreaminfo(struct vfs_handle_struct *handle,
                                 struct files_struct *fsp,
                                 TALLOC_CTX *mem_ctx,
@@ -1376,7 +1361,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .fget_compression_fn = skel_fget_compression,
        .set_compression_fn = skel_set_compression,
 
-       .streaminfo_fn = skel_streaminfo,
        .fstreaminfo_fn = skel_fstreaminfo,
        .get_real_filename_fn = skel_get_real_filename,
        .connectpath_fn = skel_connectpath,
index dfba1cf7608dbb0e50f53353256443c557c101bb..1af6bdec1fe7e9ca3f985925ee09701b86541a78 100644 (file)
@@ -1113,13 +1113,6 @@ struct vfs_fn_pointers {
                                   char *base_path,
                                   char *snap_path);
 
-       NTSTATUS (*streaminfo_fn)(struct vfs_handle_struct *handle,
-                                 struct files_struct *fsp,
-                                 const struct smb_filename *smb_fname,
-                                 TALLOC_CTX *mem_ctx,
-                                 unsigned int *num_streams,
-                                 struct stream_struct **streams);
-
        NTSTATUS (*fstreaminfo_fn)(struct vfs_handle_struct *handle,
                                   struct files_struct *fsp,
                                   TALLOC_CTX *mem_ctx,
@@ -1593,12 +1586,6 @@ struct file_id smb_vfs_call_file_id_create(struct vfs_handle_struct *handle,
                                           const SMB_STRUCT_STAT *sbuf);
 uint64_t smb_vfs_call_fs_file_id(struct vfs_handle_struct *handle,
                                 const SMB_STRUCT_STAT *sbuf);
-NTSTATUS smb_vfs_call_streaminfo(struct vfs_handle_struct *handle,
-                                struct files_struct *fsp,
-                                const struct smb_filename *smb_fname,
-                                TALLOC_CTX *mem_ctx,
-                                unsigned int *num_streams,
-                                struct stream_struct **streams);
 NTSTATUS smb_vfs_call_fstreaminfo(struct vfs_handle_struct *handle,
                                  struct files_struct *fsp,
                                  TALLOC_CTX *mem_ctx,
@@ -2059,12 +2046,6 @@ NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle,
                                             TALLOC_CTX *mem_ctx,
                                             struct files_struct *fsp,
                                             uint16_t compression_fmt);
-NTSTATUS vfs_not_implemented_streaminfo(struct vfs_handle_struct *handle,
-                                       struct files_struct *fsp,
-                                       const struct smb_filename *smb_fname,
-                                       TALLOC_CTX *mem_ctx,
-                                       unsigned int *num_streams,
-                                       struct stream_struct **streams);
 NTSTATUS vfs_not_implemented_fstreaminfo(struct vfs_handle_struct *handle,
                                         struct files_struct *fsp,
                                         TALLOC_CTX *mem_ctx,
index a5fee959dc822119a13f076aeee0133416406c5d..27b38f508167d31ec21a4c6fd522284f3c9b2500 100644 (file)
@@ -3021,66 +3021,6 @@ static uint64_t vfswrap_fs_file_id(struct vfs_handle_struct *handle,
        return file_id;
 }
 
-static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
-                                  struct files_struct *fsp,
-                                  const struct smb_filename *smb_fname,
-                                  TALLOC_CTX *mem_ctx,
-                                  unsigned int *pnum_streams,
-                                  struct stream_struct **pstreams)
-{
-       SMB_STRUCT_STAT sbuf;
-       struct stream_struct *tmp_streams = NULL;
-       int ret;
-
-       if ((fsp != NULL) && (fsp->fsp_flags.is_directory)) {
-               /*
-                * No default streams on directories
-                */
-               goto done;
-       }
-
-       if ((fsp != NULL) && (fsp_get_pathref_fd(fsp) != -1)) {
-               ret = SMB_VFS_FSTAT(fsp, &sbuf);
-       }
-       else {
-               struct smb_filename *smb_fname_cp = NULL;
-
-               smb_fname_cp = cp_smb_filename_nostream(talloc_tos(), smb_fname);
-               if (smb_fname_cp == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-               }
-
-               ret = vfs_stat(handle->conn, smb_fname_cp);
-               sbuf = smb_fname_cp->st;
-               TALLOC_FREE(smb_fname_cp);
-       }
-
-       if (ret == -1) {
-               return map_nt_error_from_unix(errno);
-       }
-
-       if (S_ISDIR(sbuf.st_ex_mode)) {
-               goto done;
-       }
-
-       tmp_streams = talloc_realloc(mem_ctx, *pstreams, struct stream_struct,
-                                       (*pnum_streams) + 1);
-       if (tmp_streams == NULL) {
-               return NT_STATUS_NO_MEMORY;
-       }
-       tmp_streams[*pnum_streams].name = talloc_strdup(tmp_streams, "::$DATA");
-       if (tmp_streams[*pnum_streams].name == NULL) {
-               return NT_STATUS_NO_MEMORY;
-       }
-       tmp_streams[*pnum_streams].size = sbuf.st_ex_size;
-       tmp_streams[*pnum_streams].alloc_size = SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp, &sbuf);
-
-       *pnum_streams += 1;
-       *pstreams = tmp_streams;
- done:
-       return NT_STATUS_OK;
-}
-
 static NTSTATUS vfswrap_fstreaminfo(vfs_handle_struct *handle,
                                   struct files_struct *fsp,
                                   TALLOC_CTX *mem_ctx,
@@ -3878,7 +3818,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .chflags_fn = vfswrap_chflags,
        .file_id_create_fn = vfswrap_file_id_create,
        .fs_file_id_fn = vfswrap_fs_file_id,
-       .streaminfo_fn = vfswrap_streaminfo,
        .fstreaminfo_fn = vfswrap_fstreaminfo,
        .get_real_filename_fn = vfswrap_get_real_filename,
        .connectpath_fn = vfswrap_connectpath,
index f52a519e68d08e3ed2cace92ecb73e1dcb4ece36..f1ded4fff04686db011cec353404a63b0dea3d2e 100644 (file)
@@ -163,7 +163,6 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_CHFLAGS,
        SMB_VFS_OP_FILE_ID_CREATE,
        SMB_VFS_OP_FS_FILE_ID,
-       SMB_VFS_OP_STREAMINFO,
        SMB_VFS_OP_FSTREAMINFO,
        SMB_VFS_OP_GET_REAL_FILENAME,
        SMB_VFS_OP_CONNECTPATH,
@@ -303,7 +302,6 @@ static struct {
        { SMB_VFS_OP_CHFLAGS,   "chflags" },
        { SMB_VFS_OP_FILE_ID_CREATE,    "file_id_create" },
        { SMB_VFS_OP_FS_FILE_ID,        "fs_file_id" },
-       { SMB_VFS_OP_STREAMINFO,        "streaminfo" },
        { SMB_VFS_OP_FSTREAMINFO,       "fstreaminfo" },
        { SMB_VFS_OP_GET_REAL_FILENAME, "get_real_filename" },
        { SMB_VFS_OP_CONNECTPATH,       "connectpath" },
@@ -2007,26 +2005,6 @@ static uint64_t smb_full_audit_fs_file_id(struct vfs_handle_struct *handle,
 
        return result;
 }
-static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle,
-                                         struct files_struct *fsp,
-                                         const struct smb_filename *smb_fname,
-                                         TALLOC_CTX *mem_ctx,
-                                         unsigned int *pnum_streams,
-                                         struct stream_struct **pstreams)
-{
-       NTSTATUS result;
-
-       result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
-                                        pnum_streams, pstreams);
-
-       do_log(SMB_VFS_OP_STREAMINFO,
-              NT_STATUS_IS_OK(result),
-              handle,
-              "%s",
-              smb_fname_str_do_log(handle->conn, smb_fname));
-
-       return result;
-}
 
 static NTSTATUS smb_full_audit_fstreaminfo(vfs_handle_struct *handle,
                                           struct files_struct *fsp,
@@ -3002,7 +2980,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .snap_check_path_fn =  smb_full_audit_snap_check_path,
        .snap_create_fn = smb_full_audit_snap_create,
        .snap_delete_fn = smb_full_audit_snap_delete,
-       .streaminfo_fn = smb_full_audit_streaminfo,
        .fstreaminfo_fn = smb_full_audit_fstreaminfo,
        .get_real_filename_fn = smb_full_audit_get_real_filename,
        .connectpath_fn = smb_full_audit_connectpath,
index 230ae35ca05297e5b5e24039bfaa6d952edd7d77..c4722c3687d969c31afd31e25da73762dc67c2e3 100644 (file)
@@ -630,16 +630,6 @@ NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle,
        return NT_STATUS_INVALID_DEVICE_REQUEST;
 }
 
-NTSTATUS vfs_not_implemented_streaminfo(struct vfs_handle_struct *handle,
-                                       struct files_struct *fsp,
-                                       const struct smb_filename *smb_fname,
-                                       TALLOC_CTX *mem_ctx,
-                                       unsigned int *num_streams,
-                                       struct stream_struct **streams)
-{
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
 NTSTATUS vfs_not_implemented_fstreaminfo(struct vfs_handle_struct *handle,
                                        struct files_struct *fsp,
                                        TALLOC_CTX *mem_ctx,
@@ -1070,7 +1060,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .fget_compression_fn = vfs_not_implemented_fget_compression,
        .set_compression_fn = vfs_not_implemented_set_compression,
 
-       .streaminfo_fn = vfs_not_implemented_streaminfo,
        .fstreaminfo_fn = vfs_not_implemented_fstreaminfo,
        .get_real_filename_fn = vfs_not_implemented_get_real_filename,
        .connectpath_fn = vfs_not_implemented_connectpath,
index c2bf905a152dc31ffcd63ecc4e53a6c326936734..7cd9bf0ae25a6d345a962f33fdc1184fa26720c6 100644 (file)
@@ -1645,30 +1645,6 @@ static uint64_t smb_time_audit_fs_file_id(struct vfs_handle_struct *handle,
        return result;
 }
 
-static NTSTATUS smb_time_audit_streaminfo(vfs_handle_struct *handle,
-                                         struct files_struct *fsp,
-                                         const struct smb_filename *smb_fname,
-                                         TALLOC_CTX *mem_ctx,
-                                         unsigned int *pnum_streams,
-                                         struct stream_struct **pstreams)
-{
-       NTSTATUS result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
-                                        pnum_streams, pstreams);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_fsp("streaminfo", timediff, fsp);
-       }
-
-       return result;
-}
-
 static NTSTATUS smb_time_audit_fstreaminfo(vfs_handle_struct *handle,
                                          struct files_struct *fsp,
                                          TALLOC_CTX *mem_ctx,
@@ -2839,7 +2815,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .snap_check_path_fn = smb_time_audit_snap_check_path,
        .snap_create_fn = smb_time_audit_snap_create,
        .snap_delete_fn = smb_time_audit_snap_delete,
-       .streaminfo_fn = smb_time_audit_streaminfo,
        .fstreaminfo_fn = smb_time_audit_fstreaminfo,
        .get_real_filename_fn = smb_time_audit_get_real_filename,
        .connectpath_fn = smb_time_audit_connectpath,
index 55a993feb4fdb2058728520836713a9a5fcb8500..7b91499dc2cfd91f7293cf034f3cf9b363a7386c 100644 (file)
@@ -2401,18 +2401,6 @@ uint64_t smb_vfs_call_fs_file_id(struct vfs_handle_struct *handle,
        return handle->fns->fs_file_id_fn(handle, sbuf);
 }
 
-NTSTATUS smb_vfs_call_streaminfo(struct vfs_handle_struct *handle,
-                                struct files_struct *fsp,
-                                const struct smb_filename *smb_fname,
-                                TALLOC_CTX *mem_ctx,
-                                unsigned int *num_streams,
-                                struct stream_struct **streams)
-{
-       VFS_FIND(streaminfo);
-       return handle->fns->streaminfo_fn(handle, fsp, smb_fname, mem_ctx,
-                                         num_streams, streams);
-}
-
 NTSTATUS smb_vfs_call_fstreaminfo(struct vfs_handle_struct *handle,
                                 struct files_struct *fsp,
                                 TALLOC_CTX *mem_ctx,