- 论坛徽章:
- 0
|
810 static inline struct address_space *page_mapping(struct page *page)
811 {
812 struct address_space *mapping = page->mapping;
813
814 VM_BUG_ON(PageSlab(page));
815 if (unlikely(PageSwapCache(page)))
816 mapping = &swapper_space;
817 else if ((unsigned long)mapping & PAGE_MAPPING_ANON)
818 mapping = NULL;
819 return mapping;
820 }
&swapper_space; 只有一个全局的这个结构。
40 struct address_space swapper_space = {
41 .page_tree = RADIX_TREE_INIT(GFP_ATOMIC|__GFP_NOWARN),
42 .tree_lock = __SPIN_LOCK_UNLOCKED(swapper_space.tree_lock),
43 .a_ops = &swap_aops,
44 .i_mmap_nonlinear = LIST_HEAD_INIT(swapper_space.i_mmap_nonlinear),
45 .backing_dev_info = &swap_backing_dev_info,
46 };
47
|
|