Lines Matching full:de
29 static int bin_search_in_dir_item(struct reiserfs_dir_entry *de, loff_t off) in bin_search_in_dir_item() argument
31 struct item_head *ih = de->de_ih; in bin_search_in_dir_item()
32 struct reiserfs_de_head *deh = de->de_deh; in bin_search_in_dir_item()
49 de->de_entry_num = j; in bin_search_in_dir_item()
53 de->de_entry_num = lbound; in bin_search_in_dir_item()
58 * comment? maybe something like set de to point to what the path points to?
60 static inline void set_de_item_location(struct reiserfs_dir_entry *de, in set_de_item_location() argument
63 de->de_bh = get_last_bh(path); in set_de_item_location()
64 de->de_ih = tp_item_head(path); in set_de_item_location()
65 de->de_deh = B_I_DEH(de->de_bh, de->de_ih); in set_de_item_location()
66 de->de_item_num = PATH_LAST_POSITION(path); in set_de_item_location()
72 inline void set_de_name_and_namelen(struct reiserfs_dir_entry *de) in set_de_name_and_namelen() argument
74 struct reiserfs_de_head *deh = de->de_deh + de->de_entry_num; in set_de_name_and_namelen()
76 BUG_ON(de->de_entry_num >= ih_entry_count(de->de_ih)); in set_de_name_and_namelen()
78 de->de_entrylen = entry_length(de->de_bh, de->de_ih, de->de_entry_num); in set_de_name_and_namelen()
79 de->de_namelen = de->de_entrylen - (de_with_sd(deh) ? SD_SIZE : 0); in set_de_name_and_namelen()
80 de->de_name = ih_item_body(de->de_bh, de->de_ih) + deh_location(deh); in set_de_name_and_namelen()
81 if (de->de_name[de->de_namelen - 1] == 0) in set_de_name_and_namelen()
82 de->de_namelen = strlen(de->de_name); in set_de_name_and_namelen()
86 static inline void set_de_object_key(struct reiserfs_dir_entry *de) in set_de_object_key() argument
88 BUG_ON(de->de_entry_num >= ih_entry_count(de->de_ih)); in set_de_object_key()
89 de->de_dir_id = deh_dir_id(&de->de_deh[de->de_entry_num]); in set_de_object_key()
90 de->de_objectid = deh_objectid(&de->de_deh[de->de_entry_num]); in set_de_object_key()
93 static inline void store_de_entry_key(struct reiserfs_dir_entry *de) in store_de_entry_key() argument
95 struct reiserfs_de_head *deh = de->de_deh + de->de_entry_num; in store_de_entry_key()
97 BUG_ON(de->de_entry_num >= ih_entry_count(de->de_ih)); in store_de_entry_key()
100 de->de_entry_key.version = KEY_FORMAT_3_5; in store_de_entry_key()
101 de->de_entry_key.on_disk_key.k_dir_id = in store_de_entry_key()
102 le32_to_cpu(de->de_ih->ih_key.k_dir_id); in store_de_entry_key()
103 de->de_entry_key.on_disk_key.k_objectid = in store_de_entry_key()
104 le32_to_cpu(de->de_ih->ih_key.k_objectid); in store_de_entry_key()
105 set_cpu_key_k_offset(&de->de_entry_key, deh_offset(deh)); in store_de_entry_key()
106 set_cpu_key_k_type(&de->de_entry_key, TYPE_DIRENTRY); in store_de_entry_key()
121 struct treepath *path, struct reiserfs_dir_entry *de) in search_by_entry_key() argument
148 set_de_item_location(de, path); in search_by_entry_key()
151 if (!is_direntry_le_ih(de->de_ih) || in search_by_entry_key()
152 COMP_SHORT_KEYS(&de->de_ih->ih_key, key)) { in search_by_entry_key()
153 print_block(de->de_bh, 0, -1, -1); in search_by_entry_key()
156 "as key %K", de->de_ih, key); in search_by_entry_key()
162 * key. sets de->de_entry_num of de in search_by_entry_key()
164 retval = bin_search_in_dir_item(de, cpu_key_k_offset(key)); in search_by_entry_key()
165 path->pos_in_item = de->de_entry_num; in search_by_entry_key()
171 set_de_name_and_namelen(de); in search_by_entry_key()
172 set_de_object_key(de); in search_by_entry_key()
208 static int reiserfs_match(struct reiserfs_dir_entry *de, in reiserfs_match() argument
213 if ((namelen == de->de_namelen) && in reiserfs_match()
214 !memcmp(de->de_name, name, de->de_namelen)) in reiserfs_match()
216 (de_visible(de->de_deh + de->de_entry_num) ? NAME_FOUND : in reiserfs_match()
222 /* de's de_bh, de_ih, de_deh, de_item_num, de_entry_num are set already */
227 struct reiserfs_dir_entry *de, in linear_search_in_dir_item() argument
230 struct reiserfs_de_head *deh = de->de_deh; in linear_search_in_dir_item()
234 i = de->de_entry_num; in linear_search_in_dir_item()
236 if (i == ih_entry_count(de->de_ih) || in linear_search_in_dir_item()
242 RFALSE(de->de_deh != B_I_DEH(de->de_bh, de->de_ih), in linear_search_in_dir_item()
255 if (de->de_gen_number_bit_string) in linear_search_in_dir_item()
257 de->de_gen_number_bit_string); in linear_search_in_dir_item()
260 de->de_entry_num = i; in linear_search_in_dir_item()
261 set_de_name_and_namelen(de); in linear_search_in_dir_item()
264 * de's de_name, de_namelen, de_recordlen are set. in linear_search_in_dir_item()
268 reiserfs_match(de, name, namelen)) != NAME_NOT_FOUND) { in linear_search_in_dir_item()
271 set_de_object_key(de); in linear_search_in_dir_item()
273 store_de_entry_key(de); in linear_search_in_dir_item()
280 if (GET_GENERATION_NUMBER(le_ih_k_offset(de->de_ih)) == 0) in linear_search_in_dir_item()
294 RFALSE(de->de_item_num, in linear_search_in_dir_item()
306 struct reiserfs_dir_entry *de) in reiserfs_find_entry() argument
322 path_to_entry, de); in reiserfs_find_entry()
330 linear_search_in_dir_item(&key_to_search, de, name, in reiserfs_find_entry()
337 path_to_entry->pos_in_item = de->de_entry_num; in reiserfs_find_entry()
346 le_ih_k_offset(de->de_ih) - 1); in reiserfs_find_entry()
357 struct reiserfs_dir_entry de; in reiserfs_lookup() local
365 de.de_gen_number_bit_string = NULL; in reiserfs_lookup()
368 &path_to_entry, &de); in reiserfs_lookup()
372 (struct cpu_key *)&de.de_dir_id); in reiserfs_lookup()
404 struct reiserfs_dir_entry de; in reiserfs_get_parent() local
411 de.de_gen_number_bit_string = NULL; in reiserfs_get_parent()
414 retval = reiserfs_find_entry(dir, "..", 2, &path_to_entry, &de); in reiserfs_get_parent()
420 inode = reiserfs_iget(dir->i_sb, (struct cpu_key *)&de.de_dir_id); in reiserfs_get_parent()
439 struct reiserfs_dir_entry de; in reiserfs_add_entry() local
488 /* put key (ino analog) to de */ in reiserfs_add_entry()
509 de.de_gen_number_bit_string = bit_string; in reiserfs_add_entry()
510 retval = reiserfs_find_entry(dir, name, namelen, &path, &de); in reiserfs_add_entry()
551 if (search_by_entry_key(dir->i_sb, &entry_key, &path, &de) != in reiserfs_add_entry()
904 struct reiserfs_dir_entry de; in reiserfs_rmdir() local
925 de.de_gen_number_bit_string = NULL; in reiserfs_rmdir()
928 &path, &de)) == NAME_NOT_FOUND) { in reiserfs_rmdir()
941 if (de.de_objectid != inode->i_ino) { in reiserfs_rmdir()
954 retval = reiserfs_cut_from_item(&th, &path, &de.de_entry_key, in reiserfs_rmdir()
970 dir->i_size -= (DEH_SIZE + de.de_entrylen); in reiserfs_rmdir()
998 struct reiserfs_dir_entry de; in reiserfs_unlink() local
1026 de.de_gen_number_bit_string = NULL; in reiserfs_unlink()
1029 &path, &de)) == NAME_NOT_FOUND) { in reiserfs_unlink()
1040 if (de.de_objectid != inode->i_ino) { in reiserfs_unlink()
1064 reiserfs_cut_from_item(&th, &path, &de.de_entry_key, dir, NULL, in reiserfs_unlink()
1073 dir->i_size -= (de.de_entrylen + DEH_SIZE); in reiserfs_unlink()
1258 /* de contains information pointing to an entry which */
1260 struct reiserfs_dir_entry *de) in de_still_valid() argument
1262 struct reiserfs_dir_entry tmp = *de; in de_still_valid()
1267 if (tmp.de_namelen != len || memcmp(name, de->de_name, len)) in de_still_valid()
1273 struct reiserfs_dir_entry *de, in entry_points_to_object() argument
1276 if (!de_still_valid(name, len, de)) in entry_points_to_object()
1280 if (!de_visible(de->de_deh + de->de_entry_num)) in entry_points_to_object()
1283 return (de->de_objectid == inode->i_ino) ? 1 : 0; in entry_points_to_object()
1287 if (de_visible(de->de_deh + de->de_entry_num)) in entry_points_to_object()
1294 static void set_ino_in_dir_entry(struct reiserfs_dir_entry *de, in set_ino_in_dir_entry() argument
1298 de->de_deh[de->de_entry_num].deh_dir_id = key->k_dir_id; in set_ino_in_dir_entry()
1299 de->de_deh[de->de_entry_num].deh_objectid = key->k_objectid; in set_ino_in_dir_entry()