#ifdef MAP_HUGETLB
hugetlb = !!(flags & MAP_HUGETLB);
#endif
+ if (!file->global_refcount)
+ file->global_hugetlb = hugetlb;
+ else
+ hugetlb = file->global_hugetlb;
+
_eina_file_map_rule_apply(rule, file->global_map, file->length, hugetlb);
file->global_refcount++;
ret = file->global_map;
eina_file_map_populate(Eina_File *file, Eina_File_Populate rule, const void *map,
unsigned long int offset, unsigned long int length)
{
- Eina_File_Map *em;
-
EINA_SAFETY_ON_NULL_RETURN(file);
eina_lock_take(&file->lock);
- em = eina_hash_find(file->rmap, &map);
- if (em) _eina_file_map_rule_apply(rule, ((char *)em->map) + offset,
- length, em->hugetlb);
+ if (map == file->global_map)
+ {
+ _eina_file_map_rule_apply(rule, ((char*) map) + offset, length,
+ file->global_hugetlb);
+ }
+ else
+ {
+ Eina_File_Map *em;
+
+ em = eina_hash_find(file->rmap, &map);
+ if (em) _eina_file_map_rule_apply(rule, ((char *) em->map) + offset,
+ length, em->hugetlb);
+ }
eina_lock_release(&file->lock);
}
Eina_Bool shared : 1; /**< Indicates whether this file can be shared */
Eina_Bool delete_me : 1; /**< Indicates that this file should be deleted */
Eina_Bool global_faulty : 1; /**< Indicates whether #global_map is bad */
+ Eina_Bool global_hugetlb : 1; /**< Indicates whether #global_map uses HugeTLB */
Eina_Bool virtual : 1; /**< Indicates that this is a virtual file */
Eina_Bool copied : 1; /**< Indicates whether this file has copied data */
};