summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2008-05-13 18:50:27 +0000
committerroot <root>2008-05-13 18:50:27 +0000
commitb75e590990962d7d68829a222860b146dc1f3a7f (patch)
treeb37ab14941595fcaac5a7a2899c494067384935f
parent7372031e3bb023747eb262f4fa7d9f5aa95b471b (diff)
*** empty log message ***
-rw-r--r--eio.c12
-rw-r--r--eio.h4
2 files changed, 11 insertions, 5 deletions
diff --git a/eio.c b/eio.c
index 3e71965..a65b617 100644
--- a/eio.c
+++ b/eio.c
@@ -358,6 +358,11 @@ static void maybe_start_thread (void)
void eio_submit (eio_req *req)
{
+ req->pri += EIO_PRI_BIAS;
+
+ if (req->pri < EIO_PRI_MIN + EIO_PRI_BIAS) req->pri = EIO_PRI_MIN + EIO_PRI_BIAS;
+ if (req->pri > EIO_PRI_MAX + EIO_PRI_BIAS) req->pri = EIO_PRI_MAX + EIO_PRI_BIAS;
+
++nreqs;
X_LOCK (reqlock);
@@ -1051,9 +1056,10 @@ static void eio_api_destroy (eio_req *req)
if (!req) \
return 0; \
\
- req->type = rtype; \
- req->pri = EIO_DEFAULT_PRI + EIO_PRI_BIAS; \
- req->finish = cb; \
+ req->type = rtype; \
+ req->pri = pri; \
+ req->finish = cb; \
+ req->data = data; \
req->destroy = eio_api_destroy;
#define SEND eio_submit (req); return req
diff --git a/eio.h b/eio.h
index c168f0d..2da2557 100644
--- a/eio.h
+++ b/eio.h
@@ -8,8 +8,8 @@ typedef struct eio_req eio_req;
typedef int (*eio_cb)(eio_req *req);
-#ifndef EIO_COMMON
-# define EIO_COMMON
+#ifndef EIO_REQ_MEMBERS
+# define EIO_REQ_MEMBERS
#endif
#ifndef EIO_STRUCT_STAT