函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\iomap\direct-io.c Create Date:2022-07-29 11:07:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:iomap_dio_bio_actor

函数原型:static loff_t iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length, struct iomap_dio *dio, struct iomap *iomap)

返回类型:loff_t

参数:

类型参数名称
struct inode *inode
loff_tpos
loff_tlength
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
211  如果pos按位或length按位或align的值按位与1左移blkbits位的值减1则返回:负EINVAL
214  如果 type of mapping 恒等于locks allocated at @addr in unwritten state
215  flags或等于covers unwritten extent(s)
216  need_zeroout = true
219  如果 flags for mapping 按位与IOMAP_F_SHAREDflags或等于covers COW extent(s)
222  如果 flags for mapping 按位与Flags reported by the file system from iomap_begin:* IOMAP_F_NEW indicates that the blocks have been newly allocated and need* zeroing for areas that no data is copied to.* IOMAP_F_DIRTY indicates the inode has uncommitted metadata needed to access
223  need_zeroout = true
224  否则如果 type of mapping 恒等于locks allocated at @addr
232  如果非 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 ))则use_fua = true
243  orig_count等于iov_iter_count(iter)
244  Cap the iov_iter by given limit; note that the second argument is* *not* the new size - it's upper limit for such. Passing it a value* greater than the amount of data in iov_iter is fine - it'll just do* nothing in that case.
246  nr_pages等于iov_iter_npages(iter, BIO_MAX_PAGES)
247  如果nr_pages小于等于0则
248  ret等于nr_pages
249  转到:out
252  如果need_zeroout
254  pad等于pos按位与fs_block_size减1
255  如果padiomap_dio_zero(dio, iomap, pos - pad, pad)
259  循环
261  如果error
263  copied等于ret等于0
264  转到:out
267  bio等于bio_alloc(GFP_KERNEL, nr_pages)
268  bio_set_dev(bio, block device for I/O )
269  device address in 512 byte sectors 等于iomap_sector(iomap, pos)
270  bi_write_hint等于ki_hint
271  bi_ioprio等于 See linux/ioprio.h
272  bi_private等于dio
273  bi_end_io等于iomap_dio_bio_end_io
275  ret等于bio_iov_iter_get_pages(bio, iter)
283  bio_put(bio)
284  转到:zero_tail
287  n等于 residual I/O count
288  如果flags按位与IOMAP_DIO_WRITE
295  否则
297  如果flags按位与IOMAP_DIO_DIRTYbio_set_pages_dirty(bio)
301  size加等于n
302  pos加等于n
303  copied加等于n
305  nr_pages等于iov_iter_npages(iter, BIO_MAX_PAGES)
306  iomap_dio_submit_bio(dio, iomap, bio)
307 nr_pages循环
315  zero_tail :
316  如果need_zerooutflags按位与IOMAP_DIO_WRITEpos大于等于NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they
319  pad等于pos按位与fs_block_size减1
320  如果padiomap_dio_zero(dio, iomap, pos, fs_block_size - pad)
323  out :
325  xpand a previously truncated iterator; count must be no more than how much* we had shrunk it.
326  如果copied则返回:copied
328  返回:ret
调用者
名称描述
iomap_dio_actor