aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/commit.c
diff options
context:
space:
mode:
authorZach Brown <zach.brown@oracle.com>2006-10-11 04:21:08 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:16 -0400
commitb517bea1c74e4773482b3f41b3f493522a8c8e30 (patch)
tree1e98110151f1a35cde84ce1a2cb6f0cb871e9551 /fs/jbd2/commit.c
parentd0d856e8bd6e697cb44b2b4dd038f3bec576a70e (diff)
[PATCH] 64-bit jbd2 core
Here is the patch to JBD to handle 64 bit block numbers, originally from Zach Brown. This patch is useful only after adding support for 64-bit block numbers in the filesystem. Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com> Signed-off-by: Zach Brown <zach.brown@oracle.com> Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jbd2/commit.c')
-rw-r--r--fs/jbd2/commit.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index b1a4eafc1541..44d68a113c73 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -271,6 +271,14 @@ write_out_data:
271 journal_do_submit_data(wbuf, bufs); 271 journal_do_submit_data(wbuf, bufs);
272} 272}
273 273
274static inline void write_tag_block(int tag_bytes, journal_block_tag_t *tag,
275 sector_t block)
276{
277 tag->t_blocknr = cpu_to_be32(block & (u32)~0);
278 if (tag_bytes > JBD_TAG_SIZE32)
279 tag->t_blocknr_high = cpu_to_be32((block >> 31) >> 1);
280}
281
274/* 282/*
275 * jbd2_journal_commit_transaction 283 * jbd2_journal_commit_transaction
276 * 284 *
@@ -293,6 +301,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
293 int first_tag = 0; 301 int first_tag = 0;
294 int tag_flag; 302 int tag_flag;
295 int i; 303 int i;
304 int tag_bytes = journal_tag_bytes(journal);
296 305
297 /* 306 /*
298 * First job: lock down the current transaction and wait for 307 * First job: lock down the current transaction and wait for
@@ -597,10 +606,10 @@ void jbd2_journal_commit_transaction(journal_t *journal)
597 tag_flag |= JBD2_FLAG_SAME_UUID; 606 tag_flag |= JBD2_FLAG_SAME_UUID;
598 607
599 tag = (journal_block_tag_t *) tagp; 608 tag = (journal_block_tag_t *) tagp;
600 tag->t_blocknr = cpu_to_be32(jh2bh(jh)->b_blocknr); 609 write_tag_block(tag_bytes, tag, jh2bh(jh)->b_blocknr);
601 tag->t_flags = cpu_to_be32(tag_flag); 610 tag->t_flags = cpu_to_be32(tag_flag);
602 tagp += sizeof(journal_block_tag_t); 611 tagp += tag_bytes;
603 space_left -= sizeof(journal_block_tag_t); 612 space_left -= tag_bytes;
604 613
605 if (first_tag) { 614 if (first_tag) {
606 memcpy (tagp, journal->j_uuid, 16); 615 memcpy (tagp, journal->j_uuid, 16);
@@ -614,7 +623,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
614 623
615 if (bufs == journal->j_wbufsize || 624 if (bufs == journal->j_wbufsize ||
616 commit_transaction->t_buffers == NULL || 625 commit_transaction->t_buffers == NULL ||
617 space_left < sizeof(journal_block_tag_t) + 16) { 626 space_left < tag_bytes + 16) {
618 627
619 jbd_debug(4, "JBD: Submit %d IOs\n", bufs); 628 jbd_debug(4, "JBD: Submit %d IOs\n", bufs);
620 629