diff options
author | Grigoriy Orlov <gluk@cvs.openbsd.org> | 2001-04-06 18:59:18 +0000 |
---|---|---|
committer | Grigoriy Orlov <gluk@cvs.openbsd.org> | 2001-04-06 18:59:18 +0000 |
commit | fc49e03d2ce94c45ba8eaa2a8f4bd853e50998fe (patch) | |
tree | d08ec332e5c7fe2f63392eb08e75640136a9a0fa /sys | |
parent | 69e6f442865111ead645b3a51fc9e42ad7979c69 (diff) |
Change softdep_count_dependencies interface so that it may be called
from interrupt at splbio.
costa@ ok.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/buf.h | 8 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 16 |
2 files changed, 14 insertions, 10 deletions
diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 46b5cc8c0fe..8d39afee064 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.h,v 1.21 2001/03/20 17:30:07 gluk Exp $ */ +/* $OpenBSD: buf.h,v 1.22 2001/04/06 18:59:17 gluk Exp $ */ /* $NetBSD: buf.h,v 1.25 1997/04/09 21:12:17 mycroft Exp $ */ /* @@ -67,7 +67,7 @@ extern struct bio_ops { void (*io_complete) __P((struct buf *)); void (*io_deallocate) __P((struct buf *)); void (*io_movedeps) __P((struct buf *, struct buf *)); - int (*io_countdeps) __P((struct buf *, int)); + int (*io_countdeps) __P((struct buf *, int, int)); } bioops; @@ -261,10 +261,10 @@ buf_movedeps(struct buf *bp, struct buf *bp2) } static __inline int -buf_countdeps(struct buf *bp, int i) +buf_countdeps(struct buf *bp, int i, int islocked) { if (bioops.io_countdeps) - return ((*bioops.io_countdeps)(bp, i)); + return ((*bioops.io_countdeps)(bp, i, islocked)); else return (0); } diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 6018663b7b0..1dea5971c61 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_softdep.c,v 1.21 2001/04/04 20:19:03 gluk Exp $ */ +/* $OpenBSD: ffs_softdep.c,v 1.22 2001/04/06 18:59:16 gluk Exp $ */ /* * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. * @@ -168,7 +168,7 @@ void softdep_disk_io_initiation __P((struct buf *)); void softdep_disk_write_complete __P((struct buf *)); void softdep_deallocate_dependencies __P((struct buf *)); void softdep_move_dependencies __P((struct buf *, struct buf *)); -int softdep_count_dependencies __P((struct buf *bp, int)); +int softdep_count_dependencies __P((struct buf *bp, int, int)); struct bio_ops bioops = { softdep_disk_io_initiation, /* io_start */ @@ -4780,9 +4780,10 @@ clear_inodedeps(p) * is set, return number of dependencies, otherwise just yes or no. */ int -softdep_count_dependencies(bp, wantcount) +softdep_count_dependencies(bp, wantcount, islocked) struct buf *bp; int wantcount; + int islocked; { struct worklist *wk; struct inodedep *inodedep; @@ -4793,7 +4794,8 @@ softdep_count_dependencies(bp, wantcount) int i, retval; retval = 0; - ACQUIRE_LOCK(&lk); + if (!islocked) + ACQUIRE_LOCK(&lk); LIST_FOREACH(wk, &bp->b_dep, wk_list) { switch (wk->wk_type) { @@ -4845,14 +4847,16 @@ softdep_count_dependencies(bp, wantcount) continue; default: - FREE_LOCK(&lk); + if (!islocked) + FREE_LOCK(&lk); panic("softdep_check_for_rollback: Unexpected type %s", TYPENAME(wk->wk_type)); /* NOTREACHED */ } } out: - FREE_LOCK(&lk); + if (!islocked) + FREE_LOCK(&lk); return retval; } |