Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Marek Behún | 27cec79 | 2017-09-03 17:00:30 +0200 | [diff] [blame] | 2 | /* |
Marek Behún | d63726e | 2022-06-01 17:17:06 +0200 | [diff] [blame] | 3 | * 2017 by Marek Behún <kabel@kernel.org> |
Marek Behún | 27cec79 | 2017-09-03 17:00:30 +0200 | [diff] [blame] | 4 | */ |
| 5 | |
Marek Behún | 27cec79 | 2017-09-03 17:00:30 +0200 | [diff] [blame] | 6 | #include <command.h> |
| 7 | #include <btrfs.h> |
| 8 | #include <fs.h> |
| 9 | |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 10 | int do_btrsubvol(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Marek Behún | 27cec79 | 2017-09-03 17:00:30 +0200 | [diff] [blame] | 11 | { |
| 12 | if (argc != 3) |
| 13 | return CMD_RET_USAGE; |
| 14 | |
| 15 | if (fs_set_blk_dev(argv[1], argv[2], FS_TYPE_BTRFS)) |
| 16 | return 1; |
| 17 | |
| 18 | btrfs_list_subvols(); |
| 19 | return 0; |
| 20 | } |
| 21 | |
| 22 | U_BOOT_CMD(btrsubvol, 3, 1, do_btrsubvol, |
| 23 | "list subvolumes of a BTRFS filesystem", |
| 24 | "<interface> <dev[:part]>\n" |
| 25 | " - List subvolumes of a BTRFS filesystem." |
Simon Glass | 761d602 | 2023-11-18 14:04:52 -0700 | [diff] [blame] | 26 | ); |