diff options
author | Mateusz Guzik <mjguzik@gmail.com> | 2025-03-05 13:36:41 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2025-03-05 18:30:00 +0100 |
commit | e83588458f656417d9b7ac45baf1c7b45790059b (patch) | |
tree | 0e8c70a87c265e0341d4e16b78f1d8d1872126b9 /fs/internal.h | |
parent | 23e490336467fcdaf95e1efcf8f58067b59f647b (diff) |
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 <mjguzik@gmail.com>
Link: https://lore.kernel.org/r/20250305123644.554845-2-mjguzik@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/internal.h')
-rw-r--r-- | fs/internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
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 */ |