Changeset 3142a5c8 in rtems


Ignore:
Timestamp:
Jun 17, 2010, 10:10:20 PM (9 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10
Children:
e66a39f
Parents:
d25f741
Message:

2010-06-18 Chris Johns <chrisj@…>

  • libfs/src/rfs/rtems-rfs-file-block.c: Clean up uint64_t maths.
  • libfs/src/rfs/rtems-rfs-file-system.h, libfs/src/rfs/rtems-rfs-file-system.c: Move questionable macros to C functions.
Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rd25f741 r3142a5c8  
     12010-06-18      Chris Johns <chrisj@rtems.org>
     2
     3        * libfs/src/rfs/rtems-rfs-file-block.c: Clean up uint64_t
     4        maths.
     5
     6        * libfs/src/rfs/rtems-rfs-file-system.h,
     7        libfs/src/rfs/rtems-rfs-file-system.c: Move
     8        questionable macros to C functions.
     9
    1102010-06-17      Joel Sherrill <joel.sherrilL@OARcorp.com>
    211
  • cpukit/libfs/src/rfs/rtems-rfs-block.c

    rd25f741 r3142a5c8  
    8989{
    9090  uint32_t offset;
     91  uint64_t block_size;
    9192  if (size->count == 0)
    9293    return 0;
     
    9596  else
    9697    offset = size->offset;
    97   return (((uint64_t) (size->count - 1)) * rtems_rfs_fs_block_size (fs)) + offset;
     98  block_size = rtems_rfs_fs_block_size (fs);
     99  return (((uint64_t) (size->count - 1)) * block_size) + offset;
    98100}
    99101
  • cpukit/libfs/src/rfs/rtems-rfs-file-system.c

    rd25f741 r3142a5c8  
    2828#include <rtems/rfs/rtems-rfs-inode.h>
    2929#include <rtems/rfs/rtems-rfs-trace.h>
     30
     31uint64_t
     32rtems_rfs_fs_size (rtems_rfs_file_system* fs)
     33{
     34  uint64_t blocks = rtems_rfs_fs_blocks (fs);
     35  uint64_t block_size = rtems_rfs_fs_block_size (fs);
     36  return blocks * block_size;
     37}
     38
     39uint64_t
     40rtems_rfs_fs_media_size (rtems_rfs_file_system* fs)
     41{
     42  uint64_t media_blocks = (uint64_t) rtems_rfs_fs_media_blocks (fs);
     43  uint64_t media_block_size = (uint64_t) rtems_rfs_fs_media_block_size (fs);
     44  return media_blocks * media_block_size;
     45}
    3046
    3147static int
  • cpukit/libfs/src/rfs/rtems-rfs-file-system.h

    rd25f741 r3142a5c8  
    305305
    306306/**
    307  * The size of the disk in bytes.
    308  *
    309  * @param _fs Pointer to the file system.
    310  */
    311 #define rtems_rfs_fs_size(_fs) (((uint64_t) rtems_rfs_fs_blocks (_fs)) * \
    312                                 rtems_rfs_fs_block_size (_fs))
    313 
    314 /**
    315307 * The number of inodes.
    316308 *
     
    355347
    356348/**
    357  * The size of the disk in bytes.
    358  *
    359  * @param _fs Pointer to the file system.
    360  */
    361 #define rtems_rfs_fs_media_size(_fs) (((uint64_t) rtems_rfs_fs_media_blocks (_fs)) * \
    362                                       rtems_rfs_fs_media_block_size (_fs))
    363 
    364 /**
    365349 * The maximum length of a name supported by the file system.
    366350 */
     
    378362 */
    379363#define rtems_rfs_fs_user(_fs) ((_fs)->user)
     364
     365/**
     366 * Return the size of the disk in bytes.
     367 *
     368 * @param fs Pointer to the file system.
     369 * @return uint64_t The size of the disk in bytes.
     370 */
     371uint64_t rtems_rfs_fs_size(rtems_rfs_file_system* fs);
     372
     373/**
     374 * The size of the disk in bytes calculated from the media parameters..
     375 *
     376 * @param fs Pointer to the file system.
     377 * @return uint64_t The size of the disk in bytes.
     378 */
     379uint64_t rtems_rfs_fs_media_size (rtems_rfs_file_system* fs);
    380380
    381381/**
Note: See TracChangeset for help on using the changeset viewer.