summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_aio_fork.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-07-09 09:00:55 +0200
committerJeremy Allison <jra@samba.org>2012-07-18 15:42:11 -0700
commitbf8696fe5dee4a829b6f7444cdd4e9a9aad2d110 (patch)
tree6440e10400b10fa538db61beeb7dd5a5ea53870b /source3/modules/vfs_aio_fork.c
parentb65ab9d5a397089653be976085dfe65c86c14811 (diff)
downloadsamba-bf8696fe5dee4a829b6f7444cdd4e9a9aad2d110.tar.gz
samba-bf8696fe5dee4a829b6f7444cdd4e9a9aad2d110.tar.bz2
samba-bf8696fe5dee4a829b6f7444cdd4e9a9aad2d110.zip
s3-aio_fork: Convert get_idle_child from NTSTATUS to errno
Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/modules/vfs_aio_fork.c')
-rw-r--r--source3/modules/vfs_aio_fork.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index 266e364596..21a7f1df42 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -558,16 +558,15 @@ static int create_aio_child(struct smbd_server_connection *sconn,
return ret;
}
-static NTSTATUS get_idle_child(struct vfs_handle_struct *handle,
- struct aio_child **pchild)
+static int get_idle_child(struct vfs_handle_struct *handle,
+ struct aio_child **pchild)
{
struct aio_child_list *children;
struct aio_child *child;
- NTSTATUS status;
children = init_aio_children(handle);
if (children == NULL) {
- return NT_STATUS_NO_MEMORY;
+ return ENOMEM;
}
for (child = children->children; child != NULL; child = child->next) {
@@ -587,14 +586,14 @@ static NTSTATUS get_idle_child(struct vfs_handle_struct *handle,
if (ret != 0) {
DEBUG(10, ("create_aio_child failed: %s\n",
strerror(errno)));
- return map_nt_error_from_unix(errno);
+ return ret;
}
}
child->dont_delete = true;
*pchild = child;
- return NT_STATUS_OK;
+ return 0;
}
static int aio_fork_read(struct vfs_handle_struct *handle,
@@ -603,7 +602,7 @@ static int aio_fork_read(struct vfs_handle_struct *handle,
struct aio_child *child;
struct rw_cmd cmd;
ssize_t ret;
- NTSTATUS status;
+ int err;
if (aiocb->aio_nbytes > 128*1024) {
/* TODO: support variable buffers */
@@ -611,9 +610,11 @@ static int aio_fork_read(struct vfs_handle_struct *handle,
return -1;
}
- status = get_idle_child(handle, &child);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("Could not get an idle child\n"));
+ err = get_idle_child(handle, &child);
+ if (err != 0) {
+ DEBUG(10, ("Could not get an idle child: %s\n",
+ strerror(err)));
+ errno = err;
return -1;
}
@@ -644,7 +645,7 @@ static int aio_fork_write(struct vfs_handle_struct *handle,
struct aio_child *child;
struct rw_cmd cmd;
ssize_t ret;
- NTSTATUS status;
+ int err;
if (aiocb->aio_nbytes > 128*1024) {
/* TODO: support variable buffers */
@@ -652,9 +653,11 @@ static int aio_fork_write(struct vfs_handle_struct *handle,
return -1;
}
- status = get_idle_child(handle, &child);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("Could not get an idle child\n"));
+ err = get_idle_child(handle, &child);
+ if (err != 0) {
+ DEBUG(10, ("Could not get an idle child: %s\n",
+ strerror(err)));
+ errno = err;
return -1;
}