1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

s3-aio: Remove unused VFS functions and more

Signed-off-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2012-07-09 21:33:57 +02:00 committed by Jeremy Allison
parent be05dad399
commit 9dc78c90f3
14 changed files with 0 additions and 788 deletions

View File

@ -38,13 +38,6 @@
complete set of Samba VFS operations:</para>
<simplelist>
<member>aio_cancel</member>
<member>aio_error</member>
<member>aio_fsync</member>
<member>aio_read</member>
<member>aio_return</member>
<member>aio_suspend</member>
<member>aio_write</member>
<member>chdir</member>
<member>chflags</member>
<member>chmod</member>

View File

@ -741,48 +741,6 @@ static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, c
return -1;
}
static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts)
{
errno = ENOSYS;
return -1;
}
static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
{
errno = ENOSYS;
@ -931,13 +889,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
.fsetxattr_fn = skel_fsetxattr,
/* aio operations */
.aio_read_fn = skel_aio_read,
.aio_write_fn = skel_aio_write,
.aio_return_fn = skel_aio_return_fn,
.aio_cancel_fn = skel_aio_cancel,
.aio_error_fn = skel_aio_error_fn,
.aio_fsync_fn = skel_aio_fsync,
.aio_suspend_fn = skel_aio_suspend,
.aio_force_fn = skel_aio_force,
/* offline operations */

View File

@ -788,41 +788,6 @@ static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, c
return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
}
static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
return SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
}
static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
return SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
}
static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
}
static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
}
static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
return SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
}
static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
{
return SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
}
static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts)
{
return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
}
static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
{
return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
@ -968,13 +933,6 @@ struct vfs_fn_pointers skel_transparent_fns = {
.fsetxattr_fn = skel_fsetxattr,
/* aio operations */
.aio_read_fn = skel_aio_read,
.aio_write_fn = skel_aio_write,
.aio_return_fn = skel_aio_return_fn,
.aio_cancel_fn = skel_aio_cancel,
.aio_error_fn = skel_aio_error_fn,
.aio_fsync_fn = skel_aio_fsync,
.aio_suspend_fn = skel_aio_suspend,
.aio_force_fn = skel_aio_force,
/* offline operations */

View File

@ -334,18 +334,6 @@ struct stat_ex {
typedef struct stat_ex SMB_STRUCT_STAT;
/*
* Type for aiocb structure.
*/
#ifndef SMB_STRUCT_AIOCB
# if defined(HAVE_AIO)
# define SMB_STRUCT_AIOCB struct aiocb
# else
# define SMB_STRUCT_AIOCB int /* AIO not being used but we still need the define.... */
# endif
#endif
enum timestamp_set_resolution {
TIMESTAMP_SET_SECONDS = 0,
TIMESTAMP_SET_MSEC,

View File

@ -310,20 +310,6 @@ uint32 unix_dev_minor(SMB_DEV_T dev);
#if 0
int sys_get_number_of_cores(void);
#endif
int sys_aio_read(SMB_STRUCT_AIOCB *aiocb);
int sys_aio_write(SMB_STRUCT_AIOCB *aiocb);
ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb);
int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb);
int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb);
int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb);
int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout);
int sys_aio_read(SMB_STRUCT_AIOCB *aiocb);
int sys_aio_write(SMB_STRUCT_AIOCB *aiocb);
ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb);
int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb);
int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb);
int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb);
int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout);
struct stat;
void init_stat_ex_from_stat (struct stat_ex *dst,

View File

@ -450,12 +450,6 @@ enum vfs_fallocate_mode {
VFS_FALLOCATE_KEEP_SIZE = 1
};
/*
* forward declaration required here until the posix aio functions
* leave the VFS
*/
struct aiocb;
/*
Available VFS operations. These values must be in sync with vfs_ops struct
(struct vfs_fn_pointers and struct vfs_handle_pointers inside of struct vfs_ops).
@ -709,13 +703,6 @@ struct vfs_fn_pointers {
int (*fsetxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags);
/* aio operations */
int (*aio_read_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
int (*aio_write_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
ssize_t (*aio_return_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
int (*aio_cancel_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
int (*aio_error_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
int (*aio_fsync_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb);
int (*aio_suspend_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *timeout);
bool (*aio_force_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp);
/* offline operations */
@ -1147,25 +1134,6 @@ int smb_vfs_call_lsetxattr(struct vfs_handle_struct *handle, const char *path,
int smb_vfs_call_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp, const char *name,
const void *value, size_t size, int flags);
int smb_vfs_call_aio_read(struct vfs_handle_struct *handle,
struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
int smb_vfs_call_aio_write(struct vfs_handle_struct *handle,
struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
ssize_t smb_vfs_call_aio_return(struct vfs_handle_struct *handle,
struct files_struct *fsp,
SMB_STRUCT_AIOCB *aiocb);
int smb_vfs_call_aio_cancel(struct vfs_handle_struct *handle,
struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
int smb_vfs_call_aio_error(struct vfs_handle_struct *handle,
struct files_struct *fsp,
SMB_STRUCT_AIOCB *aiocb);
int smb_vfs_call_aio_fsync(struct vfs_handle_struct *handle,
struct files_struct *fsp, int op,
SMB_STRUCT_AIOCB *aiocb);
int smb_vfs_call_aio_suspend(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const SMB_STRUCT_AIOCB * const aiocb[], int n,
const struct timespec *timeout);
bool smb_vfs_call_aio_force(struct vfs_handle_struct *handle,
struct files_struct *fsp);
bool smb_vfs_call_is_offline(struct vfs_handle_struct *handle,

View File

@ -573,41 +573,6 @@
#define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) \
smb_vfs_call_fsetxattr((handle)->next,(fsp),(name),(value),(size),(flags))
#define SMB_VFS_AIO_READ(fsp,aiocb) \
smb_vfs_call_aio_read((fsp)->conn->vfs_handles, (fsp), (aiocb))
#define SMB_VFS_NEXT_AIO_READ(handle,fsp,aiocb) \
smb_vfs_call_aio_read((handle)->next,(fsp),(aiocb))
#define SMB_VFS_AIO_WRITE(fsp,aiocb) \
smb_vfs_call_aio_write((fsp)->conn->vfs_handles, (fsp), (aiocb))
#define SMB_VFS_NEXT_AIO_WRITE(handle,fsp,aiocb) \
smb_vfs_call_aio_write((handle)->next,(fsp),(aiocb))
#define SMB_VFS_AIO_RETURN(fsp,aiocb) \
smb_vfs_call_aio_return((fsp)->conn->vfs_handles, (fsp), (aiocb))
#define SMB_VFS_NEXT_AIO_RETURN(handle,fsp,aiocb) \
smb_vfs_call_aio_return((handle)->next,(fsp),(aiocb))
#define SMB_VFS_AIO_CANCEL(fsp,aiocb) \
smb_vfs_call_aio_cancel((fsp)->conn->vfs_handles, (fsp), (aiocb))
#define SMB_VFS_NEXT_AIO_CANCEL(handle,fsp,aiocb) \
smb_vfs_call_aio_cancel((handle)->next,(fsp),(aiocb))
#define SMB_VFS_AIO_ERROR(fsp,aiocb) \
smb_vfs_call_aio_error((fsp)->conn->vfs_handles, (fsp),(aiocb))
#define SMB_VFS_NEXT_AIO_ERROR(handle,fsp,aiocb) \
smb_vfs_call_aio_error((handle)->next,(fsp),(aiocb))
#define SMB_VFS_AIO_FSYNC(fsp,op,aiocb) \
smb_vfs_call_aio_fsync((fsp)->conn->vfs_handles, (fsp), (op),(aiocb))
#define SMB_VFS_NEXT_AIO_FSYNC(handle,fsp,op,aiocb) \
smb_vfs_call_aio_fsync((handle)->next,(fsp),(op),(aiocb))
#define SMB_VFS_AIO_SUSPEND(fsp,aiocb,n,ts) \
smb_vfs_call_aio_suspend((fsp)->conn->vfs_handles, (fsp),(aiocb),(n),(ts))
#define SMB_VFS_NEXT_AIO_SUSPEND(handle,fsp,aiocb,n,ts) \
smb_vfs_call_aio_suspend((handle)->next,(fsp),(aiocb),(n),(ts))
#define SMB_VFS_AIO_FORCE(fsp) \
smb_vfs_call_aio_force((fsp)->conn->vfs_handles, (fsp))
#define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \

View File

@ -35,10 +35,6 @@
#include <sys/prctl.h>
#endif
#if defined(HAVE_AIO_H)
#include <aio.h>
#endif
/*
The idea is that this file will eventually have wrappers around all
important system calls in samba. The aims are:
@ -1383,147 +1379,3 @@ int sys_get_number_of_cores(void)
return ret;
}
#endif
#if defined(HAVE_AIO)
/*******************************************************************
An aio_read wrapper.
********************************************************************/
int sys_aio_read(SMB_STRUCT_AIOCB *aiocb)
{
#if defined(HAVE_AIO_READ)
return aio_read(aiocb);
#else
errno = ENOSYS;
return -1;
#endif
}
/*******************************************************************
An aio_write wrapper.
********************************************************************/
int sys_aio_write(SMB_STRUCT_AIOCB *aiocb)
{
#if defined(HAVE_AIO_WRITE)
return aio_write(aiocb);
#else
errno = ENOSYS;
return -1;
#endif
}
/*******************************************************************
An aio_return wrapper.
********************************************************************/
ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb)
{
#if defined(HAVE_AIO_RETURN)
return aio_return(aiocb);
#else
errno = ENOSYS;
return -1;
#endif
}
/*******************************************************************
An aio_cancel wrapper.
********************************************************************/
int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb)
{
#if defined(HAVE_AIO_CANCEL)
return aio_cancel(fd, aiocb);
#else
errno = ENOSYS;
return -1;
#endif
}
/*******************************************************************
An aio_error wrapper.
********************************************************************/
int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb)
{
#if defined(HAVE_AIO_ERROR)
return aio_error(aiocb);
#else
errno = ENOSYS;
return -1;
#endif
}
/*******************************************************************
An aio_fsync wrapper.
********************************************************************/
int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb)
{
#if defined(HAVE_AIO_FSYNC)
return aio_fsync(op, aiocb);
#else
errno = ENOSYS;
return -1;
#endif
}
/*******************************************************************
An aio_fsync wrapper.
********************************************************************/
int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout)
{
#if defined(HAVE_AIO_FSYNC)
return aio_suspend(cblist, n, timeout);
#else
errno = ENOSYS;
return -1;
#endif
}
#else /* !HAVE_AIO */
int sys_aio_read(SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
int sys_aio_write(SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb)
{
errno = ENOSYS;
return -1;
}
int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout)
{
errno = ENOSYS;
return -1;
}
#endif /* HAVE_AIO */

View File

@ -2155,69 +2155,6 @@ static int vfswrap_fsetxattr(struct vfs_handle_struct *handle, struct files_stru
return fsetxattr(fsp->fh->fd, name, value, size, flags);
}
static int vfswrap_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
int ret;
if (!initialize_async_io_handler()) {
errno = ENOSYS;
return -1;
}
/*
* aio_read must be done as root, because in the glibc aio
* implementation the helper thread needs to be able to send a signal
* to the main thread, even when it has done a seteuid() to a
* different user.
*/
become_root();
ret = sys_aio_read(aiocb);
unbecome_root();
return ret;
}
static int vfswrap_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
int ret;
if (!initialize_async_io_handler()) {
errno = ENOSYS;
return -1;
}
/*
* aio_write must be done as root, because in the glibc aio
* implementation the helper thread needs to be able to send a signal
* to the main thread, even when it has done a seteuid() to a
* different user.
*/
become_root();
ret = sys_aio_write(aiocb);
unbecome_root();
return ret;
}
static ssize_t vfswrap_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
return sys_aio_return(aiocb);
}
static int vfswrap_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
return sys_aio_cancel(fsp->fh->fd, aiocb);
}
static int vfswrap_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
return sys_aio_error(aiocb);
}
static int vfswrap_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
{
return sys_aio_fsync(op, aiocb);
}
static int vfswrap_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *timeout)
{
return sys_aio_suspend(aiocb, n, timeout);
}
static bool vfswrap_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
{
return false;
@ -2393,13 +2330,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
.fsetxattr_fn = vfswrap_fsetxattr,
/* aio operations */
.aio_read_fn = vfswrap_aio_read,
.aio_write_fn = vfswrap_aio_write,
.aio_return_fn = vfswrap_aio_return,
.aio_cancel_fn = vfswrap_aio_cancel,
.aio_error_fn = vfswrap_aio_error,
.aio_fsync_fn = vfswrap_aio_fsync,
.aio_suspend_fn = vfswrap_aio_suspend,
.aio_force_fn = vfswrap_aio_force,
/* offline operations */

View File

@ -205,13 +205,6 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_FSETXATTR,
/* aio operations */
SMB_VFS_OP_AIO_READ,
SMB_VFS_OP_AIO_WRITE,
SMB_VFS_OP_AIO_RETURN,
SMB_VFS_OP_AIO_CANCEL,
SMB_VFS_OP_AIO_ERROR,
SMB_VFS_OP_AIO_FSYNC,
SMB_VFS_OP_AIO_SUSPEND,
SMB_VFS_OP_AIO_FORCE,
/* offline operations */
@ -332,13 +325,6 @@ static struct {
{ SMB_VFS_OP_FREMOVEXATTR, "fremovexattr" },
{ SMB_VFS_OP_SETXATTR, "setxattr" },
{ SMB_VFS_OP_FSETXATTR, "fsetxattr" },
{ SMB_VFS_OP_AIO_READ, "aio_read" },
{ SMB_VFS_OP_AIO_WRITE, "aio_write" },
{ SMB_VFS_OP_AIO_RETURN,"aio_return" },
{ SMB_VFS_OP_AIO_CANCEL,"aio_cancel" },
{ SMB_VFS_OP_AIO_ERROR, "aio_error" },
{ SMB_VFS_OP_AIO_FSYNC, "aio_fsync" },
{ SMB_VFS_OP_AIO_SUSPEND,"aio_suspend" },
{ SMB_VFS_OP_AIO_FORCE, "aio_force" },
{ SMB_VFS_OP_IS_OFFLINE, "is_offline" },
{ SMB_VFS_OP_SET_OFFLINE, "set_offline" },
@ -2212,83 +2198,6 @@ static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle,
return result;
}
static int smb_full_audit_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
int result;
result = SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
do_log(SMB_VFS_OP_AIO_READ, (result >= 0), handle,
"%s", fsp_str_do_log(fsp));
return result;
}
static int smb_full_audit_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
int result;
result = SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
do_log(SMB_VFS_OP_AIO_WRITE, (result >= 0), handle,
"%s", fsp_str_do_log(fsp));
return result;
}
static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
int result;
result = SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
do_log(SMB_VFS_OP_AIO_RETURN, (result >= 0), handle,
"%s", fsp_str_do_log(fsp));
return result;
}
static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
int result;
result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
do_log(SMB_VFS_OP_AIO_CANCEL, (result >= 0), handle,
"%s", fsp_str_do_log(fsp));
return result;
}
static int smb_full_audit_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
int result;
result = SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
do_log(SMB_VFS_OP_AIO_ERROR, (result >= 0), handle,
"%s", fsp_str_do_log(fsp));
return result;
}
static int smb_full_audit_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
{
int result;
result = SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
do_log(SMB_VFS_OP_AIO_FSYNC, (result >= 0), handle,
"%s", fsp_str_do_log(fsp));
return result;
}
static int smb_full_audit_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts)
{
int result;
result = SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
do_log(SMB_VFS_OP_AIO_SUSPEND, (result >= 0), handle,
"%s", fsp_str_do_log(fsp));
return result;
}
static bool smb_full_audit_aio_force(struct vfs_handle_struct *handle,
struct files_struct *fsp)
{
@ -2433,13 +2342,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.fremovexattr_fn = smb_full_audit_fremovexattr,
.setxattr_fn = smb_full_audit_setxattr,
.fsetxattr_fn = smb_full_audit_fsetxattr,
.aio_read_fn = smb_full_audit_aio_read,
.aio_write_fn = smb_full_audit_aio_write,
.aio_return_fn = smb_full_audit_aio_return,
.aio_cancel_fn = smb_full_audit_aio_cancel,
.aio_error_fn = smb_full_audit_aio_error,
.aio_fsync_fn = smb_full_audit_aio_fsync,
.aio_suspend_fn = smb_full_audit_aio_suspend,
.aio_force_fn = smb_full_audit_aio_force,
.is_offline_fn = smb_full_audit_is_offline,
.set_offline_fn = smb_full_audit_set_offline,

View File

@ -2225,147 +2225,6 @@ static int smb_time_audit_fsetxattr(struct vfs_handle_struct *handle,
return result;
}
static int smb_time_audit_aio_read(struct vfs_handle_struct *handle,
struct files_struct *fsp,
SMB_STRUCT_AIOCB *aiocb)
{
int result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
result = SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
smb_time_audit_log("aio_read", timediff);
}
return result;
}
static int smb_time_audit_aio_write(struct vfs_handle_struct *handle,
struct files_struct *fsp,
SMB_STRUCT_AIOCB *aiocb)
{
int result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
result = SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
smb_time_audit_log("aio_write", timediff);
}
return result;
}
static ssize_t smb_time_audit_aio_return(struct vfs_handle_struct *handle,
struct files_struct *fsp,
SMB_STRUCT_AIOCB *aiocb)
{
ssize_t result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
result = SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
smb_time_audit_log("aio_return", timediff);
}
return result;
}
static int smb_time_audit_aio_cancel(struct vfs_handle_struct *handle,
struct files_struct *fsp,
SMB_STRUCT_AIOCB *aiocb)
{
int result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
smb_time_audit_log("aio_cancel", timediff);
}
return result;
}
static int smb_time_audit_aio_error(struct vfs_handle_struct *handle,
struct files_struct *fsp,
SMB_STRUCT_AIOCB *aiocb)
{
int result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
result = SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
smb_time_audit_log("aio_error", timediff);
}
return result;
}
static int smb_time_audit_aio_fsync(struct vfs_handle_struct *handle,
struct files_struct *fsp, int op,
SMB_STRUCT_AIOCB *aiocb)
{
int result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
result = SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
smb_time_audit_log("aio_fsync", timediff);
}
return result;
}
static int smb_time_audit_aio_suspend(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const SMB_STRUCT_AIOCB * const aiocb[],
int n, const struct timespec *ts)
{
int result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
result = SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
smb_time_audit_log("aio_suspend", timediff);
}
return result;
}
static bool smb_time_audit_aio_force(struct vfs_handle_struct *handle,
struct files_struct *fsp)
{
@ -2495,13 +2354,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
.fremovexattr_fn = smb_time_audit_fremovexattr,
.setxattr_fn = smb_time_audit_setxattr,
.fsetxattr_fn = smb_time_audit_fsetxattr,
.aio_read_fn = smb_time_audit_aio_read,
.aio_write_fn = smb_time_audit_aio_write,
.aio_return_fn = smb_time_audit_aio_return,
.aio_cancel_fn = smb_time_audit_aio_cancel,
.aio_error_fn = smb_time_audit_aio_error,
.aio_fsync_fn = smb_time_audit_aio_fsync,
.aio_suspend_fn = smb_time_audit_aio_suspend,
.aio_force_fn = smb_time_audit_aio_force,
};

