diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-30 12:43:56 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-31 11:05:48 +0200 |
commit | 40284de8443df5e8f60420c11d2dcac09b6befb1 (patch) | |
tree | 0df3c57102c41b5dcf3b71144c73f4ef0b750e5f /cpukit/libblock | |
parent | libblock: Add task stack size bdbuf configuration (diff) | |
download | rtems-40284de8443df5e8f60420c11d2dcac09b6befb1.tar.bz2 |
libblock: Remove const qualifier from bdbuf API
This allows addtion of per disk statistics for example.
Diffstat (limited to 'cpukit/libblock')
-rw-r--r-- | cpukit/libblock/include/rtems/bdbuf.h | 8 | ||||
-rw-r--r-- | cpukit/libblock/include/rtems/bdpart.h | 2 | ||||
-rw-r--r-- | cpukit/libblock/include/rtems/blkdev.h | 2 | ||||
-rw-r--r-- | cpukit/libblock/src/bdbuf.c | 8 | ||||
-rw-r--r-- | cpukit/libblock/src/bdpart-read.c | 8 | ||||
-rw-r--r-- | cpukit/libblock/src/bdpart-register.c | 4 | ||||
-rw-r--r-- | cpukit/libblock/src/bdpart-write.c | 4 | ||||
-rw-r--r-- | cpukit/libblock/src/blkdev-imfs.c | 18 |
8 files changed, 27 insertions, 27 deletions
diff --git a/cpukit/libblock/include/rtems/bdbuf.h b/cpukit/libblock/include/rtems/bdbuf.h index ead40206d1..c065f4ec55 100644 --- a/cpukit/libblock/include/rtems/bdbuf.h +++ b/cpukit/libblock/include/rtems/bdbuf.h @@ -490,7 +490,7 @@ rtems_bdbuf_init (void); */ rtems_status_code rtems_bdbuf_get ( - const rtems_disk_device *dd, + rtems_disk_device *dd, rtems_blkdev_bnum block, rtems_bdbuf_buffer** bd ); @@ -524,7 +524,7 @@ rtems_bdbuf_get ( */ rtems_status_code rtems_bdbuf_read ( - const rtems_disk_device *dd, + rtems_disk_device *dd, rtems_blkdev_bnum block, rtems_bdbuf_buffer** bd ); @@ -616,7 +616,7 @@ rtems_bdbuf_sync (rtems_bdbuf_buffer* bd); * @retval RTEMS_SUCCESSFUL Successful operation. */ rtems_status_code -rtems_bdbuf_syncdev (const rtems_disk_device *dd); +rtems_bdbuf_syncdev (rtems_disk_device *dd); /** * @brief Purges all buffers corresponding to the disk device @a dd. @@ -630,7 +630,7 @@ rtems_bdbuf_syncdev (const rtems_disk_device *dd); * @param dd [in] The disk device. */ void -rtems_bdbuf_purge_dev (const rtems_disk_device *dd); +rtems_bdbuf_purge_dev (rtems_disk_device *dd); /** * @brief Sets the block size of a disk device. diff --git a/cpukit/libblock/include/rtems/bdpart.h b/cpukit/libblock/include/rtems/bdpart.h index 873b9d31f6..d1d81e733b 100644 --- a/cpukit/libblock/include/rtems/bdpart.h +++ b/cpukit/libblock/include/rtems/bdpart.h @@ -400,7 +400,7 @@ static inline uint8_t rtems_bdpart_mbr_partition_type( rtems_status_code rtems_bdpart_get_disk_data( const char *disk_name, int *fd_ptr, - const rtems_disk_device **dd_ptr, + rtems_disk_device **dd_ptr, rtems_blkdev_bnum *disk_end ); diff --git a/cpukit/libblock/include/rtems/blkdev.h b/cpukit/libblock/include/rtems/blkdev.h index 4df881bed3..7c2787204a 100644 --- a/cpukit/libblock/include/rtems/blkdev.h +++ b/cpukit/libblock/include/rtems/blkdev.h @@ -192,7 +192,7 @@ static inline int rtems_disk_fd_get_block_count( static inline int rtems_disk_fd_get_disk_device( int fd, - const rtems_disk_device **dd_ptr + rtems_disk_device **dd_ptr ) { return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr); diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c index 439da9883d..8c929f0b87 100644 --- a/cpukit/libblock/src/bdbuf.c +++ b/cpukit/libblock/src/bdbuf.c @@ -1774,7 +1774,7 @@ rtems_bdbuf_get_media_block (const rtems_disk_device *dd, } rtems_status_code -rtems_bdbuf_get (const rtems_disk_device *dd, +rtems_bdbuf_get (rtems_disk_device *dd, rtems_blkdev_bnum block, rtems_bdbuf_buffer **bd_ptr) { @@ -1992,7 +1992,7 @@ rtems_bdbuf_execute_transfer_request (const rtems_disk_device *dd, } rtems_status_code -rtems_bdbuf_read (const rtems_disk_device *dd, +rtems_bdbuf_read (rtems_disk_device *dd, rtems_blkdev_bnum block, rtems_bdbuf_buffer **bd_ptr) { @@ -2176,7 +2176,7 @@ rtems_bdbuf_sync (rtems_bdbuf_buffer *bd) } rtems_status_code -rtems_bdbuf_syncdev (const rtems_disk_device *dd) +rtems_bdbuf_syncdev (rtems_disk_device *dd) { if (rtems_bdbuf_tracer) printf ("bdbuf:syncdev: %08x\n", (unsigned) dd->dev); @@ -2877,7 +2877,7 @@ rtems_bdbuf_gather_for_purge (rtems_chain_control *purge_list, } void -rtems_bdbuf_purge_dev (const rtems_disk_device *dd) +rtems_bdbuf_purge_dev (rtems_disk_device *dd) { rtems_chain_control purge_list; diff --git a/cpukit/libblock/src/bdpart-read.c b/cpukit/libblock/src/bdpart-read.c index 4604e1080b..b14fc4c057 100644 --- a/cpukit/libblock/src/bdpart-read.c +++ b/cpukit/libblock/src/bdpart-read.c @@ -68,14 +68,14 @@ bool rtems_bdpart_to_mbr_partition_type( rtems_status_code rtems_bdpart_get_disk_data( const char *disk_name, int *fd_ptr, - const rtems_disk_device **dd_ptr, + rtems_disk_device **dd_ptr, rtems_blkdev_bnum *disk_end ) { rtems_status_code sc = RTEMS_SUCCESSFUL; int rv = 0; int fd = -1; - const rtems_disk_device *dd = NULL; + rtems_disk_device *dd = NULL; rtems_blkdev_bnum disk_begin = 0; rtems_blkdev_bnum block_size = 0; @@ -185,7 +185,7 @@ static rtems_status_code rtems_bdpart_read_mbr_partition( } static rtems_status_code rtems_bdpart_read_record( - const rtems_disk_device *dd, + rtems_disk_device *dd, rtems_blkdev_bnum index, rtems_bdbuf_buffer **block ) @@ -237,7 +237,7 @@ rtems_status_code rtems_bdpart_read( size_t i = 0; const uint8_t *data = NULL; int fd = -1; - const rtems_disk_device *dd = NULL; + rtems_disk_device *dd = NULL; /* Check parameter */ if (format == NULL || pt == NULL || count == NULL) { diff --git a/cpukit/libblock/src/bdpart-register.c b/cpukit/libblock/src/bdpart-register.c index d937e65e6c..ebaffd181e 100644 --- a/cpukit/libblock/src/bdpart-register.c +++ b/cpukit/libblock/src/bdpart-register.c @@ -48,7 +48,7 @@ rtems_status_code rtems_bdpart_register( size_t disk_name_size = strlen( disk_name); size_t i = 0; int fd = -1; - const rtems_disk_device *dd = NULL; + rtems_disk_device *dd = NULL; /* Get disk data */ sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end); @@ -139,7 +139,7 @@ rtems_status_code rtems_bdpart_unregister( dev_t logical_disk = 0; size_t i = 0; int fd = -1; - const rtems_disk_device *dd = NULL; + rtems_disk_device *dd = NULL; /* Get disk data */ sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end); diff --git a/cpukit/libblock/src/bdpart-write.c b/cpukit/libblock/src/bdpart-write.c index 9cccda5e5b..d4523e068e 100644 --- a/cpukit/libblock/src/bdpart-write.c +++ b/cpukit/libblock/src/bdpart-write.c @@ -45,7 +45,7 @@ static void rtems_bdpart_write_mbr_partition( } static rtems_status_code rtems_bdpart_new_record( - const rtems_disk_device *dd, + rtems_disk_device *dd, rtems_blkdev_bnum index, rtems_bdbuf_buffer **block ) @@ -103,7 +103,7 @@ rtems_status_code rtems_bdpart_write( size_t i = 0; uint8_t *data = NULL; int fd = -1; - const rtems_disk_device *dd = NULL; + rtems_disk_device *dd = NULL; /* Check if we have something to do */ if (count == 0) { diff --git a/cpukit/libblock/src/blkdev-imfs.c b/cpukit/libblock/src/blkdev-imfs.c index c69542d531..c159ca3abe 100644 --- a/cpukit/libblock/src/blkdev-imfs.c +++ b/cpukit/libblock/src/blkdev-imfs.c @@ -38,8 +38,8 @@ static ssize_t rtems_blkdev_imfs_read( ) { int rv; - const rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop); - const rtems_disk_device *dd = &ctx->dd; + rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop); + rtems_disk_device *dd = &ctx->dd; ssize_t remaining = (ssize_t) count; off_t offset = iop->offset; ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd); @@ -92,8 +92,8 @@ static ssize_t rtems_blkdev_imfs_write( ) { int rv; - const rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop); - const rtems_disk_device *dd = &ctx->dd; + rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop); + rtems_disk_device *dd = &ctx->dd; ssize_t remaining = (ssize_t) count; off_t offset = iop->offset; ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd); @@ -174,9 +174,9 @@ static int rtems_blkdev_imfs_fstat( struct stat *buf ) { - const rtems_blkdev_imfs_context *ctx = + rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_location(loc); - const rtems_disk_device *dd = &ctx->dd; + rtems_disk_device *dd = &ctx->dd; buf->st_rdev = rtems_disk_get_device_identifier(dd); buf->st_blksize = rtems_disk_get_block_size(dd); @@ -190,8 +190,8 @@ static int rtems_blkdev_imfs_fsync_or_fdatasync( ) { int rv = 0; - const rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop); - const rtems_disk_device *dd = &ctx->dd; + rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop); + rtems_disk_device *dd = &ctx->dd; rtems_status_code sc = rtems_bdbuf_syncdev(dd); if (sc != RTEMS_SUCCESSFUL) { @@ -332,7 +332,7 @@ rtems_status_code rtems_blkdev_create_partition( if (rv == 0 && S_ISBLK(st.st_mode)) { rtems_disk_device *dd; - rv = ioctl(fd, RTEMS_BLKIO_GETDISKDEV, &dd); + rv = rtems_disk_fd_get_disk_device(fd, &dd); if (rv == 0) { rtems_blkdev_bnum device_block_count = rtems_disk_get_block_count(dd); |