Skip to content

Commit

Permalink
async_tx: remove depend_tx from async_tx_sync_epilog
Browse files Browse the repository at this point in the history
All callers of async_tx_sync_epilog have called async_tx_quiesce on the
depend_tx, so async_tx_sync_epilog need only call the callback to
complete the operation.

Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
djbw committed Jul 18, 2008
1 parent d2c52b7 commit 3dce017
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crypto/async_tx/async_memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
kunmap_atomic(dest_buf, KM_USER0);
kunmap_atomic(src_buf, KM_USER1);

async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param);
async_tx_sync_epilog(cb_fn, cb_param);
}

return tx;
Expand Down
2 changes: 1 addition & 1 deletion crypto/async_tx/async_memset.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async_memset(struct page *dest, int val, unsigned int offset,

memset(dest_buf, val, len);

async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param);
async_tx_sync_epilog(cb_fn, cb_param);
}

return tx;
Expand Down
2 changes: 1 addition & 1 deletion crypto/async_tx/async_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ async_trigger_callback(enum async_tx_flags flags,
/* wait for any prerequisite operations */
async_tx_quiesce(&depend_tx);

async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param);
async_tx_sync_epilog(cb_fn, cb_param);
}

return tx;
Expand Down
7 changes: 3 additions & 4 deletions crypto/async_tx/async_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ do_async_xor(struct dma_chan *chan, struct page *dest, struct page **src_list,
static void
do_sync_xor(struct page *dest, struct page **src_list, unsigned int offset,
int src_cnt, size_t len, enum async_tx_flags flags,
struct dma_async_tx_descriptor *depend_tx,
dma_async_tx_callback cb_fn, void *cb_param)
{
int i;
Expand Down Expand Up @@ -150,7 +149,7 @@ do_sync_xor(struct page *dest, struct page **src_list, unsigned int offset,
src_off += xor_src_cnt;
}

async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param);
async_tx_sync_epilog(cb_fn, cb_param);
}

/**
Expand Down Expand Up @@ -204,7 +203,7 @@ async_xor(struct page *dest, struct page **src_list, unsigned int offset,
async_tx_quiesce(&depend_tx);

do_sync_xor(dest, src_list, offset, src_cnt, len,
flags, depend_tx, cb_fn, cb_param);
flags, cb_fn, cb_param);

return NULL;
}
Expand Down Expand Up @@ -287,7 +286,7 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,

*result = page_is_zero(dest, offset, len) ? 0 : 1;

async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param);
async_tx_sync_epilog(cb_fn, cb_param);
}

return tx;
Expand Down
9 changes: 1 addition & 8 deletions include/linux/async_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,14 @@ async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,

/**
* async_tx_sync_epilog - actions to take if an operation is run synchronously
* @flags: async_tx flags
* @depend_tx: transaction depends on depend_tx
* @cb_fn: function to call when the transaction completes
* @cb_fn_param: parameter to pass to the callback routine
*/
static inline void
async_tx_sync_epilog(unsigned long flags,
struct dma_async_tx_descriptor *depend_tx,
dma_async_tx_callback cb_fn, void *cb_fn_param)
async_tx_sync_epilog(dma_async_tx_callback cb_fn, void *cb_fn_param)
{
if (cb_fn)
cb_fn(cb_fn_param);

if (depend_tx && (flags & ASYNC_TX_DEP_ACK))
async_tx_ack(depend_tx);
}

void
Expand Down

0 comments on commit 3dce017

Please sign in to comment.