summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-06-27 22:53:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:58:05 -0500
commitf2f55d703d0dd549a83809d3e5cc5151569b48d6 (patch)
treef5c2e7747c6541d19472a0157215c54af1b2cd62 /source3/modules
parent7ebd74e6c502483b7f7c73943b698d6433c8c0b2 (diff)
downloadsamba-f2f55d703d0dd549a83809d3e5cc5151569b48d6.tar.gz
samba-f2f55d703d0dd549a83809d3e5cc5151569b48d6.tar.bz2
samba-f2f55d703d0dd549a83809d3e5cc5151569b48d6.zip
r7963: Add aio support to 3.0.
Jeremy. (This used to be commit 1de27da47051af08790317f5b48b02719d6b9934)
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_full_audit.c108
1 files changed, 108 insertions, 0 deletions
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index abb77bcbf4..aa9e047f0a 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -291,6 +291,14 @@ static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp, int fd, const char *name,
const void *value, size_t size, int flags);
+static int smb_full_audit_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
+static int smb_full_audit_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
+static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
+static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb);
+static int smb_full_audit_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
+static int smb_full_audit_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb);
+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);
+
/* VFS operations */
static vfs_op_tuple audit_op_tuples[] = {
@@ -477,6 +485,21 @@ static vfs_op_tuple audit_op_tuples[] = {
{SMB_VFS_OP(smb_full_audit_fsetxattr), SMB_VFS_OP_FSETXATTR,
SMB_VFS_LAYER_LOGGER},
+ {SMB_VFS_OP(smb_full_audit_aio_read), SMB_VFS_OP_AIO_READ,
+ SMB_VFS_LAYER_LOGGER},
+ {SMB_VFS_OP(smb_full_audit_aio_write), SMB_VFS_OP_AIO_WRITE,
+ SMB_VFS_LAYER_LOGGER},
+ {SMB_VFS_OP(smb_full_audit_aio_return), SMB_VFS_OP_AIO_RETURN,
+ SMB_VFS_LAYER_LOGGER},
+ {SMB_VFS_OP(smb_full_audit_aio_cancel), SMB_VFS_OP_AIO_CANCEL,
+ SMB_VFS_LAYER_LOGGER},
+ {SMB_VFS_OP(smb_full_audit_aio_error), SMB_VFS_OP_AIO_ERROR,
+ SMB_VFS_LAYER_LOGGER},
+ {SMB_VFS_OP(smb_full_audit_aio_fsync), SMB_VFS_OP_AIO_FSYNC,
+ SMB_VFS_LAYER_LOGGER},
+ {SMB_VFS_OP(smb_full_audit_aio_suspend),SMB_VFS_OP_AIO_SUSPEND,
+ SMB_VFS_LAYER_LOGGER},
+
/* Finish VFS operations definition */
{SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP,
@@ -571,6 +594,13 @@ static struct {
{ SMB_VFS_OP_SETXATTR, "setxattr" },
{ SMB_VFS_OP_LSETXATTR, "lsetxattr" },
{ 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_LAST, NULL }
};
@@ -1835,6 +1865,84 @@ 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->fsp_name);
+
+ 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->fsp_name);
+
+ 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->fsp_name);
+
+ return result;
+}
+
+static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb)
+{
+ int result;
+
+ result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, fd, aiocb);
+ do_log(SMB_VFS_OP_AIO_CANCEL, (result >= 0), handle,
+ "%s", fsp->fsp_name);
+
+ 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->fsp_name);
+
+ 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->fsp_name);
+
+ 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->fsp_name);
+
+ return result;
+}
+
+
NTSTATUS vfs_full_audit_init(void)
{
NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION,