Ignore:
Timestamp:
Dec 6, 2019, 12:07:51 PM (4 years ago)
Author:
alain
Message:

Fix several bugs in the FATFS and in the VFS,
related to the creation of big files requiring
more than 4 Kbytes (one cluster) on device.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/list.h

    r651 r656  
    11/*
    2  * list.h - Double circular linked list
     2 * list.h - Local double circular linked list, using local pointers.
    33 *
    44 * Authors Ghassan Almaless  (2008,2009,2010,2011,2012)
     
    9191
    9292/***************************************************************************
    93  * This macro returns t pointer on the first element of a list.
     93 * This macro returns a pointer on the first element of a list.
    9494 ***************************************************************************
    9595 * @ root     : pointer on the list root
     
    171171                                   list_entry_t * entry )
    172172{
    173     list_entry_t * next = root->next; 
    174 
    175         entry->next = next;
     173    list_entry_t * first = root->next; 
     174
     175        entry->next = first;
    176176        entry->pred = root;
    177177 
    178         root->next = entry;
    179         next->pred = entry;
     178        root->next  = entry;
     179        first->pred = entry;
    180180}
    181181
     
    190190                                  list_entry_t * entry )
    191191{
    192     list_entry_t * pred = root->pred;
     192    list_entry_t * last = root->pred;
    193193
    194194        entry->next = root;
    195         entry->pred = pred;
     195        entry->pred = last;
    196196 
    197197        root->pred = entry;
    198         pred->next = entry;
     198        last->next = entry;
    199199}
    200200
     
    366366                                          list_entry_t * entry )
    367367{
    368     list_entry_t * next = hal_remote_lpt( XPTR( cxy , &root->next ) );
     368    list_entry_t * first = hal_remote_lpt( XPTR( cxy , &root->next ) );
    369369       
    370         hal_remote_spt( XPTR( cxy , &entry->next ) , next );
     370        hal_remote_spt( XPTR( cxy , &entry->next ) , first );
    371371        hal_remote_spt( XPTR( cxy , &entry->pred ) , root );
    372372 
    373         hal_remote_spt( XPTR( cxy , &root->next ) , entry );
    374         hal_remote_spt( XPTR( cxy , &next->pred ) , entry );
     373        hal_remote_spt( XPTR( cxy , &root->next )  , entry );
     374        hal_remote_spt( XPTR( cxy , &first->pred ) , entry );
    375375}
    376376
     
    387387                                         list_entry_t * entry )
    388388{
    389     list_entry_t * pred = hal_remote_lpt( XPTR( cxy , &root->pred ) );
     389    list_entry_t * last = hal_remote_lpt( XPTR( cxy , &root->pred ) );
    390390       
    391391        hal_remote_spt( XPTR( cxy , &entry->next ) , root );
    392         hal_remote_spt( XPTR( cxy , &entry->pred ) , pred );
     392        hal_remote_spt( XPTR( cxy , &entry->pred ) , last );
    393393 
    394394        hal_remote_spt( XPTR( cxy , &root->pred ) , entry );
    395         hal_remote_spt( XPTR( cxy , &pred->next ) , entry );
     395        hal_remote_spt( XPTR( cxy , &last->next ) , entry );
    396396}
    397397
     
    401401 ***************************************************************************
    402402 * @ cxy     : remote list cluster identifier
    403  * @ entry   : pointer on the entry to be removed.
     403 * @ entry   : local pointer on the remote entry to be removed.
    404404 **************************************************************************/
    405405static inline void list_remote_unlink( cxy_t          cxy,
Note: See TracChangeset for help on using the changeset viewer.