1
/* Copyright 2008 Sun Microsystems, Inc.
2
All rights reserved. Use is subject to license terms.
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; version 2 of the License.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License
14
along with this program; if not, write to the Free Software
15
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
17
#ifndef NDB_LS_IMPL_HPP
18
#define NDB_LS_IMPL_HPP
20
#include "LongSignal.hpp"
22
#ifdef NDBD_MULTITHREADED
24
#define SPC_ARG SectionSegmentPool::Cache& cache,
25
#define SPC_SEIZE_ARG f_section_lock, cache,
26
#define SPC_CACHE_ARG cache,
28
SectionSegmentPool::LockFun
40
/* Calculate number of segments to release based on section size
41
* Always release one segment, even if size is zero
43
#define relSz(x) ((x == 0)? 1 : ((x + SectionSegment::DataLength - 1) / SectionSegment::DataLength))
45
bool import(SPC_ARG Ptr<SectionSegment> & first, const Uint32 * src, Uint32 len);
47
/* appendToSection : If firstSegmentIVal == RNIL, import */
48
bool appendToSection(SPC_ARG Uint32& firstSegmentIVal, const Uint32* src, Uint32 len);
49
/* dupSection : Create new section as copy of src section */
50
bool dupSection(SPC_ARG Uint32& copyFirstIVal, Uint32 srcFirstIVal);
51
/* writeToSection : Overwrite section from offset with data. */
52
bool writeToSection(Uint32 firstSegmentIVal, Uint32 offset, const Uint32* src, Uint32 len);
54
void release(SPC_ARG SegmentedSectionPtr & ptr);
55
void releaseSection(SPC_ARG Uint32 firstSegmentIVal);