Re: [PATCH v2 03/11] async_tx: structify submission arguments, add scribble

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 20, 2009 at 1:06 AM, Andre Noll <maan@xxxxxxxxxxxxxxx> wrote:
> On Mon, May 18, 2009 at 05:59:41PM -0700, Dan Williams wrote:
>
>> diff --git a/crypto/async_tx/async_memcpy.c b/crypto/async_tx/async_memcpy.c
>> index 7117ec6..c9342ae 100644
>> --- a/crypto/async_tx/async_memcpy.c
>> +++ b/crypto/async_tx/async_memcpy.c
>> @@ -35,26 +35,23 @@
>>   * @src: src page
>>   * @offset: offset in pages to start transaction
>>   * @len: length in bytes
>> - * @flags: ASYNC_TX_ACK
>> - * @depend_tx: memcpy depends on the result of this transaction
>> - * @cb_fn: function to call when the memcpy completes
>> - * @cb_param: parameter to pass to the callback routine
>> + * @submit: submission / completion modifiers
>>   */
>>  struct dma_async_tx_descriptor *
>>  async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
>> -     unsigned int src_offset, size_t len, enum async_tx_flags flags,
>> -     struct dma_async_tx_descriptor *depend_tx,
>> -     dma_async_tx_callback cb_fn, void *cb_param)
>> +          unsigned int src_offset, size_t len,
>> +          struct async_submit_ctl *submit)
>>  {
>
> The third parameter is called "dest_offset", but the comment refers to
> "@offset".

...and I was missing a comment for src_offset.  fixed.

>
>> +struct async_submit_ctl {
>> +     enum async_tx_flags flags;
>> +     struct dma_async_tx_descriptor *depend_tx;
>> +     dma_async_tx_callback cb_fn;
>> +     void *cb_param;
>> +     void *scribble;
>> +};
>
> Can't scribble be of type addr_conv_t *?

It could, but that would require casting it when it is used.  I really
only added the addr_conv_t type to get a compiler warning if someone
inadvertently swaps the cb_param and scribble arguments to
init_async_submit().  There is no benefit for type safety once we go
to use it, and this will allow me to drop that unnecessary cast from
void * that you identified in [PATCH 04/11].

> Apart from these two minor issues the patch looks really nice. Thanks
> for taking the time to combine the common submission parameters to
> the new structure. This improves readability of the code and makes
> adaptation to future needs easier.
>
> Signed-off-by: Andre Noll <maan@xxxxxxxxxxxxxxx>

Thanks!

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux