Server IP : 85.214.239.14 / Your IP : 3.144.98.61 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/cwd/proc/self/root/usr/include/postgresql/9.6/server/storage/ |
Upload File : |
/*------------------------------------------------------------------------- * * fsm_internal.h * internal functions for free space map * * * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/fsm_internals.h * *------------------------------------------------------------------------- */ #ifndef FSM_INTERNALS_H #define FSM_INTERNALS_H #include "storage/buf.h" #include "storage/bufpage.h" /* * Structure of a FSM page. See src/backend/storage/freespace/README for * details. */ typedef struct { /* * fsm_search_avail() tries to spread the load of multiple backends by * returning different pages to different backends in a round-robin * fashion. fp_next_slot points to the next slot to be returned (assuming * there's enough space on it for the request). It's defined as an int, * because it's updated without an exclusive lock. uint16 would be more * appropriate, but int is more likely to be atomically * fetchable/storable. */ int fp_next_slot; /* * fp_nodes contains the binary tree, stored in array. The first * NonLeafNodesPerPage elements are upper nodes, and the following * LeafNodesPerPage elements are leaf nodes. Unused nodes are zero. */ uint8 fp_nodes[FLEXIBLE_ARRAY_MEMBER]; } FSMPageData; typedef FSMPageData *FSMPage; /* * Number of non-leaf and leaf nodes, and nodes in total, on an FSM page. * These definitions are internal to fsmpage.c. */ #define NodesPerPage (BLCKSZ - MAXALIGN(SizeOfPageHeaderData) - \ offsetof(FSMPageData, fp_nodes)) #define NonLeafNodesPerPage (BLCKSZ / 2 - 1) #define LeafNodesPerPage (NodesPerPage - NonLeafNodesPerPage) /* * Number of FSM "slots" on a FSM page. This is what should be used * outside fsmpage.c. */ #define SlotsPerFSMPage LeafNodesPerPage /* Prototypes for functions in fsmpage.c */ extern int fsm_search_avail(Buffer buf, uint8 min_cat, bool advancenext, bool exclusive_lock_held); extern uint8 fsm_get_avail(Page page, int slot); extern uint8 fsm_get_max_avail(Page page); extern bool fsm_set_avail(Page page, int slot, uint8 value); extern bool fsm_truncate_avail(Page page, int nslots); extern bool fsm_rebuild_page(Page page); #endif /* FSM_INTERNALS_H */