Stefan Hajnoczi 433fcea40c util/defer-call: move defer_call() to util/
The networking subsystem may wish to use defer_call(), so move the code
to util/ where it can be reused.

As a reminder of what defer_call() does:

This API defers a function call within a defer_call_begin()/defer_call_end()
section, allowing multiple calls to batch up. This is a performance
optimization that is used in the block layer to submit several I/O requests
at once instead of individually:

  defer_call_begin(); <-- start of section
  ...
  defer_call(my_func, my_obj); <-- deferred my_func(my_obj) call
  defer_call(my_func, my_obj); <-- another
  defer_call(my_func, my_obj); <-- another
  ...
  defer_call_end(); <-- end of section, my_func(my_obj) is called once

Suggested-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230913200045.1024233-3-stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-10-31 15:41:42 +01:00
..
2023-03-20 12:43:50 +01:00
2023-05-02 12:36:46 -07:00
2023-10-17 15:20:53 +02:00
2023-09-15 13:57:00 +00:00
2023-05-23 15:20:15 +08:00
2020-12-10 12:15:18 -05:00
2023-02-10 14:12:06 +01:00
2016-06-07 18:19:23 +03:00
2017-10-16 20:57:13 +03:00
2020-10-15 16:06:27 +02:00
2023-05-30 15:50:17 +01:00
2023-09-06 11:19:33 +02:00
2022-12-20 17:09:41 -08:00
2023-08-31 19:47:43 +02:00
2022-10-07 12:11:41 +02:00
2023-06-13 17:42:01 +10:00
2019-09-11 08:46:17 +02:00
2023-04-24 11:29:00 +02:00
2020-12-10 17:16:44 +01:00
2022-04-21 17:03:51 +04:00
2018-09-26 08:55:54 -07:00
2019-04-18 22:18:59 +02:00
2023-03-28 15:23:10 -07:00
2023-04-27 16:39:43 +02:00
2016-02-23 12:43:05 +00:00
2018-08-24 20:26:37 +02:00
2023-02-08 07:27:20 +01:00
2023-10-04 18:15:06 -04:00
2023-08-31 19:47:43 +02:00