• Qu Wenruo's avatar
    btrfs: concentrate all tree block parentness check parameters into one structure · 789d6a3a
    Qu Wenruo authored
    There are several different tree block parentness check parameters used
    across several helpers:
    
    - level
      Mandatory
    
    - transid
      Under most cases it's mandatory, but there are several backref cases
      which skips this check.
    
    - owner_root
    - first_key
      Utilized by most top-down tree search routine. Otherwise can be
      skipped.
    
    Those four members are not always mandatory checks, and some of them are
    the same u64, which means if some arguments got swapped compiler will
    not catch it.
    
    Furthermore if we're going to further expand the parentness check, we
    need to modify quite some helpers just to add one more parameter.
    
    This patch will concentrate all these members into a structure called
    btrfs_tree_parent_check, and pass that structure for the following
    helpers:
    
    - btrfs_read_extent_buffer()
    - read_tree_block()
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    789d6a3a
disk-io.c 148 KB