summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts
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/cddl/contrib/opensolaris/uts
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/cddl/contrib/opensolaris/uts')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c29
2 files changed, 17 insertions, 16 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
index 654d2f9..eef1d21 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
@@ -180,7 +180,7 @@ zfsctl_create(zfsvfs_t *zfsvfs)
zcp = vp->v_data;
zcp->zc_id = ZFSCTL_INO_ROOT;
- VERIFY(VFS_ROOT(zfsvfs->z_vfs, LK_EXCLUSIVE, &rvp, curthread) == 0);
+ VERIFY(VFS_ROOT(zfsvfs->z_vfs, LK_EXCLUSIVE, &rvp) == 0);
ZFS_TIME_DECODE(&zcp->zc_cmtime, VTOZ(rvp)->z_phys->zp_crtime);
VN_URELE(rvp);
@@ -415,7 +415,7 @@ zfsctl_root_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, pathname_t *pnp,
ZFS_ENTER(zfsvfs);
if (strcmp(nm, "..") == 0) {
- err = VFS_ROOT(dvp->v_vfsp, LK_EXCLUSIVE, vpp, curthread);
+ err = VFS_ROOT(dvp->v_vfsp, LK_EXCLUSIVE, vpp);
if (err == 0)
VOP_UNLOCK(*vpp, 0);
} else {
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
index 5becdb4..835aa53 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
@@ -91,12 +91,12 @@ static int zfs_version_zpl = ZPL_VERSION;
SYSCTL_INT(_vfs_zfs_version, OID_AUTO, zpl, CTLFLAG_RD, &zfs_version_zpl, 0,
"ZPL_VERSION");
-static int zfs_mount(vfs_t *vfsp, kthread_t *td);
-static int zfs_umount(vfs_t *vfsp, int fflag, kthread_t *td);
-static int zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp, kthread_t *td);
-static int zfs_statfs(vfs_t *vfsp, struct statfs *statp, kthread_t *td);
+static int zfs_mount(vfs_t *vfsp);
+static int zfs_umount(vfs_t *vfsp, int fflag);
+static int zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp);
+static int zfs_statfs(vfs_t *vfsp, struct statfs *statp);
static int zfs_vget(vfs_t *vfsp, ino_t ino, int flags, vnode_t **vpp);
-static int zfs_sync(vfs_t *vfsp, int waitfor, kthread_t *td);
+static int zfs_sync(vfs_t *vfsp, int waitfor);
static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp);
static void zfs_objset_close(zfsvfs_t *zfsvfs);
static void zfs_freevfs(vfs_t *vfsp);
@@ -122,7 +122,7 @@ static uint32_t zfs_active_fs_count = 0;
/*ARGSUSED*/
static int
-zfs_sync(vfs_t *vfsp, int waitfor, kthread_t *td)
+zfs_sync(vfs_t *vfsp, int waitfor)
{
/*
@@ -139,7 +139,7 @@ zfs_sync(vfs_t *vfsp, int waitfor, kthread_t *td)
zfsvfs_t *zfsvfs = vfsp->vfs_data;
int error;
- error = vfs_stdsync(vfsp, waitfor, td);
+ error = vfs_stdsync(vfsp, waitfor);
if (error != 0)
return (error);
@@ -688,8 +688,9 @@ zfs_unregister_callbacks(zfsvfs_t *zfsvfs)
/*ARGSUSED*/
static int
-zfs_mount(vfs_t *vfsp, kthread_t *td)
+zfs_mount(vfs_t *vfsp)
{
+ kthread_t *td = curthread;
vnode_t *mvp = vfsp->mnt_vnodecovered;
cred_t *cr = td->td_ucred;
char *osname;
@@ -782,7 +783,7 @@ out:
}
static int
-zfs_statfs(vfs_t *vfsp, struct statfs *statp, kthread_t *td)
+zfs_statfs(vfs_t *vfsp, struct statfs *statp)
{
zfsvfs_t *zfsvfs = vfsp->vfs_data;
uint64_t refdbytes, availbytes, usedobjs, availobjs;
@@ -840,7 +841,7 @@ zfs_statfs(vfs_t *vfsp, struct statfs *statp, kthread_t *td)
}
static int
-zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp, kthread_t *td)
+zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp)
{
zfsvfs_t *zfsvfs = vfsp->vfs_data;
znode_t *rootzp;
@@ -957,11 +958,11 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting)
/*ARGSUSED*/
static int
-zfs_umount(vfs_t *vfsp, int fflag, kthread_t *td)
+zfs_umount(vfs_t *vfsp, int fflag)
{
zfsvfs_t *zfsvfs = vfsp->vfs_data;
objset_t *os;
- cred_t *cr = td->td_ucred;
+ cred_t *cr = curthread->td_ucred;
int ret;
if (fflag & MS_FORCE) {
@@ -992,7 +993,7 @@ zfs_umount(vfs_t *vfsp, int fflag, kthread_t *td)
if (zfsvfs->z_ctldir != NULL) {
if ((ret = zfsctl_umount_snapshots(vfsp, fflag, cr)) != 0)
return (ret);
- ret = vflush(vfsp, 0, 0, td);
+ ret = vflush(vfsp, 0, 0, curthread);
ASSERT(ret == EBUSY);
if (!(fflag & MS_FORCE)) {
if (zfsvfs->z_ctldir->v_count > 1)
@@ -1006,7 +1007,7 @@ zfs_umount(vfs_t *vfsp, int fflag, kthread_t *td)
/*
* Flush all the files.
*/
- ret = vflush(vfsp, 1, (fflag & MS_FORCE) ? FORCECLOSE : 0, td);
+ ret = vflush(vfsp, 1, (fflag & MS_FORCE) ? FORCECLOSE : 0, curthread);
if (ret != 0) {
if (!zfsvfs->z_issnap) {
zfsctl_create(zfsvfs);
OpenPOWER on IntegriCloud