File: wcs_get_space.h

package info (click to toggle)
fis-gtm 6.3-007-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,284 kB
  • sloc: ansic: 328,861; asm: 5,182; csh: 5,102; sh: 1,918; awk: 291; makefile: 69; sed: 13
file content (41 lines) | stat: -rwxr-xr-x 1,642 bytes parent folder | download
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
/****************************************************************
 *								*
 * Copyright (c) 2001-2018 Fidelity National Information	*
 * Services, Inc. and/or its subsidiaries. All rights reserved.	*
 *								*
 *	This source code contains the intellectual property	*
 *	of its copyright holder(s), and is made available	*
 *	under a license.  If you do not know the terms of	*
 *	the license, please stop and do not read further.	*
 *								*
 ****************************************************************/

#ifndef WCS_GET_SPACE_H_INCLUDED
#define WCS_GET_SPACE_H_INCLUDED

#ifdef	UNIX
typedef struct wcs_conflict_trace_struct
{
	int4	wcs_active_lvl;
	int4	io_in_prog_pid;
	int4	fsync_in_prog_pid;
} wcs_conflict_trace_t;
#endif

/* Ensure that at least DB_CSH_RDPOOL_SZ buffers are not dirty by the time an update transaction completes. This guarantees
 * a minimum number of buffers are available at all times. Macro should be used whenever second arg is non-zero.
 * WBTEST_FORCE_WCS_GET_SPACE and WBTEST_FORCE_WCS_GET_SPACE_CACHEVRFY force wcs_get_space to be called, regardless of wc_in_free.
 */
#define WCS_GET_SPACE(REG, NEEDED, CR)												\
(																\
	(															\
	 (cnl->wc_in_free >= ((int4)(NEEDED) + DB_CSH_RDPOOL_SZ))								\
	 DEBUG_ONLY( && !(gtm_white_box_test_case_enabled && ((WBTEST_FORCE_WCS_GET_SPACE == gtm_white_box_test_case_number)	\
				 || (WBTEST_FORCE_WCS_GET_SPACE_CACHEVRFY == gtm_white_box_test_case_number))))			\
	)															\
	|| wcs_get_space(REG, (NEEDED) + DB_CSH_RDPOOL_SZ, CR)									\
)

bool wcs_get_space(gd_region *reg, int needed, cache_rec_ptr_t cr);

#endif