Clean up patch comments, and add authorship for
[ext4-patch-queue.git] / jbd2-commit-time.patch
blob005b606a13cbe4dbb5ee40d4516c27733a1c0f18
1 jbd2: Add commit time into the commit block
3 From: "Theodore Ts'o" <tytso@mit.edu>
5 Carlo Wood has demonstrated that it's possible to recover deleted
6 files from the journal. Something that will make this easier is if we
7 can put the time of the commit into commit block.
9 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 ---
11 fs/jbd2/commit.c | 3 +++
12 include/linux/jbd2.h | 2 ++
13 2 files changed, 5 insertions(+)
15 Index: linux-2.6.26-rc6/fs/jbd2/commit.c
16 ===================================================================
17 --- linux-2.6.26-rc6.orig/fs/jbd2/commit.c 2008-06-17 10:43:20.000000000 -0700
18 +++ linux-2.6.26-rc6/fs/jbd2/commit.c 2008-06-17 10:43:26.000000000 -0700
19 @@ -112,6 +112,7 @@ static int journal_submit_commit_record(
20 struct buffer_head *bh;
21 int ret;
22 int barrier_done = 0;
23 + struct timespec now = current_kernel_time();
25 if (is_journal_aborted(journal))
26 return 0;
27 @@ -126,6 +127,8 @@ static int journal_submit_commit_record(
28 tmp->h_magic = cpu_to_be32(JBD2_MAGIC_NUMBER);
29 tmp->h_blocktype = cpu_to_be32(JBD2_COMMIT_BLOCK);
30 tmp->h_sequence = cpu_to_be32(commit_transaction->t_tid);
31 + tmp->h_commit_sec = cpu_to_be64(now.tv_sec);
32 + tmp->h_commit_nsec = cpu_to_be32(now.tv_nsec);
34 if (JBD2_HAS_COMPAT_FEATURE(journal,
35 JBD2_FEATURE_COMPAT_CHECKSUM)) {
36 Index: linux-2.6.26-rc6/include/linux/jbd2.h
37 ===================================================================
38 --- linux-2.6.26-rc6.orig/include/linux/jbd2.h 2008-06-17 10:43:20.000000000 -0700
39 +++ linux-2.6.26-rc6/include/linux/jbd2.h 2008-06-17 10:43:26.000000000 -0700
40 @@ -168,6 +168,8 @@ struct commit_header {
41 unsigned char h_chksum_size;
42 unsigned char h_padding[2];
43 __be32 h_chksum[JBD2_CHECKSUM_BYTES];
44 + __be64 h_commit_sec;
45 + __be32 h_commit_nsec;