diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2004-04-26 15:13:46 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2004-04-26 15:13:46 +0000 |
commit | 788a94ec838387260dd50d92bd05d96aff3db843 (patch) | |
tree | c329cf1b1baaf177a2a5572ee6d04cedc2c6371f /sys/ufs | |
parent | 590a18f52ca14f52edaf8e4f3de51d707b0fc5b4 (diff) | |
download | FreeBSD-src-788a94ec838387260dd50d92bd05d96aff3db843.zip FreeBSD-src-788a94ec838387260dd50d92bd05d96aff3db843.tar.gz |
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>
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 8f205db..951f0eb 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -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, |