]> www.infradead.org Git - nvme.git/commit
btrfs: mark ordered extent insertion failure checks as unlikely
authorFilipe Manana <fdmanana@suse.com>
Mon, 3 Jun 2024 16:20:30 +0000 (17:20 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Jul 2024 13:33:23 +0000 (15:33 +0200)
commitb7ac1acbdd1f3e84d566bdccfb0cf2d887ef55ce
treee0638bae3575a00b1a5157f3810c2c922cbcaf6d
parentcb3cd62454eab7ebf833aeb04ca7458c656d30cf
btrfs: mark ordered extent insertion failure checks as unlikely

We never expect an ordered extent insertion to fail due to already having
another ordered extent in the tree for the same file offset, since we
always wait for existing ordered extents in a range to complete before
writing into the range again. So mark the failure checks for the results
of tree_insert() as unlikely, to make it clear it's never expected (save
exceptional causes like bugs or memory corruptions) and to serve as a hint
for the compiler to possibly generate better code.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.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/ordered-data.c