NSH mount count updated from Ken Pettit

This commit is contained in:
Gregory Nutt 2013-11-17 12:30:04 -06:00
parent 647703e649
commit 36345c7234
2 changed files with 20 additions and 3 deletions

View File

@ -734,4 +734,6 @@
NxPlayer threads now have names assigned via pthread_setname_np().
From Ken Pettit (2013-11-10).
* apps/examples/i2schar: The beginning of an I2C test based on the I2C
character driver (2013-11-10).
character driver (2013-11-10).
* apps/nshlib/nsh_mntcmds.c: Mount command updates from Ken Pettit
(2013-11-17).

View File

@ -130,6 +130,12 @@ static const char* get_fstype(FAR struct statfs *statbuf)
break;
#endif
#ifdef CONFIG_FS_PROCFS
case PROCFS_MAGIC:
fstype = "procfs";
break;
#endif
default:
fstype = "Unrecognized";
break;
@ -215,15 +221,20 @@ static int df_man_readable_handler(FAR const char *mountpoint,
}
usedlabel = labels[which];
#ifndef CONFIG_NUTTX_KERNEL
nsh_output(vtbl, "%-10s %6ld%c %8ld%c %8ld%c %s\n", get_fstype(statbuf),
size, sizelabel, used, usedlabel, free, freelabel,
mountpoint);
#else
nsh_output(vtbl, "%6ld%c %8ld%c %8ld%c %s\n", size, sizelabel, used,
usedlabel, free, freelabel, mountpoint);
#endif
return OK;
}
#endif /* CONFIG_NSH_CMDOPT_DF_H */
#endif /* CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) &&
#endif /* CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) &&
defined(CONFIG_FS_READABLE) && !defined(CONFIG_NSH_DISABLE_DF) */
/****************************************************************************
@ -280,7 +291,11 @@ int cmd_df(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
#ifdef CONFIG_NSH_CMDOPT_DF_H
if (argc > 1 && strcmp(argv[1], "-h") == 0)
{
#ifndef CONFIG_NUTTX_KERNEL
nsh_output(vtbl, "Filesystem Size Used Available Mounted on\n");
#else
nsh_output(vtbl, "Size Used Available Mounted on\n");
#endif
return foreach_mountpoint(df_man_readable_handler, (FAR void *)vtbl);
}
else
@ -369,7 +384,7 @@ int cmd_mount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
source = NULL;
target = argv[optind];
optind++;
if (optind < argc)
{
source = target;