Function report |
Source Code:block\blk-throttle.c |
Create Date:2022-07-28 17:43:49 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:tg_set_limit
Proto:static ssize_t tg_set_limit(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off)
Type:ssize_t
Parameter:
Type | Parameter | Name |
---|---|---|
struct kernfs_open_file * | of | |
char * | buf | |
size_t | nbytes | |
loff_t | off |
1632 | blkcg = css_to_blkcg(of_css(of)) |
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] |
1653 | latency_time = us |
1654 | When (true) cycle |
1660 | If sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments != 1 Then Break |
1662 | If tok[0] == '\0' Then Break |
1669 | If Not p || sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments != 1 && strcmp(p, "max") Then Go to out_finish |
1673 | If Not val Then Go to out_finish |
1681 | Else if Not strcmp(tok, "riops") Then 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 | Else if Not strcmp(tok, "wiops") Then 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) |
1689 | Else Go to 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] |
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] |
1713 | us = latency_time |
1720 | internally used bytes per second rate 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 |
1732 | If limit_valid[LIMIT_LOW] Then |
1733 | If index == LIMIT_LOW Then limit_index = LIMIT_LOW |
1735 | Else limit_index = LIMIT_MAX |
1737 | tg_conf_updated(tg, index == LIMIT_LOW && limit_valid[LIMIT_LOW]) |
1739 | ret = 0 |
1740 | out_finish : |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |