Allow clients to reuse a "park".

Patch from <yamt>, fixes PR kern/44086 by him.
This commit is contained in:
pooka 2010-11-12 17:46:09 +00:00
parent 8c5fe271ac
commit a1a97722c2
1 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_msgif.c,v 1.82 2010/07/06 17:00:06 pooka Exp $ */
/* $NetBSD: puffs_msgif.c,v 1.83 2010/11/12 17:46:09 pooka Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.82 2010/07/06 17:00:06 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.83 2010/11/12 17:46:09 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -332,6 +332,14 @@ puffs_msg_enqueue(struct puffs_mount *pmp, struct puffs_msgpark *park)
struct puffs_req *preq, *creq;
ssize_t delta;
/*
* Some clients reuse a park, so reset some flags. We might
* want to provide a caller-side interface for this and add
* a few more invariant checks here, but this will do for now.
*/
park->park_flags &= ~(PARKFLAG_DONE | PARKFLAG_HASERROR);
KASSERT((park->park_flags & PARKFLAG_WAITERGONE) == 0);
mp = PMPTOMP(pmp);
preq = park->park_preq;