The previous change to mount(8) to report ufs or ufs2 used

libufs, which only works for Charlie root.

This change reverts the introduction of libufs and moves the
check into the kernel.  Since the f_fstypename is the same
for both ufs and ufs2, we check fs_magic for presence of
ufs2 and copy "ufs2" explicitly instead.

Submitted by: Christian S.J. Peron <maneo@bsdpro.com>
This commit is contained in:
Bosko Milekic 2004-04-26 15:13:46 +00:00
parent 922ee196d9
commit 2aebb586db
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128658
3 changed files with 9 additions and 15 deletions

View File

@ -3,8 +3,6 @@
PROG= mount
SRCS= mount.c mount_ufs.c getmntopts.c vfslist.c
DPADD= ${LIBUFS}
LDADD= -lufs
WARNS?= 0
MAN= mount.8
# We do NOT install the getmntopts.3 man page.

View File

@ -46,10 +46,6 @@ static const char rcsid[] =
#include <sys/stat.h>
#include <sys/wait.h>
#include <ufs/ufs/ufsmount.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
@ -62,7 +58,6 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <libufs.h>
#include "extern.h"
#include "mntopts.h"
@ -515,16 +510,10 @@ prmount(sfp)
int flags, i;
struct opt *o;
struct passwd *pw;
struct uufsd disk;
(void)printf("%s on %s (%s", sfp->f_mntfromname, sfp->f_mntonname,
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;
for (o = optnames; flags && o->o_opt; o++)
if (flags & o->o_opt) {

View File

@ -1062,6 +1062,9 @@ ffs_statfs(mp, sbp, td)
fs = ump->um_fs;
if (fs->fs_magic != FS_UFS1_MAGIC && fs->fs_magic != FS_UFS2_MAGIC)
panic("ffs_statfs");
if (fs->fs_magic == FS_UFS2_MAGIC)
bcopy((caddr_t)"ufs2",
(caddr_t)&sbp->f_fstypename[0], MFSNAMELEN);
sbp->f_version = STATFS_VERSION;
sbp->f_bsize = fs->fs_fsize;
sbp->f_iosize = fs->fs_bsize;
@ -1082,8 +1085,12 @@ ffs_statfs(mp, sbp, td)
sbp->f_asyncreads = mp->mnt_stat.f_asyncreads;
sbp->f_owner = mp->mnt_stat.f_owner;
sbp->f_fsid = mp->mnt_stat.f_fsid;
bcopy((caddr_t)mp->mnt_stat.f_fstypename,
(caddr_t)&sbp->f_fstypename[0], MFSNAMELEN);
if (fs->fs_magic == FS_UFS2_MAGIC)
bcopy((caddr_t)"ufs2",
(caddr_t)&sbp->f_fstypename[0], MFSNAMELEN);
else
bcopy((caddr_t)mp->mnt_stat.f_fstypename,
(caddr_t)&sbp->f_fstypename[0], MFSNAMELEN);
bcopy((caddr_t)mp->mnt_stat.f_mntonname,
(caddr_t)&sbp->f_mntonname[0], MNAMELEN);
bcopy((caddr_t)mp->mnt_stat.f_mntfromname,