函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:d_alloc_undo - lookup (and if not present create) undo array*@ns: namespace*@semid: semaphore array id* The function looks up (and if not present creates) the undo structure.* The size of the undo structure depends on the size of the semaphore

函数原型:static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid)

返回类型:struct sem_undo

参数:

类型参数名称
struct ipc_namespace *ns
intsemid
1895  error等于If the task doesn't already have a undo_list, then allocate one* here. We guarantee there is only one thread using this undo list,* and current is THE ONE* If this allocation and assignment succeeds, but later
1896  如果error则返回:错误号
1899  _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
1900  加自旋锁
1901  un等于lookup_undo(ulp, semid)
1902  自旋锁解锁
1903  如果此条件成立可能性大(为编译器优化)(un != NULL)则转到:out
1908  sma等于sem_obtain_object_check(ns, semid)
1909  如果是错误
1910  _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()
1911  返回:错误指示
1914  nsems等于. of semaphores in array
1915  如果非ipc_rcu_getref( & permissions .. see ipc.h )则
1916  _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()
1917  un等于错误号
1918  转到:out
1920  _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()
1923  new等于分配内存并置零
1924  如果非new
1925  ipc_rcu_putref( & permissions .. see ipc.h , sem_rcu_free)
1926  返回:错误号
1930  _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
1931  sem_lock_and_putref(sma)
1932  如果非pc_valid_object() - helper to sort out IPC_RMID races for codepaths* where the respective ipc_ids.rwsem is not being held down.* Checks whether the ipc object is still around or if it's gone already, as
1933  sem_unlock(sma, - 1)
1934  _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()
1935  释放内存
1936  un等于错误号
1937  转到:out
1939  加自旋锁
1944  un等于lookup_undo(ulp, semid)
1945  如果un
1946  释放内存
1947  转到:success
1950  array of adjustments = (short * ) & new[1]
1951  ack ptr to sem_undo_list 等于ulp
1952  semaphore set identifier 等于semid
1953  assert_spin_locked( & lock)
1954  添加RCU保护项
1955  ipc_assert_locked_object( & permissions .. see ipc.h )
1956  添加链表项
1957  un等于new
1959  success :
1960  自旋锁解锁
1961  sem_unlock(sma, - 1)
1962  out :
1963  返回:un
调用者
名称描述
do_semtimedop