don't guard lfs_sbactive or lfs_log with splbio, lfs_lock is plenty.

This commit is contained in:
maya 2017-04-06 03:21:01 +00:00
parent f1b01545d2
commit 35cd97ea2e
3 changed files with 6 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_inode.h,v 1.18 2017/04/06 02:38:08 maya Exp $ */
/* $NetBSD: lfs_inode.h,v 1.19 2017/04/06 03:21:01 maya Exp $ */
/* from NetBSD: ulfs_inode.h,v 1.5 2013/06/06 00:51:50 dholland Exp */
/* from NetBSD: inode.h,v 1.72 2016/06/03 15:36:03 christos Exp */
@ -238,10 +238,8 @@ extern int lfs_lognum;
extern struct lfs_log_entry lfs_log[LFS_LOGLENGTH];
# define LFS_BWRITE_LOG(bp) lfs_bwrite_log((bp), __FILE__, __LINE__)
# define LFS_ENTER_LOG(theop, thefile, theline, lbn, theflags, thepid) do {\
int _s; \
\
mutex_enter(&lfs_lock); \
_s = splbio(); \
lfs_log[lfs_lognum].op = theop; \
lfs_log[lfs_lognum].file = thefile; \
lfs_log[lfs_lognum].line = (theline); \
@ -249,7 +247,6 @@ extern struct lfs_log_entry lfs_log[LFS_LOGLENGTH];
lfs_log[lfs_lognum].block = (lbn); \
lfs_log[lfs_lognum].flags = (theflags); \
lfs_lognum = (lfs_lognum + 1) % LFS_LOGLENGTH; \
splx(_s); \
mutex_exit(&lfs_lock); \
} while (0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_segment.c,v 1.268 2017/04/06 03:15:03 maya Exp $ */
/* $NetBSD: lfs_segment.c,v 1.269 2017/04/06 03:21:01 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.268 2017/04/06 03:15:03 maya Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.269 2017/04/06 03:21:01 maya Exp $");
#ifdef DEBUG
# define vndebug(vp, str) do { \
@ -2384,7 +2384,6 @@ lfs_writesuper(struct lfs *fs, daddr_t daddr)
{
struct buf *bp;
struct vnode *devvp = VTOI(fs->lfs_ivnode)->i_devvp;
int s;
ASSERT_MAYBE_SEGLOCK(fs);
if (fs->lfs_is64) {
@ -2398,13 +2397,11 @@ lfs_writesuper(struct lfs *fs, daddr_t daddr)
* So, block here if a superblock write is in progress.
*/
mutex_enter(&lfs_lock);
s = splbio();
while (fs->lfs_sbactive) {
mtsleep(&fs->lfs_sbactive, PRIBIO+1, "lfs sb", 0,
&lfs_lock);
}
fs->lfs_sbactive = daddr;
splx(s);
mutex_exit(&lfs_lock);
/* Set timestamp of this version of the superblock */

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_subr.c,v 1.91 2017/04/06 03:12:48 maya Exp $ */
/* $NetBSD: lfs_subr.c,v 1.92 2017/04/06 03:21:01 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.91 2017/04/06 03:12:48 maya Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.92 2017/04/06 03:21:01 maya Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -378,7 +378,7 @@ lfs_unmark_dirop(struct lfs *fs)
static void
lfs_auto_segclean(struct lfs *fs)
{
int i, error, s, waited;
int i, error, waited;
ASSERT_SEGLOCK(fs);
/*
@ -398,11 +398,9 @@ lfs_auto_segclean(struct lfs *fs)
/* Make sure the sb is written before we clean */
mutex_enter(&lfs_lock);
s = splbio();
while (waited == 0 && fs->lfs_sbactive)
mtsleep(&fs->lfs_sbactive, PRIBIO+1, "lfs asb",
0, &lfs_lock);
splx(s);
mutex_exit(&lfs_lock);
waited = 1;