]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: Remove SMB_VFS_STATVFS
authorVolker Lendecke <vl@samba.org>
Tue, 27 Jan 2026 17:59:09 +0000 (18:59 +0100)
committerAnoop C S <anoopcs@samba.org>
Sun, 15 Feb 2026 10:42:34 +0000 (10:42 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
14 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_ceph_new.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_not_implemented.c
source3/modules/vfs_time_audit.c
source3/modules/vfs_unityed_media.c
source3/smbd/vfs.c

index c265cc852c268a1e9a2dae0ade0cf372baba94d6..891f28427d68b3a7bd16749b62ae57f6ab07d6e5 100644 (file)
@@ -83,14 +83,6 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_statvfs(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               struct vfs_statvfs_struct *statbuf)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_fstatvfs(struct vfs_handle_struct *handle,
                         struct files_struct *fsp,
                         struct vfs_statvfs_struct *statbuf)
@@ -969,7 +961,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .get_quota_fn = skel_get_quota,
        .set_quota_fn = skel_set_quota,
        .get_shadow_copy_data_fn = skel_get_shadow_copy_data,
-       .statvfs_fn = skel_statvfs,
        .fstatvfs_fn = skel_fstatvfs,
        .fs_capabilities_fn = skel_fs_capabilities,
        .get_dfs_referrals_fn = skel_get_dfs_referrals,
index b1bc6cdd4068335a689f25b5a434a05fac71ed5a..091c738886045cc052756a86bd63af2741dcc948 100644 (file)
@@ -81,13 +81,6 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle,
                                                 labels);
 }
 
-static int skel_statvfs(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       struct vfs_statvfs_struct *statbuf)
-{
-       return SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
-}
-
 static int skel_fstatvfs(struct vfs_handle_struct *handle,
                         struct files_struct *fsp,
                         struct vfs_statvfs_struct *statbuf)
@@ -1278,7 +1271,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .get_quota_fn = skel_get_quota,
        .set_quota_fn = skel_set_quota,
        .get_shadow_copy_data_fn = skel_get_shadow_copy_data,
-       .statvfs_fn = skel_statvfs,
        .fstatvfs_fn = skel_fstatvfs,
        .fs_capabilities_fn = skel_fs_capabilities,
        .get_dfs_referrals_fn = skel_get_dfs_referrals,
index 6a779e151fe65ced5e37b17cbfcd8ce9ba69b24d..9d8e1af6575dbfeb6849c51bcb3ceaa619300b31 100644 (file)
  * Change to Version 53 - will ship with 4.25
  * Version 53 - Change DISK_FREE to take a fsp instead of a name
  * Version 53 - Add fstatvfs
+ * Version 53 - Remove statvfs
  */
 
 #define SMB_VFS_INTERFACE_VERSION 53
@@ -997,9 +998,6 @@ struct vfs_fn_pointers {
                                SMB_DISK_QUOTA *qt);
        int (*set_quota_fn)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
        int (*get_shadow_copy_data_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels);
-       int (*statvfs_fn)(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               struct vfs_statvfs_struct *statbuf);
        int (*fstatvfs_fn)(struct vfs_handle_struct *handle,
                           struct files_struct *fsp,
                           struct vfs_statvfs_struct *statbuf);
@@ -1460,9 +1458,6 @@ int smb_vfs_call_get_shadow_copy_data(struct vfs_handle_struct *handle,
                                      struct files_struct *fsp,
                                      struct shadow_copy_data *shadow_copy_data,
                                      bool labels);
-int smb_vfs_call_statvfs(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       struct vfs_statvfs_struct *statbuf);
 int smb_vfs_call_fstatvfs(struct vfs_handle_struct *handle,
                          struct files_struct *fsp,
                          struct vfs_statvfs_struct *statbuf);
@@ -1896,9 +1891,6 @@ int vfs_not_implemented_get_shadow_copy_data(vfs_handle_struct *handle,
                                files_struct *fsp,
                                struct shadow_copy_data *shadow_copy_data,
                                bool labels);
