Commit 5abe769b authored by Theodore Y. Ts'o's avatar Theodore Y. Ts'o Committed by Linus Torvalds

Add '.' and '..' entries to be returned by readdir of htree directories

This patch from Chris Li adds '.' and '..' to the rbtree so that they 
are properly returned by readdir.
parent a93de984
...@@ -549,6 +549,15 @@ int ext3_htree_fill_tree(struct file *dir_file, __u32 start_hash, ...@@ -549,6 +549,15 @@ int ext3_htree_fill_tree(struct file *dir_file, __u32 start_hash,
if (!frame) if (!frame)
return err; return err;
/* Add '.' and '..' from the htree header */
if (!start_hash && !start_minor_hash) {
de = (struct ext3_dir_entry_2 *) frames[0].bh->b_data;
ext3_htree_store_dirent(dir_file, 0, 0, de);
de = ext3_next_entry(de);
ext3_htree_store_dirent(dir_file, 0, 0, de);
count += 2;
}
while (1) { while (1) {
block = dx_get_block(frame->at); block = dx_get_block(frame->at);
dxtrace(printk("Reading block %d\n", block)); dxtrace(printk("Reading block %d\n", block));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment