1/******************************************************
2XtraBackup: hot backup tool for InnoDB
3(c) 2009-2012 Percona Inc.
4Originally Created 3/3/2009 Yasufumi Kinoshita
5Written by Alexey Kopytov, Aleksandr Kuzminsky, Stewart Smith, Vadim Tkachenko,
6Yasufumi Kinoshita, Ignacio Nin and Baron Schwartz.
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; version 2 of the License.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20
21*******************************************************/
22
23/* Changed page bitmap interface */
24
25#ifndef XB_CHANGED_PAGE_BITMAP_H
26#define XB_CHANGED_PAGE_BITMAP_H
27
28#include <ut0rbt.h>
29#include <fil0fil.h>
30
31/* The changed page bitmap structure */
32typedef ib_rbt_t xb_page_bitmap;
33
34struct xb_page_bitmap_range_struct;
35
36/* The bitmap range iterator over one space id */
37typedef struct xb_page_bitmap_range_struct xb_page_bitmap_range;
38
39/****************************************************************//**
40Read the disk bitmap and build the changed page bitmap tree for the
41LSN interval incremental_lsn to checkpoint_lsn_start.
42
43@return the built bitmap tree */
44xb_page_bitmap*
45xb_page_bitmap_init(void);
46/*=====================*/
47
48/****************************************************************//**
49Free the bitmap tree. */
50void
51xb_page_bitmap_deinit(
52/*==================*/
53 xb_page_bitmap* bitmap); /*!<in/out: bitmap tree */
54
55
56/****************************************************************//**
57Set up a new bitmap range iterator over a given space id changed
58pages in a given bitmap.
59
60@return bitmap range iterator */
61xb_page_bitmap_range*
62xb_page_bitmap_range_init(
63/*======================*/
64 xb_page_bitmap* bitmap, /*!< in: bitmap to iterate over */
65 ulint space_id); /*!< in: space id */
66
67/****************************************************************//**
68Get the next page id that has its bit set or cleared, i.e. equal to
69bit_value.
70
71@return page id */
72ulint
73xb_page_bitmap_range_get_next_bit(
74/*==============================*/
75 xb_page_bitmap_range* bitmap_range, /*!< in/out: bitmap range */
76 ibool bit_value); /*!< in: bit value */
77
78/****************************************************************//**
79Free the bitmap range iterator. */
80void
81xb_page_bitmap_range_deinit(
82/*========================*/
83 xb_page_bitmap_range* bitmap_range); /*! in/out: bitmap range */
84
85#endif
86