Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ioc_qos_write

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

Type:ssize_t

Parameter:

TypeParameterName
struct kernfs_open_file *of
char *input
size_tnbytes
loff_toff
2192  disk = lkg_conf_prep - parse and prepare for per-blkg config update*@inputp: input string pointer* Parse the device node prefix part, MAJ:MIN, of per-blkg config update* from @input and get and return the matching gendisk. *@inputp is
2193  If IS_ERR(disk) Then Return PTR_ERR(disk)
2196  ioc = q_to_ioc(queue)
2197  If Not ioc Then
2198  ret = blk_iocost_init(queue)
2199  If ret Then Go to err
2201  ioc = q_to_ioc(queue)
2204  spin_lock_irq( & lock)
2205  memcpy(qos, qos, size of qos )
2206  enable = enabled
2207  user = user_qos_params
2208  spin_unlock_irq( & lock)
2210  When p = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function cycle
2216  If Not p Then Continue
2222  enable = v
2223  Continue
2226  If Not strcmp(buf, "auto") Then user = false
2228  Else if Not strcmp(buf, "user") Then user = true
2230  Else Go to einval
2232  Continue
2235  tok = match_token(p, qos_tokens, args)
2237  Case tok == QOS_RPPM
2238  Case tok == QOS_WPPM
2244  If v < 0 || v > 10000 Then Go to einval
2246  qos[tok] = v * 100
2247  Break
2248  Case tok == QOS_RLAT
2249  Case tok == QOS_WLAT
2252  qos[tok] = v
2253  Break
2254  Case tok == QOS_MIN
2255  Case tok == QOS_MAX
2261  If v < 0 Then Go to einval
2265  Break
2266  Default
2267  Go to einval
2269  user = true
2272  If qos[QOS_MIN] > qos[QOS_MAX] Then Go to einval
2275  spin_lock_irq( & lock)
2277  If enable Then
2278  lk_queue_flag_set - atomically set a queue flag*@flag: flag to be set*@q: request queue
2279  enabled = true
2280  Else
2281  lk_queue_flag_clear - atomically clear a queue flag*@flag: flag to be cleared*@q: request queue
2282  enabled = false
2285  If user Then
2286  memcpy(qos, qos, size of qos )
2287  user_qos_params = true
2288  Else
2289  user_qos_params = false
2292  ioc_refresh_params(ioc, true)
2293  spin_unlock_irq( & lock)
2295  This is a counterpart of get_disk_and_module() and thus also of* get_gendisk().
2296  Return nbytes
2297  einval :
2298  ret = -EINVAL
2299  err :
2300  This is a counterpart of get_disk_and_module() and thus also of* get_gendisk().
2301  Return ret