vfs: SMB_VFS_GET_COMPRESSION() -> SMB_VFS_FGET_COMPRESSION()
authorRalph Boehme <slow@samba.org>
Tue, 13 Oct 2020 10:02:34 +0000 (12:02 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:32 +0000 (09:08 +0000)
Now that handle based fdos_mode() is used everywhere we can be sure that we're
also always getting a handle in SMB_VFS_GET_COMPRESSION() so we can now safely
remove the path parameter. :)

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
14 files changed:
docs-xml/manpages/vfs_full_audit.8.xml
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_btrfs.c
source3/modules/vfs_catia.c
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/dosmode.c
source3/smbd/smb2_ioctl_filesys.c
source3/smbd/vfs.c

index 674b032017d686e782abe0d3ede3ff78b65c297d..d4fbdb4f02e2b20348ec8d699955aa4125d5973f 100644 (file)
@@ -60,6 +60,7 @@
         <member>fchmod</member>
         <member>fchown</member>
         <member>fdopendir</member>
+        <member>fget_compression</member>
         <member>fget_dos_attributes</member>
         <member>fget_nt_acl_at</member>
         <member>fgetxattr</member>
@@ -78,7 +79,6 @@
         <member>fsync_send</member>
         <member>ftruncate</member>
         <member>get_alloc_size</member>
-        <member>get_compression</member>
         <member>get_dfs_referrals</member>
         <member>get_dos_attributes</member>
         <member>get_dos_attributes_recv</member>
index fd7da962ceb06dda94098995a6f615dcb202437b..881a7fdaf1c12f4f1c364e6f4855c5b172ef172a 100644 (file)
@@ -620,10 +620,9 @@ static NTSTATUS skel_offload_write_recv(struct vfs_handle_struct *handle,
        return NT_STATUS_OK;
 }
 
