函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:SYSCALL_DEFINE3

函数原型:SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)

返回类型:

参数:

102  ret等于ioprio_check_cap(ioprio)
103  如果ret则返回:ret
106  ret等于负ESRCH
107  _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
109  :which恒等于IOPRIO_WHO_PROCESS
110  如果非whop等于当前进程
112  否则p等于find_task_by_vpid(who)
114  如果pret等于set_task_ioprio(p, ioprio)
116  退出
117  :which恒等于IOPRIO_WHO_PGRP
118  如果非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.
120  否则pgrp等于find_vpid(who)
122  循环
122  如果((pgrp) != NULL)则循环(({
122  循环(({}), (p) = ({
122  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 = (({
122  typeof(( * ((struct hlist_node * * )( & ( & (pgrp)->进程属性列[PIDTYPE_PGID])->first))))________p1 = ({
122  union{typeof(( * ((structhlist_node * * )( & first)))) __val;char __c[1];}__u
122  如果1则__read_once_size( & (( * ((structhlist_node * * )( & first)))), __c, *first的长度)
122  否则__read_once_size_nocheck( & (( * ((structhlist_node * * )( & first)))), __c, *first的长度)
122  循环
122  当0循环
122  __val
122  })
122  }))
122  ____ptr ? ({
122  __mptr等于____ptr
122  循环
122  当0循环
122  __mptr__builtin_offsetof(typeof( * ((p))), pid_links[PIDTYPE_PGID])
122  }) : NULL
122  循环(({}), (p) = ({});(p);(p) = ({
122  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 = (({
122  typeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next))))________p1 = ({
122  union{typeof(( * ((structhlist_node * * )( & next)))) __val;char __c[1];}__u
122  如果1则__read_once_size( & (( * ((structhlist_node * * )( & next)))), __c, *next的长度)
122  否则__read_once_size_nocheck( & (( * ((structhlist_node * * )( & next)))), __c, *next的长度)
122  循环
122  当0循环
122  __val
122  })
122  }))
122  ____ptr ? ({
122  __mptr等于____ptr
122  循环
122  当0循环
122  __mptr__builtin_offsetof(typeof( * ((p))), pid_links[PIDTYPE_PGID])
122  }) : NULL
122  }))
122  tg___等于p
122  循环(({循环(({}), p = ({
122  void * __mptr = (void * )(({
122  union{typeof(next__val;char __c[1];}__u
122  如果1则__read_once_size( & (next), __c, next的长度)
122  否则__read_once_size_nocheck( & (next), __c, next的长度)
122  循环
122  当0循环
122  __val
122  }))
122  循环
122  当0循环
122  __mptr__builtin_offsetof(typeof( * p), thread_node)
122  循环(({}), p = ({}); & p->thread_node != ( & ((tg___)->signal)->thread_head);p = ({
122  void * __mptr = (void * )(({
122  union{typeof(next__val;char __c[1];}__u
122  如果1则__read_once_size( & (next), __c, next的长度)
122  否则__read_once_size_nocheck( & (next), __c, next的长度)
122  循环
122  当0循环
122  __val
122  }))
122  循环
122  当0循环
122  __mptr__builtin_offsetof(typeof( * p), thread_node)
122  }))
123  ret等于set_task_ioprio(p, ioprio)
124  如果ret退出
126  p等于tg___
126  如果PIDTYPE_PGID恒等于PIDTYPE_PID退出
126  当0循环
127  退出
128  :which恒等于IOPRIO_WHO_USER
129  uid等于make_kuid(current_user_ns(), who)
130  如果非uid_valid(uid)则退出
132  如果非whouser等于current_user()
134  否则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.
137  如果非user退出
141  如果非uid_eq(task_uid(p), uid)或非task_pid_vnr(p)则继续下一循环
144  ret等于set_task_ioprio(p, ioprio)
145  如果ret则转到:free_uid
148  free_uid :
149  如果whofree_uid(user)
151  退出
152  默认
153  ret等于负EINVAL
156  _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()
157  返回:ret