Lines Matching refs:detail

54 struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,  in sunrpc_cache_lookup()  argument
60 head = &detail->hash_table[hash]; in sunrpc_cache_lookup()
62 read_lock(&detail->hash_lock); in sunrpc_cache_lookup()
66 if (detail->match(tmp, key)) { in sunrpc_cache_lookup()
67 if (cache_is_expired(detail, tmp)) in sunrpc_cache_lookup()
71 read_unlock(&detail->hash_lock); in sunrpc_cache_lookup()
75 read_unlock(&detail->hash_lock); in sunrpc_cache_lookup()
78 new = detail->alloc(); in sunrpc_cache_lookup()
86 detail->init(new, key); in sunrpc_cache_lookup()
88 write_lock(&detail->hash_lock); in sunrpc_cache_lookup()
93 if (detail->match(tmp, key)) { in sunrpc_cache_lookup()
94 if (cache_is_expired(detail, tmp)) { in sunrpc_cache_lookup()
97 detail->entries --; in sunrpc_cache_lookup()
102 write_unlock(&detail->hash_lock); in sunrpc_cache_lookup()
103 cache_put(new, detail); in sunrpc_cache_lookup()
109 detail->entries++; in sunrpc_cache_lookup()
111 write_unlock(&detail->hash_lock); in sunrpc_cache_lookup()
114 cache_put(freeme, detail); in sunrpc_cache_lookup()
120 static void cache_dequeue(struct cache_detail *detail, struct cache_head *ch);
131 struct cache_detail *detail) in cache_fresh_unlocked() argument
135 cache_dequeue(detail, head); in cache_fresh_unlocked()
139 struct cache_head *sunrpc_cache_update(struct cache_detail *detail, in sunrpc_cache_update() argument
150 write_lock(&detail->hash_lock); in sunrpc_cache_update()
155 detail->update(old, new); in sunrpc_cache_update()
157 write_unlock(&detail->hash_lock); in sunrpc_cache_update()
158 cache_fresh_unlocked(old, detail); in sunrpc_cache_update()
161 write_unlock(&detail->hash_lock); in sunrpc_cache_update()
164 tmp = detail->alloc(); in sunrpc_cache_update()
166 cache_put(old, detail); in sunrpc_cache_update()
170 detail->init(tmp, old); in sunrpc_cache_update()
171 head = &detail->hash_table[hash]; in sunrpc_cache_update()
173 write_lock(&detail->hash_lock); in sunrpc_cache_update()
177 detail->update(tmp, new); in sunrpc_cache_update()
180 detail->entries++; in sunrpc_cache_update()
184 write_unlock(&detail->hash_lock); in sunrpc_cache_update()
185 cache_fresh_unlocked(tmp, detail); in sunrpc_cache_update()
186 cache_fresh_unlocked(old, detail); in sunrpc_cache_update()
187 cache_put(old, detail); in sunrpc_cache_update()
220 static int try_to_negate_entry(struct cache_detail *detail, struct cache_head *h) in try_to_negate_entry() argument
224 write_lock(&detail->hash_lock); in try_to_negate_entry()
231 write_unlock(&detail->hash_lock); in try_to_negate_entry()
232 cache_fresh_unlocked(h, detail); in try_to_negate_entry()
250 int cache_check(struct cache_detail *detail, in cache_check() argument
271 switch (cache_make_upcall(detail, h)) { in cache_check()
273 rv = try_to_negate_entry(detail, h); in cache_check()
276 cache_fresh_unlocked(h, detail); in cache_check()
294 cache_put(h, detail); in cache_check()
493 void cache_purge(struct cache_detail *detail) in cache_purge() argument
495 detail->flush_time = LONG_MAX; in cache_purge()
496 detail->nextcheck = seconds_since_boot(); in cache_purge()
498 detail->flush_time = 1; in cache_purge()
744 static int cache_request(struct cache_detail *detail, in cache_request() argument
750 detail->cache_request(detail, crq->item, &bp, &len); in cache_request()
1028 static void cache_dequeue(struct cache_detail *detail, struct cache_head *ch) in cache_dequeue() argument
1036 list_for_each_entry_safe(cq, tmp, &detail->queue, list) in cache_dequeue()
1052 cache_put(cr->item, detail); in cache_dequeue()
1117 static void warn_no_listener(struct cache_detail *detail) in warn_no_listener() argument
1119 if (detail->last_warn != detail->last_close) { in warn_no_listener()
1120 detail->last_warn = detail->last_close; in warn_no_listener()
1121 if (detail->warn_no_listener) in warn_no_listener()
1122 detail->warn_no_listener(detail, detail->last_close != 0); in warn_no_listener()
1126 static bool cache_listeners_exist(struct cache_detail *detail) in cache_listeners_exist() argument
1128 if (atomic_read(&detail->readers)) in cache_listeners_exist()
1130 if (detail->last_close == 0) in cache_listeners_exist()
1133 if (detail->last_close < seconds_since_boot() - 30) in cache_listeners_exist()
1149 int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h) in sunrpc_cache_pipe_upcall() argument
1156 if (!detail->cache_request) in sunrpc_cache_pipe_upcall()
1159 if (!cache_listeners_exist(detail)) { in sunrpc_cache_pipe_upcall()
1160 warn_no_listener(detail); in sunrpc_cache_pipe_upcall()
1184 list_add_tail(&crq->q.list, &detail->queue); in sunrpc_cache_pipe_upcall()