From: Volker Lendecke Date: Tue, 27 Jan 2026 17:59:09 +0000 (+0100) Subject: vfs: Remove SMB_VFS_STATVFS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1145665fbe07bfcf30e8d60f999834cf270b116c;p=thirdparty%2Fsamba.git vfs: Remove SMB_VFS_STATVFS Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index c265cc852c2..891f28427d6 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -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, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index b1bc6cdd406..091c7388860 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -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, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 6a779e151fe..9d8e1af6575 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -400,6 +400,7 @@ * 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); diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index cb5a4fe9fa0..f6c14338ad5 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -61,11 +61,6 @@ #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) \ diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index a3080e4cd02..e927f41dd03 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -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, diff --git a/source3/modules/vfs_ceph_new.c b/source3/modules/vfs_ceph_new.c index 7d4be60e40a..138b8e51efa 100644 --- a/source3/modules/vfs_ceph_new.c +++ b/source3/modules/vfs_ceph_new.c @@ -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, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 9c260fc3743..5fcddbdc474 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -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, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 382eab197d5..1cb66b03dc0 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -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, diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index c7f786c926e..765baf6dd49 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -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, diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c index 7fbc5bad2b4..0fe872ea69b 100644 --- a/source3/modules/vfs_media_harmony.c +++ b/source3/modules/vfs_media_harmony.c @@ -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 */ diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 7f97ba9ab18..a60b262941c 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -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, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index c68c5e02f5b..ae01a02e108 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -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, diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c index edebcf24a88..84970998ff6 100644 --- a/source3/modules/vfs_unityed_media.c +++ b/source3/modules/vfs_unityed_media.c @@ -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 */ diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 473e0ccddd5..07997472c98 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -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,