From 3f5d618c89fa6c4323d6cb83e8e5dca745171c0c Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Wed, 24 Jan 2018 17:58:20 -0600 Subject: [PATCH] bd: Add sync function to the block device API /** Ensure data on storage is in sync with the driver * * @return 0 on success or a negative error code on failure */ virtual int sync() --- features/filesystem/bd/BlockDevice.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/features/filesystem/bd/BlockDevice.h b/features/filesystem/bd/BlockDevice.h index da46c7b727..b7dbbcce15 100644 --- a/features/filesystem/bd/BlockDevice.h +++ b/features/filesystem/bd/BlockDevice.h @@ -59,6 +59,15 @@ public: */ virtual int deinit() = 0; + /** Ensure data on storage is in sync with the driver + * + * @return 0 on success or a negative error code on failure + */ + virtual int sync() + { + return 0; + } + /** Read blocks from a block device * * If a failure occurs, it is not possible to determine how many bytes succeeded