From fe62c33fedeb94c440987aa257dd7f893ae988c6 Mon Sep 17 00:00:00 2001 From: Matt Wagantall Date: Thu, 17 Feb 2011 12:39:10 -0800 Subject: [PATCH] wait: Add missing __wait_io_event_interruptible implementation wait_io_event_interruptible was added previously, but __wait_io_event_interruptible was never implemented. Fix it. Change-Id: I79caf0e13f61f0f4676fa6c600d7bdf2b8d9af50 Signed-off-by: Matt Wagantall (cherry picked from commit 054aaf03b6bb437b11ee37ac0cc3c91fc1ab7258) --- include/linux/wait.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/wait.h b/include/linux/wait.h index f0e1ca2118f..e2094acf2b9 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -346,6 +346,24 @@ do { \ __ret; \ }) +#define __wait_io_event_interruptible(wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + io_schedule(); \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + finish_wait(&wq, &__wait); \ +} while (0) + /** * wait_io_event_interruptible - sleep until an io condition gets true * @wq: the waitqueue to wait on