summaryrefslogtreecommitdiffstats
path: root/cpukit/libblock/src/bdbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libblock/src/bdbuf.c')
-rw-r--r--cpukit/libblock/src/bdbuf.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c
index 3f4915be43..c4336cd8cd 100644
--- a/cpukit/libblock/src/bdbuf.c
+++ b/cpukit/libblock/src/bdbuf.c
@@ -2948,10 +2948,19 @@ rtems_bdbuf_purge_dev (rtems_disk_device *dd)
}
rtems_status_code
-rtems_bdbuf_set_block_size (rtems_disk_device *dd, uint32_t block_size)
+rtems_bdbuf_set_block_size (rtems_disk_device *dd,
+ uint32_t block_size,
+ bool sync)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
+ /*
+ * We do not care about the synchronization status since we will purge the
+ * device later.
+ */
+ if (sync)
+ rtems_bdbuf_syncdev (dd);
+
rtems_bdbuf_lock_cache ();
if (block_size > 0)
@@ -2978,7 +2987,7 @@ rtems_bdbuf_set_block_size (rtems_disk_device *dd, uint32_t block_size)
dd->block_to_media_block_shift = block_to_media_block_shift;
dd->bds_per_group = bds_per_group;
- rtems_bdbuf_read_ahead_reset (dd);
+ rtems_bdbuf_purge_dev (dd);
}
else
{