Skip to content

Commit 71024cb

Browse files
Christoph Hellwigtorvalds
authored andcommitted
frontswap: remove frontswap_tmem_exclusive_gets
frontswap_tmem_exclusive_gets 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 3d6035f commit 71024cb

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

include/linux/frontswap.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ struct frontswap_ops {
2626
extern void frontswap_register_ops(struct frontswap_ops *ops);
2727
extern void frontswap_shrink(unsigned long);
2828
extern unsigned long frontswap_curr_pages(void);
29-
#define FRONTSWAP_HAS_EXCLUSIVE_GETS
30-
extern void frontswap_tmem_exclusive_gets(bool);
3129

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

mm/frontswap.c

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ static struct frontswap_ops *frontswap_ops __read_mostly;
3232
#define for_each_frontswap_ops(ops) \
3333
for ((ops) = frontswap_ops; (ops); (ops) = (ops)->next)
3434

35-
/*
36-
* If enabled, the underlying tmem implementation is capable of doing
37-
* exclusive gets, so frontswap_load, on a successful tmem_get must
38-
* mark the page as no longer in frontswap AND mark it dirty.
39-
*/
40-
static bool frontswap_tmem_exclusive_gets_enabled __read_mostly;
41-
4235
#ifdef CONFIG_DEBUG_FS
4336
/*
4437
* Counters available via /sys/kernel/debug/frontswap (if debugfs is
@@ -160,15 +153,6 @@ void frontswap_register_ops(struct frontswap_ops *ops)
160153
}
161154
EXPORT_SYMBOL(frontswap_register_ops);
162155

163-
/*
164-
* Enable/disable frontswap exclusive gets (see above).
165-
*/
166-
void frontswap_tmem_exclusive_gets(bool enable)
167-
{
168-
frontswap_tmem_exclusive_gets_enabled = enable;
169-
}
170-
EXPORT_SYMBOL(frontswap_tmem_exclusive_gets);
171-
172156
/*
173157
* Called when a swap device is swapon'd.
174158
*/
@@ -296,13 +280,8 @@ int __frontswap_load(struct page *page)
296280
if (!ret) /* successful load */
297281
break;
298282
}
299-
if (ret == 0) {
283+
if (ret == 0)
300284
inc_frontswap_loads();
301-
if (frontswap_tmem_exclusive_gets_enabled) {
302-
SetPageDirty(page);
303-
__frontswap_clear(sis, offset);
304-
}
305-
}
306285
return ret;
307286
}
308287
EXPORT_SYMBOL(__frontswap_load);

0 commit comments

Comments
 (0)