summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2004-07-12 08:14:09 +0000
committeralfred <alfred@FreeBSD.org>2004-07-12 08:14:09 +0000
commit8a1713aada9c142d3c2096e4857ff30970d9b1d0 (patch)
tree8fe425c682e229149daf17e6533c0f750ba308d3 /sys/kern
parentb436785ed498fa322c5ccd228770c6053e4b487b (diff)
downloadFreeBSD-src-8a1713aada9c142d3c2096e4857ff30970d9b1d0.zip
FreeBSD-src-8a1713aada9c142d3c2096e4857ff30970d9b1d0.tar.gz
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.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/init_main.c2
-rw-r--r--sys/kern/vfs_default.c3
-rw-r--r--sys/kern/vfs_export.c2
-rw-r--r--sys/kern/vfs_extattr.c2
-rw-r--r--sys/kern/vfs_lookup.c2
-rw-r--r--sys/kern/vfs_mount.c8
-rw-r--r--sys/kern/vfs_subr.c8
-rw-r--r--sys/kern/vfs_syscalls.c2
8 files changed, 15 insertions, 14 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 757f8ae..575f227 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -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;
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index c497b60..5812a03 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -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);
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index a90d6f8..dd21782 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -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)))
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 2fffe63..c22b194 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -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;
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index b931102..10b49aa 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -555,7 +555,7 @@ unionlookup:
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;
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 5252b3b..d697499 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -913,7 +913,7 @@ update:
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,
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index c0dff88..53403db 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -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);
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 2fffe63..c22b194 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -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;
OpenPOWER on IntegriCloud