]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: don't iterate mod seq list when putting a tree mod seq
authorFilipe Manana <fdmanana@suse.com>
Wed, 22 Jan 2020 12:23:54 +0000 (12:23 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:23 +0000 (17:01 +0100)
commit3a2a588c9a933c65a69f70332b522f26bfb762b3
tree0037ac322c74d6e29a867247ded5bbae12e34e34
parentfc33e4bdde6ed682a6290de7a76d519371e03176
Btrfs: don't iterate mod seq list when putting a tree mod seq

Each new element added to the mod seq list is always appended to the list,
and each one gets a sequence number coming from a counter which gets
incremented everytime a new element is added to the list (or a new node
is added to the tree mod log rbtree). Therefore the element with the
lowest sequence number is always the first element in the list.

So just remove the list iteration at btrfs_put_tree_mod_seq() that
computes the minimum sequence number in the list and replace it with
a check for the first element's sequence number.

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