[PATCH 4.9 067/101] btrfs: Refactor check_leaf function for later expansion