Skip to content

Commit

Permalink
ext3: kill 2 useless magic numbers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Andreas Dilger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Li Zefan authored and torvalds committed Jul 25, 2008
1 parent fc80c44 commit 8ef2720
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ext3/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit 8ef2720

Please sign in to comment.