Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lru_cache: remove unused lc_private, lc_set, lc_index_of

Signed-off-by: Joel Colledge <joel.colledge@linbit.com>
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20221122134301.69258-4-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Joel Colledge and committed by
Jens Axboe
2cd10a49 99334384

-47
-3
include/linux/lru_cache.h
··· 199 199 unsigned long flags; 200 200 201 201 202 - void *lc_private; 203 202 const char *name; 204 203 205 204 /* nr_elements there */ ··· 240 241 unsigned e_count, size_t e_size, size_t e_off); 241 242 extern void lc_reset(struct lru_cache *lc); 242 243 extern void lc_destroy(struct lru_cache *lc); 243 - extern void lc_set(struct lru_cache *lc, unsigned int enr, int index); 244 244 extern void lc_del(struct lru_cache *lc, struct lc_element *element); 245 245 246 246 extern struct lc_element *lc_get_cumulative(struct lru_cache *lc, unsigned int enr); ··· 295 297 container_of(ptr, type, member) 296 298 297 299 extern struct lc_element *lc_element_by_index(struct lru_cache *lc, unsigned i); 298 - extern unsigned int lc_index_of(struct lru_cache *lc, struct lc_element *e); 299 300 300 301 #endif
-44
lib/lru_cache.c
··· 575 575 } 576 576 577 577 /** 578 - * lc_index_of 579 - * @lc: the lru cache to operate on 580 - * @e: the element to query for its index position in lc->element 581 - */ 582 - unsigned int lc_index_of(struct lru_cache *lc, struct lc_element *e) 583 - { 584 - PARANOIA_LC_ELEMENT(lc, e); 585 - return e->lc_index; 586 - } 587 - 588 - /** 589 - * lc_set - associate index with label 590 - * @lc: the lru cache to operate on 591 - * @enr: the label to set 592 - * @index: the element index to associate label with. 593 - * 594 - * Used to initialize the active set to some previously recorded state. 595 - */ 596 - void lc_set(struct lru_cache *lc, unsigned int enr, int index) 597 - { 598 - struct lc_element *e; 599 - struct list_head *lh; 600 - 601 - if (index < 0 || index >= lc->nr_elements) 602 - return; 603 - 604 - e = lc_element_by_index(lc, index); 605 - BUG_ON(e->lc_number != e->lc_new_number); 606 - BUG_ON(e->refcnt != 0); 607 - 608 - e->lc_number = e->lc_new_number = enr; 609 - hlist_del_init(&e->colision); 610 - if (enr == LC_FREE) 611 - lh = &lc->free; 612 - else { 613 - hlist_add_head(&e->colision, lc_hash_slot(lc, enr)); 614 - lh = &lc->lru; 615 - } 616 - list_move(&e->list, lh); 617 - } 618 - 619 - /** 620 578 * lc_seq_dump_details - Dump a complete LRU cache to seq in textual form. 621 579 * @lc: the lru cache to operate on 622 580 * @seq: the &struct seq_file pointer to seq_printf into ··· 608 650 EXPORT_SYMBOL(lc_create); 609 651 EXPORT_SYMBOL(lc_reset); 610 652 EXPORT_SYMBOL(lc_destroy); 611 - EXPORT_SYMBOL(lc_set); 612 653 EXPORT_SYMBOL(lc_del); 613 654 EXPORT_SYMBOL(lc_try_get); 614 655 EXPORT_SYMBOL(lc_find); ··· 615 658 EXPORT_SYMBOL(lc_put); 616 659 EXPORT_SYMBOL(lc_committed); 617 660 EXPORT_SYMBOL(lc_element_by_index); 618 - EXPORT_SYMBOL(lc_index_of); 619 661 EXPORT_SYMBOL(lc_seq_printf_stats); 620 662 EXPORT_SYMBOL(lc_seq_dump_details); 621 663 EXPORT_SYMBOL(lc_try_lock);