Changeset 807
- Timestamp:
- 07/15/08 09:25:26 (2 months ago)
- Location:
- Whitix/branches/fs/fs/ext3
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/fs/fs/ext3/ext3.h
r783 r807 192 192 int Ext3ReadDir(struct File* file,void* dirEntries); 193 193 int Ext3BlockMap(struct VNode* vNode, DWORD block, int flags); 194 struct Buffer* Ext3BlockRead(struct VNode* vNode,int block );194 struct Buffer* Ext3BlockRead(struct VNode* vNode,int block, int create); 195 195 int Ext3Create(struct VNode** retVal,struct VNode* dir,char* name,int nameLength); 196 196 int Ext3Truncate(struct VNode* vNode, int size); 197 int Ext3MkDir(struct VNode** retVal,struct VNode* dir,char* name,int nameLength); 198 struct VNode* Ext3CreateINode(struct JournalHandle* handle, struct VNode* dir, int isDir); 197 199 198 200 int Ext3FileWrite(struct File* file,BYTE* buffer,DWORD len); -
Whitix/branches/fs/fs/ext3/ialloc.c
r781 r807 35 35 } 36 36 37 struct VNode* Ext3CreateINode(struct JournalHandle* handle, struct VNode* dir )37 struct VNode* Ext3CreateINode(struct JournalHandle* handle, struct VNode* dir, int isDir) 38 38 { 39 39 DWORD groupNo; … … 47 47 struct VNode* vNode; 48 48 49 /* What happens when a directory is to be created? */ 49 if (isDir) 50 { 51 int avgFree=sbInfo->super->freeInodes/sbInfo->groupCount; 52 53 for (i=0; i<sbInfo->groupCount; i++) 54 { 55 desc=Ext3GetGroupDesc(superBlock, i, &groupBuffer); 56 57 if (desc && desc->freeINodes && desc->freeINodes >= avgFree) 58 { 59 groupNo=i; 60 break; 61 } 62 } 63 }else{ 64 /* TODO: May have to search other groups. */ 65 groupNo=EXT3_INFO(dir)->blockGroup; 50 66 51 groupNo=EXT3_INFO(dir)->blockGroup; 52 53 desc=Ext3GetGroupDesc(superBlock, groupNo, &groupBuffer); 67 desc=Ext3GetGroupDesc(superBlock, groupNo, &groupBuffer); 54 68 55 if (!desc->freeINodes) 56 { 57 KePrint("Need to allocate!\n"); 58 cli(); hlt(); 69 if (!desc->freeINodes) 70 { 71 KePrint("Need to allocate!\n"); 72 cli(); hlt(); 73 } 59 74 } 60 75 … … 112 127 vNode->vNodeOps=&ext3VNodeOps; 113 128 vNode->fileOps=&ext3FileOps; 114 vNode->mode=VFS_ATTR_WRITE | VFS_ATTR_READ | VFS_ATTR_FILE; 129 130 vNode->mode=VFS_ATTR_WRITE | VFS_ATTR_READ; 131 132 if (isDir) 133 vNode->mode |= VFS_ATTR_DIR; 134 else 135 vNode->mode |= VFS_ATTR_FILE; 136 115 137 vNode->extraInfo=iNodeInfo; 116 138 -
Whitix/branches/fs/fs/ext3/super.c
r784 r807 37 37 .create = Ext3Create, 38 38 .truncate = Ext3Truncate, 39 .mkDir = Ext3MkDir, 39 40 }; 40 41
