summaryrefslogtreecommitdiff
path: root/src/lib/eio
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2016-07-31 21:37:25 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-09-08 14:58:06 -0700
commitd26a0a2f70a77457f9faf35d945a2947f5f5cdba (patch)
tree5b44e2fb50ca7a0a2faeb1f268ed71324b4d7bed /src/lib/eio
parentd8310b71802ab64e145092178c545119e6e80b23 (diff)
eio: track length of resulting operation to be reported by futures.
Diffstat (limited to 'src/lib/eio')
-rw-r--r--src/lib/eio/eio_file.c4
-rw-r--r--src/lib/eio/eio_map.c1
-rw-r--r--src/lib/eio/eio_private.h2
-rw-r--r--src/lib/eio/eio_single.c2
-rw-r--r--src/lib/eio/eio_xattr.c4
5 files changed, 13 insertions, 0 deletions
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)
102 Eina_List *pack = msg_data; 102 Eina_List *pack = msg_data;
103 Eio_File_Char *info; 103 Eio_File_Char *info;
104 104
105 async->ls.common.length += eina_list_count(pack);
106
105 EINA_LIST_FREE(pack, info) 107 EINA_LIST_FREE(pack, info)
106 { 108 {
107 async->ls.common.main.associated = info->associated; 109 async->ls.common.main.associated = info->associated;
@@ -206,6 +208,8 @@ _eio_file_direct_notify(void *data, Ecore_Thread *thread EINA_UNUSED, void *msg_
206 Eina_List *pack = msg_data; 208 Eina_List *pack = msg_data;
207 Eio_File_Direct_Info *info; 209 Eio_File_Direct_Info *info;
208 210
211 async->ls.common.length += eina_list_count(pack);
212
209 EINA_LIST_FREE(pack, info) 213 EINA_LIST_FREE(pack, info)
210 { 214 {
211 async->ls.common.main.associated = info->associated; 215 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)
70{ 70{
71 Eio_File_Map *map = data; 71 Eio_File_Map *map = data;
72 72
73 map->common.length = eina_file_size_get(map->result);
73 eina_file_close(map->result); 74 eina_file_close(map->result);
74} 75}
75 76
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
168 struct { 168 struct {
169 Eina_Hash *associated; 169 Eina_Hash *associated;
170 } worker, main; 170 } worker, main;
171
172 uint64_t length;
171}; 173};
172 174
173struct _Eio_Eet_Simple 175struct _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,
347 common->error_cb = error_cb; 347 common->error_cb = error_cb;
348 common->data = data; 348 common->data = data;
349 common->error = 0; 349 common->error = 0;
350 common->length = 0;
350 common->thread = NULL; 351 common->thread = NULL;
351 common->container = NULL; 352 common->container = NULL;
352 common->worker.associated = NULL; 353 common->worker.associated = NULL;
@@ -384,6 +385,7 @@ eio_file_set(Eio_File *common,
384 common->error_cb = error_cb; 385 common->error_cb = error_cb;
385 common->data = data; 386 common->data = data;
386 common->error = 0; 387 common->error = 0;
388 common->length = 0;
387 common->thread = NULL; 389 common->thread = NULL;
388 common->container = NULL; 390 common->container = NULL;
389 common->worker.associated = NULL; 391 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)
170 { 170 {
171 case EIO_XATTR_DATA: 171 case EIO_XATTR_DATA:
172 failure = !eina_xattr_set(file, attribute, async->todo.xdata.xattr_data, async->todo.xdata.xattr_size, flags); 172 failure = !eina_xattr_set(file, attribute, async->todo.xdata.xattr_data, async->todo.xdata.xattr_size, flags);
173 async->common.length = async->todo.xdata.xattr_size;
173 break; 174 break;
174 case EIO_XATTR_STRING: 175 case EIO_XATTR_STRING:
175 failure = !eina_xattr_string_set(file, attribute, async->todo.xstring.xattr_string, flags); 176 failure = !eina_xattr_string_set(file, attribute, async->todo.xstring.xattr_string, flags);
177 async->common.length = strlen(async->todo.xstring.xattr_string) + 1;
176 break; 178 break;
177 case EIO_XATTR_DOUBLE: 179 case EIO_XATTR_DOUBLE:
178 failure = !eina_xattr_double_set(file, attribute, async->todo.xdouble.xattr_double, flags); 180 failure = !eina_xattr_double_set(file, attribute, async->todo.xdouble.xattr_double, flags);
181 async->common.length = sizeof (double);
179 break; 182 break;
180 case EIO_XATTR_INT: 183 case EIO_XATTR_INT:
181 failure = !eina_xattr_int_set(file, attribute, async->todo.xint.xattr_int, flags); 184 failure = !eina_xattr_int_set(file, attribute, async->todo.xint.xattr_int, flags);
185 async->common.length = sizeof (int);
182 break; 186 break;
183 } 187 }
184 188