函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\badblocks.c Create Date:2022-07-27 18:59:28
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:adblocks_check() - check a given range for bad sectors*@bb: the badblocks structure that holds all badblock information*@s: sector (start) at which to check for badblocks*@sectors: number of sectors to check for badblocks*@first_bad: pointer to store

函数原型:int badblocks_check(struct badblocks *bb, sector_t s, int sectors, sector_t *first_bad, int *bad_sectors)

返回类型:int

参数:

类型参数名称
struct badblocks *bb
sector_ts
intsectors
sector_t *first_bad
int *bad_sectors
58  p等于 badblock list
60  target等于ssectors
63  如果 shift from sectors to block size * a -ve shift means badblocks are * disabled.大于0则
65  s右移等于 shift from sectors to block size * a -ve shift means badblocks are * disabled.
66  target加等于1左移 shift from sectors to block size * a -ve shift means badblocks are * disabled.位的值减1
67  target右移等于 shift from sectors to block size * a -ve shift means badblocks are * disabled.
68  sectors等于targets
72  retry :
73  seq等于Read side functions for starting and finalizing a read side section.
74  lo等于0
75  rv等于0
76  hi等于 count of bad blocks
86 hilo大于1循环
87  mid等于lohi的和除2
88  a等于BB_OFFSET(p[mid])
90  如果a小于targetlo等于mid
95  否则hi等于mid
100  如果hi大于lo
104 lo大于等于0且BB_OFFSET(p[lo])加BB_LEN(p[lo])大于s循环
106  如果BB_OFFSET(p[lo])小于target
110  如果rv不等于负1且BB_ACK(p[lo])则rv等于1
112  否则rv等于负1
114  first_bad等于BB_OFFSET(p[lo])
115  bad_sectors等于BB_LEN(p[lo])
117  lo自减
121  如果read_seqretry( & lock, seq)则转到:retry
124  返回:rv