sched/core: Drop the unused try_get_task_struct() helper function
authorDavidlohr Bueso <dave@stgolabs.net>
Thu, 15 Jun 2017 02:37:30 +0000 (19:37 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 20 Jun 2017 10:48:37 +0000 (12:48 +0200)
This function was introduced by:

  150593bf8693 ("sched/api: Introduce task_rcu_dereference() and try_get_task_struct()")

... to allow easier usage of task_rcu_dereference(), however no users
were ever added. Drop the helper.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dave@stgolabs.net
Link: http://lkml.kernel.org/r/20170615023730.22827-1-dave@stgolabs.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/sched/task.h
kernel/exit.c

index a978d7189cfddd3f83cc15b68dd187a65068e816..f0f065c5afcfbf3affb2acb4803f14f10b92bcd6 100644 (file)
@@ -95,8 +95,6 @@ static inline void put_task_struct(struct task_struct *t)
 }
 
 struct task_struct *task_rcu_dereference(struct task_struct **ptask);
-struct task_struct *try_get_task_struct(struct task_struct **ptask);
-
 
 #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT
 extern int arch_task_struct_size __read_mostly;
index 7d694437ab443c41ee13775c5f480d14334f2262..c63226283aef8b541c081a6c978e55b355f48ab2 100644 (file)
@@ -318,19 +318,6 @@ void rcuwait_wake_up(struct rcuwait *w)
        rcu_read_unlock();
 }
 
-struct task_struct *try_get_task_struct(struct task_struct **ptask)
-{
-       struct task_struct *task;
-
-       rcu_read_lock();
-       task = task_rcu_dereference(ptask);
-       if (task)
-               get_task_struct(task);
-       rcu_read_unlock();
-
-       return task;
-}
-
 /*
  * Determine if a process group is "orphaned", according to the POSIX
  * definition in 2.2.2.52.  Orphaned process groups are not to be affected