Function report |
Source Code:fs\iomap\direct-io.c |
Create Date:2022-07-28 20:32:08 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:iomap_dio_bio_actor
Proto:static loff_t iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length, struct iomap_dio *dio, struct iomap *iomap)
Type:loff_t
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct inode * | inode | |
| loff_t | pos | |
| loff_t | length | |
| struct iomap_dio * | dio | |
| struct iomap * | iomap |
| 201 | blkbits = assumes size > 256 |
| 202 | fs_block_size = i_blocksize(inode) |
| 203 | align = iov_iter_alignment(iter) |
| 205 | bool need_zeroout = false |
| 206 | bool use_fua = false |
| 207 | ret = 0 |
| 208 | copied = 0 |
| 214 | If type of mapping == locks allocated at @addr in unwritten state Then |
| 215 | flags |= covers unwritten extent(s) |
| 216 | need_zeroout = true |
| 219 | If flags for mapping & IOMAP_F_SHARED Then flags |= covers COW extent(s) |
| 223 | need_zeroout = true |
| 224 | Else if type of mapping == locks allocated at @addr Then |
| 232 | If Not ( flags for mapping & (IOMAP_F_SHARED | IOMAP_F_DIRTY)) && flags & Private flags for iomap_dio, must not overlap with the public ones in* iomap.h: && blk_queue_fua(bdev_get_queue( block device for I/O )) Then use_fua = true |
| 243 | orig_count = iov_iter_count(iter) |
| 246 | nr_pages = iov_iter_npages(iter, BIO_MAX_PAGES) |
| 247 | If nr_pages <= 0 Then |
| 252 | If need_zeroout Then |
| 254 | pad = pos & fs_block_size - 1 |
| 259 | Do |
| 261 | If error Then |
| 267 | bio = bio_alloc(GFP_KERNEL, nr_pages) |
| 268 | bio_set_dev(bio, block device for I/O ) |
| 270 | bi_write_hint = ki_hint |
| 271 | bi_ioprio = See linux/ioprio.h |
| 272 | bi_private = dio |
| 275 | ret = bio_iov_iter_get_pages(bio, iter) |
| 287 | n = residual I/O count |
| 288 | If flags & IOMAP_DIO_WRITE Then |
| 294 | task_io_account_write(n) |
| 295 | Else |
| 297 | If flags & IOMAP_DIO_DIRTY Then bio_set_pages_dirty(bio) |
| 305 | nr_pages = iov_iter_npages(iter, BIO_MAX_PAGES) |
| 306 | iomap_dio_submit_bio(dio, iomap, bio) |
| 315 | zero_tail : |
| 319 | pad = pos & fs_block_size - 1 |
| 320 | If pad Then iomap_dio_zero(dio, iomap, pos, fs_block_size - pad) |
| 323 | out : |
| 328 | Return ret |
| Name | Describe |
|---|---|
| iomap_dio_actor |
| 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 |