Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\hugetlb_cgroup.c Create Date:2022-07-28 16:16:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:hugetlb_cgroup_write

Proto:static ssize_t hugetlb_cgroup_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
293  h_cg = hugetlb_cgroup_from_css(of_css(of))
295  If hugetlb_cgroup_is_root(h_cg) Then Return -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  If ret Then Return 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  Case 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  Break
312  Default
313  ret = -EINVAL
314  Break
316  Return If ret Else nbytes