Function report |
Source Code:block\bio.c |
Create Date:2022-07-28 16:55:53 |
Last Modify:2020-03-17 23:13:58 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:_copy_user_iov - copy user data to bio*@q: destination block queue*@map_data: pointer to the rq_map_data holding pages (if necessary)*@iter: iovec iterator*@gfp_mask: memory allocation flags* Prepares and returns a bio for indirect user io, bouncing data
Proto:struct bio *bio_copy_user_iov(struct request_queue *q, struct rq_map_data *map_data, struct iov_iter *iter, gfp_t gfp_mask)
Type:struct bio
Parameter:
Type | Parameter | Name |
---|---|---|
struct request_queue * | q | |
struct rq_map_data * | map_data | |
struct iov_iter * | iter | |
gfp_t | gfp_mask |
1281 | i = 0 |
1284 | offset = If map_data Then offset_in_page(offset) Else 0 |
1286 | bmd = bio_alloc_map_data(iter, gfp_mask) |
1295 | is_our_pages = If map_data Then 0 Else 1 |
1297 | nr_pages = DIV_ROUND_UP(offset + len, PAGE_SIZE) |
1298 | If nr_pages > BIO_MAX_PAGES Then nr_pages = BIO_MAX_PAGES |
1302 | bio = bio_kmalloc(gfp_mask, nr_pages) |
1306 | ret = 0 |
1308 | If map_data Then |
1309 | nr_pages = 1 << page_order |
1320 | If map_data Then |
1321 | If i == nr_entries * nr_pages Then |
1329 | i++ |
1330 | Else |
1332 | If Not page Then |
1339 | If Not map_data Then __free_page(page) |
1341 | Break |
1345 | offset = 0 |
1351 | If map_data Then offset += residual I/O count |
1357 | If iov_iter_rw(iter) == WRITE && ( Not map_data || Not null_mapped ) || map_data && from_user Then |
1362 | Else |
1363 | If is_our_pages Then zero_fill_bio(bio) |
1365 | iov_iter_advance(iter, residual I/O count ) |
1368 | bi_private = bmd |
1369 | If map_data && null_mapped Then bio_set_flag(bio, BIO_NULL_MAPPED) |
1371 | Return bio |
1372 | cleanup : |
1373 | If Not map_data Then bio_free_pages(bio) |
1376 | out_bmd : |
Name | Describe |
---|---|
__blk_rq_map_user_iov |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |