Skip to content

Commit 7589633

Browse files
jankaratytso
authored andcommitted
mbcache: Remove mb_cache_entry_delete()
Nobody uses mb_cache_entry_delete() anymore. Remove it. Signed-off-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 1189d8e commit 7589633

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

fs/mbcache.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -230,43 +230,6 @@ struct mb_cache_entry *mb_cache_entry_get(struct mb_cache *cache, u32 key,
230230
}
231231
EXPORT_SYMBOL(mb_cache_entry_get);
232232

233-
/* mb_cache_entry_delete - try to remove a cache entry
234-
* @cache - cache we work with
235-
* @key - key
236-
* @value - value
237-
*
238-
* Remove entry from cache @cache with key @key and value @value.
239-
*/
240-
void mb_cache_entry_delete(struct mb_cache *cache, u32 key, u64 value)
241-
{
242-
struct hlist_bl_node *node;
243-
struct hlist_bl_head *head;
244-
struct mb_cache_entry *entry;
245-
246-
head = mb_cache_entry_head(cache, key);
247-
hlist_bl_lock(head);
248-
hlist_bl_for_each_entry(entry, node, head, e_hash_list) {
249-
if (entry->e_key == key && entry->e_value == value) {
250-
/* We keep hash list reference to keep entry alive */
251-
hlist_bl_del_init(&entry->e_hash_list);
252-
hlist_bl_unlock(head);
253-
spin_lock(&cache->c_list_lock);
254-
if (!list_empty(&entry->e_list)) {
255-
list_del_init(&entry->e_list);
256-
if (!WARN_ONCE(cache->c_entry_count == 0,
257-
"mbcache: attempt to decrement c_entry_count past zero"))
258-
cache->c_entry_count--;
259-
atomic_dec(&entry->e_refcnt);
260-
}
261-
spin_unlock(&cache->c_list_lock);
262-
mb_cache_entry_put(cache, entry);
263-
return;
264-
}
265-
}
266-
hlist_bl_unlock(head);
267-
}
268-
EXPORT_SYMBOL(mb_cache_entry_delete);
269-
270233
/* mb_cache_entry_delete_or_get - remove a cache entry if it has no users
271234
* @cache - cache we work with
272235
* @key - key

include/linux/mbcache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ static inline int mb_cache_entry_put(struct mb_cache *cache,
4747

4848
struct mb_cache_entry *mb_cache_entry_delete_or_get(struct mb_cache *cache,
4949
u32 key, u64 value);
50-
void mb_cache_entry_delete(struct mb_cache *cache, u32 key, u64 value);
5150
struct mb_cache_entry *mb_cache_entry_get(struct mb_cache *cache, u32 key,
5251
u64 value);
5352
struct mb_cache_entry *mb_cache_entry_find_first(struct mb_cache *cache,

0 commit comments

Comments
 (0)