Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dab291af authored by Mingming Cao's avatar Mingming Cao Committed by Linus Torvalds
Browse files

[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: default avatarRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: default avatarMingming Cao <cmm@us.ibm.com>
Signed-off-by: default avatarDave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a920e941
Loading
Loading
Loading
Loading
+40 −8
Original line number Original line Diff line number Diff line
@@ -143,7 +143,7 @@ config EXT3_FS_SECURITY
config EXT4DEV_FS
config EXT4DEV_FS
	tristate "Ext4dev/ext4 extended fs support development (EXPERIMENTAL)"
	tristate "Ext4dev/ext4 extended fs support development (EXPERIMENTAL)"
	depends on EXPERIMENTAL
	depends on EXPERIMENTAL
        select JBD
	select JBD2
	help
	help
	  Ext4dev is a predecessor filesystem of the next generation
	  Ext4dev is a predecessor filesystem of the next generation
	  extended fs ext4, based on ext3 filesystem code. It will be
	  extended fs ext4, based on ext3 filesystem code. It will be
@@ -239,6 +239,38 @@ config JBD_DEBUG
	  generated.  To turn debugging off again, do
	  generated.  To turn debugging off again, do
	  "echo 0 > /proc/sys/fs/jbd-debug".
	  "echo 0 > /proc/sys/fs/jbd-debug".


config JBD2
	tristate
	help
	  This is a generic journaling layer for block devices that support
	  both 32-bit and 64-bit block numbers.  It is currently used by
	  the ext4dev/ext4 filesystem, but it could also be used to add
	  journal support to other file systems or block devices such
	  as RAID or LVM.

	  If you are using ext4dev/ext4, you need to say Y here. If you are not
	  using ext4dev/ext4 then you will probably want to say N.

	  To compile this device as a module, choose M here. The module will be
	  called jbd2.  If you are compiling ext4dev/ext4 into the kernel,
	  you cannot compile this code as a module.

config JBD2_DEBUG
	bool "JBD2 (ext4dev/ext4) debugging support"
	depends on JBD2
	help
	  If you are using the ext4dev/ext4 journaled file system (or
	  potentially any other filesystem/device using JBD2), this option
	  allows you to enable debugging output while the system is running,
	  in order to help track down any problems you are having.
	  By default, the debugging output will be turned off.

	  If you select Y here, then you will be able to turn on debugging
	  with "echo N > /proc/sys/fs/jbd2-debug", where N is a number between
	  1 and 5. The higher the number, the more debugging output is
	  generated.  To turn debugging off again, do
	  "echo 0 > /proc/sys/fs/jbd2-debug".

config FS_MBCACHE
config FS_MBCACHE
# Meta block cache for Extended Attributes (ext2/ext3/ext4)
# Meta block cache for Extended Attributes (ext2/ext3/ext4)
	tristate
	tristate
+1 −0
Original line number Original line Diff line number Diff line
@@ -64,6 +64,7 @@ obj-$(CONFIG_REISERFS_FS) += reiserfs/
obj-$(CONFIG_EXT3_FS)		+= ext3/ # Before ext2 so root fs can be ext3
obj-$(CONFIG_EXT3_FS)		+= ext3/ # Before ext2 so root fs can be ext3
obj-$(CONFIG_EXT4DEV_FS)	+= ext4/ # Before ext2 so root fs can be ext4dev
obj-$(CONFIG_EXT4DEV_FS)	+= ext4/ # Before ext2 so root fs can be ext4dev
obj-$(CONFIG_JBD)		+= jbd/
obj-$(CONFIG_JBD)		+= jbd/
obj-$(CONFIG_JBD2)		+= jbd2/
obj-$(CONFIG_EXT2_FS)		+= ext2/
obj-$(CONFIG_EXT2_FS)		+= ext2/
obj-$(CONFIG_CRAMFS)		+= cramfs/
obj-$(CONFIG_CRAMFS)		+= cramfs/
obj-$(CONFIG_RAMFS)		+= ramfs/
obj-$(CONFIG_RAMFS)		+= ramfs/
+1 −1
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/capability.h>
#include <linux/capability.h>
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/ext4_jbd.h>
#include <linux/ext4_jbd2.h>
#include <linux/ext4_fs.h>
#include <linux/ext4_fs.h>
#include "xattr.h"
#include "xattr.h"
#include "acl.h"
#include "acl.h"
+5 −5
Original line number Original line Diff line number Diff line
@@ -14,9 +14,9 @@
#include <linux/time.h>
#include <linux/time.h>
#include <linux/capability.h>
#include <linux/capability.h>
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/jbd2.h>
#include <linux/ext4_fs.h>
#include <linux/ext4_fs.h>
#include <linux/ext4_jbd.h>
#include <linux/ext4_jbd2.h>
#include <linux/quotaops.h>
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
#include <linux/buffer_head.h>


@@ -526,12 +526,12 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
		 * transaction.
		 * transaction.
		 *
		 *
		 * Ideally we would want to allow that to happen, but to
		 * Ideally we would want to allow that to happen, but to
		 * do so requires making journal_forget() capable of
		 * do so requires making jbd2_journal_forget() capable of
		 * revoking the queued write of a data block, which
		 * revoking the queued write of a data block, which
		 * implies blocking on the journal lock.  *forget()
		 * implies blocking on the journal lock.  *forget()
		 * cannot block due to truncate races.
		 * cannot block due to truncate races.
		 *
		 *
		 * Eventually we can fix this by making journal_forget()
		 * Eventually we can fix this by making jbd2_journal_forget()
		 * return a status indicating whether or not it was able
		 * return a status indicating whether or not it was able
		 * to revoke the buffer.  On successful revoke, it is
		 * to revoke the buffer.  On successful revoke, it is
		 * safe not to set the allocation bit in the committed
		 * 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)


	jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
	jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);


	return journal_force_commit_nested(EXT4_SB(sb)->s_journal);
	return jbd2_journal_force_commit_nested(EXT4_SB(sb)->s_journal);
}
}


/**
/**
+1 −1
Original line number Original line Diff line number Diff line
@@ -8,7 +8,7 @@
 */
 */


#include <linux/buffer_head.h>
#include <linux/buffer_head.h>
#include <linux/jbd.h>
#include <linux/jbd2.h>
#include <linux/ext4_fs.h>
#include <linux/ext4_fs.h>


#ifdef EXT4FS_DEBUG
#ifdef EXT4FS_DEBUG
Loading