aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingming Cao <cmm@us.ibm.com>2006-10-11 04:21:01 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:16 -0400
commitdab291af8d6307a3075c3d67d0cc8f98e646cb94 (patch)
treea2207ab3e2e00472e5e3c969ad0dd211fb9e4151
parenta920e9416b3469994860ab552dfd7fd5a5aff162 (diff)
[PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd
Reworked from a patch by Mingming Cao and Randy Dunlap Signed-off-By: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Mingming Cao <cmm@us.ibm.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>
-rw-r--r--fs/Kconfig48
-rw-r--r--fs/Makefile1
-rw-r--r--fs/ext4/acl.c2
-rw-r--r--fs/ext4/balloc.c10
-rw-r--r--fs/ext4/bitmap.c2
-rw-r--r--fs/ext4/dir.c2
-rw-r--r--fs/ext4/file.c4
-rw-r--r--fs/ext4/fsync.c4
-rw-r--r--fs/ext4/hash.c2
-rw-r--r--fs/ext4/ialloc.c6
-rw-r--r--fs/ext4/inode.c52
-rw-r--r--fs/ext4/ioctl.c16
-rw-r--r--fs/ext4/namei.c4
-rw-r--r--fs/ext4/resize.c2
-rw-r--r--fs/ext4/super.c84
-rw-r--r--fs/ext4/symlink.c2
-rw-r--r--fs/ext4/xattr.c2
-rw-r--r--fs/ext4/xattr_security.c2
-rw-r--r--fs/ext4/xattr_trusted.c2
-rw-r--r--fs/ext4/xattr_user.c2
20 files changed, 141 insertions, 108 deletions
diff --git a/fs/Kconfig b/fs/Kconfig
index ac9ba1c30935..db4d13324c36 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -143,24 +143,24 @@ config EXT3_FS_SECURITY
143config EXT4DEV_FS 143config EXT4DEV_FS
144 tristate "Ext4dev/ext4 extended fs support development (EXPERIMENTAL)" 144 tristate "Ext4dev/ext4 extended fs support development (EXPERIMENTAL)"
145 depends on EXPERIMENTAL 145 depends on EXPERIMENTAL
146 select JBD 146 select JBD2
147 help 147 help
148 Ext4dev is a predecessor filesystem of the next generation 148 Ext4dev is a predecessor filesystem of the next generation
149 extended fs ext4, based on ext3 filesystem code. It will be 149 extended fs ext4, based on ext3 filesystem code. It will be
150 renamed ext4 fs later, once ext4dev is mature and stabilized. 150 renamed ext4 fs later, once ext4dev is mature and stabilized.
151 151
152 Unlike the change from ext2 filesystem to ext3 filesystem, 152 Unlike the change from ext2 filesystem to ext3 filesystem,
153 the on-disk format of ext4dev is not the same as ext3 any more: 153 the on-disk format of ext4dev is not the same as ext3 any more:
154 it is based on extent maps and it supports 48-bit physical block 154 it is based on extent maps and it supports 48-bit physical block
155 numbers. These combined on-disk format changes will allow 155 numbers. These combined on-disk format changes will allow
156 ext4dev/ext4 to handle more than 16 TB filesystem volumes -- 156 ext4dev/ext4 to handle more than 16 TB filesystem volumes --
157 a hard limit that ext3 cannot overcome without changing the 157 a hard limit that ext3 cannot overcome without changing the
158 on-disk format. 158 on-disk format.
159 159
160 Other than extent maps and 48-bit block numbers, ext4dev also is 160 Other than extent maps and 48-bit block numbers, ext4dev also is
161 likely to have other new features such as persistent preallocation, 161 likely to have other new features such as persistent preallocation,
162 high resolution time stamps, and larger file support etc. These 162 high resolution time stamps, and larger file support etc. These
163 features will be added to ext4dev gradually. 163 features will be added to ext4dev gradually.
164 164
165 To compile this file system support as a module, choose M here. The 165 To compile this file system support as a module, choose M here. The
166 module will be called ext4dev. Be aware, however, that the filesystem 166 module will be called ext4dev. Be aware, however, that the filesystem
@@ -239,6 +239,38 @@ config JBD_DEBUG
239 generated. To turn debugging off again, do 239 generated. To turn debugging off again, do
240 "echo 0 > /proc/sys/fs/jbd-debug". 240 "echo 0 > /proc/sys/fs/jbd-debug".
241 241
242config JBD2
243 tristate
244 help
245 This is a generic journaling layer for block devices that support
246 both 32-bit and 64-bit block numbers. It is currently used by
247 the ext4dev/ext4 filesystem, but it could also be used to add
248 journal support to other file systems or block devices such
249 as RAID or LVM.
250
251 If you are using ext4dev/ext4, you need to say Y here. If you are not
252 using ext4dev/ext4 then you will probably want to say N.
253
254 To compile this device as a module, choose M here. The module will be
255 called jbd2. If you are compiling ext4dev/ext4 into the kernel,
256 you cannot compile this code as a module.
257
258config JBD2_DEBUG
259 bool "JBD2 (ext4dev/ext4) debugging support"
260 depends on JBD2
261 help
262 If you are using the ext4dev/ext4 journaled file system (or
263 potentially any other filesystem/device using JBD2), this option
264 allows you to enable debugging output while the system is running,
265 in order to help track down any problems you are having.
266 By default, the debugging output will be turned off.
267
268 If you select Y here, then you will be able to turn on debugging
269 with "echo N > /proc/sys/fs/jbd2-debug", where N is a number between
270 1 and 5. The higher the number, the more debugging output is
271 generated. To turn debugging off again, do
272 "echo 0 > /proc/sys/fs/jbd2-debug".
273
242config FS_MBCACHE 274config FS_MBCACHE
243# Meta block cache for Extended Attributes (ext2/ext3/ext4) 275# Meta block cache for Extended Attributes (ext2/ext3/ext4)
244 tristate 276 tristate
diff --git a/fs/Makefile b/fs/Makefile
index 64396af37b2a..9a5ce9323bfd 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -64,6 +64,7 @@ obj-$(CONFIG_REISERFS_FS) += reiserfs/
64obj-$(CONFIG_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3 64obj-$(CONFIG_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3
65obj-$(CONFIG_EXT4DEV_FS) += ext4/ # Before ext2 so root fs can be ext4dev 65obj-$(CONFIG_EXT4DEV_FS) += ext4/ # Before ext2 so root fs can be ext4dev
66obj-$(CONFIG_JBD) += jbd/ 66obj-$(CONFIG_JBD) += jbd/
67obj-$(CONFIG_JBD2) += jbd2/
67obj-$(CONFIG_EXT2_FS) += ext2/ 68obj-$(CONFIG_EXT2_FS) += ext2/
68obj-$(CONFIG_CRAMFS) += cramfs/ 69obj-$(CONFIG_CRAMFS) += cramfs/
69obj-$(CONFIG_RAMFS) += ramfs/ 70obj-$(CONFIG_RAMFS) += ramfs/
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index d143489aeb4c..0a965dd5664e 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -9,7 +9,7 @@
9#include <linux/slab.h> 9#include <linux/slab.h>
10#include <linux/capability.h> 10#include <linux/capability.h>
11#include <linux/fs.h> 11#include <linux/fs.h>
12#include <linux/ext4_jbd.h> 12#include <linux/ext4_jbd2.h>
13#include <linux/ext4_fs.h> 13#include <linux/ext4_fs.h>
14#include "xattr.h" 14#include "xattr.h"
15#include "acl.h" 15#include "acl.h"
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 357e4e50374a..e9e98449137b 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -14,9 +14,9 @@
14#include <linux/time.h> 14#include <linux/time.h>
15#include <linux/capability.h> 15#include <linux/capability.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/jbd.h> 17#include <linux/jbd2.h>
18#include <linux/ext4_fs.h> 18#include <linux/ext4_fs.h>
19#include <linux/ext4_jbd.h> 19#include <linux/ext4_jbd2.h>
20#include <linux/quotaops.h> 20#include <linux/quotaops.h>
21#include <linux/buffer_head.h> 21#include <linux/buffer_head.h>
22 22
@@ -526,12 +526,12 @@ do_more:
526 * transaction. 526 * transaction.
527 * 527 *
528 * Ideally we would want to allow that to happen, but to 528 * Ideally we would want to allow that to happen, but to
529 * do so requires making journal_forget() capable of 529 * do so requires making jbd2_journal_forget() capable of
530 * revoking the queued write of a data block, which 530 * revoking the queued write of a data block, which
531 * implies blocking on the journal lock. *forget() 531 * implies blocking on the journal lock. *forget()
532 * cannot block due to truncate races. 532 * cannot block due to truncate races.
533 * 533 *
534 * Eventually we can fix this by making journal_forget() 534 * Eventually we can fix this by making jbd2_journal_forget()
535 * return a status indicating whether or not it was able 535 * return a status indicating whether or not it was able
536 * to revoke the buffer. On successful revoke, it is 536 * to revoke the buffer. On successful revoke, it is
537 * safe not to set the allocation bit in the committed 537 * safe not to set the allocation bit in the committed
@@ -1382,7 +1382,7 @@ int ext4_should_retry_alloc(struct super_block *sb, int *retries)
1382 1382
1383 jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id); 1383 jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
1384 1384
1385 return journal_force_commit_nested(EXT4_SB(sb)->s_journal); 1385 return jbd2_journal_force_commit_nested(EXT4_SB(sb)->s_journal);
1386} 1386}
1387 1387
1388/** 1388/**
diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c
index f4b35706f39c..11e93c169bcf 100644
--- a/fs/ext4/bitmap.c
+++ b/fs/ext4/bitmap.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include <linux/buffer_head.h> 10#include <linux/buffer_head.h>
11#include <linux/jbd.h> 11#include <linux/jbd2.h>
12#include <linux/ext4_fs.h> 12#include <linux/ext4_fs.h>
13 13
14#ifdef EXT4FS_DEBUG 14#ifdef EXT4FS_DEBUG
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index ec114d7886cc..9833d5d00c46 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -22,7 +22,7 @@
22 */ 22 */
23 23
24#include <linux/fs.h> 24#include <linux/fs.h>
25#include <linux/jbd.h> 25#include <linux/jbd2.h>
26#include <linux/ext4_fs.h> 26#include <linux/ext4_fs.h>
27#include <linux/buffer_head.h> 27#include <linux/buffer_head.h>
28#include <linux/smp_lock.h> 28#include <linux/smp_lock.h>
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index d938fbe1e08b..0b622c0624b7 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -20,9 +20,9 @@
20 20
21#include <linux/time.h> 21#include <linux/time.h>
22#include <linux/fs.h> 22#include <linux/fs.h>
23#include <linux/jbd.h> 23#include <linux/jbd2.h>
24#include <linux/ext4_fs.h> 24#include <linux/ext4_fs.h>
25#include <linux/ext4_jbd.h> 25#include <linux/ext4_jbd2.h>
26#include "xattr.h" 26#include "xattr.h"
27#include "acl.h" 27#include "acl.h"
28 28
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 272faa27761d..2a167d7131fa 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -26,9 +26,9 @@
26#include <linux/fs.h> 26#include <linux/fs.h>
27#include <linux/sched.h> 27#include <linux/sched.h>
28#include <linux/writeback.h> 28#include <linux/writeback.h>
29#include <linux/jbd.h> 29#include <linux/jbd2.h>
30#include <linux/ext4_fs.h> 30#include <linux/ext4_fs.h>
31#include <linux/ext4_jbd.h> 31#include <linux/ext4_jbd2.h>
32 32
33/* 33/*
34 * akpm: A new design for ext4_sync_file(). 34 * akpm: A new design for ext4_sync_file().
diff --git a/fs/ext4/hash.c b/fs/ext4/hash.c
index d15bb4274428..a67966385e06 100644
--- a/fs/ext4/hash.c
+++ b/fs/ext4/hash.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include <linux/fs.h> 12#include <linux/fs.h>
13#include <linux/jbd.h> 13#include <linux/jbd2.h>
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/ext4_fs.h> 15#include <linux/ext4_fs.h>
16#include <linux/cryptohash.h> 16#include <linux/cryptohash.h>
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 4b92066ca08f..34d39ae966f7 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -14,9 +14,9 @@
14 14
15#include <linux/time.h> 15#include <linux/time.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/jbd.h> 17#include <linux/jbd2.h>
18#include <linux/ext4_fs.h> 18#include <linux/ext4_fs.h>
19#include <linux/ext4_jbd.h> 19#include <linux/ext4_jbd2.h>
20#include <linux/stat.h> 20#include <linux/stat.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/quotaops.h> 22#include <linux/quotaops.h>
@@ -497,7 +497,7 @@ repeat_in_this_group:
497 goto got; 497 goto got;
498 } 498 }
499 /* we lost it */ 499 /* we lost it */
500 journal_release_buffer(handle, bitmap_bh); 500 jbd2_journal_release_buffer(handle, bitmap_bh);
501 501
502 if (++ino < EXT4_INODES_PER_GROUP(sb)) 502 if (++ino < EXT4_INODES_PER_GROUP(sb))
503 goto repeat_in_this_group; 503 goto repeat_in_this_group;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 7275d60dcc59..0d96c7d3bb5b 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -25,8 +25,8 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/fs.h> 26#include <linux/fs.h>
27#include <linux/time.h> 27#include <linux/time.h>
28#include <linux/ext4_jbd.h> 28#include <linux/ext4_jbd2.h>
29#include <linux/jbd.h> 29#include <linux/jbd2.h>
30#include <linux/smp_lock.h> 30#include <linux/smp_lock.h>
31#include <linux/highuid.h> 31#include <linux/highuid.h>
32#include <linux/pagemap.h> 32#include <linux/pagemap.h>
@@ -84,7 +84,7 @@ int ext4_forget(handle_t *handle, int is_metadata, struct inode *inode,
84 if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA || 84 if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA ||
85 (!is_metadata && !ext4_should_journal_data(inode))) { 85 (!is_metadata && !ext4_should_journal_data(inode))) {
86 if (bh) { 86 if (bh) {
87 BUFFER_TRACE(bh, "call journal_forget"); 87 BUFFER_TRACE(bh, "call jbd2_journal_forget");
88 return ext4_journal_forget(handle, bh); 88 return ext4_journal_forget(handle, bh);
89 } 89 }
90 return 0; 90 return 0;
@@ -657,7 +657,7 @@ static int ext4_alloc_branch(handle_t *handle, struct inode *inode,
657failed: 657failed:
658 /* Allocation failed, free what we already allocated */ 658 /* Allocation failed, free what we already allocated */
659 for (i = 1; i <= n ; i++) { 659 for (i = 1; i <= n ; i++) {
660 BUFFER_TRACE(branch[i].bh, "call journal_forget"); 660 BUFFER_TRACE(branch[i].bh, "call jbd2_journal_forget");
661 ext4_journal_forget(handle, branch[i].bh); 661 ext4_journal_forget(handle, branch[i].bh);
662 } 662 }
663 for (i = 0; i <indirect_blks; i++) 663 for (i = 0; i <indirect_blks; i++)
@@ -758,7 +758,7 @@ static int ext4_splice_branch(handle_t *handle, struct inode *inode,
758 758
759err_out: 759err_out:
760 for (i = 1; i <= num; i++) { 760 for (i = 1; i <= num; i++) {
761 BUFFER_TRACE(where[i].bh, "call journal_forget"); 761 BUFFER_TRACE(where[i].bh, "call jbd2_journal_forget");
762 ext4_journal_forget(handle, where[i].bh); 762 ext4_journal_forget(handle, where[i].bh);
763 ext4_free_blocks(handle,inode,le32_to_cpu(where[i-1].key),1); 763 ext4_free_blocks(handle,inode,le32_to_cpu(where[i-1].key),1);
764 } 764 }
@@ -1119,7 +1119,7 @@ static int walk_page_buffers( handle_t *handle,
1119 * To preserve ordering, it is essential that the hole instantiation and 1119 * To preserve ordering, it is essential that the hole instantiation and
1120 * the data write be encapsulated in a single transaction. We cannot 1120 * the data write be encapsulated in a single transaction. We cannot
1121 * close off a transaction and start a new one between the ext4_get_block() 1121 * close off a transaction and start a new one between the ext4_get_block()
1122 * and the commit_write(). So doing the journal_start at the start of 1122 * and the commit_write(). So doing the jbd2_journal_start at the start of
1123 * prepare_write() is the right place. 1123 * prepare_write() is the right place.
1124 * 1124 *
1125 * Also, this function can nest inside ext4_writepage() -> 1125 * Also, this function can nest inside ext4_writepage() ->
@@ -1135,7 +1135,7 @@ static int walk_page_buffers( handle_t *handle,
1135 * transaction open and was blocking on the quota lock - a ranking 1135 * transaction open and was blocking on the quota lock - a ranking
1136 * violation. 1136 * violation.
1137 * 1137 *
1138 * So what we do is to rely on the fact that journal_stop/journal_start 1138 * So what we do is to rely on the fact that jbd2_journal_stop/journal_start
1139 * will _not_ run commit under these circumstances because handle->h_ref 1139 * will _not_ run commit under these circumstances because handle->h_ref
1140 * is elevated. We'll still have enough credits for the tiny quotafile 1140 * is elevated. We'll still have enough credits for the tiny quotafile
1141 * write. 1141 * write.
@@ -1184,7 +1184,7 @@ out:
1184 1184
1185int ext4_journal_dirty_data(handle_t *handle, struct buffer_head *bh) 1185int ext4_journal_dirty_data(handle_t *handle, struct buffer_head *bh)
1186{ 1186{
1187 int err = journal_dirty_data(handle, bh); 1187 int err = jbd2_journal_dirty_data(handle, bh);
1188 if (err) 1188 if (err)
1189 ext4_journal_abort_handle(__FUNCTION__, __FUNCTION__, 1189 ext4_journal_abort_handle(__FUNCTION__, __FUNCTION__,
1190 bh, handle,err); 1190 bh, handle,err);
@@ -1333,9 +1333,9 @@ static sector_t ext4_bmap(struct address_space *mapping, sector_t block)
1333 1333
1334 EXT4_I(inode)->i_state &= ~EXT4_STATE_JDATA; 1334 EXT4_I(inode)->i_state &= ~EXT4_STATE_JDATA;
1335 journal = EXT4_JOURNAL(inode); 1335 journal = EXT4_JOURNAL(inode);
1336 journal_lock_updates(journal); 1336 jbd2_journal_lock_updates(journal);
1337 err = journal_flush(journal); 1337 err = jbd2_journal_flush(journal);
1338 journal_unlock_updates(journal); 1338 jbd2_journal_unlock_updates(journal);
1339 1339
1340 if (err) 1340 if (err)
1341 return 0; 1341 return 0;
@@ -1356,7 +1356,7 @@ static int bput_one(handle_t *handle, struct buffer_head *bh)
1356 return 0; 1356 return 0;
1357} 1357}
1358 1358
1359static int journal_dirty_data_fn(handle_t *handle, struct buffer_head *bh) 1359static int jbd2_journal_dirty_data_fn(handle_t *handle, struct buffer_head *bh)
1360{ 1360{
1361 if (buffer_mapped(bh)) 1361 if (buffer_mapped(bh))
1362 return ext4_journal_dirty_data(handle, bh); 1362 return ext4_journal_dirty_data(handle, bh);
@@ -1464,7 +1464,7 @@ static int ext4_ordered_writepage(struct page *page,
1464 */ 1464 */
1465 if (ret == 0) { 1465 if (ret == 0) {
1466 err = walk_page_buffers(handle, page_bufs, 0, PAGE_CACHE_SIZE, 1466 err = walk_page_buffers(handle, page_bufs, 0, PAGE_CACHE_SIZE,
1467 NULL, journal_dirty_data_fn); 1467 NULL, jbd2_journal_dirty_data_fn);
1468 if (!ret) 1468 if (!ret)
1469 ret = err; 1469 ret = err;
1470 } 1470 }
@@ -1595,7 +1595,7 @@ static void ext4_invalidatepage(struct page *page, unsigned long offset)
1595 if (offset == 0) 1595 if (offset == 0)
1596 ClearPageChecked(page); 1596 ClearPageChecked(page);
1597 1597
1598 journal_invalidatepage(journal, page, offset); 1598 jbd2_journal_invalidatepage(journal, page, offset);
1599} 1599}
1600 1600
1601static int ext4_releasepage(struct page *page, gfp_t wait) 1601static int ext4_releasepage(struct page *page, gfp_t wait)
@@ -1605,7 +1605,7 @@ static int ext4_releasepage(struct page *page, gfp_t wait)
1605 WARN_ON(PageChecked(page)); 1605 WARN_ON(PageChecked(page));
1606 if (!page_has_buffers(page)) 1606 if (!page_has_buffers(page))
1607 return 0; 1607 return 0;
1608 return journal_try_to_free_buffers(journal, page, wait); 1608 return jbd2_journal_try_to_free_buffers(journal, page, wait);
1609} 1609}
1610 1610
1611/* 1611/*
@@ -1982,11 +1982,11 @@ static void ext4_clear_blocks(handle_t *handle, struct inode *inode,
1982 1982
1983 /* 1983 /*
1984 * Any buffers which are on the journal will be in memory. We find 1984 * Any buffers which are on the journal will be in memory. We find
1985 * them on the hash table so journal_revoke() will run journal_forget() 1985 * them on the hash table so jbd2_journal_revoke() will run jbd2_journal_forget()
1986 * on them. We've already detached each block from the file, so 1986 * on them. We've already detached each block from the file, so
1987 * bforget() in journal_forget() should be safe. 1987 * bforget() in jbd2_journal_forget() should be safe.
1988 * 1988 *
1989 * AKPM: turn on bforget in journal_forget()!!! 1989 * AKPM: turn on bforget in jbd2_journal_forget()!!!
1990 */ 1990 */
1991 for (p = first; p < last; p++) { 1991 for (p = first; p < last; p++) {
1992 u32 nr = le32_to_cpu(*p); 1992 u32 nr = le32_to_cpu(*p);
@@ -2132,11 +2132,11 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
2132 * We've probably journalled the indirect block several 2132 * We've probably journalled the indirect block several
2133 * times during the truncate. But it's no longer 2133 * times during the truncate. But it's no longer
2134 * needed and we now drop it from the transaction via 2134 * needed and we now drop it from the transaction via
2135 * journal_revoke(). 2135 * jbd2_journal_revoke().
2136 * 2136 *
2137 * That's easy if it's exclusively part of this 2137 * That's easy if it's exclusively part of this
2138 * transaction. But if it's part of the committing 2138 * transaction. But if it's part of the committing
2139 * transaction then journal_forget() will simply 2139 * transaction then jbd2_journal_forget() will simply
2140 * brelse() it. That means that if the underlying 2140 * brelse() it. That means that if the underlying
2141 * block is reallocated in ext4_get_block(), 2141 * block is reallocated in ext4_get_block(),
2142 * unmap_underlying_metadata() will find this block 2142 * unmap_underlying_metadata() will find this block
@@ -2251,7 +2251,7 @@ void ext4_truncate(struct inode *inode)
2251 2251
2252 /* 2252 /*
2253 * We have to lock the EOF page here, because lock_page() nests 2253 * We have to lock the EOF page here, because lock_page() nests
2254 * outside journal_start(). 2254 * outside jbd2_journal_start().
2255 */ 2255 */
2256 if ((inode->i_size & (blocksize - 1)) == 0) { 2256 if ((inode->i_size & (blocksize - 1)) == 0) {
2257 /* Block boundary? Nothing to do */ 2257 /* Block boundary? Nothing to do */
@@ -3035,7 +3035,7 @@ int ext4_mark_iloc_dirty(handle_t *handle,
3035 /* the do_update_inode consumes one bh->b_count */ 3035 /* the do_update_inode consumes one bh->b_count */
3036 get_bh(iloc->bh); 3036 get_bh(iloc->bh);
3037 3037
3038 /* ext4_do_update_inode() does journal_dirty_metadata */ 3038 /* ext4_do_update_inode() does jbd2_journal_dirty_metadata */
3039 err = ext4_do_update_inode(handle, inode, iloc); 3039 err = ext4_do_update_inode(handle, inode, iloc);
3040 put_bh(iloc->bh); 3040 put_bh(iloc->bh);
3041 return err; 3041 return err;
@@ -3153,7 +3153,7 @@ static int ext4_pin_inode(handle_t *handle, struct inode *inode)
3153 err = ext4_get_inode_loc(inode, &iloc); 3153 err = ext4_get_inode_loc(inode, &iloc);
3154 if (!err) { 3154 if (!err) {
3155 BUFFER_TRACE(iloc.bh, "get_write_access"); 3155 BUFFER_TRACE(iloc.bh, "get_write_access");
3156 err = journal_get_write_access(handle, iloc.bh); 3156 err = jbd2_journal_get_write_access(handle, iloc.bh);
3157 if (!err) 3157 if (!err)
3158 err = ext4_journal_dirty_metadata(handle, 3158 err = ext4_journal_dirty_metadata(handle,
3159 iloc.bh); 3159 iloc.bh);
@@ -3185,8 +3185,8 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val)
3185 if (is_journal_aborted(journal) || IS_RDONLY(inode)) 3185 if (is_journal_aborted(journal) || IS_RDONLY(inode))
3186 return -EROFS; 3186 return -EROFS;
3187 3187
3188 journal_lock_updates(journal); 3188 jbd2_journal_lock_updates(journal);
3189 journal_flush(journal); 3189 jbd2_journal_flush(journal);
3190 3190
3191 /* 3191 /*
3192 * OK, there are no updates running now, and all cached data is 3192 * OK, there are no updates running now, and all cached data is
@@ -3202,7 +3202,7 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val)
3202 EXT4_I(inode)->i_flags &= ~EXT4_JOURNAL_DATA_FL; 3202 EXT4_I(inode)->i_flags &= ~EXT4_JOURNAL_DATA_FL;
3203 ext4_set_aops(inode); 3203 ext4_set_aops(inode);
3204 3204
3205 journal_unlock_updates(journal); 3205 jbd2_journal_unlock_updates(journal);
3206 3206
3207 /* Finally we can mark the inode as dirty. */ 3207 /* Finally we can mark the inode as dirty. */
3208 3208
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index a567af161b06..a63dce2117b8 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -8,10 +8,10 @@
8 */ 8 */
9 9
10#include <linux/fs.h> 10#include <linux/fs.h>
11#include <linux/jbd.h> 11#include <linux/jbd2.h>
12#include <linux/capability.h> 12#include <linux/capability.h>
13#include <linux/ext4_fs.h> 13#include <linux/ext4_fs.h>
14#include <linux/ext4_jbd.h> 14#include <linux/ext4_jbd2.h>
15#include <linux/time.h> 15#include <linux/time.h>
16#include <linux/compat.h> 16#include <linux/compat.h>
17#include <linux/smp_lock.h> 17#include <linux/smp_lock.h>
@@ -219,9 +219,9 @@ flags_err:
219 return -EFAULT; 219 return -EFAULT;
220 220
221 err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count); 221 err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count);
222 journal_lock_updates(EXT4_SB(sb)->s_journal); 222 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
223 journal_flush(EXT4_SB(sb)->s_journal); 223 jbd2_journal_flush(EXT4_SB(sb)->s_journal);
224 journal_unlock_updates(EXT4_SB(sb)->s_journal); 224 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
225 225
226 return err; 226 return err;
227 } 227 }
@@ -241,9 +241,9 @@ flags_err:
241 return -EFAULT; 241 return -EFAULT;
242 242
243 err = ext4_group_add(sb, &input); 243 err = ext4_group_add(sb, &input);
244 journal_lock_updates(EXT4_SB(sb)->s_journal); 244 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
245 journal_flush(EXT4_SB(sb)->s_journal); 245 jbd2_journal_flush(EXT4_SB(sb)->s_journal);
246 journal_unlock_updates(EXT4_SB(sb)->s_journal); 246 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
247 247
248 return err; 248 return err;
249 } 249 }
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 956b38113f62..f98b9994e36c 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -26,10 +26,10 @@
26 26
27#include <linux/fs.h> 27#include <linux/fs.h>
28#include <linux/pagemap.h> 28#include <linux/pagemap.h>
29#include <linux/jbd.h> 29#include <linux/jbd2.h>
30#include <linux/time.h> 30#include <linux/time.h>
31#include <linux/ext4_fs.h> 31#include <linux/ext4_fs.h>
32#include <linux/ext4_jbd.h> 32#include <linux/ext4_jbd2.h>
33#include <linux/fcntl.h> 33#include <linux/fcntl.h>
34#include <linux/stat.h> 34#include <linux/stat.h>
35#include <linux/string.h> 35#include <linux/string.h>
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 4a47895d9d6d..5b2828d21180 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -13,7 +13,7 @@
13 13
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/smp_lock.h> 15#include <linux/smp_lock.h>
16#include <linux/ext4_jbd.h> 16#include <linux/ext4_jbd2.h>
17 17
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 9e32a2a8d286..f131bb69b62e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -20,9 +20,9 @@
20#include <linux/string.h> 20#include <linux/string.h>
21#include <linux/fs.h> 21#include <linux/fs.h>
22#include <linux/time.h> 22#include <linux/time.h>
23#include <linux/jbd.h> 23#include <linux/jbd2.h>
24#include <linux/ext4_fs.h> 24#include <linux/ext4_fs.h>
25#include <linux/ext4_jbd.h> 25#include <linux/ext4_jbd2.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/blkdev.h> 28#include <linux/blkdev.h>
@@ -63,7 +63,7 @@ static void ext4_write_super (struct super_block * sb);
63static void ext4_write_super_lockfs(struct super_block *sb); 63static void ext4_write_super_lockfs(struct super_block *sb);
64 64
65/* 65/*
66 * Wrappers for journal_start/end. 66 * Wrappers for jbd2_journal_start/end.
67 * 67 *
68 * The only special thing we need to do here is to make sure that all 68 * The only special thing we need to do here is to make sure that all
69 * journal_end calls result in the superblock being marked dirty, so 69 * journal_end calls result in the superblock being marked dirty, so
@@ -87,12 +87,12 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks)
87 return ERR_PTR(-EROFS); 87 return ERR_PTR(-EROFS);
88 } 88 }
89 89
90 return journal_start(journal, nblocks); 90 return jbd2_journal_start(journal, nblocks);
91} 91}
92 92
93/* 93/*
94 * The only special thing we need to do here is to make sure that all 94 * The only special thing we need to do here is to make sure that all
95 * journal_stop calls result in the superblock being marked dirty, so 95 * jbd2_journal_stop calls result in the superblock being marked dirty, so
96 * that sync() will call the filesystem's write_super callback if 96 * that sync() will call the filesystem's write_super callback if
97 * appropriate. 97 * appropriate.
98 */ 98 */
@@ -104,7 +104,7 @@ int __ext4_journal_stop(const char *where, handle_t *handle)
104 104
105 sb = handle->h_transaction->t_journal->j_private; 105 sb = handle->h_transaction->t_journal->j_private;
106 err = handle->h_err; 106 err = handle->h_err;
107 rc = journal_stop(handle); 107 rc = jbd2_journal_stop(handle);
108 108
109 if (!err) 109 if (!err)
110 err = rc; 110 err = rc;
@@ -131,7 +131,7 @@ void ext4_journal_abort_handle(const char *caller, const char *err_fn,
131 printk(KERN_ERR "%s: aborting transaction: %s in %s\n", 131 printk(KERN_ERR "%s: aborting transaction: %s in %s\n",
132 caller, errstr, err_fn); 132 caller, errstr, err_fn);
133 133
134 journal_abort_handle(handle); 134 jbd2_journal_abort_handle(handle);
135} 135}
136 136
137/* Deal with the reporting of failure conditions on a filesystem such as 137/* Deal with the reporting of failure conditions on a filesystem such as
@@ -144,7 +144,7 @@ void ext4_journal_abort_handle(const char *caller, const char *err_fn,
144 * be aborted, we can't rely on the current, or future, transactions to 144 * be aborted, we can't rely on the current, or future, transactions to
145 * write out the superblock safely. 145 * write out the superblock safely.
146 * 146 *
147 * We'll just use the journal_abort() error code to record an error in 147 * We'll just use the jbd2_journal_abort() error code to record an error in
148 * the journal instead. On recovery, the journal will compain about 148 * the journal instead. On recovery, the journal will compain about
149 * that error until we've noted it down and cleared it. 149 * that error until we've noted it down and cleared it.
150 */ 150 */
@@ -164,7 +164,7 @@ static void ext4_handle_error(struct super_block *sb)
164 164
165 EXT4_SB(sb)->s_mount_opt |= EXT4_MOUNT_ABORT; 165 EXT4_SB(sb)->s_mount_opt |= EXT4_MOUNT_ABORT;
166 if (journal) 166 if (journal)
167 journal_abort(journal, -EIO); 167 jbd2_journal_abort(journal, -EIO);
168 } 168 }
169 if (test_opt (sb, ERRORS_RO)) { 169 if (test_opt (sb, ERRORS_RO)) {
170 printk (KERN_CRIT "Remounting filesystem read-only\n"); 170 printk (KERN_CRIT "Remounting filesystem read-only\n");
@@ -203,7 +203,7 @@ static const char *ext4_decode_error(struct super_block * sb, int errno,
203 errstr = "Out of memory"; 203 errstr = "Out of memory";
204 break; 204 break;
205 case -EROFS: 205 case -EROFS:
206 if (!sb || EXT4_SB(sb)->s_journal->j_flags & JFS_ABORT) 206 if (!sb || EXT4_SB(sb)->s_journal->j_flags & JBD2_ABORT)
207 errstr = "Journal has aborted"; 207 errstr = "Journal has aborted";
208 else 208 else
209 errstr = "Readonly filesystem"; 209 errstr = "Readonly filesystem";
@@ -279,7 +279,7 @@ void ext4_abort (struct super_block * sb, const char * function,
279 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; 279 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
280 sb->s_flags |= MS_RDONLY; 280 sb->s_flags |= MS_RDONLY;
281 EXT4_SB(sb)->s_mount_opt |= EXT4_MOUNT_ABORT; 281 EXT4_SB(sb)->s_mount_opt |= EXT4_MOUNT_ABORT;
282 journal_abort(EXT4_SB(sb)->s_journal, -EIO); 282 jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO);
283} 283}
284 284
285void ext4_warning (struct super_block * sb, const char * function, 285void ext4_warning (struct super_block * sb, const char * function,
@@ -391,7 +391,7 @@ static void ext4_put_super (struct super_block * sb)
391 int i; 391 int i;
392 392
393 ext4_xattr_put_super(sb); 393 ext4_xattr_put_super(sb);
394 journal_destroy(sbi->s_journal); 394 jbd2_journal_destroy(sbi->s_journal);
395 if (!(sb->s_flags & MS_RDONLY)) { 395 if (!(sb->s_flags & MS_RDONLY)) {
396 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 396 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
397 es->s_state = cpu_to_le16(sbi->s_mount_state); 397 es->s_state = cpu_to_le16(sbi->s_mount_state);
@@ -1722,8 +1722,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1722 /* No mode set, assume a default based on the journal 1722 /* No mode set, assume a default based on the journal
1723 capabilities: ORDERED_DATA if the journal can 1723 capabilities: ORDERED_DATA if the journal can
1724 cope, else JOURNAL_DATA */ 1724 cope, else JOURNAL_DATA */
1725 if (journal_check_available_features 1725 if (jbd2_journal_check_available_features
1726 (sbi->s_journal, 0, 0, JFS_FEATURE_INCOMPAT_REVOKE)) 1726 (sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE))
1727 set_opt(sbi->s_mount_opt, ORDERED_DATA); 1727 set_opt(sbi->s_mount_opt, ORDERED_DATA);
1728 else 1728 else
1729 set_opt(sbi->s_mount_opt, JOURNAL_DATA); 1729 set_opt(sbi->s_mount_opt, JOURNAL_DATA);
@@ -1731,8 +1731,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1731 1731
1732 case EXT4_MOUNT_ORDERED_DATA: 1732 case EXT4_MOUNT_ORDERED_DATA:
1733 case EXT4_MOUNT_WRITEBACK_DATA: 1733 case EXT4_MOUNT_WRITEBACK_DATA:
1734 if (!journal_check_available_features 1734 if (!jbd2_journal_check_available_features
1735 (sbi->s_journal, 0, 0, JFS_FEATURE_INCOMPAT_REVOKE)) { 1735 (sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE)) {
1736 printk(KERN_ERR "EXT4-fs: Journal does not support " 1736 printk(KERN_ERR "EXT4-fs: Journal does not support "
1737 "requested data journaling mode\n"); 1737 "requested data journaling mode\n");
1738 goto failed_mount4; 1738 goto failed_mount4;
@@ -1749,7 +1749,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1749 } 1749 }
1750 } 1750 }
1751 /* 1751 /*
1752 * The journal_load will have done any necessary log recovery, 1752 * The jbd2_journal_load will have done any necessary log recovery,
1753 * so we can safely mount the rest of the filesystem now. 1753 * so we can safely mount the rest of the filesystem now.
1754 */ 1754 */
1755 1755
@@ -1797,7 +1797,7 @@ cantfind_ext4:
1797 goto failed_mount; 1797 goto failed_mount;
1798 1798
1799failed_mount4: 1799failed_mount4:
1800 journal_destroy(sbi->s_journal); 1800 jbd2_journal_destroy(sbi->s_journal);
1801failed_mount3: 1801failed_mount3:
1802 percpu_counter_destroy(&sbi->s_freeblocks_counter); 1802 percpu_counter_destroy(&sbi->s_freeblocks_counter);
1803 percpu_counter_destroy(&sbi->s_freeinodes_counter); 1803 percpu_counter_destroy(&sbi->s_freeinodes_counter);
@@ -1837,9 +1837,9 @@ static void ext4_init_journal_params(struct super_block *sb, journal_t *journal)
1837 1837
1838 spin_lock(&journal->j_state_lock); 1838 spin_lock(&journal->j_state_lock);
1839 if (test_opt(sb, BARRIER)) 1839 if (test_opt(sb, BARRIER))
1840 journal->j_flags |= JFS_BARRIER; 1840 journal->j_flags |= JBD2_BARRIER;
1841 else 1841 else
1842 journal->j_flags &= ~JFS_BARRIER; 1842 journal->j_flags &= ~JBD2_BARRIER;
1843 spin_unlock(&journal->j_state_lock); 1843 spin_unlock(&journal->j_state_lock);
1844} 1844}
1845 1845
@@ -1873,7 +1873,7 @@ static journal_t *ext4_get_journal(struct super_block *sb,
1873 return NULL; 1873 return NULL;
1874 } 1874 }
1875 1875
1876 journal = journal_init_inode(journal_inode); 1876 journal = jbd2_journal_init_inode(journal_inode);
1877 if (!journal) { 1877 if (!journal) {
1878 printk(KERN_ERR "EXT4-fs: Could not load journal inode\n"); 1878 printk(KERN_ERR "EXT4-fs: Could not load journal inode\n");
1879 iput(journal_inode); 1879 iput(journal_inode);
@@ -1945,7 +1945,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
1945 start = sb_block + 1; 1945 start = sb_block + 1;
1946 brelse(bh); /* we're done with the superblock */ 1946 brelse(bh); /* we're done with the superblock */
1947 1947
1948 journal = journal_init_dev(bdev, sb->s_bdev, 1948 journal = jbd2_journal_init_dev(bdev, sb->s_bdev,
1949 start, len, blocksize); 1949 start, len, blocksize);
1950 if (!journal) { 1950 if (!journal) {
1951 printk(KERN_ERR "EXT4-fs: failed to create device journal\n"); 1951 printk(KERN_ERR "EXT4-fs: failed to create device journal\n");
@@ -1968,7 +1968,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
1968 ext4_init_journal_params(sb, journal); 1968 ext4_init_journal_params(sb, journal);
1969 return journal; 1969 return journal;
1970out_journal: 1970out_journal:
1971 journal_destroy(journal); 1971 jbd2_journal_destroy(journal);
1972out_bdev: 1972out_bdev:
1973 ext4_blkdev_put(bdev); 1973 ext4_blkdev_put(bdev);
1974 return NULL; 1974 return NULL;
@@ -2029,22 +2029,22 @@ static int ext4_load_journal(struct super_block *sb,
2029 } 2029 }
2030 2030
2031 if (!really_read_only && test_opt(sb, UPDATE_JOURNAL)) { 2031 if (!really_read_only && test_opt(sb, UPDATE_JOURNAL)) {
2032 err = journal_update_format(journal); 2032 err = jbd2_journal_update_format(journal);
2033 if (err) { 2033 if (err) {
2034 printk(KERN_ERR "EXT4-fs: error updating journal.\n"); 2034 printk(KERN_ERR "EXT4-fs: error updating journal.\n");
2035 journal_destroy(journal); 2035 jbd2_journal_destroy(journal);
2036 return err; 2036 return err;
2037 } 2037 }
2038 } 2038 }
2039 2039
2040 if (!EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER)) 2040 if (!EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER))
2041 err = journal_wipe(journal, !really_read_only); 2041 err = jbd2_journal_wipe(journal, !really_read_only);
2042 if (!err) 2042 if (!err)
2043 err = journal_load(journal); 2043 err = jbd2_journal_load(journal);
2044 2044
2045 if (err) { 2045 if (err) {
2046 printk(KERN_ERR "EXT4-fs: error loading journal.\n"); 2046 printk(KERN_ERR "EXT4-fs: error loading journal.\n");
2047 journal_destroy(journal); 2047 jbd2_journal_destroy(journal);
2048 return err; 2048 return err;
2049 } 2049 }
2050 2050
@@ -2081,9 +2081,9 @@ static int ext4_create_journal(struct super_block * sb,
2081 printk(KERN_INFO "EXT4-fs: creating new journal on inode %u\n", 2081 printk(KERN_INFO "EXT4-fs: creating new journal on inode %u\n",
2082 journal_inum); 2082 journal_inum);
2083 2083
2084 if (journal_create(journal)) { 2084 if (jbd2_journal_create(journal)) {
2085 printk(KERN_ERR "EXT4-fs: error creating journal.\n"); 2085 printk(KERN_ERR "EXT4-fs: error creating journal.\n");
2086 journal_destroy(journal); 2086 jbd2_journal_destroy(journal);
2087 return -EIO; 2087 return -EIO;
2088 } 2088 }
2089 2089
@@ -2130,15 +2130,15 @@ static void ext4_mark_recovery_complete(struct super_block * sb,
2130{ 2130{
2131 journal_t *journal = EXT4_SB(sb)->s_journal; 2131 journal_t *journal = EXT4_SB(sb)->s_journal;
2132 2132
2133 journal_lock_updates(journal); 2133 jbd2_journal_lock_updates(journal);
2134 journal_flush(journal); 2134 jbd2_journal_flush(journal);
2135 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER) && 2135 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER) &&
2136 sb->s_flags & MS_RDONLY) { 2136 sb->s_flags & MS_RDONLY) {
2137 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 2137 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
2138 sb->s_dirt = 0; 2138 sb->s_dirt = 0;
2139 ext4_commit_super(sb, es, 1); 2139 ext4_commit_super(sb, es, 1);
2140 } 2140 }
2141 journal_unlock_updates(journal); 2141 jbd2_journal_unlock_updates(journal);
2142} 2142}
2143 2143
2144/* 2144/*
@@ -2160,7 +2160,7 @@ static void ext4_clear_journal_err(struct super_block * sb,
2160 * journal by a prior ext4_error() or ext4_abort() 2160 * journal by a prior ext4_error() or ext4_abort()
2161 */ 2161 */
2162 2162
2163 j_errno = journal_errno(journal); 2163 j_errno = jbd2_journal_errno(journal);
2164 if (j_errno) { 2164 if (j_errno) {
2165 char nbuf[16]; 2165 char nbuf[16];
2166 2166
@@ -2174,7 +2174,7 @@ static void ext4_clear_journal_err(struct super_block * sb,
2174 es->s_state |= cpu_to_le16(EXT4_ERROR_FS); 2174 es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
2175 ext4_commit_super (sb, es, 1); 2175 ext4_commit_super (sb, es, 1);
2176 2176
2177 journal_clear_err(journal); 2177 jbd2_journal_clear_err(journal);
2178 } 2178 }
2179} 2179}
2180 2180
@@ -2217,9 +2217,9 @@ static int ext4_sync_fs(struct super_block *sb, int wait)
2217 tid_t target; 2217 tid_t target;
2218 2218
2219 sb->s_dirt = 0; 2219 sb->s_dirt = 0;
2220 if (journal_start_commit(EXT4_SB(sb)->s_journal, &target)) { 2220 if (jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, &target)) {
2221 if (wait) 2221 if (wait)
2222 log_wait_commit(EXT4_SB(sb)->s_journal, target); 2222 jbd2_log_wait_commit(EXT4_SB(sb)->s_journal, target);
2223 } 2223 }
2224 return 0; 2224 return 0;
2225} 2225}
@@ -2236,8 +2236,8 @@ static void ext4_write_super_lockfs(struct super_block *sb)
2236 journal_t *journal = EXT4_SB(sb)->s_journal; 2236 journal_t *journal = EXT4_SB(sb)->s_journal;
2237 2237
2238 /* Now we set up the journal barrier. */ 2238 /* Now we set up the journal barrier. */
2239 journal_lock_updates(journal); 2239 jbd2_journal_lock_updates(journal);
2240 journal_flush(journal); 2240 jbd2_journal_flush(journal);
2241 2241
2242 /* Journal blocked and flushed, clear needs_recovery flag. */ 2242 /* Journal blocked and flushed, clear needs_recovery flag. */
2243 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 2243 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
@@ -2257,7 +2257,7 @@ static void ext4_unlockfs(struct super_block *sb)
2257 EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 2257 EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
2258 ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); 2258 ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1);
2259 unlock_super(sb); 2259 unlock_super(sb);
2260 journal_unlock_updates(EXT4_SB(sb)->s_journal); 2260 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
2261 } 2261 }
2262} 2262}
2263 2263
@@ -2438,9 +2438,9 @@ static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf)
2438 * is locked for write. Otherwise the are possible deadlocks: 2438 * is locked for write. Otherwise the are possible deadlocks:
2439 * Process 1 Process 2 2439 * Process 1 Process 2
2440 * ext4_create() quota_sync() 2440 * ext4_create() quota_sync()
2441 * journal_start() write_dquot() 2441 * jbd2_journal_start() write_dquot()
2442 * DQUOT_INIT() down(dqio_mutex) 2442 * DQUOT_INIT() down(dqio_mutex)
2443 * down(dqio_mutex) journal_start() 2443 * down(dqio_mutex) jbd2_journal_start()
2444 * 2444 *
2445 */ 2445 */
2446 2446
diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
index 9e4c75f912f7..fcf527286d75 100644
--- a/fs/ext4/symlink.c
+++ b/fs/ext4/symlink.c
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/jbd.h> 21#include <linux/jbd2.h>
22#include <linux/ext4_fs.h> 22#include <linux/ext4_fs.h>
23#include <linux/namei.h> 23#include <linux/namei.h>
24#include "xattr.h" 24#include "xattr.h"
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index d3a408154101..90f7d5c0bae4 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -53,7 +53,7 @@
53#include <linux/init.h> 53#include <linux/init.h>
54#include <linux/fs.h> 54#include <linux/fs.h>
55#include <linux/slab.h> 55#include <linux/slab.h>
56#include <linux/ext4_jbd.h> 56#include <linux/ext4_jbd2.h>
57#include <linux/ext4_fs.h> 57#include <linux/ext4_fs.h>
58#include <linux/mbcache.h> 58#include <linux/mbcache.h>
59#include <linux/quotaops.h> 59#include <linux/quotaops.h>
diff --git a/fs/ext4/xattr_security.c b/fs/ext4/xattr_security.c
index d84b1dabeb16..b6a6861951f9 100644
--- a/fs/ext4/xattr_security.c
+++ b/fs/ext4/xattr_security.c
@@ -7,7 +7,7 @@
7#include <linux/string.h> 7#include <linux/string.h>
8#include <linux/fs.h> 8#include <linux/fs.h>
9#include <linux/smp_lock.h> 9#include <linux/smp_lock.h>
10#include <linux/ext4_jbd.h> 10#include <linux/ext4_jbd2.h>
11#include <linux/ext4_fs.h> 11#include <linux/ext4_fs.h>
12#include <linux/security.h> 12#include <linux/security.h>
13#include "xattr.h" 13#include "xattr.h"
diff --git a/fs/ext4/xattr_trusted.c b/fs/ext4/xattr_trusted.c
index 11bd58c95a61..b76f2dbc82da 100644
--- a/fs/ext4/xattr_trusted.c
+++ b/fs/ext4/xattr_trusted.c
@@ -10,7 +10,7 @@
10#include <linux/capability.h> 10#include <linux/capability.h>
11#include <linux/fs.h> 11#include <linux/fs.h>
12#include <linux/smp_lock.h> 12#include <linux/smp_lock.h>
13#include <linux/ext4_jbd.h> 13#include <linux/ext4_jbd2.h>
14#include <linux/ext4_fs.h> 14#include <linux/ext4_fs.h>
15#include "xattr.h" 15#include "xattr.h"
16 16
diff --git a/fs/ext4/xattr_user.c b/fs/ext4/xattr_user.c
index 9c5a665e0837..c53cded0761a 100644
--- a/fs/ext4/xattr_user.c
+++ b/fs/ext4/xattr_user.c
@@ -9,7 +9,7 @@
9#include <linux/string.h> 9#include <linux/string.h>
10#include <linux/fs.h> 10#include <linux/fs.h>
11#include <linux/smp_lock.h> 11#include <linux/smp_lock.h>
12#include <linux/ext4_jbd.h> 12#include <linux/ext4_jbd2.h>
13#include <linux/ext4_fs.h> 13#include <linux/ext4_fs.h>
14#include "xattr.h" 14#include "xattr.h"
15 15