cregit-Linux how code gets into the kernel

Release 4.12 include/linux/frontswap.h

Directory: include/linux
#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

PersonTokensPropCommitsCommitProp
Vlastimil Babka1593.75%150.00%
Bob Liu16.25%150.00%
Total16100.00%2100.00%


static inline bool frontswap_test(struct swap_info_struct *sis, pgoff_t offset) { return __frontswap_test(sis, offset); }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer2086.96%150.00%
Bob Liu313.04%150.00%
Total23100.00%2100.00%


static inline void frontswap_map_set(struct swap_info_struct *p, unsigned long *map) { p->frontswap_map = map; }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer23100.00%1100.00%
Total23100.00%1100.00%


static inline unsigned long *frontswap_map_get(struct swap_info_struct *p) { return p->frontswap_map; }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer19100.00%1100.00%
Total19100.00%1100.00%

#else /* all inline routines become no-ops and all externs are ignored */
static inline bool frontswap_enabled(void) { return false; }

Contributors

PersonTokensPropCommitsCommitProp
Vlastimil Babka1191.67%150.00%
Dan Magenheimer18.33%150.00%
Total12100.00%2100.00%


static inline bool frontswap_test(struct swap_info_struct *sis, pgoff_t offset) { return false; }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer18100.00%1100.00%
Total18100.00%1100.00%


static inline void frontswap_map_set(struct swap_info_struct *p, unsigned long *map) { }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer16100.00%1100.00%
Total16100.00%1100.00%


static inline unsigned long *frontswap_map_get(struct swap_info_struct *p) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer17100.00%1100.00%
Total17100.00%1100.00%

#endif
static inline int frontswap_store(struct page *page) { if (frontswap_enabled()) return __frontswap_store(page); return -1; }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer2074.07%133.33%
Vlastimil Babka518.52%133.33%
Konrad Rzeszutek Wilk27.41%133.33%
Total27100.00%3100.00%


static inline int frontswap_load(struct page *page) { if (frontswap_enabled()) return __frontswap_load(page); return -1; }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer2074.07%133.33%
Vlastimil Babka518.52%133.33%
Konrad Rzeszutek Wilk27.41%133.33%
Total27100.00%3100.00%


static inline void frontswap_invalidate_page(unsigned type, pgoff_t offset) { if (frontswap_enabled()) __frontswap_invalidate_page(type, offset); }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer2496.00%150.00%
Vlastimil Babka14.00%150.00%
Total25100.00%2100.00%


static inline void frontswap_invalidate_area(unsigned type) { if (frontswap_enabled()) __frontswap_invalidate_area(type); }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer1995.00%150.00%
Vlastimil Babka15.00%150.00%
Total20100.00%2100.00%


static inline void frontswap_init(unsigned type, unsigned long *map) { #ifdef CONFIG_FRONTSWAP __frontswap_init(type, map); #endif }

Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer1555.56%133.33%
MinChan Kim725.93%133.33%
Vlastimil Babka518.52%133.33%
Total27100.00%3100.00%

#endif /* _LINUX_FRONTSWAP_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Dan Magenheimer38479.67%225.00%
Vlastimil Babka5110.58%225.00%
Bob Liu153.11%112.50%
Dan Streetman122.49%112.50%
MinChan Kim122.49%112.50%
Konrad Rzeszutek Wilk81.66%112.50%
Total482100.00%8100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.