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