aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2018-11-24 17:06:01 +0000
committerMark Johnston <markj@FreeBSD.org>2018-11-24 17:06:01 +0000
commit792843c38f819a0966b6169fc86af05e88bc6ecd (patch)
tree58895a7e84fbc57c7263d9bba157eb10746b3cc3 /sys/kern/vfs_aio.c
parent36c4960ef829cf675aee22da292ea6002bd0d429 (diff)
downloadsrc-792843c38f819a0966b6169fc86af05e88bc6ecd.tar.gz
src-792843c38f819a0966b6169fc86af05e88bc6ecd.zip
Pass malloc flags directly through kevent(2) subroutines.
Some kevent functions have a boolean "waitok" parameter for use when calling malloc(9). Replace them with the corresponding malloc() flags: the desired behaviour is known at compile-time, so this eliminates a couple of conditional branches, and makes the code easier to read. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18318
Notes
Notes: svn path=/head/; revision=340900
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index a8bce0ee2500..5506e6ed14c7 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -1595,7 +1595,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj,
kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags;
kev.data = (intptr_t)job;
kev.udata = job->uaiocb.aio_sigevent.sigev_value.sival_ptr;
- error = kqfd_register(kqfd, &kev, td, 1);
+ error = kqfd_register(kqfd, &kev, td, M_WAITOK);
if (error)
goto aqueue_fail;
@@ -2164,7 +2164,8 @@ kern_lio_listio(struct thread *td, int mode, struct aiocb * const *uacb_list,
/* pass user defined sigval data */
kev.udata = lj->lioj_signal.sigev_value.sival_ptr;
error = kqfd_register(
- lj->lioj_signal.sigev_notify_kqueue, &kev, td, 1);
+ lj->lioj_signal.sigev_notify_kqueue, &kev, td,
+ M_WAITOK);
if (error) {
uma_zfree(aiolio_zone, lj);
return (error);