-static NTSTATUS skel_get_compression(struct vfs_handle_struct *handle,
+static NTSTATUS skel_fget_compression(struct vfs_handle_struct *handle,
                                     TALLOC_CTX *mem_ctx,
                                     struct files_struct *fsp,
-                                    struct smb_filename *smb_fname,
                                     uint16_t *_compression_fmt)
 {
        return NT_STATUS_INVALID_DEVICE_REQUEST;
@@ -1106,7 +1105,7 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .offload_read_recv_fn = skel_offload_read_recv,
        .offload_write_send_fn = skel_offload_write_send,
        .offload_write_recv_fn = skel_offload_write_recv,
-       .get_compression_fn = skel_get_compression,
+       .fget_compression_fn = skel_fget_compression,
        .set_compression_fn = skel_set_compression,
 
        .streaminfo_fn = skel_streaminfo,
index b83a67f3a7fbb237f625d4ee7c59e6e0c70e729e..2680b4f328593023ae543d5b0862d625689f98ec 100644 (file)
@@ -829,13 +829,12 @@ static NTSTATUS skel_offload_write_recv(struct vfs_handle_struct *handle,
        return NT_STATUS_OK;
 }
 
-static NTSTATUS skel_get_compression(struct vfs_handle_struct *handle,
+static NTSTATUS skel_fget_compression(struct vfs_handle_struct *handle,
                                     TALLOC_CTX *mem_ctx,
                                     struct files_struct *fsp,
-                                    struct smb_filename *smb_fname,
                                     uint16_t *_compression_fmt)
 {
-       return SMB_VFS_NEXT_GET_COMPRESSION(handle, mem_ctx, fsp, smb_fname,
+       return SMB_VFS_NEXT_FGET_COMPRESSION(handle, mem_ctx, fsp,
                                            _compression_fmt);
 }
 
@@ -1411,7 +1410,7 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .offload_read_recv_fn = skel_offload_read_recv,
        .offload_write_send_fn = skel_offload_write_send,
        .offload_write_recv_fn = skel_offload_write_recv,
-       .get_compression_fn = skel_get_compression,
+       .fget_compression_fn = skel_fget_compression,
        .set_compression_fn = skel_set_compression,
 
        .streaminfo_fn = skel_streaminfo,
index 7e06705e04b21ad5bd317953bba0d281205bbe33..1a5d71e840182057511fe03684926398affdafe4 100644 (file)
  * Version 44 - Add 'have_proc_fds' flag to struct files_struct.
  * Version 44 - Add dirfsp arg to SMB_VFS_READDIR()
  * Version 44 - Remove SMB_VFS_GET_DOS_ATTRIBUTES()
+ * Version 44 - Replace SMB_VFS_GET_COMPRESSION() with SMB_VFS_FGET_COMPRESSION()
  */
 
 #define SMB_VFS_INTERFACE_VERSION 44
@@ -1080,10 +1081,9 @@ struct vfs_fn_pointers {
        NTSTATUS (*offload_write_recv_fn)(struct vfs_handle_struct *handle,
                                          struct tevent_req *req,
                                          off_t *copied);
-       NTSTATUS (*get_compression_fn)(struct vfs_handle_struct *handle,
+       NTSTATUS (*fget_compression_fn)(struct vfs_handle_struct *handle,
                                       TALLOC_CTX *mem_ctx,
                                       struct files_struct *fsp,
-                                      struct smb_filename *smb_fname,
                                       uint16_t *_compression_fmt);
        NTSTATUS (*set_compression_fn)(struct vfs_handle_struct *handle,
                                       TALLOC_CTX *mem_ctx,
@@ -1678,10 +1678,9 @@ struct tevent_req *smb_vfs_call_offload_write_send(struct vfs_handle_struct *han
 NTSTATUS smb_vfs_call_offload_write_recv(struct vfs_handle_struct *handle,
                                         struct tevent_req *req,
                                         off_t *copied);
-NTSTATUS smb_vfs_call_get_compression(struct vfs_handle_struct *handle,
+NTSTATUS smb_vfs_call_fget_compression(struct vfs_handle_struct *handle,
                                      TALLOC_CTX *mem_ctx,
                                      struct files_struct *fsp,
-                                     struct smb_filename *smb_fname,
                                      uint16_t *_compression_fmt);
 NTSTATUS smb_vfs_call_set_compression(struct vfs_handle_struct *handle,
                                      TALLOC_CTX *mem_ctx,
@@ -2068,10 +2067,9 @@ struct tevent_req *vfs_not_implemented_offload_write_send(
 NTSTATUS vfs_not_implemented_offload_write_recv(struct vfs_handle_struct *handle,
                                                struct tevent_req *req,
                                                off_t *copied);
-NTSTATUS vfs_not_implemented_get_compression(struct vfs_handle_struct *handle,
+NTSTATUS vfs_not_implemented_fget_compression(struct vfs_handle_struct *handle,
                                             TALLOC_CTX *mem_ctx,
                                             struct files_struct *fsp,
-                                            struct smb_filename *smb_fname,
                                             uint16_t *_compression_fmt);
 NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle,
                                             TALLOC_CTX *mem_ctx,
index 058a678f6d9925611f7707184d9e147dd829df86..80720ad16cdac0003aceb0703558632092a58c92 100644 (file)
 #define SMB_VFS_NEXT_OFFLOAD_WRITE_RECV(handle, req, copied) \
        smb_vfs_call_offload_write_recv((handle)->next, (req), (copied))
 
-#define SMB_VFS_GET_COMPRESSION(conn, mem_ctx, fsp, smb_fname, _compression_fmt)               \
-       smb_vfs_call_get_compression((conn)->vfs_handles, (mem_ctx), (fsp), (smb_fname), (_compression_fmt))
-#define SMB_VFS_NEXT_GET_COMPRESSION(handle, mem_ctx, fsp, smb_fname, _compression_fmt)                \
-       smb_vfs_call_get_compression((handle)->next, (mem_ctx), (fsp), (smb_fname), (_compression_fmt))
+#define SMB_VFS_FGET_COMPRESSION(conn, mem_ctx, fsp, _compression_fmt)         \
+       smb_vfs_call_fget_compression((conn)->vfs_handles, (mem_ctx), (fsp), (_compression_fmt))
+#define SMB_VFS_NEXT_FGET_COMPRESSION(handle, mem_ctx, fsp, _compression_fmt)          \
+       smb_vfs_call_fget_compression((handle)->next, (mem_ctx), (fsp), (_compression_fmt))
 
 #define SMB_VFS_SET_COMPRESSION(conn, mem_ctx, fsp, compression_fmt)           \
        smb_vfs_call_set_compression((conn)->vfs_handles, (mem_ctx), (fsp), (compression_fmt))
index 8263e2768a6d870344dfec13fdf778321a151501..789bc6d6e8a10ace88ce213ab002250132abfb8a 100644 (file)
@@ -451,46 +451,48 @@ static NTSTATUS btrfs_offload_write_recv(struct vfs_handle_struct *handle,
        return NT_STATUS_OK;
 }
 
-/*
- * caller must pass a non-null fsp or smb_fname. If fsp is null, then
- * fall back to opening the corresponding file to issue the ioctl.
- */
-static NTSTATUS btrfs_get_compression(struct vfs_handle_struct *handle,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct files_struct *fsp,
-                                     struct smb_filename *smb_fname,
-                                     uint16_t *_compression_fmt)
+static NTSTATUS btrfs_fget_compression(struct vfs_handle_struct *handle,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct files_struct *fsp,
+                                      uint16_t *_compression_fmt)
 {
+       char buf[PATH_MAX];
+       const char *p = NULL;
        int ret;
        long flags = 0;
-       int fd;
-       bool opened = false;
+       int fd = -1;
        NTSTATUS status;
-       DIR *dir = NULL;
-
-       if ((fsp != NULL) && (fsp_get_io_fd(fsp) != -1)) {
-               fd = fsp_get_io_fd(fsp);
-       } else if (smb_fname != NULL) {
-               if (S_ISDIR(smb_fname->st.st_ex_mode)) {
-                       dir = opendir(smb_fname->base_name);
-                       if (dir == NULL) {
-                               return NT_STATUS_UNSUCCESSFUL;
-                       }
-                       opened = true;
-                       fd = dirfd(dir);
-                       if (fd < 0) {
-                               status = NT_STATUS_UNSUCCESSFUL;
-                               goto err_close;
-                       }
+
+       if (!fsp->fsp_flags.is_pathref) {
+               ret = ioctl(fd, FS_IOC_GETFLAGS, &flags);
+               if (ret < 0) {
+                       DBG_WARNING("FS_IOC_GETFLAGS failed: %s, fd %lld\n",
+                                   strerror(errno), (long long)fd);
+                       return map_nt_error_from_unix(errno);
+               }
+               if (flags & FS_COMPR_FL) {
+                       *_compression_fmt = COMPRESSION_FORMAT_LZNT1;
                } else {
-                       fd = open(smb_fname->base_name, O_RDONLY);
-                       if (fd < 0) {
-                               return NT_STATUS_UNSUCCESSFUL;
-                       }
-                       opened = true;
+                       *_compression_fmt = COMPRESSION_FORMAT_NONE;
                }
-       } else {
-               return NT_STATUS_INVALID_PARAMETER;
+               return NT_STATUS_OK;
+       }
+
+       if (!fsp->fsp_flags.have_proc_fds) {
+               return NT_STATUS_NOT_IMPLEMENTED;
+       }
+
+       fd = fsp_get_pathref_fd(fsp);
+
+       p = sys_proc_fd_path(fd, buf, sizeof(buf));
+       if (p == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       fd = open(p, O_RDONLY);
+       if (fd == -1) {
+               DBG_ERR("/proc open of %s failed: %s\n", p, strerror(errno));
+               return map_nt_error_from_unix(errno);
        }
 
        ret = ioctl(fd, FS_IOC_GETFLAGS, &flags);
@@ -506,13 +508,10 @@ static NTSTATUS btrfs_get_compression(struct vfs_handle_struct *handle,
                *_compression_fmt = COMPRESSION_FORMAT_NONE;
        }
        status = NT_STATUS_OK;
+
 err_close:
-       if (opened) {
-               if (dir != NULL) {
-                       closedir(dir);
-               } else {
-                       close(fd);
-               }
+       if (fd != -1) {
+               close(fd);
        }
 
        return status;
@@ -868,7 +867,7 @@ static struct vfs_fn_pointers btrfs_fns = {
        .offload_read_recv_fn = btrfs_offload_read_recv,
        .offload_write_send_fn = btrfs_offload_write_send,
        .offload_write_recv_fn = btrfs_offload_write_recv,
-       .get_compression_fn = btrfs_get_compression,
+       .fget_compression_fn = btrfs_fget_compression,
        .set_compression_fn = btrfs_set_compression,
        .snap_check_path_fn = btrfs_snap_check_path,
        .snap_create_fn = btrfs_snap_create,
index 51beb6b424d8fcf62e1a70ae553373c9019e6a8f..21ea24000ac4ac08dc4358d76ae84fdc4708f3e2 100644 (file)
@@ -2190,58 +2190,26 @@ static NTSTATUS catia_fsctl(struct vfs_handle_struct *handle,
        return result;
 }
 
-static NTSTATUS catia_get_compression(vfs_handle_struct *handle,
+static NTSTATUS catia_fget_compression(vfs_handle_struct *handle,
                                      TALLOC_CTX *mem_ctx,
                                      struct files_struct *fsp,
-                                     struct smb_filename *smb_fname,
                                      uint16_t *_compression_fmt)
 {
        NTSTATUS result;
        struct catia_cache *cc = NULL;
        int ret;
-       struct smb_filename *mapped_smb_fname = NULL;
-       char *mapped_name = NULL;
-
-       if (fsp != NULL) {
-               ret = CATIA_FETCH_FSP_PRE_NEXT(talloc_tos(), handle, fsp, &cc);
-               if (ret != 0) {
-                       return map_nt_error_from_unix(errno);
-               }
-               mapped_smb_fname = fsp->fsp_name;
-       } else {
-               result = catia_string_replace_allocate(handle->conn,
-                               smb_fname->base_name,
-                               &mapped_name,
-                               vfs_translate_to_unix);
-               if (!NT_STATUS_IS_OK(result)) {
-                       return result;
-               }
-
-               mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
-                                               mapped_name,
-                                               NULL,
-                                               &smb_fname->st,
-                                               smb_fname->twrp,
-                                               smb_fname->flags);
-               if (mapped_smb_fname == NULL) {
-                       TALLOC_FREE(mapped_name);
-                       return NT_STATUS_NO_MEMORY;
-               }
 
-               TALLOC_FREE(mapped_name);
+       ret = CATIA_FETCH_FSP_PRE_NEXT(talloc_tos(), handle, fsp, &cc);
+       if (ret != 0) {
+               return map_nt_error_from_unix(errno);
        }
 
-       result = SMB_VFS_NEXT_GET_COMPRESSION(handle,
+       result = SMB_VFS_NEXT_FGET_COMPRESSION(handle,
                                        mem_ctx,
                                        fsp,
-                                       mapped_smb_fname,
                                        _compression_fmt);
 
-       if (fsp != NULL) {
-               CATIA_FETCH_FSP_POST_NEXT(&cc, fsp);
-       } else {
-               TALLOC_FREE(mapped_smb_fname);
-       }
+       CATIA_FETCH_FSP_POST_NEXT(&cc, fsp);
 
        return result;
 }
@@ -2468,7 +2436,7 @@ static struct vfs_fn_pointers vfs_catia_fns = {
        .set_dos_attributes_fn = catia_set_dos_attributes,
        .fset_dos_attributes_fn = catia_fset_dos_attributes,
        .fget_dos_attributes_fn = catia_fget_dos_attributes,
-       .get_compression_fn = catia_get_compression,
+       .fget_compression_fn = catia_fget_compression,
        .set_compression_fn = catia_set_compression,
        .create_dfs_pathat_fn = catia_create_dfs_pathat,
        .read_dfs_pathat_fn = catia_read_dfs_pathat,
index 7ea0868d88b283acff96540c55f16a1166914529..9157355dfdb7e6f42b8d8e2a7f2218c644f2b9c1 100644 (file)
@@ -2337,10 +2337,9 @@ static NTSTATUS vfswrap_offload_write_recv(struct vfs_handle_struct *handle,
        return NT_STATUS_OK;
 }
 
-static NTSTATUS vfswrap_get_compression(struct vfs_handle_struct *handle,
+static NTSTATUS vfswrap_fget_compression(struct vfs_handle_struct *handle,
                                        TALLOC_CTX *mem_ctx,
                                        struct files_struct *fsp,
-                                       struct smb_filename *smb_fname,
                                        uint16_t *_compression_fmt)
 {
        return NT_STATUS_INVALID_DEVICE_REQUEST;
@@ -3863,7 +3862,7 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .offload_read_recv_fn = vfswrap_offload_read_recv,
        .offload_write_send_fn = vfswrap_offload_write_send,
        .offload_write_recv_fn = vfswrap_offload_write_recv,
-       .get_compression_fn = vfswrap_get_compression,
+       .fget_compression_fn = vfswrap_fget_compression,
        .set_compression_fn = vfswrap_set_compression,
 
        /* NT ACL operations. */
index 2988b9aed4703c8d1f0e80ad542fde33c8d250f6..39fcdfc59daf36f7500c947536402196408f9036 100644 (file)
@@ -175,7 +175,7 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_OFFLOAD_READ_RECV,
        SMB_VFS_OP_OFFLOAD_WRITE_SEND,
        SMB_VFS_OP_OFFLOAD_WRITE_RECV,
-       SMB_VFS_OP_GET_COMPRESSION,
+       SMB_VFS_OP_FGET_COMPRESSION,
        SMB_VFS_OP_SET_COMPRESSION,
        SMB_VFS_OP_SNAP_CHECK_PATH,
        SMB_VFS_OP_SNAP_CREATE,
@@ -318,7 +318,7 @@ static struct {
        { SMB_VFS_OP_OFFLOAD_READ_RECV, "offload_read_recv" },
        { SMB_VFS_OP_OFFLOAD_WRITE_SEND,        "offload_write_send" },
        { SMB_VFS_OP_OFFLOAD_WRITE_RECV,        "offload_write_recv" },
-       { SMB_VFS_OP_GET_COMPRESSION,   "get_compression" },
+       { SMB_VFS_OP_FGET_COMPRESSION,  "fget_compression" },
        { SMB_VFS_OP_SET_COMPRESSION,   "set_compression" },
        { SMB_VFS_OP_SNAP_CHECK_PATH, "snap_check_path" },
        { SMB_VFS_OP_SNAP_CREATE, "snap_create" },
@@ -2172,21 +2172,19 @@ static NTSTATUS smb_full_audit_offload_write_recv(struct vfs_handle_struct *hand
        return result;
 }
 
-static NTSTATUS smb_full_audit_get_compression(vfs_handle_struct *handle,
+static NTSTATUS smb_full_audit_fget_compression(vfs_handle_struct *handle,
                                               TALLOC_CTX *mem_ctx,
                                               struct files_struct *fsp,
-                                              struct smb_filename *smb_fname,
                                               uint16_t *_compression_fmt)
 {
        NTSTATUS result;
 
-       result = SMB_VFS_NEXT_GET_COMPRESSION(handle, mem_ctx, fsp, smb_fname,
+       result = SMB_VFS_NEXT_FGET_COMPRESSION(handle, mem_ctx, fsp,
                                              _compression_fmt);
 
-       do_log(SMB_VFS_OP_GET_COMPRESSION, NT_STATUS_IS_OK(result), handle,
+       do_log(SMB_VFS_OP_FGET_COMPRESSION, NT_STATUS_IS_OK(result), handle,
               "%s",
-              (fsp ? fsp_str_do_log(fsp) :
-               smb_fname_str_do_log(handle->conn, smb_fname)));
+              fsp_str_do_log(fsp));
 
        return result;
 }
@@ -3016,7 +3014,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .offload_read_recv_fn = smb_full_audit_offload_read_recv,
        .offload_write_send_fn = smb_full_audit_offload_write_send,
        .offload_write_recv_fn = smb_full_audit_offload_write_recv,
-       .get_compression_fn = smb_full_audit_get_compression,
+       .fget_compression_fn = smb_full_audit_fget_compression,
        .set_compression_fn = smb_full_audit_set_compression,
        .snap_check_path_fn =  smb_full_audit_snap_check_path,
        .snap_create_fn = smb_full_audit_snap_create,
index cc8d410b5e46284f9a2d563cb923073dfffb824c..4aeccb889c443185a48d878aa681e9c429201e13 100644 (file)
@@ -622,10 +622,9 @@ NTSTATUS vfs_not_implemented_offload_write_recv(struct vfs_handle_struct *handle
        return NT_STATUS_OK;
 }
 
-NTSTATUS vfs_not_implemented_get_compression(struct vfs_handle_struct *handle,
+NTSTATUS vfs_not_implemented_fget_compression(struct vfs_handle_struct *handle,
                                             TALLOC_CTX *mem_ctx,
                                             struct files_struct *fsp,
-                                            struct smb_filename *smb_fname,
                                             uint16_t *_compression_fmt)
 {
        return NT_STATUS_INVALID_DEVICE_REQUEST;
@@ -1110,7 +1109,7 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .offload_read_recv_fn = vfs_not_implemented_offload_read_recv,
        .offload_write_send_fn = vfs_not_implemented_offload_write_send,
        .offload_write_recv_fn = vfs_not_implemented_offload_write_recv,
-       .get_compression_fn = vfs_not_implemented_get_compression,
+       .fget_compression_fn = vfs_not_implemented_fget_compression,
        .set_compression_fn = vfs_not_implemented_set_compression,
 
        .streaminfo_fn = vfs_not_implemented_streaminfo,
index e2d257aedae4fe8b913e1e40eb5584ca70bf946f..3c8459e3eaa3834eaa8db718b1fed10296f4a1de 100644 (file)
@@ -2126,10 +2126,9 @@ static NTSTATUS smb_time_audit_offload_write_recv(struct vfs_handle_struct *hand
        return NT_STATUS_OK;
 }
 
-static NTSTATUS smb_time_audit_get_compression(vfs_handle_struct *handle,
+static NTSTATUS smb_time_audit_fget_compression(vfs_handle_struct *handle,
                                               TALLOC_CTX *mem_ctx,
                                               struct files_struct *fsp,
-                                              struct smb_filename *smb_fname,
                                               uint16_t *_compression_fmt)
 {
        NTSTATUS result;
@@ -2137,19 +2136,14 @@ static NTSTATUS smb_time_audit_get_compression(vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_GET_COMPRESSION(handle, mem_ctx, fsp, smb_fname,
+       result = SMB_VFS_NEXT_FGET_COMPRESSION(handle, mem_ctx, fsp,
                                              _compression_fmt);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               if (fsp !=  NULL) {
-                       smb_time_audit_log_fsp("get_compression",
-                                              timediff, fsp);
-               } else {
-                       smb_time_audit_log_smb_fname("get_compression",
-                                                    timediff, smb_fname);
-               }
+               smb_time_audit_log_fsp("get_compression",
+                                      timediff, fsp);
        }
 
        return result;
@@ -2884,7 +2878,7 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .offload_read_recv_fn = smb_time_audit_offload_read_recv,
        .offload_write_send_fn = smb_time_audit_offload_write_send,
        .offload_write_recv_fn = smb_time_audit_offload_write_recv,
-       .get_compression_fn = smb_time_audit_get_compression,
+       .fget_compression_fn = smb_time_audit_fget_compression,
        .set_compression_fn = smb_time_audit_set_compression,
        .snap_check_path_fn = smb_time_audit_snap_check_path,
        .snap_create_fn = smb_time_audit_snap_create,
index 1d2f309a5951df35140df633ec36b70a5d7846bf..ccfeaca124dd71197816f94d6815b98530c4a32d 100644 (file)
@@ -609,7 +609,7 @@ static NTSTATUS dos_mode_check_compressed(connection_struct *conn,
                goto err_out;
        }
 
-       status = SMB_VFS_GET_COMPRESSION(conn, tmp_ctx, fsp, smb_fname,
+       status = SMB_VFS_FGET_COMPRESSION(conn, tmp_ctx, fsp,
                                         &compression_fmt);
        if (!NT_STATUS_IS_OK(status)) {
                goto err_ctx_free;
index a398920bfedf00aa9f46cc5cf9bf9628b748cbae..e7bd11f90ab87635887121079bd23eb7edfc3317 100644 (file)
@@ -353,10 +353,9 @@ static NTSTATUS fsctl_get_cmprn(TALLOC_CTX *mem_ctx,
 
        ZERO_STRUCT(cmpr_state);
        if (fsp->conn->fs_capabilities & FILE_FILE_COMPRESSION) {
-               status = SMB_VFS_GET_COMPRESSION(fsp->conn,
+               status = SMB_VFS_FGET_COMPRESSION(fsp->conn,
                                                 mem_ctx,
                                                 fsp,
-                                                NULL,
                                                 &cmpr_state.format);
                if (!NT_STATUS_IS_OK(status)) {
                        return status;
index 9811efe6e2ce31f3494e5755f4507d9bede17c81..afff32063b573d37921c4abef467a27e4efe1a43 100644 (file)
@@ -2623,14 +2623,13 @@ NTSTATUS smb_vfs_call_get_dos_attributes_recv(
        return NT_STATUS_OK;
 }
 
-NTSTATUS smb_vfs_call_get_compression(vfs_handle_struct *handle,
+NTSTATUS smb_vfs_call_fget_compression(vfs_handle_struct *handle,
                                      TALLOC_CTX *mem_ctx,
                                      struct files_struct *fsp,
-                                     struct smb_filename *smb_fname,
                                      uint16_t *_compression_fmt)
 {
-       VFS_FIND(get_compression);
-       return handle->fns->get_compression_fn(handle, mem_ctx, fsp, smb_fname,
+       VFS_FIND(fget_compression);
+       return handle->fns->fget_compression_fn(handle, mem_ctx, fsp,
                                               _compression_fmt);
 }