Make VFS_ROOT() and vflush() take a thread argument.

This is to allow filesystems to decide based on the passed thread
which vnode to return.
Several filesystems used curthread, they now use the passed thread.
This commit is contained in:
Alfred Perlstein 2004-07-12 08:14:09 +00:00
parent 57a3bc4163
commit f257b7a54b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132023
37 changed files with 100 additions and 84 deletions

View File

@ -252,7 +252,7 @@ coda_unmount(vfsp, mntflags, td)
active = coda_kill(vfsp, NOT_DOWNCALL);
ASSERT_VOP_LOCKED(mi->mi_rootvp, "coda_unmount");
mi->mi_rootvp->v_vflag &= ~VV_ROOT;
error = vflush(mi->mi_vfsp, 0, FORCECLOSE);
error = vflush(mi->mi_vfsp, 0, FORCECLOSE, td);
#ifdef CODA_VERBOSE
printf("coda_unmount: active = %d, vflush active %d\n", active, error);
#endif
@ -280,9 +280,10 @@ coda_unmount(vfsp, mntflags, td)
* find root of cfs
*/
int
coda_root(vfsp, vpp)
coda_root(vfsp, vpp, td)
struct mount *vfsp;
struct vnode **vpp;
struct thread *td;
{
struct coda_mntinfo *mi = vftomi(vfsp);
struct vnode **result;

View File

@ -554,7 +554,7 @@ cd9660_unmount(mp, mntflags, td)
if (mntinvalbuf(mp))
return EBUSY;
#endif
if ((error = vflush(mp, 0, flags)))
if ((error = vflush(mp, 0, flags, td)))
return (error);
isomp = VFSTOISOFS(mp);
@ -578,9 +578,10 @@ cd9660_unmount(mp, mntflags, td)
* Return root of a filesystem
*/
static int
cd9660_root(mp, vpp)
cd9660_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct iso_mnt *imp = VFSTOISOFS(mp);
struct iso_directory_record *dp =

View File

@ -252,7 +252,7 @@ coda_unmount(vfsp, mntflags, td)
active = coda_kill(vfsp, NOT_DOWNCALL);
ASSERT_VOP_LOCKED(mi->mi_rootvp, "coda_unmount");
mi->mi_rootvp->v_vflag &= ~VV_ROOT;
error = vflush(mi->mi_vfsp, 0, FORCECLOSE);
error = vflush(mi->mi_vfsp, 0, FORCECLOSE, td);
#ifdef CODA_VERBOSE
printf("coda_unmount: active = %d, vflush active %d\n", active, error);
#endif
@ -280,9 +280,10 @@ coda_unmount(vfsp, mntflags, td)
* find root of cfs
*/
int
coda_root(vfsp, vpp)
coda_root(vfsp, vpp, td)
struct mount *vfsp;
struct vnode **vpp;
struct thread *td;
{
struct coda_mntinfo *mi = vftomi(vfsp);
struct vnode **result;

View File

@ -101,7 +101,7 @@ devfs_nmount(mp, ndp, td)
fmp->dm_basedir = fmp->dm_rootdir;
devfs_rules_newmount(fmp, td);
error = devfs_root(mp, &rvp);
error = devfs_root(mp, &rvp, td);
if (error) {
lockdestroy(&fmp->dm_lock);
FREE(fmp, M_DEVFS);
@ -130,7 +130,7 @@ devfs_unmount(mp, mntflags, td)
if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
/* There is 1 extra root vnode reference from devfs_mount(). */
error = vflush(mp, 1, flags);
error = vflush(mp, 1, flags, td);
if (error)
return (error);
devfs_purge(fmp->dm_rootdir);
@ -144,16 +144,15 @@ devfs_unmount(mp, mntflags, td)
/* Return locked reference to root. */
static int
devfs_root(mp, vpp)
devfs_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
int error;
struct thread *td;
struct vnode *vp;
struct devfs_mount *dmp;
td = curthread; /* XXX */
dmp = VFSTODEVFS(mp);
error = devfs_allocv(dmp->dm_rootdir, mp, &vp, td);
if (error)

View File

@ -58,8 +58,8 @@ struct fdescnode {
#define VFSTOFDESC(mp) ((struct fdescmount *)((mp)->mnt_data))
#define VTOFDESC(vp) ((struct fdescnode *)(vp)->v_data)
extern int fdesc_init(struct vfsconf *);
extern int fdesc_root(struct mount *, struct vnode **);
extern vfs_init_t fdesc_init;
extern vfs_root_t fdesc_root;
extern int fdesc_allocvp(fdntype, int, struct mount *, struct vnode **,
struct thread *);
#endif /* _KERNEL */

View File

@ -117,7 +117,7 @@ fdesc_unmount(mp, mntflags, td)
* There is 1 extra root vnode reference corresponding
* to f_root.
*/
if ((error = vflush(mp, 1, flags)) != 0)
if ((error = vflush(mp, 1, flags, td)) != 0)
return (error);
/*
@ -130,9 +130,10 @@ fdesc_unmount(mp, mntflags, td)
}
int
fdesc_root(mp, vpp)
fdesc_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct thread *td = curthread; /* XXX */
struct vnode *vp;

View File

@ -300,7 +300,7 @@ hpfs_mountfs(devvp, mp, argsp, td)
goto failed;
}
error = hpfs_root(mp, &vp);
error = hpfs_root(mp, &vp, td);
if (error) {
hpfs_cpdeinit(hpmp);
hpfs_bmdeinit(hpmp);
@ -344,7 +344,7 @@ hpfs_unmount(
dprintf(("hpfs_unmount: vflushing...\n"));
error = vflush(mp, 0, flags);
error = vflush(mp, 0, flags, td);
if (error) {
printf("hpfs_unmount: vflush failed: %d\n",error);
return (error);
@ -371,7 +371,8 @@ hpfs_unmount(
static int
hpfs_root(
struct mount *mp,
struct vnode **vpp )
struct vnode **vpp,
struct thread *td )
{
int error = 0;
struct hpfsmount *hpmp = VFSTOHPFS(mp);

View File

@ -91,7 +91,8 @@ static MALLOC_DEFINE(M_MSDOSFSFAT, "MSDOSFS FAT", "MSDOSFS file allocation table
struct iconv_functions *msdosfs_iconv = NULL;
static int update_mp(struct mount *mp, struct msdosfs_args *argp);
static int update_mp(struct mount *mp, struct msdosfs_args *argp,
struct thread *td);
static int mountmsdosfs(struct vnode *devvp, struct mount *mp,
struct thread *td, struct msdosfs_args *argp);
static vfs_fhtovp_t msdosfs_fhtovp;
@ -103,9 +104,10 @@ static vfs_unmount_t msdosfs_unmount;
static vfs_vptofh_t msdosfs_vptofh;
static int
update_mp(mp, argp)
update_mp(mp, argp, td)
struct mount *mp;
struct msdosfs_args *argp;
struct thread *td;
{
struct msdosfsmount *pmp = VFSTOMSDOSFS(mp);
int error;
@ -139,7 +141,7 @@ update_mp(mp, argp)
if (FAT32(pmp))
pmp->pm_flags |= MSDOSFSMNT_LONGNAME;
else {
if ((error = msdosfs_root(mp, &rootvp)) != 0)
if ((error = msdosfs_root(mp, &rootvp, td)) != 0)
return error;
pmp->pm_flags |= findwin95(VTODE(rootvp))
? MSDOSFSMNT_LONGNAME
@ -187,7 +189,7 @@ msdosfs_mount(mp, path, data, ndp, td)
flags = WRITECLOSE;
if (mp->mnt_flag & MNT_FORCE)
flags |= FORCECLOSE;
error = vflush(mp, 0, flags);
error = vflush(mp, 0, flags, td);
}
if (!error && (mp->mnt_flag & MNT_RELOAD))
/* not yet implemented */
@ -282,7 +284,7 @@ msdosfs_mount(mp, path, data, ndp, td)
return (error);
}
error = update_mp(mp, &args);
error = update_mp(mp, &args, td);
if (error) {
msdosfs_unmount(mp, MNT_FORCE, td);
return error;
@ -674,7 +676,7 @@ msdosfs_unmount(mp, mntflags, td)
flags = 0;
if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
error = vflush(mp, 0, flags);
error = vflush(mp, 0, flags, td);
if (error)
return error;
pmp = VFSTOMSDOSFS(mp);
@ -741,9 +743,10 @@ msdosfs_unmount(mp, mntflags, td)
}
static int
msdosfs_root(mp, vpp)
msdosfs_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct msdosfsmount *pmp = VFSTOMSDOSFS(mp);
struct denode *ndep;

View File

@ -457,7 +457,7 @@ ntfs_mountfs(devvp, mp, argsp, td)
for(i=0;i<NTFS_SYSNODESNUM;i++)
if(ntmp->ntm_sysvn[i]) vrele(ntmp->ntm_sysvn[i]);
if (vflush(mp, 0, 0))
if (vflush(mp, 0, 0, td))
dprintf(("ntfs_mountfs: vflush failed\n"));
out:
@ -487,7 +487,7 @@ ntfs_unmount(
flags |= FORCECLOSE;
dprintf(("ntfs_unmount: vflushing...\n"));
error = vflush(mp, 0, flags | SKIPSYSTEM);
error = vflush(mp, 0, flags | SKIPSYSTEM, td);
if (error) {
printf("ntfs_unmount: vflush failed: %d\n",error);
return (error);
@ -503,7 +503,7 @@ ntfs_unmount(
if(ntmp->ntm_sysvn[i]) vrele(ntmp->ntm_sysvn[i]);
/* vflush system vnodes */
error = vflush(mp, 0, flags);
error = vflush(mp, 0, flags, td);
if (error)
printf("ntfs_unmount: vflush failed(sysnodes): %d\n",error);
@ -538,7 +538,8 @@ ntfs_unmount(
static int
ntfs_root(
struct mount *mp,
struct vnode **vpp )
struct vnode **vpp,
struct thread *td )
{
struct vnode *nvp;
int error = 0;

View File

@ -228,7 +228,7 @@ nullfs_unmount(mp, mntflags, td)
flags |= FORCECLOSE;
/* There is 1 extra root vnode reference (nullm_rootvp). */
error = vflush(mp, 1, flags);
error = vflush(mp, 1, flags, td);
if (error)
return (error);
@ -242,11 +242,11 @@ nullfs_unmount(mp, mntflags, td)
}
static int
nullfs_root(mp, vpp)
nullfs_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct thread *td = curthread; /* XXX */
struct vnode *vp;
NULLFSDEBUG("nullfs_root(mp = %p, vp = %p->%p)\n", (void *)mp,

View File

@ -208,7 +208,7 @@ static int nwfs_mount(struct mount *mp, char *path, caddr_t data,
/* protect against invalid mount points */
nmp->m.mount_point[sizeof(nmp->m.mount_point)-1] = '\0';
vfs_getnewfsid(mp);
error = nwfs_root(mp, &vp);
error = nwfs_root(mp, &vp, td);
if (error)
goto bad;
/*
@ -238,7 +238,7 @@ nwfs_unmount(struct mount *mp, int mntflags, struct thread *td)
if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
/* There is 1 extra root vnode reference from nwfs_mount(). */
error = vflush(mp, 1, flags);
error = vflush(mp, 1, flags, td);
if (error)
return (error);
conn = NWFSTOCONN(nmp);
@ -257,13 +257,12 @@ nwfs_unmount(struct mount *mp, int mntflags, struct thread *td)
/* Return locked vnode to root of a filesystem */
static int
nwfs_root(struct mount *mp, struct vnode **vpp) {
nwfs_root(struct mount *mp, struct vnode **vpp, struct thread *td) {
struct vnode *vp;
struct nwmount *nmp;
struct nwnode *np;
struct ncp_conn *conn;
struct nw_entry_info fattr;
struct thread *td = curthread;
struct ucred *cred = td->td_ucred;
int error, nsf, opt;
u_char vol;

View File

@ -170,7 +170,7 @@ portal_unmount(mp, mntflags, td)
return (EBUSY);
#endif
/* There is 1 extra root vnode reference (pm_root). */
error = vflush(mp, 1, flags);
error = vflush(mp, 1, flags, td);
if (error)
return (error);
@ -194,9 +194,10 @@ portal_unmount(mp, mntflags, td)
}
static int
portal_root(mp, vpp)
portal_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct thread *td = curthread; /* XXX */
struct vnode *vp;

View File

@ -295,7 +295,7 @@ pfs_unmount(struct mount *mp, int mntflags, struct thread *td)
/* XXX do stuff with pi... */
error = vflush(mp, 0, (mntflags & MNT_FORCE) ? FORCECLOSE : 0);
error = vflush(mp, 0, (mntflags & MNT_FORCE) ? FORCECLOSE : 0, td);
return (error);
}
@ -303,7 +303,7 @@ pfs_unmount(struct mount *mp, int mntflags, struct thread *td)
* Return a root vnode
*/
int
pfs_root(struct mount *mp, struct vnode **vpp)
pfs_root(struct mount *mp, struct vnode **vpp, struct thread *td)
{
struct pfs_info *pi;

View File

@ -201,7 +201,8 @@ int pfs_mount (struct pfs_info *pi, struct mount *mp,
struct nameidata *ndp, struct thread *td);
int pfs_unmount (struct mount *mp, int mntflags,
struct thread *td);
int pfs_root (struct mount *mp, struct vnode **vpp);
int pfs_root (struct mount *mp, struct vnode **vpp,
struct thread *td);
int pfs_statfs (struct mount *mp, struct statfs *sbp,
struct thread *td);
int pfs_init (struct pfs_info *pi, struct vfsconf *vfc);

View File

@ -189,7 +189,7 @@ smbfs_mount(struct mount *mp, char *path, caddr_t data,
/* protect against invalid mount points */
smp->sm_args.mount_point[sizeof(smp->sm_args.mount_point) - 1] = '\0';
vfs_getnewfsid(mp);
error = smbfs_root(mp, &vp);
error = smbfs_root(mp, &vp, td);
if (error)
goto bad;
VOP_UNLOCK(vp, 0, td);
@ -238,7 +238,7 @@ smbfs_unmount(struct mount *mp, int mntflags, struct thread *td)
do {
smp->sm_didrele = 0;
/* There is 1 extra root vnode reference from smbfs_mount(). */
error = vflush(mp, 1, flags);
error = vflush(mp, 1, flags, td);
} while (error == EBUSY && smp->sm_didrele != 0);
if (error)
return error;
@ -262,7 +262,7 @@ smbfs_unmount(struct mount *mp, int mntflags, struct thread *td)
* Return locked root vnode of a filesystem
*/
static int
smbfs_root(struct mount *mp, struct vnode **vpp)
smbfs_root(struct mount *mp, struct vnode **vpp, struct thread *td)
{
struct smbmount *smp = VFSTOSMBFS(mp);
struct vnode *vp;

View File

@ -501,7 +501,7 @@ udf_unmount(struct mount *mp, int mntflags, struct thread *td)
if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
if ((error = vflush(mp, 0, flags)))
if ((error = vflush(mp, 0, flags, td)))
return (error);
if (udfmp->im_flags & UDFMNT_KICONV && udf_iconv) {
@ -532,7 +532,7 @@ udf_unmount(struct mount *mp, int mntflags, struct thread *td)
}
static int
udf_root(struct mount *mp, struct vnode **vpp)
udf_root(struct mount *mp, struct vnode **vpp, struct thread *td)
{
struct udf_mnt *udfmp;
struct vnode *vp;

View File

@ -279,7 +279,7 @@ umapfs_unmount(mp, mntflags, td)
return (EBUSY);
#endif
/* There is 1 extra root vnode reference (umapm_rootvp). */
error = vflush(mp, 1, flags);
error = vflush(mp, 1, flags, td);
if (error)
return (error);
@ -292,9 +292,10 @@ umapfs_unmount(mp, mntflags, td)
}
static int
umapfs_root(mp, vpp)
umapfs_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct thread *td = curthread; /* XXX */
struct vnode *vp;

View File

@ -342,7 +342,7 @@ union_unmount(mp, mntflags, td)
* (d) times, where (d) is the maximum tree depth
* in the filesystem.
*/
for (freeing = 0; (error = vflush(mp, 0, flags)) != 0;) {
for (freeing = 0; (error = vflush(mp, 0, flags, td)) != 0;) {
int n;
/* count #vnodes held on mount list */
@ -378,9 +378,10 @@ union_unmount(mp, mntflags, td)
}
static int
union_root(mp, vpp)
union_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
int error;

View File

@ -268,7 +268,7 @@ union_lookup1(udvp, pdvp, vpp, cnp)
relock_pdvp = 1;
vput(dvp);
dvp = NULL;
error = VFS_ROOT(mp, &dvp);
error = VFS_ROOT(mp, &dvp, td);
vfs_unbusy(mp, td);

View File

@ -829,7 +829,7 @@ ext2_flushfiles(mp, flags, td)
{
int error;
error = vflush(mp, 0, flags);
error = vflush(mp, 0, flags, td);
return (error);
}
@ -1215,9 +1215,10 @@ printf("\nupdating superblock, waitfor=%s\n", waitfor == MNT_WAIT ? "yes":"no");
* Return the root of a filesystem.
*/
static int
ext2_root(mp, vpp)
ext2_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct vnode *nvp;
int error;

View File

@ -829,7 +829,7 @@ ext2_flushfiles(mp, flags, td)
{
int error;
error = vflush(mp, 0, flags);
error = vflush(mp, 0, flags, td);
return (error);
}
@ -1215,9 +1215,10 @@ printf("\nupdating superblock, waitfor=%s\n", waitfor == MNT_WAIT ? "yes":"no");
* Return the root of a filesystem.
*/
static int
ext2_root(mp, vpp)
ext2_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct vnode *nvp;
int error;

View File

@ -554,7 +554,7 @@ cd9660_unmount(mp, mntflags, td)
if (mntinvalbuf(mp))
return EBUSY;
#endif
if ((error = vflush(mp, 0, flags)))
if ((error = vflush(mp, 0, flags, td)))
return (error);
isomp = VFSTOISOFS(mp);
@ -578,9 +578,10 @@ cd9660_unmount(mp, mntflags, td)
* Return root of a filesystem
*/
static int
cd9660_root(mp, vpp)
cd9660_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct iso_mnt *imp = VFSTOISOFS(mp);
struct iso_directory_record *dp =

View File

@ -553,7 +553,7 @@ start_init(void *dummy)
vfs_mountroot();
/* Get the vnode for '/'. Set p->p_fd->fd_cdir to reference it. */
if (VFS_ROOT(TAILQ_FIRST(&mountlist), &rootvnode))
if (VFS_ROOT(TAILQ_FIRST(&mountlist), &rootvnode, td))
panic("cannot find root vnode");
FILEDESC_LOCK(p->p_fd);
p->p_fd->fd_cdir = rootvnode;

View File

@ -655,9 +655,10 @@ vop_stdputpages(ap)
* used to fill the vfs function table to get reasonable default return values.
*/
int
vfs_stdroot (mp, vpp)
vfs_stdroot (mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
return (EOPNOTSUPP);

View File

@ -296,7 +296,7 @@ vfs_setpublicfs(mp, nep, argp)
bzero(&nfs_pub.np_handle, sizeof(nfs_pub.np_handle));
nfs_pub.np_handle.fh_fsid = mp->mnt_stat.f_fsid;
if ((error = VFS_ROOT(mp, &rvp)))
if ((error = VFS_ROOT(mp, &rvp, curthread /* XXX */)))
return (error);
if ((error = VFS_VPTOFH(rvp, &nfs_pub.np_handle.fh_fid)))

View File

@ -690,7 +690,7 @@ fchdir(td, uap)
while (!error && (mp = vp->v_mountedhere) != NULL) {
if (vfs_busy(mp, 0, 0, td))
continue;
error = VFS_ROOT(mp, &tdp);
error = VFS_ROOT(mp, &tdp, td);
vfs_unbusy(mp, td);
if (error)
break;

View File

@ -555,7 +555,7 @@ lookup(ndp)
if (vfs_busy(mp, 0, 0, td))
continue;
VOP_UNLOCK(dp, 0, td);
error = VFS_ROOT(mp, &tdp);
error = VFS_ROOT(mp, &tdp, td);
vfs_unbusy(mp, td);
if (error) {
dpunlocked = 1;

View File

@ -913,7 +913,7 @@ vfs_domount(
TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
mtx_unlock(&mountlist_mtx);
vfs_event_signal(NULL, VQ_MOUNT, 0);
if (VFS_ROOT(mp, &newdp))
if (VFS_ROOT(mp, &newdp, td))
panic("mount: lost mount");
checkdirs(vp, newdp);
vput(newdp);
@ -1114,7 +1114,7 @@ dounmount(mp, flags, td)
* vnode to the covered vnode. For non-forced unmounts we want
* such references to cause an EBUSY error.
*/
if ((flags & MNT_FORCE) && VFS_ROOT(mp, &fsrootvp) == 0) {
if ((flags & MNT_FORCE) && VFS_ROOT(mp, &fsrootvp, td) == 0) {
if (mp->mnt_vnodecovered != NULL)
checkdirs(fsrootvp, mp->mnt_vnodecovered);
if (fsrootvp == rootvnode) {
@ -1131,7 +1131,7 @@ dounmount(mp, flags, td)
vn_finished_write(mp);
if (error) {
/* Undo cdir/rdir and rootvnode changes made above. */
if ((flags & MNT_FORCE) && VFS_ROOT(mp, &fsrootvp) == 0) {
if ((flags & MNT_FORCE) && VFS_ROOT(mp, &fsrootvp, td) == 0) {
if (mp->mnt_vnodecovered != NULL)
checkdirs(mp->mnt_vnodecovered, fsrootvp);
if (rootvnode == NULL) {
@ -1465,7 +1465,7 @@ getdiskbyname(char *name)
if (error)
break;
VFS_START(mp, 0, td);
VFS_ROOT(mp, &vroot);
VFS_ROOT(mp, &vroot, td);
VOP_UNLOCK(vroot, 0, td);
NDINIT(&nid, LOOKUP, NOCACHE|FOLLOW,

View File

@ -2258,7 +2258,7 @@ vdropl(vp)
*
* `rootrefs' specifies the base reference count for the root vnode
* of this filesystem. The root vnode is considered busy if its
* v_usecount exceeds this value. On a successful return, vflush()
* v_usecount exceeds this value. On a successful return, vflush(, td)
* will call vrele() on the root vnode exactly rootrefs times.
* If the SKIPSYSTEM or WRITECLOSE flags are specified, rootrefs must
* be zero.
@ -2269,12 +2269,12 @@ SYSCTL_INT(_debug, OID_AUTO, busyprt, CTLFLAG_RW, &busyprt, 0, "");
#endif
int
vflush(mp, rootrefs, flags)
vflush(mp, rootrefs, flags, td)
struct mount *mp;
int rootrefs;
int flags;
struct thread *td;
{
struct thread *td = curthread; /* XXX */
struct vnode *vp, *nvp, *rootvp = NULL;
struct vattr vattr;
int busy = 0, error;
@ -2286,7 +2286,7 @@ vflush(mp, rootrefs, flags)
* Get the filesystem root vnode. We can vput() it
* immediately, since with rootrefs > 0, it won't go away.
*/
if ((error = VFS_ROOT(mp, &rootvp)) != 0)
if ((error = VFS_ROOT(mp, &rootvp, td)) != 0)
return (error);
vput(rootvp);

View File

@ -690,7 +690,7 @@ fchdir(td, uap)
while (!error && (mp = vp->v_mountedhere) != NULL) {
if (vfs_busy(mp, 0, 0, td))
continue;
error = VFS_ROOT(mp, &tdp);
error = VFS_ROOT(mp, &tdp, td);
vfs_unbusy(mp, td);
if (error)
break;

View File

@ -656,7 +656,7 @@ nfs_unmount(struct mount *mp, int mntflags, struct thread *td)
nmp = VFSTONFS(mp);
/*
* Goes something like this..
* - Call vflush() to clear out vnodes for this filesystem
* - Call vflush(, td) to clear out vnodes for this filesystem
* - Close the socket
* - Free up the data structures
*/
@ -668,7 +668,7 @@ nfs_unmount(struct mount *mp, int mntflags, struct thread *td)
nfs4dev_purge();
}
error = vflush(mp, 0, flags);
error = vflush(mp, 0, flags, td);
if (error)
return (error);
@ -689,7 +689,7 @@ nfs_unmount(struct mount *mp, int mntflags, struct thread *td)
* Return root of a filesystem
*/
static int
nfs_root(struct mount *mp, struct vnode **vpp)
nfs_root(struct mount *mp, struct vnode **vpp, struct thread *td)
{
struct vnode *vp;
struct nfsmount *nmp;

View File

@ -894,7 +894,7 @@ nfs_unmount(struct mount *mp, int mntflags, struct thread *td)
return (error);
}
/* We hold 1 extra ref on the root vnode; see comment in mountnfs(). */
error = vflush(mp, 1, flags);
error = vflush(mp, 1, flags, td);
if (error)
return (error);
@ -912,7 +912,7 @@ nfs_unmount(struct mount *mp, int mntflags, struct thread *td)
* Return root of a filesystem
*/
static int
nfs_root(struct mount *mp, struct vnode **vpp)
nfs_root(struct mount *mp, struct vnode **vpp, struct thread *td)
{
struct vnode *vp;
struct nfsmount *nmp;

View File

@ -464,7 +464,7 @@ typedef int vfs_mount_t(struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct thread *td);
typedef int vfs_start_t(struct mount *mp, int flags, struct thread *td);
typedef int vfs_unmount_t(struct mount *mp, int mntflags, struct thread *td);
typedef int vfs_root_t(struct mount *mp, struct vnode **vpp);
typedef int vfs_root_t(struct mount *mp, struct vnode **vpp, struct thread *td);
typedef int vfs_quotactl_t(struct mount *mp, int cmds, uid_t uid,
caddr_t arg, struct thread *td);
typedef int vfs_statfs_t(struct mount *mp, struct statfs *sbp,
@ -512,7 +512,7 @@ struct vfsops {
(*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, NDP, P)
#define VFS_START(MP, FLAGS, P) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, P)
#define VFS_UNMOUNT(MP, FORCE, P) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, P)
#define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP)
#define VFS_ROOT(MP, VPP, P) (*(MP)->mnt_op->vfs_root)(MP, VPP, P)
#define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P)
#define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P)
#define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P)

View File

@ -629,7 +629,7 @@ void vdropl(struct vnode *);
int vfinddev(struct cdev *dev, struct vnode **vpp);
void vfs_add_vnodeops(const void *);
void vfs_rm_vnodeops(const void *);
int vflush(struct mount *mp, int rootrefs, int flags);
int vflush(struct mount *mp, int rootrefs, int flags, struct thread *td);
int vget(struct vnode *vp, int lockflag, struct thread *td);
void vgone(struct vnode *vp);
void vgonel(struct vnode *vp, struct thread *td);

View File

@ -1003,7 +1003,7 @@ ffs_flushfiles(mp, flags, td)
#ifdef QUOTA
if (mp->mnt_flag & MNT_QUOTA) {
int i;
error = vflush(mp, 0, SKIPSYSTEM|flags);
error = vflush(mp, 0, SKIPSYSTEM|flags, td);
if (error)
return (error);
for (i = 0; i < MAXQUOTAS; i++) {
@ -1019,7 +1019,7 @@ ffs_flushfiles(mp, flags, td)
#endif
ASSERT_VOP_LOCKED(ump->um_devvp, "ffs_flushfiles");
if (ump->um_devvp->v_vflag & VV_COPYONWRITE) {
if ((error = vflush(mp, 0, SKIPSYSTEM | flags)) != 0)
if ((error = vflush(mp, 0, SKIPSYSTEM | flags, td)) != 0)
return (error);
ffs_snapshot_unmount(mp);
/*
@ -1030,7 +1030,7 @@ ffs_flushfiles(mp, flags, td)
/*
* Flush all the files.
*/
if ((error = vflush(mp, 0, flags)) != 0)
if ((error = vflush(mp, 0, flags, td)) != 0)
return (error);
/*
* Flush filesystem metadata.

View File

@ -472,7 +472,7 @@ ufs_extattr_autostart(struct mount *mp, struct thread *td)
* Does UFS_EXTATTR_FSROOTSUBDIR exist off the filesystem root?
* If so, automatically start EA's.
*/
error = VFS_ROOT(mp, &rvp);
error = VFS_ROOT(mp, &rvp, td);
if (error) {
printf("ufs_extattr_autostart.VFS_ROOT() returned %d\n",
error);

View File

@ -80,9 +80,10 @@ ufs_start(mp, flags, td)
* Return the root of a filesystem.
*/
int
ufs_root(mp, vpp)
ufs_root(mp, vpp, td)
struct mount *mp;
struct vnode **vpp;
struct thread *td;
{
struct vnode *nvp;
int error;