btrfs: make get_state_failrec return failrec directly
authorNikolay Borisov <nborisov@suse.com>
Thu, 2 Jul 2020 12:23:28 +0000 (15:23 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:39 +0000 (12:55 +0200)
commit2279a270534c678e78f961fed8e09c9c69611ceb
treed75262d88f6a363510c92cf5596354808a4455c5
parentb90a4ab6ba9cce79a1ac06a250d5fc8c3dff382b
btrfs: make get_state_failrec return failrec directly

Only failure that get_state_failrec can get is if there is no failure
for the given address. There is no reason why the function should return
a status code and use a separate parameter for returning the actual
failure rec (if one is found). Simplify it by making the return type
a pointer and return ERR_PTR value in case of errors.

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