diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-09-23 15:01:41 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-09-23 15:02:13 +0200 |
commit | 22be093ffb403a1c474037939ca9b88b1ee39f77 (patch) | |
tree | 99b06c7fa271316661a2c3e2ea9bd69ff370a53f /src/hashmap.c | |
parent | 647703fecb8c9928d0f13fd95d17fd5f2280c7e1 (diff) |
readahead: implement minimal readahead logic based on fanotify(), mincore() and readahead()
Diffstat (limited to 'src/hashmap.c')
-rw-r--r-- | src/hashmap.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/hashmap.c b/src/hashmap.c index 51f00131f4..4b187057ec 100644 --- a/src/hashmap.c +++ b/src/hashmap.c @@ -476,6 +476,21 @@ void* hashmap_steal_first(Hashmap *h) { return data; } +void* hashmap_steal_first_key(Hashmap *h) { + void *key; + + if (!h) + return NULL; + + if (!h->iterate_list_head) + return NULL; + + key = (void*) h->iterate_list_head->key; + remove_entry(h, h->iterate_list_head); + + return key; +} + unsigned hashmap_size(Hashmap *h) { if (!h) |