Lines Matching refs:de
222 struct ext2_dir_entry_2 * de) in ext2_match() argument
224 if (len != de->name_len) in ext2_match()
226 if (!de->inode) in ext2_match()
228 return !memcmp(name, de->name, len); in ext2_match()
243 ext2_dirent *de = (ext2_dirent*)(base + offset); in ext2_validate_entry() local
245 while ((char*)p < (char*)de) { in ext2_validate_entry()
275 static inline void ext2_set_de_type(ext2_dirent *de, struct inode *inode) in ext2_set_de_type() argument
279 de->file_type = ext2_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; in ext2_set_de_type()
281 de->file_type = 0; in ext2_set_de_type()
305 ext2_dirent *de; in ext2_readdir() local
324 de = (ext2_dirent *)(kaddr+offset); in ext2_readdir()
326 for ( ;(char*)de <= limit; de = ext2_next_entry(de)) { in ext2_readdir()
327 if (de->rec_len == 0) { in ext2_readdir()
333 if (de->inode) { in ext2_readdir()
336 if (types && de->file_type < EXT2_FT_MAX) in ext2_readdir()
337 d_type = types[de->file_type]; in ext2_readdir()
339 if (!dir_emit(ctx, de->name, de->name_len, in ext2_readdir()
340 le32_to_cpu(de->inode), in ext2_readdir()
346 ctx->pos += ext2_rec_len_from_disk(de->rec_len); in ext2_readdir()
371 ext2_dirent * de; in ext2_find_entry() local
389 de = (ext2_dirent *) kaddr; in ext2_find_entry()
391 while ((char *) de <= kaddr) { in ext2_find_entry()
392 if (de->rec_len == 0) { in ext2_find_entry()
398 if (ext2_match (namelen, name, de)) in ext2_find_entry()
400 de = ext2_next_entry(de); in ext2_find_entry()
423 return de; in ext2_find_entry()
429 ext2_dirent *de = NULL; in ext2_dotdot() local
432 de = ext2_next_entry((ext2_dirent *) page_address(page)); in ext2_dotdot()
435 return de; in ext2_dotdot()
441 struct ext2_dir_entry_2 *de; in ext2_inode_by_name() local
444 de = ext2_find_entry (dir, child, &page); in ext2_inode_by_name()
445 if (de) { in ext2_inode_by_name()
446 res = le32_to_cpu(de->inode); in ext2_inode_by_name()
458 void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de, in ext2_set_link() argument
462 (char *) de - (char *) page_address(page); in ext2_set_link()
463 unsigned len = ext2_rec_len_from_disk(de->rec_len); in ext2_set_link()
469 de->inode = cpu_to_le32(inode->i_ino); in ext2_set_link()
470 ext2_set_de_type(de, inode); in ext2_set_link()
491 ext2_dirent * de; in ext2_add_link() local
513 de = (ext2_dirent *)kaddr; in ext2_add_link()
515 while ((char *)de <= kaddr) { in ext2_add_link()
516 if ((char *)de == dir_end) { in ext2_add_link()
520 de->rec_len = ext2_rec_len_to_disk(chunk_size); in ext2_add_link()
521 de->inode = 0; in ext2_add_link()
524 if (de->rec_len == 0) { in ext2_add_link()
531 if (ext2_match (namelen, name, de)) in ext2_add_link()
533 name_len = EXT2_DIR_REC_LEN(de->name_len); in ext2_add_link()
534 rec_len = ext2_rec_len_from_disk(de->rec_len); in ext2_add_link()
535 if (!de->inode && rec_len >= reclen) in ext2_add_link()
539 de = (ext2_dirent *) ((char *) de + rec_len); in ext2_add_link()
549 (char*)de - (char*)page_address(page); in ext2_add_link()
553 if (de->inode) { in ext2_add_link()
554 ext2_dirent *de1 = (ext2_dirent *) ((char *) de + name_len); in ext2_add_link()
556 de->rec_len = ext2_rec_len_to_disk(name_len); in ext2_add_link()
557 de = de1; in ext2_add_link()
559 de->name_len = namelen; in ext2_add_link()
560 memcpy(de->name, name, namelen); in ext2_add_link()
561 de->inode = cpu_to_le32(inode->i_ino); in ext2_add_link()
562 ext2_set_de_type (de, inode); in ext2_add_link()
590 ext2_dirent * de = (ext2_dirent *) (kaddr + from); in ext2_delete_entry() local
593 while ((char*)de < (char*)dir) { in ext2_delete_entry()
594 if (de->rec_len == 0) { in ext2_delete_entry()
600 pde = de; in ext2_delete_entry()
601 de = ext2_next_entry(de); in ext2_delete_entry()
628 struct ext2_dir_entry_2 * de; in ext2_make_empty() local
642 de = (struct ext2_dir_entry_2 *)kaddr; in ext2_make_empty()
643 de->name_len = 1; in ext2_make_empty()
644 de->rec_len = ext2_rec_len_to_disk(EXT2_DIR_REC_LEN(1)); in ext2_make_empty()
645 memcpy (de->name, ".\0\0", 4); in ext2_make_empty()
646 de->inode = cpu_to_le32(inode->i_ino); in ext2_make_empty()
647 ext2_set_de_type (de, inode); in ext2_make_empty()
649 de = (struct ext2_dir_entry_2 *)(kaddr + EXT2_DIR_REC_LEN(1)); in ext2_make_empty()
650 de->name_len = 2; in ext2_make_empty()
651 de->rec_len = ext2_rec_len_to_disk(chunk_size - EXT2_DIR_REC_LEN(1)); in ext2_make_empty()
652 de->inode = cpu_to_le32(parent->i_ino); in ext2_make_empty()
653 memcpy (de->name, "..\0", 4); in ext2_make_empty()
654 ext2_set_de_type (de, inode); in ext2_make_empty()
673 ext2_dirent * de; in ext2_empty_dir() local
682 de = (ext2_dirent *)kaddr; in ext2_empty_dir()
685 while ((char *)de <= kaddr) { in ext2_empty_dir()
686 if (de->rec_len == 0) { in ext2_empty_dir()
689 printk("kaddr=%p, de=%p\n", kaddr, de); in ext2_empty_dir()
692 if (de->inode != 0) { in ext2_empty_dir()
694 if (de->name[0] != '.') in ext2_empty_dir()
696 if (de->name_len > 2) in ext2_empty_dir()
698 if (de->name_len < 2) { in ext2_empty_dir()
699 if (de->inode != in ext2_empty_dir()
702 } else if (de->name[1] != '.') in ext2_empty_dir()
705 de = ext2_next_entry(de); in ext2_empty_dir()