Skip to content

Commit 3e8e1af

Browse files
Christoph Hellwigtorvalds
authored andcommitted
frontswap: remove frontswap_curr_pages
frontswap_curr_pages is never called, so remove it. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Cc: Dan Streetman <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Konrad Rzeszutek Wilk <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Seth Jennings <[email protected]> Cc: Vitaly Wool <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0b36444 commit 3e8e1af

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

include/linux/frontswap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ struct frontswap_ops {
2424
};
2525

2626
extern void frontswap_register_ops(struct frontswap_ops *ops);
27-
extern unsigned long frontswap_curr_pages(void);
2827

2928
extern bool __frontswap_test(struct swap_info_struct *, pgoff_t);
3029
extern void __frontswap_init(unsigned type, unsigned long *map);

mm/frontswap.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -330,34 +330,6 @@ void __frontswap_invalidate_area(unsigned type)
330330
}
331331
EXPORT_SYMBOL(__frontswap_invalidate_area);
332332

333-
static unsigned long __frontswap_curr_pages(void)
334-
{
335-
unsigned long totalpages = 0;
336-
struct swap_info_struct *si = NULL;
337-
338-
assert_spin_locked(&swap_lock);
339-
plist_for_each_entry(si, &swap_active_head, list)
340-
totalpages += atomic_read(&si->frontswap_pages);
341-
return totalpages;
342-
}
343-
344-
/*
345-
* Count and return the number of frontswap pages across all
346-
* swap devices. This is exported so that backend drivers can
347-
* determine current usage without reading debugfs.
348-
*/
349-
unsigned long frontswap_curr_pages(void)
350-
{
351-
unsigned long totalpages = 0;
352-
353-
spin_lock(&swap_lock);
354-
totalpages = __frontswap_curr_pages();
355-
spin_unlock(&swap_lock);
356-
357-
return totalpages;
358-
}
359-
EXPORT_SYMBOL(frontswap_curr_pages);
360-
361333
static int __init init_frontswap(void)
362334
{
363335
#ifdef CONFIG_DEBUG_FS

0 commit comments

Comments
 (0)