函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:tg_set_limit

函数原型:static ssize_t tg_set_limit(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off)

返回类型:ssize_t

参数:

类型参数名称
struct kernfs_open_file *of
char *buf
size_tnbytes
loff_toff
1632  blkcg等于css_to_blkcg(of_css(of))
1639  index等于private
1641  ret等于lkg_conf_prep - parse and prepare for per-blkg config update*@blkcg: target block cgroup*@pol: target policy*@input: input string*@ctx: blkg_conf_ctx to be filled* Parse per-blkg config update from @input and initialize @ctx with the* result
1642  如果ret则返回:ret
1645  tg等于blkg_to_tg(blkg)
1647  v[0]等于 user configured bps limits [generic data direction definitions ][index]
1648  v[1]等于 user configured bps limits [WRITE][index]
1649  v[2]等于 user configured IOPS limits [generic data direction definitions ][index]
1650  v[3]等于 user configured IOPS limits [WRITE][index]
1652  idle_time等于 us
1653  latency_time等于 us
1654  当(true)循环
1657  val等于U64_MAX
1660  如果sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments不等于1则退出
1662  如果tok[0]恒等于'\0'则退出
1664  body加等于len
1666  ret等于负EINVAL
1667  p等于tok
1668  分割字符串
1669  如果非psscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments不等于1且字符串比较则转到:out_finish
1672  ret等于负ERANGE
1673  如果非val则转到:out_finish
1676  ret等于负EINVAL
1677  如果非字符串比较v[0]等于val
1679  否则如果非字符串比较v[1]等于val
1681  否则如果非字符串比较v[2]等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, val, UINT_MAX)
1683  否则如果非字符串比较v[3]等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, val, UINT_MAX)
1685  否则如果off恒等于LIMIT_LOW且非字符串比较idle_time等于val
1687  否则如果off恒等于LIMIT_LOW且非字符串比较latency_time等于val
1689  否则转到:out_finish
1693  user configured bps limits [generic data direction definitions ][index]等于v[0]
1694  user configured bps limits [WRITE][index]等于v[1]
1695  user configured IOPS limits [generic data direction definitions ][index]等于v[2]
1696  user configured IOPS limits [WRITE][index]等于v[3]
1698  如果index恒等于LIMIT_MAX
1699  internally used bytes per second rate limits [generic data direction definitions ][index]等于v[0]
1700  internally used bytes per second rate limits [WRITE][index]等于v[1]
1701  internally used IOPS limits [generic data direction definitions ][index]等于v[2]
1702  internally used IOPS limits [WRITE][index]等于v[3]
1704  internally used bytes per second rate limits [generic data direction definitions ][LIMIT_LOW]等于两数取小( user configured bps limits [generic data direction definitions ][LIMIT_LOW], user configured bps limits [generic data direction definitions ][LIMIT_MAX])
1706  internally used bytes per second rate limits [WRITE][LIMIT_LOW]等于两数取小( user configured bps limits [WRITE][LIMIT_LOW], user configured bps limits [WRITE][LIMIT_MAX])
1708  internally used IOPS limits [generic data direction definitions ][LIMIT_LOW]等于两数取小( user configured IOPS limits [generic data direction definitions ][LIMIT_LOW], user configured IOPS limits [generic data direction definitions ][LIMIT_MAX])
1710  internally used IOPS limits [WRITE][LIMIT_LOW]等于两数取小( user configured IOPS limits [WRITE][LIMIT_LOW], user configured IOPS limits [WRITE][LIMIT_MAX])
1712  us 等于idle_time
1713  us 等于latency_time
1716  如果非 internally used bytes per second rate limits [generic data direction definitions ][LIMIT_LOW]或 internally used IOPS limits [generic data direction definitions ][LIMIT_LOW]或 internally used bytes per second rate limits [WRITE][LIMIT_LOW]或 internally used IOPS limits [WRITE][LIMIT_LOW]的值或 us 恒等于DFL_IDLE_THRESHOLD us 恒等于DFL_LATENCY_TARGET
1720  internally used bytes per second rate limits [generic data direction definitions ][LIMIT_LOW]等于0
1721  internally used bytes per second rate limits [WRITE][LIMIT_LOW]等于0
1722  internally used IOPS limits [generic data direction definitions ][LIMIT_LOW]等于0
1723  internally used IOPS limits [WRITE][LIMIT_LOW]等于0
1724  us 等于DFL_IDLE_THRESHOLD
1725  us 等于DFL_LATENCY_TARGET
1726  否则如果index恒等于LIMIT_LOW
1727  us 等于 us
1728  us 等于 us
1731  blk_throtl_update_limit_valid( throtl_data this group belongs to )
1732  如果limit_valid[LIMIT_LOW]则
1733  如果index恒等于LIMIT_LOWlimit_index等于LIMIT_LOW
1735  否则limit_index等于LIMIT_MAX
1737  tg_conf_updated(tg, index == LIMIT_LOW && limit_valid[LIMIT_LOW])
1739  ret等于0
1740  out_finish :
1741  lkg_conf_finish - finish up per-blkg config update*@ctx: blkg_conf_ctx intiailized by blkg_conf_prep()* Finish up after per-blkg config update. This function must be paired* with blkg_conf_prep().
1742  返回:如果ret否则nbytes