lkml.org 
[lkml]   [2002]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[1/2] privatize sibling functions from sched.h
This privatizes the sibling inlines to sched.c, the sole caller
of them.

include/linux/sched.h | 24 ------------------------
kernel/sched.c | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 24 deletions(-)


diff -urpN SRC_DIR/include/linux/sched.h siblings-2.5.48/include/linux/sched.h
--- SRC_DIR/include/linux/sched.h 2002-11-17 20:29:22.000000000 -0800
+++ siblings-2.5.48/include/linux/sched.h 2002-11-19 05:49:43.000000000 -0800
@@ -639,30 +639,6 @@ extern void kick_if_running(task_t * p);
add_parent(p, (p)->parent); \
} while (0)

-static inline struct task_struct *eldest_child(struct task_struct *p)
-{
- if (list_empty(&p->children)) return NULL;
- return list_entry(p->children.next,struct task_struct,sibling);
-}
-
-static inline struct task_struct *youngest_child(struct task_struct *p)
-{
- if (list_empty(&p->children)) return NULL;
- return list_entry(p->children.prev,struct task_struct,sibling);
-}
-
-static inline struct task_struct *older_sibling(struct task_struct *p)
-{
- if (p->sibling.prev==&p->parent->children) return NULL;
- return list_entry(p->sibling.prev,struct task_struct,sibling);
-}
-
-static inline struct task_struct *younger_sibling(struct task_struct *p)
-{
- if (p->sibling.next==&p->parent->children) return NULL;
- return list_entry(p->sibling.next,struct task_struct,sibling);
-}
-
#define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks)
#define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks)

diff -urpN SRC_DIR/kernel/sched.c siblings-2.5.48/kernel/sched.c
--- SRC_DIR/kernel/sched.c 2002-11-17 20:29:52.000000000 -0800
+++ siblings-2.5.48/kernel/sched.c 2002-11-19 05:49:43.000000000 -0800
@@ -1837,6 +1837,24 @@ out_unlock:
return retval;
}

+static inline struct task_struct *eldest_child(struct task_struct *p)
+{
+ if (list_empty(&p->children)) return NULL;
+ return list_entry(p->children.next,struct task_struct,sibling);
+}
+
+static inline struct task_struct *older_sibling(struct task_struct *p)
+{
+ if (p->sibling.prev==&p->parent->children) return NULL;
+ return list_entry(p->sibling.prev,struct task_struct,sibling);
+}
+
+static inline struct task_struct *younger_sibling(struct task_struct *p)
+{
+ if (p->sibling.next==&p->parent->children) return NULL;
+ return list_entry(p->sibling.next,struct task_struct,sibling);
+}
+
static void show_task(task_t * p)
{
unsigned long free = 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:31    [W:0.034 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site