- Timestamp:
- 10/04/08 14:15:35 (2 months ago)
- Location:
- Whitix/branches/keobject
- Files:
-
- 2 removed
- 10 modified
-
devices/kedev/sdevice.c (modified) (2 diffs)
-
fs/icfs/config.c (modified) (2 diffs)
-
fs/icfs/icfs.c (modified) (3 diffs)
-
fs/icfs/info.c (modified) (4 diffs)
-
fs/icfs/info_cpu.c (modified) (1 diff)
-
fs/kfs/dir.c (modified) (1 diff)
-
fs/vfs/vnode.c (modified) (2 diffs)
-
include/devices/class.h (modified) (1 diff)
-
include/devices/device.h (modified) (1 diff)
-
include/fs/config.h (deleted)
-
include/fs/icfs.h (modified) (1 diff)
-
include/fs/info.h (deleted)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/keobject/devices/kedev/sdevice.c
r1055 r1081 19 19 #include <devices/class.h> 20 20 #include <devices/sdevice.h> 21 #include <module.h>22 21 #include <llist.h> 23 22 #include <module.h> … … 29 28 #include <malloc.h> 30 29 #include <print.h> 31 #include <fs/config.h>32 30 #include <fs/devfs.h> 33 31 -
Whitix/branches/keobject/fs/icfs/config.c
r1062 r1081 10 10 11 11 extern struct KeFsEntry root; 12 13 int ConfigAddIntEntry(struct KeFsEntry* dir, char* name, void* value)14 {15 return IcFsAddIntEntry(dir, name, (int*)value, VFS_ATTR_RW);16 }17 18 SYMBOL_EXPORT(ConfigAddIntEntry);19 20 int ConfigAddArrayEntry(struct KeFsEntry* dir, char* name, BYTE* value, int minLen, int maxLen, int size)21 {22 /* TODO: Create general IcFs function. */23 struct IcFsEntry* entry;24 25 entry=IcFsAddStrEntry(dir, name, (char*)value, VFS_ATTR_RW);26 27 if (!entry)28 return -EINVAL;29 30 entry->type=ICFS_TYPE_BYTE;31 entry->minLen=minLen;32 entry->maxLen=maxLen;33 entry->size=size;34 35 return 0;36 }37 38 SYMBOL_EXPORT(ConfigAddArrayEntry);39 40 int ConfigAddSoftLink(struct KeFsEntry* dir, char* name, int (*followLink)(char* buffer, int size))41 {42 return IcFsAddSoftLink(dir, name, followLink);43 }44 45 SYMBOL_EXPORT(ConfigAddSoftLink);46 47 struct KeFsEntry* ConfigCreateDir(struct KeFsEntry* dir, char* name)48 {49 return IcFsCreateDir(dir, name);50 }51 52 SYMBOL_EXPORT(ConfigCreateDir);53 12 54 13 struct KeFsEntry* ConfigResolvePath(char* name) … … 82 41 struct KeFsEntry* entry; 83 42 DWORD position=0; 84 85 KePrint("%s\n", name);86 43 87 44 entry=ConfigResolvePath(name); -
Whitix/branches/keobject/fs/icfs/icfs.c
r971 r1081 8 8 9 9 #include "icfs.h" 10 11 struct VfsSuperBlock* icFsSuperBlock; 10 12 11 13 int IcFsWrite(struct File* file, BYTE* data, DWORD size) … … 53 55 int IcFsFollowLink(struct VNode** ret, struct VNode* vNode) 54 56 { 55 char buf[2048]; 56 struct KeFsEntry* entry; 57 struct KeFsEntry* src, *dest; 57 58 int err; 58 59 59 entry=(struct KeFsEntry*)(vNode->id);60 src=(struct KeFsEntry*)(vNode->id); 60 61 61 62 /* FIXME: Optimize */ 62 entry->followLink(buf, 2048); 63 err = src->followLink(&dest, src); 64 65 if (err) 66 return err; 67 68 *ret = VNodeGet(icFsSuperBlock, (DWORD)dest); 63 69 64 err=NameToVNode(ret, buf, FILE_FORCE_OPEN, NULL); 70 if (!*ret) 71 return -ENOENT; 65 72 66 return err;73 return 0; 67 74 } 68 75 … … 134 141 ret->mount=VNodeGet(ret, (DWORD)IcFsGetRootId()); 135 142 143 icFsSuperBlock = ret; 144 136 145 end: 137 146 return ret; -
Whitix/branches/keobject/fs/icfs/info.c
r1062 r1081 118 118 } 119 119 120 int InfoAddIntEntry(struct KeFsEntry* dir, char* name, int* value) 121 { 122 return IcFsAddIntEntry(dir, name, value, VFS_ATTR_READ); 123 } 120 SYMBOL_EXPORT(IcFsAddIntEntry); 124 121 125 122 struct IcFsEntry* IcFsAddStrEntry(struct KeFsEntry* dir, char* name, char* str, DWORD permissions) … … 142 139 } 143 140 144 int IcFsAddSoftLink(struct KeFsEntry* dir, char* name, int (*followLink)(char* buffer, int size)) 141 int IcFsAddSoftLink(struct KeFsEntry* dir, char* name, 142 int (*followLink)(struct KeFsEntry**, struct KeFsEntry*)) 145 143 { 146 144 struct KeFsEntry* entry; … … 159 157 } 160 158 161 int InfoAddStrEntry(struct KeFsEntry* dir, char* name, char* str) 162 { 163 IcFsAddStrEntry(dir, name, str, VFS_ATTR_READ); 164 return 0; 165 } 159 SYMBOL_EXPORT(IcFsAddSoftLink); 166 160 167 161 struct KeFsEntry* IcFsCreateDir(struct KeFsEntry* dir, char* name /*, DWORD permissions */) … … 172 166 return KeFsAddDir(&dir->dir, name); 173 167 } 174 175 struct KeFsEntry* InfoCreateDir(struct KeFsEntry* dir, char* name)176 {177 return IcFsCreateDir(dir, name);178 }179 180 SYMBOL_EXPORT(InfoCreateDir);181 168 182 169 DWORD IcFsGetRootId() -
Whitix/branches/keobject/fs/icfs/info_cpu.c
r971 r1081 4 4 #include <print.h> 5 5 #include <fs/kfs.h> 6 #include <fs/info.h>7 6 #include <fs/vfs.h> 8 7 -
Whitix/branches/keobject/fs/kfs/dir.c
r1064 r1081 90 90 { 91 91 /* Follow the softlink. TODO: Must be a simple one? */ 92 char buf[2048]; 93 entry->followLink(buf, 2048); 92 struct KeFsEntry* dest; 94 93 95 struct KeFsEntry* entry2; 94 if (entry->followLink(&dest, entry)) 95 return NULL; 96 96 97 ListForEachEntry(entry2, &dir->entries, next) 98 { 99 if ((entry2->type & VFS_ATTR_DIR) && !strnicmp(entry2->name, buf, strlen(buf))) 100 return &entry2->dir; 101 } 97 if ((dest->type & VFS_ATTR_DIR)) 98 return &dest->dir; 102 99 } 103 100 -
Whitix/branches/keobject/fs/vfs/vnode.c
r1061 r1081 96 96 ++(*ret)->refs; 97 97 } 98 99 98 100 99 /* Check if the new vNode is a link. TODO: Move. */ … … 102 101 { 103 102 // KePrint("Following symlink, %#X\n", (*ret)->vNodeOps->followLink); 104 (*ret)->vNodeOps->followLink(ret, *ret);103 err = (*ret)->vNodeOps->followLink(ret, *ret); 105 104 } 106 105 -
Whitix/branches/keobject/include/devices/class.h
r1051 r1081 11 11 int DevClassCreate(struct DevClass* devClass, struct KeObjType* type, const char* name, ...); 12 12 13 static inline struct KeFsEntry* DevClassGetDir(struct DevClass* devClass) 14 { 15 return devClass->set.object.dir; 16 } 17 13 18 #endif -
Whitix/branches/keobject/include/devices/device.h
r1051 r1081 91 91 } 92 92 93 static inline struct KeFsEntry* KeDeviceGetConfDir(struct KeDevice* device) 94 { 95 return device->object.dir; 96 } 97 93 98 #endif -
Whitix/branches/keobject/include/fs/icfs.h
r1052 r1081 39 39 int IcFsAddIntEntry(struct KeFsEntry* dir, char* name, int* value, DWORD permissions); 40 40 struct IcFsEntry* IcFsAddStrEntry(struct KeFsEntry* dir, char* name, char* str, DWORD permissions); 41 int IcFsAddSoftLink(struct KeFsEntry* dir, char* name, int (*followLink)(char* buffer, int size)); 41 int IcFsAddSoftLink(struct KeFsEntry* dir, char* name, 42 int (*followLink)(struct KeFsEntry**, struct KeFsEntry*)); 42 43 43 44 #endif
