linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Use EXT4FS_DEBUG instead of EXT4_DEBUG in fsync.c
@ 2011-03-28 15:41 Tao Ma
  2011-03-28 15:41 ` [PATCH] ext4: Use s_inodes_per_block directly in __ext4_get_inode_loc Tao Ma
  2011-05-09  1:55 ` [PATCH] ext4: Use EXT4FS_DEBUG instead of EXT4_DEBUG in fsync.c Ted Ts'o
  0 siblings, 2 replies; 4+ messages in thread
From: Tao Ma @ 2011-03-28 15:41 UTC (permalink / raw)
  To: linux-ext4

From: Tao Ma <boyu.mt@taobao.com>

We have EXT4FS_DEBUG for some old debug and CONFIG_EXT4_DEBUG
for the new mballoc debug, but there isn't any EXT4_DEBUG.

As CONFIG_EXT4_DEBUG seems to be only used in mballoc, use
EXT4FS_DEBUG in fsync.c.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
---
 fs/ext4/fsync.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 7f74019..3278d6d 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -36,7 +36,7 @@
 
 static void dump_completed_IO(struct inode * inode)
 {
-#ifdef	EXT4_DEBUG
+#ifdef	EXT4FS_DEBUG
 	struct list_head *cur, *before, *after;
 	ext4_io_end_t *io, *io0, *io1;
 	unsigned long flags;
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ext4: Use s_inodes_per_block directly in __ext4_get_inode_loc.
  2011-03-28 15:41 [PATCH] ext4: Use EXT4FS_DEBUG instead of EXT4_DEBUG in fsync.c Tao Ma
@ 2011-03-28 15:41 ` Tao Ma
  2011-05-09  1:56   ` Ted Ts'o
  2011-05-09  1:55 ` [PATCH] ext4: Use EXT4FS_DEBUG instead of EXT4_DEBUG in fsync.c Ted Ts'o
  1 sibling, 1 reply; 4+ messages in thread
From: Tao Ma @ 2011-03-28 15:41 UTC (permalink / raw)
  To: linux-ext4

From: Tao Ma <boyu.mt@taobao.com>

In __ext4_get_inode_loc, we calculate inodes_per_block every time
by EXT4_BLOCK_SIZE(sb) / EXT4_INODE_SIZE(sb). AFAICS, this function
is really a hot path for ext4, so we'd better use s_inodes_per_block
directly instead of calculating every time.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
---
 fs/ext4/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 1a86282..326efd9 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4605,7 +4605,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
 	/*
 	 * Figure out the offset within the block group inode table
 	 */
-	inodes_per_block = (EXT4_BLOCK_SIZE(sb) / EXT4_INODE_SIZE(sb));
+	inodes_per_block = EXT4_SB(sb)->s_inodes_per_block;
 	inode_offset = ((inode->i_ino - 1) %
 			EXT4_INODES_PER_GROUP(sb));
 	block = ext4_inode_table(sb, gdp) + (inode_offset / inodes_per_block);
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ext4: Use EXT4FS_DEBUG instead of EXT4_DEBUG in fsync.c
  2011-03-28 15:41 [PATCH] ext4: Use EXT4FS_DEBUG instead of EXT4_DEBUG in fsync.c Tao Ma
  2011-03-28 15:41 ` [PATCH] ext4: Use s_inodes_per_block directly in __ext4_get_inode_loc Tao Ma
@ 2011-05-09  1:55 ` Ted Ts'o
  1 sibling, 0 replies; 4+ messages in thread
From: Ted Ts'o @ 2011-05-09  1:55 UTC (permalink / raw)
  To: Tao Ma; +Cc: linux-ext4

On Mon, Mar 28, 2011 at 11:41:12PM +0800, Tao Ma wrote:
> From: Tao Ma <boyu.mt@taobao.com>
> 
> We have EXT4FS_DEBUG for some old debug and CONFIG_EXT4_DEBUG
> for the new mballoc debug, but there isn't any EXT4_DEBUG.
> 
> As CONFIG_EXT4_DEBUG seems to be only used in mballoc, use
> EXT4FS_DEBUG in fsync.c.
> 
> Signed-off-by: Tao Ma <boyu.mt@taobao.com>

It doesn't really matter; although I'm including this patch in the
ext4 tree for consistency's sake.  The whole point of the #ifdef's is
to disable the debugging code.  In general you don't want to enable
all of the code protected by EXT4FS_DEBUG at the same time.

						- Ted

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ext4: Use s_inodes_per_block directly in __ext4_get_inode_loc.
  2011-03-28 15:41 ` [PATCH] ext4: Use s_inodes_per_block directly in __ext4_get_inode_loc Tao Ma
@ 2011-05-09  1:56   ` Ted Ts'o
  0 siblings, 0 replies; 4+ messages in thread
From: Ted Ts'o @ 2011-05-09  1:56 UTC (permalink / raw)
  To: Tao Ma; +Cc: linux-ext4

On Mon, Mar 28, 2011 at 11:41:13PM +0800, Tao Ma wrote:
> From: Tao Ma <boyu.mt@taobao.com>
> 
> In __ext4_get_inode_loc, we calculate inodes_per_block every time
> by EXT4_BLOCK_SIZE(sb) / EXT4_INODE_SIZE(sb). AFAICS, this function
> is really a hot path for ext4, so we'd better use s_inodes_per_block
> directly instead of calculating every time.
> 
> Signed-off-by: Tao Ma <boyu.mt@taobao.com>

Added to the ext4 tree, thanks.

						- Ted

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-09  1:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28 15:41 [PATCH] ext4: Use EXT4FS_DEBUG instead of EXT4_DEBUG in fsync.c Tao Ma
2011-03-28 15:41 ` [PATCH] ext4: Use s_inodes_per_block directly in __ext4_get_inode_loc Tao Ma
2011-05-09  1:56   ` Ted Ts'o
2011-05-09  1:55 ` [PATCH] ext4: Use EXT4FS_DEBUG instead of EXT4_DEBUG in fsync.c Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).