OpenVZ Forum - RDF feed
type: channel
items: [PATCH 0/12] tty layer and misc struct pid conversions
items: [PATCH 1/12] tty: Make __proc_set_tty static.
items: [PATCH 2/12] tty: Clarify disassociate_ctty
items: [PATCH 3/12] tty: Fix the locking for signal->session in disassociate_ctty
items: [PATCH 4/12] signal: Use kill_pgrp not kill_pg in the sunos compatibility code.
items: [PATCH 5/12] signal: Rewrite kill_something_info so it uses newer helpers.
items: [PATCH 6/12] pid: Make session_of_pgrp use struct pid instead of pid_t.
items: [PATCH 7/12] pid: Use struct pid for talking about process groups in exit.c
items: [PATCH 8/12] pid: Replace is_orphaned_pgrp with is_current_pgrp_orphaned
items: [PATCH 9/12] tty: Update the tty layer to work with struct pid.
items: [PATCH 10/12] pid: Replace do/while_each_task_pid with do/while_each_pid_task
items: [PATCH 11/12] pid: Remove now unused do_each_task_pid and while_each_task_pid
items: [PATCH 12/12] pid: Remove the now unused kill_pg kill_pg_info and __kill_pg_info
items: Re: [PATCH 0/12] tty layer and misc struct pid conversions

[PATCH 0/12] tty layer and misc struct pid conversions
type: item
description: The aim of this patch set is to start wrapping up the struct pid conversions. As such this patchset culminates with the removal of kill_pg, kill_pg_info, __kill_pg_info, do_each_task_pid, and while_each_task_pid. kill_proc, daemonize, and kernel_thread are still in my sights but there is still work to get to them. The first three are basic cleanups around disassociate_ctty, while working on converting it I found several issues. tty_old_pgrp can be a tricky concept to wrap your head around. 1 tty: Make __proc_set_tty static. 2 tty: Clarify disassociate_ctty 3 tty: Fix the locking for signal->session in disassociate_ctty These just stop using the old helper functions. 4 signal: Use kill_pgrp not kill_pg in the sunos compatibility code. 5 signal: Rewrite kill_something_info so it uses newer helpers. Then the grind to convert the tty layer and all of it's helper functions to struct pid. 6 pid: Make session_of_pgrp use struct pid instead of pid_t. 7 pid: Use struct pid for talking about process groups in exit.c 8 pid: Replace is_orphaned_pgrp with is_current_pgrp_orphaned 9 tty: Update the tty layer to work with struct pid. A final helper function update. 10 pid: Replace do/while_each_task_pid with do/while_each_pid_task And the removal of the functions that are now unused. 11 pid: Remove now unused do_each_task_pid and while_each_task_pid 12 pid: Remove the now unused kill_pg kill_pg_info and __kill_pg_info All of these should be fairly simple and to the point. Eric _______________________________________________ Containers mailing list Containers@lists.osdl.org https://lists.osdl.org/mailman/listinfo/containers
creator: ebiederm
date: 2006-12-13T11:03:39-00:00

