X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=kernel%2Fvserver%2Fnamespace.c;h=1482e62f9ee0ac6be366d6113c64dab19ad3ac62;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=2c76c6fb4467a8ae15927011c2fd3536018e3af1;hpb=b76fcd5f0c655b6e3e9bf534594357025421c66a;p=linux-2.6.git diff --git a/kernel/vserver/namespace.c b/kernel/vserver/namespace.c index 2c76c6fb4..1482e62f9 100644 --- a/kernel/vserver/namespace.c +++ b/kernel/vserver/namespace.c @@ -3,7 +3,7 @@ * * Virtual Server: Context Namespace Support * - * Copyright (C) 2003-2004 Herbert Pötzl + * Copyright (C) 2003-2005 Herbert Pötzl * * V0.01 broken out from context.c 0.07 * V0.02 added task locking for namespace @@ -12,10 +12,12 @@ #include #include +#include +#include #include -#include -#include #include +#include +#include #include #include @@ -56,11 +58,11 @@ int vc_set_vhi_name(uint32_t id, void __user *data) return -EPERM; if (copy_from_user (&vc_data, data, sizeof(vc_data))) return -EFAULT; - - vxi = find_vx_info(id); + + vxi = locate_vx_info(id); if (!vxi) return -ESRCH; - + name = vx_vhi_name(vxi, vc_data.field); if (name) memcpy(name, vc_data.name, 65); @@ -77,14 +79,14 @@ int vc_get_vhi_name(uint32_t id, void __user *data) if (copy_from_user (&vc_data, data, sizeof(vc_data))) return -EFAULT; - vxi = find_vx_info(id); + vxi = locate_vx_info(id); if (!vxi) return -ESRCH; name = vx_vhi_name(vxi, vc_data.field); if (!name) goto out_put; - + memcpy(vc_data.name, name, 65); if (copy_to_user (data, &vc_data, sizeof(vc_data))) return -EFAULT; @@ -126,7 +128,7 @@ int vc_enter_namespace(uint32_t id, void *data) if (!vx_check(0, VX_ADMIN)) return -ENOSYS; - vxi = find_vx_info(id); + vxi = locate_vx_info(id); if (!vxi) return -ESRCH; @@ -144,7 +146,7 @@ int vc_enter_namespace(uint32_t id, void *data) old_ns = current->namespace; old_fs = current->fs; get_namespace(vxi->vx_namespace); - current->namespace = vxi->vx_namespace; + current->namespace = vxi->vx_namespace; current->fs = fs; task_unlock(current); @@ -158,11 +160,9 @@ out_put: int vc_cleanup_namespace(uint32_t id, void *data) { down_write(¤t->namespace->sem); - // spin_lock(&dcache_lock); spin_lock(&vfsmount_lock); umount_unused(current->namespace->root, current->fs); spin_unlock(&vfsmount_lock); - // spin_unlock(&dcache_lock); up_write(¤t->namespace->sem); return 0; }