diff options
author | attilio <attilio@FreeBSD.org> | 2009-05-11 15:33:26 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2009-05-11 15:33:26 +0000 |
commit | 1dcb84131b6679f5d53452314d4ca1dfe2d8c5f0 (patch) | |
tree | 6591f00318da636f44a6ceb26f517e7795eb1b44 /sys/nfsclient | |
parent | ebcb20267286e4ffadb3f603af56bd7a1df1f422 (diff) | |
download | FreeBSD-src-1dcb84131b6679f5d53452314d4ca1dfe2d8c5f0.zip FreeBSD-src-1dcb84131b6679f5d53452314d4ca1dfe2d8c5f0.tar.gz |
Remove the thread argument from the FSD (File-System Dependent) parts of
the VFS. Now all the VFS_* functions and relating parts don't want the
context as long as it always refers to curthread.
In some points, in particular when dealing with VOPs and functions living
in the same namespace (eg. vflush) which still need to be converted,
pass curthread explicitly in order to retain the old behaviour.
Such loose ends will be fixed ASAP.
While here fix a bug: now, UFS_EXTATTR can be compiled alone without the
UFS_EXTATTR_AUTOSTART option.
VFS KPI is heavilly changed by this commit so thirdy parts modules needs
to be recompiled. Bump __FreeBSD_version in order to signal such
situation.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs.h | 2 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 27 |
2 files changed, 18 insertions, 11 deletions
diff --git a/sys/nfsclient/nfs.h b/sys/nfsclient/nfs.h index 4dce2fe..7f3a0f3 100644 --- a/sys/nfsclient/nfs.h +++ b/sys/nfsclient/nfs.h @@ -307,7 +307,7 @@ enum nfs_rto_timer_t { vfs_init_t nfs_init; vfs_uninit_t nfs_uninit; -int nfs_mountroot(struct mount *mp, struct thread *td); +int nfs_mountroot(struct mount *mp); #ifdef NFS_LEGACYRPC #ifndef NFS4_USE_RPCCLNT diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 9118d30..d8ce36c 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -256,9 +256,10 @@ nfs_convert_diskless(void) * nfs statfs call */ static int -nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) +nfs_statfs(struct mount *mp, struct statfs *sbp) { struct vnode *vp; + struct thread *td; struct nfs_statfs *sfp; caddr_t bpos, dpos; struct nfsmount *nmp = VFSTONFS(mp); @@ -267,6 +268,7 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) struct nfsnode *np; u_quad_t tquad; + td = curthread; #ifndef nolint sfp = NULL; #endif @@ -411,8 +413,9 @@ nfsmout: * client activity occurs. */ int -nfs_mountroot(struct mount *mp, struct thread *td) +nfs_mountroot(struct mount *mp) { + struct thread *td = curthread; INIT_VPROCG(TD_TO_VPROCG(td)); struct nfsv3_diskless *nd = &nfsv3_diskless; struct socket *so; @@ -799,7 +802,7 @@ static const char *nfs_opts[] = { "from", "nfs_args", */ /* ARGSUSED */ static int -nfs_mount(struct mount *mp, struct thread *td) +nfs_mount(struct mount *mp) { struct nfs_args args = { .version = NFS_ARGSVERSION, @@ -846,7 +849,7 @@ nfs_mount(struct mount *mp, struct thread *td) } if ((mp->mnt_flag & (MNT_ROOTFS | MNT_UPDATE)) == MNT_ROOTFS) { - error = nfs_mountroot(mp, td); + error = nfs_mountroot(mp); goto out; } @@ -1131,7 +1134,8 @@ nfs_mount(struct mount *mp, struct thread *td) } } } - error = mountnfs(&args, mp, nam, args.hostname, &vp, td->td_ucred); + error = mountnfs(&args, mp, nam, args.hostname, &vp, + curthread->td_ucred); out: if (!error) { MNT_ILOCK(mp); @@ -1153,7 +1157,7 @@ out: */ /* ARGSUSED */ static int -nfs_cmount(struct mntarg *ma, void *data, int flags, struct thread *td) +nfs_cmount(struct mntarg *ma, void *data, int flags) { int error; struct nfs_args args; @@ -1298,7 +1302,7 @@ bad: * unmount system call */ static int -nfs_unmount(struct mount *mp, int mntflags, struct thread *td) +nfs_unmount(struct mount *mp, int mntflags) { struct nfsmount *nmp; int error, flags = 0; @@ -1319,7 +1323,7 @@ nfs_unmount(struct mount *mp, int mntflags, struct thread *td) goto out; } /* We hold 1 extra ref on the root vnode; see comment in mountnfs(). */ - error = vflush(mp, 1, flags, td); + error = vflush(mp, 1, flags, curthread); if (error) goto out; @@ -1339,7 +1343,7 @@ out: * Return root of a filesystem */ static int -nfs_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td) +nfs_root(struct mount *mp, int flags, struct vnode **vpp) { struct vnode *vp; struct nfsmount *nmp; @@ -1373,11 +1377,14 @@ nfs_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td) */ /* ARGSUSED */ static int -nfs_sync(struct mount *mp, int waitfor, struct thread *td) +nfs_sync(struct mount *mp, int waitfor) { struct vnode *vp, *mvp; + struct thread *td; int error, allerror = 0; + td = curthread; + /* * Force stale buffer cache information to be flushed. */ |