X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=kernel%2Fvserver%2Flimit.c;h=4af1ee567d20ef5a6fd4cc5450fe6aa058ec7bf2;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=99590bbc01d03cf925db125cc496c4bd5ed4148c;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/kernel/vserver/limit.c b/kernel/vserver/limit.c index 99590bbc0..4af1ee567 100644 --- a/kernel/vserver/limit.c +++ b/kernel/vserver/limit.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -33,6 +34,8 @@ const char *vlimit_name[NUM_LIMITS] = { [VLIMIT_NSOCK] = "NSOCK", }; +EXPORT_SYMBOL_GPL(vlimit_name); + static int is_valid_rlimit(int id) { @@ -57,7 +60,7 @@ static inline uint64_t vc_get_rlim(struct vx_info *vxi, int id) limit = vxi->limit.rlim[id]; if (limit == RLIM_INFINITY) return CRLIM_INFINITY; - return limit; + return limit; } int vc_get_rlimit(uint32_t id, void __user *data) @@ -69,7 +72,7 @@ int vc_get_rlimit(uint32_t id, void __user *data) return -EFAULT; if (!is_valid_rlimit(vc_data.id)) return -ENOTSUPP; - + vxi = locate_vx_info(id); if (!vxi) return -ESRCH; @@ -102,7 +105,6 @@ int vc_set_rlimit(uint32_t id, void __user *data) if (vc_data.maximum != CRLIM_KEEP) vxi->limit.rlim[vc_data.id] = vc_data.maximum; - printk("setting [%d] = %d\n", vc_data.id, (int)vc_data.maximum); put_vx_info(vxi); return 0; @@ -126,7 +128,7 @@ int vc_get_rlimit_mask(uint32_t id, void __user *data) if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RESOURCE)) return -EPERM; if (copy_to_user(data, &mask, sizeof(mask))) - return -EFAULT; + return -EFAULT; return 0; } @@ -142,15 +144,15 @@ void vx_vsi_meminfo(struct sysinfo *val) v = atomic_read(&vxi->limit.rcur[RLIMIT_RSS]); val->freeram = (v < val->totalram) ? val->totalram - v : 0; val->bufferram = 0; - val->totalhigh = 0; - val->freehigh = 0; + val->totalhigh = 0; + val->freehigh = 0; return; } void vx_vsi_swapinfo(struct sysinfo *val) { struct vx_info *vxi = current->vx_info; - unsigned long w,v; + unsigned long v, w; v = vxi->limit.rlim[RLIMIT_RSS]; w = vxi->limit.rlim[RLIMIT_AS];