Displaying 2 results from an estimated 2 matches for "nbd_completion".
2019 Aug 14
1
Re: [PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
On 8/14/19 4:21 AM, Richard W.M. Jones wrote:
>>> The nbd_aio_pread function can now be called using:
>>>
>>> nbd_aio_pread (nbd, buf, sizeof buf, offset,
>>> (nbd_completion_callback) { .callback = my_fn,
>>> .user_data = my_data },
>>
>> Is it worth arranging the C struct to match the typical argument
>> ordering of user_data last? It doesn't make any real difference (the
>> struct size...
2019 Aug 14
2
Re: [PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...k is changed so that
> the callback and user_data are combined into a single structure, eg:
>
> int64_t nbd_aio_pread (struct nbd_handle *h,
> void *buf, size_t count, uint64_t offset,
> - int (*completion_callback) (/*..*/), void *user_data,
> + nbd_completion_callback completion_callback,
> uint32_t flags);
>
> Several nbd_*_callback structures are defined. The one corresponding
> to the example above is:
>
> typedef struct {
> void *user_data;
> int (*callback) (unsigned valid_flag, void *user_data, int...