linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jpirko@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org
Subject: [PATCH] fs/pipe.c: do free read pipe work in free_read_pipe()
Date: Wed, 21 Jan 2009 12:20:56 +0100	[thread overview]
Message-ID: <20090121112055.GC3780@psychotron.englab.brq.redhat.com> (raw)

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


Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 fs/pipe.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/pipe.c b/fs/pipe.c
index 3a48ba5..44cdc45 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -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;
-- 
1.6.0.6


                 reply	other threads:[~2009-01-21 11:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090121112055.GC3780@psychotron.englab.brq.redhat.com \
    --to=jpirko@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).