Ignore:
Timestamp:
Mar 18, 2020, 11:16:59 PM (4 years ago)
Author:
alain
Message:

Introduce remote_buf.c/.h & socket.c/.h files.
Update dev_nic.c/.h files.

File:
1 edited

Legend:

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

    r656 r657  
    6161 * - In the present implementation the cache size for a given file increases on demand,
    6262 *   and the  allocated memory is only released when the mapper/inode is destroyed.
    63  *
    64  * TODO the "type" field in mapper descriptor is redundant and probably unused.
    6563 ******************************************************************************************/
    6664
     
    7371{
    7472        struct vfs_inode_s * inode;           /*! owner inode                                     */
    75     uint32_t             type;        /*! file system type                                */
     73    uint32_t             fs_type;     /*! file system type                                */
    7674        grdxt_t              rt;              /*! embedded pages cache descriptor (radix tree)    */
    7775        remote_rwlock_t      lock;        /*! several readers / only one writer               */
     
    8482
    8583/*******************************************************************************************
    86  * This function allocates physical memory for a mapper descriptor, and initializes it
    87  * (refcount <= 0) / inode <= NULL).
    88  * It must be executed by a thread running in the cluster containing the mapper.
    89  *******************************************************************************************
    90  * @ type   : type of the mapper to create.
    91  * @ return : pointer on created mapper if success / return NULL if no memory
    92  ******************************************************************************************/
    93 mapper_t * mapper_create( vfs_fs_type_t type );
    94 
    95 /*******************************************************************************************
    96  * This function releases all physical memory allocated for a mapper.
    97  * Both the mapper descriptor and the radix tree are released.
     84 * This function allocates physical memory for a mapper descriptor, in cluster
     85 * identified by the <cxy> argument. It initializes it (refcount <= 0) / inode <= NULL).
     86 * It can be executed by any thread running in any cluster.
     87 *******************************************************************************************
     88 * @ cxy    : target cluster identifier.
     89 * @ type   : FS type.
     90 * @ return an extended pointer on created mapper if success / return NULL if no memory
     91 ******************************************************************************************/
     92xptr_t  mapper_create( cxy_t     cxy,
     93                       uint32_t  type );
     94
     95/*******************************************************************************************
     96 * This function releases all physical memory allocated for a mapper, identified
     97 * by the <mapper_xp> argument. Both the mapper descriptor and the radix tree are released.
    9898 * It does NOT synchronize dirty pages. Use the vfs_sync_inode() function if required.
    99  * It must be executed by a thread running in the cluster containing the mapper.
    100  *******************************************************************************************
    101  * @ mapper      : target mapper.
    102  ******************************************************************************************/
    103 void mapper_destroy( mapper_t * mapper );
     99 * It can be executed by any thread running in any cluster.
     100 *******************************************************************************************
     101 * @ mapper_xp   : extended pointer on target mapper.
     102 ******************************************************************************************/
     103void mapper_destroy( xptr_t  mapper_xp );
    104104
    105105/*******************************************************************************************
     
    117117 * @ return 0 if success / return -1 if IOC cannot be accessed.
    118118 ******************************************************************************************/
    119 error_t mapper_remote_handle_miss( xptr_t     mapper_xp,
    120                                    uint32_t   page_id,
    121                                    xptr_t   * page_xp );
     119error_t mapper_handle_miss( xptr_t     mapper_xp,
     120                            uint32_t   page_id,
     121                            xptr_t   * page_xp );
    122122
    123123/*******************************************************************************************
     
    180180
    181181/*******************************************************************************************
    182  * This function returns an extended pointer on a page descriptor.
    183  * The - possibly remote - mapper is identified by the <mapper_xp> argument.
     182 * This function returns an extended pointer on a page descriptor for a regular mapper
     183 * (i.e. this mapper is NOT the FAT mapper), identified by the <mapper_xp> argument.
    184184 * The page is identified by <page_id> argument (page index in the file).
    185185 * It can be executed by a thread running in any cluster, as it uses remote
     
    193193 * @ returns extended pointer on page descriptor if success / return XPTR_NULL if error.
    194194 ******************************************************************************************/
    195 xptr_t mapper_remote_get_page( xptr_t    mapper_xp,
    196                                uint32_t  page_id );
     195xptr_t mapper_get_page( xptr_t    mapper_xp,
     196                        uint32_t  page_id );
     197
     198/*******************************************************************************************
     199 * This function returns an extended pointer on a page descriptor for the FAT mapper.
     200 * The page is identified by <page_id> argument (page index in the FAT mapper).
     201 * It can be executed by a thread running in any cluster, as it uses remote
     202 * access primitives to scan the mapper.
     203 * In case of miss, this function takes the mapper lock in WRITE_MODE, and call the
     204 * mapper_handle_miss() to load the missing page from device to mapper, using an RPC
     205 * when the mapper is remote.
     206 *******************************************************************************************
     207 * @ mapper_xp  : extended pointer on the mapper.
     208 * @ page_id    : page index in file
     209 * @ returns extended pointer on page descriptor if success / return XPTR_NULL if error.
     210 ******************************************************************************************/
     211xptr_t mapper_get_fat_page( xptr_t    mapper_xp,
     212                            uint32_t  page_id );
    197213
    198214/*******************************************************************************************
     
    234250
    235251/*******************************************************************************************
    236  * This function scan all pages present in the mapper identified by the <mapper> argument,
    237  * and synchronize all pages marked as "dirty" on disk.
     252 * This function scan all pages present in the mapper identified by the <mapper_xp>
     253 * argument, and synchronize all pages marked as "dirty" on disk.
    238254 * These pages are unmarked and removed from the local PPM dirty_list.
    239  * This function must be called by a local thread running in same cluster as the mapper.
    240  * A remote thread must call the RPC_MAPPER_SYNC function.
    241  *******************************************************************************************
    242  * @ mapper     : [in]  local pointer on local mapper.
    243  * @ returns 0 if success / return -1 if error.
    244  ******************************************************************************************/
    245 error_t mapper_sync( mapper_t *  mapper );
     255 * It can be called by any thread running in any cluster.
     256 *******************************************************************************************
     257 * @ mapper_xp  : [in]  extended pointer on local mapper.
     258 * @ returns 0 if success / return -1 if error.
     259 ******************************************************************************************/
     260error_t mapper_sync( xptr_t  mapper_xp );
    246261
    247262/*******************************************************************************************
    248263 * This debug function displays the content of a given page of a given mapper, identified
    249  * by the <mapper_xp> and <page_xp> arguments.
     264 * by the <mapper_xp> and <page_id> arguments.
    250265 * The number of bytes to display in page is defined by the <nbytes> argument.
    251266 * The format is eigth (32 bits) words per line in hexadecimal.
     
    253268 *******************************************************************************************
    254269 * @ mapper_xp  : [in]  extended pointer on the mapper.
    255  * @ page_xp    : [in]  extended pointer on page descriptor.
     270 * @ page_id    : [in]  page_index in mapper.
    256271 * @ nbytes     : [in]  number of bytes in page.
    257272 * @ returns 0 if success / return -1 if error.
    258273 ******************************************************************************************/
    259274void mapper_display_page( xptr_t     mapper_xp,
    260                           xptr_t     page_xp,
     275                          uint32_t   page_id,
    261276                          uint32_t   nbytes );
    262277
Note: See TracChangeset for help on using the changeset viewer.