Changeset 8b96149 in rtems for cpukit/libblock/src/bdbuf.c


Ignore:
Timestamp:
Apr 17, 2004, 8:15:17 AM (17 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
d63a2c2
Parents:
714f06c
Message:

Remove stray white spaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/bdbuf.c

    r714f06c r8b96149  
    6262
    6363    Chain_Control  mod;          /* Modified buffers list */
    64     rtems_id       flush_sema;   /* Buffer flush semaphore; counting 
     64    rtems_id       flush_sema;   /* Buffer flush semaphore; counting
    6565                                    semaphore; incremented when buffer
    66                                     flushed to the disk; decremented when 
     66                                    flushed to the disk; decremented when
    6767                                    buffer modified */
    6868    rtems_id       swapout_task; /* Swapout task ID */
     
    463463        r = q->avl.left;
    464464        if (r != NULL)
    465         {   
     465        {
    466466            r->avl.bal = 0;
    467467        }
     
    763763
    764764/* rtems_bdbuf_init --
    765  *     Prepare buffering layer to work - initialize buffer descritors 
     765 *     Prepare buffering layer to work - initialize buffer descritors
    766766 *     and (if it is neccessary)buffers. Buffers will be allocated accoriding
    767  *     to the configuration table, each entry describes kind of block and 
     767 *     to the configuration table, each entry describes kind of block and
    768768 *     amount requested. After initialization all blocks is placed into
    769769 *     free elements lists.
     
    832832        rtems_build_name('B', 'S', 'W', 'P'),
    833833        SWAPOUT_PRIORITY,
    834         SWAPOUT_STACK_SIZE, 
     834        SWAPOUT_STACK_SIZE,
    835835        RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
    836836        RTEMS_DEFAULT_ATTRIBUTES,
     
    863863 *     obtain block buffer. If specified block already cached (i.e. there's
    864864 *     block in the _modified_, or _recently_used_), return address
    865  *     of appropriate buffer descriptor and increment reference counter to 1. 
    866  *     If block is not cached, allocate new buffer and return it. Data 
    867  *     shouldn't be read to the buffer from media; buffer contains arbitrary 
    868  *     data. This primitive may be blocked if there are no free buffer 
    869  *     descriptors available and there are no unused non-modified (or 
     865 *     of appropriate buffer descriptor and increment reference counter to 1.
     866 *     If block is not cached, allocate new buffer and return it. Data
     867 *     shouldn't be read to the buffer from media; buffer contains arbitrary
     868 *     data. This primitive may be blocked if there are no free buffer
     869 *     descriptors available and there are no unused non-modified (or
    870870 *     synchronized with media) buffers available.
    871871 *
     
    887887static rtems_status_code
    888888find_or_assign_buffer(disk_device *dd,
    889                       blkdev_bnum block, 
     889                      blkdev_bnum block,
    890890                      bdbuf_buffer **ret_buf)
    891891{
     
    909909    {
    910910        /* Try to obtain semaphore without waiting first. It is the most
    911            frequent case when reasonable number of buffers configured. If 
    912            it is failed, obtain semaphore blocking on it. In this case 
    913            it should be checked that appropriate buffer hasn't been loaded 
     911           frequent case when reasonable number of buffers configured. If
     912           it is failed, obtain semaphore blocking on it. In this case
     913           it should be checked that appropriate buffer hasn't been loaded
    914914           by another thread, because this thread is preempted */
    915915        rc = rtems_semaphore_obtain(bd_pool->bufget_sema, RTEMS_NO_WAIT, 0);
     
    932932            if (bd_buf != NULL)
    933933            {
    934                 int avl_result; 
     934                int avl_result;
    935935                avl_result = avl_remove(&bd_pool->tree, bd_buf);
    936936                if (avl_result != 0)
     
    987987            if (bd_buf->modified)
    988988            {
    989                 rc = rtems_semaphore_obtain(bd_ctx.flush_sema, 
     989                rc = rtems_semaphore_obtain(bd_ctx.flush_sema,
    990990                                            RTEMS_NO_WAIT, 0);
    991991            }
    992992            else
    993993            {
    994                 rc = rtems_semaphore_obtain(bd_pool->bufget_sema, 
     994                rc = rtems_semaphore_obtain(bd_pool->bufget_sema,
    995995                                            RTEMS_NO_WAIT, 0);
    996996            }
    997             /* It is possible that we couldn't obtain flush or bufget sema 
     997            /* It is possible that we couldn't obtain flush or bufget sema
    998998             * although buffer in the appropriate chain is available:
    999              * semaphore may be released to swapout task, but this task 
     999             * semaphore may be released to swapout task, but this task
    10001000             * actually did not start to process it. */
    10011001            if (rc == RTEMS_UNSATISFIED)
     
    10271027 *     Obtain block buffer. If specified block already cached (i.e. there's
    10281028 *     block in the _modified_, or _recently_used_), return address
    1029  *     of appropriate buffer descriptor and increment reference counter to 1. 
    1030  *     If block is not cached, allocate new buffer and return it. Data 
    1031  *     shouldn't be read to the buffer from media; buffer may contains 
    1032  *     arbitrary data. This primitive may be blocked if there are no free 
    1033  *     buffer descriptors available and there are no unused non-modified 
     1029 *     of appropriate buffer descriptor and increment reference counter to 1.
     1030 *     If block is not cached, allocate new buffer and return it. Data
     1031 *     shouldn't be read to the buffer from media; buffer may contains
     1032 *     arbitrary data. This primitive may be blocked if there are no free
     1033 *     buffer descriptors available and there are no unused non-modified
    10341034 *     (or synchronized with media) buffers available.
    10351035 *
     
    10941094    mutex_attr.priority_ceiling = 0;
    10951095
    1096     _CORE_mutex_Initialize(&bd_buf->transfer_sema, 
     1096    _CORE_mutex_Initialize(&bd_buf->transfer_sema,
    10971097                           &mutex_attr, CORE_MUTEX_LOCKED);
    10981098}
     
    11211121    bd_buf->in_progress = bd_buf->modified = FALSE;
    11221122    _CORE_mutex_Surrender(&bd_buf->transfer_sema, 0, NULL);
    1123     _CORE_mutex_Flush(&bd_buf->transfer_sema, NULL, 
     1123    _CORE_mutex_Flush(&bd_buf->transfer_sema, NULL,
    11241124                      CORE_MUTEX_STATUS_SUCCESSFUL);
    11251125}
     
    11471147    bd_buf->error = RTEMS_IO_ERROR;
    11481148    _CORE_mutex_Surrender(&bd_buf->transfer_sema, 0, NULL);
    1149     _CORE_mutex_Flush(&bd_buf->transfer_sema, NULL, 
     1149    _CORE_mutex_Flush(&bd_buf->transfer_sema, NULL,
    11501150                      CORE_MUTEX_STATUS_SUCCESSFUL);
    11511151}
     
    11731173 */
    11741174rtems_status_code
    1175 rtems_bdbuf_read(dev_t device, 
     1175rtems_bdbuf_read(dev_t device,
    11761176                 blkdev_bnum block,
    11771177                 bdbuf_buffer **bd)
     
    12951295        else
    12961296        {
    1297             /* Buffer was not modified. Add this descriptor to the 
     1297            /* Buffer was not modified. Add this descriptor to the
    12981298             * end of lru chain and make it available for reuse. */
    12991299            Chain_Append(&bd_pool->lru, &bd_buf->link);
     
    13151315 * PARAMETERS:
    13161316 *     bd_buf - pointer to the bdbuf_buffer structure previously obtained using
    1317  *              get/read primitive. 
     1317 *              get/read primitive.
    13181318 *
    13191319 * RETURNS:
     
    13441344/* rtems_bdbuf_release_modified --
    13451345 *     Release buffer allocated before, assuming that it is _modified_ by
    1346  *     it's owner. This primitive decrease usage counter for buffer, mark 
     1346 *     it's owner. This primitive decrease usage counter for buffer, mark
    13471347 *     buffer descriptor as modified. If usage counter is 0, insert it at
    13481348 *     end of mod chain and release flush_sema semaphore to activate the
     
    13771377    bd_buf->modified = TRUE;
    13781378    bd_buf->actual = TRUE;
    1379     rc = bdbuf_release(bd_buf);   
     1379    rc = bdbuf_release(bd_buf);
    13801380
    13811381    ENABLE_PREEMPTION(key);
     
    14801480 *     disk.
    14811481 */
    1482 static rtems_task 
     1482static rtems_task
    14831483bdbuf_swapout_task(rtems_task_argument unused)
    14841484{
     
    15221522        req.req.bufs[0].buffer = bd_buf->buffer;
    15231523
    1524         /* transfer_sema initialized when bd_buf inserted in the mod chain 
     1524        /* transfer_sema initialized when bd_buf inserted in the mod chain
    15251525           first time */
    15261526        result = dd->ioctl(dd->phys_dev->dev, BLKIO_REQUEST, &req);
     
    15761576 * RETURNS:
    15771577 *     RTEMS status code: RTEMS_SUCCESSFUL if operation completed successfully,
    1578  *     RTEMS_INVALID_SIZE if specified block size is invalid (not a power 
     1578 *     RTEMS_INVALID_SIZE if specified block size is invalid (not a power
    15791579 *     of 2), RTEMS_NOT_DEFINED if buffer pool for this or greater block size
    15801580 *     is not configured.
     
    16241624 *     block_size - block size for which buffer pool is configured returned
    16251625 *                  there
    1626  *     blocks     - number of buffers in buffer pool returned there 
     1626 *     blocks     - number of buffers in buffer pool returned there
    16271627 *
    16281628 * RETURNS:
Note: See TracChangeset for help on using the changeset viewer.