[PATCH 09/10] Integrate the ridr code into IPC code

Previous thread: [PATCH 07/10] Introduce ridr_find() by Nadia.Derbey on Tuesday, April 29, 2008 - 7:33 am. (2 messages)

Next thread: [PATCH 10/10] Get rid of ipc_lock_down() by Nadia.Derbey on Tuesday, April 29, 2008 - 7:33 am. (2 messages)
From: Nadia.Derbey
Date: Tuesday, April 29, 2008 - 7:33 am

[PATCH 09/10]

This patche makes the ipc ode use the ridr API.

Signed-off-by: Nadia Derbey <Nadia.Derbey@bull.net>

---
 include/linux/ipc_namespace.h |    4 ++--
 ipc/namespace.c               |    2 +-
 ipc/shm.c                     |    2 +-
 ipc/util.c                    |   41 ++++++++++++++++-------------------------
 4 files changed, 20 insertions(+), 29 deletions(-)

Index: linux-2.6.25-mm1/include/linux/ipc_namespace.h
===================================================================
--- linux-2.6.25-mm1.orig/include/linux/ipc_namespace.h	2008-04-25 15:29:00.000000000 +0200
+++ linux-2.6.25-mm1/include/linux/ipc_namespace.h	2008-04-29 14:46:34.000000000 +0200
@@ -2,7 +2,7 @@
 #define __IPC_NAMESPACE_H__
 
 #include <linux/err.h>
-#include <linux/idr.h>
+#include <linux/ridr.h>
 #include <linux/rwsem.h>
 #include <linux/notifier.h>
 
@@ -21,7 +21,7 @@ struct ipc_ids {
 	unsigned short seq;
 	unsigned short seq_max;
 	struct rw_semaphore rw_mutex;
-	struct idr ipcs_idr;
+	struct ridr ipcs_ridr;
 };
 
 struct ipc_namespace {
Index: linux-2.6.25-mm1/ipc/namespace.c
===================================================================
--- linux-2.6.25-mm1.orig/ipc/namespace.c	2008-04-25 15:29:13.000000000 +0200
+++ linux-2.6.25-mm1/ipc/namespace.c	2008-04-29 14:47:25.000000000 +0200
@@ -74,7 +74,7 @@ void free_ipcs(struct ipc_namespace *ns,
 	in_use = ids->in_use;
 
 	for (total = 0, next_id = 0; total < in_use; next_id++) {
-		perm = idr_find(&ids->ipcs_idr, next_id);
+		perm = ridr_find(&ids->ipcs_ridr, next_id);
 		if (perm == NULL)
 			continue;
 		ipc_lock_by_ptr(perm);
Index: linux-2.6.25-mm1/ipc/shm.c
===================================================================
--- linux-2.6.25-mm1.orig/ipc/shm.c	2008-04-25 15:29:13.000000000 +0200
+++ linux-2.6.25-mm1/ipc/shm.c	2008-04-29 14:48:26.000000000 +0200
@@ -569,7 +569,7 @@ static void shm_get_stat(struct ipc_name
 		struct shmid_kernel *shp;
 		struct inode *inode;
 
-		shp = ...
From: Tim Pepper
Date: Wednesday, April 30, 2008 - 9:32 pm

...the removal of the rw_mutex down/up_read().


-- 
Tim Pepper  <lnxninja@linux.vnet.ibm.com>
IBM Linux Technology Center
--

Previous thread: [PATCH 07/10] Introduce ridr_find() by Nadia.Derbey on Tuesday, April 29, 2008 - 7:33 am. (2 messages)

Next thread: [PATCH 10/10] Get rid of ipc_lock_down() by Nadia.Derbey on Tuesday, April 29, 2008 - 7:33 am. (2 messages)