函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:iolatency_set_limit

函数原型:static ssize_t iolatency_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
790  blkcg等于css_to_blkcg(of_css(of))
795  lat_val等于0
798  enable等于0
800  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
801  如果ret则返回:ret
804  iolat等于blkg_to_lat(blkg)
805  p等于body
807  ret等于负EINVAL
808 tok等于分割字符串循环
812  如果sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments不等于2则转到:out
815  如果非字符串比较
818  如果非字符串比较lat_val等于0
822  否则转到:out
824  否则
825  转到:out
830  blkg等于blkg
831  oldval等于min_lat_nsec
833  enable等于rn 1 for enabling iolatency, return -1 for disabling iolatency, otherwise* return 0.
834  如果enable
835  WARN_ON_ONCE(!blk_get_queue( Pointer to the associated request_queue ))
836  lkg_get - get a blkg reference*@blkg: blkg to get* The caller should be holding an existing reference.
839  如果oldval不等于min_lat_nsec
840  iolatency_clear_scaling(blkg)
843  ret等于0
844  out :
845  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().
846  如果ret恒等于0且enable
847  tmp等于blkg_to_lat(blkg)
848  blkiolat等于blkiolat
850  blk_mq_freeze_queue( Pointer to the associated request_queue )
852  如果enable恒等于1则atomic_inc( & enabled)
854  否则如果enable恒等于负1则atomic_dec( & enabled)
856  否则WARN_ON_ONCE(1)
859  blk_mq_unfreeze_queue( Pointer to the associated request_queue )
861  lkg_put - put a blkg reference*@blkg: blkg to put
862  blk_put_queue( Pointer to the associated request_queue )
864  返回:如果ret否则nbytes