-int vfs_not_implemented_statvfs(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               struct vfs_statvfs_struct *statbuf);
 int vfs_not_implemented_fstatvfs(struct vfs_handle_struct *handle,
                                 struct files_struct *fsp,
                                 struct vfs_statvfs_struct *statbuf);
index cb5a4fe9fa05e92e5f68e3f1d84a4a199ee9fcce..f6c14338ad532ffc3abeeba0d96b91f1137f0d78 100644 (file)
 #define SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data ,labels) \
        smb_vfs_call_get_shadow_copy_data((handle)->next, (fsp), (shadow_copy_data), (labels))
 
-#define SMB_VFS_STATVFS(conn, smb_fname, statbuf) \
-       smb_vfs_call_statvfs((conn)->vfs_handles, (smb_fname), (statbuf))
-#define SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf) \
-       smb_vfs_call_statvfs((handle)->next, (smb_fname), (statbuf))
-
 #define SMB_VFS_FSTATVFS(conn, fsp, statbuf) \
        smb_vfs_call_fstatvfs((conn)->vfs_handles, (fsp), (statbuf))
 #define SMB_VFS_NEXT_FSTATVFS(handle, fsp, statbuf) \
index a3080e4cd0274c2e1691f55c92064abc7b47d7d4..e927f41dd03096c75439d946a7db3df5c94b5c70 100644 (file)
@@ -1785,7 +1785,6 @@ static struct vfs_fn_pointers ceph_fns = {
        .disk_free_fn = cephwrap_disk_free,
        .get_quota_fn = vfs_not_implemented_get_quota,
        .set_quota_fn = vfs_not_implemented_set_quota,
-       .statvfs_fn = cephwrap_statvfs,
        .fstatvfs_fn = cephwrap_fstatvfs,
        .fs_capabilities_fn = cephwrap_fs_capabilities,
 
index 7d4be60e40a70dfc1d0408add6fd75882cb1537d..138b8e51efa7d83fa73127acec0891565960cb00 100644 (file)
@@ -4622,7 +4622,6 @@ static struct vfs_fn_pointers ceph_new_fns = {
        .disk_free_fn = vfs_ceph_disk_free,
        .get_quota_fn = vfs_not_implemented_get_quota,
        .set_quota_fn = vfs_not_implemented_set_quota,
-       .statvfs_fn = vfs_ceph_statvfs,
        .fstatvfs_fn = vfs_ceph_fstatvfs,
        .fs_capabilities_fn = vfs_ceph_fs_capabilities,
 
index 9c260fc3743deb6b4443e60f72ae8997ab9df748..5fcddbdc47448dbc7b17ac8d963f917e0747884c 100644 (file)
@@ -162,13 +162,6 @@ static int vfswrap_get_shadow_copy_data(struct vfs_handle_struct *handle,
        return -1;  /* Not implemented. */
 }
 
-static int vfswrap_statvfs(struct vfs_handle_struct *handle,
-                          const struct smb_filename *smb_fname,
-                          struct vfs_statvfs_struct *statbuf)
-{
-       return sys_statvfs(smb_fname->base_name, statbuf);
-}
-
 static int vfswrap_fstatvfs(struct vfs_handle_struct *handle,
                            struct files_struct *fsp,
                            struct vfs_statvfs_struct *statbuf)
@@ -4056,7 +4049,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .get_quota_fn = vfswrap_get_quota,
        .set_quota_fn = vfswrap_set_quota,
        .get_shadow_copy_data_fn = vfswrap_get_shadow_copy_data,
-       .statvfs_fn = vfswrap_statvfs,
        .fstatvfs_fn = vfswrap_fstatvfs,
        .fs_capabilities_fn = vfswrap_fs_capabilities,
        .get_dfs_referrals_fn = vfswrap_get_dfs_referrals,
index 382eab197d598b665062851bd8b79d4a025af63e..1cb66b03dc0226fb814463c23cb0fb80665192b4 100644 (file)
@@ -882,19 +882,6 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_full_audit_statvfs(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               struct vfs_statvfs_struct *statbuf)
-{
-       int result;
-
-       result = SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
-
-       do_log(SMB_VFS_OP_STATVFS, errmsg_unix(result), handle, "");
-
-       return result;
-}
-
 static int smb_full_audit_fstatvfs(struct vfs_handle_struct *handle,
                                   struct files_struct *fsp,
                                   struct vfs_statvfs_struct *statbuf)
@@ -3161,7 +3148,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .get_quota_fn = smb_full_audit_get_quota,
        .set_quota_fn = smb_full_audit_set_quota,
        .get_shadow_copy_data_fn = smb_full_audit_get_shadow_copy_data,
-       .statvfs_fn = smb_full_audit_statvfs,
        .fstatvfs_fn = smb_full_audit_fstatvfs,
        .fs_capabilities_fn = smb_full_audit_fs_capabilities,
        .get_dfs_referrals_fn = smb_full_audit_get_dfs_referrals,
index c7f786c926ea3f3cc18f68dbb4b0479039b7b305..765baf6dd49196a53a82ab289eba24904842d991 100644 (file)
@@ -2569,7 +2569,6 @@ static struct vfs_fn_pointers glusterfs_fns = {
        .disk_free_fn = vfs_gluster_disk_free,
        .get_quota_fn = vfs_gluster_get_quota,
        .set_quota_fn = vfs_gluster_set_quota,
-       .statvfs_fn = vfs_gluster_statvfs,
        .fstatvfs_fn = vfs_gluster_fstatvfs,
        .fs_capabilities_fn = vfs_gluster_fs_capabilities,
 
index 7fbc5bad2b43745a0dcb4c95f30414e02e2e27dd..0fe872ea69bd38c1504c320926c6e35dc3b7976a 100644 (file)
@@ -627,43 +627,6 @@ out:
        return status;
 }
 
-/*
- * Success: return 0
- * Failure: set errno, return -1
- */
-static int mh_statvfs(struct vfs_handle_struct *handle,
-               const struct smb_filename *smb_fname,
-               struct vfs_statvfs_struct *statbuf)
-{
-       int status;
-       struct smb_filename *clientFname = NULL;
-
-       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n",
-                       smb_fname->base_name));
-
-       if (!is_in_media_files(smb_fname->base_name))
-       {
-               status = SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
-               goto out;
-       }
-
-       status = alloc_get_client_smb_fname(handle,
-                               talloc_tos(),
-                               smb_fname,
-                               &clientFname);
-       if (status != 0) {
-               goto err;
-       }
-
-       status = SMB_VFS_NEXT_STATVFS(handle, clientFname, statbuf);
-err:
-       TALLOC_FREE(clientFname);
-out:
-       DEBUG(MH_INFO_DEBUG, ("Leaving with path '%s'\n",
-                       smb_fname->base_name));
-       return status;
-}
-
 /*
  * Success: return 0
  * Failure: set errno, return -1
@@ -1875,7 +1838,6 @@ err:
 static struct vfs_fn_pointers vfs_mh_fns = {
        /* Disk operations */
 
-       .statvfs_fn = mh_statvfs,
        .fstatvfs_fn = mh_fstatvfs,
 
        /* Directory operations */
index 7f97ba9ab1850752bc419e2435b671ce5ee9d19b..a60b262941cb922524c35921117ecc695d36ac35 100644 (file)
@@ -83,15 +83,6 @@ int vfs_not_implemented_get_shadow_copy_data(vfs_handle_struct *handle,
        return -1;
 }
 
-_PUBLIC_
-int vfs_not_implemented_statvfs(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               struct vfs_statvfs_struct *statbuf)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 _PUBLIC_
 int vfs_not_implemented_fstatvfs(struct vfs_handle_struct *handle,
                                 struct files_struct *fsp,
@@ -1065,7 +1056,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .get_quota_fn = vfs_not_implemented_get_quota,
        .set_quota_fn = vfs_not_implemented_set_quota,
        .get_shadow_copy_data_fn = vfs_not_implemented_get_shadow_copy_data,
-       .statvfs_fn = vfs_not_implemented_statvfs,
        .fstatvfs_fn = vfs_not_implemented_fstatvfs,
        .fs_capabilities_fn = vfs_not_implemented_fs_capabilities,
        .get_dfs_referrals_fn = vfs_not_implemented_get_dfs_referrals,
index c68c5e02f5b1d604ad70a9e45ed999cad46fb8c8..ae01a02e108a03e952149bab28902eea30b04a85 100644 (file)
@@ -263,27 +263,6 @@ static int smb_time_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_time_audit_statvfs(struct vfs_handle_struct *handle,
-                                 const struct smb_filename *smb_fname,
-                                 struct vfs_statvfs_struct *statbuf)
-{
-       int result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("statvfs", timediff,
-                       smb_fname->base_name);
-       }
-
-       return result;
-}
-
 static int smb_time_audit_fstatvfs(struct vfs_handle_struct *handle,
                                   struct files_struct *fsp,
                                   struct vfs_statvfs_struct *statbuf)
