Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Change last users of FSTRANS_LAZY to FSTRANS_SHARED and ...
details: https://anonhg.NetBSD.org/src/rev/2b154154216e
branches: trunk
changeset: 352396:2b154154216e
user: hannken <hannken%NetBSD.org@localhost>
date: Thu Mar 30 09:12:21 2017 +0000
description:
Change last users of FSTRANS_LAZY to FSTRANS_SHARED and change
genfs_suspendctl() to move from FSTRANS_NORMAL to FSTRANS_SUSPENDED
and vice versa.
diffstat:
sys/kern/vfs_vnode.c | 8 ++++----
sys/miscfs/genfs/genfs_io.c | 8 ++++----
sys/miscfs/genfs/genfs_vfsops.c | 20 ++++++--------------
3 files changed, 14 insertions(+), 22 deletions(-)
diffs (121 lines):
diff -r 3285a8153579 -r 2b154154216e sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c Thu Mar 30 09:10:46 2017 +0000
+++ b/sys/kern/vfs_vnode.c Thu Mar 30 09:12:21 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnode.c,v 1.76 2017/03/06 10:07:52 hannken Exp $ */
+/* $NetBSD: vfs_vnode.c,v 1.77 2017/03/30 09:12:21 hannken Exp $ */
/*-
* Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -156,7 +156,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.76 2017/03/06 10:07:52 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.77 2017/03/30 09:12:21 hannken Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -543,7 +543,7 @@
KASSERT(mutex_owned(&vdrain_lock));
mp = vp->v_mount;
- if (fstrans_start_nowait(mp, FSTRANS_LAZY) != 0)
+ if (fstrans_start_nowait(mp, FSTRANS_SHARED) != 0)
return;
/*
@@ -1518,7 +1518,7 @@
vip->vi_key.vk_key = temp_key;
mutex_exit(&vcache_lock);
- fstrans_start(mp, FSTRANS_LAZY);
+ fstrans_start(mp, FSTRANS_SHARED);
/*
* Clean out any cached data associated with the vnode.
diff -r 3285a8153579 -r 2b154154216e sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c Thu Mar 30 09:10:46 2017 +0000
+++ b/sys/miscfs/genfs/genfs_io.c Thu Mar 30 09:12:21 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfs_io.c,v 1.65 2017/03/09 10:10:02 hannken Exp $ */
+/* $NetBSD: genfs_io.c,v 1.66 2017/03/30 09:12:21 hannken Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.65 2017/03/09 10:10:02 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.66 2017/03/30 09:12:21 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -890,7 +890,7 @@
if (pagedaemon) {
/* Pagedaemon must not sleep here. */
trans_mp = vp->v_mount;
- error = fstrans_start_nowait(trans_mp, FSTRANS_LAZY);
+ error = fstrans_start_nowait(trans_mp, FSTRANS_SHARED);
if (error) {
mutex_exit(slock);
return error;
@@ -903,7 +903,7 @@
*/
mutex_exit(slock);
trans_mp = vp->v_mount;
- fstrans_start(trans_mp, FSTRANS_LAZY);
+ fstrans_start(trans_mp, FSTRANS_SHARED);
if (vp->v_mount != trans_mp) {
fstrans_done(trans_mp);
trans_mp = NULL;
diff -r 3285a8153579 -r 2b154154216e sys/miscfs/genfs/genfs_vfsops.c
--- a/sys/miscfs/genfs/genfs_vfsops.c Thu Mar 30 09:10:46 2017 +0000
+++ b/sys/miscfs/genfs/genfs_vfsops.c Thu Mar 30 09:12:21 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfs_vfsops.c,v 1.4 2017/02/17 08:31:25 hannken Exp $ */
+/* $NetBSD: genfs_vfsops.c,v 1.5 2017/03/30 09:12:21 hannken Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_vfsops.c,v 1.4 2017/02/17 08:31:25 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_vfsops.c,v 1.5 2017/03/30 09:12:21 hannken Exp $");
#include <sys/types.h>
#include <sys/mount.h>
@@ -75,26 +75,18 @@
int
genfs_suspendctl(struct mount *mp, int cmd)
{
- int error;
- int error2 __diagused;
+ int error __diagused;
if ((mp->mnt_iflag & IMNT_HAS_TRANS) == 0)
return EOPNOTSUPP;
switch (cmd) {
case SUSPEND_SUSPEND:
- if ((error = fstrans_setstate(mp, FSTRANS_SUSPENDING)) != 0)
- return error;
- if ((error = fstrans_setstate(mp, FSTRANS_SUSPENDED)) != 0) {
- error2 = fstrans_setstate(mp, FSTRANS_NORMAL);
- KASSERT(error2 == 0);
- return error;
- }
- return 0;
+ return fstrans_setstate(mp, FSTRANS_SUSPENDED);
case SUSPEND_RESUME:
- error2 = fstrans_setstate(mp, FSTRANS_NORMAL);
- KASSERT(error2 == 0);
+ error = fstrans_setstate(mp, FSTRANS_NORMAL);
+ KASSERT(error == 0);
return 0;
default:
Home |
Main Index |
Thread Index |
Old Index