• Anand Jain's avatar
    btrfs: clean up btrfs_dev_stat_inc usage · 1cb34c8e
    Anand Jain authored
    btrfs_end_bio() is using btrfs_dev_stat_inc() and then
    btrfs_dev_stat_print_on_error() separately instead use
    btrfs_dev_stat_inc_and_print() directly.
    
    As of now there isn't any bio in btrfs which is - a non-empty write and
    also the REQ_PREFLUSH flag is set. So in actual the condition
    
       if (bio->bi_opf & REQ_PREFLUSH)
    
    is never true in btrfs_end_bio(), and so there won't be any redundant
    error log by using btrfs_dev_stat_inc_and_print() separately one for
    write and another for flush.
    
    This consolidation will help to add the device critical error handles in
    the function btrfs_dev_stat_inc_and_print() and which can be renamed as
    needed.
    Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
    Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    1cb34c8e
volumes.c 188 KB