linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] drivers/char/tty_io.c: remove pty_sem
       [not found] <20071204214954.656363725@mvista.com>
@ 2007-12-04  8:00 ` Daniel Walker
  2007-12-04 23:27   ` Alan Cox
  2007-12-04  8:00 ` [PATCH 2/3] drivers/isdn/i4l/isdn_tty.c: remove write_sem Daniel Walker
  2007-12-04  8:00 ` [PATCH 3/3] unix98 allocated_ptys_lock semaphore to mutex Daniel Walker
  2 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2007-12-04  8:00 UTC (permalink / raw)
  To: akpm; +Cc: mingo, linux-kernel, linux, jonathan, matthias.kaehlcke

[-- Attachment #1: remove-pty_sem-from-tty_bufhead.patch --]
[-- Type: text/plain, Size: 1140 bytes --]

I couldn't find any users, so removing it..

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 drivers/char/tty_io.c |    1 -
 include/linux/tty.h   |    1 -
 2 files changed, 2 deletions(-)

Index: linux-2.6.23/drivers/char/tty_io.c
===================================================================
--- linux-2.6.23.orig/drivers/char/tty_io.c
+++ linux-2.6.23/drivers/char/tty_io.c
@@ -3721,7 +3721,6 @@ static void initialize_tty_struct(struct
 	tty->buf.head = tty->buf.tail = NULL;
 	tty_buffer_init(tty);
 	INIT_DELAYED_WORK(&tty->buf.work, flush_to_ldisc);
-	init_MUTEX(&tty->buf.pty_sem);
 	mutex_init(&tty->termios_mutex);
 	init_waitqueue_head(&tty->write_wait);
 	init_waitqueue_head(&tty->read_wait);
Index: linux-2.6.23/include/linux/tty.h
===================================================================
--- linux-2.6.23.orig/include/linux/tty.h
+++ linux-2.6.23/include/linux/tty.h
@@ -73,7 +73,6 @@ struct tty_buffer {
 
 struct tty_bufhead {
 	struct delayed_work work;
-	struct semaphore pty_sem;
 	spinlock_t lock;
 	struct tty_buffer *head;	/* Queue head */
 	struct tty_buffer *tail;	/* Active buffer */

-- 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/3] drivers/isdn/i4l/isdn_tty.c: remove write_sem
       [not found] <20071204214954.656363725@mvista.com>
  2007-12-04  8:00 ` [PATCH 1/3] drivers/char/tty_io.c: remove pty_sem Daniel Walker
@ 2007-12-04  8:00 ` Daniel Walker
  2007-12-04  8:00 ` [PATCH 3/3] unix98 allocated_ptys_lock semaphore to mutex Daniel Walker
  2 siblings, 0 replies; 5+ messages in thread
From: Daniel Walker @ 2007-12-04  8:00 UTC (permalink / raw)
  To: akpm; +Cc: mingo, linux-kernel, linux, jonathan, matthias.kaehlcke

[-- Attachment #1: remove-isdn-write_sem.patch --]
[-- Type: text/plain, Size: 1154 bytes --]

I couldn't find any users, so removing it..

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 drivers/isdn/i4l/isdn_tty.c |    1 -
 include/linux/isdn.h        |    1 -
 2 files changed, 2 deletions(-)

Index: linux-2.6.23/drivers/isdn/i4l/isdn_tty.c
===================================================================
--- linux-2.6.23.orig/drivers/isdn/i4l/isdn_tty.c
+++ linux-2.6.23/drivers/isdn/i4l/isdn_tty.c
@@ -1915,7 +1915,6 @@ isdn_tty_modem_init(void)
 		info->owner = THIS_MODULE;
 #endif
 		spin_lock_init(&info->readlock);
-		init_MUTEX(&info->write_sem);
 		sprintf(info->last_cause, "0000");
 		sprintf(info->last_num, "none");
 		info->last_dir = 0;
Index: linux-2.6.23/include/linux/isdn.h
===================================================================
--- linux-2.6.23.orig/include/linux/isdn.h
+++ linux-2.6.23/include/linux/isdn.h
@@ -507,7 +507,6 @@ typedef struct modem_info {
   struct ktermios	normal_termios;  /* For saving termios structs     */
   struct ktermios	callout_termios;
   wait_queue_head_t	open_wait, close_wait;
-  struct semaphore      write_sem;
   spinlock_t	        readlock;
 } modem_info;
 

-- 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/3] unix98 allocated_ptys_lock semaphore to mutex
       [not found] <20071204214954.656363725@mvista.com>
  2007-12-04  8:00 ` [PATCH 1/3] drivers/char/tty_io.c: remove pty_sem Daniel Walker
  2007-12-04  8:00 ` [PATCH 2/3] drivers/isdn/i4l/isdn_tty.c: remove write_sem Daniel Walker
@ 2007-12-04  8:00 ` Daniel Walker
  2007-12-04 22:17   ` Ingo Molnar
  2 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2007-12-04  8:00 UTC (permalink / raw)
  To: akpm; +Cc: mingo, linux-kernel, linux, jonathan, matthias.kaehlcke

[-- Attachment #1: unix98-semaphore-to-mutex.patch --]
[-- Type: text/plain, Size: 2254 bytes --]

Convert the unix98 allocated_ptys_lock to a mutex.

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 drivers/char/tty_io.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Index: linux-2.6.23/drivers/char/tty_io.c
===================================================================
--- linux-2.6.23.orig/drivers/char/tty_io.c
+++ linux-2.6.23/drivers/char/tty_io.c
@@ -138,7 +138,7 @@ EXPORT_SYMBOL(tty_mutex);
 extern struct tty_driver *ptm_driver;	/* Unix98 pty masters; for /dev/ptmx */
 extern int pty_limit;		/* Config limit on Unix98 ptys */
 static DEFINE_IDR(allocated_ptys);
-static DECLARE_MUTEX(allocated_ptys_lock);
+static DEFINE_MUTEX(allocated_ptys_lock);
 static int ptmx_open(struct inode *, struct file *);
 #endif
 
@@ -2571,9 +2571,9 @@ static void release_dev(struct file * fi
 #ifdef CONFIG_UNIX98_PTYS
 	/* Make this pty number available for reallocation */
 	if (devpts) {
-		down(&allocated_ptys_lock);
+		mutex_lock(&allocated_ptys_lock);
 		idr_remove(&allocated_ptys, idx);
-		up(&allocated_ptys_lock);
+		mutex_unlock(&allocated_ptys_lock);
 	}
 #endif
 
@@ -2737,24 +2737,24 @@ static int ptmx_open(struct inode * inod
 	nonseekable_open(inode, filp);
 
 	/* find a device that is not in use. */
-	down(&allocated_ptys_lock);
+	mutex_lock(&allocated_ptys_lock);
 	if (!idr_pre_get(&allocated_ptys, GFP_KERNEL)) {
-		up(&allocated_ptys_lock);
+		mutex_unlock(&allocated_ptys_lock);
 		return -ENOMEM;
 	}
 	idr_ret = idr_get_new(&allocated_ptys, NULL, &index);
 	if (idr_ret < 0) {
-		up(&allocated_ptys_lock);
+		mutex_unlock(&allocated_ptys_lock);
 		if (idr_ret == -EAGAIN)
 			return -ENOMEM;
 		return -EIO;
 	}
 	if (index >= pty_limit) {
 		idr_remove(&allocated_ptys, index);
-		up(&allocated_ptys_lock);
+		mutex_unlock(&allocated_ptys_lock);
 		return -EIO;
 	}
-	up(&allocated_ptys_lock);
+	mutex_unlock(&allocated_ptys_lock);
 
 	mutex_lock(&tty_mutex);
 	retval = init_dev(ptm_driver, index, &tty);
@@ -2781,9 +2781,9 @@ out1:
 	release_dev(filp);
 	return retval;
 out:
-	down(&allocated_ptys_lock);
+	mutex_lock(&allocated_ptys_lock);
 	idr_remove(&allocated_ptys, index);
-	up(&allocated_ptys_lock);
+	mutex_unlock(&allocated_ptys_lock);
 	return retval;
 }
 #endif

-- 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/3] unix98 allocated_ptys_lock semaphore to mutex
  2007-12-04  8:00 ` [PATCH 3/3] unix98 allocated_ptys_lock semaphore to mutex Daniel Walker
@ 2007-12-04 22:17   ` Ingo Molnar
  0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2007-12-04 22:17 UTC (permalink / raw)
  To: Daniel Walker; +Cc: akpm, linux-kernel, linux, jonathan, matthias.kaehlcke


* Daniel Walker <dwalker@mvista.com> wrote:

> Convert the unix98 allocated_ptys_lock to a mutex.
> 
> Signed-off-by: Daniel Walker <dwalker@mvista.com>

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] drivers/char/tty_io.c: remove pty_sem
  2007-12-04  8:00 ` [PATCH 1/3] drivers/char/tty_io.c: remove pty_sem Daniel Walker
@ 2007-12-04 23:27   ` Alan Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2007-12-04 23:27 UTC (permalink / raw)
  To: Daniel Walker
  Cc: akpm, mingo, linux-kernel, linux, jonathan, matthias.kaehlcke

On Tue, 04 Dec 2007 00:00:01 -0800
Daniel Walker <dwalker@mvista.com> wrote:

> I couldn't find any users, so removing it..
> 
> Signed-off-by: Daniel Walker <dwalker@mvista.com>

Acked-by: Alan Cox <alan@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-04 23:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20071204214954.656363725@mvista.com>
2007-12-04  8:00 ` [PATCH 1/3] drivers/char/tty_io.c: remove pty_sem Daniel Walker
2007-12-04 23:27   ` Alan Cox
2007-12-04  8:00 ` [PATCH 2/3] drivers/isdn/i4l/isdn_tty.c: remove write_sem Daniel Walker
2007-12-04  8:00 ` [PATCH 3/3] unix98 allocated_ptys_lock semaphore to mutex Daniel Walker
2007-12-04 22:17   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).