fs: btrfs: Use btrfs_iter_dir() to replace btrfs_readdir()
authorQu Wenruo <wqu@suse.com>
Wed, 24 Jun 2020 16:03:06 +0000 (18:03 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 8 Sep 2020 00:57:27 +0000 (20:57 -0400)
commit325dd1f642dd18b83a6d8df8f7e3ab066f3e7445
treed549ce3a132bea7fe583e59e62c6cf116dfb32f2
parentc921aa20c3682456b59574be8cf3df589d909950
fs: btrfs: Use btrfs_iter_dir() to replace btrfs_readdir()

Use extent buffer based infrastructure to re-implement btrfs_readdir().

Along this rework, some small corner cases fixed:
- Subvolume tree mtime
  Mtime of a subvolume tree is recorded in its root item, since there is
  no INODE_ITEM for it.
  This needs extra search from tree root.

- Output the unknown type
  If the DIR_ITEM is corrupted, at least don't try to access the memory
  out of boundary.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
fs/btrfs/btrfs.c
fs/btrfs/btrfs.h
fs/btrfs/ctree.h
fs/btrfs/dir-item.c