diff -NurpP --minimal linux-2.6.16-rc1-vs2.1.0.8.1/include/linux/vserver/limit.h linux-2.6.16-rc1-vs2.1.0.9/include/linux/vserver/limit.h
--- linux-2.6.16-rc1-vs2.1.0.8.1/include/linux/vserver/limit.h	2006-01-22 07:09:27 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9/include/linux/vserver/limit.h	2006-01-28 08:54:48 +0100
@@ -19,18 +19,27 @@
 #warning RLIM_INFINITY is undefined
 #endif
 
-#define	__rlim_val(l,r)		((l)->rcur[(r)])
-#define	__rlim_hit(l,r)		atomic_inc(&(l)->lhit[(r)])
+#define __rlim_val(l,r,v)	((l)->res[(r)].v)
+
+#define	__rlim_soft(l,r)	__rlim_val(l,r,soft)
+#define	__rlim_hard(l,r)	__rlim_val(l,r,hard)
+
+#define	__rlim_rcur(l,r)	__rlim_val(l,r,rcur)
+#define	__rlim_rmin(l,r)	__rlim_val(l,r,rmin)
+#define	__rlim_rmax(l,r)	__rlim_val(l,r,rmax)
+
+#define	__rlim_lhit(l,r)	__rlim_val(l,r,lhit)
+#define	__rlim_hit(l,r)		atomic_inc(&__rlim_lhit(l,r))
 
 typedef atomic_long_t rlim_atomic_t;
 typedef unsigned long rlim_t;
 
-#define __rlim_get(l,r)		atomic_long_read(&__rlim_val(l,r))
-#define __rlim_set(l,r,v)	atomic_long_set(&__rlim_val(l,r), v)
-#define	__rlim_inc(l,r)		atomic_long_inc(&__rlim_val(l,r))
-#define	__rlim_dec(l,r)		atomic_long_dec(&__rlim_val(l,r))
-#define	__rlim_add(l,r,v)	atomic_long_add(v, &__rlim_val(l,r))
-#define	__rlim_sub(l,r,v)	atomic_long_sub(v, &__rlim_val(l,r))
+#define __rlim_get(l,r)		atomic_long_read(&__rlim_rcur(l,r))
+#define __rlim_set(l,r,v)	atomic_long_set(&__rlim_rcur(l,r), v)
+#define	__rlim_inc(l,r)		atomic_long_inc(&__rlim_rcur(l,r))
+#define	__rlim_dec(l,r)		atomic_long_dec(&__rlim_rcur(l,r))
+#define	__rlim_add(l,r,v)	atomic_long_add(v, &__rlim_rcur(l,r))
+#define	__rlim_sub(l,r,v)	atomic_long_sub(v, &__rlim_rcur(l,r))
 
 
 #if	(RLIM_INFINITY == VLIM_INFINITY)
diff -NurpP --minimal linux-2.6.16-rc1-vs2.1.0.8.1/include/linux/vserver/limit_def.h linux-2.6.16-rc1-vs2.1.0.9/include/linux/vserver/limit_def.h
--- linux-2.6.16-rc1-vs2.1.0.8.1/include/linux/vserver/limit_def.h	2006-01-27 20:40:52 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9/include/linux/vserver/limit_def.h	2006-01-28 08:53:30 +0100
@@ -8,17 +8,21 @@
 #include "limit.h"
 
 
-/* context sub struct */
+struct _vx_res_limit {
+	rlim_t soft;		/* Context soft limit */
+	rlim_t hard;		/* Context hard limit */
 
-struct _vx_limit {
-	rlim_t soft[NUM_LIMITS];	/* Context soft limit */
-	rlim_t hard[NUM_LIMITS];	/* Context hard limit */
+	rlim_atomic_t rcur;	/* Current value */
+	rlim_t rmin;		/* Context minimum */
+	rlim_t rmax;		/* Context maximum */
 
-	rlim_atomic_t rcur[NUM_LIMITS];	/* Current value */
-	rlim_t rmin[NUM_LIMITS];	/* Context minimum */
-	rlim_t rmax[NUM_LIMITS];	/* Context maximum */
+	atomic_t lhit;		/* Limit hits */
+};
 
-	atomic_t lhit[NUM_LIMITS];	/* Limit hits */
+/* context sub struct */
+
+struct _vx_limit {
+	struct _vx_res_limit res[NUM_LIMITS];
 };
 
 #ifdef CONFIG_VSERVER_DEBUG
@@ -31,10 +35,11 @@ static inline void __dump_vx_limit(struc
 	for (i=0; i<NUM_LIMITS; i++) {
 		printk("\t [%2d] = %8lu %8lu/%8lu, %8ld/%8ld, %8d\n",
 			i, (unsigned long)__rlim_get(limit, i),
-			(unsigned long)limit->rmin[i],
-			(unsigned long)limit->rmax[i],
-			(long)limit->soft[i], (long)limit->hard[i],
-			atomic_read(&limit->lhit[i]));
+			(unsigned long)__rlim_rmin(limit, i),
+			(unsigned long)__rlim_rmax(limit, i),
+			(long)__rlim_soft(limit, i),
+			(long)__rlim_hard(limit, i),
+			atomic_read(&__rlim_lhit(limit, i)));
 	}
 }
 
