btrfs-progs: fsck: add ability to check reloc roots
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Thu, 24 Apr 2014 10:51:10 +0000 (18:51 +0800)
committerDavid Sterba <dsterba@suse.cz>
Fri, 10 Oct 2014 08:38:26 +0000 (10:38 +0200)
commit8909f110425f0db35d03c3a6b8ad7ee6b529187a
tree1e6fab530377e98c35026881369b0dff520bf231
parent1d0a3eac0c79e076d35afbcc641a7eda2aa793bc
btrfs-progs: fsck: add ability to check reloc roots

When encountering system crash or balance enospc errors,
there maybe still some reloc roots left.

The way we store reloc root is different from fs root:

reloc root's root key(BTRFS_RELOC_TREE_OBJECTID, ROOT_ITEM, objectid)
fs root's root key(objectid, ROOT_ITEM, -1)
reloc data's root key(BTRFS_DATA_RELOC_TREE_OBJECTID, ROOT_ITEM, 0)

So this patch use right key to search corresponding root node, and
avoid using normal fs root cache for reloc roots.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-check.c