Changeset 809

Show
Ignore:
Timestamp:
07/15/08 10:05:10 (3 months ago)
Author:
mwhitworth
Message:

Add comments, fix warnings.

Location:
Whitix/branches/fs/fs/ext3
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/fs/fs/ext3/balloc.c

    r802 r809  
    9090         
    9191        buffer=BlockRead(superBlock->sDevice, desc->blockBitmap); 
     92 
     93        /* TODO: Keep a cache? */ 
    9294         
    9395        return buffer; 
  • Whitix/branches/fs/fs/ext3/ext3.h

    r807 r809  
    200200int Ext3FileWrite(struct File* file,BYTE* buffer,DWORD len); 
    201201 
     202/* balloc.c */ 
     203struct Ext3GroupDesc* Ext3GetGroupDesc(struct VfsSuperBlock* superBlock, DWORD groupNo, 
     204        struct Buffer** buffer); 
     205int Ext3BlockMapHandle(struct JournalHandle* handle, struct VNode* vNode, DWORD block, int flags); 
     206int Ext3BlockTruncate(struct VNode* vNode, int size); 
     207 
    202208extern struct VNodeOps ext3VNodeOps; 
    203209extern struct FileOps ext3FileOps; 
  • Whitix/branches/fs/fs/ext3/ialloc.c

    r807 r809  
    1818 
    1919#include <bitmap.h> 
     20#include <malloc.h> 
     21#include <print.h> 
    2022 
    2123#include "ext3.h" 
     
    3739struct VNode* Ext3CreateINode(struct JournalHandle* handle, struct VNode* dir, int isDir) 
    3840{ 
    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; 
    4244        struct Buffer* bitmapBuffer; 
    43         int i; 
     45        DWORD i; 
    4446        struct VfsSuperBlock* superBlock=dir->superBlock; 
    4547        struct Ext3SbInfo* sbInfo=EXT3_SUPERINFO(superBlock); 
     
    7375                } 
    7476        } 
     77 
     78        if (!groupBuffer || !desc) 
     79                return -ENOSPC; 
    7580         
    7681        bitmapBuffer=Ext3INodeLoadBitmap(superBlock, groupNo); 
  • Whitix/branches/fs/fs/ext3/inode.c

    r806 r809  
    221221        while (1) 
    222222        { 
    223                 if ((char*)entry >= BYTES_PER_SECTOR(vNode->superBlock)+buffer->data) 
     223                if ((char*)entry >= (char*)(BYTES_PER_SECTOR(vNode->superBlock)+buffer->data)) 
    224224                { 
    225225                        KePrint("New block?\n"); 
     
    347347int Ext3BlockMap(struct VNode* vNode, DWORD block, int flags) 
    348348{ 
    349         struct Buffer* buff; 
    350349        struct JournalHandle* handle=JournalCurrHandle(); 
    351350        int ret=0; 
     
    365364                } 
    366365#endif 
    367  
    368 #if 0 
    369 #endif 
    370366        } 
    371367         
     
    458454} 
    459455 
     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  
    460471int Ext3MkDir(struct VNode** retVal,struct VNode* dir,char* name,int nameLength) 
    461472{ 
     
    466477         
    467478        handle=JournalStart(EXT3_JOURNAL(dir), EXT3_DATA_TRANS); 
     479         
     480        if (!handle) 
     481                return -EIO; 
    468482         
    469483        vNode=Ext3CreateINode(handle, dir, 1); 
  • Whitix/branches/fs/fs/ext3/super.c

    r807 r809  
    108108{ 
    109109        struct Ext3SbInfo* sb=EXT3_SUPERINFO(superBlock); 
    110         unsigned long block; 
     110//      unsigned long block; 
    111111 
    112112        return sb->sbSector+i+1; 
     
    128128         
    129129        sbInfo->sbBuffer=BlockRead(superBlock->sDevice, sector); 
     130 
     131        if (!sbInfo->sbBuffer) 
     132                return -EIO; 
     133 
    130134        sbInfo->super=(struct Ext3SuperBlock*)((sbInfo->sbBuffer->data)+offset); 
    131         sbInfo->sbSector=sector;         
     135        sbInfo->sbSector=sector; 
     136 
     137        return 0;        
    132138} 
    133139