summaryrefslogtreecommitdiff
path: root/fs/pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index abaa9234d27b..d4b97e4e37c5 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -56,7 +56,7 @@ unsigned int pipe_min_size = PAGE_SIZE;
static void pipe_lock_nested(struct pipe_inode_info *pipe, int subclass)
{
if (pipe->inode)
- mutex_lock_nested(&pipe->inode->i_mutex, subclass);
+ mutex_lock_nested(&pipe->mutex, subclass);
}
void pipe_lock(struct pipe_inode_info *pipe)
@@ -71,7 +71,7 @@ EXPORT_SYMBOL(pipe_lock);
void pipe_unlock(struct pipe_inode_info *pipe)
{
if (pipe->inode)
- mutex_unlock(&pipe->inode->i_mutex);
+ mutex_unlock(&pipe->mutex);
}
EXPORT_SYMBOL(pipe_unlock);
@@ -777,6 +777,7 @@ struct pipe_inode_info * alloc_pipe_info(struct inode *inode)
pipe->r_counter = pipe->w_counter = 1;
pipe->inode = inode;
pipe->buffers = PIPE_DEF_BUFFERS;
+ mutex_init(&pipe->mutex);
return pipe;
}
kfree(pipe);