Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys Pull up following revision(s) (requested by chs in ti...
details: https://anonhg.NetBSD.org/src/rev/ba48d9ff7c34
branches: netbsd-6
changeset: 774044:ba48d9ff7c34
user: riz <riz%NetBSD.org@localhost>
date: Mon May 07 03:01:12 2012 +0000
description:
Pull up following revision(s) (requested by chs in ticket #204):
sys/fs/sysvbfs/sysvbfs_vnops.c: revision 1.44
sys/ufs/ffs/ffs_vfsops.c: revision 1.277
sys/fs/v7fs/v7fs_vnops.c: revision 1.11
sys/ufs/chfs/chfs_vnops.c: revision 1.7
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.61
sys/miscfs/genfs/genfs_io.c: revision 1.54
sys/kern/vfs_wapbl.c: revision 1.52
sys/uvm/uvm_pager.h: revision 1.43
sys/ufs/ffs/ffs_vnops.c: revision 1.121
sys/kern/vfs_subr.c: revision 1.434
sys/fs/msdosfs/msdosfs_vnops.c: revision 1.83
sys/fs/ntfs/ntfs_vnops.c: revision 1.51
sys/fs/udf/udf_subr.c: revision 1.119
sys/miscfs/specfs/spec_vnops.c: revision 1.135
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.103
sys/fs/udf/udf_vnops.c: revision 1.71
sys/ufs/ufs/ufs_readwrite.c: revision 1.104
change vflushbuf() to take the full FSYNC_* flags.
translate FSYNC_LAZY into PGO_LAZY for VOP_PUTPAGES() so that
genfs_do_io() can set the appropriate io priority for the I/O.
this is the first part of addressing PR 46325.
mark all wapbl I/O as BPRIO_TIMECRITICAL.
this is the second part of addressing PR 46325.
diffstat:
sys/fs/msdosfs/msdosfs_vnops.c | 9 ++++---
sys/fs/ntfs/ntfs_vnops.c | 8 ++----
sys/fs/sysvbfs/sysvbfs_vnops.c | 6 ++--
sys/fs/udf/udf_subr.c | 12 ++++-----
sys/fs/udf/udf_vnops.c | 10 ++++----
sys/fs/v7fs/v7fs_vnops.c | 7 ++---
sys/kern/vfs_subr.c | 23 ++++++++++++------
sys/kern/vfs_wapbl.c | 5 ++-
sys/miscfs/genfs/genfs_io.c | 7 +++--
sys/miscfs/specfs/spec_vnops.c | 6 ++--
sys/ufs/chfs/chfs_vnops.c | 6 +---
sys/ufs/ext2fs/ext2fs_readwrite.c | 7 +++--
sys/ufs/ext2fs/ext2fs_vnops.c | 6 ++--
sys/ufs/ffs/ffs_vfsops.c | 6 ++--
sys/ufs/ffs/ffs_vnops.c | 46 ++++++++++++++++++++------------------
sys/ufs/ufs/ufs_readwrite.c | 6 ++--
sys/uvm/uvm_pager.h | 3 +-
17 files changed, 90 insertions(+), 83 deletions(-)
diffs (truncated from 614 to 300 lines):
diff -r 71c457cc4639 -r ba48d9ff7c34 sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c Mon May 07 02:57:22 2012 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c Mon May 07 03:01:12 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vnops.c,v 1.79.4.1 2012/04/06 17:40:20 riz Exp $ */
+/* $NetBSD: msdosfs_vnops.c,v 1.79.4.2 2012/05/07 03:01:13 riz Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.79.4.1 2012/04/06 17:40:20 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.79.4.2 2012/05/07 03:01:13 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -653,7 +653,8 @@
if (!async && oldoff >> 16 != uio->uio_offset >> 16) {
mutex_enter(vp->v_interlock);
error = VOP_PUTPAGES(vp, (oldoff >> 16) << 16,
- (uio->uio_offset >> 16) << 16, PGO_CLEANIT);
+ (uio->uio_offset >> 16) << 16,
+ PGO_CLEANIT | PGO_LAZY);
}
} while (error == 0 && uio->uio_resid > 0);
@@ -1805,7 +1806,7 @@
fstrans_start(vp->v_mount, FSTRANS_LAZY);
wait = (ap->a_flags & FSYNC_WAIT) != 0;
- error = vflushbuf(vp, wait);
+ error = vflushbuf(vp, ap->a_flags);
if (error == 0 && (ap->a_flags & FSYNC_DATAONLY) == 0)
error = msdosfs_update(vp, NULL, NULL, wait ? UPDATE_WAIT : 0);
diff -r 71c457cc4639 -r ba48d9ff7c34 sys/fs/ntfs/ntfs_vnops.c
--- a/sys/fs/ntfs/ntfs_vnops.c Mon May 07 02:57:22 2012 +0000
+++ b/sys/fs/ntfs/ntfs_vnops.c Mon May 07 03:01:12 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs_vnops.c,v 1.49 2011/05/19 03:11:57 rmind Exp $ */
+/* $NetBSD: ntfs_vnops.c,v 1.49.10.1 2012/05/07 03:01:13 riz Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.49 2011/05/19 03:11:57 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.49.10.1 2012/05/07 03:01:13 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -747,14 +747,12 @@
off_t offhi;
} */ *ap = v;
struct vnode *vp = ap->a_vp;
- int wait;
if (ap->a_flags & FSYNC_CACHE) {
return EOPNOTSUPP;
}
- wait = (ap->a_flags & FSYNC_WAIT) != 0;
- return vflushbuf(vp, wait);
+ return vflushbuf(vp, ap->a_flags);
}
/*
diff -r 71c457cc4639 -r ba48d9ff7c34 sys/fs/sysvbfs/sysvbfs_vnops.c
--- a/sys/fs/sysvbfs/sysvbfs_vnops.c Mon May 07 02:57:22 2012 +0000
+++ b/sys/fs/sysvbfs/sysvbfs_vnops.c Mon May 07 03:01:12 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysvbfs_vnops.c,v 1.40 2012/01/27 21:46:42 njoly Exp $ */
+/* $NetBSD: sysvbfs_vnops.c,v 1.40.2.1 2012/05/07 03:01:12 riz Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.40 2012/01/27 21:46:42 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.40.2.1 2012/05/07 03:01:12 riz Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -835,7 +835,7 @@
}
wait = (ap->a_flags & FSYNC_WAIT) != 0;
- error = vflushbuf(vp, wait);
+ error = vflushbuf(vp, ap->a_flags);
if (error == 0 && (ap->a_flags & FSYNC_DATAONLY) == 0)
error = sysvbfs_update(vp, NULL, NULL, wait ? UPDATE_WAIT : 0);
diff -r 71c457cc4639 -r ba48d9ff7c34 sys/fs/udf/udf_subr.c
--- a/sys/fs/udf/udf_subr.c Mon May 07 02:57:22 2012 +0000
+++ b/sys/fs/udf/udf_subr.c Mon May 07 03:01:12 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_subr.c,v 1.118 2011/11/13 23:08:47 christos Exp $ */
+/* $NetBSD: udf_subr.c,v 1.118.6.1 2012/05/07 03:01:14 riz Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.118 2011/11/13 23:08:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.118.6.1 2012/05/07 03:01:14 riz Exp $");
#endif /* not lint */
@@ -1830,7 +1830,7 @@
NULL, NULL);
bitmap_node->i_flags |= IN_MODIFIED;
- error = vflushbuf(bitmap_node->vnode, 1 /* sync */);
+ error = vflushbuf(bitmap_node->vnode, FSYNC_WAIT);
if (error == 0)
error = VOP_FSYNC(bitmap_node->vnode,
FSCRED, FSYNC_WAIT, 0, 0);
@@ -2834,7 +2834,7 @@
// mutex_exit(&ump->allocate_mutex);
- error = vflushbuf(ump->vat_node->vnode, 1 /* sync */);
+ error = vflushbuf(ump->vat_node->vnode, FSYNC_WAIT);
if (error)
goto out;
error = VOP_FSYNC(ump->vat_node->vnode,
@@ -3781,7 +3781,7 @@
/* write out the VAT data and all its descriptors */
DPRINTF(VOLUMES, ("writeout vat_node\n"));
udf_writeout_vat(ump);
- (void) vflushbuf(ump->vat_node->vnode, 1 /* sync */);
+ (void) vflushbuf(ump->vat_node->vnode, FSYNC_WAIT);
(void) VOP_FSYNC(ump->vat_node->vnode,
FSCRED, FSYNC_WAIT, 0, 0);
@@ -6843,5 +6843,3 @@
}
/* --------------------------------------------------------------------- */
-
-
diff -r 71c457cc4639 -r ba48d9ff7c34 sys/fs/udf/udf_vnops.c
--- a/sys/fs/udf/udf_vnops.c Mon May 07 02:57:22 2012 +0000
+++ b/sys/fs/udf/udf_vnops.c Mon May 07 03:01:12 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_vnops.c,v 1.69 2011/11/18 21:18:51 christos Exp $ */
+/* $NetBSD: udf_vnops.c,v 1.69.6.1 2012/05/07 03:01:14 riz Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.69 2011/11/18 21:18:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.69.6.1 2012/05/07 03:01:14 riz Exp $");
#endif /* not lint */
@@ -368,7 +368,8 @@
(old_offset >> 16 != uio->uio_offset >> 16)) {
mutex_enter(vp->v_interlock);
error = VOP_PUTPAGES(vp, (old_offset >> 16) << 16,
- (uio->uio_offset >> 16) << 16, PGO_CLEANIT);
+ (uio->uio_offset >> 16) << 16,
+ PGO_CLEANIT | PGO_LAZY);
old_offset = uio->uio_offset;
}
}
@@ -2224,7 +2225,7 @@
/* flush data and wait for it when requested */
wait = (ap->a_flags & FSYNC_WAIT) ? UPDATE_WAIT : 0;
- error = vflushbuf(vp, wait);
+ error = vflushbuf(vp, ap->a_flags);
if (error)
return error;
@@ -2379,4 +2380,3 @@
const struct vnodeopv_desc udf_vnodeop_opv_desc = {
&udf_vnodeop_p, udf_vnodeop_entries
};
-
diff -r 71c457cc4639 -r ba48d9ff7c34 sys/fs/v7fs/v7fs_vnops.c
--- a/sys/fs/v7fs/v7fs_vnops.c Mon May 07 02:57:22 2012 +0000
+++ b/sys/fs/v7fs/v7fs_vnops.c Mon May 07 03:01:12 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: v7fs_vnops.c,v 1.7 2012/01/27 12:22:02 njoly Exp $ */
+/* $NetBSD: v7fs_vnops.c,v 1.7.2.1 2012/05/07 03:01:12 riz Exp $ */
/*-
* Copyright (c) 2004, 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: v7fs_vnops.c,v 1.7 2012/01/27 12:22:02 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: v7fs_vnops.c,v 1.7.2.1 2012/05/07 03:01:12 riz Exp $");
#if defined _KERNEL_OPT
#include "opt_v7fs.h"
#endif
@@ -646,7 +646,7 @@
}
wait = (a->a_flags & FSYNC_WAIT);
- error = vflushbuf(vp, wait);
+ error = vflushbuf(vp, a->a_flags);
if (error == 0 && (a->a_flags & FSYNC_DATAONLY) == 0)
error = v7fs_update(vp, NULL, NULL, wait ? UPDATE_WAIT : 0);
@@ -1314,4 +1314,3 @@
error_exit:
return error;
}
-
diff -r 71c457cc4639 -r ba48d9ff7c34 sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c Mon May 07 02:57:22 2012 +0000
+++ b/sys/kern/vfs_subr.c Mon May 07 03:01:12 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_subr.c,v 1.432 2012/02/01 05:34:41 dholland Exp $ */
+/* $NetBSD: vfs_subr.c,v 1.432.2.1 2012/05/07 03:01:13 riz Exp $ */
/*-
* Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.432 2012/02/01 05:34:41 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.432.2.1 2012/05/07 03:01:13 riz Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -277,14 +277,21 @@
* buffers from being queued.
*/
int
-vflushbuf(struct vnode *vp, int sync)
+vflushbuf(struct vnode *vp, int flags)
{
struct buf *bp, *nbp;
- int error, flags = PGO_CLEANIT | PGO_ALLPAGES | (sync ? PGO_SYNCIO : 0);
- bool dirty;
+ int error, pflags;
+ bool dirty, sync;
+ sync = (flags & FSYNC_WAIT) != 0;
+ pflags = PGO_CLEANIT | PGO_ALLPAGES |
+ (sync ? PGO_SYNCIO : 0) |
+ ((flags & FSYNC_LAZY) ? PGO_LAZY : 0);
mutex_enter(vp->v_interlock);
- (void) VOP_PUTPAGES(vp, 0, 0, flags);
+ (void) VOP_PUTPAGES(vp, 0, 0, pflags);
+
+ if (LIST_EMPTY(&vp->v_dirtyblkhd) || (flags & FSYNC_DATAONLY))
+ return 0;
loop:
mutex_enter(&bufcache_lock);
@@ -301,7 +308,7 @@
* Wait for I/O associated with indirect blocks to complete,
* since there is no way to quickly wait for them below.
*/
- if (bp->b_vp == vp || sync == 0)
+ if (bp->b_vp == vp || !sync)
(void) bawrite(bp);
else {
error = bwrite(bp);
@@ -312,7 +319,7 @@
}
mutex_exit(&bufcache_lock);
- if (sync == 0)
+ if (!sync)
return 0;
mutex_enter(vp->v_interlock);
diff -r 71c457cc4639 -r ba48d9ff7c34 sys/kern/vfs_wapbl.c
--- a/sys/kern/vfs_wapbl.c Mon May 07 02:57:22 2012 +0000
+++ b/sys/kern/vfs_wapbl.c Mon May 07 03:01:12 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_wapbl.c,v 1.51 2012/01/28 18:02:56 para Exp $ */
+/* $NetBSD: vfs_wapbl.c,v 1.51.2.1 2012/05/07 03:01:13 riz Exp $ */
/*-
* Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
#define WAPBL_INTERNAL
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.51 2012/01/28 18:02:56 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.51.2.1 2012/05/07 03:01:13 riz Exp $");
Home |
Main Index |
Thread Index |
Old Index