forked from enlightenment/efl
eio: track length of resulting operation to be reported by futures.
This commit is contained in:
parent
d8310b7180
commit
d26a0a2f70
|
@ -102,6 +102,8 @@ _eio_file_notify(void *data, Ecore_Thread *thread EINA_UNUSED, void *msg_data)
|
|||
Eina_List *pack = msg_data;
|
||||
Eio_File_Char *info;
|
||||
|
||||
async->ls.common.length += eina_list_count(pack);
|
||||
|
||||
EINA_LIST_FREE(pack, info)
|
||||
{
|
||||
async->ls.common.main.associated = info->associated;
|
||||
|
@ -206,6 +208,8 @@ _eio_file_direct_notify(void *data, Ecore_Thread *thread EINA_UNUSED, void *msg_
|
|||
Eina_List *pack = msg_data;
|
||||
Eio_File_Direct_Info *info;
|
||||
|
||||
async->ls.common.length += eina_list_count(pack);
|
||||
|
||||
EINA_LIST_FREE(pack, info)
|
||||
{
|
||||
async->ls.common.main.associated = info->associated;
|
||||
|
|
|
@ -70,6 +70,7 @@ _eio_file_close_job(void *data, Ecore_Thread *thread EINA_UNUSED)
|
|||
{
|
||||
Eio_File_Map *map = data;
|
||||
|
||||
map->common.length = eina_file_size_get(map->result);
|
||||
eina_file_close(map->result);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,6 +168,8 @@ struct _Eio_File
|
|||
struct {
|
||||
Eina_Hash *associated;
|
||||
} worker, main;
|
||||
|
||||
uint64_t length;
|
||||
};
|
||||
|
||||
struct _Eio_Eet_Simple
|
||||
|
|
|
@ -347,6 +347,7 @@ eio_long_file_set(Eio_File *common,
|
|||
common->error_cb = error_cb;
|
||||
common->data = data;
|
||||
common->error = 0;
|
||||
common->length = 0;
|
||||
common->thread = NULL;
|
||||
common->container = NULL;
|
||||
common->worker.associated = NULL;
|
||||
|
@ -384,6 +385,7 @@ eio_file_set(Eio_File *common,
|
|||
common->error_cb = error_cb;
|
||||
common->data = data;
|
||||
common->error = 0;
|
||||
common->length = 0;
|
||||
common->thread = NULL;
|
||||
common->container = NULL;
|
||||
common->worker.associated = NULL;
|
||||
|
|
|
@ -170,15 +170,19 @@ _eio_file_xattr_set(void *data, Ecore_Thread *thread)
|
|||
{
|
||||
case EIO_XATTR_DATA:
|
||||
failure = !eina_xattr_set(file, attribute, async->todo.xdata.xattr_data, async->todo.xdata.xattr_size, flags);
|
||||
async->common.length = async->todo.xdata.xattr_size;
|
||||
break;
|
||||
case EIO_XATTR_STRING:
|
||||
failure = !eina_xattr_string_set(file, attribute, async->todo.xstring.xattr_string, flags);
|
||||
async->common.length = strlen(async->todo.xstring.xattr_string) + 1;
|
||||
break;
|
||||
case EIO_XATTR_DOUBLE:
|
||||
failure = !eina_xattr_double_set(file, attribute, async->todo.xdouble.xattr_double, flags);
|
||||
async->common.length = sizeof (double);
|
||||
break;
|
||||
case EIO_XATTR_INT:
|
||||
failure = !eina_xattr_int_set(file, attribute, async->todo.xint.xattr_int, flags);
|
||||
async->common.length = sizeof (int);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue