Skip to contentSkip to conversation

Is this function used?

DISCUSSION Chris Mason 1 participant 1 message Apr 22, 2009 1 message not in the archive Btrfs file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 14 lines · Siddhartha Swaroop

Hello ,

Inside the file ctree.c at line 762 there is a function called check_block( ). The source code of that function is as follows

static noinline int check_block(struct btrfs_root *root,
struct btrfs_path *path, int level)

{
        return 0;
        if (level == 0)
                return check_leaf(root, path, level);
        return check_node(root, path, level);
}
Quoted 7 lines

This function is called by balance_level and btrfs_search_slot functions.

By seeing this check_block function u may come to know that this function will not work if it is called,it will just return zero (means success) without doing anyother work.
I need to know why this code is written?

We should put the return 0 inside CONFIG option for more extensive metadata checking. I enable check_block when I'm making changes that are likely to cause corruptions in the btree code. It tends to find them more quickly.

-chris