ext4: add two journalling related routines. See below:
authorngkaho1234 <ngkaho1234@gmail.com>
Fri, 25 Dec 2015 10:00:50 +0000 (18:00 +0800)
committergkostka <kostka.grzegorz@gmail.com>
Tue, 29 Dec 2015 09:41:40 +0000 (10:41 +0100)
  - ext4_trans_get_write_access
  - ext4_trans_set_block_dirty

lwext4/ext4.c

index 56013d2f2f95373de0f9ce28d1b5f5891205305c..842d1e6903fc97cff1e1691f0e76a051509b1cae 100644 (file)
@@ -596,6 +596,29 @@ int ext4_trans_abort(struct ext4_mountpoint *mp)
        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)
 {