ndb - bug#21172

  Fix build failure if O_DIRECT is not defined
  Fix stack overflow by making odirect_readbuf global
  Remove soem old debug variables
parent d3855ce6
......@@ -244,9 +244,9 @@ AsyncFile::run()
}//while
}//AsyncFile::run()
extern bool Global_useO_SYNC;
extern bool Global_unlinkO_CREAT;
extern Uint32 Global_syncFreq;
#ifdef O_DIRECT
static char g_odirect_readbuf[2*GLOBAL_PAGE_SIZE -1];
#endif
void AsyncFile::openReq(Request* request)
{
......@@ -346,7 +346,7 @@ void AsyncFile::openReq(Request* request)
}
#elif defined O_SYNC
{
flags |= OM_SYNC;
flags |= FsOpenReq::OM_SYNC;
}
#endif
......@@ -523,8 +523,7 @@ void AsyncFile::openReq(Request* request)
#ifdef O_DIRECT
do {
int ret;
char buf[2*GLOBAL_PAGE_SIZE -1];
char * bufptr = (char*)((UintPtr(buf)+(GLOBAL_PAGE_SIZE - 1)) & ~(GLOBAL_PAGE_SIZE - 1));
char * bufptr = (char*)((UintPtr(g_odirect_readbuf)+(GLOBAL_PAGE_SIZE - 1)) & ~(GLOBAL_PAGE_SIZE - 1));
while (((ret = ::read(theFd, bufptr, GLOBAL_PAGE_SIZE)) == -1) && (errno == EINTR));
if (ret == -1)
{
......
......@@ -1062,27 +1062,10 @@ Ndbfs::execCONTINUEB(Signal* signal)
return;
}
bool Global_useO_SYNC = true;
bool Global_unlinkO_CREAT = false;
Uint32 Global_syncFreq = 1024 * 1024;
void
Ndbfs::execDUMP_STATE_ORD(Signal* signal)
{
if(signal->theData[0] == 19){
if(signal->length() > 1){
Global_useO_SYNC = signal->theData[1];
}
if(signal->length() > 2){
Global_syncFreq = signal->theData[2] * 1024 * 1024;
}
if(signal->length() > 3){
Global_unlinkO_CREAT = signal->theData[3];
}
ndbout_c("useO_SYNC = %d syncFreq = %d unlinkO_CREATE = %d",
Global_useO_SYNC,
Global_syncFreq,
Global_unlinkO_CREAT);
return;
}
if(signal->theData[0] == DumpStateOrd::NdbfsDumpFileStat){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment