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:	Mon, 11 Mar 2013 16:44:57 -0400
From:	Peter Hurley <peter@...leysoftware.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.cz>
Cc:	Sasha Levin <levinsasha928@...il.com>,
	Dave Jones <davej@...hat.com>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Shawn Guo <shawn.guo@...aro.org>, linux-kernel@...r.kernel.org,
	linux-serial@...r.kernel.org,
	Peter Hurley <peter@...leysoftware.com>
Subject: [PATCH v5 37/44] tty: Drop ldsem wait type

Now the lock failures are handled independently for reads and
writes, the wait flags are no longer necessary.

Signed-off-by: Peter Hurley <peter@...leysoftware.com>
---
 drivers/tty/tty_ldsem.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/tty/tty_ldsem.c b/drivers/tty/tty_ldsem.c
index d849fb85..ddfbdfe 100644
--- a/drivers/tty/tty_ldsem.c
+++ b/drivers/tty/tty_ldsem.c
@@ -76,9 +76,6 @@
 struct ldsem_waiter {
 	struct list_head list;
 	struct task_struct *task;
-	unsigned int flags;
-#define LDSEM_READ_WAIT		0x00000001
-#define LDSEM_WRITE_WAIT	0x00000002
 };
 
 /* Wake types for __ldsem_wake().  Note: RWSEM_WAKE_NO_CHECK implies
@@ -226,19 +223,13 @@ static struct ld_semaphore __sched *
 down_read_failed(struct ld_semaphore *sem, long timeout)
 {
 	struct ldsem_waiter waiter;
-	long flags = LDSEM_READ_WAIT;
 	long adjust = -LDSEM_ACTIVE_BIAS + LDSEM_WAIT_BIAS;
 
 	/* set up my own style of waitqueue */
 	raw_spin_lock_irq(&sem->wait_lock);
-
-	if (flags & LDSEM_READ_WAIT)
-		list_add_tail(&waiter.list, &sem->read_wait);
-	else
-		list_add_tail(&waiter.list, &sem->write_wait);
+	list_add_tail(&waiter.list, &sem->read_wait);
 
 	waiter.task = current;
-	waiter.flags = flags;
 	get_task_struct(current);
 
 	/* change the lock attempt to a wait --
@@ -287,19 +278,13 @@ static struct ld_semaphore __sched *
 down_write_failed(struct ld_semaphore *sem, long timeout)
 {
 	struct ldsem_waiter waiter;
-	long flags = LDSEM_WRITE_WAIT;
 	long adjust = -LDSEM_ACTIVE_BIAS;
 
 	/* set up my own style of waitqueue */
 	raw_spin_lock_irq(&sem->wait_lock);
-
-	if (flags & LDSEM_READ_WAIT)
-		list_add_tail(&waiter.list, &sem->read_wait);
-	else
-		list_add_tail(&waiter.list, &sem->write_wait);
+	list_add_tail(&waiter.list, &sem->write_wait);
 
 	waiter.task = current;
-	waiter.flags = flags;
 	get_task_struct(current);
 
 	/* change the lock attempt to a wait --
-- 
1.8.1.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