Changeset 809
- Timestamp:
- 07/15/08 10:05:10 (3 months ago)
- Location:
- Whitix/branches/fs/fs/ext3
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/fs/fs/ext3/balloc.c
r802 r809 90 90 91 91 buffer=BlockRead(superBlock->sDevice, desc->blockBitmap); 92 93 /* TODO: Keep a cache? */ 92 94 93 95 return buffer; -
Whitix/branches/fs/fs/ext3/ext3.h
r807 r809 200 200 int Ext3FileWrite(struct File* file,BYTE* buffer,DWORD len); 201 201 202 /* balloc.c */ 203 struct Ext3GroupDesc* Ext3GetGroupDesc(struct VfsSuperBlock* superBlock, DWORD groupNo, 204 struct Buffer** buffer); 205 int Ext3BlockMapHandle(struct JournalHandle* handle, struct VNode* vNode, DWORD block, int flags); 206 int Ext3BlockTruncate(struct VNode* vNode, int size); 207 202 208 extern struct VNodeOps ext3VNodeOps; 203 209 extern struct FileOps ext3FileOps; -
Whitix/branches/fs/fs/ext3/ialloc.c
r807 r809 18 18 19 19 #include <bitmap.h> 20 #include <malloc.h> 21 #include <print.h> 20 22 21 23 #include "ext3.h" … … 37 39 struct VNode* Ext3CreateINode(struct JournalHandle* handle, struct VNode* dir, int isDir) 38 40 { 39 DWORD groupNo ;40 struct Ext3GroupDesc* desc ;41 struct Buffer* groupBuffer ;41 DWORD groupNo=0; 42 struct Ext3GroupDesc* desc=NULL; 43 struct Buffer* groupBuffer=NULL; 42 44 struct Buffer* bitmapBuffer; 43 inti;45 DWORD i; 44 46 struct VfsSuperBlock* superBlock=dir->superBlock; 45 47 struct Ext3SbInfo* sbInfo=EXT3_SUPERINFO(superBlock); … … 73 75 } 74 76 } 77 78 if (!groupBuffer || !desc) 79 return -ENOSPC; 75 80 76 81 bitmapBuffer=Ext3INodeLoadBitmap(superBlock, groupNo); -
Whitix/branches/fs/fs/ext3/inode.c
r806 r809 221 221 while (1) 222 222 { 223 if ((char*)entry >= BYTES_PER_SECTOR(vNode->superBlock)+buffer->data)223 if ((char*)entry >= (char*)(BYTES_PER_SECTOR(vNode->superBlock)+buffer->data)) 224 224 { 225 225 KePrint("New block?\n"); … … 347 347 int Ext3BlockMap(struct VNode* vNode, DWORD block, int flags) 348 348 { 349 struct Buffer* buff;350 349 struct JournalHandle* handle=JournalCurrHandle(); 351 350 int ret=0; … … 365 364 } 366 365 #endif 367 368 #if 0369 #endif370 366 } 371 367 … … 458 454 } 459 455 456 /******************************************************************************* 457 * 458 * FUNCTION: Ext3MkDir 459 * 460 * DESCRIPTION: Make a directory in dir with name 'name'. 461 * 462 * PARAMETERS: retVal - new vNode that points to the new directory. 463 * dir - the directory to create the new directory in 464 * name - name of the new directory 465 * nameLength - length in bytes of the new name. 466 * 467 * RETURNS: Various errors. 468 * 469 ******************************************************************************/ 470 460 471 int Ext3MkDir(struct VNode** retVal,struct VNode* dir,char* name,int nameLength) 461 472 { … … 466 477 467 478 handle=JournalStart(EXT3_JOURNAL(dir), EXT3_DATA_TRANS); 479 480 if (!handle) 481 return -EIO; 468 482 469 483 vNode=Ext3CreateINode(handle, dir, 1); -
Whitix/branches/fs/fs/ext3/super.c
r807 r809 108 108 { 109 109 struct Ext3SbInfo* sb=EXT3_SUPERINFO(superBlock); 110 unsigned long block;110 // unsigned long block; 111 111 112 112 return sb->sbSector+i+1; … … 128 128 129 129 sbInfo->sbBuffer=BlockRead(superBlock->sDevice, sector); 130 131 if (!sbInfo->sbBuffer) 132 return -EIO; 133 130 134 sbInfo->super=(struct Ext3SuperBlock*)((sbInfo->sbBuffer->data)+offset); 131 sbInfo->sbSector=sector; 135 sbInfo->sbSector=sector; 136 137 return 0; 132 138 } 133 139
