]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: remove unnecessary list head initialization when syncing log
authorFilipe Manana <fdmanana@suse.com>
Tue, 20 Jul 2021 15:03:42 +0000 (16:03 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Aug 2021 11:19:01 +0000 (13:19 +0200)
commit0d418720df0e266909b3fea39e4be57b1a09369e
treebd859350ea3537b009eda9eff9cef3624691be04
parent06a2ee5be1bc68585d48db52a70ba7d6cc9dc8b4
btrfs: remove unnecessary list head initialization when syncing log

One of the last steps of syncing the log is to remove all log contexts
from the root's list of contexts, done at btrfs_remove_all_log_ctxs().
There we iterate over all the contexts in the list and delete each one
from the list, and after that we call INIT_LIST_HEAD() on the list. That
is unnecessary since at that point the list is empty.

So just remove the INIT_LIST_HEAD() call. It's not needed, increases code
size (bloat-o-meter reported a delta of -122 for btrfs_sync_log() after
this change) and increases two critical sections delimited by log mutexes.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c