summaryrefslogtreecommitdiff
path: root/lib/libpuffs/requests.c
diff options
context:
space:
mode:
authorpooka <pooka@NetBSD.org>2008-01-28 18:35:49 +0000
committerpooka <pooka@NetBSD.org>2008-01-28 18:35:49 +0000
commitd1d05d65b94de0b1c74d001d0f98e05b646d538f (patch)
tree7dd80f18258298311bb60954621b95a3c4a2b673 /lib/libpuffs/requests.c
parentf3b8aacb17bf459faf28a2822562269980f4be59 (diff)
Implement lazy contexts for file systems using puffs_mainloop().
Previously each request was executed on its own callcontext and switched to every time the request was being processed. Now requests borrow the mainloop context and switch only if/when they yield. This takes two context switches away from a file system request bringing down the typical amounts 2->0 (e.g. dtfs) and 4->2 (e.g. psshfs). The interfaces for manually executing requests changed a bit: puffs_dispatch_create() and puffs_dispatch_exec() must now be used. They are not tested, as nothing in-tree wants them and I doubt anyone else is really interested in them either. Also do some misc code cleanup related to execution contexts. The "work-in-progress checkpoint" committed over a year ago was starting to look slightly weed-infested.
Diffstat (limited to 'lib/libpuffs/requests.c')
-rw-r--r--lib/libpuffs/requests.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libpuffs/requests.c b/lib/libpuffs/requests.c
index e3c75aaac68..8b124db178b 100644
--- a/lib/libpuffs/requests.c
+++ b/lib/libpuffs/requests.c
@@ -1,4 +1,4 @@
-/* $NetBSD: requests.c,v 1.20 2007/12/05 11:06:05 pooka Exp $ */
+/* $NetBSD: requests.c,v 1.21 2008/01/28 18:35:51 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
-__RCSID("$NetBSD: requests.c,v 1.20 2007/12/05 11:06:05 pooka Exp $");
+__RCSID("$NetBSD: requests.c,v 1.21 2008/01/28 18:35:51 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@@ -56,7 +56,7 @@ __RCSID("$NetBSD: requests.c,v 1.20 2007/12/05 11:06:05 pooka Exp $");
*/
/*ARGSUSED*/
int
-puffs_fsframe_read(struct puffs_usermount *pu, struct puffs_framebuf *pb,
+puffs__fsframe_read(struct puffs_usermount *pu, struct puffs_framebuf *pb,
int fd, int *done)
{
struct putter_hdr phdr;
@@ -117,7 +117,7 @@ puffs_fsframe_read(struct puffs_usermount *pu, struct puffs_framebuf *pb,
*/
/*ARGSUSED*/
int
-puffs_fsframe_write(struct puffs_usermount *pu, struct puffs_framebuf *pb,
+puffs__fsframe_write(struct puffs_usermount *pu, struct puffs_framebuf *pb,
int fd, int *done)
{
void *win;
@@ -200,7 +200,7 @@ puffs_fsframe_write(struct puffs_usermount *pu, struct puffs_framebuf *pb,
*/
/*ARGSUSED*/
int
-puffs_fsframe_cmp(struct puffs_usermount *pu,
+puffs__fsframe_cmp(struct puffs_usermount *pu,
struct puffs_framebuf *pb1, struct puffs_framebuf *pb2, int *notresp)
{
struct puffs_req *preq1, *preq2;
@@ -233,7 +233,7 @@ puffs_fsframe_cmp(struct puffs_usermount *pu,
}
void
-puffs_fsframe_gotframe(struct puffs_usermount *pu, struct puffs_framebuf *pb)
+puffs__fsframe_gotframe(struct puffs_usermount *pu, struct puffs_framebuf *pb)
{
struct puffs_framebuf *newpb;
@@ -245,5 +245,5 @@ puffs_fsframe_gotframe(struct puffs_usermount *pu, struct puffs_framebuf *pb)
if (puffs_framebuf_reserve_space(newpb, PUFFS_MSG_MAXSIZE) == -1)
abort();
- puffs_dopufbuf(pu, newpb);
+ puffs__ml_dispatch(pu, newpb);
}