aboutsummaryrefslogtreecommitdiff
path: root/kernel/power/tuxonice_pageflags.c
blob: 22cd8699fc50b0116d9a82ac7e7e4444f3a59193 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * kernel/power/tuxonice_pageflags.c
 *
 * Copyright (C) 2004-2010 Nigel Cunningham (nigel at tuxonice net)
 *
 * This file is released under the GPLv2.
 *
 * Routines for serialising and relocating pageflags in which we
 * store our image metadata.
 */

#include <linux/list.h>
#include <linux/module.h>
#include "tuxonice_pageflags.h"
#include "power.h"

int toi_pageflags_space_needed(void)
{
	int total = 0;
	struct bm_block *bb;

	total = sizeof(unsigned int);

	list_for_each_entry(bb, &pageset1_map->blocks, hook)
	    total += 2 * sizeof(unsigned long) + PAGE_SIZE;

	return total;
}
EXPORT_SYMBOL_GPL(toi_pageflags_space_needed);