[PATCH 1/12] tty: Make __proc_set_tty static.
type: item
description: Currently all users of __proc_set_tty are in tty_io.c so make the function static. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- drivers/char/tty_io.c | 3 ++- include/linux/tty.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index a333881..bb09e4a 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -155,6 +155,7 @@ int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); static int tty_fasync(int fd, struct file * filp, int on); static void release_mem(struct tty_struct *tty, int idx); +static void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); /** * alloc_tty_struct - allocate a tty object @@ -3796,7 +3797,7 @@ void proc_clear_tty(struct task_struct *p) } EXPORT_SYMBOL(proc_clear_tty); -void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) +static void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) { if (tty) { tty->session = process_session(tsk); diff --git a/include/linux/tty.h b/include/linux/tty.h index 0161a8c..1185bca 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -313,7 +313,6 @@ extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, extern dev_t tty_devnum(struct tty_struct *tty); extern void proc_clear_tty(struct task_struct *p); -extern void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); extern void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); extern struct tty_struct *get_current_tty(void); -- 1.4.4.1.g278f _______________________________________________ Containers mailing list Containers@lists.osdl.org https://lists.osdl.org/mailman/listinfo/containers
creator: ebiederm
date: 2006-12-13T11:07:45-00:00

[PATCH 2/12] tty: Clarify disassociate_ctty
type: item
description: The code to look at tty_old_pgrp and send SIGHUP and SIGCONT when it is present only executes when disassociate_ctty is called from do_exit. Make this clear by adding an explict on_exit check, and explicitly setting tty_old_pgrp to 0. In addition fix the locking by reading tty_old_pgrp under the siglock. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- drivers/char/tty_io.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index bb09e4a..acb2f5d 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1508,8 +1508,12 @@ void disassociate_ctty(int on_exit) /* XXX: here we race, there is nothing protecting tty */ if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY) tty_vhangup(tty); - } else { - pid_t old_pgrp = current->signal->tty_old_pgrp; + } else if (on_exit) { + pid_t old_pgrp; + spin_lock_irq(&current->sighand->siglock); + old_pgrp = current->signal->tty_old_pgrp; + current->signal->tty_old_pgrp = 0; + spin_unlock_irq(&current->sighand->siglock); if (old_pgrp) { kill_pg(old_pgrp, SIGHUP, on_exit); kill_pg(old_pgrp, SIGCONT, on_exit); -- 1.4.4.1.g278f _______________________________________________ Containers mailing list Containers@lists.osdl.org https://lists.osdl.org/mailman/listinfo/containers
creator: ebiederm
date: 2006-12-13T11:07:46-00:00

[PATCH 3/12] tty: Fix the locking for signal->session in disassociate_ctty
type: item
description: commit 24ec839c431eb79bb8f6abc00c4e1eb3b8c4d517 while fixing the locking for signal->tty got the locking wrong for signal->session. This places our accesses of signal->session back under the tasklist_lock where they belong. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- drivers/char/tty_io.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index acb2f5d..628925e 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1496,7 +1496,6 @@ void disassociate_ctty(int on_exit) { struct tty_struct *tty; int tty_pgrp = -1; - int session; lock_kernel(); @@ -1530,7 +1529,6 @@ void disassociate_ctty(int on_exit) spin_lock_irq(&current->sighand->siglock); current->signal->tty_old_pgrp = 0; - session = process_session(current); spin_unlock_irq(&current->sighand->siglock); mutex_lock(&tty_mutex); @@ -1549,7 +1547,7 @@ void disassociate_ctty(int on_exit) /* Now clear signal->tty under the lock */ read_lock(&tasklist_lock); - session_clear_tty(session); + session_clear_tty(process_session(current)); read_unlock(&tasklist_lock); unlock_kernel(); } -- 1.4.4.1.g278f _______________________________________________ Containers mailing list Containers@lists.osdl.org https://lists.osdl.org/mailman/listinfo/containers
creator: ebiederm
date: 2006-12-13T11:07:47-00:00

[PATCH 4/12] signal: Use kill_pgrp not kill_pg in the sunos compatibility code.
type: item
description: I am slowly moving to a model where all process killing is struct pid based instead of pid_t based. The sunos compatibility code is one of the last users of the old pid_t based kill_pg in the kernel. By being complete I allow for the future removal of kill_pg from the kernel, which will ensure I don't miss something. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- arch/sparc/kernel/sys_sunos.c | 10 ++++++---- arch/sparc64/kernel/sys_sunos32.c | 11 +++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c index 0bf8c16..da6606f 100644 --- a/arch/sparc/kernel/sys_sunos.c +++ b/arch/sparc/kernel/sys_sunos.c @@ -859,14 +859,16 @@ asmlinkage int sunos_wait4(pid_t pid, unsigned int __user *stat_addr, return ret; } -extern int kill_pg(int, int, int); asmlinkage int sunos_killpg(int pgrp, int sig) { int ret; - lock_kernel(); - ret = kill_pg(pgrp, sig, 0); - unlock_kernel(); + rcu_read_lock(); + ret = -EINVAL; + if (pgrp > 0) + ret = kill_pgrp(find_pid(pgrp), sig, 0); + rcu_read_unlock(); + return ret; } diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index 4446f66..d9280b1 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c @@ -824,10 +824,17 @@ asmlinkage int sunos_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, in return ret; } -extern int kill_pg(int, int, int); asmlinkage int sunos_killpg(int pgrp, int sig) { - return kill_pg(pgrp, sig, 0); + int ret; + + rcu_read_lock(); + ret = -EINVAL; + if (pgrp > 0) + ret = kill_pgrp(find_pid(pgrp), sig, 0); + rcu_read_unlock(); + + return ret; } asmlinkage int sunos_audit(void) -- 1.4.4.1.g278f _______________________________________________ Containers mailing list Containers@lists.osdl.org https://lists.osdl.org/mailman/listinfo/containers
creator: ebiederm
date: 2006-12-13T11:07:48-00:00

[PATCH 5/12] signal: Rewrite kill_something_info so it uses newer helpers.
type: item
description: The goal is to remove users of the old signal helper functions so they can be removed. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- kernel/signal.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c index 1921ffd..1e34d32 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1192,8 +1192,10 @@ EXPORT_SYMBOL_GPL(kill_pid_info_as_uid); static int kill_something_info(int sig, struct siginfo *info, int pid) { + int ret; + rcu_read_lock(); if (!pid) { - return kill_pg_info(sig, info, process_group(current)); + ret = kill_pgrp_info(sig, info, task_pgrp(current)); } else if (pid == -1) { int retval = 0, count = 0; struct task_struct * p; @@ -1208,12 +1210,14 @@ static int kill_something_info(int sig, struct siginfo *info, int pid) } } read_unlock(&tasklist_lock); - return count ? retval : -ESRCH; + ret = count ? retval : -ESRCH; } else if (pid < 0) { - return kill_pg_info(sig, info, -pid); + ret = kill_pgrp_info(sig, info, find_pid(-pid)); } else { - return kill_proc_info(sig, info, pid); + ret = kill_pid_info(sig, info, find_pid(pid)); } + rcu_read_unlock(); + return ret; } /* -- 1.4.4.1.g278f _______________________________________________ Containers mailing list Containers@lists.osdl.org https://lists.osdl.org/mailman/listinfo/containers
creator: ebiederm
date: 2006-12-13T11:07:49-00:00

[PATCH 6/12] pid: Make session_of_pgrp use struct pid instead of pid_t.
type: item
description: To properly implement a pid namespace I need to deal exclusively in terms of struct pid, because pid_t values become ambiguous. To this end session_of_pgrp is transformed to take and return a struct pid pointer. To avoid the need to worry about reference counting I now require my caller to hold the appropriate locks. Leaving callers repsonsible for increasing the reference count if they need access to the result outside of the locks. Since session_of_pgrp currently only has one caller and that caller simply uses only test the result for equality with another process group, the locking change means I don't actually have to acquire the tasklist_lock at all. tiocspgrp is also modified to take and release the lock. The logic there is a little more complicated but nothing I won't need when I convert pgrp of a tty to a struct pid pointer. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- drivers/char/tty_io.c | 24 +++++++++++++++++------- include/linux/kernel.h | 3 ++- kernel/exit.c | 16 +++++++--------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 628925e..74f078a 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -2990,7 +2990,8 @@ static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p) { - pid_t pgrp; + struct pid *pgrp; + pid_t pgrp_nr; int retval = tty_check_change(real_tty); if (retval == -EIO) @@ -3001,14 +3002,23 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t (current->signal->tty != real_tty) || (real_tty->session != process_session(current))) return -ENOTTY; - if (get_user(pgrp, p)) + if (get_user(pgrp_nr, p)) return -EFAULT; - if (pgrp < 0) + if (pgrp_nr < 0) return -EINVAL; - if (session_of_pgrp(pgrp) != process_session(current)) - return -EPERM; - real_tty->pgrp = pgrp; - return 0; + rcu_read_lock(); + pgrp = find_p…
creator: ebiederm
date: 2006-12-13T11:07:50-00:00

[PATCH 7/12] pid: Use struct pid for talking about process groups in exit.c
type: item
description: Modify has_stopped_jobs and will_become_orphan_pgrp to use struct pid based process groups. This reduces the number of hash tables looks ups and paves the way for multiple pid spaces. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- kernel/exit.c | 42 ++++++++++++++++++++++-------------------- 1 files changed, 22 insertions(+), 20 deletions(-) diff --git a/kernel/exit.c b/kernel/exit.c index 97117e7..5f8455e 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -210,22 +210,22 @@ struct pid *session_of_pgrp(struct pid *pgrp) * * "I ask you, have you ever known what it is to be an orphan?" */ -static int will_become_orphaned_pgrp(int pgrp, struct task_struct *ignored_task) +static int will_become_orphaned_pgrp(struct pid *pgrp, struct task_struct *ignored_task) { struct task_struct *p; int ret = 1; - do_each_task_pid(pgrp, PIDTYPE_PGID, p) { + do_each_pid_task(pgrp, PIDTYPE_PGID, p) { if (p == ignored_task || p->exit_state || is_init(p->real_parent)) continue; - if (process_group(p->real_parent) != pgrp && - process_session(p->real_parent) == process_session(p)) { + if (task_pgrp(p->real_parent) != pgrp && + task_session(p->real_parent) == task_session(p)) { ret = 0; break; } - } while_each_task_pid(pgrp, PIDTYPE_PGID, p); + } while_each_pid_task(pgrp, PIDTYPE_PGID, p); return ret; /* (sighing) "Often!" */ } @@ -234,23 +234,23 @@ int is_orphaned_pgrp(int pgrp) int retval; read_lock(&tasklist_lock); - retval = will_become_orphaned_pgrp(pgrp, NULL); + retval = will_become_orphaned_pgrp(find_pid(pgrp), NULL); read_unlock(&tasklist_lock); return retval; } -static int has_stopped_jobs(int pgrp) +static int has_stopped_jobs(struct pid *pgrp) { int retval = 0; struct task_struct *p; - do_each_task_pid(pgrp, PIDTYPE_PGID, p) { + do_each_pid_task(pgrp, PIDTYPE_PGID, p) { if (p->state != TASK_STOPPED) continue; retval = 1; break; - } while_each_task_pid(pgrp, PIDTYPE_PGID, p); + } while_each_pid_task(pgrp, PIDTYPE_PGID, p); return retval; } @@ -640,14 +640,14 @@ repare…
creator: ebiederm
date: 2006-12-13T11:07:51-00:00

