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