btrfs-progs: check: Drop ext_ref argument from check_inode_item

We can derive this argument from root->fs_info and also make it local
to the sole switch case it's used.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Nikolay Borisov 2018-03-27 10:19:25 +03:00 committed by David Sterba
parent 990c79bff5
commit 72cdfeaf62

View File

@ -2263,13 +2263,10 @@ static bool has_orphan_item(struct btrfs_root *root, u64 ino)
* 2. check inode ref/extref * 2. check inode ref/extref
* 3. check dir item/index * 3. check dir item/index
* *
* @ext_ref: the EXTENDED_IREF feature
*
* Return 0 if no error occurred. * Return 0 if no error occurred.
* Return >0 for error or hit the traversal is done(by error bitmap) * Return >0 for error or hit the traversal is done(by error bitmap)
*/ */
static int check_inode_item(struct btrfs_root *root, struct btrfs_path *path, static int check_inode_item(struct btrfs_root *root, struct btrfs_path *path)
unsigned int ext_ref)
{ {
struct extent_buffer *node; struct extent_buffer *node;
struct btrfs_inode_item *ii; struct btrfs_inode_item *ii;
@ -2338,6 +2335,9 @@ static int check_inode_item(struct btrfs_root *root, struct btrfs_path *path,
err |= ret; err |= ret;
break; break;
case BTRFS_INODE_EXTREF_KEY: case BTRFS_INODE_EXTREF_KEY:
{
bool ext_ref = btrfs_fs_incompat(root->fs_info,
EXTENDED_IREF);
if (key.type == BTRFS_INODE_EXTREF_KEY && !ext_ref) if (key.type == BTRFS_INODE_EXTREF_KEY && !ext_ref)
warning("root %llu EXTREF[%llu %llu] isn't supported", warning("root %llu EXTREF[%llu %llu] isn't supported",
root->objectid, key.objectid, root->objectid, key.objectid,
@ -2346,6 +2346,7 @@ static int check_inode_item(struct btrfs_root *root, struct btrfs_path *path,
mode); mode);
err |= ret; err |= ret;
break; break;
}
case BTRFS_DIR_ITEM_KEY: case BTRFS_DIR_ITEM_KEY:
case BTRFS_DIR_INDEX_KEY: case BTRFS_DIR_INDEX_KEY:
if (!dir) { if (!dir) {
@ -2516,7 +2517,7 @@ static int process_one_leaf(struct btrfs_root *root, struct btrfs_path *path,
path->slots[0] = i; path->slots[0] = i;
again: again:
err |= check_inode_item(root, path, ext_ref); err |= check_inode_item(root, path);
/* modify cur since check_inode_item may change path */ /* modify cur since check_inode_item may change path */
cur = path->nodes[0]; cur = path->nodes[0];