btrfs.c 558 B

123456789101112131415161718192021222324252627
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * 2017 by Marek Behun <marek.behun@nic.cz>
  4. */
  5. #include <common.h>
  6. #include <command.h>
  7. #include <btrfs.h>
  8. #include <fs.h>
  9. int do_btrsubvol(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
  10. {
  11. if (argc != 3)
  12. return CMD_RET_USAGE;
  13. if (fs_set_blk_dev(argv[1], argv[2], FS_TYPE_BTRFS))
  14. return 1;
  15. btrfs_list_subvols();
  16. return 0;
  17. }
  18. U_BOOT_CMD(btrsubvol, 3, 1, do_btrsubvol,
  19. "list subvolumes of a BTRFS filesystem",
  20. "<interface> <dev[:part]>\n"
  21. " - List subvolumes of a BTRFS filesystem."
  22. )