函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:hugetlb_cgroup_write

函数原型:static ssize_t hugetlb_cgroup_write(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
293  h_cg等于hugetlb_cgroup_from_css(of_css(of))
295  如果hugetlb_cgroup_is_root(h_cg)则返回:负EINVAL
298  buf等于strstrip(buf)
299  ret等于page_counter_memparse - memparse() for page counter limits*@buf: string to parse*@max: string meaning maximum possible value*@nr_pages: returns the result in number of pages* Returns -EINVAL, or 0 and @nr_pages on success. @nr_pages will be
300  如果ret则返回:ret
303  idx等于MEMFILE_IDX(private)
304  nr_pages等于und_down - round down to next specified power of 2*@x: the value to round*@y: multiple to round down to (must be a power of 2)* Rounds @x down to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding down, use rounddown() below.(nr_pages, 1 << huge_page_order( & hstates[idx]))
307  :MEMFILE_ATTR(private)恒等于RES_LIMIT
308  mutex_lock( & hugetlb_limit_mutex)
309  ret等于page_counter_set_max - set the maximum number of pages allowed*@counter: counter*@nr_pages: limit to set* Returns 0 on success, -EBUSY if the current number of pages on the* counter already exceeds the specified limit.
310  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.
311  退出
312  默认
313  ret等于负EINVAL
314  退出
316  返回:如果ret否则nbytes