mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs: Properly pair fget_light/fput_light in fdget/fdput
@ 2013-06-05 16:30 Rasmus Villemoes
  0 siblings, 0 replies; only message in thread
From: Rasmus Villemoes @ 2013-06-05 16:30 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-kernel, Rasmus Villemoes

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-05 16:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-05 16:30 [PATCH] fs: Properly pair fget_light/fput_light in fdget/fdput Rasmus Villemoes

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®