diff options
author | phk <phk@FreeBSD.org> | 2002-04-02 11:23:14 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-04-02 11:23:14 +0000 |
commit | 79a894e10e07aef12898bb4e43dd33a501a1edb9 (patch) | |
tree | 1185eea4e40554c9e1ca4bf8274686061146f2eb /sys/ufs/ffs/ffs_vfsops.c | |
parent | bcba0677fbe7b038d8de4ccfa6a097ac2e97582c (diff) | |
download | FreeBSD-src-79a894e10e07aef12898bb4e43dd33a501a1edb9.zip FreeBSD-src-79a894e10e07aef12898bb4e43dd33a501a1edb9.tar.gz |
Use DIOCGSECTORSIZE instead of the bogus DIOCGPART ioctl.
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index b283489..f02c809 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -383,10 +383,10 @@ ffs_reload(mp, cred, td) void *space; struct buf *bp; struct fs *fs, *newfs; - struct partinfo dpart; dev_t dev; int i, blks, size, error; int32_t *lp; + u_int sectorsize; if ((mp->mnt_flag & MNT_RDONLY) == 0) return (EINVAL); @@ -416,10 +416,11 @@ ffs_reload(mp, cred, td) /* * Step 2: re-read superblock from disk. */ - if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, td) != 0) + if (VOP_IOCTL(devvp, DIOCGSECTORSIZE, (caddr_t)§orsize, + FREAD, NOCRED, td) != 0) size = DEV_BSIZE; else - size = dpart.disklab->d_secsize; + size = sectorsize; if ((error = bread(devvp, (ufs_daddr_t)(SBOFF/size), SBSIZE, NOCRED,&bp)) != 0) return (error); newfs = (struct fs *)bp->b_data; @@ -545,7 +546,6 @@ ffs_mountfs(devvp, mp, td, malloctype) struct buf *bp; register struct fs *fs; dev_t dev; - struct partinfo dpart; void *space; int error, i, blks, size, ronly; int32_t *lp; @@ -553,6 +553,7 @@ ffs_mountfs(devvp, mp, td, malloctype) u_int64_t maxfilesize; /* XXX */ size_t strsize; int ncount; + u_int sectorsize; dev = devvp->v_rdev; cred = td ? td->td_ucred : NOCRED; @@ -608,10 +609,11 @@ ffs_mountfs(devvp, mp, td, malloctype) if (mp->mnt_iosize_max > MAXPHYS) mp->mnt_iosize_max = MAXPHYS; - if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, cred, td) != 0) + if (VOP_IOCTL(devvp, DIOCGSECTORSIZE, (caddr_t)§orsize, + FREAD, cred, td) != 0) size = DEV_BSIZE; else - size = dpart.disklab->d_secsize; + size = sectorsize; bp = NULL; ump = NULL; |