Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset b72efe8 in mainline for uspace/srv/vfs/vfs_lookup.c


Ignore:
Timestamp:
2011-06-19T14:38:59Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
74464e8
Parents:
1d1bb0f
Message:

Separate list_t typedef from link_t (user-space part).

  • list_t represents lists
  • Use list_first(), list_last(), list_empty() where appropriate
  • Use list_foreach() where possible
  • assert_link_not_used()
  • usb_hid_report_path_free() shall not unlink the path, caller must do it
File:
1 edited

Legend:

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

    r1d1bb0f rb72efe8  
    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);
Note: See TracChangeset for help on using the changeset viewer.