X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fvfs%2Ffs%2Fdevfs.c;h=9ab2b7b4fc3c33dce9adceaeaa5e4d5d25a477d9;hb=8dcc3e209d0d728565a18c8dca2b0ba220b74a6f;hp=b3f4a57917bf7cedd06b9f10df00d13b71cd080d;hpb=51ab5f489bc356940c95cc936fd0508e8f07ea97;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/vfs/fs/devfs.c b/KernelLand/Kernel/vfs/fs/devfs.c index b3f4a579..9ab2b7b4 100644 --- a/KernelLand/Kernel/vfs/fs/devfs.c +++ b/KernelLand/Kernel/vfs/fs/devfs.c @@ -3,6 +3,7 @@ * Device Filesystem (DevFS) * - vfs/fs/devfs.c */ +#define DEBUG 0 #include #include #include @@ -13,12 +14,15 @@ void DevFS_DelDevice(tDevFS_Driver *Device); #endif tVFS_Node *DevFS_InitDevice(const char *Device, const char **Options); +void DevFS_Unmount(tVFS_Node *RootNode); char *DevFS_ReadDir(tVFS_Node *Node, int Pos); tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name); // === GLOBALS === tVFS_Driver gDevFS_Info = { - "devfs", 0, DevFS_InitDevice, NULL, NULL + .Name = "devfs", + .InitDevice = DevFS_InitDevice, + .Unmount = DevFS_Unmount }; tVFS_NodeType gDevFS_DirType = { .TypeName = "DevFS-Dir", @@ -44,6 +48,9 @@ int DevFS_AddDevice(tDevFS_Driver *Device) { int ret = 0; tDevFS_Driver *dev; + + ENTER("pDevice", Device); + LOG("Device->Name = '%s'", Device->Name); SHORTLOCK( &glDevFS_ListLock ); @@ -61,7 +68,7 @@ int DevFS_AddDevice(tDevFS_Driver *Device) else Log_Warning("DevFS", "Device %p attempted to register '%s' which was owned by %p", Device, dev->Name, dev); - ret = 0; // Error + ret = -1; // Error } else { Device->Next = gDevFS_Drivers; @@ -71,6 +78,7 @@ int DevFS_AddDevice(tDevFS_Driver *Device) } SHORTREL( &glDevFS_ListLock ); + LEAVE('i', ret); return ret; } @@ -112,6 +120,11 @@ tVFS_Node *DevFS_InitDevice(const char *Device, const char **Options) return &gDevFS_RootNode; } +void DevFS_Unmount(tVFS_Node *RootNode) +{ + +} + /** * \fn char *DevFS_ReadDir(tVFS_Node *Node, int Pos) */ @@ -140,7 +153,7 @@ tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name) { tDevFS_Driver *dev; - //ENTER("pNode sName", Node, Name); + ENTER("pNode sName", Node, Name); for(dev = gDevFS_Drivers; dev; @@ -148,14 +161,14 @@ tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name) ) { //LOG("dev = %p", dev); - //LOG("dev->Name = '%s'", dev->Name); + LOG("dev->Name = '%s'", dev->Name); if(strcmp(dev->Name, Name) == 0) { - //LEAVE('p', &dev->RootNode); + LEAVE('p', &dev->RootNode); return &dev->RootNode; } } - //LEAVE('n'); + LEAVE('n'); return NULL; }