[patch-2.3.43-pre5] optimized vhangup(2)

From: Tigran Aivazian (tigran@sco.COM)
Date: Wed Feb 09 2000 - 08:07:00 EST


Hi Linus,

The patch below does this to fs/open.c:sys_vhangup()

  a) removes a goto

  b) removes a local variable

  c) reduces the length of holding big kernel lock

I could also remove the if(current->tty) as do_tty_hangup() does nothing
if tty==NULL but with TTY_DEBUG_HANGUP one would get spurious warnings so
I left this tiny overhead there.

  http://www.ocston.org/~tigran/patches/vhangup-2.3.43-p5.patch

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran

--- open.c.0 Wed Feb 9 12:53:07 2000
+++ open.c Wed Feb 9 12:53:44 2000
@@ -898,16 +898,9 @@
  */
 asmlinkage long sys_vhangup(void)
 {
- int ret = -EPERM;
-
         if (!capable(CAP_SYS_TTY_CONFIG))
- goto out;
- /* If there is a controlling tty, hang it up */
- lock_kernel();
+ return -EPERM;
         if (current->tty)
                 tty_vhangup(current->tty);
- unlock_kernel();
- ret = 0;
-out:
- return ret;
+ return 0;
 }

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



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:15 EST