[Devel] [RFC][PATCH 3/3] Remove process_group() in autofs/autofs4

Sukadev Bhattiprolu sukadev at us.ibm.com
Wed Jan 24 20:00:41 PST 2007


Should we make this change or just continue using process_group() (and
eventually modify it to return pid_nr(task_pgrp(tsk)).

If we want to make this change, I can merge this patch with the other
autofs/autofs4 patches.

I think process_group() because is more readable but can cause some confusion
with task_pgrp() at a quick glance.

---
From: Sukadev Bhattiprolu <sukadev at us.ibm.com>

Replace process_group(tsk) with pid_nr(task_pgrp(tsk)) in autofs and autofs4.


Signed-off-by: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Cc: Cedric Le Goater <clg at fr.ibm.com>
Cc: Dave Hansen <haveblue at us.ibm.com>
Cc: Serge Hallyn <serue at us.ibm.com>
Cc: containers at lists.osdl.org

---
 fs/autofs/inode.c  |    2 +-
 fs/autofs/root.c   |    4 ++--
 fs/autofs4/inode.c |    2 +-
 fs/autofs4/root.c  |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

Index: lx26-20-rc4-mm1/fs/autofs/root.c
===================================================================
--- lx26-20-rc4-mm1.orig/fs/autofs/root.c	2007-01-24 18:39:20.834181944 -0800
+++ lx26-20-rc4-mm1/fs/autofs/root.c	2007-01-24 18:41:58.069278576 -0800
@@ -215,7 +215,7 @@ static struct dentry *autofs_root_lookup
 	oz_mode = autofs_oz_mode(sbi);
 	DPRINTK(("autofs_lookup: pid = %u, pgrp = %u, catatonic = %d, "
 				"oz_mode = %d\n", pid_nr(task_pid(current)),
-				process_group(current), sbi->catatonic,
+				pid_nr(task_pgrp(current)), sbi->catatonic,
 				oz_mode));
 
 	/*
@@ -537,7 +537,7 @@ static int autofs_root_ioctl(struct inod
 	struct autofs_sb_info *sbi = autofs_sbi(inode->i_sb);
 	void __user *argp = (void __user *)arg;
 
-	DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",cmd,arg,sbi,process_group(current)));
+	DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",cmd,arg,sbi,pid_nr(task_pgrp(current))));
 
 	if ( _IOC_TYPE(cmd) != _IOC_TYPE(AUTOFS_IOC_FIRST) ||
 	     _IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT )
Index: lx26-20-rc4-mm1/fs/autofs4/root.c
===================================================================
--- lx26-20-rc4-mm1.orig/fs/autofs4/root.c	2007-01-24 18:41:56.261553392 -0800
+++ lx26-20-rc4-mm1/fs/autofs4/root.c	2007-01-24 18:41:58.070278424 -0800
@@ -495,7 +495,7 @@ static struct dentry *autofs4_lookup(str
 	oz_mode = autofs4_oz_mode(sbi);
 
 	DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d",
-		 pid_nr(task_pid(current)), process_group(current),
+		 pid_nr(task_pid(current)), pid_nr(task_pgrp(current)),
 		 sbi->catatonic, oz_mode);
 
 	/*
@@ -829,7 +829,7 @@ static int autofs4_root_ioctl(struct ino
 	void __user *p = (void __user *)arg;
 
 	DPRINTK("cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u",
-		cmd,arg,sbi,process_group(current));
+		cmd,arg,sbi,pid_nr(task_pgrp(current)));
 
 	if ( _IOC_TYPE(cmd) != _IOC_TYPE(AUTOFS_IOC_FIRST) ||
 	     _IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT )
Index: lx26-20-rc4-mm1/fs/autofs/inode.c
===================================================================
--- lx26-20-rc4-mm1.orig/fs/autofs/inode.c	2007-01-24 18:39:20.834181944 -0800
+++ lx26-20-rc4-mm1/fs/autofs/inode.c	2007-01-24 18:41:58.070278424 -0800
@@ -81,7 +81,7 @@ static int parse_options(char *options, 
 
 	*uid = current->uid;
 	*gid = current->gid;
-	pgid = process_group(current);
+	pgid = pid_nr(task_pgrp(current));
 
 	*minproto = *maxproto = AUTOFS_PROTO_VERSION;
 
Index: lx26-20-rc4-mm1/fs/autofs4/inode.c
===================================================================
--- lx26-20-rc4-mm1.orig/fs/autofs4/inode.c	2007-01-24 18:41:56.261553392 -0800
+++ lx26-20-rc4-mm1/fs/autofs4/inode.c	2007-01-24 18:41:58.071278272 -0800
@@ -230,7 +230,7 @@ static int parse_options(char *options, 
 
 	*uid = current->uid;
 	*gid = current->gid;
-	pgid = process_group(current);
+	pgid = pid_nr(task_pgrp((current));
 
 	*minproto = AUTOFS_MIN_PROTO_VERSION;
 	*maxproto = AUTOFS_MAX_PROTO_VERSION;
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers




More information about the Devel mailing list