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() ...@@ -244,9 +244,9 @@ AsyncFile::run()
}//while }//while
}//AsyncFile::run() }//AsyncFile::run()
extern bool Global_useO_SYNC; #ifdef O_DIRECT
extern bool Global_unlinkO_CREAT; static char g_odirect_readbuf[2*GLOBAL_PAGE_SIZE -1];
extern Uint32 Global_syncFreq; #endif
void AsyncFile::openReq(Request* request) void AsyncFile::openReq(Request* request)
{ {
...@@ -346,7 +346,7 @@ void AsyncFile::openReq(Request* request) ...@@ -346,7 +346,7 @@ void AsyncFile::openReq(Request* request)
} }
#elif defined O_SYNC #elif defined O_SYNC
{ {
flags |= OM_SYNC; flags |= FsOpenReq::OM_SYNC;
} }
#endif #endif
...@@ -523,8 +523,7 @@ void AsyncFile::openReq(Request* request) ...@@ -523,8 +523,7 @@ void AsyncFile::openReq(Request* request)
#ifdef O_DIRECT #ifdef O_DIRECT
do { do {
int ret; int ret;
char buf[2*GLOBAL_PAGE_SIZE -1]; char * bufptr = (char*)((UintPtr(g_odirect_readbuf)+(GLOBAL_PAGE_SIZE - 1)) & ~(GLOBAL_PAGE_SIZE - 1));
char * bufptr = (char*)((UintPtr(buf)+(GLOBAL_PAGE_SIZE - 1)) & ~(GLOBAL_PAGE_SIZE - 1));
while (((ret = ::read(theFd, bufptr, GLOBAL_PAGE_SIZE)) == -1) && (errno == EINTR)); while (((ret = ::read(theFd, bufptr, GLOBAL_PAGE_SIZE)) == -1) && (errno == EINTR));
if (ret == -1) if (ret == -1)
{ {
......
...@@ -1062,27 +1062,10 @@ Ndbfs::execCONTINUEB(Signal* signal) ...@@ -1062,27 +1062,10 @@ Ndbfs::execCONTINUEB(Signal* signal)
return; return;
} }
bool Global_useO_SYNC = true;
bool Global_unlinkO_CREAT = false;
Uint32 Global_syncFreq = 1024 * 1024;
void void
Ndbfs::execDUMP_STATE_ORD(Signal* signal) Ndbfs::execDUMP_STATE_ORD(Signal* signal)
{ {
if(signal->theData[0] == 19){ 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; return;
} }
if(signal->theData[0] == DumpStateOrd::NdbfsDumpFileStat){ 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