Thread (28 messages) 28 messages, 2 authors, 2009-06-03

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

From: Dan Williams <hidden>
Date: 2009-05-20 18:19:56

On Wed, May 20, 2009 at 1:06 AM, Andre Noll [off-list ref] wrote:
On Mon, May 18, 2009 at 05:59:41PM -0700, Dan Williams wrote:
quoted
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.
quoted
+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 <redacted>
Thanks!

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help