函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\ioprio.c Create Date:2022-07-27 18:59:14
Last Modify:2020-03-17 23:21:05 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:SYSCALL_DEFINE2

函数原型:SYSCALL_DEFINE2(ioprio_get, int, which, int, who)

返回类型:

参数:

192  ret等于负ESRCH
195  _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
197  :which恒等于IOPRIO_WHO_PROCESS
198  如果非whop等于当前进程
200  否则p等于find_task_by_vpid(who)
202  如果pret等于get_task_ioprio(p)
204  退出
205  :which恒等于IOPRIO_WHO_PGRP
206  如果非whopgrp等于Without tasklist or RCU lock it is not safe to dereference* the result of task_pgrp/task_session even if task == current,* we can race with another thread doing sys_setsid/sys_setpgid.
208  否则pgrp等于find_vpid(who)
210  循环
210  如果((pgrp) != NULL)则循环(({
210  循环(({}), (p) = ({
210  typeof(({typeof(( * ((struct hlist_node * * )( & ( & (pgrp)->进程属性列[PIDTYPE_PGID])->first))))________p1 = ({union{typeof(( * ((struct hlist_node * * )( & ( & (pgrp)->进程属性列[PIDTYPE_PGID])->first))))__val;char __c[1];}__u;if (1)__read_once_size( & (( * ((struct hlist_node * * )( & ( & (pgrp)->进程属性列[PIDTYPE_PGID])->first)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & (pgrp)->进程属性列[PIDTYPE_PGID])->first)))));否则 __read_once_size_nocheck( & (( * ((struct hlist_node * * )( & ( & (pgrp)->进程属性列[PIDTYPE_PGID])->first)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & (pgrp)->进程属性列[PIDTYPE_PGID])->first)))));循环{}while (0);__u.__val;});((typeof( * ( * ((struct hlist_node * * )( & ( & (pgrp)->进程属性列[PIDTYPE_PGID])->first)))) * )(________p1));}))____ptr = (({
210  typeof(( * ((struct hlist_node * * )( & ( & (pgrp)->进程属性列[PIDTYPE_PGID])->first))))________p1 = ({
210  union{typeof(( * ((structhlist_node * * )( & first)))) __val;char __c[1];}__u
210  如果1则__read_once_size( & (( * ((structhlist_node * * )( & first)))), __c, *first的长度)
210  否则__read_once_size_nocheck( & (( * ((structhlist_node * * )( & first)))), __c, *first的长度)
210  循环
210  当0循环
210  __val
210  })
210  }))
210  ____ptr ? ({
210  __mptr等于____ptr
210  循环
210  当0循环
210  __mptr__builtin_offsetof(typeof( * ((p))), pid_links[PIDTYPE_PGID])
210  }) : NULL
210  循环(({}), (p) = ({});(p);(p) = ({
210  typeof(({typeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next))))________p1 = ({union{typeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next))))__val;char __c[1];}__u;if (1)__read_once_size( & (( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))));否则 __read_once_size_nocheck( & (( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))));循环{}while (0);__u.__val;});((typeof( * ( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))) * )(________p1));}))____ptr = (({
210  typeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next))))________p1 = ({
210  union{typeof(( * ((structhlist_node * * )( & next)))) __val;char __c[1];}__u
210  如果1则__read_once_size( & (( * ((structhlist_node * * )( & next)))), __c, *next的长度)
210  否则__read_once_size_nocheck( & (( * ((structhlist_node * * )( & next)))), __c, *next的长度)
210  循环
210  当0循环
210  __val
210  })
210  }))
210  ____ptr ? ({
210  __mptr等于____ptr
210  循环
210  当0循环
210  __mptr__builtin_offsetof(typeof( * ((p))), pid_links[PIDTYPE_PGID])
210  }) : NULL
210  }))
210  tg___等于p
210  循环(({循环(({}), p = ({
210  void * __mptr = (void * )(({
210  union{typeof(next__val;char __c[1];}__u
210  如果1则__read_once_size( & (next), __c, next的长度)
210  否则__read_once_size_nocheck( & (next), __c, next的长度)
210  循环
210  当0循环
210  __val
210  }))
210  循环
210  当0循环
210  __mptr__builtin_offsetof(typeof( * p), thread_node)
210  循环(({}), p = ({}); & p->thread_node != ( & ((tg___)->signal)->thread_head);p = ({
210  void * __mptr = (void * )(({
210  union{typeof(next__val;char __c[1];}__u
210  如果1则__read_once_size( & (next), __c, next的长度)
210  否则__read_once_size_nocheck( & (next), __c, next的长度)
210  循环
210  当0循环
210  __val
210  }))
210  循环
210  当0循环
210  __mptr__builtin_offsetof(typeof( * p), thread_node)
210  }))
211  tmpio等于get_task_ioprio(p)
212  如果tmpio小于0则继续下一循环
214  如果ret恒等于负ESRCHret等于tmpio
216  否则ret等于ioprio_best(ret, tmpio)
218  p等于tg___
218  如果PIDTYPE_PGID恒等于PIDTYPE_PID退出
218  当0循环
219  退出
220  :which恒等于IOPRIO_WHO_USER
221  uid等于make_kuid - Map a user-namespace uid pair into a kuid
222  如果非whouser等于current_user()
224  否则user等于Locate the user_struct for the passed UID. If found, take a ref on it. The* caller must undo that ref with free_uid().* If the user_struct could not be found, return NULL.
227  如果非user退出
231  如果非uid_eq(task_uid(p), uid)或非task_pid_vnr(p)则继续下一循环
234  tmpio等于get_task_ioprio(p)
235  如果tmpio小于0则继续下一循环
237  如果ret恒等于负ESRCHret等于tmpio
239  否则ret等于ioprio_best(ret, tmpio)
243  如果whofree_uid(user)
245  退出
246  默认
247  ret等于负EINVAL
250  _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()
251  返回:ret