1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
19
#include <ndbd_exit_codes.h>
20
#include "SignalData.hpp"
23
* FsRef - Common signal class for all REF signals sent from Ndbfs
24
* GSN_FSCLOSEREF, GSN_FSOPENREF, GSN_FSWRITEREF, GSN_FSREADREF,
36
friend bool printFSREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
39
* Enum type for errorCode
41
STATIC_CONST( FS_ERR_BIT = 0x8000 );
43
enum NdbfsErrorCodeType {
45
fsErrEnvironmentError=NDBD_EXIT_AFS_ENVIRONMENT,
46
fsErrTemporaryNotAccessible=NDBD_EXIT_AFS_TEMP_NO_ACCESS,
47
fsErrNoSpaceLeftOnDevice=NDBD_EXIT_AFS_DISK_FULL,
48
fsErrPermissionDenied=NDBD_EXIT_AFS_PERMISSION_DENIED,
49
fsErrInvalidParameters=NDBD_EXIT_AFS_INVALID_PARAM,
50
fsErrUnknown=NDBD_EXIT_AFS_UNKNOWN,
51
fsErrNoMoreResources=NDBD_EXIT_AFS_NO_MORE_RESOURCES,
52
fsErrFileDoesNotExist=NDBD_EXIT_AFS_NO_SUCH_FILE,
53
fsErrReadUnderflow = NDBD_EXIT_AFS_READ_UNDERFLOW,
54
fsErrFileExists = FS_ERR_BIT | 12,
55
fsErrInvalidFileSize = FS_ERR_BIT | 13,
56
fsErrOutOfMemory = FS_ERR_BIT | 14,
62
STATIC_CONST( SignalLength = 4 );
67
UintR userPointer; // DATA 0
68
UintR errorCode; // DATA 1
69
UintR osErrorCode; // DATA 2
72
static NdbfsErrorCodeType getErrorCode(const UintR & errorcode);
73
static void setErrorCode(UintR & errorcode, NdbfsErrorCodeType errorcodetype);
74
static void setErrorCode(UintR & errorcode, UintR errorcodetype);
80
FsRef::NdbfsErrorCodeType
81
FsRef::getErrorCode(const UintR & errorcode){
82
return (NdbfsErrorCodeType)errorcode;
87
FsRef::setErrorCode(UintR & errorcode, NdbfsErrorCodeType errorcodetype){
88
ASSERT_MAX(errorcodetype, fsErrMax, "FsRef::setErrorCode");
89
errorcode = (UintR)errorcodetype;
94
FsRef::setErrorCode(UintR & errorcode, UintR errorcodetype){
95
ASSERT_MAX(errorcodetype, fsErrMax, "FsRef::setErrorCode");
96
errorcode = errorcodetype;