Lines Matching refs:sis

279 static inline struct swap_extent *first_se(struct swap_info_struct *sis)
281 struct rb_node *rb = rb_first(&sis->swap_extent_root);
329 offset_to_swap_extent(struct swap_info_struct *sis, unsigned long offset)
334 rb = sis->swap_extent_root.rb_node;
350 struct swap_info_struct *sis = swp_swap_info(folio->swap);
356 se = offset_to_swap_extent(sis, offset);
1595 struct swap_info_struct *sis;
1598 sis = _swap_info_get(entry);
1599 if (!sis)
1604 swap_entries_put_map(sis, swp_entry(sis->type, offset), nr);
1897 struct swap_info_struct *sis = swap_info[type];
1899 if (!(sis->flags & SWP_WRITEOK))
1902 if (device == sis->bdev->bd_dev) {
1903 struct swap_extent *se = first_se(sis);
1921 struct swap_info_struct *sis = swap_info[type];
1923 if (!(sis->flags & SWP_WRITEOK))
1925 *device = sis->bdev->bd_dev;
1960 struct swap_info_struct *sis = swap_info[type];
1962 spin_lock(&sis->lock);
1963 if (sis->flags & SWP_WRITEOK) {
1964 n = sis->pages;
1966 n -= swap_usage_in_pages(sis);
1968 spin_unlock(&sis->lock);
2415 static void destroy_swap_extents(struct swap_info_struct *sis)
2417 while (!RB_EMPTY_ROOT(&sis->swap_extent_root)) {
2418 struct rb_node *rb = sis->swap_extent_root.rb_node;
2421 rb_erase(rb, &sis->swap_extent_root);
2425 if (sis->flags & SWP_ACTIVATED) {
2426 struct file *swap_file = sis->swap_file;
2429 sis->flags &= ~SWP_ACTIVATED;
2442 add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
2445 struct rb_node **link = &sis->swap_extent_root.rb_node, *parent = NULL;
2477 rb_insert_color(&new_se->rb_node, &sis->swap_extent_root);
2509 static int setup_swap_extents(struct swap_info_struct *sis, sector_t *span)
2511 struct file *swap_file = sis->swap_file;
2517 ret = add_swap_extent(sis, 0, sis->max, 0);
2518 *span = sis->pages;
2523 ret = mapping->a_ops->swap_activate(sis, swap_file, span);
2526 sis->flags |= SWP_ACTIVATED;
2527 if ((sis->flags & SWP_FS_OPS) &&
2529 destroy_swap_extents(sis);
2535 return generic_swapfile_activate(sis, swap_file, span);