}
static int skel_statvfs(struct vfs_handle_struct *handle,
- const char *path, struct vfs_statvfs_struct *statbuf)
+ const struct smb_filename *smb_fname,
+ struct vfs_statvfs_struct *statbuf)
{
errno = ENOSYS;
return -1;
labels);
}
-static int skel_statvfs(struct vfs_handle_struct *handle, const char *path,
+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, path, statbuf);
+ return SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
}
static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle,
to const struct smb_filename * */
/* Version 37 - Change link from const char *
to const struct smb_filename * */
+/* Version 37 - Change statvfs from const char *
+ to const struct smb_filename * */
#define SMB_VFS_INTERFACE_VERSION 37
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 char *path, struct vfs_statvfs_struct *statbuf);
+ int (*statvfs_fn)(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ struct vfs_statvfs_struct *statbuf);
uint32_t (*fs_capabilities_fn)(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res);
/*
struct files_struct *fsp,
struct shadow_copy_data *shadow_copy_data,
bool labels);
-int smb_vfs_call_statvfs(struct vfs_handle_struct *handle, const char *path,
- struct vfs_statvfs_struct *statbuf);
+int smb_vfs_call_statvfs(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ struct vfs_statvfs_struct *statbuf);
uint32_t smb_vfs_call_fs_capabilities(struct vfs_handle_struct *handle,
enum timestamp_set_resolution *p_ts_res);
/*
#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, path, statbuf) \
- smb_vfs_call_statvfs((conn)->vfs_handles, (path), (statbuf))
-#define SMB_VFS_NEXT_STATVFS(handle, path, statbuf) \
- smb_vfs_call_statvfs((handle)->next, (path), (statbuf))
+#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_FS_CAPABILITIES(conn, p_ts_res) \
smb_vfs_call_fs_capabilities((conn)->vfs_handles, (p_ts_res))
#endif
}
-static int cephwrap_statvfs(struct vfs_handle_struct *handle, const char *path, vfs_statvfs_struct *statbuf)
+static int cephwrap_statvfs(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ vfs_statvfs_struct *statbuf)
{
struct statvfs statvfs_buf;
int ret;
- ret = ceph_statfs(handle->data, path, &statvfs_buf);
+ ret = ceph_statfs(handle->data, smb_fname->base_name, &statvfs_buf);
if (ret < 0) {
WRAP_RETURN(ret);
} else {
return -1; /* Not implemented. */
}
-static int vfswrap_statvfs(struct vfs_handle_struct *handle, const char *path, vfs_statvfs_struct *statbuf)
+static int vfswrap_statvfs(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ vfs_statvfs_struct *statbuf)
{
- return sys_statvfs(path, statbuf);
+ return sys_statvfs(smb_fname->base_name, statbuf);
}
static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle,
}
static int smb_full_audit_statvfs(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *smb_fname,
struct vfs_statvfs_struct *statbuf)
{
int result;
- result = SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
+ result = SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
do_log(SMB_VFS_OP_STATVFS, (result >= 0), handle, "");
}
static int vfs_gluster_statvfs(struct vfs_handle_struct *handle,
- const char *path,
- struct vfs_statvfs_struct *vfs_statvfs)
+ const struct smb_filename *smb_fname,
+ struct vfs_statvfs_struct *vfs_statvfs)
{
struct statvfs statvfs = { 0, };
int ret;
- ret = glfs_statvfs(handle->data, path, &statvfs);
+ ret = glfs_statvfs(handle->data, smb_fname->base_name, &statvfs);
if (ret < 0) {
DEBUG(0, ("glfs_statvfs(%s) failed: %s\n",
- path, strerror(errno)));
+ smb_fname->base_name, strerror(errno)));
return -1;
}
* Failure: set errno, return -1
*/
static int mh_statvfs(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *smb_fname,
struct vfs_statvfs_struct *statbuf)
{
int status;
- char *clientPath;
- TALLOC_CTX *ctx;
+ struct smb_filename *clientFname = NULL;
- DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
+ DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n",
+ smb_fname->base_name));
- if (!is_in_media_files(path))
+ if (!is_in_media_files(smb_fname->base_name))
{
- status = SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
+ status = SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
goto out;
}
- clientPath = NULL;
- ctx = talloc_tos();
-
- if ((status = alloc_get_client_path(handle, ctx,
- path,
- &clientPath)))
- {
+ status = alloc_get_client_smb_fname(handle,
+ talloc_tos(),
+ smb_fname,
+ &clientFname);
+ if (status != 0) {
goto err;
}
- status = SMB_VFS_NEXT_STATVFS(handle, clientPath, statbuf);
+ status = SMB_VFS_NEXT_STATVFS(handle, clientFname, statbuf);
err:
- TALLOC_FREE(clientPath);
+ TALLOC_FREE(clientFname);
out:
- DEBUG(MH_INFO_DEBUG, ("Leaving with path '%s'\n", path));
+ DEBUG(MH_INFO_DEBUG, ("Leaving with path '%s'\n",
+ smb_fname->base_name));
return status;
}
}
static int smb_time_audit_statvfs(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *smb_fname,
struct vfs_statvfs_struct *statbuf)
{
int result;
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
+ 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, path);
+ smb_time_audit_log_fname("statvfs", timediff,
+ smb_fname->base_name);
}
return result;
* Failure: set errno, return -1
*/
static int um_statvfs(struct vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *smb_fname,
struct vfs_statvfs_struct *statbuf)
{
int status;
- char *clientPath = NULL;
+ struct smb_filename *client_fname = NULL;
- DEBUG(10, ("Entering with path '%s'\n", path));
+ DEBUG(10, ("Entering with path '%s'\n", smb_fname->base_name));
- if (!is_in_media_files(path)) {
- return SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
+ if (!is_in_media_files(smb_fname->base_name)) {
+ return SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
}
- status = alloc_get_client_path(handle, talloc_tos(),
- path, &clientPath);
+ status = alloc_get_client_smb_fname(handle,
+ talloc_tos(),
+ smb_fname,
+ &client_fname);
if (status != 0) {
goto err;
}
- status = SMB_VFS_NEXT_STATVFS(handle, clientPath, statbuf);
+ status = SMB_VFS_NEXT_STATVFS(handle, client_fname, statbuf);
err:
- TALLOC_FREE(clientPath);
- DEBUG(10, ("Leaving with path '%s'\n", path));
+ TALLOC_FREE(client_fname);
+ DEBUG(10, ("Leaving with path '%s'\n", smb_fname->base_name));
return status;
}
return NT_STATUS_INVALID_LEVEL;
}
- rc = SMB_VFS_STATVFS(conn, filename, &svfs);
+ rc = SMB_VFS_STATVFS(conn, &smb_fname, &svfs);
if (!rc) {
data_len = 56;
shadow_copy_data,
labels);
}
-int smb_vfs_call_statvfs(struct vfs_handle_struct *handle, const char *path,
- struct vfs_statvfs_struct *statbuf)
+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, path, statbuf);
+ return handle->fns->statvfs_fn(handle, smb_fname, statbuf);
}
uint32_t smb_vfs_call_fs_capabilities(struct vfs_handle_struct *handle,