diff -NurpP --minimal linux-2.6.16-rc1-vs2.1.0.8.1/include/linux/vserver/limit_int.h linux-2.6.16-rc1-vs2.1.0.9/include/linux/vserver/limit_int.h
--- linux-2.6.16-rc1-vs2.1.0.8.1/include/linux/vserver/limit_int.h	2006-01-27 20:41:21 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9/include/linux/vserver/limit_int.h	2006-01-28 08:26:01 +0100
@@ -48,8 +48,8 @@ static inline int __vx_cres_avail(struct
 	if (VXD_RLIMIT_COND(res))
 		vxlprintk(1, "vx_cres_avail[%5d,%s,%2d]: %5ld/%5ld > %5ld + %5d",
 			(vxi ? vxi->vx_id : -1), vlimit_name[res], res,
-			(vxi ? (long)vxi->limit.soft[res] : -1),
-			(vxi ? (long)vxi->limit.hard[res] : -1),
+			(vxi ? (long)__rlim_soft(&vxi->limit, res) : -1),
+			(vxi ? (long)__rlim_hard(&vxi->limit, res) : -1),
 			(vxi ? (long)__rlim_get(&vxi->limit, res) : 0),
 			num, _file, _line);
 	if (num == 0)
@@ -59,19 +59,19 @@ static inline int __vx_cres_avail(struct
 
 	value = __rlim_get(&vxi->limit, res);
 
-	if (value > vxi->limit.rmax[res])
-		vxi->limit.rmax[res] = value;
-	else if (value < vxi->limit.rmin[res])
-		vxi->limit.rmin[res] = value;
+	if (value > __rlim_rmax(&vxi->limit, res))
+		__rlim_rmax(&vxi->limit, res) = value;
+	else if (value < __rlim_rmin(&vxi->limit, res))
+		__rlim_rmin(&vxi->limit, res) = value;
 
-	if (vxi->limit.soft[res] == RLIM_INFINITY)
+	if (__rlim_soft(&vxi->limit, res) == RLIM_INFINITY)
 		return -1;
-	if (value + num <= vxi->limit.soft[res])
+	if (value + num <= __rlim_soft(&vxi->limit, res))
 		return -1;
 
-	if (vxi->limit.hard[res] == RLIM_INFINITY)
+	if (__rlim_hard(&vxi->limit, res) == RLIM_INFINITY)
 		return 1;
-	if (value + num <= vxi->limit.hard[res])
+	if (value + num <= __rlim_hard(&vxi->limit, res))
 		return 1;
 
 	__rlim_hit(&vxi->limit, res);
diff -NurpP --minimal linux-2.6.16-rc1-vs2.1.0.8.1/kernel/vserver/limit.c linux-2.6.16-rc1-vs2.1.0.9/kernel/vserver/limit.c
--- linux-2.6.16-rc1-vs2.1.0.8.1/kernel/vserver/limit.c	2006-01-27 22:03:58 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9/kernel/vserver/limit.c	2006-01-28 08:34:13 +0100
@@ -63,13 +63,13 @@ static int is_valid_rlimit(int id)
 
 static inline uint64_t vc_get_soft(struct vx_info *vxi, int id)
 {
-	rlim_t limit = vxi->limit.soft[id];
+	rlim_t limit = __rlim_soft(&vxi->limit, id);
 	return VX_VLIM(limit);
 }
 
 static inline uint64_t vc_get_hard(struct vx_info *vxi, int id)
 {
-	rlim_t limit = vxi->limit.hard[id];
+	rlim_t limit = __rlim_hard(&vxi->limit, id);
 	return VX_VLIM(limit);
 }
 
@@ -114,9 +114,11 @@ int vc_set_rlimit(uint32_t id, void __us
 		return -ESRCH;
 
 	if (vc_data.maximum != CRLIM_KEEP)
-		vxi->limit.hard[vc_data.id] = VX_RLIM(vc_data.maximum);
+		__rlim_hard(&vxi->limit, vc_data.id) =
+			VX_RLIM(vc_data.maximum);
 	if (vc_data.softlimit != CRLIM_KEEP)
-		vxi->limit.soft[vc_data.id] = VX_RLIM(vc_data.softlimit);
+		__rlim_soft(&vxi->limit, vc_data.id) =
+			VX_RLIM(vc_data.softlimit);
 	put_vx_info(vxi);
 
 	return 0;
@@ -155,7 +157,7 @@ void vx_vsi_meminfo(struct sysinfo *val)
 	struct vx_info *vxi = current->vx_info;
 	rlim_t v;
 
-	v = vxi->limit.soft[RLIMIT_RSS];
+	v = __rlim_soft(&vxi->limit, RLIMIT_RSS);
 	if (v == RLIM_INFINITY)
 		return;
 
@@ -176,11 +178,11 @@ void vx_vsi_swapinfo(struct sysinfo *val
 	struct vx_info *vxi = current->vx_info;
 	rlim_t v, w;
 
-	v = vxi->limit.soft[RLIMIT_RSS];
+	v = __rlim_soft(&vxi->limit, RLIMIT_RSS);
 	if (v == RLIM_INFINITY)
 		return;
 
-	w = vxi->limit.hard[RLIMIT_RSS];
+	w = __rlim_hard(&vxi->limit, RLIMIT_RSS);
 	if (w == RLIM_INFINITY)
 		return;
 
diff -NurpP --minimal linux-2.6.16-rc1-vs2.1.0.8.1/kernel/vserver/limit_init.h linux-2.6.16-rc1-vs2.1.0.9/kernel/vserver/limit_init.h
--- linux-2.6.16-rc1-vs2.1.0.8.1/kernel/vserver/limit_init.h	2006-01-27 22:02:11 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9/kernel/vserver/limit_init.h	2006-01-28 08:44:45 +0100
@@ -7,12 +7,12 @@ static inline void vx_info_init_limit(st
 	int lim;
 
 	for (lim=0; lim<NUM_LIMITS; lim++) {
-		limit->soft[lim] = RLIM_INFINITY;
-		limit->hard[lim] = RLIM_INFINITY;
+		__rlim_soft(limit, lim) = RLIM_INFINITY;
+		__rlim_hard(limit, lim) = RLIM_INFINITY;
 		__rlim_set(limit, lim, 0);
-		atomic_set(&limit->lhit[lim], 0);
-		limit->rmin[lim] = 0;
-		limit->rmax[lim] = 0;
+		atomic_set(&__rlim_lhit(limit, lim), 0);
+		__rlim_rmin(limit, lim) = 0;
+		__rlim_rmax(limit, lim) = 0;
 	}
 }
 
diff -NurpP --minimal linux-2.6.16-rc1-vs2.1.0.8.1/kernel/vserver/limit_proc.h linux-2.6.16-rc1-vs2.1.0.9/kernel/vserver/limit_proc.h
--- linux-2.6.16-rc1-vs2.1.0.8.1/kernel/vserver/limit_proc.h	2006-01-21 18:28:15 +0100
+++ linux-2.6.16-rc1-vs2.1.0.9/kernel/vserver/limit_proc.h	2006-01-28 08:48:27 +0100
@@ -9,12 +9,12 @@ static inline void vx_limit_fixup(struct
 
 	for (lim=0; lim<NUM_LIMITS; lim++) {
 		value = __rlim_get(limit, lim);
-		if (value > limit->rmax[lim])
-			limit->rmax[lim] = value;
-		if (value < limit->rmin[lim])
-			limit->rmin[lim] = value;
-		if (limit->rmax[lim] > limit->hard[lim])
-			limit->rmax[lim] = limit->hard[lim];
+		if (value > __rlim_rmax(limit, lim))
+			__rlim_rmax(limit, lim) = value;
+		if (value < __rlim_rmin(limit, lim))
+			__rlim_rmin(limit, lim) = value;
+		if (__rlim_rmax(limit, lim) > __rlim_hard(limit, lim))
+			__rlim_rmax(limit, lim) = __rlim_hard(limit, lim);
 	}
 }
 
@@ -25,11 +25,11 @@ static inline void vx_limit_fixup(struct
 
 #define VX_LIMIT_ARG(r)				\
 	,(unsigned long)__rlim_get(limit, r)	\
-	,(unsigned long)limit->rmin[r]		\
-	,(unsigned long)limit->rmax[r]		\
-	,VX_VLIM(limit->soft[r])		\
-	,VX_VLIM(limit->hard[r])		\
-	,atomic_read(&limit->lhit[r])
+	,(unsigned long)__rlim_rmin(limit, r)	\
+	,(unsigned long)__rlim_rmax(limit, r)	\
+	,VX_VLIM(__rlim_soft(limit, r))		\
+	,VX_VLIM(__rlim_hard(limit, r))		\
+	,atomic_read(&__rlim_lhit(limit, r))
 
 static inline int vx_info_proc_limit(struct _vx_limit *limit, char *buffer)
 {
