kernel/fs/vnode.c
/*
 * Finds a vnode from a given superblock and vnode number.
 * Returns an existing vnode if it is still in the vnode cache.
 * If the vnode is not in the cache then another free vnode is
 * chosen. Data pointed to by the vnode->data field is freed first
 * before returning the vnode.
 *
 * returns a vnode structure, if not existing already then V_VALID
 * is cleared in the flags field.
 */
Finds a vnode from a given superblock and vnode number.
Returns an existing vnode if it is still in the vnode cache.
If the vnode is not in the cache then another free vnode is
chosen. Data pointed to by the vnode->data field is freed first
before returning the vnode.

returns a vnode structure, if not existing already then V_VALID
is cleared in the flags field.
Finds a vnode from a given superblock and vnode number . Returns an existing vnode if it is still in the vnode cache . If the vnode is not in the cache then another free vnode is chosen . Data pointed to by the vnode - > data field is freed first before returning the vnode . returns a vnode structure if not existing already then V_VALID is cleared in the flags field .
struct VNode *VNodeGet(struct SuperBlock *sb, int inode_nr) {
  struct VNode *vnode;
  KLog ("VNodeGet sb = %08x, ino = %d", (vm_addr)sb, inode_nr);
  while (1) {
    if (sb->flags & S_ABORT)
      return NULL;
    if ((vnode = FindVNode(sb, inode_nr)) != NULL) {
      Info ("VNodeGet found vnode: %08x, inode_nr = %d", (vm_addr)vnode, vnode->inode_nr);
      if ((vnode->flags & V_FREE) == V_FREE) {
        LIST_REM_ENTRY(&vnode_free_list, vnode, vnode_entry);
      }
      vnode->reference_cnt++;
      sb->reference_cnt++;
      return vnode;
    } else {
      return NULL;
    }
  }
}
struct VNode * VNodeGet ( struct SuperBlock * sb , int inode_nr ) { struct VNode * vnode ; KLog ( " " , ( vm_addr ) sb , inode_nr ) ; while ( 1 ) { if ( sb -> flags & S_ABORT ) return NULL ; if ( ( vnode = FindVNode ( sb , inode_nr ) ) != NULL ) { Info ( " " , ( vm_addr ) vnode , vnode -> inode_nr ) ; if ( ( vnode -> flags & V_FREE ) == V_FREE ) { LIST_REM_ENTRY ( & vnode_free_list , vnode , vnode_entry ) ; } vnode -> reference_cnt ++ ; sb -> reference_cnt ++ ; return vnode ; } else { return NULL ; } } }
Finds a vnode from a given superblock and vnode number.
Finds a vnode from a given superblock and vnode number .
/*
      if (vnode->busy == 1) {
        KLog ("Found vnode, vnode busy, sleeping");
        TaskSleep(&vnode->rendez);
        continue;
      }
*/ //      vnode->busy = 1;