Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\ioprio.c Create Date:2022-07-28 17:23:53
Last Modify:2020-03-17 23:21:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:SYSCALL_DEFINE2

Proto:SYSCALL_DEFINE2(ioprio_get, int, which, int, who)

Type:

Parameter:Nothing

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  Case which == IOPRIO_WHO_PROCESS
198  If Not who Then p = current process
200  Else p = find_task_by_vpid(who)
202  If p Then ret = get_task_ioprio(p)
204  Break
205  Case which == IOPRIO_WHO_PGRP
206  If Not who Then pgrp = 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  Else pgrp = find_vpid(who)
210  Do
210  If ((pgrp) != NULL) Then cycle (({
210  cycle (({}), (p) = ({
210  typeof(({typeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first))))________p1 = ({union{typeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first))))__val;char __c[1];}__u;if (1)__read_once_size( & (( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))));Else  __read_once_size_nocheck( & (( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))));Do{}while (0);__u.__val;});((typeof( * ( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))) * )(________p1));}))____ptr = (({
210  typeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first))))________p1 = ({
210  union{typeof(( * ((structhlist_node * * )( & first)))) __val;char __c[1];}__u
210  If 1 Then __read_once_size( & (( * ((structhlist_node * * )( & first)))), __c, size of *first )
210  Else __read_once_size_nocheck( & (( * ((structhlist_node * * )( & first)))), __c, size of *first )
210  Do
210  When 0 cycle
210  __val
210  })
210  }))
210  ____ptr ? ({
210  __mptr = ____ptr
210  Do
210  When 0 cycle
210  __mptr - __builtin_offsetof(typeof( * ((p))), pid_links[PIDTYPE_PGID])
210  }) : NULL
210  cycle (({}), (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)))));Else  __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)))));Do{}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  If 1 Then __read_once_size( & (( * ((structhlist_node * * )( & next)))), __c, size of *next )
210  Else __read_once_size_nocheck( & (( * ((structhlist_node * * )( & next)))), __c, size of *next )
210  Do
210  When 0 cycle
210  __val
210  })
210  }))
210  ____ptr ? ({
210  __mptr = ____ptr
210  Do
210  When 0 cycle
210  __mptr - __builtin_offsetof(typeof( * ((p))), pid_links[PIDTYPE_PGID])
210  }) : NULL
210  }))
210  tg___ = p
210  cycle (({cycle (({}), p = ({
210  void * __mptr = (void * )(({
210  union{typeof(next__val;char __c[1];}__u
210  If 1 Then __read_once_size( & (next), __c, size of next )
210  Else __read_once_size_nocheck( & (next), __c, size of next )
210  Do
210  When 0 cycle
210  __val
210  }))
210  Do
210  When 0 cycle
210  __mptr - __builtin_offsetof(typeof( * p), thread_node)
210  cycle (({}), p = ({}); & p->thread_node != ( & ((tg___)->signal)->thread_head);p = ({
210  void * __mptr = (void * )(({
210  union{typeof(next__val;char __c[1];}__u
210  If 1 Then __read_once_size( & (next), __c, size of next )
210  Else __read_once_size_nocheck( & (next), __c, size of next )
210  Do
210  When 0 cycle
210  __val
210  }))
210  Do
210  When 0 cycle
210  __mptr - __builtin_offsetof(typeof( * p), thread_node)
210  }))
212  If tmpio < 0 Then Continue
214  If ret == -ESRCH Then ret = tmpio
216  Else ret = ioprio_best(ret, tmpio)
218  p = tg___
218  If PIDTYPE_PGID == PIDTYPE_PID Then Break
218  When 0 cycle
219  Break
220  Case which == IOPRIO_WHO_USER
221  uid = make_kuid - Map a user-namespace uid pair into a kuid
222  If Not who Then user = current_user()
224  Else 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  If Not user Then Break
231  If Not uid_eq(task_uid(p), uid) || Not task_pid_vnr(p) Then Continue
235  If tmpio < 0 Then Continue
237  If ret == -ESRCH Then ret = tmpio
239  Else ret = ioprio_best(ret, tmpio)
243  If who Then free_uid(user)
245  Break
246  Default
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  Return ret