shithub: lwext4

Download patch

ref: b14390e833df6bfe4e223df2e035da13b8a7e9fa
parent: c9e58fcc9ee0038c4ad97eb56f655b9e283bec7c
author: ngkaho1234 <ngkaho1234@gmail.com>
date: Fri Dec 25 13:00:50 EST 2015

ext4: add two journalling related routines. See below:

  - ext4_trans_get_write_access
  - ext4_trans_set_block_dirty

--- a/lwext4/ext4.c
+++ b/lwext4/ext4.c
@@ -596,6 +596,29 @@
 	return r;
 }
 
+int ext4_trans_get_write_access(struct ext4_fs *fs,
+				struct ext4_block *block)
+{
+	int r = EOK;
+	if (fs->jbd_journal && fs->curr_trans) {
+		struct jbd_journal *journal = fs->jbd_journal;
+		struct jbd_trans *trans = fs->curr_trans;
+		r = jbd_trans_get_access(journal, trans, block);
+	}
+	return r;
+}
+
+int ext4_trans_set_block_dirty(struct ext4_fs *fs,
+			 struct ext4_block *block)
+{
+	int r = EOK;
+	if (fs->jbd_journal && fs->curr_trans) {
+		struct jbd_trans *trans = fs->curr_trans;
+		r = jbd_trans_set_block_dirty(trans, block);
+	}
+	return r;
+}
+
 int ext4_mount_point_stats(const char *mount_point,
 			   struct ext4_mount_stats *stats)
 {