ext4_journal: code logic optimization. See below.
[lwext4.git] / lwext4 / ext4_blockdev.h
index bd29f8950bc189bc4fbd9ae05a6e1f348326d8c3..f5329ec8b34484a3e1d26d4deeb9cb9fc3dadbdc 100644 (file)
@@ -42,6 +42,7 @@ extern "C" {
 
 #include "ext4_config.h"
 #include "ext4_bcache.h"
+#include "ext4_trans.h"
 #include "ext4_debug.h"
 
 #include <stdbool.h>
@@ -122,6 +123,9 @@ struct ext4_blockdev {
 
        /**@brief   Cache write back mode reference counter*/
        uint32_t cache_write_back;
+
+       /**@brief   The filesystem this block device belongs to. */
+       struct ext4_fs *fs;
 };
 
 /**@brief   Static initialization of the block device.*/
@@ -169,6 +173,13 @@ int ext4_block_fini(struct ext4_blockdev *bdev);
  * @return  standard error code*/
 int ext4_block_flush_buf(struct ext4_blockdev *bdev, struct ext4_buf *buf);
 
+/**@brief   Flush data in buffer of given lba to disk,
+ *          if that buffer exists in block cache.
+ * @param   bdev block device descriptor
+ * @param   lba logical block address
+ * @return  standard error code*/
+int ext4_block_flush_lba(struct ext4_blockdev *bdev, uint64_t lba);
+
 /**@brief   Set logical block size in block device.
  * @param   bdev block device descriptor
  * @param   lb_size logical block size (in bytes)