[patch] no lock needed in sys_creat()

Tigran Aivazian (tigran@SCO.com)
Tue, 9 Mar 1999 08:57:05 +0000 (GMT)


Hi Linus,

The patch below makes the code for sys_creat() as small as it needs to be.
The global kernel lock does not need to be in sys_creat() as it is taken
in sys_open() already.

It (patch) is small and simple so I hope it has a chance of your blessing.

Of course, I understand (thanks to Richard :) ) that no harm done by
taking the global kernel lock twice but the smaller the code, the better.

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.aivazian.demon.co.uk

--- open.c.0 Tue Mar 9 08:50:08 1999
+++ open.c Tue Mar 9 08:50:26 1999
@@ -751,12 +751,7 @@
*/
asmlinkage int sys_creat(const char * pathname, int mode)
{
- int ret;
-
- lock_kernel();
- ret = sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
- unlock_kernel();
- return ret;
+ return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
}

#endif

-
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/