Lines Matching refs:sis
161 static inline struct swap_extent *first_se(struct swap_info_struct *sis) in first_se() argument
163 struct rb_node *rb = rb_first(&sis->swap_extent_root); in first_se()
211 offset_to_swap_extent(struct swap_info_struct *sis, unsigned long offset) in offset_to_swap_extent() argument
216 rb = sis->swap_extent_root.rb_node; in offset_to_swap_extent()
232 struct swap_info_struct *sis = page_swap_info(page); in swap_page_sector() local
238 se = offset_to_swap_extent(sis, offset); in swap_page_sector()
1653 struct swap_info_struct *sis = swap_info[type]; in swap_type_of() local
1655 if (!(sis->flags & SWP_WRITEOK)) in swap_type_of()
1658 if (device == sis->bdev->bd_dev) { in swap_type_of()
1659 struct swap_extent *se = first_se(sis); in swap_type_of()
1677 struct swap_info_struct *sis = swap_info[type]; in find_first_swap() local
1679 if (!(sis->flags & SWP_WRITEOK)) in find_first_swap()
1681 *device = sis->bdev->bd_dev; in find_first_swap()
1716 struct swap_info_struct *sis = swap_info[type]; in count_swap_pages() local
1718 spin_lock(&sis->lock); in count_swap_pages()
1719 if (sis->flags & SWP_WRITEOK) { in count_swap_pages()
1720 n = sis->pages; in count_swap_pages()
1722 n -= sis->inuse_pages; in count_swap_pages()
1724 spin_unlock(&sis->lock); in count_swap_pages()
2157 static void destroy_swap_extents(struct swap_info_struct *sis) in destroy_swap_extents() argument
2159 while (!RB_EMPTY_ROOT(&sis->swap_extent_root)) { in destroy_swap_extents()
2160 struct rb_node *rb = sis->swap_extent_root.rb_node; in destroy_swap_extents()
2163 rb_erase(rb, &sis->swap_extent_root); in destroy_swap_extents()
2167 if (sis->flags & SWP_ACTIVATED) { in destroy_swap_extents()
2168 struct file *swap_file = sis->swap_file; in destroy_swap_extents()
2171 sis->flags &= ~SWP_ACTIVATED; in destroy_swap_extents()
2184 add_swap_extent(struct swap_info_struct *sis, unsigned long start_page, in add_swap_extent() argument
2187 struct rb_node **link = &sis->swap_extent_root.rb_node, *parent = NULL; in add_swap_extent()
2219 rb_insert_color(&new_se->rb_node, &sis->swap_extent_root); in add_swap_extent()
2251 static int setup_swap_extents(struct swap_info_struct *sis, sector_t *span) in setup_swap_extents() argument
2253 struct file *swap_file = sis->swap_file; in setup_swap_extents()
2259 ret = add_swap_extent(sis, 0, sis->max, 0); in setup_swap_extents()
2260 *span = sis->pages; in setup_swap_extents()
2265 ret = mapping->a_ops->swap_activate(sis, swap_file, span); in setup_swap_extents()
2268 sis->flags |= SWP_ACTIVATED; in setup_swap_extents()
2269 if ((sis->flags & SWP_FS_OPS) && in setup_swap_extents()
2271 destroy_swap_extents(sis); in setup_swap_extents()
2277 return generic_swapfile_activate(sis, swap_file, span); in setup_swap_extents()