.RB [ --lazy | -l ]
.RB [ --pool | -p
.IR <fsname> [. <pool> ]]
+.RB [ --mdt | -m ]
+.RB [ --ost | -o ]
.RB [ --verbose | -v ]
.RI [ path ]
.SH DESCRIPTION
output if a target is offline or unreachable, and only returns the
space on OSTs that can currently be accessed.
.TP
+.BR -m ", " --mdt
+Filter output to show information on
+.B MDT
+devices. Can be used with
+.BR -o
+to show both types of devices, which is equivalent to having neither option.
+.TP
+.BR -o ", " --ost
+Filter output to show information on
+.B OST
+devices. Can be used with
+.BR -m
+to show both types of devices, which is equivalent to having neither option.
+.TP
.BR -p ", " --pool= [ \fIfsname\fR .] \fIpool\fR
Limit the usage to report only MDTs and OSTs that are in the specified
.IR pool .
}
run_test 56da "test lfs find with long paths"
+test_56db() {
+ local mdts=$($LFS df -m | grep -c MDT)
+ local osts=$($LFS df -m | grep -c OST)
+
+ $LFS df
+
+ (( mdts == MDSCOUNT )) ||
+ error "lfs df -m showed $mdts MDTs, not $MDSCOUNT"
+ (( osts == 0 )) ||
+ error "lfs df -m showed $osts OSTs, not 0"
+}
+run_test 56db "test 'lfs df -m' only shows MDT devices"
+
+test_56dc() {
+ local mdts=$($LFS df -o | grep -c MDT)
+ local osts=$($LFS df -o | grep -c OST)
+
+ $LFS df
+
+ (( osts == OSTCOUNT )) ||
+ error "lfs df -o showed $osts OSTs, not $OSTCOUNT"
+ (( mdts == 0 )) ||
+ error "lfs df -o showed $mdts MDTs, not 0"
+}
+run_test 56dc "test 'lfs df -o' only shows OST devices"
+
test_56ea() { #LU-10378
local path=$DIR/$tdir
local pool=$TESTNAME
"report filesystem disk space usage or inodes usage "
"of each MDS and all OSDs or a batch belonging to a specific pool.\n"
"Usage: df [--inodes|-i] [--human-readable|-h] [--lazy|-l]\n"
- " [--pool|-p <fsname>[.<pool>]] [path]"},
+ "[--mdt|-m] [--ost|-o]\n"
+ "[--pool|-p <fsname>[.<pool>]] [path]"},
{"getname", lfs_getname, 0,
"list instances and specified mount points [for specified path only]\n"
"Usage: getname [--help|-h] [--instance|-i] [--fsname|-n] [path ...]"},
{
char mntdir[PATH_MAX] = {'\0'}, path[PATH_MAX] = {'\0'};
enum mntdf_flags flags = MNTDF_SHOW;
- int ops = LL_STATFS_LMV | LL_STATFS_LOV;
+ int ops = 0;
int c, rc = 0, rc1 = 0, index = 0, arg_idx = 0;
char fsname[PATH_MAX] = "", *pool_name = NULL;
struct option long_opts[] = {
{ .val = 'l', .name = "lazy", .has_arg = no_argument },
{ .val = 'p', .name = "pool", .has_arg = required_argument },
{ .val = 'v', .name = "verbose", .has_arg = no_argument },
+ { .val = 'm', .name = "mdt", .has_arg = no_argument },
+ { .val = 'o', .name = "ost", .has_arg = no_argument },
{ .name = NULL} };
- while ((c = getopt_long(argc, argv, "hHilp:v", long_opts, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "hHilmop:v",
+ long_opts, NULL)) != -1) {
switch (c) {
case 'h':
flags = (flags & ~MNTDF_DECIMAL) | MNTDF_COOKED;
case 'l':
flags |= MNTDF_LAZY;
break;
+ case 'm':
+ ops |= LL_STATFS_LMV;
+ break;
+ case 'o':
+ ops |= LL_STATFS_LOV;
+ break;
case 'p':
pool_name = optarg;
break;
}
}
+ /* Handle case where neither MDT nor OST flag is specified */
+ if (!ops)
+ ops |= LL_STATFS_LMV | LL_STATFS_LOV;
+
/* Handle case where path is not specified */
if (optind == argc) {
while (!llapi_search_mounts(path, index++, mntdir, fsname)) {