RE: [PATCH 07/13] async_tx: add support for asynchronous RAID6recovery operations

From: Sosnowski, Maciej
Date: Mon Mar 30 2009 - 10:31:32 EST


Williams, Dan J wrote:
> +ddr_sync:
> + {
> + void **sptrs = (void **)lptrs;
> + /*
> + * Failed to compute asynchronously, do it in
> + * synchronous manner
> + */
> +
> + /* wait for any prerequisite operations */
> + async_tx_quiesce(&depend_tx);
> + if (flags & ASYNC_TX_DEP_ACK)
> + async_tx_ack(depend_tx);
> +
> + i = disks;
> + while (i--)
> + sptrs[i] = page_address(ptrs[i]);
> + raid6_2data_recov(disks, bytes, faila, failb, sptrs);
> +
> + async_tx_sync_epilog(cb, cb_param);
> + }
(...)
> +dpr_sync:
> + {
> + void **sptrs = (void **) lptrs;
> + /*
> + * Failed to compute asynchronously, do it in
> + * synchronous manner
> + */
> +
> + /* wait for any prerequisite operations */
> + async_tx_quiesce(&depend_tx);
> + if (flags & ASYNC_TX_DEP_ACK)
> + async_tx_ack(depend_tx);
> +
> + i = disks;
> + while (i--)
> + sptrs[i] = page_address(ptrs[i]);
> + raid6_datap_recov(disks, bytes, faila, (void *)sptrs);
> +
> + async_tx_sync_epilog(cb, cb_param);
> + }

These synchronous sections in async_r6_dd_recov() and async_r6_dp_recov()
look almost the same. What about placing the code in a common function?

Regards,
Maciej--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/