Remove global variable rootdevs and rootvp, they are unused as such.

Add local rootvp variables as needed.

Remove checks for miniroot's in the swappartition.  We never did that
and most of the filesystems could never be used for that, but it had
still been copy&pasted all over the place.
This commit is contained in:
Poul-Henning Kamp 2004-07-28 20:21:04 +00:00
parent 56e0670fdc
commit d634f69316
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132805
11 changed files with 14 additions and 15 deletions

View File

@ -144,6 +144,7 @@ iso_mountroot(mp, td)
struct thread *td;
{
struct iso_args args;
struct vnode *rootvp;
int error;
if ((error = bdevvp(rootdev, &rootvp))) {
@ -297,7 +298,7 @@ iso_mountfs(devvp, mp, td, argp)
*/
if ((error = vfs_mountedon(devvp)))
return error;
if (vcount(devvp) > 1 && devvp != rootvp)
if (vcount(devvp) > 1)
return EBUSY;
if ((error = vinvalbuf(devvp, V_SAVE, td->td_ucred, td, 0, 0)))
return (error);

View File

@ -232,7 +232,7 @@ hpfs_mountfs(devvp, mp, argsp, td)
ncount = vcount(devvp);
if (devvp->v_object)
ncount -= 1;
if (ncount > 1 && devvp != rootvp)
if (ncount > 1)
return (EBUSY);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);

View File

@ -326,7 +326,7 @@ mountmsdosfs(devvp, mp, td, argp)
error = vfs_mountedon(devvp);
if (error)
return (error);
if (vcount(devvp) > 1 && devvp != rootvp)
if (vcount(devvp) > 1)
return (EBUSY);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
error = vinvalbuf(devvp, V_SAVE, td->td_ucred, td, 0, 0);

View File

@ -105,7 +105,7 @@ ntfs_mount (
{
size_t size;
int err = 0;
struct vnode *devvp;
struct vnode *devvp, *rootvp;
struct ntfs_args args;
/*
@ -289,7 +289,7 @@ ntfs_mountfs(devvp, mp, argsp, td)
ncount = vcount(devvp);
if (devvp->v_object)
ncount -= 1;
if (ncount > 1 && devvp != rootvp)
if (ncount > 1)
return (EBUSY);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
error = vinvalbuf(devvp, V_SAVE, td->td_ucred, td, 0, 0);

View File

@ -117,6 +117,7 @@ ext2_mountroot()
{
struct ext2_sb_info *fs;
struct mount *mp;
struct vnode *rootvp;
struct thread *td = curthread;
struct ext2mount *ump;
u_int size;
@ -642,7 +643,7 @@ ext2_mountfs(devvp, mp, td)
*/
if ((error = vfs_mountedon(devvp)) != 0)
return (error);
if (vcount(devvp) > 1 && devvp != rootvp)
if (vcount(devvp) > 1)
return (EBUSY);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
error = vinvalbuf(devvp, V_SAVE, td->td_ucred, td, 0, 0);

View File

@ -117,6 +117,7 @@ ext2_mountroot()
{
struct ext2_sb_info *fs;
struct mount *mp;
struct vnode *rootvp;
struct thread *td = curthread;
struct ext2mount *ump;
u_int size;
@ -642,7 +643,7 @@ ext2_mountfs(devvp, mp, td)
*/
if ((error = vfs_mountedon(devvp)) != 0)
return (error);
if (vcount(devvp) > 1 && devvp != rootvp)
if (vcount(devvp) > 1)
return (EBUSY);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
error = vinvalbuf(devvp, V_SAVE, td->td_ucred, td, 0, 0);

View File

@ -144,6 +144,7 @@ iso_mountroot(mp, td)
struct thread *td;
{
struct iso_args args;
struct vnode *rootvp;
int error;
if ((error = bdevvp(rootdev, &rootvp))) {
@ -297,7 +298,7 @@ iso_mountfs(devvp, mp, td, argp)
*/
if ((error = vfs_mountedon(devvp)))
return error;
if (vcount(devvp) > 1 && devvp != rootvp)
if (vcount(devvp) > 1)
return EBUSY;
if ((error = vinvalbuf(devvp, V_SAVE, td->td_ucred, td, 0, 0)))
return (error);

View File

@ -96,7 +96,6 @@ static struct filedesc0 filedesc0;
struct vmspace vmspace0;
struct proc *initproc;
struct vnode *rootvp;
int boothowto = 0; /* initialized so that it can be patched */
SYSCTL_INT(_debug, OID_AUTO, boothowto, CTLFLAG_RD, &boothowto, 0, "");
int bootverbose;

View File

@ -479,8 +479,6 @@ nfs_mountroot(struct mount *mp, struct thread *td)
return (error);
}
rootvp = vp;
/*
* This is not really an nfs issue, but it is much easier to
* set hostname here and then let the "/etc/rc.xxx" files

View File

@ -64,9 +64,7 @@ extern struct cv selwait; /* select conditional variable */
extern long physmem; /* physical memory */
extern struct cdev *rootdev; /* root device */
extern struct cdev *rootdevs[2]; /* possible root devices */
extern char *rootdevnames[2]; /* names of possible root devices */
extern struct vnode *rootvp; /* vnode equivalent to above */
extern int boothowto; /* reboot flags, from console subsystem */
extern int bootverbose; /* nonzero to print verbose messages */

View File

@ -142,7 +142,7 @@ ffs_mount(mp, path, data, ndp, td)
struct thread *td; /* process requesting mount*/
{
size_t size;
struct vnode *devvp;
struct vnode *devvp, *rootvp;
struct ufs_args args;
struct ufsmount *ump = 0;
struct fs *fs;
@ -565,7 +565,7 @@ ffs_mountfs(devvp, mp, td)
error = vfs_mountedon(devvp);
if (error)
return (error);
if (vcount(devvp) > 1 && devvp != rootvp)
if (vcount(devvp) > 1)
return (EBUSY);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
error = vinvalbuf(devvp, V_SAVE, cred, td, 0, 0);