btrfs-progs/check
Qu Wenruo ac9e07a780 btrfs-progs: check: find imode using info from INODE_REF item
Introduce a function, find_file_type(), to find filetype using info from
INODE_REF, including dir_id from key index/name from inode_ref_item.

This function will:

- Search DIR_INDEX first
  DIR_INDEX is easier since there is only one item in it.

- Validate the DIR_INDEX item
  If the DIR_INDEX is valid, use the filetype and call it a day.

- Search DIR_ITEM then
  It needs extra iteration since it's possible to have hash collision.

- Validate the DIR_ITEM
  If valid, call it a day. Or return -ENOENT;

This would be used as the primary method to determine the imode in later
imode repair code.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-18 19:21:07 +01:00
..
common.h btrfs-progs: check: move device_record to main.c 2019-10-14 17:27:41 +02:00
main.c btrfs-progs: check: Export btrfs_type_to_imode 2019-11-18 19:21:07 +01:00
mode-common.c btrfs-progs: check: find imode using info from INODE_REF item 2019-11-18 19:21:07 +01:00
mode-common.h btrfs-progs: check: Export btrfs_type_to_imode 2019-11-18 19:21:07 +01:00
mode-lowmem.c btrfs-progs: check/lowmem: Skip nbytes check for orphan inodes 2019-09-04 16:08:56 +02:00
mode-lowmem.h btrfs-progs: check/lowmem: Check and repair root generation 2019-09-04 16:06:50 +02:00
mode-original.h btrfs-progs: move rbtree-utils.[ch] to common/ 2019-07-03 20:49:04 +02:00
qgroup-verify.c btrfs-progs: move qgroup-verify.[ch] to check/ 2019-10-14 17:27:35 +02:00
qgroup-verify.h btrfs-progs: move qgroup-verify.[ch] to check/ 2019-10-14 17:27:35 +02:00