Lines Matching refs:de
127 struct ocfs2_dir_entry *de, in ocfs2_skip_dir_trailer() argument
160 struct ocfs2_dir_entry * de, in ocfs2_check_dir_entry() argument
165 const int rlen = le16_to_cpu(de->rec_len); in ocfs2_check_dir_entry()
171 else if (rlen < OCFS2_DIR_REC_LEN(de->name_len)) in ocfs2_check_dir_entry()
173 else if (((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize) in ocfs2_check_dir_entry()
180 offset, (unsigned long long)le64_to_cpu(de->inode), rlen, in ocfs2_check_dir_entry()
181 de->name_len); in ocfs2_check_dir_entry()
187 struct ocfs2_dir_entry *de) in ocfs2_match() argument
189 if (len != de->name_len) in ocfs2_match()
191 if (!de->inode) in ocfs2_match()
193 return !memcmp(name, de->name, len); in ocfs2_match()
207 struct ocfs2_dir_entry *de; in ocfs2_search_dirblock() local
221 de = (struct ocfs2_dir_entry *) de_buf; in ocfs2_search_dirblock()
224 ocfs2_match(namelen, name, de)) { in ocfs2_search_dirblock()
226 if (!ocfs2_check_dir_entry(dir, de, bh, offset)) { in ocfs2_search_dirblock()
230 *res_dir = de; in ocfs2_search_dirblock()
236 de_len = le16_to_cpu(de->rec_len); in ocfs2_search_dirblock()
511 struct buffer_head *de_bh, struct ocfs2_dir_entry *de, in ocfs2_update_entry() argument
532 de->inode = cpu_to_le64(OCFS2_I(new_entry_inode)->ip_blkno); in ocfs2_update_entry()
533 ocfs2_set_de_type(de, new_entry_inode->i_mode); in ocfs2_update_entry()
546 struct ocfs2_dir_entry *de, *pde; in __ocfs2_delete_entry() local
557 de = (struct ocfs2_dir_entry *) first_de; in __ocfs2_delete_entry()
559 if (!ocfs2_check_dir_entry(dir, de, bh, i)) { in __ocfs2_delete_entry()
564 if (de == de_del) { in __ocfs2_delete_entry()
574 le16_to_cpu(de->rec_len)); in __ocfs2_delete_entry()
576 de->inode = 0; in __ocfs2_delete_entry()
581 i += le16_to_cpu(de->rec_len); in __ocfs2_delete_entry()
582 pde = de; in __ocfs2_delete_entry()
583 de = (struct ocfs2_dir_entry *)((char *)de + le16_to_cpu(de->rec_len)); in __ocfs2_delete_entry()
645 static inline int ocfs2_dirent_would_fit(struct ocfs2_dir_entry *de, in ocfs2_dirent_would_fit() argument
651 if (le64_to_cpu(de->inode) == 0 && in ocfs2_dirent_would_fit()
652 le16_to_cpu(de->rec_len) >= new_rec_len) in ocfs2_dirent_would_fit()
659 de_really_used = OCFS2_DIR_REC_LEN(de->name_len); in ocfs2_dirent_would_fit()
660 if (le16_to_cpu(de->rec_len) >= (de_really_used + new_rec_len)) in ocfs2_dirent_would_fit()
681 struct ocfs2_dir_entry *de, *de1; in __ocfs2_add_entry() local
702 de = (struct ocfs2_dir_entry *) data_start; in __ocfs2_add_entry()
704 BUG_ON((char *)de >= (size + data_start)); in __ocfs2_add_entry()
709 if (!ocfs2_check_dir_entry(dir, de, insert_bh, offset)) { in __ocfs2_add_entry()
713 if (ocfs2_match(namelen, name, de)) { in __ocfs2_add_entry()
720 mlog_bug_on_msg(ocfs2_skip_dir_trailer(dir, de, offset, size), in __ocfs2_add_entry()
728 if (ocfs2_dirent_would_fit(de, rec_len)) { in __ocfs2_add_entry()
745 offset += le16_to_cpu(de->rec_len); in __ocfs2_add_entry()
746 if (le64_to_cpu(de->inode)) { in __ocfs2_add_entry()
747 de1 = (struct ocfs2_dir_entry *)((char *) de + in __ocfs2_add_entry()
748 OCFS2_DIR_REC_LEN(de->name_len)); in __ocfs2_add_entry()
750 cpu_to_le16(le16_to_cpu(de->rec_len) - in __ocfs2_add_entry()
751 OCFS2_DIR_REC_LEN(de->name_len)); in __ocfs2_add_entry()
752 de->rec_len = cpu_to_le16(OCFS2_DIR_REC_LEN(de->name_len)); in __ocfs2_add_entry()
753 de = de1; in __ocfs2_add_entry()
755 de->file_type = OCFS2_FT_UNKNOWN; in __ocfs2_add_entry()
757 de->inode = cpu_to_le64(blkno); in __ocfs2_add_entry()
758 ocfs2_set_de_type(de, inode->i_mode); in __ocfs2_add_entry()
760 de->inode = 0; in __ocfs2_add_entry()
761 de->name_len = namelen; in __ocfs2_add_entry()
762 memcpy(de->name, name, namelen); in __ocfs2_add_entry()
770 offset += le16_to_cpu(de->rec_len); in __ocfs2_add_entry()
771 de = (struct ocfs2_dir_entry *) ((char *) de + le16_to_cpu(de->rec_len)); in __ocfs2_add_entry()
793 struct ocfs2_dir_entry *de; in ocfs2_dir_foreach_blk_id() local
813 de = (struct ocfs2_dir_entry *) in ocfs2_dir_foreach_blk_id()
821 if (le16_to_cpu(de->rec_len) < in ocfs2_dir_foreach_blk_id()
824 i += le16_to_cpu(de->rec_len); in ocfs2_dir_foreach_blk_id()
830 de = (struct ocfs2_dir_entry *) (data->id_data + *f_pos); in ocfs2_dir_foreach_blk_id()
831 if (!ocfs2_check_dir_entry(inode, de, di_bh, *f_pos)) { in ocfs2_dir_foreach_blk_id()
836 offset += le16_to_cpu(de->rec_len); in ocfs2_dir_foreach_blk_id()
837 if (le64_to_cpu(de->inode)) { in ocfs2_dir_foreach_blk_id()
848 if (de->file_type < OCFS2_FT_MAX) in ocfs2_dir_foreach_blk_id()
849 d_type = ocfs2_filetype_table[de->file_type]; in ocfs2_dir_foreach_blk_id()
851 filldir_ret = filldir(priv, de->name, in ocfs2_dir_foreach_blk_id()
852 de->name_len, in ocfs2_dir_foreach_blk_id()
854 le64_to_cpu(de->inode), in ocfs2_dir_foreach_blk_id()
864 *f_pos += le16_to_cpu(de->rec_len); in ocfs2_dir_foreach_blk_id()
882 struct ocfs2_dir_entry * de; in ocfs2_dir_foreach_blk_el() local
924 de = (struct ocfs2_dir_entry *) (bh->b_data + i); in ocfs2_dir_foreach_blk_el()
931 if (le16_to_cpu(de->rec_len) < in ocfs2_dir_foreach_blk_el()
934 i += le16_to_cpu(de->rec_len); in ocfs2_dir_foreach_blk_el()
944 de = (struct ocfs2_dir_entry *) (bh->b_data + offset); in ocfs2_dir_foreach_blk_el()
945 if (!ocfs2_check_dir_entry(inode, de, bh, offset)) { in ocfs2_dir_foreach_blk_el()
952 offset += le16_to_cpu(de->rec_len); in ocfs2_dir_foreach_blk_el()
953 if (le64_to_cpu(de->inode)) { in ocfs2_dir_foreach_blk_el()
964 if (de->file_type < OCFS2_FT_MAX) in ocfs2_dir_foreach_blk_el()
965 d_type = ocfs2_filetype_table[de->file_type]; in ocfs2_dir_foreach_blk_el()
966 error = filldir(priv, de->name, in ocfs2_dir_foreach_blk_el()
967 de->name_len, in ocfs2_dir_foreach_blk_el()
969 le64_to_cpu(de->inode), in ocfs2_dir_foreach_blk_el()
980 *f_pos += le16_to_cpu(de->rec_len); in ocfs2_dir_foreach_blk_el()
1217 struct ocfs2_dir_entry *de = (struct ocfs2_dir_entry *)start; in ocfs2_fill_initial_dirents() local
1219 de->inode = cpu_to_le64(OCFS2_I(inode)->ip_blkno); in ocfs2_fill_initial_dirents()
1220 de->name_len = 1; in ocfs2_fill_initial_dirents()
1221 de->rec_len = in ocfs2_fill_initial_dirents()
1222 cpu_to_le16(OCFS2_DIR_REC_LEN(de->name_len)); in ocfs2_fill_initial_dirents()
1223 strcpy(de->name, "."); in ocfs2_fill_initial_dirents()
1224 ocfs2_set_de_type(de, S_IFDIR); in ocfs2_fill_initial_dirents()
1226 de = (struct ocfs2_dir_entry *) ((char *)de + le16_to_cpu(de->rec_len)); in ocfs2_fill_initial_dirents()
1227 de->inode = cpu_to_le64(OCFS2_I(parent)->ip_blkno); in ocfs2_fill_initial_dirents()
1228 de->rec_len = cpu_to_le16(size - OCFS2_DIR_REC_LEN(1)); in ocfs2_fill_initial_dirents()
1229 de->name_len = 2; in ocfs2_fill_initial_dirents()
1230 strcpy(de->name, ".."); in ocfs2_fill_initial_dirents()
1231 ocfs2_set_de_type(de, S_IFDIR); in ocfs2_fill_initial_dirents()
1233 return de; in ocfs2_fill_initial_dirents()
1288 struct ocfs2_dir_entry *de; in ocfs2_fill_new_dir_el() local
1312 de = ocfs2_fill_initial_dirents(inode, parent, new_bh->b_data, size); in ocfs2_fill_new_dir_el()
1366 struct ocfs2_dir_entry *de; in ocfs2_expand_last_dirent() local
1379 de = (struct ocfs2_dir_entry *)de_buf; in ocfs2_expand_last_dirent()
1381 prev_de = de; in ocfs2_expand_last_dirent()
1382 de_buf += le16_to_cpu(de->rec_len); in ocfs2_expand_last_dirent()
1383 de = (struct ocfs2_dir_entry *)de_buf; in ocfs2_expand_last_dirent()
1677 struct ocfs2_dir_entry * de; in ocfs2_extend_dir() local
1782 de = (struct ocfs2_dir_entry *) new_bh->b_data; in ocfs2_extend_dir()
1783 de->inode = 0; in ocfs2_extend_dir()
1785 de->rec_len = cpu_to_le16(ocfs2_dir_trailer_blk_off(sb)); in ocfs2_extend_dir()
1788 de->rec_len = cpu_to_le16(sb->s_blocksize); in ocfs2_extend_dir()
1833 struct ocfs2_dir_entry *de, *last_de = NULL; in ocfs2_find_dir_space_id() local
1852 de = (struct ocfs2_dir_entry *)de_buf; in ocfs2_find_dir_space_id()
1854 if (!ocfs2_check_dir_entry(dir, de, di_bh, offset)) { in ocfs2_find_dir_space_id()
1858 if (ocfs2_match(namelen, name, de)) { in ocfs2_find_dir_space_id()
1867 if (ocfs2_dirent_would_fit(de, rec_len)) { in ocfs2_find_dir_space_id()
1876 last_de = de; in ocfs2_find_dir_space_id()
1877 de_buf += le16_to_cpu(de->rec_len); in ocfs2_find_dir_space_id()
1878 offset += le16_to_cpu(de->rec_len); in ocfs2_find_dir_space_id()
1902 struct ocfs2_dir_entry *de; in ocfs2_find_dir_space_el() local
1915 de = (struct ocfs2_dir_entry *) bh->b_data; in ocfs2_find_dir_space_el()
1917 if ((char *)de >= sb->s_blocksize + bh->b_data) { in ocfs2_find_dir_space_el()
1937 de = (struct ocfs2_dir_entry *) bh->b_data; in ocfs2_find_dir_space_el()
1939 if (!ocfs2_check_dir_entry(dir, de, bh, offset)) { in ocfs2_find_dir_space_el()
1943 if (ocfs2_match(namelen, name, de)) { in ocfs2_find_dir_space_el()
1948 if (ocfs2_skip_dir_trailer(dir, de, offset % blocksize, in ocfs2_find_dir_space_el()
1952 if (ocfs2_dirent_would_fit(de, rec_len)) { in ocfs2_find_dir_space_el()
1961 offset += le16_to_cpu(de->rec_len); in ocfs2_find_dir_space_el()
1962 de = (struct ocfs2_dir_entry *)((char *) de + le16_to_cpu(de->rec_len)); in ocfs2_find_dir_space_el()