summaryrefslogtreecommitdiffstats
path: root/sys/ufs
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/ufs
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/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c29
-rw-r--r--sys/ufs/ufs/extattr.h2
-rw-r--r--sys/ufs/ufs/ufs_extattr.c7
-rw-r--r--sys/ufs/ufs/ufs_vfsops.c8
4 files changed, 26 insertions, 20 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 94752c7..c5c1328 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -132,9 +132,10 @@ static const char *ffs_opts[] = { "acls", "async", "noatime", "noclusterr",
"union", NULL };
static int
-ffs_mount(struct mount *mp, struct thread *td)
+ffs_mount(struct mount *mp)
{
struct vnode *devvp;
+ struct thread *td;
struct ufsmount *ump = 0;
struct fs *fs;
int error, flags;
@@ -143,6 +144,7 @@ ffs_mount(struct mount *mp, struct thread *td)
struct nameidata ndp;
char *fspec;
+ td = curthread;
if (vfs_filteropt(mp->mnt_optnew, ffs_opts))
return (EINVAL);
if (uma_inode == NULL) {
@@ -213,7 +215,7 @@ ffs_mount(struct mount *mp, struct thread *td)
* ignore the suspension to
* synchronize on-disk state.
*/
- curthread->td_pflags |= TDP_IGNSUSP;
+ td->td_pflags |= TDP_IGNSUSP;
break;
}
MNT_IUNLOCK(mp);
@@ -431,7 +433,7 @@ ffs_mount(struct mount *mp, struct thread *td)
*/
static int
-ffs_cmount(struct mntarg *ma, void *data, int flags, struct thread *td)
+ffs_cmount(struct mntarg *ma, void *data, int flags)
{
struct ufs_args args;
int error;
@@ -1025,11 +1027,11 @@ ffs_oldfscompat_write(fs, ump)
* unmount system call
*/
static int
-ffs_unmount(mp, mntflags, td)
+ffs_unmount(mp, mntflags)
struct mount *mp;
int mntflags;
- struct thread *td;
{
+ struct thread *td;
struct ufsmount *ump = VFSTOUFS(mp);
struct fs *fs;
int error, flags, susp;
@@ -1038,6 +1040,7 @@ ffs_unmount(mp, mntflags, td)
#endif
flags = 0;
+ td = curthread;
fs = ump->um_fs;
if (mntflags & MNT_FORCE) {
flags |= FORCECLOSE;
@@ -1069,7 +1072,7 @@ ffs_unmount(mp, mntflags, td)
MNTK_SUSPEND2);
wakeup(&mp->mnt_flag);
MNT_IUNLOCK(mp);
- curthread->td_pflags |= TDP_IGNSUSP;
+ td->td_pflags |= TDP_IGNSUSP;
break;
}
MNT_IUNLOCK(mp);
@@ -1199,10 +1202,9 @@ ffs_flushfiles(mp, flags, td)
* Get filesystem statistics.
*/
static int
-ffs_statfs(mp, sbp, td)
+ffs_statfs(mp, sbp)
struct mount *mp;
struct statfs *sbp;
- struct thread *td;
{
struct ufsmount *ump;
struct fs *fs;
@@ -1235,12 +1237,12 @@ ffs_statfs(mp, sbp, td)
* Note: we are always called with the filesystem marked `MPBUSY'.
*/
static int
-ffs_sync(mp, waitfor, td)
+ffs_sync(mp, waitfor)
struct mount *mp;
int waitfor;
- struct thread *td;
{
struct vnode *mvp, *vp, *devvp;
+ struct thread *td;
struct inode *ip;
struct ufsmount *ump = VFSTOUFS(mp);
struct fs *fs;
@@ -1253,6 +1255,7 @@ ffs_sync(mp, waitfor, td)
int softdep_accdeps;
struct bufobj *bo;
+ td = curthread;
fs = ump->um_fs;
if (fs->fs_fmod != 0 && fs->fs_ronly != 0) { /* XXX */
printf("fs = %s\n", fs->fs_fsmnt);
@@ -1698,15 +1701,15 @@ ffs_sbupdate(mp, waitfor, suspended)
static int
ffs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp,
- int attrnamespace, const char *attrname, struct thread *td)
+ int attrnamespace, const char *attrname)
{
#ifdef UFS_EXTATTR
return (ufs_extattrctl(mp, cmd, filename_vp, attrnamespace,
- attrname, td));
+ attrname));
#else
return (vfs_stdextattrctl(mp, cmd, filename_vp, attrnamespace,
- attrname, td));
+ attrname));
#endif
}
diff --git a/sys/ufs/ufs/extattr.h b/sys/ufs/ufs/extattr.h
index 5d26bf6..3716ec2 100644
--- a/sys/ufs/ufs/extattr.h
+++ b/sys/ufs/ufs/extattr.h
@@ -143,7 +143,7 @@ int ufs_extattr_start(struct mount *mp, struct thread *td);
int ufs_extattr_autostart(struct mount *mp, struct thread *td);
int ufs_extattr_stop(struct mount *mp, struct thread *td);
int ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename,
- int attrnamespace, const char *attrname, struct thread *td);
+ int attrnamespace, const char *attrname);
int ufs_getextattr(struct vop_getextattr_args *ap);
int ufs_deleteextattr(struct vop_deleteextattr_args *ap);
int ufs_setextattr(struct vop_setextattr_args *ap);
diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c
index d034bee..032d9cc 100644
--- a/sys/ufs/ufs/ufs_extattr.c
+++ b/sys/ufs/ufs/ufs_extattr.c
@@ -93,8 +93,10 @@ static int ufs_extattr_set(struct vnode *vp, int attrnamespace,
struct thread *td);
static int ufs_extattr_rm(struct vnode *vp, int attrnamespace,
const char *name, struct ucred *cred, struct thread *td);
+#ifdef UFS_EXTATTR_AUTOSTART
static int ufs_extattr_autostart_locked(struct mount *mp,
struct thread *td);
+#endif
static int ufs_extattr_start_locked(struct ufsmount *ump,
struct thread *td);
@@ -478,7 +480,7 @@ ufs_extattr_autostart_locked(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, LK_EXCLUSIVE, &rvp, td);
+ error = VFS_ROOT(mp, LK_EXCLUSIVE, &rvp);
if (error) {
printf("ufs_extattr_autostart.VFS_ROOT() returned %d\n",
error);
@@ -714,9 +716,10 @@ ufs_extattr_disable(struct ufsmount *ump, int attrnamespace,
*/
int
ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp,
- int attrnamespace, const char *attrname, struct thread *td)
+ int attrnamespace, const char *attrname)
{
struct ufsmount *ump = VFSTOUFS(mp);
+ struct thread *td = curthread;
int error;
/*
diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c
index ac1fbcf..f6b6b1e 100644
--- a/sys/ufs/ufs/ufs_vfsops.c
+++ b/sys/ufs/ufs/ufs_vfsops.c
@@ -66,11 +66,10 @@ MALLOC_DEFINE(M_UFSMNT, "ufs_mount", "UFS mount structure");
* Return the root of a filesystem.
*/
int
-ufs_root(mp, flags, vpp, td)
+ufs_root(mp, flags, vpp)
struct mount *mp;
int flags;
struct vnode **vpp;
- struct thread *td;
{
struct vnode *nvp;
int error;
@@ -86,18 +85,19 @@ ufs_root(mp, flags, vpp, td)
* Do operations associated with quotas
*/
int
-ufs_quotactl(mp, cmds, id, arg, td)
+ufs_quotactl(mp, cmds, id, arg)
struct mount *mp;
int cmds;
uid_t id;
void *arg;
- struct thread *td;
{
#ifndef QUOTA
return (EOPNOTSUPP);
#else
+ struct thread *td;
int cmd, type, error;
+ td = curthread;
cmd = cmds >> SUBCMDSHIFT;
type = cmds & SUBCMDMASK;
if (id == -1) {
OpenPOWER on IntegriCloud