--- a/cache.h Sat Aug 09 01:00:35 2008 +0300
+++ b/cache.h Sat Aug 09 14:42:59 2008 +0300
@@ -43,13 +43,16 @@
CACHE_STATE_INVALID,
CACHE_STATE_LOOKUP,
- CACHE_STATE_WRITE_BEGIN,
- CACHE_STATE_READ_BEGIN,
+ CACHE_STATE_HIT,
+ CACHE_STATE_MISS,
+
+ CACHE_STATE_OPEN_READ,
+ CACHE_STATE_READ,
+
+ CACHE_STATE_OPEN_WRITE,
CACHE_STATE_WRITE,
CACHE_STATE_WRITE_PAUSE,
- CACHE_STATE_READ,
- CACHE_STATE_DONE,
CACHE_STATE_ERROR,
};
@@ -128,7 +131,12 @@
/*
* Prepare this cache req for writing in the data. Hint, if nonzero, is used to pre-allocate resources for the entry.
*/
-int cache_req_begin_write(struct cache_req *req, size_t hint);
+int cache_req_begin_write (struct cache_req *req, size_t hint);
+
+/*
+ * Prepare this cache req for use with cache_req_pull.
+ */
+int cache_req_begin_read (struct cache_req *req);
/*
* Add some data into this cache entry, reading from the given fd. This is only valid for cache_req's in