From f94bf21c227ad196f9e49066cf17132b90a39818 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 6 May 2006 16:33:26 +0000 Subject: [PATCH] Remove the thread argument from ext2_quotaoff(), ext2_flushfiles(), ext2_mountfs(), and ext2_reload(). --- sys/vfs/gnu/ext2fs/ext2_quota.c | 16 ++++------------ sys/vfs/gnu/ext2fs/ext2_vfsops.c | 27 +++++++++++++-------------- sys/vfs/gnu/ext2fs/quota.h | 4 ++-- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/sys/vfs/gnu/ext2fs/ext2_quota.c b/sys/vfs/gnu/ext2fs/ext2_quota.c index bb0aa26ccb..5118049be7 100644 --- a/sys/vfs/gnu/ext2fs/ext2_quota.c +++ b/sys/vfs/gnu/ext2fs/ext2_quota.c @@ -35,7 +35,7 @@ * * @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95 * $FreeBSD: src/sys/ufs/ufs/ufs_quota.c,v 1.27.2.3 2002/01/15 10:33:32 phk Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_quota.c,v 1.3 2006/05/06 02:43:13 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_quota.c,v 1.4 2006/05/06 16:33:26 dillon Exp $ */ #include @@ -363,7 +363,6 @@ ext2_chkdquot(struct inode *ip) */ struct scaninfo { - thread_t td; int rescan; int type; }; @@ -403,7 +402,7 @@ ext2_quotaon(struct thread *td, struct mount *mp, int type, caddr_t fname) VOP_UNLOCK(vp, 0); if (*vpp != vp) - ext2_quotaoff(td, mp, type); + ext2_quotaoff(mp, type); ump->um_qflags[type] |= QTF_OPENING; mp->mnt_flag |= MNT_QUOTA; vp->v_flag |= VSYSTEM; @@ -429,7 +428,6 @@ ext2_quotaon(struct thread *td, struct mount *mp, int type, caddr_t fname) * NB: only need to add dquot's for inodes being modified. */ scaninfo.rescan = 1; - scaninfo.td = td; while (scaninfo.rescan) { scaninfo.rescan = 0; error = vmntvnodescan(mp, VMSC_GETVP, @@ -439,7 +437,7 @@ ext2_quotaon(struct thread *td, struct mount *mp, int type, caddr_t fname) } ump->um_qflags[type] &= ~QTF_OPENING; if (error) - ext2_quotaoff(td, mp, type); + ext2_quotaoff(mp, type); return (error); } @@ -462,17 +460,13 @@ ext2_quotaon_scan(struct mount *mp, struct vnode *vp, void *data) static int ext2_quotaoff_scan(struct mount *mp, struct vnode *vp, void *data); int -ext2_quotaoff(struct thread *td, struct mount *mp, int type) +ext2_quotaoff(struct mount *mp, int type) { struct vnode *qvp; struct ext2mount *ump = VFSTOEXT2(mp); - struct ucred *cred; int error; struct scaninfo scaninfo; - KKASSERT(td->td_proc); - cred = td->td_proc->p_ucred; - if ((qvp = ump->um_quotas[type]) == NULLVP) return (0); ump->um_qflags[type] |= QTF_CLOSING; @@ -482,7 +476,6 @@ ext2_quotaoff(struct thread *td, struct mount *mp, int type) * deleting any references to quota file being closed. */ scaninfo.rescan = 1; - scaninfo.td = td; scaninfo.type = type; while (scaninfo.rescan) { scaninfo.rescan = 0; @@ -667,7 +660,6 @@ ext2_qsync(struct mount *mp) * synchronizing any modified ext2_dquot structures. */ scaninfo.rescan = 1; - scaninfo.td = td; while (scaninfo.rescan) { scaninfo.rescan = 0; vmntvnodescan(mp, VMSC_GETVP|VMSC_NOWAIT, diff --git a/sys/vfs/gnu/ext2fs/ext2_vfsops.c b/sys/vfs/gnu/ext2fs/ext2_vfsops.c index c0af3e2b4c..9e20bc2685 100644 --- a/sys/vfs/gnu/ext2fs/ext2_vfsops.c +++ b/sys/vfs/gnu/ext2fs/ext2_vfsops.c @@ -38,7 +38,7 @@ * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_vfsops.c,v 1.63.2.7 2002/07/01 00:18:51 iedowse Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.41 2006/05/06 02:43:13 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.42 2006/05/06 16:33:26 dillon Exp $ */ #include "opt_quota.h" @@ -76,12 +76,11 @@ extern struct vnodeopv_entry_desc ext2_specop_entries[]; extern struct vnodeopv_entry_desc ext2_fifoop_entries[]; static int ext2_fhtovp (struct mount *, struct fid *, struct vnode **); -static int ext2_flushfiles (struct mount *mp, int flags, struct thread *td); +static int ext2_flushfiles (struct mount *mp, int flags); static int ext2_mount (struct mount *, char *, caddr_t, struct thread *); -static int ext2_mountfs (struct vnode *, struct mount *, struct thread *); +static int ext2_mountfs (struct vnode *, struct mount *); static int ext2_root(struct mount *, struct vnode **); -static int ext2_reload (struct mount *mountp, struct ucred *cred, - struct thread *p); +static int ext2_reload (struct mount *mountp, struct ucred *cred); static int ext2_sbupdate (struct ext2mount *, int); static int ext2_statfs (struct mount *, struct statfs *, struct thread *); static int ext2_sync (struct mount *, int); @@ -190,7 +189,7 @@ ext2_quotactl(struct mount *mp, int cmds, uid_t uid, caddr_t arg, break; case Q_QUOTAOFF: - error = ext2_quotaoff(td, mp, type); + error = ext2_quotaoff(mp, type); break; case Q_SETQUOTA: @@ -277,7 +276,7 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, flags |= FORCECLOSE; if (vfs_busy(mp, LK_NOWAIT)) return (EBUSY); - error = ext2_flushfiles(mp, flags, td); + error = ext2_flushfiles(mp, flags); vfs_unbusy(mp); if (!error && fs->s_wasvalid) { fs->s_es->s_state |= EXT2_VALID_FS; @@ -290,7 +289,7 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, VOP_UNLOCK(devvp, 0); } if (!error && (mp->mnt_flag & MNT_RELOAD)) - error = ext2_reload(mp, proc0.p_ucred, td); + error = ext2_reload(mp, proc0.p_ucred); if (error) return (error); if (ext2_check_sb_compat(fs->s_es, devvp->v_rdev, @@ -375,7 +374,7 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, } if ((mp->mnt_flag & MNT_UPDATE) == 0) { - error = ext2_mountfs(devvp, mp, td); + error = ext2_mountfs(devvp, mp); } else { if (devvp != ump->um_devvp) error = EINVAL; /* needs translation */ @@ -600,7 +599,7 @@ struct scaninfo { }; static int -ext2_reload(struct mount *mountp, struct ucred *cred, struct thread *td) +ext2_reload(struct mount *mountp, struct ucred *cred) { struct vnode *devvp; struct buf *bp; @@ -699,7 +698,7 @@ ext2_reload_scan2(struct mount *mp, struct vnode *vp, void *data) * Common code for mount and mountroot */ static int -ext2_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) +ext2_mountfs(struct vnode *devvp, struct mount *mp) { struct ext2mount *ump; struct buf *bp; @@ -859,7 +858,7 @@ ext2_unmount(struct mount *mp, int mntflags, struct thread *td) return (EINVAL); flags |= FORCECLOSE; } - if ((error = ext2_flushfiles(mp, flags, td)) != 0) + if ((error = ext2_flushfiles(mp, flags)) != 0) return (error); ump = VFSTOEXT2(mp); fs = ump->um_e2fs; @@ -899,7 +898,7 @@ ext2_unmount(struct mount *mp, int mntflags, struct thread *td) * Flush out all the files in a filesystem. */ static int -ext2_flushfiles(struct mount *mp, int flags, struct thread *td) +ext2_flushfiles(struct mount *mp, int flags) { struct ext2mount *ump; int error; @@ -915,7 +914,7 @@ ext2_flushfiles(struct mount *mp, int flags, struct thread *td) for (i = 0; i < MAXQUOTAS; i++) { if (ump->um_quotas[i] == NULLVP) continue; - ext2_quotaoff(td, mp, i); + ext2_quotaoff(mp, i); } /* * Here we fall through to vflush again to ensure diff --git a/sys/vfs/gnu/ext2fs/quota.h b/sys/vfs/gnu/ext2fs/quota.h index 7e712765f3..540618bfdd 100644 --- a/sys/vfs/gnu/ext2fs/quota.h +++ b/sys/vfs/gnu/ext2fs/quota.h @@ -35,7 +35,7 @@ * * @(#)quota.h 8.3 (Berkeley) 8/19/94 * $FreeBSD: src/sys/ufs/ufs/quota.h,v 1.15.2.1 2003/02/27 12:04:13 das Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/quota.h,v 1.1 2006/04/04 17:34:32 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/quota.h,v 1.2 2006/05/06 16:33:26 dillon Exp $ */ #ifndef _VFS_GNU_EXT2FS_QUOTA_H_ @@ -186,7 +186,7 @@ void ext2_dqrele(struct vnode *, struct ext2_dquot *); int ext2_getinoquota(struct inode *); int ext2_getquota(struct mount *, u_long, int, caddr_t); int ext2_qsync(struct mount *mp); -int ext2_quotaoff(struct thread *, struct mount *, int); +int ext2_quotaoff(struct mount *, int); int ext2_quotaon(struct thread *, struct mount *, int, caddr_t); int ext2_setquota(struct mount *, u_long, int, caddr_t); int ext2_setuse(struct mount *, u_long, int, caddr_t); -- 2.11.4.GIT