diff options
-rw-r--r-- | fs/ext4/dir.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 2bf0331ea194..5ed5108766c1 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -272,7 +272,7 @@ static void free_rb_tree_fname(struct rb_root *root) | |||
272 | 272 | ||
273 | while (n) { | 273 | while (n) { |
274 | /* Do the node's children first */ | 274 | /* Do the node's children first */ |
275 | if ((n)->rb_left) { | 275 | if (n->rb_left) { |
276 | n = n->rb_left; | 276 | n = n->rb_left; |
277 | continue; | 277 | continue; |
278 | } | 278 | } |
@@ -301,24 +301,18 @@ static void free_rb_tree_fname(struct rb_root *root) | |||
301 | parent->rb_right = NULL; | 301 | parent->rb_right = NULL; |
302 | n = parent; | 302 | n = parent; |
303 | } | 303 | } |
304 | root->rb_node = NULL; | ||
305 | } | 304 | } |
306 | 305 | ||
307 | 306 | ||
308 | static struct dir_private_info *create_dir_info(loff_t pos) | 307 | static struct dir_private_info *ext4_htree_create_dir_info(loff_t pos) |
309 | { | 308 | { |
310 | struct dir_private_info *p; | 309 | struct dir_private_info *p; |
311 | 310 | ||
312 | p = kmalloc(sizeof(struct dir_private_info), GFP_KERNEL); | 311 | p = kzalloc(sizeof(struct dir_private_info), GFP_KERNEL); |
313 | if (!p) | 312 | if (!p) |
314 | return NULL; | 313 | return NULL; |
315 | p->root.rb_node = NULL; | ||
316 | p->curr_node = NULL; | ||
317 | p->extra_fname = NULL; | ||
318 | p->last_pos = 0; | ||
319 | p->curr_hash = pos2maj_hash(pos); | 314 | p->curr_hash = pos2maj_hash(pos); |
320 | p->curr_minor_hash = pos2min_hash(pos); | 315 | p->curr_minor_hash = pos2min_hash(pos); |
321 | p->next_hash = 0; | ||
322 | return p; | 316 | return p; |
323 | } | 317 | } |
324 | 318 | ||
@@ -433,7 +427,7 @@ static int ext4_dx_readdir(struct file * filp, | |||
433 | int ret; | 427 | int ret; |
434 | 428 | ||
435 | if (!info) { | 429 | if (!info) { |
436 | info = create_dir_info(filp->f_pos); | 430 | info = ext4_htree_create_dir_info(filp->f_pos); |
437 | if (!info) | 431 | if (!info) |
438 | return -ENOMEM; | 432 | return -ENOMEM; |
439 | filp->private_data = info; | 433 | filp->private_data = info; |