Report the difference between ufs and ufs2.
Submitted by: "Christian S.J. Peron" <maneo@bsdpro.com>
This commit is contained in:
parent
9aa2bd22cd
commit
c6d1415d6a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125933
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
PROG= mount
|
PROG= mount
|
||||||
SRCS= mount.c mount_ufs.c getmntopts.c vfslist.c
|
SRCS= mount.c mount_ufs.c getmntopts.c vfslist.c
|
||||||
|
DPADD= ${LIBUFS}
|
||||||
|
LDADD= -lufs
|
||||||
WARNS?= 0
|
WARNS?= 0
|
||||||
MAN= mount.8
|
MAN= mount.8
|
||||||
# We do NOT install the getmntopts.3 man page.
|
# We do NOT install the getmntopts.3 man page.
|
||||||
|
@ -50,6 +50,10 @@ static const char rcsid[] =
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
|
#include <ufs/ufs/ufsmount.h>
|
||||||
|
#include <ufs/ufs/dinode.h>
|
||||||
|
#include <ufs/ffs/fs.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -62,13 +66,14 @@ static const char rcsid[] =
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <libufs.h>
|
||||||
|
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
#include "mntopts.h"
|
#include "mntopts.h"
|
||||||
#include "pathnames.h"
|
#include "pathnames.h"
|
||||||
|
|
||||||
/* `meta' options */
|
/* `meta' options */
|
||||||
#define MOUNT_META_OPTION_FSTAB "fstab"
|
#define MOUNT_META_OPTION_FSTAB "fstab"
|
||||||
#define MOUNT_META_OPTION_CURRENT "current"
|
#define MOUNT_META_OPTION_CURRENT "current"
|
||||||
|
|
||||||
int debug, fstab_style, verbose;
|
int debug, fstab_style, verbose;
|
||||||
@ -514,10 +519,16 @@ prmount(sfp)
|
|||||||
int flags, i;
|
int flags, i;
|
||||||
struct opt *o;
|
struct opt *o;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
|
struct uufsd disk;
|
||||||
|
|
||||||
(void)printf("%s on %s (%s", sfp->f_mntfromname, sfp->f_mntonname,
|
(void)printf("%s on %s (%s", sfp->f_mntfromname, sfp->f_mntonname,
|
||||||
sfp->f_fstypename);
|
sfp->f_fstypename);
|
||||||
|
|
||||||
|
if (strncmp(sfp->f_fstypename, "ufs", 3) == 0) {
|
||||||
|
ufs_disk_fillout(&disk, sfp->f_mntonname);
|
||||||
|
printf("%s", (disk.d_ufs == 2) ? "2" : "");
|
||||||
|
}
|
||||||
|
|
||||||
flags = sfp->f_flags & MNT_VISFLAGMASK;
|
flags = sfp->f_flags & MNT_VISFLAGMASK;
|
||||||
for (o = optnames; flags && o->o_opt; o++)
|
for (o = optnames; flags && o->o_opt; o++)
|
||||||
if (flags & o->o_opt) {
|
if (flags & o->o_opt) {
|
||||||
@ -664,7 +675,7 @@ update_options(opts, fstab, curflags)
|
|||||||
for (p = expopt; (o = strsep(&p, ",")) != NULL;) {
|
for (p = expopt; (o = strsep(&p, ",")) != NULL;) {
|
||||||
if ((tmpopt = malloc( strlen(o) + 2 + 1 )) == NULL)
|
if ((tmpopt = malloc( strlen(o) + 2 + 1 )) == NULL)
|
||||||
errx(1, "malloc failed");
|
errx(1, "malloc failed");
|
||||||
|
|
||||||
strcpy(tmpopt, "no");
|
strcpy(tmpopt, "no");
|
||||||
strcat(tmpopt, o);
|
strcat(tmpopt, o);
|
||||||
remopt(newopt, tmpopt);
|
remopt(newopt, tmpopt);
|
||||||
@ -721,7 +732,7 @@ putfsent(ent)
|
|||||||
{
|
{
|
||||||
struct fstab *fst;
|
struct fstab *fst;
|
||||||
char *opts;
|
char *opts;
|
||||||
|
|
||||||
opts = flags2opts(ent->f_flags);
|
opts = flags2opts(ent->f_flags);
|
||||||
printf("%s\t%s\t%s %s", ent->f_mntfromname, ent->f_mntonname,
|
printf("%s\t%s\t%s %s", ent->f_mntfromname, ent->f_mntonname,
|
||||||
ent->f_fstypename, opts);
|
ent->f_fstypename, opts);
|
||||||
|
Loading…
Reference in New Issue
Block a user