Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ioc_weight_write

Proto:static ssize_t ioc_weight_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off)

Type:ssize_t

Parameter:

TypeParameterName
struct kernfs_open_file *of
char *buf
size_tnbytes
loff_toff
2073  blkcg = css_to_blkcg(of_css(of))
2074  iocc = blkcg_to_iocc(blkcg)
2080  If Not strchr(buf, ':') Then
2083  If Not sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments && Not sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments Then Return -EINVAL
2086  If v < All weight knobs on the default hierarhcy should use the following min,* default and max values. The default value is the logarithmic center of* MIN and MAX and allows 100x to be expressed in both directions. || v > CGROUP_WEIGHT_MAX Then Return -EINVAL
2089  spin_lock( & lock)
2090  dfl_weight = v
2092  iocg = blkg_to_iocg(blkg)
2094  If iocg Then
2095  spin_lock_irq( & lock)
2097  spin_unlock_irq( & lock)
2100  spin_unlock( & lock)
2102  Return nbytes
2105  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
2106  If ret Then Return ret
2109  iocg = blkg_to_iocg(blkg)
2111  If Not strncmp(body, "default", 7) Then
2112  v = 0
2113  Else
2114  If Not sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments Then Go to einval
2116  If v < All weight knobs on the default hierarhcy should use the following min,* default and max values. The default value is the logarithmic center of* MIN and MAX and allows 100x to be expressed in both directions. || v > CGROUP_WEIGHT_MAX Then Go to einval
2120  spin_lock( & lock)
2121  * A iocg can get its weight from two sources - an explicit * per-device-cgroup configuration or the default weight of the * cgroup. `cfg_weight` is the explicit per-device-cgroup * configuration. `weight` is the effective considering both * sources. * When = v
2122  weight_updated(iocg)
2123  spin_unlock( & lock)
2125  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().
2126  Return nbytes
2128  einval :
2129  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().
2130  Return -EINVAL