summaryrefslogtreecommitdiff
path: root/include/linux/jbd2.h
diff options
context:
space:
mode:
authorDmitry Monakhov <dmonakhov@openvz.org>2013-06-12 22:25:07 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-06-12 22:25:07 -0400
commit06a407f13daf9e48f0ef7189c7e54082b53940c7 (patch)
tree79ce69f348c778ed64877f549c7b81a2a585848e /include/linux/jbd2.h
parent9ff864462477206bc23b405a6ae506e92fb6dc9c (diff)
ext4: fix data integrity for ext4_sync_fs
Inode's data or non journaled quota may be written w/o jounral so we _must_ send a barrier at the end of ext4_sync_fs. But it can be skipped if journal commit will do it for us. Also fix data integrity for nojournal mode. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r--include/linux/jbd2.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index c3645b9475f1..a79783faecad 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1374,6 +1374,19 @@ static inline u32 jbd2_chksum(journal_t *journal, u32 crc,
return *(u32 *)desc.ctx;
}
+/* Return most recent uncommitted transaction */
+static inline tid_t jbd2_get_latest_transaction(journal_t *journal)
+{
+ tid_t tid;
+
+ read_lock(&journal->j_state_lock);
+ tid = journal->j_commit_request;
+ if (journal->j_running_transaction)
+ tid = journal->j_running_transaction->t_tid;
+ read_unlock(&journal->j_state_lock);
+ return tid;
+}
+
#ifdef __KERNEL__
#define buffer_trace_init(bh) do {} while (0)