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