blob: 20111cbf7f0b9886d28a19eabe5ad49246712ca4 (
plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/***********************************************************************
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
***********************************************************************/
/**************************************************//**
@file os0api.h
The interface to the helper functions.
These functions are used on os0file.h where
including full full header is not feasible and
implemented on buf0buf.cc and fil0fil.cc.
*******************************************************/
#ifndef OS_API_H
#define OS_API_H 1
/** Page control block */
class buf_page_t;
/** File Node */
struct fil_node_t;
/**
Should we punch hole to deallocate unused portion of the page.
@param[in] bpage Page control block
@return true if punch hole should be used, false if not */
bool
buf_page_should_punch_hole(
const buf_page_t* bpage)
MY_ATTRIBUTE((warn_unused_result));
/**
Calculate the length of trim (punch_hole) operation.
@param[in] bpage Page control block
@param[in] write_length Write length
@return length of the trim or zero. */
ulint
buf_page_get_trim_length(
const buf_page_t* bpage,
ulint write_length)
MY_ATTRIBUTE((warn_unused_result));
#endif /* OS_API_H */
|