函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cgroup\rdma.c Create Date:2022-07-27 12:17:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:rdmacg_resource_set_max

函数原型:static ssize_t rdmacg_resource_set_max(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
428  cg等于css_rdmacg(of_css(of))
432  options等于strstrip(buf)
434  enables等于0
435  i等于0, ret等于0
438  dev_name等于分割字符串
439  如果非dev_name
440  ret等于负EINVAL
441  转到:err
444  new_limits等于分配数组内存并置零
445  如果非new_limits
446  ret等于负ENOMEM
447  转到:err
450  ret等于rdmacg_parse_limits(options, new_limits, & enables)
451  如果ret则转到:parse_err
455  mutex_lock( & Protects list of resource pools maintained on per cgroup basis* and rdma device list.)
457  device等于rdmacg_get_device_locked(dev_name)
458  如果非device
459  ret等于负ENODEV
460  转到:dev_err
463  rpool等于get_cg_rpool_locked(cg, device)
464  如果是错误
465  ret等于错误
466  转到:dev_err
470  for_each_set_bit(i, & enables, RDMACG_RESOURCE_MAX)
471  set_resource_limit(rpool, i, new_limits[i])
473  如果count active user tasks of this pool 恒等于0且al number counts which are set to max 恒等于RDMACG_RESOURCE_MAX
479  free_cg_rpool_locked(rpool)
482  dev_err :
483  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
485  parse_err :
486  kfree(new_limits)
488  err :
489  返回:如果ret否则nbytes