Changeset 40284de in rtems


Ignore:
Timestamp:
May 30, 2012, 10:43:56 AM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
2c6cc3c
Parents:
b6911069
git-author:
Sebastian Huber <sebastian.huber@…> (05/30/12 10:43:56)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/31/12 09:05:48)
Message:

libblock: Remove const qualifier from bdbuf API

This allows addtion of per disk statistics for example.

Files:
20 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/include/rtems/bdbuf.h

    rb6911069 r40284de  
    491491rtems_status_code
    492492rtems_bdbuf_get (
    493   const rtems_disk_device *dd,
     493  rtems_disk_device *dd,
    494494  rtems_blkdev_bnum block,
    495495  rtems_bdbuf_buffer** bd
     
    525525rtems_status_code
    526526rtems_bdbuf_read (
    527   const rtems_disk_device *dd,
     527  rtems_disk_device *dd,
    528528  rtems_blkdev_bnum block,
    529529  rtems_bdbuf_buffer** bd
     
    617617 */
    618618rtems_status_code
    619 rtems_bdbuf_syncdev (const rtems_disk_device *dd);
     619rtems_bdbuf_syncdev (rtems_disk_device *dd);
    620620
    621621/**
     
    631631 */
    632632void
    633 rtems_bdbuf_purge_dev (const rtems_disk_device *dd);
     633rtems_bdbuf_purge_dev (rtems_disk_device *dd);
    634634
    635635/**
  • cpukit/libblock/include/rtems/bdpart.h

    rb6911069 r40284de  
    401401  const char *disk_name,
    402402  int *fd_ptr,
    403   const rtems_disk_device **dd_ptr,
     403  rtems_disk_device **dd_ptr,
    404404  rtems_blkdev_bnum *disk_end
    405405);
  • cpukit/libblock/include/rtems/blkdev.h

    rb6911069 r40284de  
    193193static inline int rtems_disk_fd_get_disk_device(
    194194  int fd,
    195   const rtems_disk_device **dd_ptr
     195  rtems_disk_device **dd_ptr
    196196)
    197197{
  • cpukit/libblock/src/bdbuf.c

    rb6911069 r40284de  
    17751775
    17761776rtems_status_code
    1777 rtems_bdbuf_get (const rtems_disk_device *dd,
     1777rtems_bdbuf_get (rtems_disk_device  *dd,
    17781778                 rtems_blkdev_bnum    block,
    17791779                 rtems_bdbuf_buffer **bd_ptr)
     
    19931993
    19941994rtems_status_code
    1995 rtems_bdbuf_read (const rtems_disk_device *dd,
     1995rtems_bdbuf_read (rtems_disk_device  *dd,
    19961996                  rtems_blkdev_bnum    block,
    19971997                  rtems_bdbuf_buffer **bd_ptr)
     
    21772177
    21782178rtems_status_code
    2179 rtems_bdbuf_syncdev (const rtems_disk_device *dd)
     2179rtems_bdbuf_syncdev (rtems_disk_device *dd)
    21802180{
    21812181  if (rtems_bdbuf_tracer)
     
    28782878
    28792879void
    2880 rtems_bdbuf_purge_dev (const rtems_disk_device *dd)
     2880rtems_bdbuf_purge_dev (rtems_disk_device *dd)
    28812881{
    28822882  rtems_chain_control purge_list;
  • cpukit/libblock/src/bdpart-read.c

    rb6911069 r40284de  
    6969  const char *disk_name,
    7070  int *fd_ptr,
    71   const rtems_disk_device **dd_ptr,
     71  rtems_disk_device **dd_ptr,
    7272  rtems_blkdev_bnum *disk_end
    7373)
     
    7676  int rv = 0;
    7777  int fd = -1;
    78   const rtems_disk_device *dd = NULL;
     78  rtems_disk_device *dd = NULL;
    7979  rtems_blkdev_bnum disk_begin = 0;
    8080  rtems_blkdev_bnum block_size = 0;
     
    186186
    187187static rtems_status_code rtems_bdpart_read_record(
    188   const rtems_disk_device *dd,
     188  rtems_disk_device *dd,
    189189  rtems_blkdev_bnum index,
    190190  rtems_bdbuf_buffer **block
     
    238238  const uint8_t *data = NULL;
    239239  int fd = -1;
    240   const rtems_disk_device *dd = NULL;
     240  rtems_disk_device *dd = NULL;
    241241
    242242  /* Check parameter */
  • cpukit/libblock/src/bdpart-register.c

    rb6911069 r40284de  
    4949  size_t i = 0;
    5050  int fd = -1;
    51   const rtems_disk_device *dd = NULL;
     51  rtems_disk_device *dd = NULL;
    5252
    5353  /* Get disk data */
     
    140140  size_t i = 0;
    141141  int fd = -1;
    142   const rtems_disk_device *dd = NULL;
     142  rtems_disk_device *dd = NULL;
    143143
    144144  /* Get disk data */
  • cpukit/libblock/src/bdpart-write.c

    rb6911069 r40284de  
    4646
    4747static rtems_status_code rtems_bdpart_new_record(
    48   const rtems_disk_device *dd,
     48  rtems_disk_device *dd,
    4949  rtems_blkdev_bnum index,
    5050  rtems_bdbuf_buffer **block
     
    104104  uint8_t *data = NULL;
    105105  int fd = -1;
    106   const rtems_disk_device *dd = NULL;
     106  rtems_disk_device *dd = NULL;
    107107
    108108  /* Check if we have something to do */
  • cpukit/libblock/src/blkdev-imfs.c

    rb6911069 r40284de  
    3939{
    4040  int rv;
    41   const rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
    42   const rtems_disk_device *dd = &ctx->dd;
     41  rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
     42  rtems_disk_device *dd = &ctx->dd;
    4343  ssize_t remaining = (ssize_t) count;
    4444  off_t offset = iop->offset;
     
    9393{
    9494  int rv;
    95   const rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
    96   const rtems_disk_device *dd = &ctx->dd;
     95  rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
     96  rtems_disk_device *dd = &ctx->dd;
    9797  ssize_t remaining = (ssize_t) count;
    9898  off_t offset = iop->offset;
     
    175175)
    176176{
    177   const rtems_blkdev_imfs_context *ctx =
     177  rtems_blkdev_imfs_context *ctx =
    178178    IMFS_generic_get_context_by_location(loc);
    179   const rtems_disk_device *dd = &ctx->dd;
     179  rtems_disk_device *dd = &ctx->dd;
    180180
    181181  buf->st_rdev = rtems_disk_get_device_identifier(dd);
     
    191191{
    192192  int rv = 0;
    193   const rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
    194   const rtems_disk_device *dd = &ctx->dd;
     193  rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
     194  rtems_disk_device *dd = &ctx->dd;
    195195  rtems_status_code sc = rtems_bdbuf_syncdev(dd);
    196196
     
    333333      rtems_disk_device *dd;
    334334
    335       rv = ioctl(fd, RTEMS_BLKIO_GETDISKDEV, &dd);
     335      rv = rtems_disk_fd_get_disk_device(fd, &dd);
    336336      if (rv == 0) {
    337337        rtems_blkdev_bnum device_block_count = rtems_disk_get_block_count(dd);
  • testsuites/fstests/fsbdpart01/init.c

    rb6911069 r40284de  
    8181
    8282    if (exists) {
    83       const rtems_disk_device *dd = NULL;
     83      rtems_disk_device *dd = NULL;
    8484      int rv = 0;
    8585
  • testsuites/libtests/block01/init.c

    rb6911069 r40284de  
    4949  rtems_status_code sc = RTEMS_SUCCESSFUL;
    5050  rtems_disk_device *dd = NULL;
    51   const rtems_disk_device *fd_dd = NULL;
     51  rtems_disk_device *fd_dd = NULL;
    5252  int fd = -1;
    5353  int rv = -1;
  • testsuites/libtests/block02/init.c

    rb6911069 r40284de  
    5353#define BLOCK_COUNT_B 1
    5454
    55 static const rtems_disk_device *dd_a;
    56 
    57 static const rtems_disk_device *dd_b;
     55static rtems_disk_device *dd_a;
     56
     57static rtems_disk_device *dd_b;
    5858
    5959static volatile bool sync_done = false;
  • testsuites/libtests/block03/init.c

    rb6911069 r40284de  
    4949#define BLOCK_COUNT 2
    5050
    51 static const rtems_disk_device *dd;
     51static rtems_disk_device *dd;
    5252
    5353static volatile bool sync_done = false;
  • testsuites/libtests/block04/init.c

    rb6911069 r40284de  
    4949#define BLOCK_COUNT 1
    5050
    51 static const rtems_disk_device *dd;
     51static rtems_disk_device *dd;
    5252
    5353static rtems_id task_id_low;
  • testsuites/libtests/block05/init.c

    rb6911069 r40284de  
    6161static unsigned output_level = 0;
    6262
    63 static const rtems_disk_device *dd_a;
    64 
    65 static const rtems_disk_device *dd_b;
     63static rtems_disk_device *dd_a;
     64
     65static rtems_disk_device *dd_b;
    6666
    6767static rtems_id task_id_init;
     
    394394  uint32_t block_size,
    395395  rtems_blkdev_bnum block_count,
    396   const rtems_disk_device **dd_ptr
     396  rtems_disk_device **dd_ptr
    397397)
    398398{
  • testsuites/libtests/block06/init.c

    rb6911069 r40284de  
    109109  rtems_device_minor_number minor;
    110110  bool                      passed;
    111   const rtems_disk_device  *dd;
     111  rtems_disk_device        *dd;
    112112} bdbuf_task_control;
    113113
     
    346346                         rtems_id                  master,
    347347                         rtems_device_major_number major,
    348                          const rtems_disk_device  *dd)
     348                         rtems_disk_device        *dd)
    349349{
    350350  char name[6];
     
    615615
    616616static bool
    617 bdbuf_tests_setup_disk (rtems_device_major_number* major,
    618                         const rtems_disk_device **dd_ptr)
     617bdbuf_tests_setup_disk (rtems_device_major_number *major,
     618                        rtems_disk_device        **dd_ptr)
    619619{
    620620  rtems_status_code sc;
     
    17661766  int                       t;
    17671767  bool                      passed = true;
    1768   const rtems_disk_device *dd;
     1768  rtems_disk_device        *dd;
    17691769
    17701770  /*
  • testsuites/libtests/block08/bdbuf_tests.c

    rb6911069 r40284de  
    4848
    4949/** Device ID used for testing */
    50 const rtems_disk_device *test_dd = NULL;
     50rtems_disk_device *test_dd = NULL;
    5151
    5252/** Test result variable */
  • testsuites/libtests/block08/bdbuf_tests.h

    rb6911069 r40284de  
    151151
    152152/** Device ID used for testing */
    153 extern const rtems_disk_device *test_dd;
     153extern rtems_disk_device *test_dd;
    154154
    155155/**
  • testsuites/libtests/block09/init.c

    rb6911069 r40284de  
    144144
    145145static void check_read(
    146   const rtems_disk_device *dd,
     146  rtems_disk_device *dd,
    147147  rtems_blkdev_bnum block,
    148148  rtems_status_code expected_sc
  • testsuites/libtests/block10/init.c

    rb6911069 r40284de  
    5656typedef void (*release_func)(char task, rtems_bdbuf_buffer *bd);
    5757
    58 static const rtems_disk_device *dd;
     58static rtems_disk_device *dd;
    5959
    6060static rtems_id task_id_init;
  • testsuites/libtests/block11/init.c

    rb6911069 r40284de  
    158158  ramdisk *rd;
    159159  int fd;
    160   const rtems_disk_device *dd;
     160  rtems_disk_device *dd;
    161161  struct stat st;
    162162
Note: See TracChangeset for help on using the changeset viewer.