OpenVZ Forum - RDF feed
type: channel
items: [PATCH 2/4] Replace pid_t in autofs with struct pid reference

[PATCH 2/4] Replace pid_t in autofs with struct pid reference
type: item
description: From: Sukadev Bhattiprolu <sukadev@us.ibm.com> Subject: [PATCH 2/4] Replace pid_t in autofs with struct pid reference. Make autofs container-friendly by caching struct pid reference rather than pid_t and using pid_nr() to retreive a task's pid_t. ChangeLog: - Fix Eric Biederman's comments - Use find_get_pid() to hold a reference to oz_pgrp and release while unmounting; separate out changes to autofs and autofs4. - Fix Cedric's comments: retain old prototype of parse_options() and move necessary change to its caller. Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com> Cc: Cedric Le Goater <clg@fr.ibm.com> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: Serge Hallyn <serue@us.ibm.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: containers@lists.osdl.org --- fs/autofs/autofs_i.h | 4 ++-- fs/autofs/inode.c | 20 ++++++++++++++++---- fs/autofs/root.c | 6 ++++-- 3 files changed, 22 insertions(+), 8 deletions(-) Index: lx26-20-mm1/fs/autofs/autofs_i.h =================================================================== --- lx26-20-mm1.orig/fs/autofs/autofs_i.h 2007-02-16 14:32:49.000000000 -0800 +++ lx26-20-mm1/fs/autofs/autofs_i.h 2007-02-16 15:44:24.000000000 -0800 @@ -101,7 +101,7 @@ struct autofs_symlink { struct autofs_sb_info { u32 magic; struct file *pipe; - pid_t oz_pgrp; + struct pid *oz_pgrp; int catatonic; struct super_block *sb; unsigned long exp_timeout; @@ -122,7 +122,7 @@ static inline struct autofs_sb_info *aut filesystem without "magic".) */ static inline int autofs_oz_mode(struct autofs_sb_info *sbi) { - return sbi->catatonic || process_group(current) == sbi->oz_pgrp; + return sbi->catatonic || task_pgrp(current) == sbi->oz_pgrp; } /* Hash operations */ Index: lx26-20-mm1/fs/autofs/inode.c =================================================================== --- lx26-20-mm1.orig/fs/autofs/inode.c 2007-02-16 15:43:14.000000000 -0800 +++ lx26-20-mm1/fs/autofs/inode.c 2007-02-16 15:44:24.000000000 -0800 @@ -37,6 +37,8 @@ void autofs_kill_sb(struct super_block *…
creator: Sukadev Bhattiprolu
date: 2007-02-22T23:32:26-00:00