View File

@ -23,8 +23,6 @@
#include "smbd/globals.h"
#include "../lib/util/tevent_ntstatus.h"
#if defined(HAVE_AIO)
/****************************************************************************
The buffer we keep around whilst an aio request is in process.
*****************************************************************************/
@ -48,11 +46,6 @@ bool aio_write_through_requested(struct aio_extra *aio_ex)
return aio_ex->write_through;
}
bool initialize_async_io_handler(void)
{
return true;
}
static int aio_extra_destructor(struct aio_extra *aio_ex)
{
outstanding_aio_calls--;
@ -891,11 +884,6 @@ static void aio_pwrite_smb2_done(struct tevent_req *req)
Handle any aio completion inline.
*****************************************************************************/
void smbd_aio_complete_aio_ex(struct aio_extra *aio_ex)
{
return;
}
void aio_fsp_close(files_struct *fsp)
{
unsigned i;
@ -907,67 +895,3 @@ void aio_fsp_close(files_struct *fsp)
aio_ex->fsp = NULL;
}
}
#else
bool initialize_async_io_handler(void)
{
return false;
}
NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
struct smb_request *smbreq,
files_struct *fsp, off_t startpos,
size_t smb_maxcnt)
{
return NT_STATUS_RETRY;
}
NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
struct smb_request *smbreq,
files_struct *fsp, const char *data,
off_t startpos,
size_t numtowrite)
{
return NT_STATUS_RETRY;
}
bool cancel_smb2_aio(struct smb_request *smbreq)
{
return false;
}
NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
struct smb_request *smbreq,
files_struct *fsp,
TALLOC_CTX *ctx,
DATA_BLOB *preadbuf,
off_t startpos,
size_t smb_maxcnt)
{
return NT_STATUS_RETRY;
}
NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
struct smb_request *smbreq,
files_struct *fsp,
uint64_t in_offset,
DATA_BLOB in_data,
bool write_through)
{
return NT_STATUS_RETRY;
}
void aio_fsp_close(files_struct *fsp)
{
return;
}
int wait_for_aio_completion(files_struct *fsp)
{
return 0;
}
void smbd_aio_complete_mid(uint64_t mid);
#endif

