_Eina_File Struct Reference

This is the underlying data structure that represents a file in Eina. More...

#include <eina_file_common.h>

Data Fields

 EINA_MAGIC
 Indicates whether Eina Magic should be used.
const char * filename
 The absolute path of the file.
Eina_Hash * map
 Tracks portions of a file that have been mapped with mmap(2).
Eina_Hash * rmap
 Similar function to map, but used to look up mapped areas by pointer rather than offset/length.
void * global_map
 A pointer to the entire contents of the file that have been mapped with mmap(2).
Eina_Lock lock
 A file locking mechanism.
unsigned long long length
 The length of the file in bytes.
time_t mtime
 The last modified time.
ino_t inode
 The inode.
dev_t dev
 The fs device.
int refcount
 Keeps track of references to map.
int global_refcount
 Keeps track of references to global_map.
Eina_Statgen statgen
 For inexact stats a stat gen count to rate limit syscalls to stat file.
int fd
 The file descriptor.
Eina_List * dead_map
 Tracks regions that get a failure from mmap(2).
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.
virtual Eina_Bool: 1
 Indicates that this is a virtual file.
Eina_Bool copied: 1
 Indicates whether this file has copied data.

Detailed Description

This is the underlying data structure that represents a file in Eina.

Field Documentation

◆ filename

const char* _Eina_File::filename

The absolute path of the file.

Note that the path given when calling eina_file_open will be run through eina_file_path_sanitize before it is stored here.

Referenced by eina_file_clean_close(), eina_file_close(), eina_file_dup(), eina_file_filename_get(), eina_file_open(), eina_file_refresh(), and eina_file_virtualize().

◆ map

Eina_Hash* _Eina_File::map

Tracks portions of a file that have been mapped with mmap(2).

The key is a tuple offset/length and the data is a pointer to the mapped region.

Referenced by eina_file_clean_close(), eina_file_common_map_free(), eina_file_flush(), eina_file_map_new(), eina_file_virtual_map_free(), eina_file_virtual_map_new(), and eina_file_virtualize().

◆ rmap

Eina_Hash* _Eina_File::rmap

◆ global_map

void* _Eina_File::global_map

A pointer to the entire contents of the file that have been mapped with mmap(2).

This is the common case, and EFL and is optimized for it.

Referenced by eina_file_dup(), eina_file_flush(), eina_file_map_all(), eina_file_map_faulted(), eina_file_map_free(), eina_file_map_populate(), eina_file_virtual_map_all(), eina_file_virtual_map_free(), eina_file_virtual_map_new(), and eina_file_virtualize().

◆ lock

◆ length

◆ mtime

time_t _Eina_File::mtime

◆ inode

ino_t _Eina_File::inode

The inode.

Referenced by eina_file_refresh().

◆ dev

dev_t _Eina_File::dev

The fs device.

Referenced by eina_file_refresh().

◆ refcount

int _Eina_File::refcount

◆ global_refcount

int _Eina_File::global_refcount

◆ statgen

Eina_Statgen _Eina_File::statgen

For inexact stats a stat gen count to rate limit syscalls to stat file.

Referenced by eina_file_open().

◆ fd

◆ dead_map

Eina_List* _Eina_File::dead_map

Tracks regions that get a failure from mmap(2).

Referenced by eina_file_common_map_free(), eina_file_flush(), and eina_file_map_faulted().

◆ delete_me

Eina_Bool _Eina_File::delete_me

Indicates that this file should be deleted.

Referenced by eina_file_open().

◆ global_faulty

Eina_Bool _Eina_File::global_faulty

Indicates whether global_map is bad.

Referenced by eina_file_map_faulted().

◆ global_hugetlb

Eina_Bool _Eina_File::global_hugetlb

Indicates whether global_map uses HugeTLB.

Referenced by eina_file_map_all(), and eina_file_map_populate().

◆ copied

Eina_Bool _Eina_File::copied

Indicates whether this file has copied data.

Referenced by eina_file_dup(), and eina_file_virtualize().