The previous commit removed all callers of this, so lets remove it.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Oct 11 14:44:03 CEST 2016 on sn-devel-144
return false;
}
-static bool skel_is_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf)
-{
- errno = ENOSYS;
- return false;
-}
-
-static int skel_set_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname)
-{
- errno = ENOSYS;
- return -1;
-}
-
/* VFS operations structure */
struct vfs_fn_pointers skel_opaque_fns = {
/* aio operations */
.aio_force_fn = skel_aio_force,
-
- /* offline operations */
- .is_offline_fn = skel_is_offline,
- .set_offline_fn = skel_set_offline
};
static_decl_vfs;
return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
}
-static bool skel_is_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf)
-{
- return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
-}
-
-static int skel_set_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname)
-{
- return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
-}
-
/* VFS operations structure */
struct vfs_fn_pointers skel_transparent_fns = {
/* aio operations */
.aio_force_fn = skel_aio_force,
-
- /* offline operations */
- .is_offline_fn = skel_is_offline,
- .set_offline_fn = skel_set_offline
};
static_decl_vfs;
/* Version 35 - Add uint32_t flags to struct smb_filename */
/* Version 35 - Add get/set/fget/fset dos attribute functions. */
/* Version 35 - Add bool use_ofd_locks to struct files_struct */
+/* Bump to version 36 - Samba 4.6 will ship with that */
+/* Version 36 - Remove is_offline and set_offline */
-#define SMB_VFS_INTERFACE_VERSION 35
+#define SMB_VFS_INTERFACE_VERSION 36
/*
All intercepted VFS operations must be declared as static functions inside module source
/* aio operations */
bool (*aio_force_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp);
- /* offline operations */
- bool (*is_offline_fn)(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf);
- int (*set_offline_fn)(struct vfs_handle_struct *handle,
- const struct smb_filename *fname);
-
/* durable handle operations */
NTSTATUS (*durable_cookie_fn)(struct vfs_handle_struct *handle,
struct files_struct *fsp,
#define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \
smb_vfs_call_aio_force((handle)->next,(fsp))
-#define SMB_VFS_IS_OFFLINE(conn,fname,sbuf) \
- smb_vfs_call_is_offline((conn)->vfs_handles,(fname),(sbuf))
-#define SMB_VFS_NEXT_IS_OFFLINE(handle,fname,sbuf) \
- smb_vfs_call_is_offline((handle)->next,(fname),(sbuf))
-
-#define SMB_VFS_SET_OFFLINE(conn,fname) \
- smb_vfs_call_set_offline((conn)->vfs_handles,(fname))
-#define SMB_VFS_NEXT_SET_OFFLINE(handle,fname) \
- smb_vfs_call_set_offline((handle)->next, (fname))
-
/* durable handle operations */
#define SMB_VFS_DURABLE_COOKIE(fsp, mem_ctx, cookie) \
return false;
}
-static bool cephwrap_is_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf)
-{
- return false;
-}
-
-static int cephwrap_set_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname)
-{
- errno = ENOTSUP;
- return -1;
-}
-
static struct vfs_fn_pointers ceph_fns = {
/* Disk operations */
/* aio operations */
.aio_force_fn = cephwrap_aio_force,
-
- /* offline operations */
- .is_offline_fn = cephwrap_is_offline,
- .set_offline_fn = cephwrap_set_offline
};
NTSTATUS vfs_ceph_init(void);
return result;
}
-static bool smb_full_audit_is_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf)
-{
- bool result;
-
- result = SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
- do_log(SMB_VFS_OP_IS_OFFLINE, result, handle, "%s",
- smb_fname_str_do_log(fname));
- return result;
-}
-
-static int smb_full_audit_set_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname)
-{
- int result;
-
- result = SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
- do_log(SMB_VFS_OP_SET_OFFLINE, result >= 0, handle, "%s",
- smb_fname_str_do_log(fname));
- return result;
-}
-
static NTSTATUS smb_full_audit_durable_cookie(struct vfs_handle_struct *handle,
struct files_struct *fsp,
TALLOC_CTX *mem_ctx,
.setxattr_fn = smb_full_audit_setxattr,
.fsetxattr_fn = smb_full_audit_fsetxattr,
.aio_force_fn = smb_full_audit_aio_force,
- .is_offline_fn = smb_full_audit_is_offline,
- .set_offline_fn = smb_full_audit_set_offline,
.durable_cookie_fn = smb_full_audit_durable_cookie,
.durable_disconnect_fn = smb_full_audit_durable_disconnect,
.durable_reconnect_fn = smb_full_audit_durable_reconnect,
return false;
}
-/* Offline Operations */
-
-static bool vfs_gluster_is_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf)
-{
- return false;
-}
-
-static int vfs_gluster_set_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname)
-{
- errno = ENOTSUP;
- return -1;
-}
-
static struct vfs_fn_pointers glusterfs_fns = {
/* Disk Operations */
/* AIO Operations */
.aio_force_fn = vfs_gluster_aio_force,
- /* Offline Operations */
- .is_offline_fn = vfs_gluster_is_offline,
- .set_offline_fn = vfs_gluster_set_offline,
-
/* Durable handle Operations */
.durable_cookie_fn = NULL,
.durable_disconnect_fn = NULL,
.fstat_fn = vfs_gpfs_fstat,
.lstat_fn = vfs_gpfs_lstat,
.ntimes_fn = vfs_gpfs_ntimes,
- .is_offline_fn = vfs_gpfs_is_offline,
.aio_force_fn = vfs_gpfs_aio_force,
.sendfile_fn = vfs_gpfs_sendfile,
.fallocate_fn = vfs_gpfs_fallocate,
return status;
}
-/*
- * Success: return true
- * Failure: set errno, return false
- */
-static bool mh_is_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf)
-{
- // check if sbuf is modified further down the chain.
- bool ret;
- struct smb_filename *clientFname;
- TALLOC_CTX *ctx;
-
- DEBUG(MH_INFO_DEBUG, ("Entering mh_is_offline\n"));
- if (!is_in_media_files(fname->base_name))
- {
- ret = SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
- goto out;
- }
-
- clientFname = NULL;
- ctx = talloc_tos();
-
- if(alloc_get_client_smb_fname(handle, ctx,
- fname,
- &clientFname))
- {
- ret = -1;
- goto err;
- }
-
- ret = SMB_VFS_NEXT_IS_OFFLINE(handle, clientFname, sbuf);
-err:
- TALLOC_FREE(clientFname);
-out:
- return ret;
-}
-
-/*
- * Success: return 0 (?)
- * Failure: set errno, return -1
- */
-static int mh_set_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname)
-{
- int status;
- struct smb_filename *clientFname;
- TALLOC_CTX *ctx;
-
- DEBUG(MH_INFO_DEBUG, ("Entering mh_set_offline\n"));
- if (!is_in_media_files(fname->base_name))
- {
- status = SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
- goto out;
- }
-
- clientFname = NULL;
- ctx = talloc_tos();
-
- if ((status = alloc_get_client_smb_fname(handle, ctx,
- fname,
- &clientFname)))
- {
- goto err;
- }
-
- status = SMB_VFS_NEXT_SET_OFFLINE(handle, clientFname);
-err:
- TALLOC_FREE(clientFname);
-out:
- return status;
-}
-
/* VFS operations structure */
static struct vfs_fn_pointers vfs_mh_fns = {
.setxattr_fn = mh_setxattr,
/* aio operations */
-
- /* offline operations */
- .is_offline_fn = mh_is_offline,
- .set_offline_fn = mh_set_offline
};
NTSTATUS vfs_media_harmony_init(void);
return result;
}
-static bool smb_time_audit_is_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf)
-{
- bool result;
- struct timespec ts1,ts2;
- double timediff;
-
- clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
- clock_gettime_mono(&ts2);
- timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
- if (timediff > audit_timeout) {
- smb_time_audit_log_smb_fname("is_offline", timediff, fname);
- }
-
- return result;
-}
-
-static int smb_time_audit_set_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname)
-{
- int result;
- struct timespec ts1,ts2;
- double timediff;
-
- clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
- clock_gettime_mono(&ts2);
- timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
- if (timediff > audit_timeout) {
- smb_time_audit_log_smb_fname("set_offline", timediff, fname);
- }
-
- return result;
-}
-
static NTSTATUS smb_time_audit_durable_cookie(struct vfs_handle_struct *handle,
struct files_struct *fsp,
TALLOC_CTX *mem_ctx,
.setxattr_fn = smb_time_audit_setxattr,
.fsetxattr_fn = smb_time_audit_fsetxattr,
.aio_force_fn = smb_time_audit_aio_force,
- .is_offline_fn = smb_time_audit_is_offline,
- .set_offline_fn = smb_time_audit_set_offline,
.durable_cookie_fn = smb_time_audit_durable_cookie,
.durable_disconnect_fn = smb_time_audit_durable_disconnect,
.durable_reconnect_fn = smb_time_audit_durable_reconnect,
return status;
}
-static bool um_is_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf)
-{
- bool ret;
- struct smb_filename *client_fname = NULL;
- int status;
-
- DEBUG(10, ("Entering um_is_offline\n"));
-
- if (!is_in_media_files(fname->base_name)) {
- return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
- }
-
- status = alloc_get_client_smb_fname(handle, talloc_tos(),
- fname, &client_fname);
- if (status != 0) {
- ret = false;
- goto err;
- }
-
- ret = SMB_VFS_NEXT_IS_OFFLINE(handle, client_fname, sbuf);
-
-err:
- TALLOC_FREE(client_fname);
- return ret;
-}
-
-static int um_set_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname)
-{
- int status;
- struct smb_filename *client_fname = NULL;
-
- DEBUG(10, ("Entering um_set_offline\n"));
-
- if (!is_in_media_files(fname->base_name)) {
- return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
- }
-
- status = alloc_get_client_smb_fname(handle, talloc_tos(),
- fname, &client_fname);
- if (status != 0) {
- goto err;
- }
-
- status = SMB_VFS_NEXT_SET_OFFLINE(handle, client_fname);
-
-err:
- TALLOC_FREE(client_fname);
- return status;
-}
-
static int um_connect(vfs_handle_struct *handle,
const char *service,
const char *user)
.listxattr_fn = um_listxattr,
.removexattr_fn = um_removexattr,
.setxattr_fn = um_setxattr,
-
- /* aio operations */
-
- /* offline operations */
- .is_offline_fn = um_is_offline,
- .set_offline_fn = um_set_offline
};
NTSTATUS vfs_unityed_media_init(void);
return handle->fns->aio_force_fn(handle, fsp);
}
-bool smb_vfs_call_is_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname,
- SMB_STRUCT_STAT *sbuf)
-{
- VFS_FIND(is_offline);
- return handle->fns->is_offline_fn(handle, fname, sbuf);
-}
-
-int smb_vfs_call_set_offline(struct vfs_handle_struct *handle,
- const struct smb_filename *fname)
-{
- VFS_FIND(set_offline);
- return handle->fns->set_offline_fn(handle, fname);
-}
-
NTSTATUS smb_vfs_call_durable_cookie(struct vfs_handle_struct *handle,
struct files_struct *fsp,
TALLOC_CTX *mem_ctx,