Changeset 1131 for Whitix

Show
Ignore:
Timestamp:
10/14/08 19:36:32 (1 month ago)
Author:
mwhitworth
Message:

Misc fixes, mainly to do with references.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/keobject/fs/vfs/vnode.c

    r1081 r1131  
    8686 
    8787        if (err) 
    88                 return err; 
     88                goto out; 
    8989 
    9090        /* This is how mountpoints work. FIXME: Does every vNode need a mountNode? */ 
     
    104104        } 
    105105 
     106out: 
    106107        VNodeRelease(dir); 
    107108        return err; 
     
    168169                if (!c) 
    169170                        break; 
     171                         
     172                currNode->refs++; 
    170173 
    171174                if (VfsDoLookup(currName, length, &newNode, currNode) || !(newNode->mode & VFS_ATTR_DIR)) 
    172175                { 
    173                         VNodeRelease(currNode); 
     176//                      VNodeRelease(currNode); /* FIXME: Needed? currNode is released in VfsDoLookup */ 
    174177                        return NULL; 
    175178                } 
     
    217220        if (!dir) 
    218221                return -ENOENT; 
    219  
     222         
    220223        /* Now the directory vNode is known, create/open the file, according to what 
    221224        the caller wants to do. */ 
     
    246249        }else if (flags & FILE_CREATE_OPEN) 
    247250        { 
     251                dir->refs++; 
    248252                /* The file can either be created or opened */ 
    249253                if (VfsDoLookup(name,nameLen,retVal,dir)) 
    250254                { 
    251255                        /* Obviously doesn't exist, so create it */ 
    252                         if (dir->vNodeOps->create) 
     256                        if (dir->vNodeOps && dir->vNodeOps->create) 
    253257                        { 
    254258                                ret=dir->vNodeOps->create(retVal,dir,name,nameLen);