mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mateusz Guzik <mjguzik@gmail.com>
To: brauner@kernel.org
Cc: viro@zeniv.linux.org.uk, jack@suse.cz,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Mateusz Guzik <mjguzik@gmail.com>
Subject: [PATCH 2/3] fs: predict not having to do anything in fdput()
Date: Mon,  7 Apr 2025 01:58:05 +0200	[thread overview]
Message-ID: <20250406235806.1637000-2-mjguzik@gmail.com> (raw)
In-Reply-To: <20250406235806.1637000-1-mjguzik@gmail.com>

This matches the annotation in fdget().

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
---
 include/linux/file.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/file.h b/include/linux/file.h
index 302f11355b10..af1768d934a0 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -59,7 +59,7 @@ static inline struct fd CLONED_FD(struct file *f)
 
 static inline void fdput(struct fd fd)
 {
-	if (fd.word & FDPUT_FPUT)
+	if (unlikely(fd.word & FDPUT_FPUT))
 		fput(fd_file(fd));
 }
 
-- 
2.43.0


  reply	other threads:[~2025-04-06 23:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-06 23:58 [PATCH 1/3] fs: sort out cosmetic differences between stat funcs and add predicts Mateusz Guzik
2025-04-06 23:58 ` Mateusz Guzik [this message]
2025-04-08 10:16   ` [PATCH 2/3] fs: predict not having to do anything in fdput() Jan Kara
2025-04-06 23:58 ` [PATCH 3/3 v3] fs: make generic_fillattr() tail-callable and utilize it in ext2/ext4 Mateusz Guzik
2025-04-07 14:36   ` Christoph Hellwig
2025-04-08  8:28 ` (subset) [PATCH 1/3] fs: sort out cosmetic differences between stat funcs and add predicts Christian Brauner
2025-04-08 10:14 ` Jan Kara

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=20250406235806.1637000-2-mjguzik@gmail.com \
    --to=mjguzik@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --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

all inboxes | Powered by JetHome®