MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / dx_make_map

Function dx_make_map

Ext4Fsd/ext3/htree.c:1305–1327  ·  view source on GitHub ↗

* Create map of hash values, offsets, and sizes, stored at end of block. * Returns number of entries mapped. */

Source from the content-addressed store, hash-verified

1303 * Returns number of entries mapped.
1304 */
1305static int dx_make_map (struct ext3_dir_entry_2 *de, int size,
1306 struct dx_hash_info *hinfo, struct dx_map_entry *map_tail)
1307{
1308 int count = 0;
1309 char *base = (char *) de;
1310 struct dx_hash_info h = *hinfo;
1311
1312 while ((char *) de < base + size)
1313 {
1314 if (de->name_len && de->inode) {
1315 ext3_dirhash(de->name, de->name_len, &h);
1316 map_tail--;
1317 map_tail->hash = h.hash;
1318 map_tail->offs = (u16) ((char *) de - base);
1319 map_tail->size = le16_to_cpu(de->rec_len);
1320 count++;
1321 cond_resched();
1322 }
1323 /* XXX: do we need to check rec_len == 0 case? -Chris */
1324 de = (struct ext3_dir_entry_2 *) ((char *) de + le16_to_cpu(de->rec_len));
1325 }
1326 return count;
1327}
1328
1329/* Sort map by hash value */
1330static void dx_sort_map (struct dx_map_entry *map, unsigned count)

Callers 1

do_splitFunction · 0.85

Calls 2

ext3_dirhashFunction · 0.85
cond_reschedFunction · 0.85

Tested by

no test coverage detected