[PATCH 3.16 038/245] btrfs: Refactor check_leaf function for later expansion