[PATCH 1/8] pid_namespace: destroy_pid_namespace: Add IDR implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of freeing individual pages of the bitmap for the namespace,
call idr_destroy() on the idr struct for the namespace.

Signed-off-by: Gargi Sharma <gs051095@xxxxxxxxx>
---
 kernel/pid_namespace.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 74a5a72..6894109 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -164,11 +164,9 @@ static void delayed_free_pidns(struct rcu_head *p)
 
 static void destroy_pid_namespace(struct pid_namespace *ns)
 {
-	int i;
-
 	ns_free_inum(&ns->ns);
-	for (i = 0; i < PIDMAP_ENTRIES; i++)
-		kfree(ns->pidmap[i].page);
+
+	idr_destroy(ns->idr);
 	call_rcu(&ns->rcu, delayed_free_pidns);
 }
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux