[PATCH 4.14 029/146] btrfs: Refactor check_leaf function for later expansion