2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public
4 * License v2 as published by the Free Software Foundation.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 * General Public License for more details.
11 * You should have received a copy of the GNU General Public
12 * License along with this program; if not, write to the
13 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
14 * Boston, MA 021110-1307, USA.
17 #define _XOPEN_SOURCE 500
22 #include <sys/ioctl.h>
24 #include <uuid/uuid.h>
29 #include <linux/limits.h>
32 #include "kerncompat.h"
39 #include "list_sort.h"
44 * for btrfs fi show, we maintain a hash of fsids we've already printed.
45 * This way we don't print dups if a given FS is mounted more than once.
47 #define SEEN_FSID_HASH_SIZE 256
50 u8 fsid
[BTRFS_FSID_SIZE
];
51 struct seen_fsid
*next
;
54 static struct seen_fsid
*seen_fsid_hash
[SEEN_FSID_HASH_SIZE
] = {NULL
,};
56 static int add_seen_fsid(u8
*fsid
)
59 int slot
= hash
% SEEN_FSID_HASH_SIZE
;
60 struct seen_fsid
*seen
= seen_fsid_hash
[slot
];
61 struct seen_fsid
*alloc
;
67 if (memcmp(seen
->fsid
, fsid
, BTRFS_FSID_SIZE
) == 0)
78 alloc
= malloc(sizeof(*alloc
));
83 memcpy(alloc
->fsid
, fsid
, BTRFS_FSID_SIZE
);
88 seen_fsid_hash
[slot
] = alloc
;
93 static void free_seen_fsid(void)
96 struct seen_fsid
*seen
;
97 struct seen_fsid
*next
;
99 for (slot
= 0; slot
< SEEN_FSID_HASH_SIZE
; slot
++) {
100 seen
= seen_fsid_hash
[slot
];
106 seen_fsid_hash
[slot
] = NULL
;
110 static const char * const filesystem_cmd_group_usage
[] = {
111 "btrfs filesystem [<group>] <command> [<args>]",
115 static const char * const cmd_df_usage
[] = {
116 "btrfs filesystem df <path>",
117 "Show space usage information for a mount point",
121 static char *group_type_str(u64 flag
)
123 switch (flag
& BTRFS_BLOCK_GROUP_TYPE_MASK
) {
124 case BTRFS_BLOCK_GROUP_DATA
:
126 case BTRFS_BLOCK_GROUP_SYSTEM
:
128 case BTRFS_BLOCK_GROUP_METADATA
:
130 case BTRFS_BLOCK_GROUP_DATA
|BTRFS_BLOCK_GROUP_METADATA
:
131 return "Data+Metadata";
137 static char *group_profile_str(u64 flag
)
139 switch (flag
& BTRFS_BLOCK_GROUP_PROFILE_MASK
) {
142 case BTRFS_BLOCK_GROUP_RAID0
:
144 case BTRFS_BLOCK_GROUP_RAID1
:
146 case BTRFS_BLOCK_GROUP_RAID5
:
148 case BTRFS_BLOCK_GROUP_RAID6
:
150 case BTRFS_BLOCK_GROUP_DUP
:
152 case BTRFS_BLOCK_GROUP_RAID10
:
159 static int get_df(int fd
, struct btrfs_ioctl_space_args
**sargs_ret
)
163 struct btrfs_ioctl_space_args
*sargs
;
165 sargs
= malloc(sizeof(struct btrfs_ioctl_space_args
));
169 sargs
->space_slots
= 0;
170 sargs
->total_spaces
= 0;
172 ret
= ioctl(fd
, BTRFS_IOC_SPACE_INFO
, sargs
);
175 fprintf(stderr
, "ERROR: couldn't get space info - %s\n",
180 /* This really should never happen */
181 if (!sargs
->total_spaces
) {
185 count
= sargs
->total_spaces
;
188 sargs
= malloc(sizeof(struct btrfs_ioctl_space_args
) +
189 (count
* sizeof(struct btrfs_ioctl_space_info
)));
193 sargs
->space_slots
= count
;
194 sargs
->total_spaces
= 0;
195 ret
= ioctl(fd
, BTRFS_IOC_SPACE_INFO
, sargs
);
198 fprintf(stderr
, "ERROR: get space info count %llu - %s\n",
207 static void print_df(struct btrfs_ioctl_space_args
*sargs
)
210 struct btrfs_ioctl_space_info
*sp
= sargs
->spaces
;
212 for (i
= 0; i
< sargs
->total_spaces
; i
++, sp
++) {
213 printf("%s, %s: total=%s, used=%s\n",
214 group_type_str(sp
->flags
),
215 group_profile_str(sp
->flags
),
216 pretty_size(sp
->total_bytes
),
217 pretty_size(sp
->used_bytes
));
221 static int cmd_df(int argc
, char **argv
)
223 struct btrfs_ioctl_space_args
*sargs
= NULL
;
227 DIR *dirstream
= NULL
;
229 if (check_argc_exact(argc
, 2))
234 fd
= open_file_or_dir(path
, &dirstream
);
236 fprintf(stderr
, "ERROR: can't access '%s'\n", path
);
239 ret
= get_df(fd
, &sargs
);
245 fprintf(stderr
, "ERROR: get_df failed %s\n", strerror(-ret
));
248 close_file_or_dir(fd
, dirstream
);
252 static int match_search_item_kernel(__u8
*fsid
, char *mnt
, char *label
,
255 char uuidbuf
[BTRFS_UUID_UNPARSED_SIZE
];
256 int search_len
= strlen(search
);
258 search_len
= min(search_len
, BTRFS_UUID_UNPARSED_SIZE
);
259 uuid_unparse(fsid
, uuidbuf
);
260 if (!strncmp(uuidbuf
, search
, search_len
))
263 if (strlen(label
) && strcmp(label
, search
) == 0)
266 if (strcmp(mnt
, search
) == 0)
272 static int uuid_search(struct btrfs_fs_devices
*fs_devices
, char *search
)
274 char uuidbuf
[BTRFS_UUID_UNPARSED_SIZE
];
275 struct list_head
*cur
;
276 struct btrfs_device
*device
;
277 int search_len
= strlen(search
);
279 search_len
= min(search_len
, BTRFS_UUID_UNPARSED_SIZE
);
280 uuid_unparse(fs_devices
->fsid
, uuidbuf
);
281 if (!strncmp(uuidbuf
, search
, search_len
))
284 list_for_each(cur
, &fs_devices
->devices
) {
285 device
= list_entry(cur
, struct btrfs_device
, dev_list
);
286 if ((device
->label
&& strcmp(device
->label
, search
) == 0) ||
287 strcmp(device
->name
, search
) == 0)
294 * Sort devices by devid, ascending
296 static int cmp_device_id(void *priv
, struct list_head
*a
,
299 const struct btrfs_device
*da
= list_entry(a
, struct btrfs_device
,
301 const struct btrfs_device
*db
= list_entry(b
, struct btrfs_device
,
304 return da
->devid
< db
->devid
? -1 :
305 da
->devid
> db
->devid
? 1 : 0;
308 static void print_one_uuid(struct btrfs_fs_devices
*fs_devices
)
310 char uuidbuf
[BTRFS_UUID_UNPARSED_SIZE
];
311 struct list_head
*cur
;
312 struct btrfs_device
*device
;
316 if (add_seen_fsid(fs_devices
->fsid
))
319 uuid_unparse(fs_devices
->fsid
, uuidbuf
);
320 device
= list_entry(fs_devices
->devices
.next
, struct btrfs_device
,
322 if (device
->label
&& device
->label
[0])
323 printf("Label: '%s' ", device
->label
);
325 printf("Label: none ");
328 total
= device
->total_devs
;
329 printf(" uuid: %s\n\tTotal devices %llu FS bytes used %s\n", uuidbuf
,
330 (unsigned long long)total
,
331 pretty_size(device
->super_bytes_used
));
333 list_sort(NULL
, &fs_devices
->devices
, cmp_device_id
);
334 list_for_each(cur
, &fs_devices
->devices
) {
335 device
= list_entry(cur
, struct btrfs_device
, dev_list
);
337 printf("\tdevid %4llu size %s used %s path %s\n",
338 (unsigned long long)device
->devid
,
339 pretty_size(device
->total_bytes
),
340 pretty_size(device
->bytes_used
), device
->name
);
344 if (devs_found
< total
) {
345 printf("\t*** Some devices missing\n");
350 /* adds up all the used spaces as reported by the space info ioctl
352 static u64
calc_used_bytes(struct btrfs_ioctl_space_args
*si
)
356 for (i
= 0; i
< si
->total_spaces
; i
++)
357 ret
+= si
->spaces
[i
].used_bytes
;
361 static int print_one_fs(struct btrfs_ioctl_fs_info_args
*fs_info
,
362 struct btrfs_ioctl_dev_info_args
*dev_info
,
363 struct btrfs_ioctl_space_args
*space_info
,
364 char *label
, char *path
)
369 char uuidbuf
[BTRFS_UUID_UNPARSED_SIZE
];
370 struct btrfs_ioctl_dev_info_args
*tmp_dev_info
;
373 ret
= add_seen_fsid(fs_info
->fsid
);
379 uuid_unparse(fs_info
->fsid
, uuidbuf
);
380 if (label
&& strlen(label
))
381 printf("Label: '%s' ", label
);
383 printf("Label: none ");
385 printf(" uuid: %s\n\tTotal devices %llu FS bytes used %s\n", uuidbuf
,
386 fs_info
->num_devices
,
387 pretty_size(calc_used_bytes(space_info
)));
389 for (i
= 0; i
< fs_info
->num_devices
; i
++) {
390 tmp_dev_info
= (struct btrfs_ioctl_dev_info_args
*)&dev_info
[i
];
392 /* Add check for missing devices even mounted */
393 fd
= open((char *)tmp_dev_info
->path
, O_RDONLY
);
399 printf("\tdevid %4llu size %s used %s path %s\n",
401 pretty_size(tmp_dev_info
->total_bytes
),
402 pretty_size(tmp_dev_info
->bytes_used
),
407 printf("\t*** Some devices missing\n");
412 /* This function checks if the given input parameter is
414 * return -1: some error in the given input
415 * return 0: unknow input
416 * return 1: given input is uuid
417 * return 2: given input is path
419 static int check_arg_type(char *input
)
427 if (realpath(input
, path
)) {
428 if (is_block_device(path
) == 1)
429 return BTRFS_ARG_BLKDEV
;
431 if (is_mount_point(path
) == 1)
432 return BTRFS_ARG_MNTPOINT
;
434 return BTRFS_ARG_UNKNOWN
;
437 if (strlen(input
) == (BTRFS_UUID_UNPARSED_SIZE
- 1) &&
438 !uuid_parse(input
, out
))
439 return BTRFS_ARG_UUID
;
441 return BTRFS_ARG_UNKNOWN
;
444 static int btrfs_scan_kernel(void *search
)
449 struct btrfs_ioctl_fs_info_args fs_info_arg
;
450 struct btrfs_ioctl_dev_info_args
*dev_info_arg
= NULL
;
451 struct btrfs_ioctl_space_args
*space_info_arg
;
452 char label
[BTRFS_LABEL_SIZE
];
454 f
= setmntent("/proc/self/mounts", "r");
458 memset(label
, 0, sizeof(label
));
459 while ((mnt
= getmntent(f
)) != NULL
) {
460 if (strcmp(mnt
->mnt_type
, "btrfs"))
462 ret
= get_fs_info(mnt
->mnt_dir
, &fs_info_arg
,
467 if (get_label_mounted(mnt
->mnt_dir
, label
)) {
472 if (search
&& !match_search_item_kernel(fs_info_arg
.fsid
,
473 mnt
->mnt_dir
, label
, search
)) {
478 fd
= open(mnt
->mnt_dir
, O_RDONLY
);
479 if ((fd
!= -1) && !get_df(fd
, &space_info_arg
)) {
480 print_one_fs(&fs_info_arg
, dev_info_arg
,
481 space_info_arg
, label
, mnt
->mnt_dir
);
482 kfree(space_info_arg
);
483 memset(label
, 0, sizeof(label
));
499 static int dev_to_fsid(char *dev
, __u8
*fsid
)
501 struct btrfs_super_block
*disk_super
;
510 fd
= open(dev
, O_RDONLY
);
517 disk_super
= (struct btrfs_super_block
*)buf
;
518 ret
= btrfs_read_dev_super(fd
, disk_super
,
519 BTRFS_SUPER_INFO_OFFSET
);
523 memcpy(fsid
, disk_super
->fsid
, BTRFS_FSID_SIZE
);
532 static const char * const cmd_show_usage
[] = {
533 "btrfs filesystem show [options] [<path>|<uuid>|<device>|label]",
534 "Show the structure of a filesystem",
535 "-d|--all-devices show only disks under /dev containing btrfs filesystem",
536 "-m|--mounted show only mounted btrfs",
537 "If no argument is given, structure of all present filesystems is shown.",
541 static int cmd_show(int argc
, char **argv
)
543 struct list_head
*all_uuids
;
544 struct btrfs_fs_devices
*fs_devices
;
545 struct list_head
*cur_uuid
;
548 int where
= BTRFS_SCAN_LBLKID
;
550 char mp
[BTRFS_PATH_NAME_MAX
+ 1];
552 __u8 fsid
[BTRFS_FSID_SIZE
];
558 static struct option long_options
[] = {
559 { "all-devices", no_argument
, NULL
, 'd'},
560 { "mounted", no_argument
, NULL
, 'm'},
561 { NULL
, no_argument
, NULL
, 0 },
563 int c
= getopt_long(argc
, argv
, "dm", long_options
,
569 where
= BTRFS_SCAN_DEV
;
572 where
= BTRFS_SCAN_MOUNTED
;
575 usage(cmd_show_usage
);
579 if (check_argc_max(argc
, optind
+ 1))
580 usage(cmd_show_usage
);
583 search
= argv
[optind
];
584 if (strlen(search
) == 0)
585 usage(cmd_show_usage
);
586 type
= check_arg_type(search
);
588 * needs spl handling if input arg is block dev
589 * And if input arg is mount-point just print it
592 if (type
== BTRFS_ARG_BLKDEV
) {
593 if (where
== BTRFS_SCAN_DEV
) {
594 /* we need to do this because
595 * legacy BTRFS_SCAN_DEV
596 * provides /dev/dm-x paths
598 if (realpath(search
, path
))
601 ret
= get_btrfs_mount(search
,
604 /* given block dev is mounted*/
606 type
= BTRFS_ARG_MNTPOINT
;
608 ret
= dev_to_fsid(search
, fsid
);
611 "ERROR: No btrfs on %s\n",
615 uuid_unparse(fsid
, uuid_buf
);
617 type
= BTRFS_ARG_UUID
;
624 if (where
== BTRFS_SCAN_DEV
)
627 /* show mounted btrfs */
628 ret
= btrfs_scan_kernel(search
);
629 if (search
&& !ret
) {
630 /* since search is found we are done */
634 /* shows mounted only */
635 if (where
== BTRFS_SCAN_MOUNTED
)
639 ret
= scan_for_btrfs(where
, !BTRFS_UPDATE_KERNEL
);
642 fprintf(stderr
, "ERROR: %d while scanning\n", ret
);
646 all_uuids
= btrfs_scanned_uuids();
647 list_for_each(cur_uuid
, all_uuids
) {
648 fs_devices
= list_entry(cur_uuid
, struct btrfs_fs_devices
,
650 if (search
&& uuid_search(fs_devices
, search
) == 0)
653 print_one_uuid(fs_devices
);
656 if (search
&& !found
)
660 printf("%s\n", BTRFS_BUILD_VERSION
);
665 static const char * const cmd_sync_usage
[] = {
666 "btrfs filesystem sync <path>",
667 "Force a sync on a filesystem",
671 static int cmd_sync(int argc
, char **argv
)
675 DIR *dirstream
= NULL
;
677 if (check_argc_exact(argc
, 2))
678 usage(cmd_sync_usage
);
682 fd
= open_file_or_dir(path
, &dirstream
);
684 fprintf(stderr
, "ERROR: can't access '%s'\n", path
);
688 printf("FSSync '%s'\n", path
);
689 res
= ioctl(fd
, BTRFS_IOC_SYNC
);
691 close_file_or_dir(fd
, dirstream
);
693 fprintf(stderr
, "ERROR: unable to fs-syncing '%s' - %s\n",
701 static int parse_compress_type(char *s
)
703 if (strcmp(optarg
, "zlib") == 0)
704 return BTRFS_COMPRESS_ZLIB
;
705 else if (strcmp(optarg
, "lzo") == 0)
706 return BTRFS_COMPRESS_LZO
;
708 fprintf(stderr
, "Unknown compress type %s\n", s
);
713 static const char * const cmd_defrag_usage
[] = {
714 "btrfs filesystem defragment [options] <file>|<dir> [<file>|<dir>...]",
715 "Defragment a file or a directory",
718 "-r defragment files recursively",
719 "-c[zlib,lzo] compress the file while defragmenting",
720 "-f flush data to disk immediately after defragmenting",
721 "-s start defragment only from byte onward",
722 "-l len defragment only up to len bytes",
723 "-t size minimal size of file to be considered for defragmenting",
727 static int do_defrag(int fd
, int fancy_ioctl
,
728 struct btrfs_ioctl_defrag_range_args
*range
)
733 ret
= ioctl(fd
, BTRFS_IOC_DEFRAG
, NULL
);
735 ret
= ioctl(fd
, BTRFS_IOC_DEFRAG_RANGE
, range
);
740 static int defrag_global_fancy_ioctl
;
741 static struct btrfs_ioctl_defrag_range_args defrag_global_range
;
742 static int defrag_global_verbose
;
743 static int defrag_global_errors
;
744 static int defrag_callback(const char *fpath
, const struct stat
*sb
,
745 int typeflag
, struct FTW
*ftwbuf
)
751 if ((typeflag
== FTW_F
) && S_ISREG(sb
->st_mode
)) {
752 if (defrag_global_verbose
)
753 printf("%s\n", fpath
);
754 fd
= open(fpath
, O_RDWR
);
758 ret
= do_defrag(fd
, defrag_global_fancy_ioctl
, &defrag_global_range
);
761 if (ret
&& e
== ENOTTY
&& defrag_global_fancy_ioctl
) {
762 fprintf(stderr
, "ERROR: defrag range ioctl not "
763 "supported in this kernel, please try "
764 "without any options.\n");
765 defrag_global_errors
++;
774 fprintf(stderr
, "ERROR: defrag failed on %s - %s\n", fpath
, strerror(e
));
775 defrag_global_errors
++;
779 static int cmd_defrag(int argc
, char **argv
)
789 struct btrfs_ioctl_defrag_range_args range
;
791 int compress_type
= BTRFS_COMPRESS_NONE
;
794 defrag_global_errors
= 0;
795 defrag_global_verbose
= 0;
796 defrag_global_errors
= 0;
797 defrag_global_fancy_ioctl
= 0;
800 int c
= getopt(argc
, argv
, "vrc::fs:l:t:");
806 compress_type
= BTRFS_COMPRESS_ZLIB
;
808 compress_type
= parse_compress_type(optarg
);
809 defrag_global_fancy_ioctl
= 1;
813 defrag_global_fancy_ioctl
= 1;
816 defrag_global_verbose
= 1;
819 start
= parse_size(optarg
);
820 defrag_global_fancy_ioctl
= 1;
823 len
= parse_size(optarg
);
824 defrag_global_fancy_ioctl
= 1;
827 thresh
= parse_size(optarg
);
828 defrag_global_fancy_ioctl
= 1;
834 usage(cmd_defrag_usage
);
838 if (check_argc_min(argc
- optind
, 1))
839 usage(cmd_defrag_usage
);
841 memset(&defrag_global_range
, 0, sizeof(range
));
842 defrag_global_range
.start
= start
;
843 defrag_global_range
.len
= len
;
844 defrag_global_range
.extent_thresh
= thresh
;
846 defrag_global_range
.flags
|= BTRFS_DEFRAG_RANGE_COMPRESS
;
847 defrag_global_range
.compress_type
= compress_type
;
850 defrag_global_range
.flags
|= BTRFS_DEFRAG_RANGE_START_IO
;
852 for (i
= optind
; i
< argc
; i
++) {
856 fd
= open_file_or_dir(argv
[i
], &dirstream
);
858 fprintf(stderr
, "ERROR: failed to open %s - %s\n", argv
[i
],
860 defrag_global_errors
++;
861 close_file_or_dir(fd
, dirstream
);
864 if (fstat(fd
, &st
)) {
865 fprintf(stderr
, "ERROR: failed to stat %s - %s\n",
866 argv
[i
], strerror(errno
));
867 defrag_global_errors
++;
868 close_file_or_dir(fd
, dirstream
);
871 if (!(S_ISDIR(st
.st_mode
) || S_ISREG(st
.st_mode
))) {
873 "ERROR: %s is not a directory or a regular file\n",
875 defrag_global_errors
++;
876 close_file_or_dir(fd
, dirstream
);
880 if (S_ISDIR(st
.st_mode
)) {
881 ret
= nftw(argv
[i
], defrag_callback
, 10,
882 FTW_MOUNT
| FTW_PHYS
);
885 /* errors are handled in the callback */
888 if (defrag_global_verbose
)
889 printf("%s\n", argv
[i
]);
890 ret
= do_defrag(fd
, defrag_global_fancy_ioctl
,
891 &defrag_global_range
);
895 if (defrag_global_verbose
)
896 printf("%s\n", argv
[i
]);
897 ret
= do_defrag(fd
, defrag_global_fancy_ioctl
,
898 &defrag_global_range
);
901 close_file_or_dir(fd
, dirstream
);
902 if (ret
&& e
== ENOTTY
&& defrag_global_fancy_ioctl
) {
903 fprintf(stderr
, "ERROR: defrag range ioctl not "
904 "supported in this kernel, please try "
905 "without any options.\n");
906 defrag_global_errors
++;
910 fprintf(stderr
, "ERROR: defrag failed on %s - %s\n",
911 argv
[i
], strerror(e
));
912 defrag_global_errors
++;
915 if (defrag_global_verbose
)
916 printf("%s\n", BTRFS_BUILD_VERSION
);
917 if (defrag_global_errors
)
918 fprintf(stderr
, "total %d failures\n", defrag_global_errors
);
920 return !!defrag_global_errors
;
923 static const char * const cmd_resize_usage
[] = {
924 "btrfs filesystem resize [devid:][+/-]<newsize>[gkm]|[devid:]max <path>",
925 "Resize a filesystem",
926 "If 'max' is passed, the filesystem will occupy all available space",
927 "on the device 'devid'.",
931 static int cmd_resize(int argc
, char **argv
)
933 struct btrfs_ioctl_vol_args args
;
936 DIR *dirstream
= NULL
;
938 if (check_argc_exact(argc
, 3))
939 usage(cmd_resize_usage
);
944 len
= strlen(amount
);
945 if (len
== 0 || len
>= BTRFS_VOL_NAME_MAX
) {
946 fprintf(stderr
, "ERROR: size value too long ('%s)\n",
951 fd
= open_file_or_dir(path
, &dirstream
);
953 fprintf(stderr
, "ERROR: can't access '%s'\n", path
);
957 printf("Resize '%s' of '%s'\n", path
, amount
);
958 strncpy_null(args
.name
, amount
);
959 res
= ioctl(fd
, BTRFS_IOC_RESIZE
, &args
);
961 close_file_or_dir(fd
, dirstream
);
963 fprintf(stderr
, "ERROR: unable to resize '%s' - %s\n",
970 static const char * const cmd_label_usage
[] = {
971 "btrfs filesystem label [<device>|<mount_point>] [<newlabel>]",
972 "Get or change the label of a filesystem",
973 "With one argument, get the label of filesystem on <device>.",
974 "If <newlabel> is passed, set the filesystem label to <newlabel>.",
978 static int cmd_label(int argc
, char **argv
)
980 if (check_argc_min(argc
, 2) || check_argc_max(argc
, 3))
981 usage(cmd_label_usage
);
984 return set_label(argv
[1], argv
[2]);
986 char label
[BTRFS_LABEL_SIZE
];
989 ret
= get_label(argv
[1], label
);
991 fprintf(stdout
, "%s\n", label
);
997 const struct cmd_group filesystem_cmd_group
= {
998 filesystem_cmd_group_usage
, NULL
, {
999 { "df", cmd_df
, cmd_df_usage
, NULL
, 0 },
1000 { "show", cmd_show
, cmd_show_usage
, NULL
, 0 },
1001 { "sync", cmd_sync
, cmd_sync_usage
, NULL
, 0 },
1002 { "defragment", cmd_defrag
, cmd_defrag_usage
, NULL
, 0 },
1003 { "balance", cmd_balance
, NULL
, &balance_cmd_group
, 1 },
1004 { "resize", cmd_resize
, cmd_resize_usage
, NULL
, 0 },
1005 { "label", cmd_label
, cmd_label_usage
, NULL
, 0 },
1010 int cmd_filesystem(int argc
, char **argv
)
1012 return handle_command_group(&filesystem_cmd_group
, argc
, argv
);