mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rasmus Villemoes <mail@rasmusvillemoes.dk>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: [PATCH] fs: Properly pair fget_light/fput_light in fdget/fdput
Date: Wed,  5 Jun 2013 16:30:57 +0000	[thread overview]
Message-ID: <1370449857-25355-1-git-send-email-linux@rasmusvillemoes.dk> (raw)

fdget() is implemented using fget_light(). Its companion fdput()
currently open-codes the behaviour of fput_light(). This is slightly
confusing. To follow the documentation in fs/file.c:688ff to the
letter, use fput_light() in fdput().

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 include/linux/file.h |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linux/file.h b/include/linux/file.h
index cbacf4f..30be9b0 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -33,8 +33,7 @@ struct fd {
 
 static inline void fdput(struct fd fd)
 {
-	if (fd.need_put)
-		fput(fd.file);
+	fput_light(fd.file, fd.need_put);
 }
 
 extern struct file *fget(unsigned int fd);
-- 
1.7.9.5


                 reply	other threads:[~2013-06-05 16:31 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=1370449857-25355-1-git-send-email-linux@rasmusvillemoes.dk \
    --to=mail@rasmusvillemoes.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --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

all inboxes | Powered by JetHome®