Files
linux/include/trace/events
Filipe Manana b769777d92 btrfs: use refcount_t type for the extent buffer reference counter
Instead of using a bare atomic, use the refcount_t type, which despite
being a structure that contains only an atomic, has an API that checks
for underflows and other hazards. This doesn't change the size of the
extent_buffer structure.

This removes the need to do things like this:

    WARN_ON(atomic_read(&eb->refs) == 0);
    if (atomic_dec_and_test(&eb->refs)) {
        (...)
    }

And do just:

    if (refcount_dec_and_test(&eb->refs)) {
        (...)
    }

Since refcount_dec_and_test() already triggers a warning when we decrement
a ref count that has a value of 0 (or below zero).

Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2025-07-21 23:53:30 +02:00
..
2024-11-22 11:43:27 -07:00
2024-10-29 08:54:06 +01:00
2025-05-08 15:22:45 +00:00
2023-07-04 19:40:16 +01:00
2024-05-08 10:39:26 +01:00
2023-03-24 11:01:29 +01:00
2023-12-29 11:58:27 -08:00
2023-07-17 08:18:17 -06:00
2024-11-11 00:26:46 -08:00
2025-05-22 14:55:37 -07:00
2024-05-14 07:22:35 -06:00
2024-09-11 20:44:31 -07:00
2024-09-28 15:13:56 +02:00
2024-06-19 12:44:22 +01:00
2025-04-11 18:58:10 -07:00
2023-07-17 08:18:17 -06:00
2023-09-19 07:04:49 +02:00