Commit | Line | Data |
---|---|---|
6fa3eb70 S |
1 | /* |
2 | * kernel/power/tuxonice_bio_internal.h | |
3 | * | |
4 | * Copyright (C) 2009-2010 Nigel Cunningham (nigel at tuxonice net) | |
5 | * | |
6 | * Distributed under GPLv2. | |
7 | * | |
8 | * This file contains declarations for functions exported from | |
9 | * tuxonice_bio.c, which contains low level io functions. | |
10 | */ | |
11 | ||
12 | /* Extent chains */ | |
13 | void toi_extent_state_goto_start(void); | |
14 | void toi_extent_state_save(int slot); | |
15 | int go_next_page(int writing, int section_barrier); | |
16 | void toi_extent_state_restore(int slot); | |
17 | void free_all_bdev_info(void); | |
18 | int devices_of_same_priority(struct toi_bdev_info *this); | |
19 | int toi_register_storage_chain(struct toi_bdev_info *new); | |
20 | int toi_serialise_extent_chains(void); | |
21 | int toi_load_extent_chains(void); | |
22 | int toi_bio_rw_page(int writing, struct page *page, int is_readahead, int free_group); | |
23 | int toi_bio_restore_original_signature(void); | |
24 | int toi_bio_devinfo_storage_needed(void); | |
25 | unsigned long get_headerblock(void); | |
26 | dev_t get_header_dev_t(void); | |
27 | struct block_device *get_header_bdev(void); | |
28 | int toi_bio_allocate_storage(unsigned long request); | |
29 | ||
30 | /* Signature functions */ | |
31 | #define HaveImage "HaveImage" | |
32 | #define NoImage "TuxOnIce" | |
33 | #define sig_size (sizeof(HaveImage)) | |
34 | ||
35 | struct sig_data { | |
36 | char sig[sig_size]; | |
37 | int have_image; | |
38 | int resumed_before; | |
39 | ||
40 | char have_uuid; | |
41 | char header_uuid[17]; | |
42 | dev_t header_dev_t; | |
43 | unsigned long first_header_block; | |
44 | ||
45 | /* Repeat the signature to be sure we have a header version */ | |
46 | char sig2[sig_size]; | |
47 | int header_version; | |
48 | }; | |
49 | ||
50 | void forget_signature_page(void); | |
51 | int toi_check_for_signature(void); | |
52 | int toi_bio_image_exists(int quiet); | |
53 | int get_signature_page(void); | |
54 | int toi_bio_mark_resume_attempted(int); | |
55 | extern char *toi_cur_sig_page; | |
56 | extern char *toi_orig_sig_page; | |
57 | int toi_bio_mark_have_image(void); | |
58 | extern struct sig_data *toi_sig_data; | |
59 | extern dev_t resume_dev_t; | |
60 | extern struct block_device *resume_block_device; | |
61 | extern struct block_device *header_block_device; | |
62 | extern unsigned long resume_firstblock; | |
63 | ||
64 | struct block_device *open_bdev(dev_t device, int display_errs); | |
65 | extern int current_stream; | |
66 | extern int more_readahead; | |
67 | int toi_do_io(int writing, struct block_device *bdev, long block0, | |
68 | struct page *page, int is_readahead, int syncio, int free_group); | |
69 | int get_main_pool_phys_params(void); | |
70 | ||
71 | void toi_close_bdev(struct block_device *bdev); | |
72 | struct block_device *toi_open_bdev(char *uuid, dev_t default_device, int display_errs); | |
73 | ||
74 | extern struct toi_module_ops toi_blockwriter_ops; | |
75 | void dump_block_chains(void); | |
76 | void debug_broken_header(void); | |
77 | extern unsigned long raw_pages_allocd, header_pages_reserved; | |
78 | int toi_bio_chains_debug_info(char *buffer, int size); | |
79 | void toi_bio_chains_post_atomic(struct toi_boot_kernel_data *bkd); | |
80 | int toi_bio_scan_for_image(int quiet); | |
81 | int toi_bio_get_header_version(void); | |
82 | ||
83 | void close_resume_dev_t(int force); | |
84 | int open_resume_dev_t(int force, int quiet); |