[PATCH 8/12] pid: Replace is_orphaned_pgrp with is_current_pgrp_orphaned
type: item
description: Every call to is_orphaned_pgrp passed in process_group(current) which is racy with respect to another thread changing our process group. It didn't bite us because we were dealing with integers and the worse we would get would be a stale answer. In switching the checks to use struct pid to be a little more efficient and prepare the way for pid namespaces this race became apparent. So I simplified the calls to the more specialized is_current_pgrp_orphaned so I didn't have to worry about making logic changes to avoid the race. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- drivers/char/n_tty.c | 2 +- drivers/char/tty_io.c | 2 +- include/linux/tty.h | 2 +- kernel/exit.c | 4 ++-- kernel/signal.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index e96a00f..7f1ded8 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -1189,7 +1189,7 @@ static int job_control(struct tty_struct *tty, struct file *file) printk("read_chan: tty->pgrp <= 0!\n"); else if (process_group(current) != tty->pgrp) { if (is_ignored(SIGTTIN) || - is_orphaned_pgrp(process_group(current))) + is_current_pgrp_orphaned()) return -EIO; kill_pg(process_group(current), SIGTTIN, 1); return -ERESTARTSYS; diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 74f078a..d8fdf45 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1118,7 +1118,7 @@ int tty_check_change(struct tty_struct * tty) return 0; if (is_ignored(SIGTTOU)) return 0; - if (is_orphaned_pgrp(process_group(current))) + if (is_current_pgrp_orphaned()) return -EIO; (void) kill_pg(process_group(current), SIGTTOU, 1); return -ERESTARTSYS; diff --git a/include/linux/tty.h b/include/linux/tty.h index 1185bca..13a4918 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -283,7 +283,7 @@ extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, int buflen); extern void tty_write_message(struct tty_struct *tty, char *msg…
creator: ebiederm
date: 2006-12-13T11:07:52-00:00

[PATCH 9/12] tty: Update the tty layer to work with struct pid.
type: item
description: Of kernel subsystems that work with pids the tty layer is probably the largest consumer. But it has the nice virtue that the assiation with a session only lasts until the session leader exits. Which means that no reference counting is required. So using struct pid winds up being a simple optimization to avoid hash table lookups. In the long term the use of pid_nr also ensures that when we have multiple pid spaces mixed everything will work correctly. Signed-off-by: Eric W. Biederman <eric@maxwell.lnxi.com> --- arch/um/drivers/line.c | 2 +- drivers/char/ip2/ip2main.c | 4 +- drivers/char/n_tty.c | 12 ++-- drivers/char/tty_io.c | 129 ++++++++++++++++++++++++++----------------- drivers/char/vt.c | 4 +- fs/proc/array.c | 2 +- include/linux/init_task.h | 2 +- include/linux/sched.h | 2 +- include/linux/tty.h | 4 +- kernel/fork.c | 2 +- kernel/sys.c | 1 - 11 files changed, 95 insertions(+), 69 deletions(-) diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 83301e1..3c1a1d4 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -737,7 +737,7 @@ static irqreturn_t winch_interrupt(int irq, void *data) line = tty->driver_data; chan_window_size(&line->chan_list, &tty->winsize.ws_row, &tty->winsize.ws_col); - kill_pg(tty->pgrp, SIGWINCH, 1); + kill_pgrp(tty->pgrp, SIGWINCH, 1); } out: if(winch->fd != -1) diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index 7c70310..83c7258 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c @@ -1271,8 +1271,8 @@ static void do_input(struct work_struct *work) // code duplicated from n_tty (ldisc) static inline void isig(int sig, struct tty_struct *tty, int flush) { - if (tty->pgrp > 0) - kill_pg(tty->pgrp, sig, 1); + if (tty->pgrp) + kill_pgrp(tty->pgrp, sig, 1); if (flush || !L_NOFLSH(tty)) { if ( tty->ldisc.flush_buffer ) tty->ldisc.flush_buffer(tty); diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index 7f1ded8..2b50a50 100644 --- a/drivers/char/n_tty.c +++ b/drive…
creator: ebiederm
date: 2006-12-13T11:07:53-00:00

