Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218875
b: refs/heads/master
c: 7845c04
h: refs/heads/master
i:
  218873: bb0e998
  218871: 877ea99
v: v3
  • Loading branch information
Theodore Ts'o committed Oct 28, 2010
1 parent 74c58bd commit d8f56aa
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: 8941ec8bb6443d28d5c25311870aeaa809cf1538
refs/heads/master: 7845c0497536c566bfef08db1a38ae1ad2c25464
33 changes: 12 additions & 21 deletions trunk/fs/ext4/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,39 +974,30 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct q
struct super_block * sb = dir->i_sb;
struct dx_hash_info hinfo;
struct dx_frame frames[2], *frame;
struct ext4_dir_entry_2 *de, *top;
struct buffer_head *bh;
ext4_lblk_t block;
int retval;
int namelen = d_name->len;
const u8 *name = d_name->name;

if (!(frame = dx_probe(d_name, dir, &hinfo, frames, err)))
return NULL;
do {
block = dx_get_block(frame->at);
if (!(bh = ext4_bread (NULL,dir, block, 0, err)))
if (!(bh = ext4_bread(NULL, dir, block, 0, err)))
goto errout;
de = (struct ext4_dir_entry_2 *) bh->b_data;
top = (struct ext4_dir_entry_2 *) ((char *) de + sb->s_blocksize -
EXT4_DIR_REC_LEN(0));
for (; de < top; de = ext4_next_entry(de, sb->s_blocksize)) {
int off = (block << EXT4_BLOCK_SIZE_BITS(sb))
+ ((char *) de - bh->b_data);

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

if (ext4_match(namelen, name, de)) {
*res_dir = de;
dx_release(frames);
return bh;
}
retval = search_dirblock(bh, dir, d_name,
block << EXT4_BLOCK_SIZE_BITS(sb),
res_dir);
if (retval == 1) { /* Success! */
dx_release(frames);
return bh;
}
brelse(bh);
if (retval == -1) {
*err = ERR_BAD_DX_DIR;
goto errout;
}

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

0 comments on commit d8f56aa

Please sign in to comment.