Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs switch lfs_dirops to condvar (from mtsleep)
details: https://anonhg.NetBSD.org/src/rev/97f48cab6d69
branches: trunk
changeset: 352443:97f48cab6d69
user: maya <maya%NetBSD.org@localhost>
date: Sat Apr 01 14:43:00 2017 +0000
description:
switch lfs_dirops to condvar (from mtsleep)
diffstat:
sys/ufs/lfs/lfs.h | 3 ++-
sys/ufs/lfs/lfs_subr.c | 6 +++---
sys/ufs/lfs/lfs_vfsops.c | 6 ++++--
sys/ufs/lfs/lfs_vnops.c | 7 +++----
4 files changed, 12 insertions(+), 10 deletions(-)
diffs (106 lines):
diff -r c03bd9e44b5b -r 97f48cab6d69 sys/ufs/lfs/lfs.h
--- a/sys/ufs/lfs/lfs.h Sat Apr 01 14:31:05 2017 +0000
+++ b/sys/ufs/lfs/lfs.h Sat Apr 01 14:43:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.h,v 1.200 2017/04/01 01:50:02 maya Exp $ */
+/* $NetBSD: lfs.h,v 1.201 2017/04/01 14:43:00 maya Exp $ */
/* from NetBSD: dinode.h,v 1.25 2016/01/22 23:06:10 dholland Exp */
/* from NetBSD: dir.h,v 1.25 2015/09/01 06:16:03 dholland Exp */
@@ -976,6 +976,7 @@
uint32_t lfs_iocount; /* number of ios pending */
uint32_t lfs_writer; /* don't allow any dirops to start */
uint32_t lfs_dirops; /* count of active directory ops */
+ kcondvar_t lfs_diropscv; /* condvar of active directory ops */
uint32_t lfs_dirvcount; /* count of VDIROP nodes in this fs */
uint32_t lfs_doifile; /* Write ifile blocks on next write */
uint32_t lfs_nactive; /* Number of segments since last ckp */
diff -r c03bd9e44b5b -r 97f48cab6d69 sys/ufs/lfs/lfs_subr.c
--- a/sys/ufs/lfs/lfs_subr.c Sat Apr 01 14:31:05 2017 +0000
+++ b/sys/ufs/lfs/lfs_subr.c Sat Apr 01 14:43:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_subr.c,v 1.86 2015/10/03 08:28:16 dholland Exp $ */
+/* $NetBSD: lfs_subr.c,v 1.87 2017/04/01 14:43:00 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.86 2015/10/03 08:28:16 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.87 2017/04/01 14:43:00 maya Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -597,7 +597,7 @@
dowakeup = !(--fs->lfs_writer);
mutex_exit(&lfs_lock);
if (dowakeup)
- wakeup(&fs->lfs_dirops);
+ cv_broadcast(&fs->lfs_diropscv);
}
/*
diff -r c03bd9e44b5b -r 97f48cab6d69 sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c Sat Apr 01 14:31:05 2017 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c Sat Apr 01 14:43:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_vfsops.c,v 1.354 2017/04/01 01:50:02 maya Exp $ */
+/* $NetBSD: lfs_vfsops.c,v 1.355 2017/04/01 14:43:00 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.354 2017/04/01 01:50:02 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.355 2017/04/01 14:43:00 maya Exp $");
#if defined(_KERNEL_OPT)
#include "opt_lfs.h"
@@ -1098,6 +1098,7 @@
rw_init(&fs->lfs_fraglock);
rw_init(&fs->lfs_iflock);
cv_init(&fs->lfs_sleeperscv, "lfs_slp");
+ cv_init(&fs->lfs_diropscv, "lfs_dirop");
cv_init(&fs->lfs_stopcv, "lfsstop");
/* Set the file system readonly/modify bits. */
@@ -1415,6 +1416,7 @@
free(fs->lfs_suflags, M_SEGMENT);
lfs_free_resblks(fs);
cv_destroy(&fs->lfs_sleeperscv);
+ cv_destroy(&fs->lfs_diropscv);
cv_destroy(&fs->lfs_stopcv);
rw_destroy(&fs->lfs_fraglock);
rw_destroy(&fs->lfs_iflock);
diff -r c03bd9e44b5b -r 97f48cab6d69 sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c Sat Apr 01 14:31:05 2017 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c Sat Apr 01 14:43:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_vnops.c,v 1.308 2017/04/01 01:50:02 maya Exp $ */
+/* $NetBSD: lfs_vnops.c,v 1.309 2017/04/01 14:43:00 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.308 2017/04/01 01:50:02 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.309 2017/04/01 14:43:00 maya Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -573,8 +573,7 @@
mutex_enter(&lfs_lock);
}
while (fs->lfs_writer) {
- error = mtsleep(&fs->lfs_dirops, (PRIBIO + 1) | PCATCH,
- "lfs_sdirop", 0, &lfs_lock);
+ error = cv_wait_sig(&fs->lfs_diropscv, &lfs_lock);
if (error == EINTR) {
mutex_exit(&lfs_lock);
goto unreserve;
Home |
Main Index |
Thread Index |
Old Index