s3: Survive an idle child that was killed
[Samba.git] / source3 / modules / vfs_aio_fork.c
blob4ddc71ee9d2d711356b96c5409d76282471ae9c0
1 /*
2 * Simulate the Posix AIO using mmap/fork
4 * Copyright (C) Volker Lendecke 2008
5 * Copyright (C) Jeremy Allison 2010
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include "includes.h"
24 struct mmap_area {
25 size_t size;
26 volatile void *ptr;
29 static int mmap_area_destructor(struct mmap_area *area)
31 munmap((void *)area->ptr, area->size);
32 return 0;
35 static struct mmap_area *mmap_area_init(TALLOC_CTX *mem_ctx, size_t size)
37 struct mmap_area *result;
38 int fd;
40 result = talloc(mem_ctx, struct mmap_area);
41 if (result == NULL) {
42 DEBUG(0, ("talloc failed\n"));
43 goto fail;
46 fd = open("/dev/zero", O_RDWR);
47 if (fd == -1) {
48 DEBUG(3, ("open(\"/dev/zero\") failed: %s\n",
49 strerror(errno)));
50 goto fail;
53 result->ptr = mmap(NULL, size, PROT_READ|PROT_WRITE,
54 MAP_SHARED|MAP_FILE, fd, 0);
55 if (result->ptr == MAP_FAILED) {
56 DEBUG(1, ("mmap failed: %s\n", strerror(errno)));
57 goto fail;
60 close(fd);
62 result->size = size;
63 talloc_set_destructor(result, mmap_area_destructor);
65 return result;
67 fail:
68 TALLOC_FREE(result);
69 return NULL;
72 struct rw_cmd {
73 size_t n;
74 SMB_OFF_T offset;
75 bool read_cmd;
78 struct rw_ret {
79 ssize_t size;
80 int ret_errno;
83 struct aio_child_list;
85 struct aio_child {
86 struct aio_child *prev, *next;
87 struct aio_child_list *list;
88 SMB_STRUCT_AIOCB *aiocb;
89 pid_t pid;
90 int sockfd;
91 struct fd_event *sock_event;
92 struct rw_ret retval;
93 struct mmap_area *map; /* ==NULL means write request */
94 bool dont_delete; /* Marked as in use since last cleanup */
95 bool cancelled;
96 bool read_cmd;
99 struct aio_child_list {
100 struct aio_child *children;
101 struct timed_event *cleanup_event;
104 static void free_aio_children(void **p)
106 TALLOC_FREE(*p);
109 static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd)
111 struct msghdr msg;
112 struct iovec iov[1];
113 ssize_t n;
114 #ifndef HAVE_MSGHDR_MSG_CONTROL
115 int newfd;
116 #endif
118 #ifdef HAVE_MSGHDR_MSG_CONTROL
119 union {
120 struct cmsghdr cm;
121 char control[CMSG_SPACE(sizeof(int))];
122 } control_un;
123 struct cmsghdr *cmptr;
125 msg.msg_control = control_un.control;
126 msg.msg_controllen = sizeof(control_un.control);
127 #else
128 #if HAVE_MSGHDR_MSG_ACCTRIGHTS
129 msg.msg_accrights = (caddr_t) &newfd;
130 msg.msg_accrightslen = sizeof(int);
131 #else
132 #error Can not pass file descriptors
133 #endif
134 #endif
136 msg.msg_name = NULL;
137 msg.msg_namelen = 0;
139 iov[0].iov_base = (void *)ptr;
140 iov[0].iov_len = nbytes;
141 msg.msg_iov = iov;
142 msg.msg_iovlen = 1;
144 if ( (n = recvmsg(fd, &msg, 0)) <= 0) {
145 return(n);
148 #ifdef HAVE_MSGHDR_MSG_CONTROL
149 if ((cmptr = CMSG_FIRSTHDR(&msg)) != NULL
150 && cmptr->cmsg_len == CMSG_LEN(sizeof(int))) {
151 if (cmptr->cmsg_level != SOL_SOCKET) {
152 DEBUG(10, ("control level != SOL_SOCKET"));
153 errno = EINVAL;
154 return -1;
156 if (cmptr->cmsg_type != SCM_RIGHTS) {
157 DEBUG(10, ("control type != SCM_RIGHTS"));
158 errno = EINVAL;
159 return -1;
161 *recvfd = *((int *) CMSG_DATA(cmptr));
162 } else {
163 *recvfd = -1; /* descriptor was not passed */
165 #else
166 if (msg.msg_accrightslen == sizeof(int)) {
167 *recvfd = newfd;
169 else {
170 *recvfd = -1; /* descriptor was not passed */
172 #endif
174 return(n);
177 static ssize_t write_fd(int fd, void *ptr, size_t nbytes, int sendfd)
179 struct msghdr msg;
180 struct iovec iov[1];
182 #ifdef HAVE_MSGHDR_MSG_CONTROL
183 union {
184 struct cmsghdr cm;
185 char control[CMSG_SPACE(sizeof(int))];
186 } control_un;
187 struct cmsghdr *cmptr;
189 ZERO_STRUCT(msg);
190 ZERO_STRUCT(control_un);
192 msg.msg_control = control_un.control;
193 msg.msg_controllen = sizeof(control_un.control);
195 cmptr = CMSG_FIRSTHDR(&msg);
196 cmptr->cmsg_len = CMSG_LEN(sizeof(int));
197 cmptr->cmsg_level = SOL_SOCKET;
198 cmptr->cmsg_type = SCM_RIGHTS;
199 *((int *) CMSG_DATA(cmptr)) = sendfd;
200 #else
201 ZERO_STRUCT(msg);
202 msg.msg_accrights = (caddr_t) &sendfd;
203 msg.msg_accrightslen = sizeof(int);
204 #endif
206 msg.msg_name = NULL;
207 msg.msg_namelen = 0;
209 ZERO_STRUCT(iov);
210 iov[0].iov_base = (void *)ptr;
211 iov[0].iov_len = nbytes;
212 msg.msg_iov = iov;
213 msg.msg_iovlen = 1;
215 return (sendmsg(fd, &msg, 0));
218 static void aio_child_cleanup(struct event_context *event_ctx,
219 struct timed_event *te,
220 struct timeval now,
221 void *private_data)
223 struct aio_child_list *list = talloc_get_type_abort(
224 private_data, struct aio_child_list);
225 struct aio_child *child, *next;
227 TALLOC_FREE(list->cleanup_event);
229 for (child = list->children; child != NULL; child = next) {
230 next = child->next;
232 if (child->aiocb != NULL) {
233 DEBUG(10, ("child %d currently active\n",
234 (int)child->pid));
235 continue;
238 if (child->dont_delete) {
239 DEBUG(10, ("Child %d was active since last cleanup\n",
240 (int)child->pid));
241 child->dont_delete = false;
242 continue;
245 DEBUG(10, ("Child %d idle for more than 30 seconds, "
246 "deleting\n", (int)child->pid));
248 TALLOC_FREE(child);
249 child = next;
252 if (list->children != NULL) {
254 * Re-schedule the next cleanup round
256 list->cleanup_event = event_add_timed(smbd_event_context(), list,
257 timeval_add(&now, 30, 0),
258 aio_child_cleanup, list);
263 static struct aio_child_list *init_aio_children(struct vfs_handle_struct *handle)
265 struct aio_child_list *data = NULL;
267 if (SMB_VFS_HANDLE_TEST_DATA(handle)) {
268 SMB_VFS_HANDLE_GET_DATA(handle, data, struct aio_child_list,
269 return NULL);
272 if (data == NULL) {
273 data = TALLOC_ZERO_P(NULL, struct aio_child_list);
274 if (data == NULL) {
275 return NULL;
280 * Regardless of whether the child_list had been around or not, make
281 * sure that we have a cleanup timed event. This timed event will
282 * delete itself when it finds that no children are around anymore.
285 if (data->cleanup_event == NULL) {
286 data->cleanup_event = event_add_timed(smbd_event_context(), data,
287 timeval_current_ofs(30, 0),
288 aio_child_cleanup, data);
289 if (data->cleanup_event == NULL) {
290 TALLOC_FREE(data);
291 return NULL;
295 if (!SMB_VFS_HANDLE_TEST_DATA(handle)) {
296 SMB_VFS_HANDLE_SET_DATA(handle, data, free_aio_children,
297 struct aio_child_list, return False);
300 return data;
303 static void aio_child_loop(int sockfd, struct mmap_area *map)
305 while (true) {
306 int fd = -1;
307 ssize_t ret;
308 struct rw_cmd cmd_struct;
309 struct rw_ret ret_struct;
311 ret = read_fd(sockfd, &cmd_struct, sizeof(cmd_struct), &fd);
312 if (ret != sizeof(cmd_struct)) {
313 DEBUG(10, ("read_fd returned %d: %s\n", (int)ret,
314 strerror(errno)));
315 exit(1);
318 DEBUG(10, ("aio_child_loop: %s %d bytes at %d from fd %d\n",
319 cmd_struct.read_cmd ? "read" : "write",
320 (int)cmd_struct.n, (int)cmd_struct.offset, fd));
322 #ifdef ENABLE_BUILD_FARM_HACKS
325 * In the build farm, we want erratic behaviour for
326 * async I/O times
328 uint8_t randval;
329 unsigned msecs;
331 * use generate_random_buffer, we just forked from a
332 * common parent state
334 generate_random_buffer(&randval, sizeof(randval));
335 msecs = randval + 20;
336 DEBUG(10, ("delaying for %u msecs\n", msecs));
337 smb_msleep(msecs);
339 #endif
342 ZERO_STRUCT(ret_struct);
344 if (cmd_struct.read_cmd) {
345 ret_struct.size = sys_pread(
346 fd, (void *)map->ptr, cmd_struct.n,
347 cmd_struct.offset);
348 #if 0
349 /* This breaks "make test" when run with aio_fork module. */
350 #ifdef ENABLE_BUILD_FARM_HACKS
351 ret_struct.size = MAX(1, ret_struct.size * 0.9);
352 #endif
353 #endif
355 else {
356 ret_struct.size = sys_pwrite(
357 fd, (void *)map->ptr, cmd_struct.n,
358 cmd_struct.offset);
361 DEBUG(10, ("aio_child_loop: syscall returned %d\n",
362 (int)ret_struct.size));
364 if (ret_struct.size == -1) {
365 ret_struct.ret_errno = errno;
369 * Close the fd before telling our parent we're done. The
370 * parent might close and re-open the file very quickly, and
371 * with system-level share modes (GPFS) we would get an
372 * unjustified SHARING_VIOLATION.
374 close(fd);
376 ret = write_data(sockfd, (char *)&ret_struct,
377 sizeof(ret_struct));
378 if (ret != sizeof(ret_struct)) {
379 DEBUG(10, ("could not write ret_struct: %s\n",
380 strerror(errno)));
381 exit(2);
386 static void handle_aio_completion(struct event_context *event_ctx,
387 struct fd_event *event, uint16 flags,
388 void *p)
390 struct aio_extra *aio_ex = NULL;
391 struct aio_child *child = (struct aio_child *)p;
392 NTSTATUS status;
394 DEBUG(10, ("handle_aio_completion called with flags=%d\n", flags));
396 if ((flags & EVENT_FD_READ) == 0) {
397 return;
400 status = read_data(child->sockfd, (char *)&child->retval,
401 sizeof(child->retval));
403 if (!NT_STATUS_IS_OK(status)) {
404 DEBUG(1, ("aio child %d died: %s\n", (int)child->pid,
405 nt_errstr(status)));
406 child->retval.size = -1;
407 child->retval.ret_errno = EIO;
410 if (child->aiocb == NULL) {
411 DEBUG(1, ("Inactive child died\n"));
412 TALLOC_FREE(child);
413 return;
416 if (child->cancelled) {
417 child->aiocb = NULL;
418 child->cancelled = false;
419 return;
422 if (child->read_cmd && (child->retval.size > 0)) {
423 SMB_ASSERT(child->retval.size <= child->aiocb->aio_nbytes);
424 memcpy((void *)child->aiocb->aio_buf, (void *)child->map->ptr,
425 child->retval.size);
428 aio_ex = (struct aio_extra *)child->aiocb->aio_sigevent.sigev_value.sival_ptr;
429 smbd_aio_complete_aio_ex(aio_ex);
432 static int aio_child_destructor(struct aio_child *child)
434 char c=0;
436 SMB_ASSERT((child->aiocb == NULL) || child->cancelled);
438 DEBUG(10, ("aio_child_destructor: removing child %d on fd %d\n",
439 child->pid, child->sockfd));
442 * closing the sockfd makes the child not return from recvmsg() on RHEL
443 * 5.5 so instead force the child to exit by writing bad data to it
445 write(child->sockfd, &c, sizeof(c));
446 close(child->sockfd);
447 DLIST_REMOVE(child->list->children, child);
448 return 0;
452 * We have to close all fd's in open files, we might incorrectly hold a system
453 * level share mode on a file.
456 static struct files_struct *close_fsp_fd(struct files_struct *fsp,
457 void *private_data)
459 if ((fsp->fh != NULL) && (fsp->fh->fd != -1)) {
460 close(fsp->fh->fd);
461 fsp->fh->fd = -1;
463 return NULL;
466 static NTSTATUS create_aio_child(struct smbd_server_connection *sconn,
467 struct aio_child_list *children,
468 size_t map_size,
469 struct aio_child **presult)
471 struct aio_child *result;
472 int fdpair[2];
473 NTSTATUS status;
475 fdpair[0] = fdpair[1] = -1;
477 result = TALLOC_ZERO_P(children, struct aio_child);
478 NT_STATUS_HAVE_NO_MEMORY(result);
480 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fdpair) == -1) {
481 status = map_nt_error_from_unix(errno);
482 DEBUG(10, ("socketpair() failed: %s\n", strerror(errno)));
483 goto fail;
486 DEBUG(10, ("fdpair = %d/%d\n", fdpair[0], fdpair[1]));
488 result->map = mmap_area_init(result, map_size);
489 if (result->map == NULL) {
490 status = map_nt_error_from_unix(errno);
491 DEBUG(0, ("Could not create mmap area\n"));
492 goto fail;
495 result->pid = sys_fork();
496 if (result->pid == -1) {
497 status = map_nt_error_from_unix(errno);
498 DEBUG(0, ("fork failed: %s\n", strerror(errno)));
499 goto fail;
502 if (result->pid == 0) {
503 close(fdpair[0]);
504 result->sockfd = fdpair[1];
505 files_forall(sconn, close_fsp_fd, NULL);
506 aio_child_loop(result->sockfd, result->map);
509 DEBUG(10, ("Child %d created with sockfd %d\n",
510 result->pid, fdpair[0]));
512 result->sockfd = fdpair[0];
513 close(fdpair[1]);
515 result->sock_event = event_add_fd(smbd_event_context(), result,
516 result->sockfd, EVENT_FD_READ,
517 handle_aio_completion,
518 result);
519 if (result->sock_event == NULL) {
520 status = NT_STATUS_NO_MEMORY;
521 DEBUG(0, ("event_add_fd failed\n"));
522 goto fail;
525 result->list = children;
526 DLIST_ADD(children->children, result);
528 talloc_set_destructor(result, aio_child_destructor);
530 *presult = result;
532 return NT_STATUS_OK;
534 fail:
535 if (fdpair[0] != -1) close(fdpair[0]);
536 if (fdpair[1] != -1) close(fdpair[1]);
537 TALLOC_FREE(result);
539 return status;
542 static NTSTATUS get_idle_child(struct vfs_handle_struct *handle,
543 struct aio_child **pchild)
545 struct aio_child_list *children;
546 struct aio_child *child;
547 NTSTATUS status;
549 children = init_aio_children(handle);
550 if (children == NULL) {
551 return NT_STATUS_NO_MEMORY;
554 for (child = children->children; child != NULL; child = child->next) {
555 if (child->aiocb == NULL) {
556 /* idle */
557 break;
561 if (child == NULL) {
562 DEBUG(10, ("no idle child found, creating new one\n"));
564 status = create_aio_child(handle->conn->sconn, children,
565 128*1024, &child);
566 if (!NT_STATUS_IS_OK(status)) {
567 DEBUG(10, ("create_aio_child failed: %s\n",
568 nt_errstr(status)));
569 return status;
573 child->dont_delete = true;
575 *pchild = child;
576 return NT_STATUS_OK;
579 static int aio_fork_read(struct vfs_handle_struct *handle,
580 struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
582 struct aio_child *child;
583 struct rw_cmd cmd;
584 ssize_t ret;
585 NTSTATUS status;
587 if (aiocb->aio_nbytes > 128*1024) {
588 /* TODO: support variable buffers */
589 errno = EINVAL;
590 return -1;
593 status = get_idle_child(handle, &child);
594 if (!NT_STATUS_IS_OK(status)) {
595 DEBUG(10, ("Could not get an idle child\n"));
596 return -1;
599 child->read_cmd = true;
600 child->aiocb = aiocb;
601 child->retval.ret_errno = EINPROGRESS;
603 ZERO_STRUCT(cmd);
604 cmd.n = aiocb->aio_nbytes;
605 cmd.offset = aiocb->aio_offset;
606 cmd.read_cmd = child->read_cmd;
608 DEBUG(10, ("sending fd %d to child %d\n", fsp->fh->fd,
609 (int)child->pid));
611 ret = write_fd(child->sockfd, &cmd, sizeof(cmd), fsp->fh->fd);
612 if (ret == -1) {
613 DEBUG(10, ("write_fd failed: %s\n", strerror(errno)));
614 return -1;
617 return 0;
620 static int aio_fork_write(struct vfs_handle_struct *handle,
621 struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
623 struct aio_child *child;
624 struct rw_cmd cmd;
625 ssize_t ret;
626 NTSTATUS status;
628 if (aiocb->aio_nbytes > 128*1024) {
629 /* TODO: support variable buffers */
630 errno = EINVAL;
631 return -1;
634 status = get_idle_child(handle, &child);
635 if (!NT_STATUS_IS_OK(status)) {
636 DEBUG(10, ("Could not get an idle child\n"));
637 return -1;
640 child->read_cmd = false;
641 child->aiocb = aiocb;
642 child->retval.ret_errno = EINPROGRESS;
644 memcpy((void *)child->map->ptr, (void *)aiocb->aio_buf,
645 aiocb->aio_nbytes);
647 ZERO_STRUCT(cmd);
648 cmd.n = aiocb->aio_nbytes;
649 cmd.offset = aiocb->aio_offset;
650 cmd.read_cmd = child->read_cmd;
652 DEBUG(10, ("sending fd %d to child %d\n", fsp->fh->fd,
653 (int)child->pid));
655 ret = write_fd(child->sockfd, &cmd, sizeof(cmd), fsp->fh->fd);
656 if (ret == -1) {
657 DEBUG(10, ("write_fd failed: %s\n", strerror(errno)));
658 return -1;
661 return 0;
664 static struct aio_child *aio_fork_find_child(struct vfs_handle_struct *handle,
665 SMB_STRUCT_AIOCB *aiocb)
667 struct aio_child_list *children;
668 struct aio_child *child;
670 children = init_aio_children(handle);
671 if (children == NULL) {
672 return NULL;
675 for (child = children->children; child != NULL; child = child->next) {
676 if (child->aiocb == aiocb) {
677 return child;
681 return NULL;
684 static ssize_t aio_fork_return_fn(struct vfs_handle_struct *handle,
685 struct files_struct *fsp,
686 SMB_STRUCT_AIOCB *aiocb)
688 struct aio_child *child = aio_fork_find_child(handle, aiocb);
690 if (child == NULL) {
691 errno = EINVAL;
692 DEBUG(0, ("returning EINVAL\n"));
693 return -1;
696 child->aiocb = NULL;
698 if (child->retval.size == -1) {
699 errno = child->retval.ret_errno;
702 return child->retval.size;
705 static int aio_fork_cancel(struct vfs_handle_struct *handle,
706 struct files_struct *fsp,
707 SMB_STRUCT_AIOCB *aiocb)
709 struct aio_child_list *children;
710 struct aio_child *child;
712 children = init_aio_children(handle);
713 if (children == NULL) {
714 errno = EINVAL;
715 return -1;
718 for (child = children->children; child != NULL; child = child->next) {
719 if (child->aiocb == NULL) {
720 continue;
722 if (child->aiocb->aio_fildes != fsp->fh->fd) {
723 continue;
725 if ((aiocb != NULL) && (child->aiocb != aiocb)) {
726 continue;
730 * We let the child do its job, but we discard the result when
731 * it's finished.
734 child->cancelled = true;
737 return AIO_CANCELED;
740 static int aio_fork_error_fn(struct vfs_handle_struct *handle,
741 struct files_struct *fsp,
742 SMB_STRUCT_AIOCB *aiocb)
744 struct aio_child *child = aio_fork_find_child(handle, aiocb);
746 if (child == NULL) {
747 errno = EINVAL;
748 return -1;
751 return child->retval.ret_errno;
754 static void aio_fork_suspend_timed_out(struct tevent_context *event_ctx,
755 struct tevent_timer *te,
756 struct timeval now,
757 void *private_data)
759 bool *timed_out = (bool *)private_data;
760 /* Remove this timed event handler. */
761 TALLOC_FREE(te);
762 *timed_out = true;
765 static int aio_fork_suspend(struct vfs_handle_struct *handle,
766 struct files_struct *fsp,
767 const SMB_STRUCT_AIOCB * const aiocb_array[],
768 int n,
769 const struct timespec *timeout)
771 struct aio_child_list *children = NULL;
772 TALLOC_CTX *frame = talloc_stackframe();
773 struct event_context *ev = NULL;
774 int i;
775 int ret = -1;
776 bool timed_out = false;
778 children = init_aio_children(handle);
779 if (children == NULL) {
780 errno = EINVAL;
781 goto out;
784 /* This is a blocking call, and has to use a sub-event loop. */
785 ev = event_context_init(frame);
786 if (ev == NULL) {
787 errno = ENOMEM;
788 goto out;
791 if (timeout) {
792 struct timeval tv = convert_timespec_to_timeval(*timeout);
793 struct tevent_timer *te = tevent_add_timer(ev,
794 frame,
795 timeval_current_ofs(tv.tv_sec,
796 tv.tv_usec),
797 aio_fork_suspend_timed_out,
798 &timed_out);
799 if (!te) {
800 errno = ENOMEM;
801 goto out;
805 for (i = 0; i < n; i++) {
806 struct aio_child *child = NULL;
807 const SMB_STRUCT_AIOCB *aiocb = aiocb_array[i];
809 if (!aiocb) {
810 continue;
814 * We're going to cheat here. We know that smbd/aio.c
815 * only calls this when it's waiting for every single
816 * outstanding call to finish on a close, so just wait
817 * individually for each IO to complete. We don't care
818 * what order they finish - only that they all do. JRA.
821 for (child = children->children; child != NULL; child = child->next) {
822 if (child->aiocb == NULL) {
823 continue;
825 if (child->aiocb->aio_fildes != fsp->fh->fd) {
826 continue;
828 if (child->aiocb != aiocb) {
829 continue;
832 if (child->aiocb->aio_sigevent.sigev_value.sival_ptr == NULL) {
833 continue;
836 /* We're never using this event on the
837 * main event context again... */
838 TALLOC_FREE(child->sock_event);
840 child->sock_event = event_add_fd(ev,
841 child,
842 child->sockfd,
843 EVENT_FD_READ,
844 handle_aio_completion,
845 child);
847 while (1) {
848 if (tevent_loop_once(ev) == -1) {
849 goto out;
852 if (timed_out) {
853 errno = EAGAIN;
854 goto out;
857 /* We set child->aiocb to NULL in our hooked
858 * AIO_RETURN(). */
859 if (child->aiocb == NULL) {
860 break;
866 ret = 0;
868 out:
870 TALLOC_FREE(frame);
871 return ret;
874 static struct vfs_fn_pointers vfs_aio_fork_fns = {
875 .aio_read = aio_fork_read,
876 .aio_write = aio_fork_write,
877 .aio_return_fn = aio_fork_return_fn,
878 .aio_cancel = aio_fork_cancel,
879 .aio_error_fn = aio_fork_error_fn,
880 .aio_suspend = aio_fork_suspend,
883 NTSTATUS vfs_aio_fork_init(void);
884 NTSTATUS vfs_aio_fork_init(void)
886 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
887 "aio_fork", &vfs_aio_fork_fns);