[PATCH 10/12] pid: Replace do/while_each_task_pid with do/while_each_pid_task
type: item
description: There isn't any real advantage to this change except that it allows the old functions to be removed. Which is easier on maintenance and puts the code in a more uniform style. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- fs/ioprio.c | 18 ++++++++++++------ kernel/capability.c | 8 +++++--- kernel/sys.c | 40 ++++++++++++++++++++++++---------------- 3 files changed, 41 insertions(+), 25 deletions(-) diff --git a/fs/ioprio.c b/fs/ioprio.c index 89e8da1..10d2c21 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c @@ -60,6 +60,7 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio) int data = IOPRIO_PRIO_DATA(ioprio); struct task_struct *p, *g; struct user_struct *user; + struct pid *pgrp; int ret; switch (class) { @@ -98,12 +99,14 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio) break; case IOPRIO_WHO_PGRP: if (!who) - who = process_group(current); - do_each_task_pid(who, PIDTYPE_PGID, p) { + pgrp = task_pgrp(current); + else + pgrp = find_pid(who); + do_each_pid_task(pgrp, PIDTYPE_PGID, p) { ret = set_task_ioprio(p, ioprio); if (ret) break; - } while_each_task_pid(who, PIDTYPE_PGID, p); + } while_each_pid_task(pgrp, PIDTYPE_PGID, p); break; case IOPRIO_WHO_USER: if (!who) @@ -167,6 +170,7 @@ asmlinkage long sys_ioprio_get(int which, int who) { struct task_struct *g, *p; struct user_struct *user; + struct pid *pgrp; int ret = -ESRCH; int tmpio; @@ -182,8 +186,10 @@ asmlinkage long sys_ioprio_get(int which, int who) break; case IOPRIO_WHO_PGRP: if (!who) - who = process_group(current); - do_each_task_pid(who, PIDTYPE_PGID, p) { + pgrp = task_pgrp(current); + else + pgrp = find_pid(who); + do_each_pid_task(pgrp, PIDTYPE_PGID, p) { tmpio = get_task_ioprio(p); if (tmpio < 0) continue; @@ -191,7 +197,7 @@ asmlinkage long sys_ioprio_get(int which, int who) ret = tmpio; else ret = ioprio_best(ret, tmpio); - } while_each_task_pid(who, PIDTYPE_PGID, p); + } while_each_pid_task(pgrp, PIDTYPE_PGID, p); break; case IOPRIO_WHO_USER: if (!who) diff -…
creator: ebiederm
date: 2006-12-13T11:07:54-00:00

