Changeset 238 for trunk/kernel/mm


Ignore:
Timestamp:
Jul 19, 2017, 3:31:39 PM (7 years ago)
Author:
alain
Message:

Fixing bugs in vfs_lookup()

Location:
trunk/kernel/mm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/mapper.c

    r204 r238  
    164164        page = grdxt_lookup( &mapper->radix , index );
    165165
    166         if ( page == NULL )   // missing page => load it from file system
     166        if ( page == NULL )   // missing page => create it and load it from file system
    167167        {
    168168            mapper_dmsg("\n[INFO] %s : missing page => load from FS\n", __FUNCTION__ );
     
    208208            }
    209209
     210            // update the mapper and index fields in page descriptor
     211            // required by the vfs_move_page_to_mapper()
     212            page->mapper = mapper;
     213            page->index  = index;
     214
    210215            // launch I/O operation to load page from file system
    211             error = vfs_move_page_to_mapper( page );
     216            error = vfs_mapper_move_page( page , true );   // to mapper
    212217
    213218            if( error )
     
    223228            }
    224229
    225             // update the mapper and index fields in page descriptor
    226             page->mapper = mapper;
    227             page->index  = index;
    228 
    229230            // reset the page INLOAD flag to make the page available to all readers
    230231            page_clear_flag( page , PG_INLOAD );
     
    267268
    268269    // lauch IO operation to update page to file system
    269     error = vfs_move_page_from_mapper( page );
     270    error = vfs_mapper_move_page( page , false );    // from mapper
    270271
    271272    if( error )
  • trunk/kernel/mm/mapper.h

    r204 r238  
    4949 * - The mapper is protected by a blocking "rwlock", to support several simultaneous
    5050 *   readers, and only one writer. This lock implement a busy waiting policy.
    51  * - The two functions vfs_move_page_to_mapper() and vfs_move_page_from_mapper() define
    52  *   the generic API used to move pages to or from the relevant file system.
    53  * - the mapper_move() function is used to move data to or from a, possibly distributed
    54  *   user buffer in user space.
     51 * - The vfs_mapper_move_page() and vfs_mapper_load_all() functions are used to move
     52 *   pages to or from the file system on device.
     53 * - the mapper_move() function is used to move data to or from an user buffer.
     54 *   This user space buffer can be physically distributed in several clusters.
    5555 * - The mapper_get_page() function that return a page descriptor pointer from a page
    5656 *   index in file is in charge of handling the miss on the mapper cache.
  • trunk/kernel/mm/page.c

    r149 r238  
    147147
    148148                // sync the page
    149                 vfs_move_page_from_mapper( page );
     149                vfs_mapper_move_page( page , false );  // from mapper
    150150
    151151                // unlock the page
Note: See TracChangeset for help on using the changeset viewer.