Simplify fifo_open() locking logic
We don't do interruptible waits for the pipe mutex anywhere else any more either, so don't do it in fifo_open() either. Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
d11d9b2dd2
commit
d19e997408
|
@ -34,10 +34,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = -ERESTARTSYS;
|
mutex_lock(PIPE_MUTEX(*inode));
|
||||||
if (mutex_lock_interruptible(PIPE_MUTEX(*inode)))
|
|
||||||
goto err_nolock_nocleanup;
|
|
||||||
|
|
||||||
if (!inode->i_pipe) {
|
if (!inode->i_pipe) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
if(!pipe_new(inode))
|
if(!pipe_new(inode))
|
||||||
|
@ -140,8 +137,6 @@ err:
|
||||||
|
|
||||||
err_nocleanup:
|
err_nocleanup:
|
||||||
mutex_unlock(PIPE_MUTEX(*inode));
|
mutex_unlock(PIPE_MUTEX(*inode));
|
||||||
|
|
||||||
err_nolock_nocleanup:
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue