函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Notify userspace when a cgroup is released, by running the* configured release agent with the name of the cgroup (path* relative to the root of cgroup file system) as the argument

函数原型:void cgroup1_release_agent(struct work_struct *work)

返回类型:void

参数:

类型参数名称
struct work_struct *work
777  cgrp等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(work, structcgroup, release_agent_work)
779  char * pathbuf = NULL, * agentbuf = NULL
780  char * argv[3], * envp[3]
783  mutex_lock( & cgroup_mutex is the master lock)
785  pathbuf等于开辟内存
786  agentbuf等于kstrdup( The path to use for release notifications. , GFP_KERNEL)
787  如果非pathbuf或非agentbuf则转到:out
790  spin_lock_irq( & css_set_lock)
791  ret等于cgroup_path_ns_locked(cgrp, pathbuf, # chars in a path name including nul , & cgroup namespace for init task )
792  spin_unlock_irq( & css_set_lock)
793  如果ret小于0或ret大于等于# chars in a path name including nul 则转到:out
796  argv[0]等于agentbuf
797  argv[1]等于pathbuf
798  argv[2] = NULL
801  envp[0]等于"HOME=/"
802  envp[1]等于"PATH=/sbin:/bin:/usr/sbin:/usr/bin"
803  envp[2] = NULL
805  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.
806  all_usermodehelper() - prepare and start a usermode application*@path: path to usermode executable*@argv: arg vector for process*@envp: environment for process*@wait: wait for the application to finish and return status
807  转到:out_free
808  out :
809  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.
810  out_free :
811  kfree(agentbuf)
812  kfree(pathbuf)