• Home
  • Raw
  • Download

Lines Matching refs:idx

416 				  unsigned int idx)  in cluster_list_add_tail()  argument
419 cluster_set_next_flag(&list->head, idx, 0); in cluster_list_add_tail()
420 cluster_set_next_flag(&list->tail, idx, 0); in cluster_list_add_tail()
431 cluster_set_next(ci_tail, idx); in cluster_list_add_tail()
433 cluster_set_next_flag(&list->tail, idx, 0); in cluster_list_add_tail()
440 unsigned int idx; in cluster_list_del_first() local
442 idx = cluster_next(&list->head); in cluster_list_del_first()
443 if (cluster_next(&list->tail) == idx) { in cluster_list_del_first()
448 cluster_next(&ci[idx]), 0); in cluster_list_del_first()
450 return idx; in cluster_list_del_first()
455 unsigned int idx) in swap_cluster_schedule_discard() argument
463 memset(si->swap_map + idx * SWAPFILE_CLUSTER, in swap_cluster_schedule_discard()
466 cluster_list_add_tail(&si->discard_clusters, si->cluster_info, idx); in swap_cluster_schedule_discard()
471 static void __free_cluster(struct swap_info_struct *si, unsigned long idx) in __free_cluster() argument
475 cluster_set_flag(ci + idx, CLUSTER_FLAG_FREE); in __free_cluster()
476 cluster_list_add_tail(&si->free_clusters, ci, idx); in __free_cluster()
486 unsigned int idx; in swap_do_scheduled_discard() local
491 idx = cluster_list_del_first(&si->discard_clusters, info); in swap_do_scheduled_discard()
494 discard_swap_cluster(si, idx * SWAPFILE_CLUSTER, in swap_do_scheduled_discard()
498 ci = lock_cluster(si, idx * SWAPFILE_CLUSTER); in swap_do_scheduled_discard()
499 __free_cluster(si, idx); in swap_do_scheduled_discard()
500 memset(si->swap_map + idx * SWAPFILE_CLUSTER, in swap_do_scheduled_discard()
517 static void alloc_cluster(struct swap_info_struct *si, unsigned long idx) in alloc_cluster() argument
521 VM_BUG_ON(cluster_list_first(&si->free_clusters) != idx); in alloc_cluster()
523 cluster_set_count_flag(ci + idx, 0, 0); in alloc_cluster()
526 static void free_cluster(struct swap_info_struct *si, unsigned long idx) in free_cluster() argument
528 struct swap_cluster_info *ci = si->cluster_info + idx; in free_cluster()
538 swap_cluster_schedule_discard(si, idx); in free_cluster()
542 __free_cluster(si, idx); in free_cluster()
552 unsigned long idx = page_nr / SWAPFILE_CLUSTER; in inc_cluster_info_page() local
556 if (cluster_is_free(&cluster_info[idx])) in inc_cluster_info_page()
557 alloc_cluster(p, idx); in inc_cluster_info_page()
559 VM_BUG_ON(cluster_count(&cluster_info[idx]) >= SWAPFILE_CLUSTER); in inc_cluster_info_page()
560 cluster_set_count(&cluster_info[idx], in inc_cluster_info_page()
561 cluster_count(&cluster_info[idx]) + 1); in inc_cluster_info_page()
572 unsigned long idx = page_nr / SWAPFILE_CLUSTER; in dec_cluster_info_page() local
577 VM_BUG_ON(cluster_count(&cluster_info[idx]) == 0); in dec_cluster_info_page()
578 cluster_set_count(&cluster_info[idx], in dec_cluster_info_page()
579 cluster_count(&cluster_info[idx]) - 1); in dec_cluster_info_page()
581 if (cluster_count(&cluster_info[idx]) == 0) in dec_cluster_info_page()
582 free_cluster(p, idx); in dec_cluster_info_page()
1007 unsigned long idx; in swap_alloc_cluster() local
1024 idx = cluster_list_first(&si->free_clusters); in swap_alloc_cluster()
1025 offset = idx * SWAPFILE_CLUSTER; in swap_alloc_cluster()
1027 alloc_cluster(si, idx); in swap_alloc_cluster()
1041 static void swap_free_cluster(struct swap_info_struct *si, unsigned long idx) in swap_free_cluster() argument
1043 unsigned long offset = idx * SWAPFILE_CLUSTER; in swap_free_cluster()
1049 free_cluster(si, idx); in swap_free_cluster()
1409 unsigned long idx = offset / SWAPFILE_CLUSTER; in put_swap_page() local
1436 swap_free_cluster(si, idx); in put_swap_page()
3120 unsigned long i, idx; in setup_swap_map_and_extents() local
3176 idx = i * SWAP_CLUSTER_COLS + j; in setup_swap_map_and_extents()
3177 if (idx >= nr_clusters) in setup_swap_map_and_extents()
3179 if (cluster_count(&cluster_info[idx])) in setup_swap_map_and_extents()
3181 cluster_set_flag(&cluster_info[idx], CLUSTER_FLAG_FREE); in setup_swap_map_and_extents()
3183 idx); in setup_swap_map_and_extents()