projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'vfio-v3.18-rc1' of git://github.com/awilliam/linux-vfio
[firefly-linux-kernel-4.4.55.git]
/
mm
/
util.c
diff --git
a/mm/util.c
b/mm/util.c
index 093c973f1697dd39545c6c93aeac8e9c3d60cf52..fec39d4509a958763685fb6b70499590f9e363fb 100644
(file)
--- a/
mm/util.c
+++ b/
mm/util.c
@@
-170,32
+170,25
@@
static int vm_is_stack_for_task(struct task_struct *t,
/*
* Check if the vma is being used as a stack.
* If is_group is non-zero, check in the entire thread group or else
/*
* Check if the vma is being used as a stack.
* If is_group is non-zero, check in the entire thread group or else
- * just check in the current task. Returns the
pid of the task that
- * th
e vma is stack for
.
+ * just check in the current task. Returns the
task_struct of the task
+ * th
at the vma is stack for. Must be called under rcu_read_lock()
.
*/
*/
-
pid_t vm_is
_stack(struct task_struct *task,
-
struct vm_area_struct *vma, int
in_group)
+
struct task_struct *task_of
_stack(struct task_struct *task,
+
struct vm_area_struct *vma, bool
in_group)
{
{
- pid_t ret = 0;
-
if (vm_is_stack_for_task(task, vma))
if (vm_is_stack_for_task(task, vma))
- return task
->pid
;
+ return task;
if (in_group) {
struct task_struct *t;
if (in_group) {
struct task_struct *t;
- rcu_read_lock();
for_each_thread(task, t) {
for_each_thread(task, t) {
- if (vm_is_stack_for_task(t, vma)) {
- ret = t->pid;
- goto done;
- }
+ if (vm_is_stack_for_task(t, vma))
+ return t;
}
}
-done:
- rcu_read_unlock();
}
}
- return
ret
;
+ return
NULL
;
}
#if defined(CONFIG_MMU) && !defined(HAVE_ARCH_PICK_MMAP_LAYOUT)
}
#if defined(CONFIG_MMU) && !defined(HAVE_ARCH_PICK_MMAP_LAYOUT)