1BLK_RQ_PREP_CLONE(9) Block Devices BLK_RQ_PREP_CLONE(9)
2
3
4
6 blk_rq_prep_clone - Helper function to setup clone request
7
9 int blk_rq_prep_clone(struct request * rq, struct request * rq_src,
10 struct bio_set * bs, gfp_t gfp_mask,
11 int (*bio_ctr) (struct bio *, struct bio *, void *),
12 void * data);
13
15 rq
16 the request to be setup
17
18 rq_src
19 original request to be cloned
20
21 bs
22 bio_set that bios for clone are allocated from
23
24 gfp_mask
25 memory allocation mask for bio
26
27 bio_ctr
28 setup function to be called for each clone bio. Returns 0 for
29 success, non 0 for failure.
30
31 data
32 private data to be passed to bio_ctr
33
35 Clones bios in rq_src to rq, and copies attributes of rq_src to rq. The
36 actual data parts of rq_src (e.g. ->cmd, ->buffer, ->sense) are not
37 copied, and copying such parts is the callerĀ“s responsibility. Also,
38 pages which the original bios are pointing to are not copied and the
39 cloned bios just point same pages. So cloned bios must be completed
40 before original bios, which means the caller must complete rq before
41 rq_src.
42
44Kernel Hackers Manual 2.6. June 2019 BLK_RQ_PREP_CLONE(9)