Esempio n. 1
0
/*
 * Passed an array of pages, drop them all from swapcache and then release
 * them.  They are removed from the LRU and freed if this is their last use.
 */
void free_pages_and_swap_cache(struct page **pages, int nr)
{
    struct page **pagep = pages;
    int i;

    lru_add_drain();
    for (i = 0; i < nr; i++)
        free_swap_cache(pagep[i]);
    release_pages(pagep, nr, false);
}
Esempio n. 2
0
/*
 * Passed an array of pages, drop them all from swapcache and then release
 * them.  They are removed from the LRU and freed if this is their last use.
 */
void free_pages_and_swap_cache(struct page **pages, int nr)
{
	struct page **pagep = pages;

	lru_add_drain();
	while (nr) {
		int todo = min(nr, PAGEVEC_SIZE);
		int i;

		for (i = 0; i < todo; i++)
			free_swap_cache(pagep[i]);
		release_pages(pagep, todo, 0);
		pagep += todo;
		nr -= todo;
	}
}
Esempio n. 3
0
/**
 * free_page_and_swap_cache:page从交换区高速缓存中删除
 */
void free_page_and_swap_cache(struct page *page)
{
	free_swap_cache(page);
	/*页框引用次数递减*/
	page_cache_release(page);
}
Esempio n. 4
0
/*
 * Perform a free_page(), also freeing any swap cache associated with
 * this page if it is the last user of the page.
 */
void free_page_and_swap_cache(struct page *page)
{
    free_swap_cache(page);
    put_page(page);
}
Esempio n. 5
0
/* 
 * Perform a free_page(), also freeing any swap cache associated with
 * this page if it is the last user of the page.
 */
void free_page_and_swap_cache(struct page *page)
{
	free_swap_cache(page);
	page_cache_release(page);
}
Esempio n. 6
0
/* 
 * Perform a free_page(), also freeing any swap cache associated with
 * this page if it is the last user of the page.
 */
void free_page_and_swap_cache(struct page *page)
{
	free_swap_cache(page);
	if (!is_huge_zero_page(page))
		put_page(page);
}