函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__generic_block_fiemap - FIEMAP for block based inodes (no locking)*@inode: the inode to map*@fieinfo: the fiemap info struct that will be passed back to userspace*@start: where to start mapping in the inode*@len: how much space to map*@get_block: the

函数原型:int __generic_block_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, loff_t start, loff_t len, get_block_t *get_block)

返回类型:int

参数:

类型参数名称
struct inode *inode
struct fiemap_extent_info *fieinfo
loff_tstart
loff_tlen
get_block_t *get_block
296  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
297  logical等于0, phys等于0, size等于0
298  flags等于File does not natively* support extents. Result* merged for efficiency.
299  bool past_eof = TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., whole_file = false
300  ret等于0
302  ret等于map_check_flags - check validity of requested flags for fiemap*@fieinfo: Fiemap context passed into ->fiemap*@fs_flags: Set of fiemap flags that the file system understands* Called from file system ->fiemap callback. This will compute the
303  如果ret则返回:ret
311  如果len大于等于isize
312  whole_file = true
313  len等于isize
320  如果logical_to_blk(inode, len)恒等于0则len等于blk_to_logical(inode, 1)
323  start_blk等于logical_to_blk(inode, start)
324  last_blk等于logical_to_blk(inode, start + len - 1)
326  循环
331  memset( & map_bh, 0, sizeof(structbuffer_head))
332  size of mapping 等于len
334  ret等于get_block(inode, start_blk, & map_bh, 0)
335  如果ret退出
339  如果非buffer_mapped( & map_bh)则
340  start_blk自加
349  如果非past_eofblk_to_logical(inode, start_blk)大于等于isizepast_eof等于1
357  如果past_eofsize
362  否则如果size
365  size等于0
369  如果start_blk大于last_blkpast_eofret退出
371  否则
387  如果start_blk大于last_blk且非whole_file
398  如果size
418  如果非past_eoflogicalsize大于等于isizepast_eof = true
421  cond_resched()
423  ret等于负EINTR
424  退出
427  当1循环
430  如果ret恒等于1则ret等于0
433  返回:ret
调用者
名称描述
generic_block_fiemapgeneric_block_fiemap - FIEMAP for block based inodes*@inode: The inode to map*@fieinfo: The mapping information*@start: The initial block to map*@len: The length of the extect to attempt to map*@get_block: The block mapping function for the fs* Calls