Changeset 8ff0bd2 in mainline for uspace/srv/vfs/vfs_lookup.c


Ignore:
Timestamp:
2011-09-04T11:30:58Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
03bc76a
Parents:
d2c67e7 (diff), deac215e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_lookup.c

    rd2c67e7 r8ff0bd2  
    5050
    5151FIBRIL_MUTEX_INITIALIZE(plb_mutex);
    52 LIST_INITIALIZE(plb_head);      /**< PLB entry ring buffer. */
     52LIST_INITIALIZE(plb_entries);   /**< PLB entry ring buffer. */
    5353uint8_t *plb = NULL;
    5454
     
    102102        size_t last;    /* the last free index */
    103103
    104         if (list_empty(&plb_head)) {
     104        if (list_empty(&plb_entries)) {
    105105                first = 0;
    106106                last = PLB_SIZE - 1;
    107107        } else {
    108                 plb_entry_t *oldest = list_get_instance(plb_head.next,
    109                     plb_entry_t, plb_link);
    110                 plb_entry_t *newest = list_get_instance(plb_head.prev,
    111                     plb_entry_t, plb_link);
     108                plb_entry_t *oldest = list_get_instance(
     109                    list_first(&plb_entries), plb_entry_t, plb_link);
     110                plb_entry_t *newest = list_get_instance(
     111                    list_last(&plb_entries), plb_entry_t, plb_link);
    112112
    113113                first = (newest->index + newest->len) % PLB_SIZE;
     
    145145         * buffer.
    146146         */
    147         list_append(&entry.plb_link, &plb_head);
     147        list_append(&entry.plb_link, &plb_entries);
    148148       
    149149        fibril_mutex_unlock(&plb_mutex);
     
    162162        aid_t req = async_send_5(exch, VFS_OUT_LOOKUP, (sysarg_t) first,
    163163            (sysarg_t) (first + len - 1) % PLB_SIZE,
    164             (sysarg_t) root->devmap_handle, (sysarg_t) lflag, (sysarg_t) index,
     164            (sysarg_t) root->service_id, (sysarg_t) lflag, (sysarg_t) index,
    165165            &answer);
    166166       
     
    185185       
    186186        result->triplet.fs_handle = (fs_handle_t) rc;
    187         result->triplet.devmap_handle = (devmap_handle_t) IPC_GET_ARG1(answer);
     187        result->triplet.service_id = (service_id_t) IPC_GET_ARG1(answer);
    188188        result->triplet.index = (fs_index_t) IPC_GET_ARG2(answer);
    189189        result->size =
     
    201201}
    202202
    203 /** Perform a node open operation.
    204  *
    205  * @return EOK on success or an error code from errno.h.
    206  *
    207  */
    208 int vfs_open_node_internal(vfs_lookup_res_t *result)
    209 {
    210         async_exch_t *exch = vfs_exchange_grab(result->triplet.fs_handle);
    211        
    212         ipc_call_t answer;
    213         aid_t req = async_send_2(exch, VFS_OUT_OPEN_NODE,
    214             (sysarg_t) result->triplet.devmap_handle,
    215             (sysarg_t) result->triplet.index, &answer);
    216        
    217         sysarg_t rc;
    218         async_wait_for(req, &rc);
    219         vfs_exchange_release(exch);
    220        
    221         if (rc == EOK) {
    222                 result->size =
    223                     MERGE_LOUP32(IPC_GET_ARG1(answer), IPC_GET_ARG2(answer));
    224                 result->lnkcnt = (unsigned int) IPC_GET_ARG3(answer);
    225                 if (IPC_GET_ARG4(answer) & L_FILE)
    226                         result->type = VFS_NODE_FILE;
    227                 else if (IPC_GET_ARG4(answer) & L_DIRECTORY)
    228                         result->type = VFS_NODE_DIRECTORY;
    229                 else
    230                         result->type = VFS_NODE_UNKNOWN;
    231         }
    232        
    233         return rc;
    234 }
    235 
    236203/**
    237204 * @}
Note: See TracChangeset for help on using the changeset viewer.