Release 4.12 include/linux/frontswap.h
#ifndef _LINUX_FRONTSWAP_H
#define _LINUX_FRONTSWAP_H
#include <linux/swap.h>
#include <linux/mm.h>
#include <linux/bitops.h>
#include <linux/jump_label.h>
struct frontswap_ops {
void (*init)(unsigned); /* this swap type was just swapon'ed */
int (*store)(unsigned, pgoff_t, struct page *); /* store a page */
int (*load)(unsigned, pgoff_t, struct page *); /* load a page */
void (*invalidate_page)(unsigned, pgoff_t); /* page no longer needed */
void (*invalidate_area)(unsigned); /* swap type just swapoff'ed */
struct frontswap_ops *next; /* private pointer to next ops */
};
extern void frontswap_register_ops(struct frontswap_ops *ops);
extern void frontswap_shrink(unsigned long);
extern unsigned long frontswap_curr_pages(void);
extern void frontswap_writethrough(bool);
#define FRONTSWAP_HAS_EXCLUSIVE_GETS
extern void frontswap_tmem_exclusive_gets(bool);
extern bool __frontswap_test(struct swap_info_struct *, pgoff_t);
extern void __frontswap_init(unsigned type, unsigned long *map);
extern int __frontswap_store(struct page *page);
extern int __frontswap_load(struct page *page);
extern void __frontswap_invalidate_page(unsigned, pgoff_t);
extern void __frontswap_invalidate_area(unsigned);
#ifdef CONFIG_FRONTSWAP
extern struct static_key_false frontswap_enabled_key;
static inline bool frontswap_enabled(void)
{
return static_branch_unlikely(&frontswap_enabled_key);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vlastimil Babka | 15 | 93.75% | 1 | 50.00% |
Bob Liu | 1 | 6.25% | 1 | 50.00% |
Total | 16 | 100.00% | 2 | 100.00% |
static inline bool frontswap_test(struct swap_info_struct *sis, pgoff_t offset)
{
return __frontswap_test(sis, offset);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 20 | 86.96% | 1 | 50.00% |
Bob Liu | 3 | 13.04% | 1 | 50.00% |
Total | 23 | 100.00% | 2 | 100.00% |
static inline void frontswap_map_set(struct swap_info_struct *p,
unsigned long *map)
{
p->frontswap_map = map;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 23 | 100.00% | 1 | 100.00% |
Total | 23 | 100.00% | 1 | 100.00% |
static inline unsigned long *frontswap_map_get(struct swap_info_struct *p)
{
return p->frontswap_map;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 19 | 100.00% | 1 | 100.00% |
Total | 19 | 100.00% | 1 | 100.00% |
#else
/* all inline routines become no-ops and all externs are ignored */
static inline bool frontswap_enabled(void)
{
return false;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vlastimil Babka | 11 | 91.67% | 1 | 50.00% |
Dan Magenheimer | 1 | 8.33% | 1 | 50.00% |
Total | 12 | 100.00% | 2 | 100.00% |
static inline bool frontswap_test(struct swap_info_struct *sis, pgoff_t offset)
{
return false;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 18 | 100.00% | 1 | 100.00% |
Total | 18 | 100.00% | 1 | 100.00% |
static inline void frontswap_map_set(struct swap_info_struct *p,
unsigned long *map)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
static inline unsigned long *frontswap_map_get(struct swap_info_struct *p)
{
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 17 | 100.00% | 1 | 100.00% |
Total | 17 | 100.00% | 1 | 100.00% |
#endif
static inline int frontswap_store(struct page *page)
{
if (frontswap_enabled())
return __frontswap_store(page);
return -1;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 20 | 74.07% | 1 | 33.33% |
Vlastimil Babka | 5 | 18.52% | 1 | 33.33% |
Konrad Rzeszutek Wilk | 2 | 7.41% | 1 | 33.33% |
Total | 27 | 100.00% | 3 | 100.00% |
static inline int frontswap_load(struct page *page)
{
if (frontswap_enabled())
return __frontswap_load(page);
return -1;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 20 | 74.07% | 1 | 33.33% |
Vlastimil Babka | 5 | 18.52% | 1 | 33.33% |
Konrad Rzeszutek Wilk | 2 | 7.41% | 1 | 33.33% |
Total | 27 | 100.00% | 3 | 100.00% |
static inline void frontswap_invalidate_page(unsigned type, pgoff_t offset)
{
if (frontswap_enabled())
__frontswap_invalidate_page(type, offset);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 24 | 96.00% | 1 | 50.00% |
Vlastimil Babka | 1 | 4.00% | 1 | 50.00% |
Total | 25 | 100.00% | 2 | 100.00% |
static inline void frontswap_invalidate_area(unsigned type)
{
if (frontswap_enabled())
__frontswap_invalidate_area(type);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 19 | 95.00% | 1 | 50.00% |
Vlastimil Babka | 1 | 5.00% | 1 | 50.00% |
Total | 20 | 100.00% | 2 | 100.00% |
static inline void frontswap_init(unsigned type, unsigned long *map)
{
#ifdef CONFIG_FRONTSWAP
__frontswap_init(type, map);
#endif
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 15 | 55.56% | 1 | 33.33% |
MinChan Kim | 7 | 25.93% | 1 | 33.33% |
Vlastimil Babka | 5 | 18.52% | 1 | 33.33% |
Total | 27 | 100.00% | 3 | 100.00% |
#endif /* _LINUX_FRONTSWAP_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dan Magenheimer | 384 | 79.67% | 2 | 25.00% |
Vlastimil Babka | 51 | 10.58% | 2 | 25.00% |
Bob Liu | 15 | 3.11% | 1 | 12.50% |
Dan Streetman | 12 | 2.49% | 1 | 12.50% |
MinChan Kim | 12 | 2.49% | 1 | 12.50% |
Konrad Rzeszutek Wilk | 8 | 1.66% | 1 | 12.50% |
Total | 482 | 100.00% | 8 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.