bool MkFileWithPatternMsgEx::processIncoming(struct sockaddr_in* fromAddr, Socket* sock,
   char* respBuf, size_t bufLen, HighResolutionStats* stats)
{
   #ifdef BEEGFS_DEBUG
      const char* logContext = "MkFileWithPatternMsg incoming";

      std::string peer = fromAddr ? Socket::ipaddrToStr(&fromAddr->sin_addr) : sock->getPeername();
      LOG_DEBUG(logContext, 4, std::string("Received a MkFileWithPatternMsg from: ") + peer);
   #endif // BEEGFS_DEBUG

   EntryInfo* parentInfo = this->getParentInfo();
   std::string newFileName = this->getNewFileName();
   EntryInfo newEntryInfo;

   FhgfsOpsErr mkRes = mkFile(parentInfo, newFileName, &newEntryInfo);

   MkFileWithPatternRespMsg respMsg(mkRes, &newEntryInfo );
   respMsg.serialize(respBuf, bufLen);
   sock->sendto(respBuf, respMsg.getMsgLength(), 0,
      (struct sockaddr*)fromAddr, sizeof(struct sockaddr_in) );

   App* app = Program::getApp();
   app->getNodeOpStats()->updateNodeOp(sock->getPeerIP(), MetaOpCounter_MKFILE,
      getMsgHeaderUserID() );

   return true;
}
Example #2
0
void MProject::setMakefile()
{
    _makefile = _filename;
    _makefile.setExt( ".mk" );

    WFileName mkFile( _makefile );
    if( mkFile.needQuotes() ) {
        mkFile.addQuotes();
    }
    setenv( "_makefile", mkFile , 1 );
}
Example #3
0
void initramfs () {
	kprintf ("Initializing root directory (ramfs)\n");
	rootDir = kmalloc (sizeof (dirEntry_t));
	rootDir->extent = rootDir;
	rootDir->name = (uint8 *) ".";
	rootDir->file = 0;

	dirEntry_t *newDir = kmalloc (sizeof (dirEntry_t));
	rootDir->nextDir = newDir;
	newDir->nextDir = (dirEntry_t *) -1;
	newDir->extent = rootDir;
	newDir->name = (uint8 *) "..";
	newDir->file = 0;

	mkDir ((uint8 *) "/", (uint8 *) "test");
	mkDir ((uint8 *) "/test/", (uint8 *) "test2");
	mkDir ((uint8 *) "/test/", (uint8 *) "boink");
	mkFile ((uint8 *) "/test", (uint8 *) "boo.txt");

	uint8 *buf = (uint8 *) "Hello from boo.txt!";	
	writeFS (openFS ((uint8 *) "/test/boo.txt", 0, 0), 100, buf);

	registerRootFS ((uint8 *) "/", openFS, readFS, writeFS, listDir, 0, 0);
}