Lines Matching refs:sis
162 static inline struct swap_extent *first_se(struct swap_info_struct *sis)
164 struct rb_node *rb = rb_first(&sis->swap_extent_root);
212 offset_to_swap_extent(struct swap_info_struct *sis, unsigned long offset)
217 rb = sis->swap_extent_root.rb_node;
233 struct swap_info_struct *sis = page_swap_info(page);
239 se = offset_to_swap_extent(sis, offset);
1665 struct swap_info_struct *sis = swap_info[type];
1667 if (!(sis->flags & SWP_WRITEOK))
1670 if (device == sis->bdev->bd_dev) {
1671 struct swap_extent *se = first_se(sis);
1689 struct swap_info_struct *sis = swap_info[type];
1691 if (!(sis->flags & SWP_WRITEOK))
1693 *device = sis->bdev->bd_dev;
1728 struct swap_info_struct *sis = swap_info[type];
1730 spin_lock(&sis->lock);
1731 if (sis->flags & SWP_WRITEOK) {
1732 n = sis->pages;
1734 n -= sis->inuse_pages;
1736 spin_unlock(&sis->lock);
2169 static void destroy_swap_extents(struct swap_info_struct *sis)
2171 while (!RB_EMPTY_ROOT(&sis->swap_extent_root)) {
2172 struct rb_node *rb = sis->swap_extent_root.rb_node;
2175 rb_erase(rb, &sis->swap_extent_root);
2179 if (sis->flags & SWP_ACTIVATED) {
2180 struct file *swap_file = sis->swap_file;
2183 sis->flags &= ~SWP_ACTIVATED;
2196 add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
2199 struct rb_node **link = &sis->swap_extent_root.rb_node, *parent = NULL;
2231 rb_insert_color(&new_se->rb_node, &sis->swap_extent_root);
2263 static int setup_swap_extents(struct swap_info_struct *sis, sector_t *span)
2265 struct file *swap_file = sis->swap_file;
2271 ret = add_swap_extent(sis, 0, sis->max, 0);
2272 *span = sis->pages;
2277 ret = mapping->a_ops->swap_activate(sis, swap_file, span);
2280 sis->flags |= SWP_ACTIVATED;
2281 if ((sis->flags & SWP_FS_OPS) &&
2283 destroy_swap_extents(sis);
2289 return generic_swapfile_activate(sis, swap_file, span);