Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

ven54.c File Reference


Detailed Description

Disk IO: Kernel IO Routines and Threads.

Author:
JoergM
See also:

Definition in file ven54.c.

#include "gen00.h"
#include "heo00.h"
#include "heo52.h"
#include "geo50_0.h"
#include "gen500.h"
#include "geo54.h"
#include "gen54.h"
#include "heo54k.h"
#include "geo00_2.h"
#include "heo46.h"
#include "gen41.h"
#include "gen541.h"
#include "geo57.h"
#include "heo58.h"
#include "gen71.h"
#include "gen72.h"
#include "gen75.h"
#include "heo07.h"
#include "gen81.h"
#include "gen88.h"
#include "hen40.h"
#include "geo001.h"
#include "RunTime/InputOutput/RTEIO_DevSpaceInfo.h"
#include "RunTime/System/RTESys_MicroTime.h"
#include "RunTime/Configuration/RTEConf_ParameterAccessKernelInterface.h"
#include "RunTime/RTE_saveUNIXcalls.h"
#include "RunTime/HotStandbyStorage/RTEHSS_PascalInterface.h"

Go to the source code of this file.

Classes

struct  ALIGNED_MEM
struct  DEV_CNTL_INFO
struct  en54_open_arg

Defines

#define BEYOND_END_OF_VOLUME   "Cannot read behind end of volume"
#define COLSIZE   64
#define DEFAULT_OPEN_MODE_EN54   ( 0 )
#define DEVIO_ERR_ALRATT   3
#define DEVIO_ERR_CLOSE   16
#define DEVIO_ERR_DEVCONTROL   13
#define DEVIO_ERR_DEVICREA   1
#define DEVIO_ERR_DEVIJCREA   4
#define DEVIO_ERR_DEVSUPPORT   14
#define DEVIO_ERR_FILESTAT   12
#define DEVIO_ERR_FILETYPE   11
#define DEVIO_ERR_INVALID_DEVNO   17
#define DEVIO_ERR_INVPNO   7
#define DEVIO_ERR_LOCK   8
#define DEVIO_ERR_MALLOC   15
#define DEVIO_ERR_MAXDEVNO   2
#define DEVIO_ERR_OPEN   0
#define DEVIO_ERR_PAGE_0   10
#define DEVIO_ERR_SERE   6
#define DEVIO_ERR_SEWR   5
#define DEVIO_ERR_USER_REQ   9
#define DEVIO_MAX_ERR_NR   18
#define EN54_FSTAT_PIPE_CHECK_CODE_OK   1
#define EN54_NO_PIPE_CHECK_CODE_TESTED   0
#define EN54_NO_PIPE_CHECK_CODE_WORKING   3
#define EN54_POLL_PIPE_CHECK_CODE_OK   2
#define EN54_SMALL_MESSAGE_BUFFER_SIZE   256
#define EN54_TEST_DONE_FILE   "/ckeckdone_"
#define EN54_TEST_PIPE_CONTENT   "Testing pipe code"
#define EN54_TEST_PIPE_NAME   "/pipecheck_"
#define FILE_SYSTEM_FULL   "I am sorry, but no space left on device"
#define FORMAT_IO_STAT_BLOCKS_WRITTEN_LIMIT_EN54   16
#define getminor(dev)   (dev % 256)
#define INFO_TEST_WILDCARD   11809,3,"TEST ","%s"
#define IO_LIMIT   10
#define IS_TAPE(_hostfileno)   ( _hostfileno >= KGS->maxdevspaces * 2 )
#define IS_TRACE_DEV(_devno)   (_devno == 0 )
#define MAX_PIPE_CHECK_WAIT_TIME_EN54   30
#define MAX_VDETACH_WAIT_TIME   30
#define MF__   MOD__"en54_WaitForSelfIOCompletionAndClose"
#define MF__   MOD__"en54FindPipeCheckAlgorithm"
#define MF__   MOD__"vdualvectorio"
#define MF__   MOD__"vcopyvolume"
#define MF__   MOD__"vvectorio"
#define MF__   MOD__"en81DumpNewRteDumpOnly"
#define MF__   MOD__"vdump_rte"
#define MF__   MOD__"en54RteDumpFile"
#define MF__   MOD__"en54RteDumpFile"
#define MF__   MOD__"en54_StatFileType"
#define MF__   MOD__"e54_checkForTape"
#define MF__   MOD__"e54_genericNorewindTest"
#define MF__   MOD__"en54_Rewind"
#define MF__   MOD__"en54_AllocAligned"
#define MF__   MOD__"en54_ValidHostfile"
#define MF__   MOD__"en54_RequestToUKT"
#define MF__   MOD__"en54_RequestToDevi"
#define MF__   MOD__"en54_RequestToDev0"
#define MF__   MOD__"e54_int_to_text"
#define MF__   MOD__"en54_SimulateSingleVectorIO"
#define MF__   MOD__"en54_SingleVectorIO"
#define MF__   MOD__"en54_SingleBlockIO"
#define MF__   MOD__"e54_init_self_io"
#define MF__   MOD__"en54_CloseSingleFilescs"
#define MF__   MOD__"en54_FormatDevspace"
#define MF__   MOD__"en54_NewDevsize"
#define MF__   MOD__"en54_RawDiskVdevsize"
#define MF__   MOD__"en54_RegularFileVdevsize"
#define MF__   MOD__"en54_ValidateReadOnlyVolumeSize"
#define MF__   MOD__"en54_InitializeDevspace"
#define MF__   MOD__"en54_FindAsyncDevpcb"
#define MF__   MOD__"en54_FindDevpcb"
#define MF__   MOD__"en54_dev0Receive"
#define MF__   MOD__"en54_DevOpen"
#define MF__   MOD__"en54_SimulateDiskIOWriteVector"
#define MF__   MOD__"en54_DiskIOWriteVector"
#define MF__   MOD__"en54_DiskIOWrite"
#define MF__   MOD__"en54_DiskIORead"
#define MF__   MOD__"en54_DeviAsynioReadBlock"
#define MF__   MOD__"en54_ReadBlock"
#define MF__   MOD__"en54_Page0IO"
#define MF__   MOD__"en54_DeviMain"
#define MF__   MOD__"en54_Dev0Main"
#define MF__   MOD__"en54_WrongCall"
#define MF__   MOD__"en54_DeviVdetach"
#define MF__   MOD__"en54_Dev0Vdetach"
#define MF__   MOD__"devi_asyncntl"
#define MF__   MOD__"devi_asynio"
#define MF__   MOD__"en54_DeviVmarkBadDev"
#define MF__   MOD__"en54_DeviVVectorio"
#define MF__   MOD__"en54_DeviVblockio"
#define MF__   MOD__"en54_OpenAsyncDevice"
#define MF__   MOD__"en54_IsExistingPipe"
#define MF__   MOD__"en54_ResetNonBlockingFlag"
#define MF__   MOD__"en54_DeviVasynopen"
#define MF__   MOD__"en54_Dev0Vasynopen"
#define MF__   MOD__"en54_Mdevi_main"
#define MF__   MOD__"en54_DeviVattach"
#define MF__   MOD__"en54_Dev0Vattach"
#define MF__   MOD__"en54_find_device_no"
#define MF__   MOD__"en54_Mdevio"
#define MF__   MOD__"vasyninit_tape"
#define MF__   MOD__"vasynwait"
#define MF__   MOD__"vasynio"
#define MF__   MOD__"vasynclose_old"
#define MF__   MOD__"vasynclose"
#define MF__   MOD__"vasynopen"
#define MF__   MOD__"vblockio"
#define MF__   MOD__"vget_data_io_cnt"
#define MF__   MOD__"vdetach"
#define MF__   MOD__"vattach"
#define MF__   MOD__"vdevsize"
#define MF__   MOD__"vdevsizeWithImage"
#define MOD__   "ven54.c:"
#define NO_PRIO   0
#define NO_REPLY_WANTED_EN54   (-1)
#define OK   0
#define SAPDB_IOV_LIMIT   16
#define SET_DEVSP_WAITING_FOR(_Task, _Devno)
#define TAPE_AIX   4
#define TAPE_ATT   3
#define TAPE_MTIO_H   1
#define TAPE_SCO   2
#define VB_NO_MORE_FILES   2
#define VB_NOTOK   0
#define VB_OK   1
#define WRN_TEST_WILDCARD   11809,2,"TEST ","%s"

