Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 229082
b: refs/heads/master
c: 5026e90
h: refs/heads/master
v: v3
  • Loading branch information
Theodore Ts'o authored and Jan Kara committed Jan 6, 2011
1 parent a1706d6 commit 39b49c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0cad89f5e8ef8b6d0c065115565524137e44f0b
refs/heads/master: 5026e90b86684bc878e4db0a8cd043fed769719c
33 changes: 12 additions & 21 deletions trunk/fs/ext3/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,39 +975,30 @@ static struct buffer_head * ext3_dx_find_entry(struct inode *dir,
struct super_block *sb = dir->i_sb;
struct dx_hash_info hinfo;
struct dx_frame frames[2], *frame;
struct ext3_dir_entry_2 *de, *top;
struct buffer_head *bh;
unsigned long block;
int retval;
int namelen = entry->len;
const u8 *name = entry->name;

if (!(frame = dx_probe(entry, dir, &hinfo, frames, err)))
return NULL;
do {
block = dx_get_block(frame->at);
if (!(bh = ext3_bread (NULL,dir, block, 0, err)))
goto errout;
de = (struct ext3_dir_entry_2 *) bh->b_data;
top = (struct ext3_dir_entry_2 *) ((char *) de + sb->s_blocksize -
EXT3_DIR_REC_LEN(0));
for (; de < top; de = ext3_next_entry(de)) {
int off = (block << EXT3_BLOCK_SIZE_BITS(sb))
+ ((char *) de - bh->b_data);

if (!ext3_check_dir_entry(__func__, dir, de, bh, off)) {
brelse(bh);
*err = ERR_BAD_DX_DIR;
goto errout;
}

if (ext3_match(namelen, name, de)) {
*res_dir = de;
dx_release(frames);
return bh;
}
retval = search_dirblock(bh, dir, entry,
block << EXT3_BLOCK_SIZE_BITS(sb),
res_dir);
if (retval == 1) {
dx_release(frames);
return bh;
}
brelse (bh);
brelse(bh);
if (retval == -1) {
*err = ERR_BAD_DX_DIR;
goto errout;
}

/* Check to see if we should continue to search */
retval = ext3_htree_next_block(dir, hinfo.hash, frame,
frames, NULL);
Expand Down

0 comments on commit 39b49c1

Please sign in to comment.