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:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Calculate the range inside the page that we actually need to read.

Proto:static void iomap_adjust_read_range(struct inode *inode, struct iomap_page *iop, loff_t *pos, loff_t length, unsigned *offp, unsigned *lenp)

Type:void

Parameter:

TypeParameterName
struct inode *inode
struct iomap_page *iop
loff_t *pos
loff_tlength
unsigned *offp
unsigned *lenp
90  orig_pos = pos
91  isize = 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
92  block_bits = i_blkbits
93  block_size = 1 << block_bits
94  poff = offset_in_page( * pos)
95  plen = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(loff_t, PAGE_SIZE - poff, length)
96  first = poff >> block_bits
97  last = poff + plen - 1 >> block_bits
104  If iop Then
108  When i <= last cycle
111  pos += block_size
112  poff += block_size
113  plen -= block_size
114  first++
118  When i <= last cycle
120  plen -= ( last - i + 1) * block_size
121  last = i - 1
122  Break
132  If orig_pos <= isize && orig_pos + length > isize Then
133  end = offset_in_page(isize - 1) >> block_bits
135  If first <= end && last > end Then plen -= (last - end) * block_size
139  offp = poff
140  lenp = plen
Caller
NameDescribe
iomap_readpage_actor
__iomap_write_begin