Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\iomap\buffered-io.c Create Date:2022-07-28 20:31:52
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:iomap_readpage_actor

Proto:static loff_t iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, struct iomap *iomap, struct iomap *srcmap)

Type:loff_t

Parameter:

TypeParameterName
struct inode *inode
loff_tpos
loff_tlength
void *data
struct iomap *iomap
struct iomap *srcmap
254  ctx = data
255  page = cur_page
256  iop = iomap_page_create(inode, page)
257  bool same_page = TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., is_contig = false
258  orig_pos = pos
262  If type of mapping == data inline in the inode Then
263  WARN_ON_ONCE(pos)
264  iomap_read_inline_data(inode, page, iomap)
265  Return PAGE_SIZE
269  Calculate the range inside the page that we actually need to read.
270  If plen == 0 Then Go to done
273  If iomap_block_needs_zeroing(inode, iomap, pos) Then
274  zero_user(page, poff, plen)
275  iomap_set_range_uptodate(page, poff, plen)
276  Go to done
279  cur_page_in_bio = true
284  sector = iomap_sector(iomap, pos)
285  If bio && bio_end_sector(bio) == sector Then is_contig = true
288  If is_contig && __bio_try_merge_page(bio, page, plen, poff, & same_page) Then
290  If Not same_page && iop Then atomic_inc( & read_count)
292  Go to done
300  If iop Then atomic_inc( & read_count)
303  If Not bio || Not is_contig || _full - check if the bio is full*@bio: bio to check*@len: length of one segment to be added* Return true if @bio is full and one segment with @len bytes can't be* added to the bio, otherwise return false Then
304  gfp = Restricts the given gfp_mask to what the mapping allows.
305  nr_vecs = length + PAGE_SIZE - 1 >> PAGE_SHIFT determines the page size
307  If bio Then submit_bio(bio)
310  If is_readahead Then gfp |= __GFP_NORETRY | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.
312  bio = bio_alloc(gfp, min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(BIO_MAX_PAGES, nr_vecs))
313  bottom bits req flags, * top bits REQ_OP. Use * accessors. = REQ_OP_READ
314  If is_readahead Then bottom bits req flags, * top bits REQ_OP. Use * accessors. |= REQ_RAHEAD
316  device address in 512 byte sectors = sector
317  bio_set_dev(bio, block device for I/O )
318  bi_end_io = iomap_read_end_io
321  bio_add_page(bio, page, plen, poff)
322  done :
329  Return pos - orig_pos + plen
Caller
NameDescribe
iomap_readpages_actor