Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-throttle.c Create Date:2022-07-28 17:43:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:tg_prfill_limit

Proto:static u64 tg_prfill_limit(struct seq_file *sf, struct blkg_policy_data *pd, int off)

Type:u64

Parameter:

TypeParameterName
struct seq_file *sf
struct blkg_policy_data *pd
intoff
1562  tg = pd_to_tg(pd)
1563  dname = blkg_dev_name(he blkg and policy id this per-policy data belongs to )
1564  char bufs[4][21] = {"max", "max", "max", "max"}
1567  idle_time[26] = ""
1568  latency_time[26] = ""
1570  If Not dname Then Return 0
1573  If off == LIMIT_LOW Then
1574  bps_dft = 0
1575  iops_dft = 0
1576  Else
1577  bps_dft = U64_MAX
1578  iops_dft = UINT_MAX
1581  If user configured bps limits [generic data direction definitions ][off] == bps_dft && user configured bps limits [WRITE][off] == bps_dft && user configured IOPS limits [generic data direction definitions ][off] == iops_dft && user configured IOPS limits [WRITE][off] == iops_dft && ( off != LIMIT_LOW || us == DFL_IDLE_THRESHOLD && us == DFL_LATENCY_TARGET ) Then Return 0
1590  If user configured bps limits [generic data direction definitions ][off] != U64_MAX Then snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
1593  If user configured bps limits [WRITE][off] != U64_MAX Then snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
1596  If user configured IOPS limits [generic data direction definitions ][off] != UINT_MAX Then snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
1599  If user configured IOPS limits [WRITE][off] != UINT_MAX Then snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
1602  If off == LIMIT_LOW Then
1603  If us == ULONG_MAX Then strcpy(idle_time, " idle=max")
1605  Else snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
1609  If us == ULONG_MAX Then strcpy(latency_time, " latency=max")
1611  Else snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
1616  seq_printf(sf, "%s rbps=%s wbps=%s riops=%s wiops=%s%s%s\n", dname, bufs[0], bufs[1], bufs[2], bufs[3], idle_time, latency_time)
1619  Return 0