From d26a0a2f70a77457f9faf35d945a2947f5f5cdba Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Sun, 31 Jul 2016 21:37:25 -0700 Subject: [PATCH] eio: track length of resulting operation to be reported by futures. --- src/lib/eio/eio_file.c | 4 ++++ src/lib/eio/eio_map.c | 1 + src/lib/eio/eio_private.h | 2 ++ src/lib/eio/eio_single.c | 2 ++ src/lib/eio/eio_xattr.c | 4 ++++ 5 files changed, 13 insertions(+) diff --git a/src/lib/eio/eio_file.c b/src/lib/eio/eio_file.c index 7d3757f957..a7c02b9a40 100644 --- a/src/lib/eio/eio_file.c +++ b/src/lib/eio/eio_file.c @@ -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; diff --git a/src/lib/eio/eio_map.c b/src/lib/eio/eio_map.c index 194b338516..897519f966 100644 --- a/src/lib/eio/eio_map.c +++ b/src/lib/eio/eio_map.c @@ -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); } diff --git a/src/lib/eio/eio_private.h b/src/lib/eio/eio_private.h index 6d58f9f6f5..39c37ae20b 100644 --- a/src/lib/eio/eio_private.h +++ b/src/lib/eio/eio_private.h @@ -168,6 +168,8 @@ struct _Eio_File struct { Eina_Hash *associated; } worker, main; + + uint64_t length; }; struct _Eio_Eet_Simple diff --git a/src/lib/eio/eio_single.c b/src/lib/eio/eio_single.c index c7841b1a96..b2a7a4992d 100644 --- a/src/lib/eio/eio_single.c +++ b/src/lib/eio/eio_single.c @@ -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; diff --git a/src/lib/eio/eio_xattr.c b/src/lib/eio/eio_xattr.c index 9d6dc481a4..a795b9535f 100644 --- a/src/lib/eio/eio_xattr.c +++ b/src/lib/eio/eio_xattr.c @@ -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; }