函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:_map_user_iov - map user iovec into bio*@q: the struct request_queue for the bio*@iter: iovec iterator*@gfp_mask: memory allocation flags* Map the user space address into a bio suitable for io to a block* device. Returns an error pointer in case of error.

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

返回类型:struct bio

参数:

类型参数名称
struct request_queue *q
struct iov_iter *iter
gfp_tgfp_mask
1398  如果非iov_iter_count(iter)则返回:错误号
1401  bio等于bio_kmalloc(gfp_mask, iov_iter_npages(iter, BIO_MAX_PAGES))
1402  如果非bio则返回:错误号
1405 iov_iter_count(iter)循环
1408  added等于0
1411  bytes等于iov_iter_get_pages_alloc(iter, & pages, LONG_MAX, & offs)
1413  ret等于如果bytesbytes否则负EFAULT
1414  转到:out_unmap
1417  npages等于DIV_ROUND_UP(offs + bytes, PAGE_SIZE)
1420  ret等于负EINVAL
1421  j等于0
1422  否则
1423 j小于npages循环
1447 j小于npages循环
1448  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1449  kvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
1451  如果bytes退出
1455  bio_set_flag(bio, BIO_USER_MAPPED)
1463  get a reference to a bio, so it won't disappear. the intended use is* something like:* bio_get(bio);* submit_bio(rw, bio);* if (bio->bi_flags ...)* do_something* bio_put(bio);* without the bio_get(), it could potentially complete I/O before submit_bio
1464  返回:bio
1466  out_unmap :
1467  bio_release_pages(bio, false)
1468  _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.
1469  返回:错误号
调用者
名称描述
__blk_rq_map_user_iov