lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 29 Sep 2013 15:14:36 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Alexander Viro <viro@...iv.linux.org.uk>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 3/5] splice: Add sync parameter to wakeup_pipe_writers()

So that it can handle both of sync and normal wakeups in one place.
Although it doesn't have any sync user, it'll be introduced soon.

Cc: Jens Axboe <axboe@...nel.dk>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
 fs/splice.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/fs/splice.c b/fs/splice.c
index 77251152e1b8..0325e8b0d816 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -765,11 +765,15 @@ out:
 }
 EXPORT_SYMBOL(pipe_to_file);
 
-static void wakeup_pipe_writers(struct pipe_inode_info *pipe)
+static void wakeup_pipe_writers(struct pipe_inode_info *pipe, bool sync)
 {
 	smp_mb();
-	if (waitqueue_active(&pipe->wait))
-		wake_up_interruptible(&pipe->wait);
+	if (waitqueue_active(&pipe->wait)) {
+		if (sync)
+			wake_up_interruptible_sync(&pipe->wait);
+		else
+			wake_up_interruptible(&pipe->wait);
+	}
 	kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
 }
 
@@ -868,7 +872,7 @@ int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd)
 			return -ERESTARTSYS;
 
 		if (sd->need_wakeup) {
-			wakeup_pipe_writers(pipe);
+			wakeup_pipe_writers(pipe, false);
 			sd->need_wakeup = false;
 		}
 
@@ -908,7 +912,7 @@ EXPORT_SYMBOL(splice_from_pipe_begin);
 void splice_from_pipe_end(struct pipe_inode_info *pipe, struct splice_desc *sd)
 {
 	if (sd->need_wakeup)
-		wakeup_pipe_writers(pipe);
+		wakeup_pipe_writers(pipe, false);
 }
 EXPORT_SYMBOL(splice_from_pipe_end);
 
@@ -1935,7 +1939,7 @@ retry:
 		wakeup_pipe_readers(opipe, false);
 
 	if (input_wakeup)
-		wakeup_pipe_writers(ipipe);
+		wakeup_pipe_writers(ipipe, false);
 
 	return ret;
 }
-- 
1.7.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