Use ltsleep(... PNORELOCK ) instead of simple_unlock()/tsleep()

This commit is contained in:
sommerfeld 2000-08-12 16:29:36 +00:00
parent 01233143b9
commit a6cdaddbe6

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_extent.c,v 1.36 2000/07/07 14:10:48 mrg Exp $ */ /* $NetBSD: subr_extent.c,v 1.37 2000/08/12 16:29:36 sommerfeld Exp $ */
/*- /*-
* Copyright (c) 1996, 1998 The NetBSD Foundation, Inc. * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@ -468,10 +468,9 @@ extent_alloc_region(ex, start, size, flags)
*/ */
if (flags & EX_WAITSPACE) { if (flags & EX_WAITSPACE) {
ex->ex_flags |= EXF_WANTED; ex->ex_flags |= EXF_WANTED;
simple_unlock(&ex->ex_slock); error = ltsleep(ex,
error = tsleep(ex, PNORELOCK | PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0),
PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0), "extnt", 0, &ex->ex_slock);
"extnt", 0);
if (error) if (error)
return (error); return (error);
goto alloc_start; goto alloc_start;
@ -843,9 +842,9 @@ extent_alloc_subregion1(ex, substart, subend, size, alignment, skew, boundary,
*/ */
if (flags & EX_WAITSPACE) { if (flags & EX_WAITSPACE) {
ex->ex_flags |= EXF_WANTED; ex->ex_flags |= EXF_WANTED;
simple_unlock(&ex->ex_slock); error = ltsleep(ex,
error = tsleep(ex, PNORELOCK | PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0),
PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0), "extnt", 0); "extnt", 0, &ex->ex_slock);
if (error) if (error)
return (error); return (error);
goto alloc_start; goto alloc_start;
@ -1072,10 +1071,9 @@ extent_alloc_region_descriptor(ex, flags)
return (NULL); return (NULL);
} }
ex->ex_flags |= EXF_FLWANTED; ex->ex_flags |= EXF_FLWANTED;
simple_unlock(&ex->ex_slock); if (ltsleep(&fex->fex_freelist,
if (tsleep(&fex->fex_freelist, PNORELOCK| PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0),
PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0), "extnt", 0, &ex->ex_slock))
"extnt", 0))
return (NULL); return (NULL);
} }
} }