Mark UFS as being MP-Safe in "options QUOTA" case too. Remove no more

neccessary Giant acquisions in softdepend processing code.

Tested by:	Peter Holm
Reviewed by:	tegge
Approved by:	re (kensmith)
This commit is contained in:
Konstantin Belousov 2007-03-20 10:51:45 +00:00
parent 62c1ff9c48
commit 36d4667907
2 changed files with 0 additions and 19 deletions

View File

@ -722,16 +722,12 @@ softdep_flush(void)
struct ufsmount *ump;
struct thread *td;
int remaining;
int vfslocked;
td = curthread;
td->td_pflags |= TDP_NORUNNINGBUF;
for (;;) {
kthread_suspend_check(softdepproc);
#ifdef QUOTA
mtx_lock(&Giant);
#endif
ACQUIRE_LOCK(&lk);
/*
* If requested, try removing inode or removal dependencies.
@ -747,9 +743,6 @@ softdep_flush(void)
wakeup_one(&proc_waiting);
}
FREE_LOCK(&lk);
#ifdef QUOTA
mtx_unlock(&Giant);
#endif
remaining = 0;
mtx_lock(&mountlist_mtx);
for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) {
@ -758,12 +751,10 @@ softdep_flush(void)
continue;
if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx, td))
continue;
vfslocked = VFS_LOCK_GIANT(mp);
softdep_process_worklist(mp, 0);
ump = VFSTOUFS(mp);
remaining += ump->softdep_on_worklist -
ump->softdep_on_worklist_inprogress;
VFS_UNLOCK_GIANT(vfslocked);
mtx_lock(&mountlist_mtx);
nmp = TAILQ_NEXT(mp, mnt_list);
vfs_unbusy(mp, td);

View File

@ -880,19 +880,9 @@ ffs_mountfs(devvp, mp, td)
(void) ufs_extattr_autostart(mp, td);
#endif /* !UFS_EXTATTR_AUTOSTART */
#endif /* !UFS_EXTATTR */
#ifdef QUOTA
/*
* Our bufobj must require giant for snapshots when quotas are
* enabled.
*/
BO_LOCK(&devvp->v_bufobj);
devvp->v_bufobj.bo_flag |= BO_NEEDSGIANT;
BO_UNLOCK(&devvp->v_bufobj);
#else
MNT_ILOCK(mp);
mp->mnt_kern_flag |= MNTK_MPSAFE;
MNT_IUNLOCK(mp);
#endif
return (0);
out:
if (bp)