Changeset 528 for Whitix/branches/hybrid

Show
Ignore:
Timestamp:
05/24/08 09:51:18 (5 months ago)
Author:
mwhitworth
Message:

Add structures, add inline DeviceGetOps.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/hybrid/include/fs/devfs.h

    r58 r528  
    3535}; 
    3636 
     37/* Structures */ 
     38struct DevFsDir 
     39{ 
     40        struct ListHead entries; /* All DevFsEntrys */ 
     41        struct DevFsDir* parent; 
     42}; 
     43 
     44struct DevFsEntry 
     45{ 
     46        struct ListHead next; 
     47        int type; 
     48        union { 
     49                struct DevFsDir dir; 
     50                struct DevFsDevice device; 
     51        }; 
     52        char name[1]; 
     53}; 
     54 
    3755struct StorageDevice; 
    3856 
    3957int DevAddDevice(char* name,WORD major,WORD minor,int type,void* ops); 
    40 void* DeviceGetOps(struct VNode* devNode); 
    4158 
    4259struct StorageDevice* DevFindRootDev(WORD major,WORD minor); 
    4360 
     61static inline void* DeviceGetOps(struct VNode* devNode) 
     62{ 
     63        struct DevFsEntry* entry=(struct DevFsEntry*)(devNode->extraInfo); 
     64 
     65        /* DevFs directories don't have specific operations. */  
     66        if (entry->type & VFS_ATTR_DIR) 
     67                return NULL; 
     68         
     69        return (void*)(entry->device.ops); 
     70} 
     71 
    4472#endif