node->flags |= EXFAT_ATTRIB_CONTIGUOUS;
}
+static const struct exfat_entry* get_entry_ptr(const struct exfat* ef,
+ const struct iterator* it)
+{
+ return (const struct exfat_entry*)
+ (it->chunk + it->offset % CLUSTER_SIZE(*ef->sb));
+}
+
/*
* Reads one entry in directory at position pointed by iterator and fills
* node structure.
{
/* every directory (even empty one) occupies at least one cluster and
must contain EOD entry */
- entry = (const struct exfat_entry*)
- (it->chunk + it->offset % CLUSTER_SIZE(*ef->sb));
+ entry = get_entry_ptr(ef, it);
switch (entry->type)
{
*cluster = it.cluster;
*offset = it.offset;
}
- entry = (const struct exfat_entry*)
- (it.chunk + it.offset % CLUSTER_SIZE(*ef->sb));
+ entry = get_entry_ptr(ef, &it);
if (entry->type == EXFAT_ENTRY_EOD)
{
rc = grow_directory(ef, dir,
for (;;)
{
- entry = (const struct exfat_entry*)
- (it.chunk + it.offset % CLUSTER_SIZE(*ef->sb));
+ entry = get_entry_ptr(ef, &it);
if (entry->type == EXFAT_ENTRY_EOD)
{