函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:adblocks_clear() - Remove a range of bad blocks to the table

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

返回类型:int

参数:

类型参数名称
struct badblocks *bb
sector_ts
intsectors
335  target等于ssectors
336  rv等于0
338  如果 shift from sectors to block size * a -ve shift means badblocks are * disabled.大于0则
345  s加等于1左移 shift from sectors to block size * a -ve shift means badblocks are * disabled.位的值减1
346  s右移等于 shift from sectors to block size * a -ve shift means badblocks are * disabled.
347  target右移等于 shift from sectors to block size * a -ve shift means badblocks are * disabled.
348  sectors等于targets
351  write_seqlock_irq( & lock)
353  p等于 badblock list
354  lo等于0
355  hi等于 count of bad blocks
357 hilo大于1循环
358  mid等于lohi的和除2
359  a等于BB_OFFSET(p[mid])
361  如果a小于targetlo等于mid
363  否则hi等于mid
366  如果hi大于lo
371  如果BB_OFFSET(p[lo])加BB_LEN(p[lo])大于targetBB_OFFSET(p[lo])小于target
374  ack等于BB_ACK(p[lo])
375  a等于BB_OFFSET(p[lo])
376  end等于aBB_LEN(p[lo])
378  如果a小于s
389  p[lo]等于BB_MAKE(target, end - target, ack)
391  hi等于lo
392  lo自减
394 lo大于等于0且BB_OFFSET(p[lo])加BB_LEN(p[lo])大于sBB_OFFSET(p[lo])小于target循环
398  如果BB_OFFSET(p[lo])小于s
400  ack等于BB_ACK(p[lo])
401  start等于BB_OFFSET(p[lo])
403  p[lo]等于BB_MAKE(start, s - start, ack)
405  退出
407  lo自减
412  如果hilo大于1则
413  memmove(p + lo + 1, p + hi, ( count of bad blocks - hi) * 8)
414  count of bad blocks 减等于hilo减1
418  badblocks_update_acked(bb)
419  changed等于1
420  out :
421  write_sequnlock_irq( & lock)
422  返回:rv