blob: 2843835d08b80710f1de6820c3402c3e15be90f9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Marek Behún27cec792017-09-03 17:00:30 +02002/*
Marek Behúnd63726e2022-06-01 17:17:06 +02003 * 2017 by Marek Behún <kabel@kernel.org>
Marek Behún27cec792017-09-03 17:00:30 +02004 */
5
6#include <common.h>
7#include <command.h>
8#include <btrfs.h>
9#include <fs.h>
10
Simon Glassed38aef2020-05-10 11:40:03 -060011int do_btrsubvol(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Marek Behún27cec792017-09-03 17:00:30 +020012{
13 if (argc != 3)
14 return CMD_RET_USAGE;
15
16 if (fs_set_blk_dev(argv[1], argv[2], FS_TYPE_BTRFS))
17 return 1;
18
19 btrfs_list_subvols();
20 return 0;
21}
22
23U_BOOT_CMD(btrsubvol, 3, 1, do_btrsubvol,
24 "list subvolumes of a BTRFS filesystem",
25 "<interface> <dev[:part]>\n"
26 " - List subvolumes of a BTRFS filesystem."
Simon Glass761d6022023-11-18 14:04:52 -070027);