Plist name space cleanup
Subsystems (4)
PATCH 2/2 Plist name space cleanup
Gives the structs, and plist_empty more consistent names.
Also updates with Oleg's comments.
This patch goes on top of the docs patch .
Signed-off-by Daniel Walker <[email protected]>
include/linux/plist.h +31 -31
@@ -77,64 +77,64 @@#include <linux/list.h> -struct pl_head { +struct plist_head {struct list_head prio_list;struct list_head node_list; }; -struct pl_node { -int prio; -struct pl_head plist; +struct plist_node { +int prio; +struct plist_head plist; };/** -* #PL_HEAD_INIT - static struct pl_head initializer +* #PLIST_HEAD_INIT - static struct plist_head initializer * -* @head: struct pl_head variable name +* @head: struct plist_head variable name */ -#define PL_HEAD_INIT (head) \ +#define PLIST_HEAD_INIT (head) \ { \ .prio_list = LIST_HEAD_INIT((head).prio_list), \ .node_list = LIST_HEAD_INIT((head).node_list), \ }/** -* #PL_NODE_INIT - static struct pl_node initializer +* #PLIST_NODE_INIT - static struct plist_node initializer * -* @node: struct pl_node variable name +* @node: struct plist_node variable name * @__prio: initial node priority */ -#define PL_NODE_INIT (node, __prio) \ +#define PLIST_NODE_INIT (node, __prio) \ { \ .prio = (__prio), \ - .plist = PL_HEAD_INIT((node).plist), \ + .plist = PLIST_HEAD_INIT((node).plist), \ }/** -* pl_head_init - dynamic struct pl_head initializer +* plist_head_init - dynamic struct plist_head initializer * -* @head: &struct pl_head pointer +* @head: &struct plist_head pointer */ -static inline void pl_head_init (struct pl_head *head) +static inline void plist_head_init (struct plist_head *head) {INIT_LIST_HEAD (&head->prio_list);INIT_LIST_HEAD (&head->node_list); }/** -* pl_node_init - Dynamic struct pl_node initializer +* plist_node_init - Dynamic struct plist_node initializer * -* @node: &struct pl_node pointer +* @node: &struct plist_node pointer * @prio: initial node priority */ -static inline void pl_node_init (struct pl_node *node,int prio) +static inline void plist_node_init (struct plist_node *node,int prio) { node->prio = prio; -pl_head_init (&node->plist); +plist_head_init (&node->plist); } -extern void plist_add (struct pl_node *node,struct pl_head *head); -extern void plist_del (struct pl_node *node); +extern void plist_add (struct plist_node *node,struct plist_head *head); +extern void plist_del (struct plist_node *node);/** * plist_for_each - iterate over the plist
@@ -179,31 +179,31 @@ extern void plist_del(struct pl_node *nolist_for_each_entry_safe (pos, n, &(head)->node_list, mem.plist.node_list)/** -* plist_empty - return !0 if a plist_head is empty +* plist_head_empty - return !0 if a plist_head is empty * -* @head: &struct pl_head pointer +* @head: &struct plist_head pointer */ -static inline int plist_empty(const struct pl_head *head) +static inline int plist_head_empty(const struct plist_head *head) {return list_empty (&head->node_list); }/** -* plist_unhashed - return !0 if plist_node is not on a list +* plist_node_empty - return !0 if plist_node is not on a list * -* @node: &struct pl_node pointer +* @node: &struct plist_node pointer */ -static inline int plist_unhashed (const struct pl_node *node) +static inline int plist_node_empty (const struct plist_node *node) {return list_empty (&node->plist.node_list); } -/* All functions below assume the pl_head is not empty. */ +/* All functions below assume the plist_head is not empty. */ /** * plist_first_entry - get the struct for the first entry * -* @ptr: the &struct pl_head pointer. +* @ptr: the &struct plist_head pointer. * @type: the type of the struct this is embedded in. * @member: the name of the list_struct within the struct. */
@@ -213,13 +213,13 @@ static inline int plist_unhashed(const s/** * plist_first - return the first node (and thus, highest priority) * -* @head: the &struct pl_head pointer +* @head: the &struct plist_head pointer * * Assumes the plist is _not_ empty. */ -static inline struct pl_node *plist_first (const struct pl_head *head) +static inline struct plist_node *plist_first (const struct plist_head *head) { - return list_entry(head->node_list.next, struct pl_node, plist.node_list); + return list_entry(head->node_list.next, struct plist_node, plist.node_list); }#endif
include/linux/sched.h +1 -1
@@ -1026,7 +1026,7 @@ struct task_struct {#endif /* realtime bits */ struct list_head delayed_put; -struct pl_head pi_waiters; +struct plist_head pi_waiters;/* RT deadlock detection and priority inheritance handling */ struct rt_mutex_waiter *blocked_on;
kernel/fork.c +1 -1
@@ -1027,7 +1027,7 @@ static task_t *copy_process(unsigned lon#endif INIT_LIST_HEAD (&p->delayed_put);preempt_disable (); -pl_head_init (&p->pi_waiters); +plist_head_init (&p->pi_waiters);preempt_enable (); p->blocked_on =NULL ;/* not blocked yet */ spin_lock_init (&p->pi_lock);
lib/plist.c +8 -8
@@ -24,12 +24,12 @@* plist_add - add @node to @head returns !0 if the plist prio changed, 0 * otherwise. XXX: Fix return code. * -* @node: &struct pl_node pointer -* @head: &struct pl_head pointer +* @node: &struct plist_node pointer +* @head: &struct plist_head pointer */ -void plist_add (struct pl_node *node,struct pl_head *head) +void plist_add (struct plist_node *node,struct plist_head *head) { -struct pl_node *iter; +struct plist_node *iter;INIT_LIST_HEAD (&node->plist.prio_list);
@@ -38,7 +38,7 @@ void plist_add(struct pl_node *node, str goto lt_prio; else if (node->prio == iter->prio) { iter =list_entry (iter->plist.prio_list.next, - struct pl_node, plist.prio_list); + struct plist_node, plist.prio_list); goto eq_prio; }
@@ -52,12 +52,12 @@ eq_prio:* plist_del - Remove a @node from plist. returns !0 if the plist prio * changed, 0 otherwise. XXX: Fix return code. * -* @node: &struct pl_node pointer +* @node: &struct plist_node pointer */ -void plist_del (struct pl_node *node) +void plist_del (struct plist_node *node) {if (!list_empty (&node->plist.prio_list)) { -struct pl_node *next =plist_first (&node->plist); +struct plist_node *next =plist_first (&node->plist);list_move_tail (&next->plist.prio_list, &node->plist.prio_list);list_del_init (&node->plist.prio_list); }
include/linux/init_task.h +1 -1
@@ -121,7 +121,7 @@ extern struct group_info init_groups; .alloc_lock = SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ .proc_lock = SPIN_LOCK_UNLOCKED(tsk.proc_lock), \ .delayed_put = LIST_HEAD_INIT(tsk.delayed_put), \ - .pi_waiters = PL_HEAD_INIT(tsk.pi_waiters), \ + .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \ .pi_lock = RAW_SPIN_LOCK_UNLOCKED, \ .journal_info = NULL, \ .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
kernel/rt.c +28 -28
201 lines not on this page · raw message
include/linux/rt_lock.h +4 -4
@@ -24,7 +24,7 @@*/ struct rt_mutex {raw_spinlock_t wait_lock; -struct pl_head wait_list; +struct plist_head wait_list;struct thread_info *owner;# ifdef CONFIG_DEBUG_RT_LOCKING_MODE raw_spinlock_t debug_slock;
@@ -49,8 +49,8 @@ struct rt_mutex {*/ struct rt_mutex_waiter {struct rt_mutex *lock; -struct pl_node list; -struct pl_node pi_list; +struct plist_node list; +struct plist_node pi_list;struct thread_info *ti;#ifdef CONFIG_DEBUG_DEADLOCKS unsigned long eip;
@@ -87,7 +87,7 @@ struct rt_mutex_waiter {# define __PLIST_INIT (lockname)#else # define __PLIST_INIT (lockname) \ - , .wait_list = PL_HEAD_INIT((lockname).wait_list) + , .wait_list = PLIST_HEAD_INIT((lockname).wait_list)#endif #define __RT_MUTEX_INITIALIZER (lockname) \