lkml.org 
[lkml]   [2009]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRE: [PATCH 07/13] async_tx: add support for asynchronous RAID6 recovery operations
    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

    \
     
     \ /
      Last update: 2009-03-30 16:35    [W:4.176 / U:0.460 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site