Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:dax_iomap_actor

Proto:static loff_t dax_iomap_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
1096  bdev = block device for I/O
1097  dax_dev = dax_dev for dax operations
1098  iter = data
1099  end = pos + length , done = 0
1100  ret = 0
1104  If iov_iter_rw(iter) == generic data direction definitions Then
1105  end = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(end, 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 )
1106  If pos >= end Then Return 0
1109  If type of mapping == blocks allocated, need allocation || type of mapping == locks allocated at @addr in unwritten state Then Return iov_iter_zero(min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(length, end - pos), iter)
1113  If WARN_ON_ONCE( type of mapping != locks allocated at @addr ) Then Return -EIO
1121  If 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 Then
1122  validate_inode_pages2_range - remove range of pages from an address_space*@mapping: the address_space*@start: the page offset 'from' which to invalidate*@end: the page offset 'to' which to invalidate (inclusive)* Any pages which are found to be mapped
1127  id = dax_read_lock()
1128  When pos < end cycle
1129  offset = pos & PAGE_SIZE - 1
1130  size = @a is a power of 2 value (length + offset, PAGE_SIZE)
1131  sector = dax_iomap_sector(iomap, pos)
1137  ret = -EINTR
1138  Break
1141  ret = bdev_dax_pgoff(bdev, sector, size, & pgoff)
1142  If ret Then Break
1145  map_len = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), & kaddr, NULL)
1147  If map_len < 0 Then
1148  ret = map_len
1149  Break
1152  map_len = PFN_PHYS(map_len)
1153  kaddr += offset
1154  map_len -= offset
1155  If map_len > end - pos Then map_len = end - pos
1163  If iov_iter_rw(iter) == WRITE Then xfer = dax_copy_from_iter(dax_dev, pgoff, kaddr, map_len, iter)
1166  Else xfer = dax_copy_to_iter(dax_dev, pgoff, kaddr, map_len, iter)
1170  pos += xfer
1171  length -= xfer
1172  done += xfer
1174  If xfer == 0 Then ret = -EFAULT
1176  If xfer < map_len Then Break
1179  dax_read_unlock(id)
1181  Return If done Then done Else ret