fs: btrfs: change directory list output to be aligned as before
authorMarek Behún <marek.behun@nic.cz>
Tue, 9 Feb 2021 18:05:08 +0000 (19:05 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 24 Feb 2021 21:51:48 +0000 (16:51 -0500)
commitc65365d7add59b35a4fdde5807a7afb5503e7a40
tree10f8ab43306877215e67c24b99be88684827355b
parente4cecb56677c42077fae48928f9cd5ce18e8a3a2
fs: btrfs: change directory list output to be aligned as before

Since commit 325dd1f642dd ("fs: btrfs: Use btrfs_iter_dir() to ...")
when btrfs is listing a directory, the output is not aligned:

  <SYMLINK>         15  Wed Sep 09 13:20:03 2020  boot.scr -> @/boot/boot.scr
  <DIR>          0  Tue Feb 02 12:42:09 2021  @
  <FILE>        108  Tue Feb 02 12:54:04 2021  1.info

Return back to how it was displayed previously, i.e.:

  <SYM>         15  Wed Sep 09 13:20:03 2020  boot.scr -> @/boot/boot.scr
  <DIR>          0  Tue Feb 02 12:42:09 2021  @
  <   >        108  Tue Feb 02 12:54:04 2021  1.info

Instead of '<FILE>', print '<   >', as ext4 driver.

If an unknown directory item type is encountered, we will print the type
number left padded with spaces, enclosed by '?', instead of '<' and '>',
i.e.:

  ? 30?        .............................  name

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Fixes: 325dd1f642dd ("fs: btrfs: Use btrfs_iter_dir() to replace ...")
Cc: David Sterba <dsterba@suse.com>
Cc: Qu Wenruo <wqu@suse.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
fs/btrfs/btrfs.c