Functions

static void devi_asyncntl (struct DOUBLY_LINKED *request, struct DEV_PCB *devi_pcb, SAPDB_Int fd)
static void devi_asynio (struct DOUBLY_LINKED *request, struct DEV_PCB *devi_pcb, SAPDB_Int fd)
SAPDB_Int e54_asyn_vasynio (struct DOUBLY_LINKED *request, tsp00_ErrText errtext)
SAPDB_Int e54_asyn_vblockio (struct DOUBLY_LINKED *request, tsp00_ErrText errtext)
static tsp00_VfType e54_checkForTape (struct DEV_CNTL_INFO *devCntlInfo, SAPDB_UInt4 *errcode)
static tsp00_VfType e54_genericNorewindTest (struct DEV_CNTL_INFO *devCntlInfo, SAPDB_UInt4 *errcode)
externC SAPDB_Int e54_init_self_io (ten50_UKT_Control *this_ukt, SAPDB_Int4 devno, tsp00_PageNo devpno, tsp2_io_op_code op_code, SAPDB_Int *fd, tsp00_ErrText errtext)
void e54_int_to_text (SAPDB_Int io_err, tsp00_ErrText errtext)
static SAPDB_Int en54_AddSynchronousOpen ()
static UCHAR * en54_AllocAligned (struct ALIGNED_MEM *memInfo, SAPDB_Int blockSize, SAPDB_Int *retcod)
static void en54_CloseSingleFilescs (ten50_UKT_Control *this_ukt)
static void en54_CloseSingleIOFileDesc (ten50_UKT_Control *pTmpUKTCtrl, SAPDB_Int4 lDevspaceNo)
static SAPDB_Bool en54_CreateSingleIOWorker (struct DEV_PCB *devi_pcb)
static void en54_Dev0Main (void)
static struct DOUBLY_LINKED * en54_dev0Receive (void)
static SAPDB_Bool en54_Dev0Vasynopen (struct DOUBLY_LINKED *request)
static SAPDB_Bool en54_Dev0Vattach (struct DOUBLY_LINKED *request)
static void en54_Dev0Vdetach (struct DOUBLY_LINKED *request)
static SAPDB_Int en54_DeviAsynioReadBlock (struct DEV_PCB *devi_pcb, SAPDB_Int fd, struct REQ_PARMS_ASYNIO *parms, long length, long pno)
static void en54_DeviMain (struct DEV_PCB *pcb)
static SAPDB_Bool en54_DeviVasynopen (struct DEV_PCB *devi_pcb)
static SAPDB_Bool en54_DeviVattach (struct DEV_PCB *devi_pcb)
static void en54_DeviVblockio (struct DOUBLY_LINKED *request, struct DEV_PCB *devi_pcb, INTFUNC_PTR *io_f, SAPDB_Int fd)
static void en54_DeviVdetach (struct DOUBLY_LINKED *request, struct DEV_PCB *pcb)
static void en54_DeviVmarkBadDev (struct DOUBLY_LINKED *request, struct DEV_PCB *devi_pcb, SAPDB_Int fd)
static void en54_DeviVVectorio (struct DOUBLY_LINKED *request, struct DEV_PCB *devi_pcb, SAPDB_Int fd)
static SAPDB_Int en54_DevOpen (char *fname, SAPDB_Bool forceReadOnly, INTFUNC_PTR *io_f, SAPDB_Int4 *fsize, SAPDB_Int *type)
static SAPDB_Int en54_DiskIORead (struct DEV_PCB *devi_pcb, SAPDB_Int fd, char *buf, long length, long pno, SAPDB_UInt4 *errcode)
static SAPDB_Int en54_DiskIOWrite (struct DEV_PCB *devi_pcb, SAPDB_Int fd, char *buf, long length, long pno, SAPDB_UInt4 *errcode)
static SAPDB_Int en54_DiskIOWriteVector (struct DEV_PCB *devi_pcb, SAPDB_Int fd, tsp00_PageAddr pageVector[], SAPDB_Int4 pageCount, SAPDB_Int4 pno, SAPDB_UInt4 *errcode)
static void en54_FillPattern (UCHAR *pBuf, SAPDB_Int pBufSize)
static tsp00_Uint4 en54_find_device_no (struct DOUBLY_LINKED *request, char *devname, tsp00_Uint4 *pErrCode)
static struct DEV_PCB * en54_FindAsyncDevpcb (SAPDB_Int4 devno)
static struct DEV_PCB * en54_FindDevpcb (ten50_UKT_Control *this_ukt, SAPDB_Int4 devno, SAPDB_Bool prio)
static void en54_FormatDevspace (SAPDB_Int4 fd, SAPDB_Int4 devcapacity, SAPDB_Int4 givenBlockSize, tsp00_TaskId taskResponsibleForCall, char *diskImage, tsp00_ErrText errtext, SAPDB_Bool *ok)
static void en54_FreeAligned (struct ALIGNED_MEM *memInfo)
static void en54_InitializeDevspace (SAPDB_Int fd, SAPDB_Int4 devcapacity, SAPDB_Int4 givenBlockSize, SAPDB_Bool wantFormatDevspace, tsp00_TaskId taskResponsibleForCall, char *diskImage, tsp00_ErrText errtext, SAPDB_Bool *ok)
static SAPDB_Int en54_IsExistingPipe (const char *devname)
static void en54_KillAllOtherDevi (struct REQ_PARMS_VATTACH *parms)
static void * en54_Mdevi_main (void *arg)
externC void * en54_Mdevio (void *arg)
static void en54_NewDevsize (SAPDB_Int4 fd, SAPDB_Bool devsp_is_file, SAPDB_Int4 devcapacity, SAPDB_Int4 givenBlockSize, tsp00_ErrText errtext, SAPDB_Bool *ok)
static SAPDB_Int en54_OpenAsyncDevice (ten50_UKT_Control *this_ukt, struct DOUBLY_LINKED *request, struct REQ_PARMS_ASYNOPEN *parms, char *devname)
static void * en54_OpenWatchdog (void *pArg)
static SAPDB_Int en54_Page0IO (SAPDB_Int fd, tsp2_io_op_code op_code, SAPDB_Int4 *page_0_size, SAPDB_Int4 capacity, SAPDB_Bool is_devspace, char *f_label)
static void en54_RawDiskVdevsize (tsp2_devnamec volume, SAPDB_Int4 givenBlockSize, SAPDB_Int4 *devcapacity, tsp00_TaskId taskResponsibleForCall, char *diskImage, SAPDB_Int isSequential, SAPDB_Bool forceReadOnly, tsp00_ErrText errtext, SAPDB_Bool *ok)
static SAPDB_Int en54_ReadBlock (SAPDB_Int fd, tsp00_PageAddr block, long block_len)
static SAPDB_Int en54_ReadWithRetry (SAPDB_Int fd, off_t offset, char *block, unsigned block_len)
static void en54_RegularFileVdevsize (tsp2_devnamec volume, SAPDB_Int4 givenBlockSize, SAPDB_Int4 *devcapacity, tsp00_TaskId taskResponsibleForCall, char *diskImage, SAPDB_Int isSequential, SAPDB_Bool forceReadOnly, tsp00_ErrText errtext, SAPDB_Bool *ok)
static void en54_RequestToDev0 (struct DOUBLY_LINKED *request)
static void en54_RequestToDevi (struct DEV_PCB *devi, struct DOUBLY_LINKED *request)
static void en54_RequestToUKT (struct DEV_PCB *devi, struct DOUBLY_LINKED *request)
static SAPDB_Int en54_ResetNonBlockingFlag (SAPDB_Int fd)
static SAPDB_Bool en54_Rewind (SAPDB_Int filedes, SAPDB_Int4 hostfileno, SAPDB_Bool forClose, SAPDB_UInt4 *errcode)
static void en54_RteDumpFile (tsp00_Pathc RteDumpFile, tsp00_Pathc RteDumpPath)
static void en54_RteDumpFinalFile (tsp00_Pathc RteDumpFinalPath)
static off_t en54_SignalSave_lseek (int fd, off_t where, int whence)
static long en54_SignalSave_read (int fd, void *buffer, size_t size)
static long en54_SignalSave_read_partial (int fd, void *buffer, size_t size)
static long en54_SignalSave_write (int fd, void *buffer, size_t size)
static SAPDB_Int en54_SimulateDiskIOWriteVector (struct DEV_PCB *devi_pcb, SAPDB_Int fd, tsp00_PageAddr pageVector[], SAPDB_Int4 pageCount, SAPDB_Int4 pno, SAPDB_UInt4 *errcode)
static SAPDB_Int en54_SimulateDiskIOWriteVector (struct DEV_PCB *devi_pcb, int fd, tsp00_PageAddr pageVector[], SAPDB_Int4 pageCount, SAPDB_Int4 pno, SAPDB_UInt4 *errcode)
static SAPDB_Int en54_SimulateSingleVectorIO (ten50_UKT_Control *this_ukt, SAPDB_Int4 devno, tsp00_PageNo devpno, tsp00_PageAddr pageVector[], SAPDB_Int2 pageCountcount, tsp00_ErrText errtext, SAPDB_Bool *ok)
static SAPDB_Int en54_SingleBlockIO (ten50_UKT_Control *this_ukt, SAPDB_Int4 devno, tsp00_PageNo devpno, tsp2_io_op_code op_code, tsp00_PageAddr bufadr, SAPDB_Int2 buf_count, tsp00_ErrText errtext, SAPDB_Bool *ok)
static SAPDB_Int en54_SingleVectorIO (ten50_UKT_Control *this_ukt, SAPDB_Int4 devno, tsp00_PageNo devpno, tsp00_PageAddr pageVector[], SAPDB_Int2 pageCountcount, tsp00_ErrText errtext, SAPDB_Bool *ok)
static tsp00_VfType en54_StatFileType (struct DEV_CNTL_INFO *devCntlInfo, SAPDB_UInt4 *returncode)
static SAPDB_Bool en54_TouchVolumeIfNotExists (char *volume, SAPDB_Bool *pForceReadOnly, tsp00_ErrText errtext)
static void en54_ValidateReadOnlyVolumeSize (tsp2_devnamec volume, SAPDB_Int4 givenBlockSize, SAPDB_Bool *pForceReadOnly)
static SAPDB_Bool en54_ValidHostfile (SAPDB_Int4 hostfileno, char *routineName, tsp00_VaReturn *returncode, tsp00_ErrText errtext)
static void en54_WaitForSelfIOCompletionAndClose (SAPDB_Int4 lDevspaceNo)
 This call synchronizes with pending self I/O activity on devno The UKT owns a device specific information structure which includes the file descriptor, the self I/O statistic and the self I/O pending flag.
