Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ffs syncsnap: Use bbusy() to take a buffer from v_di...
details: https://anonhg.NetBSD.org/src/rev/2ff735e28d9d
branches: trunk
changeset: 759524:2ff735e28d9d
user: hannken <hannken%NetBSD.org@localhost>
date: Sun Dec 12 10:28:22 2010 +0000
description:
syncsnap: Use bbusy() to take a buffer from v_dirtyblkhd.
diffstat:
sys/ufs/ffs/ffs_snapshot.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diffs (35 lines):
diff -r 184295428ec0 -r 2ff735e28d9d sys/ufs/ffs/ffs_snapshot.c
--- a/sys/ufs/ffs/ffs_snapshot.c Sun Dec 12 10:07:34 2010 +0000
+++ b/sys/ufs/ffs/ffs_snapshot.c Sun Dec 12 10:28:22 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_snapshot.c,v 1.99 2010/06/24 13:03:19 hannken Exp $ */
+/* $NetBSD: ffs_snapshot.c,v 1.100 2010/12/12 10:28:22 hannken Exp $ */
/*
* Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.99 2010/06/24 13:03:19 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.100 2010/12/12 10:28:22 hannken Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -2081,9 +2081,14 @@
mutex_enter(&bufcache_lock);
while ((bp = LIST_FIRST(&vp->v_dirtyblkhd))) {
- KASSERT((bp->b_cflags & BC_BUSY) == 0);
+ error = bbusy(bp, false, 0, NULL);
+ if (error == EPASSTHROUGH)
+ continue;
+ else if (error != 0) {
+ mutex_exit(&bufcache_lock);
+ return error;
+ }
KASSERT(bp->b_bcount == fs->fs_bsize);
- bp->b_cflags |= BC_BUSY;
mutex_exit(&bufcache_lock);
error = rwfsblk(vp, B_WRITE, bp->b_data,
fragstoblks(fs, dbtofsb(fs, bp->b_blkno)));
Home |
Main Index |
Thread Index |
Old Index