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

[RFC][PATCH 2/3] Replace pid_t in autofs4 with struct pid reference
type: item
description: 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. - Also rollback my earlier change to autofs_wait_queue (pid and tgid in the wait queue are just used to write to a userspace daemon's pipe). --- From: Sukadev Bhattiprolu <sukadev@us.ibm.com> Subject: Replace pid_t in autofs4 with struct pid reference. Make autofs4 container-friendly by caching struct pid reference rather than pid_t. 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/autofs4/autofs_i.h | 6 +++--- fs/autofs4/inode.c | 29 ++++++++++++++++++++--------- fs/autofs4/root.c | 3 ++- fs/autofs4/waitq.c | 4 ++-- 4 files changed, 27 insertions(+), 15 deletions(-) Index: lx26-20-rc4-mm1/fs/autofs4/autofs_i.h =================================================================== --- lx26-20-rc4-mm1.orig/fs/autofs4/autofs_i.h 2007-01-24 18:39:28.172066416 -0800 +++ lx26-20-rc4-mm1/fs/autofs4/autofs_i.h 2007-01-24 18:41:56.260553544 -0800 @@ -35,7 +35,7 @@ /* #define DEBUG */ #ifdef DEBUG -#define DPRINTK(fmt,args...) do { printk(KERN_DEBUG "pid %d: %s: " fmt "\n" , current->pid , __FUNCTION__ , ##args); } while(0) +#define DPRINTK(fmt,args...) do { printk(KERN_DEBUG "pid %d: %s: " fmt "\n" , pid_nr(task_pid(current)), __FUNCTION__ , ##args); } while(0) #else #define DPRINTK(fmt,args...) do {} while(0) #endif @@ -96,7 +96,7 @@ struct autofs_sb_info { u32 magic; int pipefd; struct file *pipe; - pid_t oz_pgrp; + struct pid *oz_pgrp; int catatonic; int version; int sub_version; @@ -127,7 +127,7 @@ static inline struct autofs_info *autofs filesystem without "magic".) */ static inline int autofs4_oz_mode(struct autofs_sb_info *sbi) { - return sbi->catatonic || process_group(current) == sbi->oz_pgrp; + return sbi-…
creator: Sukadev Bhattiprolu
date: 2007-01-25T03:54:30-00:00