]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: streamline btrfs_get_io_failure_record logic
authorNikolay Borisov <nborisov@suse.com>
Thu, 2 Jul 2020 12:23:29 +0000 (15:23 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:39 +0000 (12:55 +0200)
commit6e7f842bbcf2256d5e3043329ab51e5eef379dd2
treea64f18866e8b3a0f25a4559d89c96b102721fb79
parentc31bb0fb652d56967eb6d5442eb2f3742936b404
btrfs: streamline btrfs_get_io_failure_record logic

Make the function directly return a pointer to a failure record and
adjust callers to handle it. Also refactor the logic inside so that
the case which allocates the failure record for the first time is not
handled in an 'if' arm, saving us a level of indentation. Finally make
the function static as it's not used outside of extent_io.c .

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-io-tree.h
fs/btrfs/extent_io.c