View File

@ -65,7 +65,6 @@ void srv_set_signing(struct smbd_server_connection *conn,
/* The following definitions come from smbd/aio.c */
bool aio_write_through_requested(struct aio_extra *aio_ex);
bool initialize_async_io_handler(void);
NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
struct smb_request *req,
files_struct *fsp, off_t startpos,
@ -90,8 +89,6 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
bool write_through);
bool cancel_smb2_aio(struct smb_request *smbreq);
void aio_fsp_close(files_struct *fsp);
int wait_for_aio_completion(files_struct *fsp);
void smbd_aio_complete_aio_ex(struct aio_extra *aio_ex);
/* The following definitions come from smbd/blocking.c */

View File

@ -2369,60 +2369,6 @@ int smb_vfs_call_fsetxattr(struct vfs_handle_struct *handle,
return handle->fns->fsetxattr_fn(handle, fsp, name, value, size, flags);
}
int smb_vfs_call_aio_read(struct vfs_handle_struct *handle,
struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
VFS_FIND(aio_read);
return handle->fns->aio_read_fn(handle, fsp, aiocb);
}
int smb_vfs_call_aio_write(struct vfs_handle_struct *handle,
struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
VFS_FIND(aio_write);
return handle->fns->aio_write_fn(handle, fsp, aiocb);
}
ssize_t smb_vfs_call_aio_return(struct vfs_handle_struct *handle,
struct files_struct *fsp,
SMB_STRUCT_AIOCB *aiocb)
{
VFS_FIND(aio_return);
return handle->fns->aio_return_fn(handle, fsp, aiocb);
}
int smb_vfs_call_aio_cancel(struct vfs_handle_struct *handle,
struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
{
VFS_FIND(aio_cancel);
return handle->fns->aio_cancel_fn(handle, fsp, aiocb);
}
int smb_vfs_call_aio_error(struct vfs_handle_struct *handle,
struct files_struct *fsp,
SMB_STRUCT_AIOCB *aiocb)
{
VFS_FIND(aio_error);
return handle->fns->aio_error_fn(handle, fsp, aiocb);
}
int smb_vfs_call_aio_fsync(struct vfs_handle_struct *handle,
struct files_struct *fsp, int op,
SMB_STRUCT_AIOCB *aiocb)
{
VFS_FIND(aio_fsync);
return handle->fns->aio_fsync_fn(handle, fsp, op, aiocb);
}
int smb_vfs_call_aio_suspend(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const SMB_STRUCT_AIOCB * const aiocb[], int n,
const struct timespec *timeout)
{
VFS_FIND(aio_suspend);
return handle->fns->aio_suspend_fn(handle, fsp, aiocb, n, timeout);
}
bool smb_vfs_call_aio_force(struct vfs_handle_struct *handle,
struct files_struct *fsp)
{