0001
0002 #ifndef _LINUX_SECRETMEM_H
0003 #define _LINUX_SECRETMEM_H
0004
0005 #ifdef CONFIG_SECRETMEM
0006
0007 extern const struct address_space_operations secretmem_aops;
0008
0009 static inline bool page_is_secretmem(struct page *page)
0010 {
0011 struct address_space *mapping;
0012
0013
0014
0015
0016
0017
0018
0019
0020 if (PageCompound(page) || !PageLRU(page))
0021 return false;
0022
0023 mapping = (struct address_space *)
0024 ((unsigned long)page->mapping & ~PAGE_MAPPING_FLAGS);
0025
0026 if (!mapping || mapping != page->mapping)
0027 return false;
0028
0029 return mapping->a_ops == &secretmem_aops;
0030 }
0031
0032 bool vma_is_secretmem(struct vm_area_struct *vma);
0033 bool secretmem_active(void);
0034
0035 #else
0036
0037 static inline bool vma_is_secretmem(struct vm_area_struct *vma)
0038 {
0039 return false;
0040 }
0041
0042 static inline bool page_is_secretmem(struct page *page)
0043 {
0044 return false;
0045 }
0046
0047 static inline bool secretmem_active(void)
0048 {
0049 return false;
0050 }
0051
0052 #endif
0053
0054 #endif