/[vps]/vserver-sources/2.1.0.5/4913_vs2.1.0.5-2.6.15-atomic-fix01.patch
Gentoo

Contents of /vserver-sources/2.1.0.5/4913_vs2.1.0.5-2.6.15-atomic-fix01.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 218 - (show annotations) (download)
Tue Jan 24 18:23:50 2006 UTC (8 years, 10 months ago) by phreak
File size: 2033 byte(s)
Adding patchdir for 2.1.0.5
1 Index: vserver-sources-2.1.0.5_2.6.15/include/linux/vserver/limit.h
2 ===================================================================
3 --- vserver-sources-2.1.0.5_2.6.15.orig/include/linux/vserver/limit.h
4 +++ vserver-sources-2.1.0.5_2.6.15/include/linux/vserver/limit.h
5 @@ -31,6 +31,7 @@ typedef unsigned long rlim_t;
6 #define __rlim_inc(l,r) atomic64_inc(&__rlim_val(l,r))
7 #define __rlim_dec(l,r) atomic64_dec(&__rlim_val(l,r))
8 #define __rlim_add(l,r,v) atomic64_add(v, &__rlim_val(l,r))
9 +#define __rlim_sub(l,r,v) atomic64_sub(v, &__rlim_val(l,r))
10
11 #else /* !ATOMIC64_INIT */
12 typedef atomic_t rlim_atomic_t;
13 @@ -41,6 +42,8 @@ typedef unsigned rlim_t;
14 #define __rlim_inc(l,r) atomic_inc(&__rlim_val(l,r))
15 #define __rlim_dec(l,r) atomic_dec(&__rlim_val(l,r))
16 #define __rlim_add(l,r,v) atomic_add(v, &__rlim_val(l,r))
17 +#define __rlim_sub(l,r,v) atomic_sub(v, &__rlim_val(l,r))
18 +
19 #endif /* ATOMIC64_INIT */
20
21 #if (RLIM_INFINITY == VLIM_INFINITY)
22 Index: vserver-sources-2.1.0.5_2.6.15/kernel/vserver/context.c
23 ===================================================================
24 --- vserver-sources-2.1.0.5_2.6.15.orig/kernel/vserver/context.c
25 +++ vserver-sources-2.1.0.5_2.6.15/kernel/vserver/context.c
26 @@ -660,15 +660,15 @@ int vx_migrate_task(struct task_struct *
27 if (old_vxi) {
28 atomic_dec(&old_vxi->cvirt.nr_threads);
29 atomic_dec(&old_vxi->cvirt.nr_running);
30 - atomic_dec(&old_vxi->limit.rcur[RLIMIT_NPROC]);
31 + __rlim_dec(&old_vxi->limit, RLIMIT_NPROC);
32 /* FIXME: what about the struct files here? */
33 - atomic_sub(openfd, &old_vxi->limit.rcur[VLIMIT_OPENFD]);
34 + __rlim_sub(&old_vxi->limit, VLIMIT_OPENFD, openfd);
35 }
36 atomic_inc(&vxi->cvirt.nr_threads);
37 atomic_inc(&vxi->cvirt.nr_running);
38 - atomic_inc(&vxi->limit.rcur[RLIMIT_NPROC]);
39 + __rlim_inc(&vxi->limit, RLIMIT_NPROC);
40 /* FIXME: what about the struct files here? */
41 - atomic_add(openfd, &vxi->limit.rcur[VLIMIT_OPENFD]);
42 + __rlim_add(&vxi->limit, VLIMIT_OPENFD, openfd);
43
44 if (old_vxi) {
45 release_vx_info(old_vxi, p);

  ViewVC Help
Powered by ViewVC 1.1.20