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)
.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,
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)
.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,
* 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
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);
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);
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);
#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) \
.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,
.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,
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)
.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,
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)
.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,
.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,
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
static struct vfs_fn_pointers vfs_mh_fns = {
/* Disk operations */
- .statvfs_fn = mh_statvfs,
.fstatvfs_fn = mh_fstatvfs,
/* Directory operations */
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,
.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,
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)
.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,
* 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
/* Disk operations */
- .statvfs_fn = um_statvfs,
.fstatvfs_fn = um_fstatvfs,
/* Directory operations */
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,