diff options
author | Jeremy Allison <jra@samba.org> | 2005-06-27 22:53:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:58:05 -0500 |
commit | f2f55d703d0dd549a83809d3e5cc5151569b48d6 (patch) | |
tree | f5c2e7747c6541d19472a0157215c54af1b2cd62 /examples | |
parent | 7ebd74e6c502483b7f7c73943b698d6433c8c0b2 (diff) | |
download | samba-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 'examples')
-rw-r--r-- | examples/VFS/skel_opaque.c | 44 | ||||
-rw-r--r-- | examples/VFS/skel_transparent.c | 44 |
2 files changed, 88 insertions, 0 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index a3a42912f8..a3aab55c3e 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -487,6 +487,41 @@ static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,in return -1; } +static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + return vfswrap_aio_read(NULL, fsp, aiocb); +} + +static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + return vfswrap_aio_write(NULL, fsp, aiocb); +} + +static ssize_t skel_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + return vfswrap_aio_return(NULL, fsp, aiocb); +} + +static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb) +{ + return vfswrap_aio_cancel(NULL, fsp, fd, aiocb); +} + +static int skel_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + return vfswrap_aio_error(NULL, fsp, aiocb); +} + +static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb) +{ + return vfswrap_aio_fsync(NULL, 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 vfswrap_aioi_suspend(NULL, fsp, aiocb, n, ts); +} + /* VFS operations structure */ static vfs_op_tuple skel_op_tuples[] = { @@ -590,6 +625,15 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_lsetxattr), SMB_VFS_OP_LSETXATTR, SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(skel_fsetxattr), SMB_VFS_OP_FSETXATTR, SMB_VFS_LAYER_OPAQUE}, + /* AIO operations. */ + {SMB_VFS_OP(skel_aio_read), SMB_VFS_OP_AIO_READ, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(skel_aio_write), SMB_VFS_OP_AIO_WRITE, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(skel_aio_return), SMB_VFS_OP_AIO_RETURN, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(skel_aio_cancel), SMB_VFS_OP_AIO_CANCEL, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(skel_aio_error), SMB_VFS_OP_AIO_ERROR, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(skel_aio_fsync), SMB_VFS_OP_AIO_FSYNC, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(skel_aio_suspend), SMB_VFS_OP_AIO_SUSPEND, SMB_VFS_LAYER_OPAQUE}, + {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} }; diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 8be1a7fb44..81069765d0 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -456,6 +456,41 @@ static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,in return SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, 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(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, int fd, SMB_STRUCT_AIOCB *aiocb) +{ + return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, fd, aiocb); +} + +static int skel_aio_error(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); +} + /* VFS operations structure */ static vfs_op_tuple skel_op_tuples[] = { @@ -557,6 +592,15 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_lsetxattr), SMB_VFS_OP_LSETXATTR, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_fsetxattr), SMB_VFS_OP_FSETXATTR, SMB_VFS_LAYER_TRANSPARENT}, + /* AIO operations. */ + {SMB_VFS_OP(skel_aio_read), SMB_VFS_OP_AIO_READ, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_write), SMB_VFS_OP_AIO_WRITE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_return), SMB_VFS_OP_AIO_RETURN, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_cancel), SMB_VFS_OP_AIO_CANCEL, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_error), SMB_VFS_OP_AIO_ERROR, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_fsync), SMB_VFS_OP_AIO_FSYNC, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_aio_suspend), SMB_VFS_OP_AIO_SUSPEND, SMB_VFS_LAYER_TRANSPARENT}, + {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} }; |