函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bio.c Create Date:2022-07-27 18:31:06
Last Modify:2020-03-17 23:13:58 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:_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

函数原型:struct bio *bio_copy_user_iov(struct request_queue *q, struct rq_map_data *map_data, struct iov_iter *iter, gfp_t gfp_mask)

返回类型:struct bio

参数:

类型参数名称
struct request_queue *q
struct rq_map_data *map_data
struct iov_iter *iter
gfp_tgfp_mask
1281  i等于0
1283  len等于count
1284  offset等于如果map_dataoffset_in_page(offset)否则0
1286  bmd等于bio_alloc_map_data(iter, gfp_mask)
1287  如果非bmd则返回:错误号
1295  is_our_pages等于如果map_data则0否则1
1297  nr_pages等于DIV_ROUND_UP(offset + len, PAGE_SIZE)
1298  如果nr_pages大于BIO_MAX_PAGESnr_pages等于BIO_MAX_PAGES
1301  ret等于负ENOMEM
1302  bio等于bio_kmalloc(gfp_mask, nr_pages)
1303  如果非bio则转到:out_bmd
1306  ret等于0
1308  如果map_data
1309  nr_pages等于1左移page_order
1310  i等于offsetPAGE_SIZE
1312 len循环
1313  bytes等于PAGE_SIZE
1315  bytes减等于offset
1317  如果bytes大于lenbytes等于len
1320  如果map_data
1321  如果i恒等于nr_entriesnr_pages
1322  ret等于负ENOMEM
1323  退出
1326  page等于pages[i / nr_pages]
1327  page加等于i取模nr_pages
1329  i自加
1330  否则
1332  如果非page
1333  ret等于负ENOMEM
1334  退出
1338  如果bio_add_pc_page(q, bio, page, bytes, offset)小于bytes
1339  如果非map_data__free_page(page)
1341  退出
1344  len减等于bytes
1345  offset等于0
1348  如果ret则转到:cleanup
1351  如果map_dataoffset加等于 residual I/O count
1357  如果iov_iter_rw(iter)恒等于WRITE且非map_data或非null_mapped的值或map_datafrom_user
1359  ret等于_copy_from_iter - copy all pages from iov_iter to bio*@bio: The &struct bio which describes the I/O as destination*@iter: iov_iter as source* Copy all pages from iov_iter to bio.* Returns 0 on success, or error on failure.
1360  如果ret则转到:cleanup
1362  否则
1363  如果is_our_pageszero_fill_bio(bio)
1365  iov_iter_advance(iter, residual I/O count )
1368  bi_private等于bmd
1369  如果map_datanull_mappedbio_set_flag(bio, BIO_NULL_MAPPED)
1371  返回:bio
1372  cleanup :
1373  如果非map_databio_free_pages(bio)
1375  _put - release a reference to a bio*@bio: bio to release reference to* Description:* Put a reference to a &struct bio, either one you have gotten with* bio_alloc, bio_get or bio_clone_*. The last put of a bio will free it.
1376  out_bmd :
1377  释放内存
1378  返回:错误号
调用者
名称描述
__blk_rq_map_user_iov