eio: track length of resulting operation to be reported by futures.
authorCedric Bail <cedric@osg.samsung.com>
Mon, 1 Aug 2016 04:37:25 +0000 (21:37 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Thu, 8 Sep 2016 21:58:06 +0000 (14:58 -0700)
src/lib/eio/eio_file.c
src/lib/eio/eio_map.c
src/lib/eio/eio_private.h
src/lib/eio/eio_single.c
src/lib/eio/eio_xattr.c

index 7d3757f..a7c02b9 100644 (file)
@@ -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;
index 194b338..897519f 100644 (file)
@@ -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);
 }
 
index 6d58f9f..39c37ae 100644 (file)
@@ -168,6 +168,8 @@ struct _Eio_File
    struct {
       Eina_Hash *associated;
    } worker, main;
+
+   uint64_t length;
 };
 
 struct _Eio_Eet_Simple
index c7841b1..b2a7a49 100644 (file)
@@ -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;
index 9d6dc48..a795b95 100644 (file)
@@ -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;
      }