2
Copyright (C) 2003, 2005, 2006 MySQL AB
3
All rights reserved. Use is subject to license terms.
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
#include <ndbd_exit_codes.h>
23
#include "SignalData.hpp"
26
* FsRef - Common signal class for all REF signals sent from Ndbfs
27
* GSN_FSCLOSEREF, GSN_FSOPENREF, GSN_FSWRITEREF, GSN_FSREADREF,
39
friend bool printFSREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
42
* Enum type for errorCode
44
STATIC_CONST( FS_ERR_BIT = 0x8000 );
46
enum NdbfsErrorCodeType {
48
fsErrEnvironmentError=NDBD_EXIT_AFS_ENVIRONMENT,
49
fsErrTemporaryNotAccessible=NDBD_EXIT_AFS_TEMP_NO_ACCESS,
50
fsErrNoSpaceLeftOnDevice=NDBD_EXIT_AFS_DISK_FULL,
51
fsErrPermissionDenied=NDBD_EXIT_AFS_PERMISSION_DENIED,
52
fsErrInvalidParameters=NDBD_EXIT_AFS_INVALID_PARAM,
53
fsErrUnknown=NDBD_EXIT_AFS_UNKNOWN,
54
fsErrNoMoreResources=NDBD_EXIT_AFS_NO_MORE_RESOURCES,
55
fsErrFileDoesNotExist=NDBD_EXIT_AFS_NO_SUCH_FILE,
56
fsErrReadUnderflow = NDBD_EXIT_AFS_READ_UNDERFLOW,
57
fsErrFileExists = FS_ERR_BIT | 12,
58
fsErrInvalidFileSize = FS_ERR_BIT | 13,
59
fsErrOutOfMemory = FS_ERR_BIT | 14,
65
STATIC_CONST( SignalLength = 4 );
70
UintR userPointer; // DATA 0
71
UintR errorCode; // DATA 1
72
UintR osErrorCode; // DATA 2
75
static NdbfsErrorCodeType getErrorCode(const UintR & errorcode);
76
static void setErrorCode(UintR & errorcode, NdbfsErrorCodeType errorcodetype);
77
static void setErrorCode(UintR & errorcode, UintR errorcodetype);
83
FsRef::NdbfsErrorCodeType
84
FsRef::getErrorCode(const UintR & errorcode){
85
return (NdbfsErrorCodeType)errorcode;
90
FsRef::setErrorCode(UintR & errorcode, NdbfsErrorCodeType errorcodetype){
91
ASSERT_MAX(errorcodetype, fsErrMax, "FsRef::setErrorCode");
92
errorcode = (UintR)errorcodetype;
97
FsRef::setErrorCode(UintR & errorcode, UintR errorcodetype){
98
ASSERT_MAX(errorcodetype, fsErrMax, "FsRef::setErrorCode");
99
errorcode = errorcodetype;