Show
Ignore:
Timestamp:
10/04/08 14:15:35 (3 months ago)
Author:
mwhitworth
Message:

Use new softlink code for IcFs, which uses KeFsEntrys. Add extra checks elsewhere.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/keobject/fs/icfs/icfs.c

    r971 r1081  
    88 
    99#include "icfs.h" 
     10 
     11struct VfsSuperBlock* icFsSuperBlock; 
    1012 
    1113int IcFsWrite(struct File* file, BYTE* data, DWORD size) 
     
    5355int IcFsFollowLink(struct VNode** ret, struct VNode* vNode) 
    5456{ 
    55         char buf[2048]; 
    56         struct KeFsEntry* entry; 
     57        struct KeFsEntry* src, *dest; 
    5758        int err; 
    5859         
    59         entry=(struct KeFsEntry*)(vNode->id); 
     60        src=(struct KeFsEntry*)(vNode->id); 
    6061         
    6162        /* 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); 
    6369         
    64         err=NameToVNode(ret, buf, FILE_FORCE_OPEN, NULL); 
     70        if (!*ret) 
     71                return -ENOENT; 
    6572         
    66         return err; 
     73        return 0; 
    6774} 
    6875 
     
    134141        ret->mount=VNodeGet(ret, (DWORD)IcFsGetRootId()); 
    135142 
     143        icFsSuperBlock = ret; 
     144 
    136145end: 
    137146        return ret;