[PATCH 11/12] pid: Remove now unused do_each_task_pid and while_each_task_pid
type: item
description: Now that I have changed all of the users remove the old version of these functions. This should be a clear hint to any out of tree users that they should use do_each_pid_task and while_each_pid_task for new code. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- include/linux/pid.h | 14 -------------- 1 files changed, 0 insertions(+), 14 deletions(-) diff --git a/include/linux/pid.h b/include/linux/pid.h index 4dec047..2ac27f9 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -105,20 +105,6 @@ static inline pid_t pid_nr(struct pid *pid) return nr; } - -#define do_each_task_pid(who, type, task) \ - do { \ - struct hlist_node *pos___; \ - struct pid *pid___ = find_pid(who); \ - if (pid___ != NULL) \ - hlist_for_each_entry_rcu((task), pos___, \ - &pid___->tasks[type], pids[type].node) { - -#define while_each_task_pid(who, type, task) \ - } \ - } while (0) - - #define do_each_pid_task(pid, type, task) \ do { \ struct hlist_node *pos___; \ -- 1.4.4.1.g278f _______________________________________________ Containers mailing list Containers@lists.osdl.org https://lists.osdl.org/mailman/listinfo/containers
creator: ebiederm
date: 2006-12-13T11:07:55-00:00

[PATCH 12/12] pid: Remove the now unused kill_pg kill_pg_info and __kill_pg_info
type: item
description: Now that I have changed all of the in-tree users remove the old version of these functions. This should make it clear to any out of tree users that they should be using kill_pgrp kill_pgrp_info or __kill_pgrp_info instead. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- include/linux/sched.h | 3 --- kernel/signal.c | 27 --------------------------- 2 files changed, 0 insertions(+), 30 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index ef0d6fe..f455f02 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1328,14 +1328,11 @@ extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); extern int kill_pgrp(struct pid *pid, int sig, int priv); extern int kill_pid(struct pid *pid, int sig, int priv); -extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); -extern int kill_pg_info(int, struct siginfo *, pid_t); extern void do_notify_parent(struct task_struct *, int); extern void force_sig(int, struct task_struct *); extern void force_sig_specific(int, struct task_struct *); extern int send_sig(int, struct task_struct *, int); extern void zap_other_threads(struct task_struct *p); -extern int kill_pg(pid_t, int, int); extern int kill_proc(pid_t, int, int); extern struct sigqueue *sigqueue_alloc(void); extern void sigqueue_free(struct sigqueue *); diff --git a/kernel/signal.c b/kernel/signal.c index 91caafa..2b29e95 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1096,26 +1096,6 @@ int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp) return retval; } -int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp) -{ - if (pgrp <= 0) - return -EINVAL; - - return __kill_pgrp_info(sig, info, find_pid(pgrp)); -} - -int -kill_pg_info(int sig, struct siginfo *info, pid_t pgrp) -{ - int retval; - - read_lock(&tasklist_lock); - retval = __kill_pg_info(sig, info, pgrp); - read_unlock(&tasklist_lo…
creator: ebiederm
date: 2006-12-13T11:07:56-00:00

Re: [PATCH 0/12] tty layer and misc struct pid conversions
type: item
description: On Wed, 13 Dec 2006 04:03:39 -0700 ebiederm@xmission.com (Eric W. Biederman) wrote: > The aim of this patch set is to start wrapping up the struct pid > conversions. hm, it touches a lot of tricky code which few people are familar with. Worried. _______________________________________________ Containers mailing list Containers@lists.osdl.org https://lists.osdl.org/mailman/listinfo/containers
creator: Andrew Morton
date: 2006-12-13T22:10:36-00:00

Re: [PATCH 0/12] tty layer and misc struct pid conversions
type: item
description: Andrew Morton <akpm@osdl.org> writes: > On Wed, 13 Dec 2006 04:03:39 -0700 > ebiederm@xmission.com (Eric W. Biederman) wrote: > >> The aim of this patch set is to start wrapping up the struct pid >> conversions. > > hm, it touches a lot of tricky code which few people are familar > with. Worried. Reasonable concern. The good thing is that the only big change was that struct pid is reference counted while old style pids are not. Which means that most of the pieces are simple substitutions. Although I admit checking that the reference is correct especially in the tty layer is tricky. Eric _______________________________________________ Containers mailing list Containers@lists.osdl.org https://lists.osdl.org/mailman/listinfo/containers
creator: ebiederm
date: 2006-12-14T00:54:54-00:00