From e83588458f656417d9b7ac45baf1c7b45790059b Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Wed, 5 Mar 2025 13:36:41 +0100 Subject: file: add fput and file_ref_put routines optimized for use when closing a fd Vast majority of the time closing a file descriptor also operates on the last reference, where a regular fput usage will result in 2 atomics. This can be changed to only suffer 1. See commentary above file_ref_put_close() for more information. Signed-off-by: Mateusz Guzik Link: https://lore.kernel.org/r/20250305123644.554845-2-mjguzik@gmail.com Signed-off-by: Christian Brauner --- fs/internal.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/internal.h') diff --git a/fs/internal.h b/fs/internal.h index e7f02ae1e098..05c817f39a28 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -118,6 +118,9 @@ static inline void put_file_access(struct file *file) } } +void fput_close_sync(struct file *); +void fput_close(struct file *); + /* * super.c */ -- cgit v1.2.3