Ignore:
Timestamp:
Jul 21, 2017, 7:36:08 AM (5 years ago)
Author:
alain
Message:

Fix several bugs in VFS.

File:
1 edited

Legend:

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

    r246 r265  
    5151 * - The mapper_get_page() function that return a page descriptor pointer from a page
    5252 *   index in file is in charge of handling the miss on the mapper cache.
    53  * - The vfs_mapper_move_page() function is used to handle miss on one specific page,
     53 * - The vfs_mapper_move_page() function access the file system to handle a mapper miss,
    5454 *   or update a dirty page on device.
    55  * - The vfs_mapper_load_all() functions is used to load all pages of a given directory
    56  *   into the mapper.
    57  * - the mapper_move() function is used to move data to or from an user buffer.
     55 * - The vfs_mapper_load_all() functions is used to load all pages of a given file
     56 *   or directory into the mapper.
     57 * - the mapper_move_user() function is used to move data to or from an user buffer.
    5858 *   This user space buffer can be physically distributed in several clusters.
    5959 * - In the present implementation the cache size for a given file increases on demand,
     
    117117
    118118/*******************************************************************************************
    119  * This function move data between a kernel mapper and an user buffer.
     119 * This function move data between a mapper and an user or kernel buffer.
    120120 * It must be called by a thread running in the cluster containing the mapper.
    121  * It split the data in fragments : one fragment is a set of contiguous bytes
    122  * stored in the same mapper page. 
    123  * It uses "hal_uspace" accesses to move fragments to/from the user buffer.
     121 * - A kernel buffer must be entirely contained in the same cluster as the mapper.
     122 * - An user buffer can be physically distributed in several clusters.
     123 * In both cases, the data transfer is split in "fragments": one fragment contains
     124 * contiguous bytes in the same mapper page.
     125 * - It uses "hal_uspace" accesses to move a fragment to/from the user buffer.
     126 * - It uses a simple memcpy" access to move a fragment to/from a kernel buffer.
    124127 * In case of write, the dirty bit is set for all pages written in the mapper.
    125128 * The offset in the file descriptor is not modified by this function.
    126129 *******************************************************************************************
    127  * @ mapper       : local pointer on local mapper.
    128  * @ to_buffer    : move data from mapper to buffer if true.
     130 * @ mapper       : local pointer on mapper.
     131 * @ to_buffer    : mapper -> buffer if true / buffer -> mapper if false.
     132 * @ is_user      : user space buffer if true / kernel local buffer if false.
    129133 * @ file_offset  : first byte to move in file.
    130  * @ buffer       : buffer address in user space.
     134 * @ buffer       : pointer on buffer (local kernel buffer or user spaceaddress in user space.
    131135 * @ size         : number of bytes to move.
    132136 * returns O if success / returns EINVAL if error.
    133137 ******************************************************************************************/
    134 error_t mapper_move( mapper_t * mapper,
    135                      bool_t     to_buffer,
    136                      uint32_t   file_offset,
    137                      void     * buffer,
    138                      uint32_t   size );
     138error_t mapper_move_buffer( mapper_t * mapper,
     139                            bool_t     to_buffer,
     140                            bool_t     is_user,
     141                            uint32_t   file_offset,
     142                            void     * buffer,
     143                            uint32_t   size );
    139144
    140145/*******************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.