Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs don't guard lfs_sbactive or lfs_log with splbio, ...
details: https://anonhg.NetBSD.org/src/rev/75aad4149c1a
branches: trunk
changeset: 352519:75aad4149c1a
user: maya <maya%NetBSD.org@localhost>
date: Thu Apr 06 03:21:01 2017 +0000
description:
don't guard lfs_sbactive or lfs_log with splbio, lfs_lock is plenty.
diffstat:
sys/ufs/lfs/lfs_inode.h | 5 +----
sys/ufs/lfs/lfs_segment.c | 7 ++-----
sys/ufs/lfs/lfs_subr.c | 8 +++-----
3 files changed, 6 insertions(+), 14 deletions(-)
diffs (107 lines):
diff -r eb857d95ba37 -r 75aad4149c1a sys/ufs/lfs/lfs_inode.h
--- a/sys/ufs/lfs/lfs_inode.h Thu Apr 06 03:15:03 2017 +0000
+++ b/sys/ufs/lfs/lfs_inode.h Thu Apr 06 03:21:01 2017 +0000
@@ -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 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 @@
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)
diff -r eb857d95ba37 -r 75aad4149c1a sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Thu Apr 06 03:15:03 2017 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Thu Apr 06 03:21:01 2017 +0000
@@ -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 @@
{
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 @@
* 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 */
diff -r eb857d95ba37 -r 75aad4149c1a sys/ufs/lfs/lfs_subr.c
--- a/sys/ufs/lfs/lfs_subr.c Thu Apr 06 03:15:03 2017 +0000
+++ b/sys/ufs/lfs/lfs_subr.c Thu Apr 06 03:21:01 2017 +0000
@@ -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 @@
static void
lfs_auto_segclean(struct lfs *fs)
{
- int i, error, s, waited;
+ int i, error, waited;
ASSERT_SEGLOCK(fs);
/*
@@ -398,11 +398,9 @@
/* 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;
Home |
Main Index |
Thread Index |
Old Index