]> www.infradead.org Git - users/jedix/linux-maple.git/commit
file: add fput and file_ref_put routines optimized for use when closing a fd
authorMateusz Guzik <mjguzik@gmail.com>
Wed, 5 Mar 2025 12:36:41 +0000 (13:36 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 5 Mar 2025 17:30:00 +0000 (18:30 +0100)
commite83588458f656417d9b7ac45baf1c7b45790059b
tree0e8c70a87c265e0341d4e16b78f1d8d1872126b9
parent23e490336467fcdaf95e1efcf8f58067b59f647b
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>
fs/file.c
fs/file_table.c
fs/internal.h
include/linux/file_ref.h