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
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
}
-static bool initialize_async_io_handler(void)
+bool initialize_async_io_handler(void)
{
static bool tried_signal_setup = false;
size_t min_aio_read_size = lp_aio_read_size(SNUM(conn));
int ret;
- /* Ensure aio is initialized. */
- if (!initialize_async_io_handler()) {
- return NT_STATUS_RETRY;
- }
-
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
DEBUG(10, ("AIO on streams not yet supported\n"));
size_t min_aio_write_size = lp_aio_write_size(SNUM(conn));
int ret;
- /* Ensure aio is initialized. */
- if (!initialize_async_io_handler()) {
- return NT_STATUS_RETRY;
- }
-
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
DEBUG(10, ("AIO on streams not yet supported\n"));
size_t min_aio_read_size = lp_aio_read_size(SNUM(conn));
int ret;
- /* Ensure aio is initialized. */
- if (!initialize_async_io_handler()) {
- return NT_STATUS_RETRY;
- }
-
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
DEBUG(10, ("AIO on streams not yet supported\n"));
size_t min_aio_write_size = lp_aio_write_size(SNUM(conn));
int ret;
- /* Ensure aio is initialized. */
- if (!initialize_async_io_handler()) {
- return NT_STATUS_RETRY;
- }
-
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
DEBUG(10, ("AIO on streams not yet supported\n"));
}
#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,