From: Oleg Nesterov on
Cleanup. __set_personality() always changes ->exec_domain/personality,
the special case when ->exec_domain remains the same buys nothing but
complicates the code.

I don't understand why lookup_exec_domain() always succeeds even if
the search in ->exec_domains list fails, we use default_exec_domain
in this case.

Signed-off-by: Oleg Nesterov <oleg(a)redhat.com>
---

kernel/exec_domain.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)

--- 34-rc1/kernel/exec_domain.c~3_CLEANUP_SET_PERSONALITY 2010-05-27 15:54:33.000000000 +0200
+++ 34-rc1/kernel/exec_domain.c 2010-05-27 17:03:29.000000000 +0200
@@ -134,23 +134,14 @@ unregister:
return 0;
}

-int
-__set_personality(u_long personality)
+int __set_personality(u_long personality)
{
- struct exec_domain *ep, *oep;
-
- ep = lookup_exec_domain(personality);
- if (ep == current_thread_info()->exec_domain) {
- current->personality = personality;
- module_put(ep->module);
- return 0;
- }
+ struct exec_domain *oep = current_thread_info()->exec_domain;

+ current_thread_info()->exec_domain = lookup_exec_domain(personality);
current->personality = personality;
- oep = current_thread_info()->exec_domain;
- current_thread_info()->exec_domain = ep;
-
module_put(oep->module);
+
return 0;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/