@@ -2707,7 +2686,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .get_quota_fn = smb_time_audit_get_quota,
        .set_quota_fn = smb_time_audit_set_quota,
        .get_shadow_copy_data_fn = smb_time_audit_get_shadow_copy_data,
-       .statvfs_fn = smb_time_audit_statvfs,
        .fstatvfs_fn = smb_time_audit_fstatvfs,
        .fs_capabilities_fn = smb_time_audit_fs_capabilities,
        .get_dfs_referrals_fn = smb_time_audit_get_dfs_referrals,
index edebcf24a885fab997dea8ce28c61c70748beedf..84970998ff6dc98e8ff144becd9a1186e14565b1 100644 (file)
@@ -526,38 +526,6 @@ err:
  * VFS functions
  **********************************************************************/
 
-/*
- * Success: return 0
- * Failure: set errno, return -1
- */
-static int um_statvfs(struct vfs_handle_struct *handle,
-                     const struct smb_filename *smb_fname,
-                     struct vfs_statvfs_struct *statbuf)
-{
-       int status;
-       struct smb_filename *client_fname = NULL;
-
-       DEBUG(10, ("Entering with path '%s'\n", smb_fname->base_name));
-
-       if (!is_in_media_files(smb_fname->base_name)) {
-               return SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
-       }
-
-       status = alloc_get_client_smb_fname(handle,
-                               talloc_tos(),
-                               smb_fname,
-                               &client_fname);
-       if (status != 0) {
-               goto err;
-       }
-
-       status = SMB_VFS_NEXT_STATVFS(handle, client_fname, statbuf);
-err:
-       TALLOC_FREE(client_fname);
-       DEBUG(10, ("Leaving with path '%s'\n", smb_fname->base_name));
-       return status;
-}
-
 /*
  * Success: return 0
  * Failure: set errno, return -1
@@ -1548,7 +1516,6 @@ static struct vfs_fn_pointers vfs_um_fns = {
 
        /* Disk operations */
 
-       .statvfs_fn = um_statvfs,
        .fstatvfs_fn = um_fstatvfs,
 
        /* Directory operations */
index 473e0ccddd54aacdb3ec81c65d8d077bce39b6f2..07997472c9803eaa69d3d409fdd8b50aa1207068 100644 (file)
@@ -1479,13 +1479,6 @@ int smb_vfs_call_get_shadow_copy_data(struct vfs_handle_struct *handle,
                                                    shadow_copy_data,
                                                    labels);
 }
-int smb_vfs_call_statvfs(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       struct vfs_statvfs_struct *statbuf)
-{
-       VFS_FIND(statvfs);
-       return handle->fns->statvfs_fn(handle, smb_fname, statbuf);
-}
 
 int smb_vfs_call_fstatvfs(struct vfs_handle_struct *handle,
                          struct files_struct *fsp,