summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfsclient/nfs_clvfsops.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2009-05-11 15:33:26 +0000
committerattilio <attilio@FreeBSD.org>2009-05-11 15:33:26 +0000
commit1dcb84131b6679f5d53452314d4ca1dfe2d8c5f0 (patch)
tree6591f00318da636f44a6ceb26f517e7795eb1b44 /sys/fs/nfsclient/nfs_clvfsops.c
parentebcb20267286e4ffadb3f603af56bd7a1df1f422 (diff)
downloadFreeBSD-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/fs/nfsclient/nfs_clvfsops.c')
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index 1ceba85..66ea55b 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -244,9 +244,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 nfsmount *nmp = VFSTONFS(mp);
struct nfsvattr nfsva;
struct nfsfsinfo fs;
@@ -254,6 +255,8 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td)
int error = 0, attrflag, gotfsinfo = 0, ret;
struct nfsnode *np;
+ td = curthread;
+
error = vfs_busy(mp, MBF_NOWAIT);
if (error)
return (error);
@@ -659,7 +662,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,
@@ -689,6 +692,7 @@ nfs_mount(struct mount *mp, struct thread *td)
int error;
struct sockaddr *nam;
struct vnode *vp;
+ struct thread *td;
char hst[MNAMELEN];
size_t len;
u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100];
@@ -698,6 +702,7 @@ nfs_mount(struct mount *mp, struct thread *td)
goto out;
}
+ td = curthread;
if ((mp->mnt_flag & (MNT_ROOTFS | MNT_UPDATE)) == MNT_ROOTFS) {
error = ncl_mountroot(mp, td);
goto out;
@@ -835,7 +840,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;
@@ -1069,11 +1074,14 @@ bad:
* unmount system call
*/
static int
-nfs_unmount(struct mount *mp, int mntflags, struct thread *td)
+nfs_unmount(struct mount *mp, int mntflags)
{
+ struct thread *td;
struct nfsmount *nmp;
int error, flags = 0, trycnt = 0;
+ td = curthread;
+
if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
nmp = VFSTONFS(mp);
@@ -1120,7 +1128,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;
@@ -1153,11 +1161,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.
*/
OpenPOWER on IntegriCloud