Skip to contentSkip to conversation

fs/pipe.c: do free read pipe work in free_read_pipe()

PATCH New Jiri Pirko 1 participant 1 message Jan 21, 2009 VFS

lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 fs/pipe.c: do free read pipe work in free_read_pipe()

This patch just introduces function free_read_pipe() which do the free read pipe work. This approach is similar to free_write_pipe().

---
 fs/pipe.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
fs/pipe.c +7 -2
index 3a48ba5..44cdc45 100644
@@ -989,6 +989,12 @@ struct file *create_read_pipe(struct file *wrf, int flags)
 	return f;
 }
 
+void free_read_pipe(struct file *f)
+{
+	path_put(&f->f_path);
+	put_filp(f);
+}
+
 int do_pipe_flags(int *fd, int flags)
 {
 	struct file *fw, *fr;
@@ -1027,8 +1033,7 @@ int do_pipe_flags(int *fd, int flags)
  err_fdr:
 	put_unused_fd(fdr);
  err_read_pipe:
-	path_put(&fr->f_path);
-	put_filp(fr);
+	free_read_pipe(fr);
  err_write_pipe:
 	free_write_pipe(fw);
 	return error;
Signature · 1 line
1.6.0.6