#ifndef CACHE_REQ_H
#define CACHE_REQ_H
#include <sys/queue.h>
#include "../cache.h"
#include "op.h"
struct cache_req {
// a pointer to the relevant key
struct cache_key *key;
// a copy
// XXX: this should be moved to cache_op
struct cache_key key_copy;
// we are part of cache_op.req_list
LIST_ENTRY(cache_req) node;
// the user callback
cache_callback cb_func;
void *cb_data;
// the op we are using
struct cache_op *op;
// were we the origional req that created the op, i.e. the one that handles open_write in case of OP_STATE_MISS?
int is_write;
// our own read offset into the cache entry.
size_t read_offset;
};
/*
* Called by cache_op to notify for changes in state
*/
int cache_req_notify (struct cache_req *req);
#endif /* CACHE_REQ_H */