static SAPDB_Int en54_WrongCall (struct DEV_PCB *devi_pcb, SAPDB_Int fd, char *buf, long length, long pno, SAPDB_UInt4 *errcode)
int en54CreateIOWorkerThreads ()
 create semaphores and threads of IO worker threads The parameter PREALLOCATE_IOWORKER controls, if only DEV0 thread is started or all other possible DEVi threads too. In case of a fatal resource allocation problem, the routine writes diagnostics into knldiag
void en54DumpNewRteDumpOnly (void)
void en54FindPipeCheckAlgorithm (char *dbname)
static SAPDB_Bool ResetForcedReadOnlyIfHSDefaultMaster (SAPDB_Bool *pIsForcedReadOnly)
SAPDB_Bool RTE_CheckForSimulateVectorIo (SAPDB_Bool isRawDevice)
SAPDB_Bool RTE_CSetDatabasePathOwnership (SAPDB_Char const *volume)
void vabort (SAPDB_Int wantCore)
void vasynclose (SAPDB_Int4 hostfileno, SAPDB_Bool rewind, SAPDB_Bool nxt_in_autoloader, tsp00_VaReturn *nxt_tape_available, tsp00_VaReturn *returncode, tsp00_ErrText errtext)
void vasynclose_old (SAPDB_Int4 hostfileno, SAPDB_Bool nxt_in_autoloader, tsp00_VaReturn *nxt_tape_available, tsp00_VaReturn *returncode, tsp00_ErrText errtext)
void vasyninit_tape (SAPDB_Int4 hostfileno, SAPDB_Bool destructive, tsp00_VfType *filetype, tsp00_VaReturn *returncode, tsp00_ErrText errtext)
void vasynio (SAPDB_Int4 hostfileno, SAPDB_Int4 io_id, SAPDB_Int4 file_pos, SAPDB_Int4 io_block_cnt, tsp00_PageAddr io_block_ptr, tsp00_VaReturn *returncode, tsp00_ErrText errtext)
void vasynopen (tsp00_VFilename hostfile, SAPDB_Bool is_devspace, SAPDB_Bool for_writing, tsp00_VfType_Param filetype, SAPDB_Int4 givenBlockSize, tsp00_BoolAddr cancel_pointer, SAPDB_Int4 *max_block_cnt, SAPDB_Int4 *hostfileno, tsp00_VaReturn *returncode, tsp00_ErrText errtext)
void vasynwait (SAPDB_Int4 hostfileno, SAPDB_Int4 *io_id, SAPDB_Int4 *io_block_cnt, tsp00_VaReturn *returncode, tsp00_ErrText errtext)
void vattach (SAPDB_Int4 type_spec_devno, tsp2_dev_type_Param devtype, SAPDB_Int4 *devno, tsp00_TaskId taskId, tsp00_ErrText errtext, SAPDB_Bool *ok)
void vblockio (SAPDB_Int4 devno, tsp00_PageNo devpno, tsp2_io_op_code_Param op_code, tsp00_PageAddr bufadr, SAPDB_Int2 buf_count, tsp00_TaskId taskId, tsp00_ErrText errtext, SAPDB_Bool *ok)
void vcheckopenvolume (SAPDB_Int4 type_spec_devno, tsp2_dev_type_Param devtype, SAPDB_Bool *ok)
void vcopyvolume (SAPDB_Int4 devnoSource, SAPDB_Int4 devnoDestination, tsp00_PageNo firstPage, SAPDB_Int4 pageCount, tsp00_TaskId taskId, tsp00_ErrText VAR_ARRAY_REF errtext, SAPDB_Bool VAR_VALUE_REF ok)
void vdetach (SAPDB_Int4 devno, tsp00_TaskId taskId)
void vdevsize (SAPDB_Int4 type_spec_devno, tsp2_dev_type_Param devtype, SAPDB_Int4 *devcapacity, tsp00_ErrText errtext, SAPDB_Bool *ok)
void vdevsizeWithImage (SAPDB_Int4 type_spec_devno, tsp2_dev_type_Param devtype, SAPDB_Int4 *devcapacity, tsp00_TaskId taskResponsibleForCall, char *diskImage, tsp00_ErrText errtext, SAPDB_Bool *ok)
void vdualvectorio (SAPDB_Int4 devno1, SAPDB_Int4 devno2, tsp00_PageNo devpno, tsp00_PageAddr pageVector[], SAPDB_Int2 pageCount, tsp00_TaskId taskId, tsp00_ErrText VAR_ARRAY_REF errtext1, SAPDB_Bool VAR_VALUE_REF ok1, tsp00_ErrText VAR_ARRAY_REF errtext2, SAPDB_Bool VAR_VALUE_REF ok2)
void vdump_rte (void)
SAPDB_Int4 vget_data_io_cnt ()
externC void vvectorio (SAPDB_Int4 devno, tsp00_PageNo devpno, tsp00_PageAddr pageVector[], SAPDB_Int2 pageCount, tsp00_TaskId taskId, tsp00_ErrText VAR_ARRAY_REF errtext, SAPDB_Bool VAR_VALUE_REF ok)
void WriteIntoPipe (tsp00_Pathc fifoPath, tsp00_Pathc testPath)

Variables

static SAPDB_Int en54_pipeCheckAlgorithm = EN54_NO_PIPE_CHECK_CODE_TESTED
static char * errtab [DEVIO_MAX_ERR_NR]
static char * ftype_text []
volatile SAPDB_Int neverStop_en54 = 1


Generated by  Doxygen 1.6.0   Back to index