函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\shm.c Create Date:2022-07-27 18:22:48
Last Modify:2020-03-17 22:58:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:This function handles some shmctl 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 shmctl_down(struct ipc_namespace *ns, int shmid, int cmd, struct shmid64_ds *shmid64)

返回类型:int

参数:

类型参数名称
struct ipc_namespace *ns
intshmid
intcmd
struct shmid64_ds *shmid64
898  lock for writing
899  _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
901  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
903  如果是错误
904  err等于错误
905  转到:out_unlock1
908  shp等于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, structshmid_kernel, shm_perm)
910  err等于security_shm_shmctl( & shm_perm, cmd)
911  如果err则转到:out_unlock1
915  :cmd恒等于move resource
916  ipc_lock_object( & shm_perm)
918  Called with shm_ids.rwsem (writer) and the shp structure locked.* Only shm_ids.rwsem remains locked on exit.
919  转到:out_up
920  :cmd恒等于set ipc_perm options
921  ipc_lock_object( & shm_perm)
922  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.
923  如果err则转到:out_unlock0
925  shm_ctim等于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.
926  退出
927  默认
928  err等于负EINVAL
929  转到:out_unlock1
932  out_unlock0 :
933  ipc_unlock_object( & shm_perm)
934  out_unlock1 :
935  _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()
936  out_up :
937  lease a write lock
938  返回:err
调用者
名称描述
ksys_shmctl
compat_ksys_shmctl