diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2017-09-03 17:00:30 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-10-02 21:52:18 -0400 |
commit | 9d845509553e3c07414259ea97e4f59a3fe65904 (patch) | |
tree | 3de68025da896761c5d0e0a73cb3e003fc2c93b3 /cmd/btrfs.c | |
parent | 0c936ee3194ac5b533a18fcd08e5d285853af5fe (diff) |
cmd: Add the 'btrsubvol' command to list BTRFS subvolumes
Signed-off-by: Marek Behun <marek.behun@nic.cz>
create mode 100644 cmd/btrfs.c
Diffstat (limited to 'cmd/btrfs.c')
-rw-r--r-- | cmd/btrfs.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cmd/btrfs.c b/cmd/btrfs.c new file mode 100644 index 0000000000..3f4f1b782b --- /dev/null +++ b/cmd/btrfs.c @@ -0,0 +1,28 @@ +/* + * 2017 by Marek Behun <marek.behun@nic.cz> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <command.h> +#include <btrfs.h> +#include <fs.h> + +int do_btrsubvol(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +{ + if (argc != 3) + return CMD_RET_USAGE; + + if (fs_set_blk_dev(argv[1], argv[2], FS_TYPE_BTRFS)) + return 1; + + btrfs_list_subvols(); + return 0; +} + +U_BOOT_CMD(btrsubvol, 3, 1, do_btrsubvol, + "list subvolumes of a BTRFS filesystem", + "<interface> <dev[:part]>\n" + " - List subvolumes of a BTRFS filesystem." +) |