Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ioc_cost_model_write

Proto:static ssize_t ioc_cost_model_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
2358  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
2359  If IS_ERR(disk) Then Return PTR_ERR(disk)
2362  ioc = q_to_ioc(queue)
2363  If Not ioc Then
2364  ret = blk_iocost_init(queue)
2365  If ret Then Go to err
2367  ioc = q_to_ioc(queue)
2370  spin_lock_irq( & lock)
2371  memcpy(u, i_lcoefs, size of u )
2372  user = user_cost_model
2373  spin_unlock_irq( & lock)
2375  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
2381  If Not p Then Continue
2387  If Not strcmp(buf, "auto") Then user = false
2389  Else if Not strcmp(buf, "user") Then user = true
2391  Else Go to einval
2393  Continue
2396  If strcmp(buf, "linear") Then Go to einval
2398  Continue
2401  tok = match_token(p, i_lcoef_tokens, args)
2402  If tok == NR_I_LCOEFS Then Go to einval
2404  If match_u64: - scan a decimal representation of a u64 from* a substring_t*@s: substring_t to be scanned*@result: resulting unsigned long long on success* Description: Attempts to parse the &substring_t @s as a long decimal* integer Then Go to einval
2406  u[tok] = v
2407  user = true
2410  spin_lock_irq( & lock)
2411  If user Then
2412  memcpy(i_lcoefs, u, size of u )
2413  user_cost_model = true
2414  Else
2415  user_cost_model = false
2417  ioc_refresh_params(ioc, true)
2418  spin_unlock_irq( & lock)
2420  This is a counterpart of get_disk_and_module() and thus also of* get_gendisk().
2421  Return nbytes
2423  einval :
2424  ret = -EINVAL
2425  err :
2426  This is a counterpart of get_disk_and_module() and thus also of* get_gendisk().
2427  Return ret