* [PATCH 1/2] ext3: kill 2 useless magic numbers
@ 2008-06-12 1:18 Li Zefan
2008-06-12 6:38 ` Andreas Dilger
0 siblings, 1 reply; 3+ messages in thread
From: Li Zefan @ 2008-06-12 1:18 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Andrew Morton, linux-ext4
dx_root_limit() will never return 20, and I can't figure out
what 20 stands for. This function has never changed since htree
directory indexing was merged.
Similar for dx_node_limit() and the magic 22.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
fs/ext3/namei.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 0b8cf80..d282ea8 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -240,13 +240,13 @@ static inline unsigned dx_root_limit (struct inode *dir, unsigned infosize)
{
unsigned entry_space = dir->i_sb->s_blocksize - EXT3_DIR_REC_LEN(1) -
EXT3_DIR_REC_LEN(2) - infosize;
- return 0? 20: entry_space / sizeof(struct dx_entry);
+ return entry_space / sizeof(struct dx_entry);
}
static inline unsigned dx_node_limit (struct inode *dir)
{
unsigned entry_space = dir->i_sb->s_blocksize - EXT3_DIR_REC_LEN(0);
- return 0? 22: entry_space / sizeof(struct dx_entry);
+ return entry_space / sizeof(struct dx_entry);
}
/*
--
1.5.4.rc3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] ext3: kill 2 useless magic numbers
2008-06-12 1:18 [PATCH 1/2] ext3: kill 2 useless magic numbers Li Zefan
@ 2008-06-12 6:38 ` Andreas Dilger
2008-06-12 23:11 ` Mingming Cao
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Dilger @ 2008-06-12 6:38 UTC (permalink / raw)
To: Li Zefan; +Cc: Theodore Ts'o, Andrew Morton, linux-ext4
On Jun 12, 2008 09:18 +0800, Li Zefan wrote:
> dx_root_limit() will never return 20, and I can't figure out
> what 20 stands for. This function has never changed since htree
> directory indexing was merged.
>
> Similar for dx_node_limit() and the magic 22.
This was for testing htree split code more aggressively, but can be
removed.
Acked-by: Andreas Dilger <adilger@sun.com>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
> fs/ext3/namei.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
> index 0b8cf80..d282ea8 100644
> --- a/fs/ext3/namei.c
> +++ b/fs/ext3/namei.c
> @@ -240,13 +240,13 @@ static inline unsigned dx_root_limit (struct inode *dir, unsigned infosize)
> {
> unsigned entry_space = dir->i_sb->s_blocksize - EXT3_DIR_REC_LEN(1) -
> EXT3_DIR_REC_LEN(2) - infosize;
> - return 0? 20: entry_space / sizeof(struct dx_entry);
> + return entry_space / sizeof(struct dx_entry);
> }
>
> static inline unsigned dx_node_limit (struct inode *dir)
> {
> unsigned entry_space = dir->i_sb->s_blocksize - EXT3_DIR_REC_LEN(0);
> - return 0? 22: entry_space / sizeof(struct dx_entry);
> + return entry_space / sizeof(struct dx_entry);
> }
>
> /*
> --
> 1.5.4.rc3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] ext3: kill 2 useless magic numbers
2008-06-12 6:38 ` Andreas Dilger
@ 2008-06-12 23:11 ` Mingming Cao
0 siblings, 0 replies; 3+ messages in thread
From: Mingming Cao @ 2008-06-12 23:11 UTC (permalink / raw)
To: Andreas Dilger; +Cc: Li Zefan, Theodore Ts'o, Andrew Morton, linux-ext4
On Thu, 2008-06-12 at 00:38 -0600, Andreas Dilger wrote:
> On Jun 12, 2008 09:18 +0800, Li Zefan wrote:
> > dx_root_limit() will never return 20, and I can't figure out
> > what 20 stands for. This function has never changed since htree
> > directory indexing was merged.
> >
> > Similar for dx_node_limit() and the magic 22.
>
> This was for testing htree split code more aggressively, but can be
> removed.
>
> Acked-by: Andreas Dilger <adilger@sun.com>
I added the ext4 version to the patch queue
Mingming
>
> > Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> > ---
> > fs/ext3/namei.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
> > index 0b8cf80..d282ea8 100644
> > --- a/fs/ext3/namei.c
> > +++ b/fs/ext3/namei.c
> > @@ -240,13 +240,13 @@ static inline unsigned dx_root_limit (struct inode *dir, unsigned infosize)
> > {
> > unsigned entry_space = dir->i_sb->s_blocksize - EXT3_DIR_REC_LEN(1) -
> > EXT3_DIR_REC_LEN(2) - infosize;
> > - return 0? 20: entry_space / sizeof(struct dx_entry);
> > + return entry_space / sizeof(struct dx_entry);
> > }
> >
> > static inline unsigned dx_node_limit (struct inode *dir)
> > {
> > unsigned entry_space = dir->i_sb->s_blocksize - EXT3_DIR_REC_LEN(0);
> > - return 0? 22: entry_space / sizeof(struct dx_entry);
> > + return entry_space / sizeof(struct dx_entry);
> > }
> >
> > /*
> > --
> > 1.5.4.rc3
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> Cheers, Andreas
> --
> Andreas Dilger
> Sr. Staff Engineer, Lustre Group
> Sun Microsystems of Canada, Inc.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-06-12 23:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-12 1:18 [PATCH 1/2] ext3: kill 2 useless magic numbers Li Zefan
2008-06-12 6:38 ` Andreas Dilger
2008-06-12 23:11 ` Mingming Cao
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).