函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:This function handles some semctl commands which require the rwsem* to be held in write mode.* NOTE: no locks must be held, the rwsem is taken inside this function.

函数原型:static int semctl_down(struct ipc_namespace *ns, int semid, int cmd, struct semid64_ds *semid64)

返回类型:int

参数:

类型参数名称
struct ipc_namespace *ns
intsemid
intcmd
struct semid64_ds *semid64
1590  lock for writing
1591  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1593  ipcp等于pcctl_obtain_check - retrieve an ipc object and check permissions*@ns: ipc namespace*@ids: the table of ids where to look for the ipc*@id: the id of the ipc to retrieve*@cmd: the cmd to check*@perm: the permission to set*@extra_perm: one extra permission
1595  如果是错误
1596  err等于错误
1597  转到:out_unlock1
1600  sma等于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.(ipcp, structsem_array, sem_perm)
1602  err等于security_sem_semctl( & permissions .. see ipc.h , cmd)
1603  如果err则转到:out_unlock1
1607  :cmd恒等于move resource
1608  If the request contains only one semaphore operation, and there are* no complex transactions pending, lock only the semaphore involved
1610  Free a semaphore set. freeary() is called with sem_ids.rwsem locked* as a writer and the spinlock for this semaphore set hold. sem_ids.rwsem* remains locked on exit.
1611  转到:out_up
1612  :cmd恒等于set ipc_perm options
1613  If the request contains only one semaphore operation, and there are* no complex transactions pending, lock only the semaphore involved
1614  err等于pc_update_perm - update the permissions of an ipc object*@in: the permission given as input.*@out: the permission of the ipc to set.
1615  如果err则转到:out_unlock0
1617  create/last semctl() time 等于ktime_get_real_seconds - Get the seconds portion of CLOCK_REALTIME* Returns the wall clock seconds since 1970. This replaces the* get_seconds() interface which is not y2038 safe on 32bit systems.
1618  退出
1619  默认
1620  err等于负EINVAL
1621  转到:out_unlock1
1624  out_unlock0 :
1625  sem_unlock(sma, - 1)
1626  out_unlock1 :
1627  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1628  out_up :
1629  lease a write lock
1630  返回:err
调用者
名称描述
ksys_semctl
compat_ksys_semctl