aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index 6cac5ceeded0..a029a14bacf1 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -751,7 +751,7 @@ pipe_release(struct inode *inode, struct file *file)
751 __pipe_unlock(pipe); 751 __pipe_unlock(pipe);
752 752
753 if (kill) 753 if (kill)
754 __free_pipe_info(pipe); 754 free_pipe_info(pipe);
755 755
756 return 0; 756 return 0;
757} 757}
@@ -795,7 +795,7 @@ struct pipe_inode_info *alloc_pipe_info(void)
795 return NULL; 795 return NULL;
796} 796}
797 797
798void __free_pipe_info(struct pipe_inode_info *pipe) 798void free_pipe_info(struct pipe_inode_info *pipe)
799{ 799{
800 int i; 800 int i;
801 801
@@ -810,12 +810,6 @@ void __free_pipe_info(struct pipe_inode_info *pipe)
810 kfree(pipe); 810 kfree(pipe);
811} 811}
812 812
813void free_pipe_info(struct inode *inode)
814{
815 __free_pipe_info(inode->i_pipe);
816 inode->i_pipe = NULL;
817}
818
819static struct vfsmount *pipe_mnt __read_mostly; 813static struct vfsmount *pipe_mnt __read_mostly;
820 814
821/* 815/*
@@ -911,12 +905,12 @@ int create_pipe_files(struct file **res, int flags)
911err_file: 905err_file:
912 put_filp(f); 906 put_filp(f);
913err_dentry: 907err_dentry:
914 free_pipe_info(inode); 908 free_pipe_info(inode->i_pipe);
915 path_put(&path); 909 path_put(&path);
916 return err; 910 return err;
917 911
918err_inode: 912err_inode:
919 free_pipe_info(inode); 913 free_pipe_info(inode->i_pipe);
920 iput(inode); 914 iput(inode);
921 return err; 915 return err;
922} 916}
@@ -1039,7 +1033,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
1039 if (unlikely(inode->i_pipe)) { 1033 if (unlikely(inode->i_pipe)) {
1040 inode->i_pipe->files++; 1034 inode->i_pipe->files++;
1041 spin_unlock(&inode->i_lock); 1035 spin_unlock(&inode->i_lock);
1042 __free_pipe_info(pipe); 1036 free_pipe_info(pipe);
1043 pipe = inode->i_pipe; 1037 pipe = inode->i_pipe;
1044 } else { 1038 } else {
1045 inode->i_pipe = pipe; 1039 inode->i_pipe = pipe;
@@ -1143,7 +1137,7 @@ err:
1143 spin_unlock(&inode->i_lock); 1137 spin_unlock(&inode->i_lock);
1144 __pipe_unlock(pipe); 1138 __pipe_unlock(pipe);
1145 if (kill) 1139 if (kill)
1146 __free_pipe_info(pipe); 1140 free_pipe_info(pipe);
1147 return ret; 1141 return ret;
1148} 1142}
1149 1143