author | Tero Marttila <terom@fixme.fi> |
Thu, 28 Aug 2008 01:34:14 +0300 | |
changeset 44 | 03a7e064f833 |
parent 37 | f0188b445c84 |
permissions | -rw-r--r-- |
30
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
1 |
#ifndef CACHE_REQ_H |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
2 |
#define CACHE_REQ_H |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
3 |
|
31 | 4 |
#include <sys/queue.h> |
5 |
||
30
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
6 |
#include "../cache.h" |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
7 |
#include "op.h" |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
8 |
|
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
9 |
struct cache_req { |
36
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
10 |
// a pointer to the relevant key |
30
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
11 |
struct cache_key *key; |
36
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
12 |
|
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
13 |
// a copy |
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
14 |
// XXX: this should be moved to cache_op |
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
15 |
struct cache_key key_copy; |
30
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
16 |
|
36
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
17 |
// we are part of cache_op.req_list |
30
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
18 |
LIST_ENTRY(cache_req) node; |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
19 |
|
36
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
20 |
// the user callback |
30
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
21 |
cache_callback cb_func; |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
22 |
void *cb_data; |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
23 |
|
36
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
24 |
// the op we are using |
30
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
25 |
struct cache_op *op; |
36
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
26 |
|
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
27 |
// were we the origional req that created the op, i.e. the one that handles open_write in case of OP_STATE_MISS? |
30
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
28 |
int is_write; |
36
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
29 |
|
b4023990811e
rename/clean up states slightly and add lots of documentation
Tero Marttila <terom@fixme.fi>
parents:
33
diff
changeset
|
30 |
// our own read offset into the cache entry. |
37 | 31 |
size_t read_offset; |
30
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
32 |
}; |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
33 |
|
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
34 |
/* |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
35 |
* Called by cache_op to notify for changes in state |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
36 |
*/ |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
37 |
int cache_req_notify (struct cache_req *req); |
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
38 |
|
33e464fd6773
my hg working dir managed to break itself somehow... my attempt to fix that, and add some cache code :)
terom@cl-543.hel-01.fi.sixxs.net
parents:
diff
changeset
|
39 |
#endif /* CACHE_REQ_H */ |