blk_rq_prep_clone - Helper function to setup clone request
2. SYNOPSIS ▲
int blk_rq_prep_clone(struct request * rq , struct request * rq_src , struct bio_set * bs , gfp_t gfp_mask , int (* bio_ctr ) (struct bio *, struct bio *, void *), void * data );
3. ARGUMENTS ▲
the request to be setup
original request to be cloned
bio_set that bios for clone are allocated from
memory allocation mask for bio
setup function to be called for each clone bio. Returns 0 for success, non 0 for failure.
private data to be passed to bio_ctr
4. DESCRIPTION ▲
Clones bios in rq_src to rq, and copies attributes of rq_src to rq. The actual data parts of rq_src (e.g. ->cmd, ->buffer, ->sense) are not copied, and copying such parts is the callerAqs responsibility. Also, pages which the original bios are pointing to are not copied and the cloned bios just point same pages. So cloned bios must be completed before original bios, which means the caller must complete rq before rq_src.
5. COPYRIGHT ▲