• Home
  • Raw
  • Download

Lines Matching full:detail

44 static void cache_init(struct cache_head *h, struct cache_detail *detail)  in cache_init()  argument
51 if (now <= detail->flush_time) in cache_init()
53 now = detail->flush_time + 1; in cache_init()
58 struct cache_detail *detail);
60 struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail, in sunrpc_cache_lookup() argument
66 head = &detail->hash_table[hash]; in sunrpc_cache_lookup()
68 read_lock(&detail->hash_lock); in sunrpc_cache_lookup()
71 if (detail->match(tmp, key)) { in sunrpc_cache_lookup()
72 if (cache_is_expired(detail, tmp)) in sunrpc_cache_lookup()
76 read_unlock(&detail->hash_lock); in sunrpc_cache_lookup()
80 read_unlock(&detail->hash_lock); in sunrpc_cache_lookup()
83 new = detail->alloc(); in sunrpc_cache_lookup()
90 cache_init(new, detail); in sunrpc_cache_lookup()
91 detail->init(new, key); in sunrpc_cache_lookup()
93 write_lock(&detail->hash_lock); in sunrpc_cache_lookup()
97 if (detail->match(tmp, key)) { in sunrpc_cache_lookup()
98 if (cache_is_expired(detail, tmp)) { in sunrpc_cache_lookup()
100 detail->entries --; in sunrpc_cache_lookup()
105 write_unlock(&detail->hash_lock); in sunrpc_cache_lookup()
106 cache_put(new, detail); in sunrpc_cache_lookup()
112 detail->entries++; in sunrpc_cache_lookup()
114 write_unlock(&detail->hash_lock); in sunrpc_cache_lookup()
117 cache_fresh_unlocked(freeme, detail); in sunrpc_cache_lookup()
118 cache_put(freeme, detail); in sunrpc_cache_lookup()
125 static void cache_dequeue(struct cache_detail *detail, struct cache_head *ch);
128 struct cache_detail *detail) in cache_fresh_locked() argument
131 if (now <= detail->flush_time) in cache_fresh_locked()
133 now = detail->flush_time + 1; in cache_fresh_locked()
141 struct cache_detail *detail) in cache_fresh_unlocked() argument
145 cache_dequeue(detail, head); in cache_fresh_unlocked()
149 struct cache_head *sunrpc_cache_update(struct cache_detail *detail, in sunrpc_cache_update() argument
159 write_lock(&detail->hash_lock); in sunrpc_cache_update()
164 detail->update(old, new); in sunrpc_cache_update()
165 cache_fresh_locked(old, new->expiry_time, detail); in sunrpc_cache_update()
166 write_unlock(&detail->hash_lock); in sunrpc_cache_update()
167 cache_fresh_unlocked(old, detail); in sunrpc_cache_update()
170 write_unlock(&detail->hash_lock); in sunrpc_cache_update()
173 tmp = detail->alloc(); in sunrpc_cache_update()
175 cache_put(old, detail); in sunrpc_cache_update()
178 cache_init(tmp, detail); in sunrpc_cache_update()
179 detail->init(tmp, old); in sunrpc_cache_update()
181 write_lock(&detail->hash_lock); in sunrpc_cache_update()
185 detail->update(tmp, new); in sunrpc_cache_update()
186 hlist_add_head(&tmp->cache_list, &detail->hash_table[hash]); in sunrpc_cache_update()
187 detail->entries++; in sunrpc_cache_update()
189 cache_fresh_locked(tmp, new->expiry_time, detail); in sunrpc_cache_update()
190 cache_fresh_locked(old, 0, detail); in sunrpc_cache_update()
191 write_unlock(&detail->hash_lock); in sunrpc_cache_update()
192 cache_fresh_unlocked(tmp, detail); in sunrpc_cache_update()
193 cache_fresh_unlocked(old, detail); in sunrpc_cache_update()
194 cache_put(old, detail); in sunrpc_cache_update()
227 static int try_to_negate_entry(struct cache_detail *detail, struct cache_head *h) in try_to_negate_entry() argument
231 write_lock(&detail->hash_lock); in try_to_negate_entry()
236 detail); in try_to_negate_entry()
239 write_unlock(&detail->hash_lock); in try_to_negate_entry()
240 cache_fresh_unlocked(h, detail); in try_to_negate_entry()
258 int cache_check(struct cache_detail *detail, in cache_check() argument
279 switch (cache_make_upcall(detail, h)) { in cache_check()
281 rv = try_to_negate_entry(detail, h); in cache_check()
284 cache_fresh_unlocked(h, detail); in cache_check()
302 cache_put(h, detail); in cache_check()
495 void cache_purge(struct cache_detail *detail) in cache_purge() argument
502 write_lock(&detail->hash_lock); in cache_purge()
503 if (!detail->entries) { in cache_purge()
504 write_unlock(&detail->hash_lock); in cache_purge()
508 dprintk("RPC: %d entries in %s cache\n", detail->entries, detail->name); in cache_purge()
509 for (i = 0; i < detail->hash_size; i++) { in cache_purge()
510 head = &detail->hash_table[i]; in cache_purge()
513 detail->entries--; in cache_purge()
516 write_unlock(&detail->hash_lock); in cache_purge()
517 cache_fresh_unlocked(ch, detail); in cache_purge()
518 cache_put(ch, detail); in cache_purge()
519 write_lock(&detail->hash_lock); in cache_purge()
522 write_unlock(&detail->hash_lock); in cache_purge()
768 static int cache_request(struct cache_detail *detail, in cache_request() argument
774 detail->cache_request(detail, crq->item, &bp, &len); in cache_request()
1052 static void cache_dequeue(struct cache_detail *detail, struct cache_head *ch) in cache_dequeue() argument
1060 list_for_each_entry_safe(cq, tmp, &detail->queue, list) in cache_dequeue()
1076 cache_put(cr->item, detail); in cache_dequeue()
1141 static void warn_no_listener(struct cache_detail *detail) in warn_no_listener() argument
1143 if (detail->last_warn != detail->last_close) { in warn_no_listener()
1144 detail->last_warn = detail->last_close; in warn_no_listener()
1145 if (detail->warn_no_listener) in warn_no_listener()
1146 detail->warn_no_listener(detail, detail->last_close != 0); in warn_no_listener()
1150 static bool cache_listeners_exist(struct cache_detail *detail) in cache_listeners_exist() argument
1152 if (atomic_read(&detail->readers)) in cache_listeners_exist()
1154 if (detail->last_close == 0) in cache_listeners_exist()
1157 if (detail->last_close < seconds_since_boot() - 30) in cache_listeners_exist()
1173 int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h) in sunrpc_cache_pipe_upcall() argument
1180 if (!detail->cache_request) in sunrpc_cache_pipe_upcall()
1183 if (!cache_listeners_exist(detail)) { in sunrpc_cache_pipe_upcall()
1184 warn_no_listener(detail); in sunrpc_cache_pipe_upcall()
1208 list_add_tail(&crq->q.list, &detail->queue); in sunrpc_cache_pipe_upcall()