/[vps]/vserver-sources/2.1.1-r1/4410_vs2.1.1.patch
Gentoo

Diff of /vserver-sources/2.1.1-r1/4410_vs2.1.1.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

vserver-sources/2.1.1/4410_vs2.1.1.patch Revision 525 vserver-sources/2.1.1-r1/4410_vs2.1.1.patch Revision 526
1diff -NurpP --minimal linux-2.6.18.2/Documentation/vserver/debug.txt linux-2.6.18.2-vs2.1.1/Documentation/vserver/debug.txt 1Index: linux-2.6.18/Documentation/vserver/debug.txt
2--- linux-2.6.18.2/Documentation/vserver/debug.txt 1970-01-01 01:00:00 +0100 2===================================================================
3+++ linux-2.6.18.2-vs2.1.1/Documentation/vserver/debug.txt 2006-11-03 17:26:38 +0100 3--- /dev/null
4+++ linux-2.6.18/Documentation/vserver/debug.txt
4@@ -0,0 +1,154 @@ 5@@ -0,0 +1,154 @@
5+ 6+
6+debug_cvirt: 7+debug_cvirt:
7+ 8+
8+ 2 4 "vx_map_tgid: %p/%llx: %d -> %d" 9+ 2 4 "vx_map_tgid: %p/%llx: %d -> %d"
154+ "vx_cres_avail[%5d,%s,%2d]: %5ld > %5d + %5d" 155+ "vx_cres_avail[%5d,%s,%2d]: %5ld > %5d + %5d"
155+ 156+
156+ m 2^m "vx_acc_page[%5d,%s,%2d]: %5d%s" 157+ m 2^m "vx_acc_page[%5d,%s,%2d]: %5d%s"
157+ "vx_acc_pages[%5d,%s,%2d]: %5d += %5d" 158+ "vx_acc_pages[%5d,%s,%2d]: %5d += %5d"
158+ "vx_pages_avail[%5d,%s,%2d]: %5ld > %5d + %5d" 159+ "vx_pages_avail[%5d,%s,%2d]: %5ld > %5d + %5d"
159diff -NurpP --minimal linux-2.6.18.2/Makefile linux-2.6.18.2-vs2.1.1/Makefile 160Index: linux-2.6.18/Makefile
160--- linux-2.6.18.2/Makefile 2006-11-04 19:43:18 +0100 161===================================================================
161+++ linux-2.6.18.2-vs2.1.1/Makefile 2006-11-05 20:28:39 +0100 162--- linux-2.6.18.orig/Makefile
163+++ linux-2.6.18/Makefile
162@@ -1,7 +1,7 @@ 164@@ -1,7 +1,7 @@
163 VERSION = 2 165 VERSION = 2
164 PATCHLEVEL = 6 166 PATCHLEVEL = 6
165 SUBLEVEL = 18 167 SUBLEVEL = 18
166-EXTRAVERSION = 168-EXTRAVERSION =
167+EXTRAVERSION = -vs2.1.1-gentoo 169+EXTRAVERSION = -vs2.1.1-gentoo-r1
168 NAME=Avast! A bilge rat! 170 NAME=Avast! A bilge rat!
169 171
170 # *DOCUMENTATION* 172 # *DOCUMENTATION*
171diff -NurpP --minimal linux-2.6.18.2/arch/alpha/Kconfig linux-2.6.18.2-vs2.1.1/arch/alpha/Kconfig 173Index: linux-2.6.18/arch/alpha/Kconfig
172--- linux-2.6.18.2/arch/alpha/Kconfig 2006-06-18 04:51:38 +0200 174===================================================================
173+++ linux-2.6.18.2-vs2.1.1/arch/alpha/Kconfig 2006-09-20 17:01:44 +0200 175--- linux-2.6.18.orig/arch/alpha/Kconfig
176+++ linux-2.6.18/arch/alpha/Kconfig
174@@ -632,6 +632,8 @@ source "arch/alpha/oprofile/Kconfig" 177@@ -658,6 +658,8 @@ source "arch/alpha/oprofile/Kconfig"
175 178
176 source "arch/alpha/Kconfig.debug" 179 source "arch/alpha/Kconfig.debug"
177 180
178+source "kernel/vserver/Kconfig" 181+source "kernel/vserver/Kconfig"
179+ 182+
180 source "security/Kconfig" 183 source "security/Kconfig"
181 184
182 source "crypto/Kconfig" 185 source "crypto/Kconfig"
183diff -NurpP --minimal linux-2.6.18.2/arch/alpha/kernel/asm-offsets.c linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/asm-offsets.c 186Index: linux-2.6.18/arch/alpha/kernel/asm-offsets.c
187===================================================================
184--- linux-2.6.18.2/arch/alpha/kernel/asm-offsets.c 2006-02-15 13:54:10 +0100 188--- linux-2.6.18.orig/arch/alpha/kernel/asm-offsets.c
185+++ linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/asm-offsets.c 2006-09-25 15:40:02 +0200 189+++ linux-2.6.18/arch/alpha/kernel/asm-offsets.c
186@@ -36,6 +36,7 @@ void foo(void) 190@@ -36,6 +36,7 @@ void foo(void)
187 DEFINE(PT_PTRACED, PT_PTRACED); 191 DEFINE(PT_PTRACED, PT_PTRACED);
188 DEFINE(CLONE_VM, CLONE_VM); 192 DEFINE(CLONE_VM, CLONE_VM);
189 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); 193 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
190+ DEFINE(CLONE_KTHREAD, CLONE_KTHREAD); 194+ DEFINE(CLONE_KTHREAD, CLONE_KTHREAD);
191 DEFINE(SIGCHLD, SIGCHLD); 195 DEFINE(SIGCHLD, SIGCHLD);
192 BLANK(); 196 BLANK();
193 197
194diff -NurpP --minimal linux-2.6.18.2/arch/alpha/kernel/entry.S linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/entry.S 198Index: linux-2.6.18/arch/alpha/kernel/entry.S
195--- linux-2.6.18.2/arch/alpha/kernel/entry.S 2006-09-20 16:57:57 +0200 199===================================================================
196+++ linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/entry.S 2006-09-25 15:40:02 +0200 200--- linux-2.6.18.orig/arch/alpha/kernel/entry.S
201+++ linux-2.6.18/arch/alpha/kernel/entry.S
197@@ -644,7 +644,7 @@ kernel_thread: 202@@ -644,7 +644,7 @@ kernel_thread:
198 stq $2, 152($sp) /* HAE */ 203 stq $2, 152($sp) /* HAE */
199 204
200 /* Shuffle FLAGS to the front; add CLONE_VM. */ 205 /* Shuffle FLAGS to the front; add CLONE_VM. */
201- ldi $1, CLONE_VM|CLONE_UNTRACED 206- ldi $1, CLONE_VM|CLONE_UNTRACED
233+ 238+
234+ lda $sp, 16($sp) 239+ lda $sp, 16($sp)
235 ret 240 ret
236 .end sys_getxpid 241 .end sys_getxpid
237 242
238diff -NurpP --minimal linux-2.6.18.2/arch/alpha/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/irq.c 243Index: linux-2.6.18/arch/alpha/kernel/irq.c
239--- linux-2.6.18.2/arch/alpha/kernel/irq.c 2006-09-20 16:57:57 +0200 244===================================================================
240+++ linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/irq.c 2006-10-25 03:39:09 +0200 245--- linux-2.6.18.orig/arch/alpha/kernel/irq.c
246+++ linux-2.6.18/arch/alpha/kernel/irq.c
241@@ -26,6 +26,7 @@ 247@@ -26,6 +26,7 @@
242 #include <linux/seq_file.h> 248 #include <linux/seq_file.h>
243 #include <linux/profile.h> 249 #include <linux/profile.h>
244 #include <linux/bitops.h> 250 #include <linux/bitops.h>
245+#include <linux/vs_context.h> 251+#include <linux/vs_context.h>
261+ __enter_vx_admin(&vxis); 267+ __enter_vx_admin(&vxis);
262 __do_IRQ(irq, regs); 268 __do_IRQ(irq, regs);
263+ __leave_vx_admin(&vxis); 269+ __leave_vx_admin(&vxis);
264 irq_exit(); 270 irq_exit();
265 } 271 }
266diff -NurpP --minimal linux-2.6.18.2/arch/alpha/kernel/osf_sys.c linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/osf_sys.c 272Index: linux-2.6.18/arch/alpha/kernel/osf_sys.c
267--- linux-2.6.18.2/arch/alpha/kernel/osf_sys.c 2006-09-20 16:57:57 +0200 273===================================================================
268+++ linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/osf_sys.c 2006-09-25 15:40:02 +0200 274--- linux-2.6.18.orig/arch/alpha/kernel/osf_sys.c
275+++ linux-2.6.18/arch/alpha/kernel/osf_sys.c
269@@ -38,6 +38,7 @@ 276@@ -38,6 +38,7 @@
270 #include <linux/uio.h> 277 #include <linux/uio.h>
271 #include <linux/vfs.h> 278 #include <linux/vfs.h>
272 #include <linux/rcupdate.h> 279 #include <linux/rcupdate.h>
273+#include <linux/vs_cvirt.h> 280+#include <linux/vs_cvirt.h>
372- do_gettimeofday(&ktv); 379- do_gettimeofday(&ktv);
373+ vx_gettimeofday(&ktv); 380+ vx_gettimeofday(&ktv);
374 if (put_tv32(tv, &ktv)) 381 if (put_tv32(tv, &ktv))
375 return -EFAULT; 382 return -EFAULT;
376 } 383 }
377diff -NurpP --minimal linux-2.6.18.2/arch/alpha/kernel/ptrace.c linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/ptrace.c 384Index: linux-2.6.18/arch/alpha/kernel/ptrace.c
378--- linux-2.6.18.2/arch/alpha/kernel/ptrace.c 2006-04-09 13:49:39 +0200 385===================================================================
379+++ linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/ptrace.c 2006-10-06 23:10:42 +0200 386--- linux-2.6.18.orig/arch/alpha/kernel/ptrace.c
387+++ linux-2.6.18/arch/alpha/kernel/ptrace.c
380@@ -283,6 +283,11 @@ do_sys_ptrace(long request, long pid, lo 388@@ -283,6 +283,11 @@ do_sys_ptrace(long request, long pid, lo
381 goto out_notsk; 389 goto out_notsk;
382 } 390 }
383 391
384+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) { 392+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) {
387+ } 395+ }
388+ 396+
389 if (request == PTRACE_ATTACH) { 397 if (request == PTRACE_ATTACH) {
390 ret = ptrace_attach(child); 398 ret = ptrace_attach(child);
391 goto out; 399 goto out;
392diff -NurpP --minimal linux-2.6.18.2/arch/alpha/kernel/semaphore.c linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/semaphore.c 400Index: linux-2.6.18/arch/alpha/kernel/semaphore.c
401===================================================================
393--- linux-2.6.18.2/arch/alpha/kernel/semaphore.c 2004-08-14 12:55:32 +0200 402--- linux-2.6.18.orig/arch/alpha/kernel/semaphore.c
394+++ linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/semaphore.c 2006-10-28 19:27:34 +0200 403+++ linux-2.6.18/arch/alpha/kernel/semaphore.c
395@@ -68,8 +68,8 @@ __down_failed(struct semaphore *sem) 404@@ -68,8 +68,8 @@ __down_failed(struct semaphore *sem)
396 DECLARE_WAITQUEUE(wait, tsk); 405 DECLARE_WAITQUEUE(wait, tsk);
397 406
398 #ifdef CONFIG_DEBUG_SEMAPHORE 407 #ifdef CONFIG_DEBUG_SEMAPHORE
399- printk("%s(%d): down failed(%p)\n", 408- printk("%s(%d): down failed(%p)\n",
423+ printk("%s(%d:#%u): down failed(%p)\n", 432+ printk("%s(%d:#%u): down failed(%p)\n",
424+ tsk->comm, tsk->pid, tsk->xid, sem); 433+ tsk->comm, tsk->pid, tsk->xid, sem);
425 #endif 434 #endif
426 435
427 tsk->state = TASK_INTERRUPTIBLE; 436 tsk->state = TASK_INTERRUPTIBLE;
428diff -NurpP --minimal linux-2.6.18.2/arch/alpha/kernel/systbls.S linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/systbls.S 437Index: linux-2.6.18/arch/alpha/kernel/systbls.S
429--- linux-2.6.18.2/arch/alpha/kernel/systbls.S 2005-08-29 22:24:49 +0200 438===================================================================
430+++ linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/systbls.S 2006-09-20 17:01:44 +0200 439--- linux-2.6.18.orig/arch/alpha/kernel/systbls.S
440+++ linux-2.6.18/arch/alpha/kernel/systbls.S
431@@ -447,7 +447,7 @@ sys_call_table: 441@@ -447,7 +447,7 @@ sys_call_table:
432 .quad sys_stat64 /* 425 */ 442 .quad sys_stat64 /* 425 */
433 .quad sys_lstat64 443 .quad sys_lstat64
434 .quad sys_fstat64 444 .quad sys_fstat64
435- .quad sys_ni_syscall /* sys_vserver */ 445- .quad sys_ni_syscall /* sys_vserver */
436+ .quad sys_vserver /* sys_vserver */ 446+ .quad sys_vserver /* sys_vserver */
437 .quad sys_ni_syscall /* sys_mbind */ 447 .quad sys_ni_syscall /* sys_mbind */
438 .quad sys_ni_syscall /* sys_get_mempolicy */ 448 .quad sys_ni_syscall /* sys_get_mempolicy */
439 .quad sys_ni_syscall /* sys_set_mempolicy */ 449 .quad sys_ni_syscall /* sys_set_mempolicy */
440diff -NurpP --minimal linux-2.6.18.2/arch/alpha/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/traps.c 450Index: linux-2.6.18/arch/alpha/kernel/traps.c
441--- linux-2.6.18.2/arch/alpha/kernel/traps.c 2006-09-20 16:57:57 +0200 451===================================================================
442+++ linux-2.6.18.2-vs2.1.1/arch/alpha/kernel/traps.c 2006-09-25 15:40:02 +0200 452--- linux-2.6.18.orig/arch/alpha/kernel/traps.c
453+++ linux-2.6.18/arch/alpha/kernel/traps.c
443@@ -182,7 +182,8 @@ die_if_kernel(char * str, struct pt_regs 454@@ -215,7 +215,8 @@ die_if_kernel(char * str, struct pt_regs
444 #ifdef CONFIG_SMP 455 #ifdef CONFIG_SMP
445 printk("CPU %d ", hard_smp_processor_id()); 456 printk("CPU %d ", hard_smp_processor_id());
446 #endif 457 #endif
447- printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err); 458- printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err);
448+ printk("%s(%d[#%u]): %s %ld\n", current->comm, 459+ printk("%s(%d[#%u]): %s %ld\n", current->comm,
449+ current->pid, current->xid, str, err); 460+ current->pid, current->xid, str, err);
450 dik_show_regs(regs, r9_15); 461 dik_show_regs(regs, r9_15);
451 dik_show_trace((unsigned long *)(regs+1)); 462 dik_show_trace((unsigned long *)(regs+1));
452 dik_show_code((unsigned int *)regs->pc); 463 dik_show_code((unsigned int *)regs->pc);
453diff -NurpP --minimal linux-2.6.18.2/arch/alpha/mm/init.c linux-2.6.18.2-vs2.1.1/arch/alpha/mm/init.c 464Index: linux-2.6.18/arch/alpha/mm/init.c
454--- linux-2.6.18.2/arch/alpha/mm/init.c 2006-09-20 16:57:57 +0200 465===================================================================
455+++ linux-2.6.18.2-vs2.1.1/arch/alpha/mm/init.c 2006-09-20 17:01:44 +0200 466--- linux-2.6.18.orig/arch/alpha/mm/init.c
467+++ linux-2.6.18/arch/alpha/mm/init.c
456@@ -20,6 +20,7 @@ 468@@ -20,6 +20,7 @@
457 #include <linux/init.h> 469 #include <linux/init.h>
458 #include <linux/bootmem.h> /* max_low_pfn */ 470 #include <linux/bootmem.h> /* max_low_pfn */
459 #include <linux/vmalloc.h> 471 #include <linux/vmalloc.h>
460+#include <linux/pagemap.h> 472+#include <linux/pagemap.h>
461 473
462 #include <asm/system.h> 474 #include <asm/system.h>
463 #include <asm/uaccess.h> 475 #include <asm/uaccess.h>
464diff -NurpP --minimal linux-2.6.18.2/arch/arm/Kconfig linux-2.6.18.2-vs2.1.1/arch/arm/Kconfig 476Index: linux-2.6.18/arch/arm/Kconfig
465--- linux-2.6.18.2/arch/arm/Kconfig 2006-09-20 16:57:57 +0200 477===================================================================
466+++ linux-2.6.18.2-vs2.1.1/arch/arm/Kconfig 2006-09-20 17:01:44 +0200 478--- linux-2.6.18.orig/arch/arm/Kconfig
479+++ linux-2.6.18/arch/arm/Kconfig
467@@ -907,6 +907,8 @@ source "arch/arm/oprofile/Kconfig" 480@@ -908,6 +908,8 @@ source "arch/arm/oprofile/Kconfig"
468 481
469 source "arch/arm/Kconfig.debug" 482 source "arch/arm/Kconfig.debug"
470 483
471+source "kernel/vserver/Kconfig" 484+source "kernel/vserver/Kconfig"
472+ 485+
473 source "security/Kconfig" 486 source "security/Kconfig"
474 487
475 source "crypto/Kconfig" 488 source "crypto/Kconfig"
476diff -NurpP --minimal linux-2.6.18.2/arch/arm/kernel/calls.S linux-2.6.18.2-vs2.1.1/arch/arm/kernel/calls.S 489Index: linux-2.6.18/arch/arm/kernel/calls.S
477--- linux-2.6.18.2/arch/arm/kernel/calls.S 2006-02-18 14:39:40 +0100 490===================================================================
478+++ linux-2.6.18.2-vs2.1.1/arch/arm/kernel/calls.S 2006-09-20 17:01:44 +0200 491--- linux-2.6.18.orig/arch/arm/kernel/calls.S
492+++ linux-2.6.18/arch/arm/kernel/calls.S
479@@ -322,7 +322,7 @@ 493@@ -322,7 +322,7 @@
480 /* 310 */ CALL(sys_request_key) 494 /* 310 */ CALL(sys_request_key)
481 CALL(sys_keyctl) 495 CALL(sys_keyctl)
482 CALL(ABI(sys_semtimedop, sys_oabi_semtimedop)) 496 CALL(ABI(sys_semtimedop, sys_oabi_semtimedop))
483-/* vserver */ CALL(sys_ni_syscall) 497-/* vserver */ CALL(sys_ni_syscall)
484+ CALL(sys_vserver) 498+ CALL(sys_vserver)
485 CALL(sys_ioprio_set) 499 CALL(sys_ioprio_set)
486 /* 315 */ CALL(sys_ioprio_get) 500 /* 315 */ CALL(sys_ioprio_get)
487 CALL(sys_inotify_init) 501 CALL(sys_inotify_init)
488diff -NurpP --minimal linux-2.6.18.2/arch/arm/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/arm/kernel/process.c 502Index: linux-2.6.18/arch/arm/kernel/process.c
489--- linux-2.6.18.2/arch/arm/kernel/process.c 2006-09-20 16:57:57 +0200 503===================================================================
490+++ linux-2.6.18.2-vs2.1.1/arch/arm/kernel/process.c 2006-09-25 15:40:02 +0200 504--- linux-2.6.18.orig/arch/arm/kernel/process.c
505+++ linux-2.6.18/arch/arm/kernel/process.c
491@@ -236,7 +236,8 @@ void __show_regs(struct pt_regs *regs) 506@@ -236,7 +236,8 @@ void __show_regs(struct pt_regs *regs)
492 void show_regs(struct pt_regs * regs) 507 void show_regs(struct pt_regs * regs)
493 { 508 {
494 printk("\n"); 509 printk("\n");
495- printk("Pid: %d, comm: %20s\n", current->pid, current->comm); 510- printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
506+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 521+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
507+ 0, &regs, 0, NULL, NULL); 522+ 0, &regs, 0, NULL, NULL);
508 } 523 }
509 EXPORT_SYMBOL(kernel_thread); 524 EXPORT_SYMBOL(kernel_thread);
510 525
511diff -NurpP --minimal linux-2.6.18.2/arch/arm/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/arm/kernel/traps.c 526Index: linux-2.6.18/arch/arm/kernel/traps.c
512--- linux-2.6.18.2/arch/arm/kernel/traps.c 2006-09-20 16:57:57 +0200 527===================================================================
513+++ linux-2.6.18.2-vs2.1.1/arch/arm/kernel/traps.c 2006-10-28 19:27:58 +0200 528--- linux-2.6.18.orig/arch/arm/kernel/traps.c
529+++ linux-2.6.18/arch/arm/kernel/traps.c
514@@ -205,8 +205,8 @@ static void __die(const char *str, int e 530@@ -205,8 +205,8 @@ static void __die(const char *str, int e
515 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter); 531 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter);
516 print_modules(); 532 print_modules();
517 __show_regs(regs); 533 __show_regs(regs);
518- printk("Process %s (pid: %d, stack limit = 0x%p)\n", 534- printk("Process %s (pid: %d, stack limit = 0x%p)\n",
520+ printk("Process %s (pid: %d:#%u, stack limit = 0x%p)\n", 536+ printk("Process %s (pid: %d:#%u, stack limit = 0x%p)\n",
521+ tsk->comm, tsk->pid, tsk->xid, thread + 1); 537+ tsk->comm, tsk->pid, tsk->xid, thread + 1);
522 538
523 if (!user_mode(regs) || in_interrupt()) { 539 if (!user_mode(regs) || in_interrupt()) {
524 dump_mem("Stack: ", regs->ARM_sp, 540 dump_mem("Stack: ", regs->ARM_sp,
525diff -NurpP --minimal linux-2.6.18.2/arch/arm26/Kconfig linux-2.6.18.2-vs2.1.1/arch/arm26/Kconfig 541Index: linux-2.6.18/arch/arm26/Kconfig
526--- linux-2.6.18.2/arch/arm26/Kconfig 2006-09-20 16:57:57 +0200 542===================================================================
527+++ linux-2.6.18.2-vs2.1.1/arch/arm26/Kconfig 2006-09-20 17:01:44 +0200 543--- linux-2.6.18.orig/arch/arm26/Kconfig
544+++ linux-2.6.18/arch/arm26/Kconfig
528@@ -234,6 +234,8 @@ source "drivers/usb/Kconfig" 545@@ -234,6 +234,8 @@ source "drivers/usb/Kconfig"
529 546
530 source "arch/arm26/Kconfig.debug" 547 source "arch/arm26/Kconfig.debug"
531 548
532+source "kernel/vserver/Kconfig" 549+source "kernel/vserver/Kconfig"
533+ 550+
534 source "security/Kconfig" 551 source "security/Kconfig"
535 552
536 source "crypto/Kconfig" 553 source "crypto/Kconfig"
537diff -NurpP --minimal linux-2.6.18.2/arch/arm26/kernel/calls.S linux-2.6.18.2-vs2.1.1/arch/arm26/kernel/calls.S 554Index: linux-2.6.18/arch/arm26/kernel/calls.S
538--- linux-2.6.18.2/arch/arm26/kernel/calls.S 2005-03-02 12:38:19 +0100 555===================================================================
539+++ linux-2.6.18.2-vs2.1.1/arch/arm26/kernel/calls.S 2006-09-20 17:01:44 +0200 556--- linux-2.6.18.orig/arch/arm26/kernel/calls.S
557+++ linux-2.6.18/arch/arm26/kernel/calls.S
540@@ -257,6 +257,11 @@ __syscall_start: 558@@ -257,6 +257,11 @@ __syscall_start:
541 .long sys_lremovexattr 559 .long sys_lremovexattr
542 .long sys_fremovexattr 560 .long sys_fremovexattr
543 .long sys_tkill 561 .long sys_tkill
544+ 562+
547+ .endr 565+ .endr
548+ .long sys_vserver /* 313 */ 566+ .long sys_vserver /* 313 */
549 __syscall_end: 567 __syscall_end:
550 568
551 .rept NR_syscalls - (__syscall_end - __syscall_start) / 4 569 .rept NR_syscalls - (__syscall_end - __syscall_start) / 4
552diff -NurpP --minimal linux-2.6.18.2/arch/arm26/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/arm26/kernel/process.c 570Index: linux-2.6.18/arch/arm26/kernel/process.c
553--- linux-2.6.18.2/arch/arm26/kernel/process.c 2006-09-20 16:57:57 +0200 571===================================================================
554+++ linux-2.6.18.2-vs2.1.1/arch/arm26/kernel/process.c 2006-09-25 15:40:02 +0200 572--- linux-2.6.18.orig/arch/arm26/kernel/process.c
573+++ linux-2.6.18/arch/arm26/kernel/process.c
555@@ -365,7 +365,8 @@ pid_t kernel_thread(int (*fn)(void *), v 574@@ -365,7 +365,8 @@ pid_t kernel_thread(int (*fn)(void *), v
556 regs.ARM_r3 = (unsigned long)do_exit; 575 regs.ARM_r3 = (unsigned long)do_exit;
557 regs.ARM_pc = (unsigned long)kernel_thread_helper | MODE_SVC26; 576 regs.ARM_pc = (unsigned long)kernel_thread_helper | MODE_SVC26;
558 577
559- return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 578- return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
560+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 579+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
561+ 0, &regs, 0, NULL, NULL); 580+ 0, &regs, 0, NULL, NULL);
562 } 581 }
563 EXPORT_SYMBOL(kernel_thread); 582 EXPORT_SYMBOL(kernel_thread);
564 583
565diff -NurpP --minimal linux-2.6.18.2/arch/arm26/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/arm26/kernel/traps.c 584Index: linux-2.6.18/arch/arm26/kernel/traps.c
566--- linux-2.6.18.2/arch/arm26/kernel/traps.c 2006-09-20 16:57:57 +0200 585===================================================================
567+++ linux-2.6.18.2-vs2.1.1/arch/arm26/kernel/traps.c 2006-09-20 17:01:44 +0200 586--- linux-2.6.18.orig/arch/arm26/kernel/traps.c
587+++ linux-2.6.18/arch/arm26/kernel/traps.c
568@@ -185,8 +185,9 @@ NORET_TYPE void die(const char *str, str 588@@ -185,8 +185,9 @@ NORET_TYPE void die(const char *str, str
569 printk("Internal error: %s: %x\n", str, err); 589 printk("Internal error: %s: %x\n", str, err);
570 printk("CPU: %d\n", smp_processor_id()); 590 printk("CPU: %d\n", smp_processor_id());
571 show_regs(regs); 591 show_regs(regs);
572- printk("Process %s (pid: %d, stack limit = 0x%p)\n", 592- printk("Process %s (pid: %d, stack limit = 0x%p)\n",
575+ current->comm, current->pid, 595+ current->comm, current->pid,
576+ current->xid, end_of_stack(tsk)); 596+ current->xid, end_of_stack(tsk));
577 597
578 if (!user_mode(regs) || in_interrupt()) { 598 if (!user_mode(regs) || in_interrupt()) {
579 __dump_stack(tsk, (unsigned long)(regs + 1)); 599 __dump_stack(tsk, (unsigned long)(regs + 1));
580diff -NurpP --minimal linux-2.6.18.2/arch/cris/Kconfig linux-2.6.18.2-vs2.1.1/arch/cris/Kconfig 600Index: linux-2.6.18/arch/cris/Kconfig
581--- linux-2.6.18.2/arch/cris/Kconfig 2006-09-20 16:57:57 +0200 601===================================================================
582+++ linux-2.6.18.2-vs2.1.1/arch/cris/Kconfig 2006-09-20 17:01:44 +0200 602--- linux-2.6.18.orig/arch/cris/Kconfig
603+++ linux-2.6.18/arch/cris/Kconfig
583@@ -185,6 +185,8 @@ source "drivers/usb/Kconfig" 604@@ -185,6 +185,8 @@ source "drivers/usb/Kconfig"
584 605
585 source "arch/cris/Kconfig.debug" 606 source "arch/cris/Kconfig.debug"
586 607
587+source "kernel/vserver/Kconfig" 608+source "kernel/vserver/Kconfig"
588+ 609+
589 source "security/Kconfig" 610 source "security/Kconfig"
590 611
591 source "crypto/Kconfig" 612 source "crypto/Kconfig"
592diff -NurpP --minimal linux-2.6.18.2/arch/cris/arch-v10/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/cris/arch-v10/kernel/process.c 613Index: linux-2.6.18/arch/cris/arch-v10/kernel/process.c
614===================================================================
593--- linux-2.6.18.2/arch/cris/arch-v10/kernel/process.c 2006-09-20 16:57:57 +0200 615--- linux-2.6.18.orig/arch/cris/arch-v10/kernel/process.c
594+++ linux-2.6.18.2-vs2.1.1/arch/cris/arch-v10/kernel/process.c 2006-09-25 15:40:02 +0200 616+++ linux-2.6.18/arch/cris/arch-v10/kernel/process.c
595@@ -103,7 +103,8 @@ int kernel_thread(int (*fn)(void *), voi 617@@ -103,7 +103,8 @@ int kernel_thread(int (*fn)(void *), voi
596 regs.dccr = 1 << I_DCCR_BITNR; 618 regs.dccr = 1 << I_DCCR_BITNR;
597 619
598 /* Ok, create the new process.. */ 620 /* Ok, create the new process.. */
599- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 621- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
600+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 622+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
601+ 0, &regs, 0, NULL, NULL); 623+ 0, &regs, 0, NULL, NULL);
602 } 624 }
603 625
604 /* setup the child's kernel stack with a pt_regs and switch_stack on it. 626 /* setup the child's kernel stack with a pt_regs and switch_stack on it.
605diff -NurpP --minimal linux-2.6.18.2/arch/cris/arch-v32/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/cris/arch-v32/kernel/process.c 627Index: linux-2.6.18/arch/cris/arch-v32/kernel/process.c
628===================================================================
606--- linux-2.6.18.2/arch/cris/arch-v32/kernel/process.c 2006-09-20 16:57:57 +0200 629--- linux-2.6.18.orig/arch/cris/arch-v32/kernel/process.c
607+++ linux-2.6.18.2-vs2.1.1/arch/cris/arch-v32/kernel/process.c 2006-09-25 15:40:02 +0200 630+++ linux-2.6.18/arch/cris/arch-v32/kernel/process.c
608@@ -120,7 +120,8 @@ kernel_thread(int (*fn)(void *), void * 631@@ -120,7 +120,8 @@ kernel_thread(int (*fn)(void *), void *
609 regs.ccs = 1 << (I_CCS_BITNR + CCS_SHIFT); 632 regs.ccs = 1 << (I_CCS_BITNR + CCS_SHIFT);
610 633
611 /* Create the new process. */ 634 /* Create the new process. */
612- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 635- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
613+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 636+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
614+ 0, &regs, 0, NULL, NULL); 637+ 0, &regs, 0, NULL, NULL);
615 } 638 }
616 639
617 /* 640 /*
618diff -NurpP --minimal linux-2.6.18.2/arch/cris/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/cris/kernel/irq.c 641Index: linux-2.6.18/arch/cris/kernel/irq.c
619--- linux-2.6.18.2/arch/cris/kernel/irq.c 2006-09-20 16:57:57 +0200 642===================================================================
620+++ linux-2.6.18.2-vs2.1.1/arch/cris/kernel/irq.c 2006-10-13 20:52:32 +0200 643--- linux-2.6.18.orig/arch/cris/kernel/irq.c
644+++ linux-2.6.18/arch/cris/kernel/irq.c
621@@ -35,6 +35,7 @@ 645@@ -35,6 +35,7 @@
622 #include <linux/seq_file.h> 646 #include <linux/seq_file.h>
623 #include <linux/errno.h> 647 #include <linux/errno.h>
624 #include <linux/spinlock.h> 648 #include <linux/spinlock.h>
625+#include <linux/vs_context.h> 649+#include <linux/vs_context.h>
642 __do_IRQ(irq, regs); 666 __do_IRQ(irq, regs);
643+ __leave_vx_admin(&vxis); 667+ __leave_vx_admin(&vxis);
644 irq_exit(); 668 irq_exit();
645 } 669 }
646 670
647diff -NurpP --minimal linux-2.6.18.2/arch/frv/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/frv/kernel/irq.c 671Index: linux-2.6.18/arch/frv/kernel/irq.c
648--- linux-2.6.18.2/arch/frv/kernel/irq.c 2006-09-20 16:57:57 +0200 672===================================================================
649+++ linux-2.6.18.2-vs2.1.1/arch/frv/kernel/irq.c 2006-10-13 20:52:40 +0200 673--- linux-2.6.18.orig/arch/frv/kernel/irq.c
674+++ linux-2.6.18/arch/frv/kernel/irq.c
650@@ -32,6 +32,7 @@ 675@@ -32,6 +32,7 @@
651 #include <linux/proc_fs.h> 676 #include <linux/proc_fs.h>
652 #include <linux/seq_file.h> 677 #include <linux/seq_file.h>
653 #include <linux/module.h> 678 #include <linux/module.h>
654+#include <linux/vs_context.h> 679+#include <linux/vs_context.h>
672 source->doirq(source); 697 source->doirq(source);
673+ __leave_vx_admin(&vxis); 698+ __leave_vx_admin(&vxis);
674 699
675 __clr_MASK(level); 700 __clr_MASK(level);
676 701
677diff -NurpP --minimal linux-2.6.18.2/arch/frv/kernel/kernel_thread.S linux-2.6.18.2-vs2.1.1/arch/frv/kernel/kernel_thread.S 702Index: linux-2.6.18/arch/frv/kernel/kernel_thread.S
703===================================================================
678--- linux-2.6.18.2/arch/frv/kernel/kernel_thread.S 2005-03-02 12:38:20 +0100 704--- linux-2.6.18.orig/arch/frv/kernel/kernel_thread.S
679+++ linux-2.6.18.2-vs2.1.1/arch/frv/kernel/kernel_thread.S 2006-09-25 15:40:02 +0200 705+++ linux-2.6.18/arch/frv/kernel/kernel_thread.S
680@@ -13,6 +13,8 @@ 706@@ -13,6 +13,8 @@
681 #include <asm/unistd.h> 707 #include <asm/unistd.h>
682 708
683 #define CLONE_VM 0x00000100 /* set if VM shared between processes */ 709 #define CLONE_VM 0x00000100 /* set if VM shared between processes */
684+#define CLONE_KTHREAD 0x10000000 /* kernel thread */ 710+#define CLONE_KTHREAD 0x10000000 /* kernel thread */
693- ori gr10,#CLONE_VM,gr8 ; first syscall arg [clone_flags] 719- ori gr10,#CLONE_VM,gr8 ; first syscall arg [clone_flags]
694+ ori gr10,#CLONE_KT,gr8 ; first syscall arg [clone_flags] 720+ ori gr10,#CLONE_KT,gr8 ; first syscall arg [clone_flags]
695 sethi.p #0xe4e4,gr9 ; second syscall arg [newsp] 721 sethi.p #0xe4e4,gr9 ; second syscall arg [newsp]
696 setlo #0xe4e4,gr9 722 setlo #0xe4e4,gr9
697 setlos.p #0,gr10 ; third syscall arg [parent_tidptr] 723 setlos.p #0,gr10 ; third syscall arg [parent_tidptr]
698diff -NurpP --minimal linux-2.6.18.2/arch/h8300/Kconfig linux-2.6.18.2-vs2.1.1/arch/h8300/Kconfig 724Index: linux-2.6.18/arch/h8300/Kconfig
699--- linux-2.6.18.2/arch/h8300/Kconfig 2006-06-18 04:51:49 +0200 725===================================================================
700+++ linux-2.6.18.2-vs2.1.1/arch/h8300/Kconfig 2006-09-20 17:01:44 +0200 726--- linux-2.6.18.orig/arch/h8300/Kconfig
727+++ linux-2.6.18/arch/h8300/Kconfig
701@@ -199,6 +199,8 @@ source "fs/Kconfig" 728@@ -199,6 +199,8 @@ source "fs/Kconfig"
702 729
703 source "arch/h8300/Kconfig.debug" 730 source "arch/h8300/Kconfig.debug"
704 731
705+source "kernel/vserver/Kconfig" 732+source "kernel/vserver/Kconfig"
706+ 733+
707 source "security/Kconfig" 734 source "security/Kconfig"
708 735
709 source "crypto/Kconfig" 736 source "crypto/Kconfig"
710diff -NurpP --minimal linux-2.6.18.2/arch/h8300/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/h8300/kernel/process.c 737Index: linux-2.6.18/arch/h8300/kernel/process.c
711--- linux-2.6.18.2/arch/h8300/kernel/process.c 2006-09-20 16:57:58 +0200 738===================================================================
712+++ linux-2.6.18.2-vs2.1.1/arch/h8300/kernel/process.c 2006-09-25 15:40:02 +0200 739--- linux-2.6.18.orig/arch/h8300/kernel/process.c
740+++ linux-2.6.18/arch/h8300/kernel/process.c
713@@ -134,7 +134,7 @@ int kernel_thread(int (*fn)(void *), voi 741@@ -134,7 +134,7 @@ int kernel_thread(int (*fn)(void *), voi
714 742
715 fs = get_fs(); 743 fs = get_fs();
716 set_fs (KERNEL_DS); 744 set_fs (KERNEL_DS);
717- clone_arg = flags | CLONE_VM; 745- clone_arg = flags | CLONE_VM;
718+ clone_arg = flags | CLONE_VM | CLONE_KTHREAD; 746+ clone_arg = flags | CLONE_VM | CLONE_KTHREAD;
719 __asm__("mov.l sp,er3\n\t" 747 __asm__("mov.l sp,er3\n\t"
720 "sub.l er2,er2\n\t" 748 "sub.l er2,er2\n\t"
721 "mov.l %2,er1\n\t" 749 "mov.l %2,er1\n\t"
722diff -NurpP --minimal linux-2.6.18.2/arch/i386/Kconfig linux-2.6.18.2-vs2.1.1/arch/i386/Kconfig 750Index: linux-2.6.18/arch/i386/Kconfig
723--- linux-2.6.18.2/arch/i386/Kconfig 2006-09-20 16:57:58 +0200 751===================================================================
724+++ linux-2.6.18.2-vs2.1.1/arch/i386/Kconfig 2006-09-20 17:01:44 +0200 752--- linux-2.6.18.orig/arch/i386/Kconfig
753+++ linux-2.6.18/arch/i386/Kconfig
725@@ -1142,6 +1142,8 @@ endmenu 754@@ -1142,6 +1142,8 @@ endmenu
726 755
727 source "arch/i386/Kconfig.debug" 756 source "arch/i386/Kconfig.debug"
728 757
729+source "kernel/vserver/Kconfig" 758+source "kernel/vserver/Kconfig"
730+ 759+
731 source "security/Kconfig" 760 source "security/Kconfig"
732 761
733 source "crypto/Kconfig" 762 source "crypto/Kconfig"
734diff -NurpP --minimal linux-2.6.18.2/arch/i386/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/i386/kernel/irq.c 763Index: linux-2.6.18/arch/i386/kernel/irq.c
735--- linux-2.6.18.2/arch/i386/kernel/irq.c 2006-09-20 16:57:58 +0200 764===================================================================
736+++ linux-2.6.18.2-vs2.1.1/arch/i386/kernel/irq.c 2006-10-13 20:52:50 +0200 765--- linux-2.6.18.orig/arch/i386/kernel/irq.c
766+++ linux-2.6.18/arch/i386/kernel/irq.c
737@@ -18,6 +18,7 @@ 767@@ -18,6 +18,7 @@
738 #include <linux/notifier.h> 768 #include <linux/notifier.h>
739 #include <linux/cpu.h> 769 #include <linux/cpu.h>
740 #include <linux/delay.h> 770 #include <linux/delay.h>
741+#include <linux/vs_context.h> 771+#include <linux/vs_context.h>
765 __do_IRQ(irq, regs); 795 __do_IRQ(irq, regs);
766+ __leave_vx_admin(&vxis); 796+ __leave_vx_admin(&vxis);
767 797
768 irq_exit(); 798 irq_exit();
769 799
770diff -NurpP --minimal linux-2.6.18.2/arch/i386/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/i386/kernel/process.c 800Index: linux-2.6.18/arch/i386/kernel/process.c
771--- linux-2.6.18.2/arch/i386/kernel/process.c 2006-09-20 16:57:58 +0200 801===================================================================
772+++ linux-2.6.18.2-vs2.1.1/arch/i386/kernel/process.c 2006-09-25 15:40:02 +0200 802--- linux-2.6.18.orig/arch/i386/kernel/process.c
803+++ linux-2.6.18/arch/i386/kernel/process.c
773@@ -289,8 +289,10 @@ void show_regs(struct pt_regs * regs) 804@@ -289,8 +289,10 @@ void show_regs(struct pt_regs * regs)
774 unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; 805 unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
775 806
776 printk("\n"); 807 printk("\n");
777- printk("Pid: %d, comm: %20s\n", current->pid, current->comm); 808- printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
791+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 822+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
792+ 0, &regs, 0, NULL, NULL); 823+ 0, &regs, 0, NULL, NULL);
793 } 824 }
794 EXPORT_SYMBOL(kernel_thread); 825 EXPORT_SYMBOL(kernel_thread);
795 826
796diff -NurpP --minimal linux-2.6.18.2/arch/i386/kernel/sys_i386.c linux-2.6.18.2-vs2.1.1/arch/i386/kernel/sys_i386.c 827Index: linux-2.6.18/arch/i386/kernel/sys_i386.c
797--- linux-2.6.18.2/arch/i386/kernel/sys_i386.c 2006-06-18 04:51:53 +0200 828===================================================================
798+++ linux-2.6.18.2-vs2.1.1/arch/i386/kernel/sys_i386.c 2006-09-20 17:01:44 +0200 829--- linux-2.6.18.orig/arch/i386/kernel/sys_i386.c
830+++ linux-2.6.18/arch/i386/kernel/sys_i386.c
799@@ -19,6 +19,7 @@ 831@@ -19,6 +19,7 @@
800 #include <linux/mman.h> 832 #include <linux/mman.h>
801 #include <linux/file.h> 833 #include <linux/file.h>
802 #include <linux/utsname.h> 834 #include <linux/utsname.h>
803+#include <linux/vs_cvirt.h> 835+#include <linux/vs_cvirt.h>
841- error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); 873- error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
842+ error |= __copy_to_user(&name->machine,ptr->machine,__OLD_UTS_LEN); 874+ error |= __copy_to_user(&name->machine,ptr->machine,__OLD_UTS_LEN);
843 error |= __put_user(0,name->machine+__OLD_UTS_LEN); 875 error |= __put_user(0,name->machine+__OLD_UTS_LEN);
844 876
845 up_read(&uts_sem); 877 up_read(&uts_sem);
846diff -NurpP --minimal linux-2.6.18.2/arch/i386/kernel/syscall_table.S linux-2.6.18.2-vs2.1.1/arch/i386/kernel/syscall_table.S 878Index: linux-2.6.18/arch/i386/kernel/syscall_table.S
879===================================================================
847--- linux-2.6.18.2/arch/i386/kernel/syscall_table.S 2006-09-20 16:57:58 +0200 880--- linux-2.6.18.orig/arch/i386/kernel/syscall_table.S
848+++ linux-2.6.18.2-vs2.1.1/arch/i386/kernel/syscall_table.S 2006-09-20 17:01:44 +0200 881+++ linux-2.6.18/arch/i386/kernel/syscall_table.S
849@@ -272,7 +272,7 @@ ENTRY(sys_call_table) 882@@ -272,7 +272,7 @@ ENTRY(sys_call_table)
850 .long sys_tgkill /* 270 */ 883 .long sys_tgkill /* 270 */
851 .long sys_utimes 884 .long sys_utimes
852 .long sys_fadvise64_64 885 .long sys_fadvise64_64
853- .long sys_ni_syscall /* sys_vserver */ 886- .long sys_ni_syscall /* sys_vserver */
854+ .long sys_vserver 887+ .long sys_vserver
855 .long sys_mbind 888 .long sys_mbind
856 .long sys_get_mempolicy 889 .long sys_get_mempolicy
857 .long sys_set_mempolicy 890 .long sys_set_mempolicy
858diff -NurpP --minimal linux-2.6.18.2/arch/i386/kernel/sysenter.c linux-2.6.18.2-vs2.1.1/arch/i386/kernel/sysenter.c 891Index: linux-2.6.18/arch/i386/kernel/sysenter.c
859--- linux-2.6.18.2/arch/i386/kernel/sysenter.c 2006-09-20 16:57:58 +0200 892===================================================================
860+++ linux-2.6.18.2-vs2.1.1/arch/i386/kernel/sysenter.c 2006-09-20 21:46:26 +0200 893--- linux-2.6.18.orig/arch/i386/kernel/sysenter.c
894+++ linux-2.6.18/arch/i386/kernel/sysenter.c
861@@ -17,6 +17,7 @@ 895@@ -17,6 +17,7 @@
862 #include <linux/elf.h> 896 #include <linux/elf.h>
863 #include <linux/mm.h> 897 #include <linux/mm.h>
864 #include <linux/module.h> 898 #include <linux/module.h>
865+#include <linux/vs_memory.h> 899+#include <linux/vs_memory.h>
873- mm->total_vm++; 907- mm->total_vm++;
874+ vx_vmpages_inc(mm); 908+ vx_vmpages_inc(mm);
875 up_fail: 909 up_fail:
876 up_write(&mm->mmap_sem); 910 up_write(&mm->mmap_sem);
877 return ret; 911 return ret;
878diff -NurpP --minimal linux-2.6.18.2/arch/i386/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/i386/kernel/traps.c 912Index: linux-2.6.18/arch/i386/kernel/traps.c
879--- linux-2.6.18.2/arch/i386/kernel/traps.c 2006-09-20 16:57:58 +0200 913===================================================================
880+++ linux-2.6.18.2-vs2.1.1/arch/i386/kernel/traps.c 2006-09-25 15:40:02 +0200 914--- linux-2.6.18.orig/arch/i386/kernel/traps.c
915+++ linux-2.6.18/arch/i386/kernel/traps.c
881@@ -53,6 +53,8 @@ 916@@ -53,6 +53,8 @@
882 #include <asm/kdebug.h> 917 #include <asm/kdebug.h>
883 918
884 #include <linux/module.h> 919 #include <linux/module.h>
885+#include <linux/vserver/debug.h> 920+#include <linux/vserver/debug.h>
917 show_registers(regs); 952 show_registers(regs);
918+ vxh_dump_history(); 953+ vxh_dump_history();
919 /* Executive summary in case the oops scrolled away */ 954 /* Executive summary in case the oops scrolled away */
920 esp = (unsigned long) (&regs->esp); 955 esp = (unsigned long) (&regs->esp);
921 savesegment(ss, ss); 956 savesegment(ss, ss);
922diff -NurpP --minimal linux-2.6.18.2/arch/ia64/Kconfig linux-2.6.18.2-vs2.1.1/arch/ia64/Kconfig 957Index: linux-2.6.18/arch/ia64/Kconfig
923--- linux-2.6.18.2/arch/ia64/Kconfig 2006-09-20 16:57:58 +0200 958===================================================================
924+++ linux-2.6.18.2-vs2.1.1/arch/ia64/Kconfig 2006-09-20 17:01:44 +0200 959--- linux-2.6.18.orig/arch/ia64/Kconfig
960+++ linux-2.6.18/arch/ia64/Kconfig
925@@ -525,6 +525,8 @@ endmenu 961@@ -525,6 +525,8 @@ endmenu
926 962
927 source "arch/ia64/Kconfig.debug" 963 source "arch/ia64/Kconfig.debug"
928 964
929+source "kernel/vserver/Kconfig" 965+source "kernel/vserver/Kconfig"
930+ 966+
931 source "security/Kconfig" 967 source "security/Kconfig"
932 968
933 source "crypto/Kconfig" 969 source "crypto/Kconfig"
934diff -NurpP --minimal linux-2.6.18.2/arch/ia64/ia32/binfmt_elf32.c linux-2.6.18.2-vs2.1.1/arch/ia64/ia32/binfmt_elf32.c 970Index: linux-2.6.18/arch/ia64/ia32/binfmt_elf32.c
971===================================================================
935--- linux-2.6.18.2/arch/ia64/ia32/binfmt_elf32.c 2006-09-20 16:57:58 +0200 972--- linux-2.6.18.orig/arch/ia64/ia32/binfmt_elf32.c
936+++ linux-2.6.18.2-vs2.1.1/arch/ia64/ia32/binfmt_elf32.c 2006-09-20 17:01:44 +0200 973+++ linux-2.6.18/arch/ia64/ia32/binfmt_elf32.c
937@@ -238,7 +238,8 @@ ia32_setup_arg_pages (struct linux_binpr 974@@ -238,7 +238,8 @@ ia32_setup_arg_pages (struct linux_binpr
938 kmem_cache_free(vm_area_cachep, mpnt); 975 kmem_cache_free(vm_area_cachep, mpnt);
939 return ret; 976 return ret;
940 } 977 }
941- current->mm->stack_vm = current->mm->total_vm = vma_pages(mpnt); 978- current->mm->stack_vm = current->mm->total_vm = vma_pages(mpnt);
942+ vx_vmpages_sub(current->mm, current->mm->total_vm - vma_pages(mpnt)); 979+ vx_vmpages_sub(current->mm, current->mm->total_vm - vma_pages(mpnt));
943+ current->mm->stack_vm = current->mm->total_vm; 980+ current->mm->stack_vm = current->mm->total_vm;
944 } 981 }
945 982
946 for (i = 0 ; i < MAX_ARG_PAGES ; i++) { 983 for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
947diff -NurpP --minimal linux-2.6.18.2/arch/ia64/ia32/ia32_entry.S linux-2.6.18.2-vs2.1.1/arch/ia64/ia32/ia32_entry.S 984Index: linux-2.6.18/arch/ia64/ia32/ia32_entry.S
948--- linux-2.6.18.2/arch/ia64/ia32/ia32_entry.S 2006-06-18 04:51:55 +0200 985===================================================================
949+++ linux-2.6.18.2-vs2.1.1/arch/ia64/ia32/ia32_entry.S 2006-09-20 17:01:44 +0200 986--- linux-2.6.18.orig/arch/ia64/ia32/ia32_entry.S
987+++ linux-2.6.18/arch/ia64/ia32/ia32_entry.S
950@@ -483,7 +483,7 @@ ia32_syscall_table: 988@@ -483,7 +483,7 @@ ia32_syscall_table:
951 data8 sys_tgkill /* 270 */ 989 data8 sys_tgkill /* 270 */
952 data8 compat_sys_utimes 990 data8 compat_sys_utimes
953 data8 sys32_fadvise64_64 991 data8 sys32_fadvise64_64
954- data8 sys_ni_syscall 992- data8 sys_ni_syscall
955+ data8 sys32_vserver 993+ data8 sys32_vserver
956 data8 sys_ni_syscall 994 data8 sys_ni_syscall
957 data8 sys_ni_syscall /* 275 */ 995 data8 sys_ni_syscall /* 275 */
958 data8 sys_ni_syscall 996 data8 sys_ni_syscall
959diff -NurpP --minimal linux-2.6.18.2/arch/ia64/ia32/sys_ia32.c linux-2.6.18.2-vs2.1.1/arch/ia64/ia32/sys_ia32.c 997Index: linux-2.6.18/arch/ia64/ia32/sys_ia32.c
960--- linux-2.6.18.2/arch/ia64/ia32/sys_ia32.c 2006-09-20 16:57:58 +0200 998===================================================================
961+++ linux-2.6.18.2-vs2.1.1/arch/ia64/ia32/sys_ia32.c 2006-10-06 23:10:42 +0200 999--- linux-2.6.18.orig/arch/ia64/ia32/sys_ia32.c
1000+++ linux-2.6.18/arch/ia64/ia32/sys_ia32.c
962@@ -1177,7 +1177,7 @@ sys32_gettimeofday (struct compat_timeva 1001@@ -1177,7 +1177,7 @@ sys32_gettimeofday (struct compat_timeva
963 { 1002 {
964 if (tv) { 1003 if (tv) {
965 struct timeval ktv; 1004 struct timeval ktv;
966- do_gettimeofday(&ktv); 1005- do_gettimeofday(&ktv);
967+ vx_gettimeofday(&ktv); 1006+ vx_gettimeofday(&ktv);
968 if (put_tv32(tv, &ktv)) 1007 if (put_tv32(tv, &ktv))
969 return -EFAULT; 1008 return -EFAULT;
970 } 1009 }
971diff -NurpP --minimal linux-2.6.18.2/arch/ia64/kernel/asm-offsets.c linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/asm-offsets.c 1010Index: linux-2.6.18/arch/ia64/kernel/asm-offsets.c
1011===================================================================
972--- linux-2.6.18.2/arch/ia64/kernel/asm-offsets.c 2006-09-20 16:57:58 +0200 1012--- linux-2.6.18.orig/arch/ia64/kernel/asm-offsets.c
973+++ linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/asm-offsets.c 2006-09-25 15:40:02 +0200 1013+++ linux-2.6.18/arch/ia64/kernel/asm-offsets.c
974@@ -191,6 +191,7 @@ void foo(void) 1014@@ -191,6 +191,7 @@ void foo(void)
975 /* for assembly files which can't include sched.h: */ 1015 /* for assembly files which can't include sched.h: */
976 DEFINE(IA64_CLONE_VFORK, CLONE_VFORK); 1016 DEFINE(IA64_CLONE_VFORK, CLONE_VFORK);
977 DEFINE(IA64_CLONE_VM, CLONE_VM); 1017 DEFINE(IA64_CLONE_VM, CLONE_VM);
978+ DEFINE(IA64_CLONE_KTHREAD, CLONE_KTHREAD); 1018+ DEFINE(IA64_CLONE_KTHREAD, CLONE_KTHREAD);
979 1019
980 BLANK(); 1020 BLANK();
981 DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET, 1021 DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET,
982diff -NurpP --minimal linux-2.6.18.2/arch/ia64/kernel/entry.S linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/entry.S 1022Index: linux-2.6.18/arch/ia64/kernel/entry.S
983--- linux-2.6.18.2/arch/ia64/kernel/entry.S 2006-09-20 16:57:58 +0200 1023===================================================================
984+++ linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/entry.S 2006-09-20 17:01:44 +0200 1024--- linux-2.6.18.orig/arch/ia64/kernel/entry.S
1025+++ linux-2.6.18/arch/ia64/kernel/entry.S
985@@ -1576,7 +1576,7 @@ sys_call_table: 1026@@ -1576,7 +1576,7 @@ sys_call_table:
986 data8 sys_mq_notify 1027 data8 sys_mq_notify
987 data8 sys_mq_getsetattr 1028 data8 sys_mq_getsetattr
988 data8 sys_ni_syscall // reserved for kexec_load 1029 data8 sys_ni_syscall // reserved for kexec_load
989- data8 sys_ni_syscall // reserved for vserver 1030- data8 sys_ni_syscall // reserved for vserver
990+ data8 sys_vserver 1031+ data8 sys_vserver
991 data8 sys_waitid // 1270 1032 data8 sys_waitid // 1270
992 data8 sys_add_key 1033 data8 sys_add_key
993 data8 sys_request_key 1034 data8 sys_request_key
994diff -NurpP --minimal linux-2.6.18.2/arch/ia64/kernel/perfmon.c linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/perfmon.c 1035Index: linux-2.6.18/arch/ia64/kernel/perfmon.c
995--- linux-2.6.18.2/arch/ia64/kernel/perfmon.c 2006-09-20 16:57:58 +0200 1036===================================================================
996+++ linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/perfmon.c 2006-10-07 04:29:47 +0200 1037--- linux-2.6.18.orig/arch/ia64/kernel/perfmon.c
1038+++ linux-2.6.18/arch/ia64/kernel/perfmon.c
997@@ -40,6 +40,7 @@ 1039@@ -40,6 +40,7 @@
998 #include <linux/capability.h> 1040 #include <linux/capability.h>
999 #include <linux/rcupdate.h> 1041 #include <linux/rcupdate.h>
1000 #include <linux/completion.h> 1042 #include <linux/completion.h>
1001+#include <linux/vs_memory.h> 1043+#include <linux/vs_memory.h>
1009- mm->total_vm += size >> PAGE_SHIFT; 1051- mm->total_vm += size >> PAGE_SHIFT;
1010+ vx_vmpages_add(mm, size >> PAGE_SHIFT); 1052+ vx_vmpages_add(mm, size >> PAGE_SHIFT);
1011 vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, 1053 vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
1012 vma_pages(vma)); 1054 vma_pages(vma));
1013 up_write(&task->mm->mmap_sem); 1055 up_write(&task->mm->mmap_sem);
1014diff -NurpP --minimal linux-2.6.18.2/arch/ia64/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/process.c 1056Index: linux-2.6.18/arch/ia64/kernel/process.c
1015--- linux-2.6.18.2/arch/ia64/kernel/process.c 2006-09-20 16:57:58 +0200 1057===================================================================
1016+++ linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/process.c 2006-09-25 15:40:02 +0200 1058--- linux-2.6.18.orig/arch/ia64/kernel/process.c
1059+++ linux-2.6.18/arch/ia64/kernel/process.c
1017@@ -107,7 +107,8 @@ show_regs (struct pt_regs *regs) 1060@@ -107,7 +107,8 @@ show_regs (struct pt_regs *regs)
1018 unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri; 1061 unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
1019 1062
1020 print_modules(); 1063 print_modules();
1021- printk("\nPid: %d, CPU %d, comm: %20s\n", current->pid, smp_processor_id(), current->comm); 1064- printk("\nPid: %d, CPU %d, comm: %20s\n", current->pid, smp_processor_id(), current->comm);
1032+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 1075+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
1033+ 0, &regs.pt, 0, NULL, NULL); 1076+ 0, &regs.pt, 0, NULL, NULL);
1034 } 1077 }
1035 EXPORT_SYMBOL(kernel_thread); 1078 EXPORT_SYMBOL(kernel_thread);
1036 1079
1037diff -NurpP --minimal linux-2.6.18.2/arch/ia64/kernel/ptrace.c linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/ptrace.c 1080Index: linux-2.6.18/arch/ia64/kernel/ptrace.c
1038--- linux-2.6.18.2/arch/ia64/kernel/ptrace.c 2006-09-20 16:57:58 +0200 1081===================================================================
1039+++ linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/ptrace.c 2006-10-07 04:29:47 +0200 1082--- linux-2.6.18.orig/arch/ia64/kernel/ptrace.c
1083+++ linux-2.6.18/arch/ia64/kernel/ptrace.c
1040@@ -1442,6 +1442,9 @@ sys_ptrace (long request, pid_t pid, uns 1084@@ -1442,6 +1442,9 @@ sys_ptrace (long request, pid_t pid, uns
1041 read_unlock(&tasklist_lock); 1085 read_unlock(&tasklist_lock);
1042 if (!child) 1086 if (!child)
1043 goto out; 1087 goto out;
1044+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) 1088+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT))
1045+ goto out_tsk; 1089+ goto out_tsk;
1046+ 1090+
1047 ret = -EPERM; 1091 ret = -EPERM;
1048 if (pid == 1) /* no messing around with init! */ 1092 if (pid == 1) /* no messing around with init! */
1049 goto out_tsk; 1093 goto out_tsk;
1050diff -NurpP --minimal linux-2.6.18.2/arch/ia64/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/traps.c 1094Index: linux-2.6.18/arch/ia64/kernel/traps.c
1051--- linux-2.6.18.2/arch/ia64/kernel/traps.c 2006-09-20 16:57:58 +0200 1095===================================================================
1052+++ linux-2.6.18.2-vs2.1.1/arch/ia64/kernel/traps.c 2006-09-25 15:40:02 +0200 1096--- linux-2.6.18.orig/arch/ia64/kernel/traps.c
1097+++ linux-2.6.18/arch/ia64/kernel/traps.c
1053@@ -106,8 +106,9 @@ die (const char *str, struct pt_regs *re 1098@@ -106,8 +106,9 @@ die (const char *str, struct pt_regs *re
1054 put_cpu(); 1099 put_cpu();
1055 1100
1056 if (++die.lock_owner_depth < 3) { 1101 if (++die.lock_owner_depth < 3) {
1057- printk("%s[%d]: %s %ld [%d]\n", 1102- printk("%s[%d]: %s %ld [%d]\n",
1072+ current->comm, current->pid, current->xid, 1117+ current->comm, current->pid, current->xid,
1073+ regs->cr_iip + ia64_psr(regs)->ri, isr); 1118+ regs->cr_iip + ia64_psr(regs)->ri, isr);
1074 } 1119 }
1075 1120
1076 exception = fp_emulate(fp_fault, bundle, &regs->cr_ipsr, &regs->ar_fpsr, &isr, &regs->pr, 1121 exception = fp_emulate(fp_fault, bundle, &regs->cr_ipsr, &regs->ar_fpsr, &isr, &regs->pr,
1077diff -NurpP --minimal linux-2.6.18.2/arch/ia64/mm/fault.c linux-2.6.18.2-vs2.1.1/arch/ia64/mm/fault.c 1122Index: linux-2.6.18/arch/ia64/mm/fault.c
1078--- linux-2.6.18.2/arch/ia64/mm/fault.c 2006-09-20 16:57:58 +0200 1123===================================================================
1079+++ linux-2.6.18.2-vs2.1.1/arch/ia64/mm/fault.c 2006-09-20 17:01:44 +0200 1124--- linux-2.6.18.orig/arch/ia64/mm/fault.c
1125+++ linux-2.6.18/arch/ia64/mm/fault.c
1080@@ -10,6 +10,7 @@ 1126@@ -10,6 +10,7 @@
1081 #include <linux/smp_lock.h> 1127 #include <linux/smp_lock.h>
1082 #include <linux/interrupt.h> 1128 #include <linux/interrupt.h>
1083 #include <linux/kprobes.h> 1129 #include <linux/kprobes.h>
1084+#include <linux/vs_memory.h> 1130+#include <linux/vs_memory.h>
1085 1131
1086 #include <asm/pgtable.h> 1132 #include <asm/pgtable.h>
1087 #include <asm/processor.h> 1133 #include <asm/processor.h>
1088diff -NurpP --minimal linux-2.6.18.2/arch/ia64/sn/kernel/xpc_main.c linux-2.6.18.2-vs2.1.1/arch/ia64/sn/kernel/xpc_main.c 1134Index: linux-2.6.18/arch/ia64/sn/kernel/xpc_main.c
1135===================================================================
1089--- linux-2.6.18.2/arch/ia64/sn/kernel/xpc_main.c 2006-09-20 16:57:58 +0200 1136--- linux-2.6.18.orig/arch/ia64/sn/kernel/xpc_main.c
1090+++ linux-2.6.18.2-vs2.1.1/arch/ia64/sn/kernel/xpc_main.c 2006-09-20 17:01:44 +0200 1137+++ linux-2.6.18/arch/ia64/sn/kernel/xpc_main.c
1091@@ -108,6 +108,7 @@ static ctl_table xpc_sys_xpc_hb_dir[] = 1138@@ -108,6 +108,7 @@ static ctl_table xpc_sys_xpc_hb_dir[] =
1092 0644, 1139 0644,
1093 NULL, 1140 NULL,
1094 &proc_dointvec_minmax, 1141 &proc_dointvec_minmax,
1095+ NULL, 1142+ NULL,
1110 &proc_dointvec_minmax, 1157 &proc_dointvec_minmax,
1111+ NULL, 1158+ NULL,
1112 &sysctl_intvec, 1159 &sysctl_intvec,
1113 NULL, 1160 NULL,
1114 &xpc_disengage_request_min_timelimit, 1161 &xpc_disengage_request_min_timelimit,
1115diff -NurpP --minimal linux-2.6.18.2/arch/m32r/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/m32r/kernel/irq.c 1162Index: linux-2.6.18/arch/m32r/kernel/irq.c
1116--- linux-2.6.18.2/arch/m32r/kernel/irq.c 2006-09-20 16:57:58 +0200 1163===================================================================
1117+++ linux-2.6.18.2-vs2.1.1/arch/m32r/kernel/irq.c 2006-10-13 20:53:02 +0200 1164--- linux-2.6.18.orig/arch/m32r/kernel/irq.c
1165+++ linux-2.6.18/arch/m32r/kernel/irq.c
1118@@ -20,6 +20,7 @@ 1166@@ -20,6 +20,7 @@
1119 #include <linux/interrupt.h> 1167 #include <linux/interrupt.h>
1120 #include <linux/seq_file.h> 1168 #include <linux/seq_file.h>
1121 #include <linux/module.h> 1169 #include <linux/module.h>
1122+#include <linux/vs_context.h> 1170+#include <linux/vs_context.h>
1138 __do_IRQ(irq, regs); 1186 __do_IRQ(irq, regs);
1139+ __leave_vx_admin(&vxis); 1187+ __leave_vx_admin(&vxis);
1140 irq_exit(); 1188 irq_exit();
1141 1189
1142 return 1; 1190 return 1;
1143diff -NurpP --minimal linux-2.6.18.2/arch/m32r/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/m32r/kernel/process.c 1191Index: linux-2.6.18/arch/m32r/kernel/process.c
1144--- linux-2.6.18.2/arch/m32r/kernel/process.c 2006-09-20 16:57:58 +0200 1192===================================================================
1145+++ linux-2.6.18.2-vs2.1.1/arch/m32r/kernel/process.c 2006-09-25 15:40:02 +0200 1193--- linux-2.6.18.orig/arch/m32r/kernel/process.c
1194+++ linux-2.6.18/arch/m32r/kernel/process.c
1146@@ -211,8 +211,8 @@ int kernel_thread(int (*fn)(void *), voi 1195@@ -211,8 +211,8 @@ int kernel_thread(int (*fn)(void *), voi
1147 regs.psw = M32R_PSW_BIE; 1196 regs.psw = M32R_PSW_BIE;
1148 1197
1149 /* Ok, create the new process. */ 1198 /* Ok, create the new process. */
1150- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, 1199- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL,
1152+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 1201+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
1153+ 0, &regs, 0, NULL, NULL); 1202+ 0, &regs, 0, NULL, NULL);
1154 } 1203 }
1155 1204
1156 /* 1205 /*
1157diff -NurpP --minimal linux-2.6.18.2/arch/m32r/kernel/sys_m32r.c linux-2.6.18.2-vs2.1.1/arch/m32r/kernel/sys_m32r.c 1206Index: linux-2.6.18/arch/m32r/kernel/sys_m32r.c
1158--- linux-2.6.18.2/arch/m32r/kernel/sys_m32r.c 2006-09-20 16:57:58 +0200 1207===================================================================
1159+++ linux-2.6.18.2-vs2.1.1/arch/m32r/kernel/sys_m32r.c 2006-09-20 17:01:44 +0200 1208--- linux-2.6.18.orig/arch/m32r/kernel/sys_m32r.c
1209+++ linux-2.6.18/arch/m32r/kernel/sys_m32r.c
1160@@ -20,6 +20,7 @@ 1210@@ -20,6 +20,7 @@
1161 #include <linux/mman.h> 1211 #include <linux/mman.h>
1162 #include <linux/file.h> 1212 #include <linux/file.h>
1163 #include <linux/utsname.h> 1213 #include <linux/utsname.h>
1164+#include <linux/vs_cvirt.h> 1214+#include <linux/vs_cvirt.h>
1172- err=copy_to_user(name, &system_utsname, sizeof (*name)); 1222- err=copy_to_user(name, &system_utsname, sizeof (*name));
1173+ err=copy_to_user(name, vx_new_utsname(), sizeof (*name)); 1223+ err=copy_to_user(name, vx_new_utsname(), sizeof (*name));
1174 up_read(&uts_sem); 1224 up_read(&uts_sem);
1175 return err?-EFAULT:0; 1225 return err?-EFAULT:0;
1176 } 1226 }
1177diff -NurpP --minimal linux-2.6.18.2/arch/m32r/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/m32r/kernel/traps.c 1227Index: linux-2.6.18/arch/m32r/kernel/traps.c
1178--- linux-2.6.18.2/arch/m32r/kernel/traps.c 2006-09-20 16:57:58 +0200 1228===================================================================
1179+++ linux-2.6.18.2-vs2.1.1/arch/m32r/kernel/traps.c 2006-09-25 15:40:02 +0200 1229--- linux-2.6.18.orig/arch/m32r/kernel/traps.c
1230+++ linux-2.6.18/arch/m32r/kernel/traps.c
1180@@ -195,8 +195,9 @@ static void show_registers(struct pt_reg 1231@@ -195,8 +195,9 @@ static void show_registers(struct pt_reg
1181 } else { 1232 } else {
1182 printk("SPI: %08lx\n", sp); 1233 printk("SPI: %08lx\n", sp);
1183 } 1234 }
1184- printk("Process %s (pid: %d, process nr: %d, stackpage=%08lx)", 1235- printk("Process %s (pid: %d, process nr: %d, stackpage=%08lx)",
1187+ current->comm, current->pid, current->xid, 1238+ current->comm, current->pid, current->xid,
1188+ 0xffff & i, 4096+(unsigned long)current); 1239+ 0xffff & i, 4096+(unsigned long)current);
1189 1240
1190 /* 1241 /*
1191 * When in-kernel, we also print out the stack and code at the 1242 * When in-kernel, we also print out the stack and code at the
1192diff -NurpP --minimal linux-2.6.18.2/arch/m68k/Kconfig linux-2.6.18.2-vs2.1.1/arch/m68k/Kconfig 1243Index: linux-2.6.18/arch/m68k/Kconfig
1193--- linux-2.6.18.2/arch/m68k/Kconfig 2006-06-18 04:51:57 +0200 1244===================================================================
1194+++ linux-2.6.18.2-vs2.1.1/arch/m68k/Kconfig 2006-09-20 17:01:44 +0200 1245--- linux-2.6.18.orig/arch/m68k/Kconfig
1246+++ linux-2.6.18/arch/m68k/Kconfig
1195@@ -654,6 +654,8 @@ source "fs/Kconfig" 1247@@ -654,6 +654,8 @@ source "fs/Kconfig"
1196 1248
1197 source "arch/m68k/Kconfig.debug" 1249 source "arch/m68k/Kconfig.debug"
1198 1250
1199+source "kernel/vserver/Kconfig" 1251+source "kernel/vserver/Kconfig"
1200+ 1252+
1201 source "security/Kconfig" 1253 source "security/Kconfig"
1202 1254
1203 source "crypto/Kconfig" 1255 source "crypto/Kconfig"
1204diff -NurpP --minimal linux-2.6.18.2/arch/m68k/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/m68k/kernel/process.c 1256Index: linux-2.6.18/arch/m68k/kernel/process.c
1205--- linux-2.6.18.2/arch/m68k/kernel/process.c 2006-09-20 16:57:58 +0200 1257===================================================================
1206+++ linux-2.6.18.2-vs2.1.1/arch/m68k/kernel/process.c 2006-09-25 15:40:02 +0200 1258--- linux-2.6.18.orig/arch/m68k/kernel/process.c
1259+++ linux-2.6.18/arch/m68k/kernel/process.c
1207@@ -159,7 +159,8 @@ int kernel_thread(int (*fn)(void *), voi 1260@@ -159,7 +159,8 @@ int kernel_thread(int (*fn)(void *), voi
1208 1261
1209 { 1262 {
1210 register long retval __asm__ ("d0"); 1263 register long retval __asm__ ("d0");
1211- register long clone_arg __asm__ ("d1") = flags | CLONE_VM | CLONE_UNTRACED; 1264- register long clone_arg __asm__ ("d1") = flags | CLONE_VM | CLONE_UNTRACED;
1212+ register long clone_arg __asm__ ("d1") = 1265+ register long clone_arg __asm__ ("d1") =
1213+ flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD; 1266+ flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD;
1214 1267
1215 retval = __NR_clone; 1268 retval = __NR_clone;
1216 __asm__ __volatile__ 1269 __asm__ __volatile__
1217diff -NurpP --minimal linux-2.6.18.2/arch/m68k/kernel/ptrace.c linux-2.6.18.2-vs2.1.1/arch/m68k/kernel/ptrace.c 1270Index: linux-2.6.18/arch/m68k/kernel/ptrace.c
1218--- linux-2.6.18.2/arch/m68k/kernel/ptrace.c 2006-09-20 16:57:58 +0200 1271===================================================================
1219+++ linux-2.6.18.2-vs2.1.1/arch/m68k/kernel/ptrace.c 2006-09-25 15:40:02 +0200 1272--- linux-2.6.18.orig/arch/m68k/kernel/ptrace.c
1273+++ linux-2.6.18/arch/m68k/kernel/ptrace.c
1220@@ -279,6 +279,8 @@ long arch_ptrace(struct task_struct *chi 1274@@ -279,6 +279,8 @@ long arch_ptrace(struct task_struct *chi
1221 ret = ptrace_request(child, request, addr, data); 1275 ret = ptrace_request(child, request, addr, data);
1222 break; 1276 break;
1223 } 1277 }
1224+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) 1278+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT))
1225+ goto out_tsk; 1279+ goto out_tsk;
1226 1280
1227 return ret; 1281 return ret;
1228 out_eio: 1282 out_eio:
1229diff -NurpP --minimal linux-2.6.18.2/arch/m68k/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/m68k/kernel/traps.c 1283Index: linux-2.6.18/arch/m68k/kernel/traps.c
1230--- linux-2.6.18.2/arch/m68k/kernel/traps.c 2006-09-20 16:57:58 +0200 1284===================================================================
1231+++ linux-2.6.18.2-vs2.1.1/arch/m68k/kernel/traps.c 2006-09-25 17:16:58 +0200 1285--- linux-2.6.18.orig/arch/m68k/kernel/traps.c
1286+++ linux-2.6.18/arch/m68k/kernel/traps.c
1232@@ -899,8 +899,8 @@ void show_registers(struct pt_regs *regs 1287@@ -899,8 +899,8 @@ void show_registers(struct pt_regs *regs
1233 printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", 1288 printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
1234 regs->d4, regs->d5, regs->a0, regs->a1); 1289 regs->d4, regs->d5, regs->a0, regs->a1);
1235 1290
1236- printk("Process %s (pid: %d, task=%p)\n", 1291- printk("Process %s (pid: %d, task=%p)\n",
1238+ printk("Process %s (pid: %d[#%u], task=%p)\n", 1293+ printk("Process %s (pid: %d[#%u], task=%p)\n",
1239+ current->comm, current->pid, current->xid, current); 1294+ current->comm, current->pid, current->xid, current);
1240 addr = (unsigned long)&fp->un; 1295 addr = (unsigned long)&fp->un;
1241 printk("Frame format=%X ", regs->format); 1296 printk("Frame format=%X ", regs->format);
1242 switch (regs->format) { 1297 switch (regs->format) {
1243diff -NurpP --minimal linux-2.6.18.2/arch/m68knommu/Kconfig linux-2.6.18.2-vs2.1.1/arch/m68knommu/Kconfig 1298Index: linux-2.6.18/arch/m68knommu/Kconfig
1244--- linux-2.6.18.2/arch/m68knommu/Kconfig 2006-09-20 16:57:58 +0200 1299===================================================================
1245+++ linux-2.6.18.2-vs2.1.1/arch/m68knommu/Kconfig 2006-09-20 17:01:44 +0200 1300--- linux-2.6.18.orig/arch/m68knommu/Kconfig
1301+++ linux-2.6.18/arch/m68knommu/Kconfig
1246@@ -663,6 +663,8 @@ source "fs/Kconfig" 1302@@ -663,6 +663,8 @@ source "fs/Kconfig"
1247 1303
1248 source "arch/m68knommu/Kconfig.debug" 1304 source "arch/m68knommu/Kconfig.debug"
1249 1305
1250+source "kernel/vserver/Kconfig" 1306+source "kernel/vserver/Kconfig"
1251+ 1307+
1252 source "security/Kconfig" 1308 source "security/Kconfig"
1253 1309
1254 source "crypto/Kconfig" 1310 source "crypto/Kconfig"
1255diff -NurpP --minimal linux-2.6.18.2/arch/m68knommu/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/m68knommu/kernel/process.c 1311Index: linux-2.6.18/arch/m68knommu/kernel/process.c
1312===================================================================
1256--- linux-2.6.18.2/arch/m68knommu/kernel/process.c 2006-09-20 16:57:58 +0200 1313--- linux-2.6.18.orig/arch/m68knommu/kernel/process.c
1257+++ linux-2.6.18.2-vs2.1.1/arch/m68knommu/kernel/process.c 2006-09-25 15:40:02 +0200 1314+++ linux-2.6.18/arch/m68knommu/kernel/process.c
1258@@ -122,7 +122,7 @@ void show_regs(struct pt_regs * regs) 1315@@ -122,7 +122,7 @@ void show_regs(struct pt_regs * regs)
1259 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) 1316 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
1260 { 1317 {
1261 int retval; 1318 int retval;
1262- long clone_arg = flags | CLONE_VM; 1319- long clone_arg = flags | CLONE_VM;
1263+ long clone_arg = flags | CLONE_VM | CLONE_KTHREAD; 1320+ long clone_arg = flags | CLONE_VM | CLONE_KTHREAD;
1264 mm_segment_t fs; 1321 mm_segment_t fs;
1265 1322
1266 fs = get_fs(); 1323 fs = get_fs();
1267diff -NurpP --minimal linux-2.6.18.2/arch/m68knommu/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/m68knommu/kernel/traps.c 1324Index: linux-2.6.18/arch/m68knommu/kernel/traps.c
1325===================================================================
1268--- linux-2.6.18.2/arch/m68knommu/kernel/traps.c 2006-09-20 16:57:58 +0200 1326--- linux-2.6.18.orig/arch/m68knommu/kernel/traps.c
1269+++ linux-2.6.18.2-vs2.1.1/arch/m68knommu/kernel/traps.c 2006-09-25 15:40:02 +0200 1327+++ linux-2.6.18/arch/m68knommu/kernel/traps.c
1270@@ -80,8 +80,9 @@ void die_if_kernel(char *str, struct pt_ 1328@@ -80,8 +80,9 @@ void die_if_kernel(char *str, struct pt_
1271 printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", 1329 printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
1272 fp->d4, fp->d5, fp->a0, fp->a1); 1330 fp->d4, fp->d5, fp->a0, fp->a1);
1273 1331
1274- printk(KERN_EMERG "Process %s (pid: %d, stackpage=%08lx)\n", 1332- printk(KERN_EMERG "Process %s (pid: %d, stackpage=%08lx)\n",
1277+ current->comm, current->pid, current->xid, 1335+ current->comm, current->pid, current->xid,
1278+ PAGE_SIZE+(unsigned long)current); 1336+ PAGE_SIZE+(unsigned long)current);
1279 show_stack(NULL, (unsigned long *)fp); 1337 show_stack(NULL, (unsigned long *)fp);
1280 do_exit(SIGSEGV); 1338 do_exit(SIGSEGV);
1281 } 1339 }
1282diff -NurpP --minimal linux-2.6.18.2/arch/mips/Kconfig linux-2.6.18.2-vs2.1.1/arch/mips/Kconfig 1340Index: linux-2.6.18/arch/mips/Kconfig
1283--- linux-2.6.18.2/arch/mips/Kconfig 2006-09-20 16:57:58 +0200 1341===================================================================
1284+++ linux-2.6.18.2-vs2.1.1/arch/mips/Kconfig 2006-09-20 17:01:44 +0200 1342--- linux-2.6.18.orig/arch/mips/Kconfig
1343+++ linux-2.6.18/arch/mips/Kconfig
1285@@ -2057,6 +2057,8 @@ source "arch/mips/oprofile/Kconfig" 1344@@ -2057,6 +2057,8 @@ source "arch/mips/oprofile/Kconfig"
1286 1345
1287 source "arch/mips/Kconfig.debug" 1346 source "arch/mips/Kconfig.debug"
1288 1347
1289+source "kernel/vserver/Kconfig" 1348+source "kernel/vserver/Kconfig"
1290+ 1349+
1291 source "security/Kconfig" 1350 source "security/Kconfig"
1292 1351
1293 source "crypto/Kconfig" 1352 source "crypto/Kconfig"
1294diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/mips/kernel/irq.c 1353Index: linux-2.6.18/arch/mips/kernel/irq.c
1295--- linux-2.6.18.2/arch/mips/kernel/irq.c 2006-09-20 16:57:58 +0200 1354===================================================================
1296+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/irq.c 2006-10-13 20:53:09 +0200 1355--- linux-2.6.18.orig/arch/mips/kernel/irq.c
1356+++ linux-2.6.18/arch/mips/kernel/irq.c
1297@@ -21,6 +21,7 @@ 1357@@ -21,6 +21,7 @@
1298 #include <linux/sched.h> 1358 #include <linux/sched.h>
1299 #include <linux/seq_file.h> 1359 #include <linux/seq_file.h>
1300 #include <linux/kallsyms.h> 1360 #include <linux/kallsyms.h>
1301+#include <linux/vs_context.h> 1361+#include <linux/vs_context.h>
1315 __do_IRQ(irq, regs); 1375 __do_IRQ(irq, regs);
1316+ __leave_vx_admin(&vxis); 1376+ __leave_vx_admin(&vxis);
1317 1377
1318 irq_exit(); 1378 irq_exit();
1319 1379
1320diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/linux32.c linux-2.6.18.2-vs2.1.1/arch/mips/kernel/linux32.c 1380Index: linux-2.6.18/arch/mips/kernel/linux32.c
1321--- linux-2.6.18.2/arch/mips/kernel/linux32.c 2006-09-20 16:57:58 +0200 1381===================================================================
1322+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/linux32.c 2006-09-25 15:40:02 +0200 1382--- linux-2.6.18.orig/arch/mips/kernel/linux32.c
1383+++ linux-2.6.18/arch/mips/kernel/linux32.c
1323@@ -35,6 +35,7 @@ 1384@@ -35,6 +35,7 @@
1324 #include <linux/security.h> 1385 #include <linux/security.h>
1325 #include <linux/compat.h> 1386 #include <linux/compat.h>
1326 #include <linux/vfs.h> 1387 #include <linux/vfs.h>
1327+#include <linux/vs_cvirt.h> 1388+#include <linux/vs_cvirt.h>
1344- if (copy_to_user(name,&system_utsname,sizeof *name)) 1405- if (copy_to_user(name,&system_utsname,sizeof *name))
1345+ if (copy_to_user(name, vx_new_utsname(), sizeof *name)) 1406+ if (copy_to_user(name, vx_new_utsname(), sizeof *name))
1346 ret = -EFAULT; 1407 ret = -EFAULT;
1347 up_read(&uts_sem); 1408 up_read(&uts_sem);
1348 1409
1349diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/mips/kernel/process.c 1410Index: linux-2.6.18/arch/mips/kernel/process.c
1350--- linux-2.6.18.2/arch/mips/kernel/process.c 2006-09-20 16:57:58 +0200 1411===================================================================
1351+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/process.c 2006-09-25 15:40:02 +0200 1412--- linux-2.6.18.orig/arch/mips/kernel/process.c
1413+++ linux-2.6.18/arch/mips/kernel/process.c
1352@@ -270,7 +270,8 @@ long kernel_thread(int (*fn)(void *), vo 1414@@ -270,7 +270,8 @@ long kernel_thread(int (*fn)(void *), vo
1353 #endif 1415 #endif
1354 1416
1355 /* Ok, create the new process.. */ 1417 /* Ok, create the new process.. */
1356- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 1418- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
1357+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 1419+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
1358+ 0, &regs, 0, NULL, NULL); 1420+ 0, &regs, 0, NULL, NULL);
1359 } 1421 }
1360 1422
1361 static struct mips_frame_info { 1423 static struct mips_frame_info {
1362diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/ptrace.c linux-2.6.18.2-vs2.1.1/arch/mips/kernel/ptrace.c 1424Index: linux-2.6.18/arch/mips/kernel/ptrace.c
1363--- linux-2.6.18.2/arch/mips/kernel/ptrace.c 2006-09-20 16:57:58 +0200 1425===================================================================
1364+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/ptrace.c 2006-10-28 21:04:21 +0200 1426--- linux-2.6.18.orig/arch/mips/kernel/ptrace.c
1427+++ linux-2.6.18/arch/mips/kernel/ptrace.c
1365@@ -171,6 +171,9 @@ long arch_ptrace(struct task_struct *chi 1428@@ -171,6 +171,9 @@ long arch_ptrace(struct task_struct *chi
1366 { 1429 {
1367 int ret; 1430 int ret;
1368 1431
1369+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) 1432+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT))
1370+ goto out; 1433+ goto out;
1371+ 1434+
1372 switch (request) { 1435 switch (request) {
1373 /* when I and D space are separate, these will need to be fixed. */ 1436 /* when I and D space are separate, these will need to be fixed. */
1374 case PTRACE_PEEKTEXT: /* read word at location addr. */ 1437 case PTRACE_PEEKTEXT: /* read word at location addr. */
1375diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/scall32-o32.S linux-2.6.18.2-vs2.1.1/arch/mips/kernel/scall32-o32.S 1438Index: linux-2.6.18/arch/mips/kernel/scall32-o32.S
1439===================================================================
1376--- linux-2.6.18.2/arch/mips/kernel/scall32-o32.S 2006-09-20 16:57:58 +0200 1440--- linux-2.6.18.orig/arch/mips/kernel/scall32-o32.S
1377+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/scall32-o32.S 2006-09-20 17:01:44 +0200 1441+++ linux-2.6.18/arch/mips/kernel/scall32-o32.S
1378@@ -630,7 +630,7 @@ einval: li v0, -EINVAL 1442@@ -630,7 +630,7 @@ einval: li v0, -EINVAL
1379 sys sys_mq_timedreceive 5 1443 sys sys_mq_timedreceive 5
1380 sys sys_mq_notify 2 /* 4275 */ 1444 sys sys_mq_notify 2 /* 4275 */
1381 sys sys_mq_getsetattr 3 1445 sys sys_mq_getsetattr 3
1382- sys sys_ni_syscall 0 /* sys_vserver */ 1446- sys sys_ni_syscall 0 /* sys_vserver */
1383+ sys sys_vserver 3 1447+ sys sys_vserver 3
1384 sys sys_waitid 5 1448 sys sys_waitid 5
1385 sys sys_ni_syscall 0 /* available, was setaltroot */ 1449 sys sys_ni_syscall 0 /* available, was setaltroot */
1386 sys sys_add_key 5 /* 4280 */ 1450 sys sys_add_key 5 /* 4280 */
1387diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/scall64-64.S linux-2.6.18.2-vs2.1.1/arch/mips/kernel/scall64-64.S 1451Index: linux-2.6.18/arch/mips/kernel/scall64-64.S
1452===================================================================
1388--- linux-2.6.18.2/arch/mips/kernel/scall64-64.S 2006-09-20 16:57:58 +0200 1453--- linux-2.6.18.orig/arch/mips/kernel/scall64-64.S
1389+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/scall64-64.S 2006-09-20 17:01:44 +0200 1454+++ linux-2.6.18/arch/mips/kernel/scall64-64.S
1390@@ -434,7 +434,7 @@ sys_call_table: 1455@@ -434,7 +434,7 @@ sys_call_table:
1391 PTR sys_mq_timedreceive 1456 PTR sys_mq_timedreceive
1392 PTR sys_mq_notify 1457 PTR sys_mq_notify
1393 PTR sys_mq_getsetattr /* 5235 */ 1458 PTR sys_mq_getsetattr /* 5235 */
1394- PTR sys_ni_syscall /* sys_vserver */ 1459- PTR sys_ni_syscall /* sys_vserver */
1395+ PTR sys_vserver 1460+ PTR sys_vserver
1396 PTR sys_waitid 1461 PTR sys_waitid
1397 PTR sys_ni_syscall /* available, was setaltroot */ 1462 PTR sys_ni_syscall /* available, was setaltroot */
1398 PTR sys_add_key 1463 PTR sys_add_key
1399diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/scall64-n32.S linux-2.6.18.2-vs2.1.1/arch/mips/kernel/scall64-n32.S 1464Index: linux-2.6.18/arch/mips/kernel/scall64-n32.S
1465===================================================================
1400--- linux-2.6.18.2/arch/mips/kernel/scall64-n32.S 2006-09-20 16:57:58 +0200 1466--- linux-2.6.18.orig/arch/mips/kernel/scall64-n32.S
1401+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/scall64-n32.S 2006-09-20 17:01:44 +0200 1467+++ linux-2.6.18/arch/mips/kernel/scall64-n32.S
1402@@ -360,7 +360,7 @@ EXPORT(sysn32_call_table) 1468@@ -360,7 +360,7 @@ EXPORT(sysn32_call_table)
1403 PTR compat_sys_mq_timedreceive 1469 PTR compat_sys_mq_timedreceive
1404 PTR compat_sys_mq_notify 1470 PTR compat_sys_mq_notify
1405 PTR compat_sys_mq_getsetattr 1471 PTR compat_sys_mq_getsetattr
1406- PTR sys_ni_syscall /* 6240, sys_vserver */ 1472- PTR sys_ni_syscall /* 6240, sys_vserver */
1407+ PTR sys32_vserver /* 6240 */ 1473+ PTR sys32_vserver /* 6240 */
1408 PTR sysn32_waitid 1474 PTR sysn32_waitid
1409 PTR sys_ni_syscall /* available, was setaltroot */ 1475 PTR sys_ni_syscall /* available, was setaltroot */
1410 PTR sys_add_key 1476 PTR sys_add_key
1411diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/scall64-o32.S linux-2.6.18.2-vs2.1.1/arch/mips/kernel/scall64-o32.S 1477Index: linux-2.6.18/arch/mips/kernel/scall64-o32.S
1478===================================================================
1412--- linux-2.6.18.2/arch/mips/kernel/scall64-o32.S 2006-09-20 16:57:58 +0200 1479--- linux-2.6.18.orig/arch/mips/kernel/scall64-o32.S
1413+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/scall64-o32.S 2006-09-20 17:01:44 +0200 1480+++ linux-2.6.18/arch/mips/kernel/scall64-o32.S
1414@@ -482,7 +482,7 @@ sys_call_table: 1481@@ -482,7 +482,7 @@ sys_call_table:
1415 PTR compat_sys_mq_timedreceive 1482 PTR compat_sys_mq_timedreceive
1416 PTR compat_sys_mq_notify /* 4275 */ 1483 PTR compat_sys_mq_notify /* 4275 */
1417 PTR compat_sys_mq_getsetattr 1484 PTR compat_sys_mq_getsetattr
1418- PTR sys_ni_syscall /* sys_vserver */ 1485- PTR sys_ni_syscall /* sys_vserver */
1419+ PTR sys32_vserver 1486+ PTR sys32_vserver
1420 PTR sys32_waitid 1487 PTR sys32_waitid
1421 PTR sys_ni_syscall /* available, was setaltroot */ 1488 PTR sys_ni_syscall /* available, was setaltroot */
1422 PTR sys_add_key /* 4280 */ 1489 PTR sys_add_key /* 4280 */
1423diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/syscall.c linux-2.6.18.2-vs2.1.1/arch/mips/kernel/syscall.c 1490Index: linux-2.6.18/arch/mips/kernel/syscall.c
1424--- linux-2.6.18.2/arch/mips/kernel/syscall.c 2006-09-20 16:57:58 +0200 1491===================================================================
1425+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/syscall.c 2006-09-20 17:01:44 +0200 1492--- linux-2.6.18.orig/arch/mips/kernel/syscall.c
1493+++ linux-2.6.18/arch/mips/kernel/syscall.c
1426@@ -28,6 +28,7 @@ 1494@@ -28,6 +28,7 @@
1427 #include <linux/shm.h> 1495 #include <linux/shm.h>
1428 #include <linux/compiler.h> 1496 #include <linux/compiler.h>
1429 #include <linux/module.h> 1497 #include <linux/module.h>
1430+#include <linux/vs_cvirt.h> 1498+#include <linux/vs_cvirt.h>
1467- error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); 1535- error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
1468+ error -= __copy_to_user(&name->machine,ptr->machine,__OLD_UTS_LEN); 1536+ error -= __copy_to_user(&name->machine,ptr->machine,__OLD_UTS_LEN);
1469 error = __put_user(0,name->machine+__OLD_UTS_LEN); 1537 error = __put_user(0,name->machine+__OLD_UTS_LEN);
1470 error = error ? -EFAULT : 0; 1538 error = error ? -EFAULT : 0;
1471 1539
1472diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/sysirix.c linux-2.6.18.2-vs2.1.1/arch/mips/kernel/sysirix.c 1540Index: linux-2.6.18/arch/mips/kernel/sysirix.c
1473--- linux-2.6.18.2/arch/mips/kernel/sysirix.c 2006-09-20 16:57:58 +0200 1541===================================================================
1474+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/sysirix.c 2006-10-07 04:29:47 +0200 1542--- linux-2.6.18.orig/arch/mips/kernel/sysirix.c
1543+++ linux-2.6.18/arch/mips/kernel/sysirix.c
1475@@ -32,6 +32,7 @@ 1544@@ -32,6 +32,7 @@
1476 #include <linux/security.h> 1545 #include <linux/security.h>
1477 #include <linux/syscalls.h> 1546 #include <linux/syscalls.h>
1478 #include <linux/resource.h> 1547 #include <linux/resource.h>
1479+#include <linux/vs_cvirt.h> 1548+#include <linux/vs_cvirt.h>
1504+ || copy_from_user(vx_new_uts(version), buf->version, 65) 1573+ || copy_from_user(vx_new_uts(version), buf->version, 65)
1505+ || copy_from_user(vx_new_uts(machine), buf->machine, 65)) { 1574+ || copy_from_user(vx_new_uts(machine), buf->machine, 65)) {
1506 return -EFAULT; 1575 return -EFAULT;
1507 } 1576 }
1508 up_read(&uts_sem); 1577 up_read(&uts_sem);
1509diff -NurpP --minimal linux-2.6.18.2/arch/mips/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/mips/kernel/traps.c 1578Index: linux-2.6.18/arch/mips/kernel/traps.c
1510--- linux-2.6.18.2/arch/mips/kernel/traps.c 2006-09-20 16:57:58 +0200 1579===================================================================
1511+++ linux-2.6.18.2-vs2.1.1/arch/mips/kernel/traps.c 2006-09-25 15:40:02 +0200 1580--- linux-2.6.18.orig/arch/mips/kernel/traps.c
1581+++ linux-2.6.18/arch/mips/kernel/traps.c
1512@@ -266,8 +266,9 @@ void show_registers(struct pt_regs *regs 1582@@ -266,8 +266,9 @@ void show_registers(struct pt_regs *regs
1513 { 1583 {
1514 show_regs(regs); 1584 show_regs(regs);
1515 print_modules(); 1585 print_modules();
1516- printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n", 1586- printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
1519+ current->comm, current->pid, current->xid, 1589+ current->comm, current->pid, current->xid,
1520+ current_thread_info(), current); 1590+ current_thread_info(), current);
1521 show_stack(current, (long *) regs->regs[29]); 1591 show_stack(current, (long *) regs->regs[29]);
1522 show_trace(current, (long *) regs->regs[29]); 1592 show_trace(current, (long *) regs->regs[29]);
1523 show_code((unsigned int *) regs->cp0_epc); 1593 show_code((unsigned int *) regs->cp0_epc);
1524diff -NurpP --minimal linux-2.6.18.2/arch/parisc/Kconfig linux-2.6.18.2-vs2.1.1/arch/parisc/Kconfig 1594Index: linux-2.6.18/arch/parisc/Kconfig
1525--- linux-2.6.18.2/arch/parisc/Kconfig 2006-09-20 16:58:00 +0200 1595===================================================================
1526+++ linux-2.6.18.2-vs2.1.1/arch/parisc/Kconfig 2006-09-20 17:01:44 +0200 1596--- linux-2.6.18.orig/arch/parisc/Kconfig
1597+++ linux-2.6.18/arch/parisc/Kconfig
1527@@ -257,6 +257,8 @@ source "arch/parisc/oprofile/Kconfig" 1598@@ -257,6 +257,8 @@ source "arch/parisc/oprofile/Kconfig"
1528 1599
1529 source "arch/parisc/Kconfig.debug" 1600 source "arch/parisc/Kconfig.debug"
1530 1601
1531+source "kernel/vserver/Kconfig" 1602+source "kernel/vserver/Kconfig"
1532+ 1603+
1533 source "security/Kconfig" 1604 source "security/Kconfig"
1534 1605
1535 source "crypto/Kconfig" 1606 source "crypto/Kconfig"
1536diff -NurpP --minimal linux-2.6.18.2/arch/parisc/hpux/sys_hpux.c linux-2.6.18.2-vs2.1.1/arch/parisc/hpux/sys_hpux.c 1607Index: linux-2.6.18/arch/parisc/hpux/sys_hpux.c
1537--- linux-2.6.18.2/arch/parisc/hpux/sys_hpux.c 2006-09-20 16:58:01 +0200 1608===================================================================
1538+++ linux-2.6.18.2-vs2.1.1/arch/parisc/hpux/sys_hpux.c 2006-09-20 17:01:44 +0200 1609--- linux-2.6.18.orig/arch/parisc/hpux/sys_hpux.c
1610+++ linux-2.6.18/arch/parisc/hpux/sys_hpux.c
1539@@ -33,6 +33,7 @@ 1611@@ -33,6 +33,7 @@
1540 #include <linux/utsname.h> 1612 #include <linux/utsname.h>
1541 #include <linux/vfs.h> 1613 #include <linux/vfs.h>
1542 #include <linux/vmalloc.h> 1614 #include <linux/vmalloc.h>
1543+#include <linux/vs_cvirt.h> 1615+#include <linux/vs_cvirt.h>
1601- if(copy_to_user(name, system_utsname.domainname, len)) 1673- if(copy_to_user(name, system_utsname.domainname, len))
1602+ if(copy_to_user(name, vx_new_uts(domainname), len)) 1674+ if(copy_to_user(name, vx_new_uts(domainname), len))
1603 goto done; 1675 goto done;
1604 err = 0; 1676 err = 0;
1605 done: 1677 done:
1606diff -NurpP --minimal linux-2.6.18.2/arch/parisc/kernel/entry.S linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/entry.S 1678Index: linux-2.6.18/arch/parisc/kernel/entry.S
1607--- linux-2.6.18.2/arch/parisc/kernel/entry.S 2006-09-20 16:58:01 +0200 1679===================================================================
1608+++ linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/entry.S 2006-09-25 15:40:02 +0200 1680--- linux-2.6.18.orig/arch/parisc/kernel/entry.S
1681+++ linux-2.6.18/arch/parisc/kernel/entry.S
1609@@ -764,6 +764,7 @@ fault_vector_11: 1682@@ -764,6 +764,7 @@ fault_vector_11:
1610 1683
1611 #define CLONE_VM 0x100 /* Must agree with <linux/sched.h> */ 1684 #define CLONE_VM 0x100 /* Must agree with <linux/sched.h> */
1612 #define CLONE_UNTRACED 0x00800000 1685 #define CLONE_UNTRACED 0x00800000
1613+#define CLONE_KTHREAD 0x10000000 1686+#define CLONE_KTHREAD 0x10000000
1614 1687
1615 .export __kernel_thread, code 1688 .export __kernel_thread, code
1616 .import do_fork 1689 .import do_fork
1617diff -NurpP --minimal linux-2.6.18.2/arch/parisc/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/process.c 1690Index: linux-2.6.18/arch/parisc/kernel/process.c
1618--- linux-2.6.18.2/arch/parisc/kernel/process.c 2006-06-18 04:52:15 +0200 1691===================================================================
1619+++ linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/process.c 2006-09-25 15:40:02 +0200 1692--- linux-2.6.18.orig/arch/parisc/kernel/process.c
1693+++ linux-2.6.18/arch/parisc/kernel/process.c
1620@@ -173,7 +173,7 @@ pid_t kernel_thread(int (*fn)(void *), v 1694@@ -173,7 +173,7 @@ pid_t kernel_thread(int (*fn)(void *), v
1621 * kernel_thread can become a #define. 1695 * kernel_thread can become a #define.
1622 */ 1696 */
1623 1697
1624- return __kernel_thread(fn, arg, flags); 1698- return __kernel_thread(fn, arg, flags);
1625+ return __kernel_thread(fn, arg, flags | CLONE_KTHREAD); 1699+ return __kernel_thread(fn, arg, flags | CLONE_KTHREAD);
1626 } 1700 }
1627 EXPORT_SYMBOL(kernel_thread); 1701 EXPORT_SYMBOL(kernel_thread);
1628 1702
1629diff -NurpP --minimal linux-2.6.18.2/arch/parisc/kernel/sys_parisc32.c linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/sys_parisc32.c 1703Index: linux-2.6.18/arch/parisc/kernel/sys_parisc32.c
1704===================================================================
1630--- linux-2.6.18.2/arch/parisc/kernel/sys_parisc32.c 2006-09-20 16:58:01 +0200 1705--- linux-2.6.18.orig/arch/parisc/kernel/sys_parisc32.c
1631+++ linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/sys_parisc32.c 2006-09-25 15:40:02 +0200 1706+++ linux-2.6.18/arch/parisc/kernel/sys_parisc32.c
1632@@ -201,11 +201,11 @@ static inline long get_ts32(struct times 1707@@ -201,11 +201,11 @@ static inline long get_ts32(struct times
1633 asmlinkage int 1708 asmlinkage int
1634 sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz) 1709 sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
1635 { 1710 {
1636- extern void do_gettimeofday(struct timeval *tv); 1711- extern void do_gettimeofday(struct timeval *tv);
1649 seq = read_seqbegin(&xtime_lock); 1724 seq = read_seqbegin(&xtime_lock);
1650+ /* FIXME: requires vx virtualization */ 1725+ /* FIXME: requires vx virtualization */
1651 val.uptime = jiffies / HZ; 1726 val.uptime = jiffies / HZ;
1652 1727
1653 val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT); 1728 val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT);
1654diff -NurpP --minimal linux-2.6.18.2/arch/parisc/kernel/syscall_table.S linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/syscall_table.S 1729Index: linux-2.6.18/arch/parisc/kernel/syscall_table.S
1730===================================================================
1655--- linux-2.6.18.2/arch/parisc/kernel/syscall_table.S 2006-06-18 04:52:15 +0200 1731--- linux-2.6.18.orig/arch/parisc/kernel/syscall_table.S
1656+++ linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/syscall_table.S 2006-09-20 17:01:44 +0200 1732+++ linux-2.6.18/arch/parisc/kernel/syscall_table.S
1657@@ -368,7 +368,7 @@ 1733@@ -368,7 +368,7 @@
1658 ENTRY_COMP(mbind) /* 260 */ 1734 ENTRY_COMP(mbind) /* 260 */
1659 ENTRY_COMP(get_mempolicy) 1735 ENTRY_COMP(get_mempolicy)
1660 ENTRY_COMP(set_mempolicy) 1736 ENTRY_COMP(set_mempolicy)
1661- ENTRY_SAME(ni_syscall) /* 263: reserved for vserver */ 1737- ENTRY_SAME(ni_syscall) /* 263: reserved for vserver */
1662+ ENTRY_DIFF(vserver) 1738+ ENTRY_DIFF(vserver)
1663 ENTRY_SAME(add_key) 1739 ENTRY_SAME(add_key)
1664 ENTRY_SAME(request_key) /* 265 */ 1740 ENTRY_SAME(request_key) /* 265 */
1665 ENTRY_SAME(keyctl) 1741 ENTRY_SAME(keyctl)
1666diff -NurpP --minimal linux-2.6.18.2/arch/parisc/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/traps.c 1742Index: linux-2.6.18/arch/parisc/kernel/traps.c
1667--- linux-2.6.18.2/arch/parisc/kernel/traps.c 2006-09-20 16:58:01 +0200 1743===================================================================
1668+++ linux-2.6.18.2-vs2.1.1/arch/parisc/kernel/traps.c 2006-09-25 15:40:02 +0200 1744--- linux-2.6.18.orig/arch/parisc/kernel/traps.c
1745+++ linux-2.6.18/arch/parisc/kernel/traps.c
1669@@ -209,8 +209,9 @@ void die_if_kernel(char *str, struct pt_ 1746@@ -209,8 +209,9 @@ void die_if_kernel(char *str, struct pt_
1670 if (err == 0) 1747 if (err == 0)
1671 return; /* STFU */ 1748 return; /* STFU */
1672 1749
1673- printk(KERN_CRIT "%s (pid %d): %s (code %ld) at " RFMT "\n", 1750- printk(KERN_CRIT "%s (pid %d): %s (code %ld) at " RFMT "\n",
1687+ printk(KERN_CRIT "%s (pid %d[#%u]): %s (code %ld)\n", 1764+ printk(KERN_CRIT "%s (pid %d[#%u]): %s (code %ld)\n",
1688+ current->comm, current->pid, current->xid, str, err); 1765+ current->comm, current->pid, current->xid, str, err);
1689 show_regs(regs); 1766 show_regs(regs);
1690 1767
1691 /* Wot's wrong wif bein' racy? */ 1768 /* Wot's wrong wif bein' racy? */
1692diff -NurpP --minimal linux-2.6.18.2/arch/parisc/mm/fault.c linux-2.6.18.2-vs2.1.1/arch/parisc/mm/fault.c 1769Index: linux-2.6.18/arch/parisc/mm/fault.c
1693--- linux-2.6.18.2/arch/parisc/mm/fault.c 2006-06-18 04:52:15 +0200 1770===================================================================
1694+++ linux-2.6.18.2-vs2.1.1/arch/parisc/mm/fault.c 2006-10-28 19:28:40 +0200 1771--- linux-2.6.18.orig/arch/parisc/mm/fault.c
1772+++ linux-2.6.18/arch/parisc/mm/fault.c
1695@@ -213,8 +213,9 @@ bad_area: 1773@@ -213,8 +213,9 @@ bad_area:
1696 1774
1697 #ifdef PRINT_USER_FAULTS 1775 #ifdef PRINT_USER_FAULTS
1698 printk(KERN_DEBUG "\n"); 1776 printk(KERN_DEBUG "\n");
1699- printk(KERN_DEBUG "do_page_fault() pid=%d command='%s' type=%lu address=0x%08lx\n", 1777- printk(KERN_DEBUG "do_page_fault() pid=%d command='%s' type=%lu address=0x%08lx\n",
1702+ "command='%s' type=%lu address=0x%08lx\n", 1780+ "command='%s' type=%lu address=0x%08lx\n",
1703+ tsk->pid, tsk->xid, tsk->comm, code, address); 1781+ tsk->pid, tsk->xid, tsk->comm, code, address);
1704 if (vma) { 1782 if (vma) {
1705 printk(KERN_DEBUG "vm_start = 0x%08lx, vm_end = 0x%08lx\n", 1783 printk(KERN_DEBUG "vm_start = 0x%08lx, vm_end = 0x%08lx\n",
1706 vma->vm_start, vma->vm_end); 1784 vma->vm_start, vma->vm_end);
1707diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/Kconfig linux-2.6.18.2-vs2.1.1/arch/powerpc/Kconfig 1785Index: linux-2.6.18/arch/powerpc/Kconfig
1708--- linux-2.6.18.2/arch/powerpc/Kconfig 2006-11-04 19:43:22 +0100 1786===================================================================
1709+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/Kconfig 2006-11-04 19:12:53 +0100 1787--- linux-2.6.18.orig/arch/powerpc/Kconfig
1788+++ linux-2.6.18/arch/powerpc/Kconfig
1710@@ -1078,6 +1078,8 @@ endmenu 1789@@ -1078,6 +1078,8 @@ endmenu
1711 1790
1712 source "arch/powerpc/Kconfig.debug" 1791 source "arch/powerpc/Kconfig.debug"
1713 1792
1714+source "kernel/vserver/Kconfig" 1793+source "kernel/vserver/Kconfig"
1715+ 1794+
1716 source "security/Kconfig" 1795 source "security/Kconfig"
1717 1796
1718 config KEYS_COMPAT 1797 config KEYS_COMPAT
1719diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/kernel/asm-offsets.c linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/asm-offsets.c 1798Index: linux-2.6.18/arch/powerpc/kernel/asm-offsets.c
1799===================================================================
1720--- linux-2.6.18.2/arch/powerpc/kernel/asm-offsets.c 2006-09-20 16:58:01 +0200 1800--- linux-2.6.18.orig/arch/powerpc/kernel/asm-offsets.c
1721+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/asm-offsets.c 2006-09-25 15:40:02 +0200 1801+++ linux-2.6.18/arch/powerpc/kernel/asm-offsets.c
1722@@ -229,6 +229,7 @@ int main(void) 1802@@ -229,6 +229,7 @@ int main(void)
1723 1803
1724 DEFINE(CLONE_VM, CLONE_VM); 1804 DEFINE(CLONE_VM, CLONE_VM);
1725 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); 1805 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
1726+ DEFINE(CLONE_KTHREAD, CLONE_KTHREAD); 1806+ DEFINE(CLONE_KTHREAD, CLONE_KTHREAD);
1727 1807
1728 #ifndef CONFIG_PPC64 1808 #ifndef CONFIG_PPC64
1729 DEFINE(MM_PGD, offsetof(struct mm_struct, pgd)); 1809 DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
1730diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/irq.c 1810Index: linux-2.6.18/arch/powerpc/kernel/irq.c
1731--- linux-2.6.18.2/arch/powerpc/kernel/irq.c 2006-09-20 16:58:01 +0200 1811===================================================================
1732+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/irq.c 2006-10-13 20:34:37 +0200 1812--- linux-2.6.18.orig/arch/powerpc/kernel/irq.c
1813+++ linux-2.6.18/arch/powerpc/kernel/irq.c
1733@@ -52,6 +52,7 @@ 1814@@ -52,6 +52,7 @@
1734 #include <linux/radix-tree.h> 1815 #include <linux/radix-tree.h>
1735 #include <linux/mutex.h> 1816 #include <linux/mutex.h>
1736 #include <linux/bootmem.h> 1817 #include <linux/bootmem.h>
1737+#include <linux/vs_context.h> 1818+#include <linux/vs_context.h>
1768 timer_interrupt(regs); 1849 timer_interrupt(regs);
1769+ __leave_vx_admin(&vxis); 1850+ __leave_vx_admin(&vxis);
1770 } 1851 }
1771 #endif 1852 #endif
1772 } 1853 }
1773diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/kernel/misc_32.S linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/misc_32.S 1854Index: linux-2.6.18/arch/powerpc/kernel/misc_32.S
1855===================================================================
1774--- linux-2.6.18.2/arch/powerpc/kernel/misc_32.S 2006-09-20 16:58:01 +0200 1856--- linux-2.6.18.orig/arch/powerpc/kernel/misc_32.S
1775+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/misc_32.S 2006-09-25 15:40:02 +0200 1857+++ linux-2.6.18/arch/powerpc/kernel/misc_32.S
1776@@ -823,7 +823,7 @@ _GLOBAL(kernel_thread) 1858@@ -823,7 +823,7 @@ _GLOBAL(kernel_thread)
1777 mr r30,r3 /* function */ 1859 mr r30,r3 /* function */
1778 mr r31,r4 /* argument */ 1860 mr r31,r4 /* argument */
1779 ori r3,r5,CLONE_VM /* flags */ 1861 ori r3,r5,CLONE_VM /* flags */
1780- oris r3,r3,CLONE_UNTRACED>>16 1862- oris r3,r3,CLONE_UNTRACED>>16
1781+ oris r3,r3,(CLONE_UNTRACED|CLONE_KTHREAD)>>16 1863+ oris r3,r3,(CLONE_UNTRACED|CLONE_KTHREAD)>>16
1782 li r4,0 /* new sp (unused) */ 1864 li r4,0 /* new sp (unused) */
1783 li r0,__NR_clone 1865 li r0,__NR_clone
1784 sc 1866 sc
1785diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/kernel/misc_64.S linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/misc_64.S 1867Index: linux-2.6.18/arch/powerpc/kernel/misc_64.S
1868===================================================================
1786--- linux-2.6.18.2/arch/powerpc/kernel/misc_64.S 2006-09-20 16:58:01 +0200 1869--- linux-2.6.18.orig/arch/powerpc/kernel/misc_64.S
1787+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/misc_64.S 2006-09-25 15:40:02 +0200 1870+++ linux-2.6.18/arch/powerpc/kernel/misc_64.S
1788@@ -472,7 +472,7 @@ _GLOBAL(kernel_thread) 1871@@ -472,7 +472,7 @@ _GLOBAL(kernel_thread)
1789 mr r29,r3 1872 mr r29,r3
1790 mr r30,r4 1873 mr r30,r4
1791 ori r3,r5,CLONE_VM /* flags */ 1874 ori r3,r5,CLONE_VM /* flags */
1792- oris r3,r3,(CLONE_UNTRACED>>16) 1875- oris r3,r3,(CLONE_UNTRACED>>16)
1793+ oris r3,r3,(CLONE_UNTRACED|CLONE_KTHREAD)>>16 1876+ oris r3,r3,(CLONE_UNTRACED|CLONE_KTHREAD)>>16
1794 li r4,0 /* new sp (unused) */ 1877 li r4,0 /* new sp (unused) */
1795 li r0,__NR_clone 1878 li r0,__NR_clone
1796 sc 1879 sc
1797diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/process.c 1880Index: linux-2.6.18/arch/powerpc/kernel/process.c
1881===================================================================
1798--- linux-2.6.18.2/arch/powerpc/kernel/process.c 2006-09-20 16:58:01 +0200 1882--- linux-2.6.18.orig/arch/powerpc/kernel/process.c
1799+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/process.c 2006-09-20 17:01:44 +0200 1883+++ linux-2.6.18/arch/powerpc/kernel/process.c
1800@@ -431,8 +431,9 @@ void show_regs(struct pt_regs * regs) 1884@@ -431,8 +431,9 @@ void show_regs(struct pt_regs * regs)
1801 trap = TRAP(regs); 1885 trap = TRAP(regs);
1802 if (trap == 0x300 || trap == 0x600) 1886 if (trap == 0x300 || trap == 0x600)
1803 printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr); 1887 printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
1804- printk("TASK = %p[%d] '%s' THREAD: %p", 1888- printk("TASK = %p[%d] '%s' THREAD: %p",
1807+ current, current->pid, current->xid, 1891+ current, current->pid, current->xid,
1808+ current->comm, task_thread_info(current)); 1892+ current->comm, task_thread_info(current));
1809 1893
1810 #ifdef CONFIG_SMP 1894 #ifdef CONFIG_SMP
1811 printk(" CPU: %d", smp_processor_id()); 1895 printk(" CPU: %d", smp_processor_id());
1812diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/kernel/sys_ppc32.c linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/sys_ppc32.c 1896Index: linux-2.6.18/arch/powerpc/kernel/sys_ppc32.c
1897===================================================================
1813--- linux-2.6.18.2/arch/powerpc/kernel/sys_ppc32.c 2006-09-20 16:58:01 +0200 1898--- linux-2.6.18.orig/arch/powerpc/kernel/sys_ppc32.c
1814+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/sys_ppc32.c 2006-09-25 15:40:02 +0200 1899+++ linux-2.6.18/arch/powerpc/kernel/sys_ppc32.c
1815@@ -266,7 +266,7 @@ asmlinkage long compat_sys_gettimeofday( 1900@@ -266,7 +266,7 @@ asmlinkage long compat_sys_gettimeofday(
1816 { 1901 {
1817 if (tv) { 1902 if (tv) {
1818 struct timeval ktv; 1903 struct timeval ktv;
1819- do_gettimeofday(&ktv); 1904- do_gettimeofday(&ktv);
1820+ vx_gettimeofday(&ktv); 1905+ vx_gettimeofday(&ktv);
1821 if (put_tv32(tv, &ktv)) 1906 if (put_tv32(tv, &ktv))
1822 return -EFAULT; 1907 return -EFAULT;
1823 } 1908 }
1824diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/kernel/syscalls.c linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/syscalls.c 1909Index: linux-2.6.18/arch/powerpc/kernel/syscalls.c
1910===================================================================
1825--- linux-2.6.18.2/arch/powerpc/kernel/syscalls.c 2006-06-18 04:52:17 +0200 1911--- linux-2.6.18.orig/arch/powerpc/kernel/syscalls.c
1826+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/syscalls.c 2006-09-20 17:01:44 +0200 1912+++ linux-2.6.18/arch/powerpc/kernel/syscalls.c
1827@@ -36,6 +36,7 @@ 1913@@ -36,6 +36,7 @@
1828 #include <linux/file.h> 1914 #include <linux/file.h>
1829 #include <linux/init.h> 1915 #include <linux/init.h>
1830 #include <linux/personality.h> 1916 #include <linux/personality.h>
1831+#include <linux/vs_cvirt.h> 1917+#include <linux/vs_cvirt.h>
1881- __OLD_UTS_LEN); 1967- __OLD_UTS_LEN);
1882+ error |= __copy_to_user(&name->machine, ptr->machine, __OLD_UTS_LEN); 1968+ error |= __copy_to_user(&name->machine, ptr->machine, __OLD_UTS_LEN);
1883 error |= override_machine(name->machine); 1969 error |= override_machine(name->machine);
1884 up_read(&uts_sem); 1970 up_read(&uts_sem);
1885 1971
1886diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/traps.c 1972Index: linux-2.6.18/arch/powerpc/kernel/traps.c
1887--- linux-2.6.18.2/arch/powerpc/kernel/traps.c 2006-09-20 16:58:01 +0200 1973===================================================================
1888+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/traps.c 2006-09-25 15:40:02 +0200 1974--- linux-2.6.18.orig/arch/powerpc/kernel/traps.c
1975+++ linux-2.6.18/arch/powerpc/kernel/traps.c
1889@@ -861,8 +861,9 @@ void nonrecoverable_exception(struct pt_ 1976@@ -861,8 +861,9 @@ void nonrecoverable_exception(struct pt_
1890 1977
1891 void trace_syscall(struct pt_regs *regs) 1978 void trace_syscall(struct pt_regs *regs)
1892 { 1979 {
1893- printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n", 1980- printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n",
1896+ current, current->pid, current->xid, 1983+ current, current->pid, current->xid,
1897+ regs->nip, regs->link, regs->gpr[0], 1984+ regs->nip, regs->link, regs->gpr[0],
1898 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted()); 1985 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
1899 } 1986 }
1900 1987
1901diff -NurpP --minimal linux-2.6.18.2/arch/powerpc/kernel/vdso.c linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/vdso.c 1988Index: linux-2.6.18/arch/powerpc/kernel/vdso.c
1902--- linux-2.6.18.2/arch/powerpc/kernel/vdso.c 2006-09-20 16:58:01 +0200 1989===================================================================
1903+++ linux-2.6.18.2-vs2.1.1/arch/powerpc/kernel/vdso.c 2006-09-20 19:58:24 +0200 1990--- linux-2.6.18.orig/arch/powerpc/kernel/vdso.c
1991+++ linux-2.6.18/arch/powerpc/kernel/vdso.c
1904@@ -22,6 +22,7 @@ 1992@@ -22,6 +22,7 @@
1905 #include <linux/elf.h> 1993 #include <linux/elf.h>
1906 #include <linux/security.h> 1994 #include <linux/security.h>
1907 #include <linux/bootmem.h> 1995 #include <linux/bootmem.h>
1908+#include <linux/vs_memory.h> 1996+#include <linux/vs_memory.h>
1916- mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 2004- mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
1917+ vx_vmpages_add(mm, (vma->vm_end - vma->vm_start) >> PAGE_SHIFT); 2005+ vx_vmpages_add(mm, (vma->vm_end - vma->vm_start) >> PAGE_SHIFT);
1918 up_write(&mm->mmap_sem); 2006 up_write(&mm->mmap_sem);
1919 return 0; 2007 return 0;
1920 2008
1921diff -NurpP --minimal linux-2.6.18.2/arch/ppc/Kconfig linux-2.6.18.2-vs2.1.1/arch/ppc/Kconfig 2009Index: linux-2.6.18/arch/ppc/Kconfig
1922--- linux-2.6.18.2/arch/ppc/Kconfig 2006-09-20 16:58:01 +0200 2010===================================================================
1923+++ linux-2.6.18.2-vs2.1.1/arch/ppc/Kconfig 2006-09-20 17:01:44 +0200 2011--- linux-2.6.18.orig/arch/ppc/Kconfig
2012+++ linux-2.6.18/arch/ppc/Kconfig
1924@@ -1418,6 +1418,8 @@ source "arch/powerpc/oprofile/Kconfig" 2013@@ -1418,6 +1418,8 @@ source "arch/powerpc/oprofile/Kconfig"
1925 2014
1926 source "arch/ppc/Kconfig.debug" 2015 source "arch/ppc/Kconfig.debug"
1927 2016
1928+source "kernel/vserver/Kconfig" 2017+source "kernel/vserver/Kconfig"
1929+ 2018+
1930 source "security/Kconfig" 2019 source "security/Kconfig"
1931 2020
1932 source "crypto/Kconfig" 2021 source "crypto/Kconfig"
1933diff -NurpP --minimal linux-2.6.18.2/arch/ppc/kernel/asm-offsets.c linux-2.6.18.2-vs2.1.1/arch/ppc/kernel/asm-offsets.c 2022Index: linux-2.6.18/arch/ppc/kernel/asm-offsets.c
2023===================================================================
1934--- linux-2.6.18.2/arch/ppc/kernel/asm-offsets.c 2006-09-20 16:58:01 +0200 2024--- linux-2.6.18.orig/arch/ppc/kernel/asm-offsets.c
1935+++ linux-2.6.18.2-vs2.1.1/arch/ppc/kernel/asm-offsets.c 2006-09-25 15:40:02 +0200 2025+++ linux-2.6.18/arch/ppc/kernel/asm-offsets.c
1936@@ -121,6 +121,7 @@ main(void) 2026@@ -121,6 +121,7 @@ main(void)
1937 DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); 2027 DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
1938 DEFINE(CLONE_VM, CLONE_VM); 2028 DEFINE(CLONE_VM, CLONE_VM);
1939 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); 2029 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
1940+ DEFINE(CLONE_KTHREAD, CLONE_KTHREAD); 2030+ DEFINE(CLONE_KTHREAD, CLONE_KTHREAD);
1941 DEFINE(MM_PGD, offsetof(struct mm_struct, pgd)); 2031 DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
1942 2032
1943 /* About the CPU features table */ 2033 /* About the CPU features table */
1944diff -NurpP --minimal linux-2.6.18.2/arch/ppc/kernel/misc.S linux-2.6.18.2-vs2.1.1/arch/ppc/kernel/misc.S 2034Index: linux-2.6.18/arch/ppc/kernel/misc.S
1945--- linux-2.6.18.2/arch/ppc/kernel/misc.S 2006-09-20 16:58:01 +0200 2035===================================================================
1946+++ linux-2.6.18.2-vs2.1.1/arch/ppc/kernel/misc.S 2006-09-25 15:40:02 +0200 2036--- linux-2.6.18.orig/arch/ppc/kernel/misc.S
2037+++ linux-2.6.18/arch/ppc/kernel/misc.S
1947@@ -1010,7 +1010,7 @@ _GLOBAL(kernel_thread) 2038@@ -1010,7 +1010,7 @@ _GLOBAL(kernel_thread)
1948 mr r30,r3 /* function */ 2039 mr r30,r3 /* function */
1949 mr r31,r4 /* argument */ 2040 mr r31,r4 /* argument */
1950 ori r3,r5,CLONE_VM /* flags */ 2041 ori r3,r5,CLONE_VM /* flags */
1951- oris r3,r3,CLONE_UNTRACED>>16 2042- oris r3,r3,CLONE_UNTRACED>>16
1952+ oris r3,r3,(CLONE_UNTRACED|CLONE_KTHREAD)>>16 2043+ oris r3,r3,(CLONE_UNTRACED|CLONE_KTHREAD)>>16
1953 li r4,0 /* new sp (unused) */ 2044 li r4,0 /* new sp (unused) */
1954 li r0,__NR_clone 2045 li r0,__NR_clone
1955 sc 2046 sc
1956diff -NurpP --minimal linux-2.6.18.2/arch/ppc/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/ppc/kernel/traps.c 2047Index: linux-2.6.18/arch/ppc/kernel/traps.c
1957--- linux-2.6.18.2/arch/ppc/kernel/traps.c 2006-09-20 16:58:01 +0200 2048===================================================================
1958+++ linux-2.6.18.2-vs2.1.1/arch/ppc/kernel/traps.c 2006-09-25 15:40:02 +0200 2049--- linux-2.6.18.orig/arch/ppc/kernel/traps.c
2050+++ linux-2.6.18/arch/ppc/kernel/traps.c
1959@@ -746,8 +746,9 @@ void nonrecoverable_exception(struct pt_ 2051@@ -746,8 +746,9 @@ void nonrecoverable_exception(struct pt_
1960 2052
1961 void trace_syscall(struct pt_regs *regs) 2053 void trace_syscall(struct pt_regs *regs)
1962 { 2054 {
1963- printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n", 2055- printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n",
1966+ current, current->pid, current->xid, 2058+ current, current->pid, current->xid,
1967+ regs->nip, regs->link, regs->gpr[0], 2059+ regs->nip, regs->link, regs->gpr[0],
1968 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted()); 2060 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
1969 } 2061 }
1970 2062
1971diff -NurpP --minimal linux-2.6.18.2/arch/s390/Kconfig linux-2.6.18.2-vs2.1.1/arch/s390/Kconfig 2063Index: linux-2.6.18/arch/s390/Kconfig
1972--- linux-2.6.18.2/arch/s390/Kconfig 2006-11-04 19:43:22 +0100 2064===================================================================
1973+++ linux-2.6.18.2-vs2.1.1/arch/s390/Kconfig 2006-11-04 19:12:53 +0100 2065--- linux-2.6.18.orig/arch/s390/Kconfig
2066+++ linux-2.6.18/arch/s390/Kconfig
1974@@ -495,6 +495,8 @@ source "arch/s390/oprofile/Kconfig" 2067@@ -495,6 +495,8 @@ source "arch/s390/oprofile/Kconfig"
1975 2068
1976 source "arch/s390/Kconfig.debug" 2069 source "arch/s390/Kconfig.debug"
1977 2070
1978+source "kernel/vserver/Kconfig" 2071+source "kernel/vserver/Kconfig"
1979+ 2072+
1980 source "security/Kconfig" 2073 source "security/Kconfig"
1981 2074
1982 source "crypto/Kconfig" 2075 source "crypto/Kconfig"
1983diff -NurpP --minimal linux-2.6.18.2/arch/s390/kernel/compat_linux.c linux-2.6.18.2-vs2.1.1/arch/s390/kernel/compat_linux.c 2076Index: linux-2.6.18/arch/s390/kernel/compat_linux.c
2077===================================================================
1984--- linux-2.6.18.2/arch/s390/kernel/compat_linux.c 2006-09-20 16:58:01 +0200 2078--- linux-2.6.18.orig/arch/s390/kernel/compat_linux.c
1985+++ linux-2.6.18.2-vs2.1.1/arch/s390/kernel/compat_linux.c 2006-09-25 15:40:02 +0200 2079+++ linux-2.6.18/arch/s390/kernel/compat_linux.c
1986@@ -596,7 +596,7 @@ asmlinkage long sys32_gettimeofday(struc 2080@@ -596,7 +596,7 @@ asmlinkage long sys32_gettimeofday(struc
1987 { 2081 {
1988 if (tv) { 2082 if (tv) {
1989 struct timeval ktv; 2083 struct timeval ktv;
1990- do_gettimeofday(&ktv); 2084- do_gettimeofday(&ktv);
1991+ vx_gettimeofday(&ktv); 2085+ vx_gettimeofday(&ktv);
1992 if (put_tv32(tv, &ktv)) 2086 if (put_tv32(tv, &ktv))
1993 return -EFAULT; 2087 return -EFAULT;
1994 } 2088 }
1995diff -NurpP --minimal linux-2.6.18.2/arch/s390/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/s390/kernel/process.c 2089Index: linux-2.6.18/arch/s390/kernel/process.c
1996--- linux-2.6.18.2/arch/s390/kernel/process.c 2006-09-20 16:58:01 +0200 2090===================================================================
1997+++ linux-2.6.18.2-vs2.1.1/arch/s390/kernel/process.c 2006-09-25 15:40:02 +0200 2091--- linux-2.6.18.orig/arch/s390/kernel/process.c
2092+++ linux-2.6.18/arch/s390/kernel/process.c
1998@@ -165,9 +165,9 @@ void show_regs(struct pt_regs *regs) 2093@@ -165,9 +165,9 @@ void show_regs(struct pt_regs *regs)
1999 struct task_struct *tsk = current; 2094 struct task_struct *tsk = current;
2000 2095
2001 printk("CPU: %d %s\n", task_thread_info(tsk)->cpu, print_tainted()); 2096 printk("CPU: %d %s\n", task_thread_info(tsk)->cpu, print_tainted());
2002- printk("Process %s (pid: %d, task: %p, ksp: %p)\n", 2097- printk("Process %s (pid: %d, task: %p, ksp: %p)\n",
2015- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 2110- return do_fork(flags | CLONE_VM | CLONE_UNTRACED,
2016+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 2111+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
2017 0, &regs, 0, NULL, NULL); 2112 0, &regs, 0, NULL, NULL);
2018 } 2113 }
2019 2114
2020diff -NurpP --minimal linux-2.6.18.2/arch/s390/kernel/ptrace.c linux-2.6.18.2-vs2.1.1/arch/s390/kernel/ptrace.c 2115Index: linux-2.6.18/arch/s390/kernel/ptrace.c
2021--- linux-2.6.18.2/arch/s390/kernel/ptrace.c 2006-06-18 04:52:33 +0200 2116===================================================================
2022+++ linux-2.6.18.2-vs2.1.1/arch/s390/kernel/ptrace.c 2006-09-25 15:40:02 +0200 2117--- linux-2.6.18.orig/arch/s390/kernel/ptrace.c
2118+++ linux-2.6.18/arch/s390/kernel/ptrace.c
2023@@ -723,7 +723,13 @@ sys_ptrace(long request, long pid, long 2119@@ -723,7 +723,13 @@ sys_ptrace(long request, long pid, long
2024 goto out; 2120 goto out;
2025 } 2121 }
2026 2122
2027+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) { 2123+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) {
2032 ret = do_ptrace(child, request, addr, data); 2128 ret = do_ptrace(child, request, addr, data);
2033+out_tsk: 2129+out_tsk:
2034 put_task_struct(child); 2130 put_task_struct(child);
2035 out: 2131 out:
2036 unlock_kernel(); 2132 unlock_kernel();
2037diff -NurpP --minimal linux-2.6.18.2/arch/s390/kernel/syscalls.S linux-2.6.18.2-vs2.1.1/arch/s390/kernel/syscalls.S 2133Index: linux-2.6.18/arch/s390/kernel/syscalls.S
2038--- linux-2.6.18.2/arch/s390/kernel/syscalls.S 2006-06-18 04:52:33 +0200 2134===================================================================
2039+++ linux-2.6.18.2-vs2.1.1/arch/s390/kernel/syscalls.S 2006-09-20 17:01:44 +0200 2135--- linux-2.6.18.orig/arch/s390/kernel/syscalls.S
2136+++ linux-2.6.18/arch/s390/kernel/syscalls.S
2040@@ -271,7 +271,7 @@ SYSCALL(sys_clock_settime,sys_clock_sett 2137@@ -271,7 +271,7 @@ SYSCALL(sys_clock_settime,sys_clock_sett
2041 SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper) /* 260 */ 2138 SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper) /* 260 */
2042 SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) 2139 SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper)
2043 SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) 2140 SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper)
2044-NI_SYSCALL /* reserved for vserver */ 2141-NI_SYSCALL /* reserved for vserver */
2045+SYSCALL(sys_vserver,sys_vserver,sys32_vserver) 2142+SYSCALL(sys_vserver,sys_vserver,sys32_vserver)
2046 SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) 2143 SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper)
2047 SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper) 2144 SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper)
2048 SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper) 2145 SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper)
2049diff -NurpP --minimal linux-2.6.18.2/arch/sh/Kconfig linux-2.6.18.2-vs2.1.1/arch/sh/Kconfig 2146Index: linux-2.6.18/arch/sh/Kconfig
2050--- linux-2.6.18.2/arch/sh/Kconfig 2006-09-20 16:58:01 +0200 2147===================================================================
2051+++ linux-2.6.18.2-vs2.1.1/arch/sh/Kconfig 2006-09-20 17:01:44 +0200 2148--- linux-2.6.18.orig/arch/sh/Kconfig
2149+++ linux-2.6.18/arch/sh/Kconfig
2052@@ -646,6 +646,8 @@ source "arch/sh/oprofile/Kconfig" 2150@@ -646,6 +646,8 @@ source "arch/sh/oprofile/Kconfig"
2053 2151
2054 source "arch/sh/Kconfig.debug" 2152 source "arch/sh/Kconfig.debug"
2055 2153
2056+source "kernel/vserver/Kconfig" 2154+source "kernel/vserver/Kconfig"
2057+ 2155+
2058 source "security/Kconfig" 2156 source "security/Kconfig"
2059 2157
2060 source "crypto/Kconfig" 2158 source "crypto/Kconfig"
2061diff -NurpP --minimal linux-2.6.18.2/arch/sh/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/sh/kernel/irq.c 2159Index: linux-2.6.18/arch/sh/kernel/irq.c
2062--- linux-2.6.18.2/arch/sh/kernel/irq.c 2006-09-20 16:58:01 +0200 2160===================================================================
2063+++ linux-2.6.18.2-vs2.1.1/arch/sh/kernel/irq.c 2006-10-13 20:53:27 +0200 2161--- linux-2.6.18.orig/arch/sh/kernel/irq.c
2162+++ linux-2.6.18/arch/sh/kernel/irq.c
2064@@ -12,6 +12,7 @@ 2163@@ -12,6 +12,7 @@
2065 #include <linux/interrupt.h> 2164 #include <linux/interrupt.h>
2066 #include <linux/kernel_stat.h> 2165 #include <linux/kernel_stat.h>
2067 #include <linux/seq_file.h> 2166 #include <linux/seq_file.h>
2068+#include <linux/vs_context.h> 2167+#include <linux/vs_context.h>
2085 __do_IRQ(irq, &regs); 2184 __do_IRQ(irq, &regs);
2086+ __leave_vx_admin(&vxis); 2185+ __leave_vx_admin(&vxis);
2087 irq_exit(); 2186 irq_exit();
2088 return 1; 2187 return 1;
2089 } 2188 }
2090diff -NurpP --minimal linux-2.6.18.2/arch/sh/kernel/kgdb_stub.c linux-2.6.18.2-vs2.1.1/arch/sh/kernel/kgdb_stub.c 2189Index: linux-2.6.18/arch/sh/kernel/kgdb_stub.c
2091--- linux-2.6.18.2/arch/sh/kernel/kgdb_stub.c 2004-08-14 12:54:51 +0200 2190===================================================================
2092+++ linux-2.6.18.2-vs2.1.1/arch/sh/kernel/kgdb_stub.c 2006-09-20 17:01:44 +0200 2191--- linux-2.6.18.orig/arch/sh/kernel/kgdb_stub.c
2192+++ linux-2.6.18/arch/sh/kernel/kgdb_stub.c
2093@@ -412,7 +412,7 @@ static struct task_struct *get_thread(in 2193@@ -412,7 +412,7 @@ static struct task_struct *get_thread(in
2094 if (pid == PID_MAX) pid = 0; 2194 if (pid == PID_MAX) pid = 0;
2095 2195
2096 /* First check via PID */ 2196 /* First check via PID */
2097- thread = find_task_by_pid(pid); 2197- thread = find_task_by_pid(pid);
2098+ thread = find_task_by_real_pid(pid); 2198+ thread = find_task_by_real_pid(pid);
2099 2199
2100 if (thread) 2200 if (thread)
2101 return thread; 2201 return thread;
2102diff -NurpP --minimal linux-2.6.18.2/arch/sh/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/sh/kernel/process.c 2202Index: linux-2.6.18/arch/sh/kernel/process.c
2103--- linux-2.6.18.2/arch/sh/kernel/process.c 2006-11-04 19:43:22 +0100 2203===================================================================
2104+++ linux-2.6.18.2-vs2.1.1/arch/sh/kernel/process.c 2006-10-18 01:14:30 +0200 2204--- linux-2.6.18.orig/arch/sh/kernel/process.c
2205+++ linux-2.6.18/arch/sh/kernel/process.c
2105@@ -113,7 +113,8 @@ void machine_power_off(void) 2206@@ -113,7 +113,8 @@ void machine_power_off(void)
2106 void show_regs(struct pt_regs * regs) 2207 void show_regs(struct pt_regs * regs)
2107 { 2208 {
2108 printk("\n"); 2209 printk("\n");
2109- printk("Pid : %d, Comm: %20s\n", current->pid, current->comm); 2210- printk("Pid : %d, Comm: %20s\n", current->pid, current->comm);
2120+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, 2221+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD,
2121+ 0, &regs, 0, NULL, NULL); 2222+ 0, &regs, 0, NULL, NULL);
2122 } 2223 }
2123 2224
2124 /* 2225 /*
2125diff -NurpP --minimal linux-2.6.18.2/arch/sh/kernel/setup.c linux-2.6.18.2-vs2.1.1/arch/sh/kernel/setup.c 2226Index: linux-2.6.18/arch/sh/kernel/setup.c
2126--- linux-2.6.18.2/arch/sh/kernel/setup.c 2006-09-20 16:58:01 +0200 2227===================================================================
2127+++ linux-2.6.18.2-vs2.1.1/arch/sh/kernel/setup.c 2006-09-20 17:01:44 +0200 2228--- linux-2.6.18.orig/arch/sh/kernel/setup.c
2229+++ linux-2.6.18/arch/sh/kernel/setup.c
2128@@ -21,6 +21,7 @@ 2230@@ -21,6 +21,7 @@
2129 #include <linux/utsname.h> 2231 #include <linux/utsname.h>
2130 #include <linux/cpu.h> 2232 #include <linux/cpu.h>
2131 #include <linux/pfn.h> 2233 #include <linux/pfn.h>
2132+#include <linux/vs_cvirt.h> 2234+#include <linux/vs_cvirt.h>
2140- seq_printf(m, "cpu family\t: %s\n", system_utsname.machine); 2242- seq_printf(m, "cpu family\t: %s\n", system_utsname.machine);
2141+ seq_printf(m, "cpu family\t: %s\n", vx_new_uts(machine)); 2243+ seq_printf(m, "cpu family\t: %s\n", vx_new_uts(machine));
2142 seq_printf(m, "cpu type\t: %s\n", get_cpu_subtype()); 2244 seq_printf(m, "cpu type\t: %s\n", get_cpu_subtype());
2143 2245
2144 show_cpuflags(m); 2246 show_cpuflags(m);
2145diff -NurpP --minimal linux-2.6.18.2/arch/sh/kernel/sys_sh.c linux-2.6.18.2-vs2.1.1/arch/sh/kernel/sys_sh.c 2247Index: linux-2.6.18/arch/sh/kernel/sys_sh.c
2146--- linux-2.6.18.2/arch/sh/kernel/sys_sh.c 2005-08-29 22:24:55 +0200 2248===================================================================
2147+++ linux-2.6.18.2-vs2.1.1/arch/sh/kernel/sys_sh.c 2006-09-20 17:01:44 +0200 2249--- linux-2.6.18.orig/arch/sh/kernel/sys_sh.c
2250+++ linux-2.6.18/arch/sh/kernel/sys_sh.c
2148@@ -21,6 +21,7 @@ 2251@@ -21,6 +21,7 @@
2149 #include <linux/mman.h> 2252 #include <linux/mman.h>
2150 #include <linux/file.h> 2253 #include <linux/file.h>
2151 #include <linux/utsname.h> 2254 #include <linux/utsname.h>
2152+#include <linux/vs_cvirt.h> 2255+#include <linux/vs_cvirt.h>
2160- err=copy_to_user(name, &system_utsname, sizeof (*name)); 2263- err=copy_to_user(name, &system_utsname, sizeof (*name));
2161+ err=copy_to_user(name, vx_new_utsname(), sizeof (*name)); 2264+ err=copy_to_user(name, vx_new_utsname(), sizeof (*name));
2162 up_read(&uts_sem); 2265 up_read(&uts_sem);
2163 return err?-EFAULT:0; 2266 return err?-EFAULT:0;
2164 } 2267 }
2165diff -NurpP --minimal linux-2.6.18.2/arch/sh64/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/sh64/kernel/irq.c 2268Index: linux-2.6.18/arch/sh64/kernel/irq.c
2166--- linux-2.6.18.2/arch/sh64/kernel/irq.c 2006-09-20 16:58:01 +0200 2269===================================================================
2167+++ linux-2.6.18.2-vs2.1.1/arch/sh64/kernel/irq.c 2006-10-13 20:53:48 +0200 2270--- linux-2.6.18.orig/arch/sh64/kernel/irq.c
2271+++ linux-2.6.18/arch/sh64/kernel/irq.c
2168@@ -37,6 +37,7 @@ 2272@@ -37,6 +37,7 @@
2169 #include <asm/delay.h> 2273 #include <asm/delay.h>
2170 #include <asm/irq.h> 2274 #include <asm/irq.h>
2171 #include <linux/irq.h> 2275 #include <linux/irq.h>
2172+#include <linux/vs_context.h> 2276+#include <linux/vs_context.h>
2183 __do_IRQ(irq, regs); 2287 __do_IRQ(irq, regs);
2184+ __leave_vx_admin(&vxis); 2288+ __leave_vx_admin(&vxis);
2185 } else { 2289 } else {
2186 printk("unexpected IRQ trap at vector %03lx\n", vector_num); 2290 printk("unexpected IRQ trap at vector %03lx\n", vector_num);
2187 } 2291 }
2188diff -NurpP --minimal linux-2.6.18.2/arch/sh64/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/sh64/kernel/process.c 2292Index: linux-2.6.18/arch/sh64/kernel/process.c
2189--- linux-2.6.18.2/arch/sh64/kernel/process.c 2006-09-20 16:58:01 +0200 2293===================================================================
2190+++ linux-2.6.18.2-vs2.1.1/arch/sh64/kernel/process.c 2006-09-25 15:40:02 +0200 2294--- linux-2.6.18.orig/arch/sh64/kernel/process.c
2295+++ linux-2.6.18/arch/sh64/kernel/process.c
2191@@ -639,7 +639,7 @@ int kernel_thread(int (*fn)(void *), voi 2296@@ -639,7 +639,7 @@ int kernel_thread(int (*fn)(void *), voi
2192 static __inline__ _syscall2(int,clone,unsigned long,flags,unsigned long,newsp) 2297 static __inline__ _syscall2(int,clone,unsigned long,flags,unsigned long,newsp)
2193 static __inline__ _syscall1(int,exit,int,ret) 2298 static __inline__ _syscall1(int,exit,int,ret)
2194 2299
2195- reply = clone(flags | CLONE_VM, 0); 2300- reply = clone(flags | CLONE_VM, 0);
2196+ reply = clone(flags | CLONE_VM | CLONE_KTHREAD, 0); 2301+ reply = clone(flags | CLONE_VM | CLONE_KTHREAD, 0);
2197 if (!reply) { 2302 if (!reply) {
2198 /* Child */ 2303 /* Child */
2199 reply = exit(fn(arg)); 2304 reply = exit(fn(arg));
2200diff -NurpP --minimal linux-2.6.18.2/arch/sh64/kernel/sys_sh64.c linux-2.6.18.2-vs2.1.1/arch/sh64/kernel/sys_sh64.c 2305Index: linux-2.6.18/arch/sh64/kernel/sys_sh64.c
2201--- linux-2.6.18.2/arch/sh64/kernel/sys_sh64.c 2005-06-22 02:37:59 +0200 2306===================================================================
2202+++ linux-2.6.18.2-vs2.1.1/arch/sh64/kernel/sys_sh64.c 2006-09-20 17:01:44 +0200 2307--- linux-2.6.18.orig/arch/sh64/kernel/sys_sh64.c
2308+++ linux-2.6.18/arch/sh64/kernel/sys_sh64.c
2203@@ -29,6 +29,7 @@ 2309@@ -29,6 +29,7 @@
2204 #include <linux/file.h> 2310 #include <linux/file.h>
2205 #include <linux/utsname.h> 2311 #include <linux/utsname.h>
2206 #include <linux/syscalls.h> 2312 #include <linux/syscalls.h>
2207+#include <linux/vs_cvirt.h> 2313+#include <linux/vs_cvirt.h>
2215- err=copy_to_user(name, &system_utsname, sizeof (*name)); 2321- err=copy_to_user(name, &system_utsname, sizeof (*name));
2216+ err=copy_to_user(name, vx_new_utsname(), sizeof (*name)); 2322+ err=copy_to_user(name, vx_new_utsname(), sizeof (*name));
2217 up_read(&uts_sem); 2323 up_read(&uts_sem);
2218 return err?-EFAULT:0; 2324 return err?-EFAULT:0;
2219 } 2325 }
2220diff -NurpP --minimal linux-2.6.18.2/arch/sh64/mm/fault.c linux-2.6.18.2-vs2.1.1/arch/sh64/mm/fault.c 2326Index: linux-2.6.18/arch/sh64/mm/fault.c
2221--- linux-2.6.18.2/arch/sh64/mm/fault.c 2005-08-29 22:24:56 +0200 2327===================================================================
2222+++ linux-2.6.18.2-vs2.1.1/arch/sh64/mm/fault.c 2006-10-28 19:29:06 +0200 2328--- linux-2.6.18.orig/arch/sh64/mm/fault.c
2329+++ linux-2.6.18/arch/sh64/mm/fault.c
2223@@ -82,7 +82,7 @@ static inline void print_vma(struct vm_a 2330@@ -82,7 +82,7 @@ static inline void print_vma(struct vm_a
2224 2331
2225 static inline void print_task(struct task_struct *tsk) 2332 static inline void print_task(struct task_struct *tsk)
2226 { 2333 {
2227- printk("Task pid %d\n", tsk->pid); 2334- printk("Task pid %d\n", tsk->pid);
2228+ printk("Task pid %d:#%u\n", tsk->pid, tsk->xid); 2335+ printk("Task pid %d:#%u\n", tsk->pid, tsk->xid);
2229 } 2336 }
2230 2337
2231 static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address) 2338 static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address)
2232diff -NurpP --minimal linux-2.6.18.2/arch/sparc/Kconfig linux-2.6.18.2-vs2.1.1/arch/sparc/Kconfig 2339Index: linux-2.6.18/arch/sparc/Kconfig
2233--- linux-2.6.18.2/arch/sparc/Kconfig 2006-06-18 04:52:33 +0200 2340===================================================================
2234+++ linux-2.6.18.2-vs2.1.1/arch/sparc/Kconfig 2006-09-20 17:01:44 +0200 2341--- linux-2.6.18.orig/arch/sparc/Kconfig
2342+++ linux-2.6.18/arch/sparc/Kconfig
2235@@ -291,6 +291,8 @@ source "fs/Kconfig" 2343@@ -291,6 +291,8 @@ source "fs/Kconfig"
2236 2344
2237 source "arch/sparc/Kconfig.debug" 2345 source "arch/sparc/Kconfig.debug"
2238 2346
2239+source "kernel/vserver/Kconfig" 2347+source "kernel/vserver/Kconfig"
2240+ 2348+
2241 source "security/Kconfig" 2349 source "security/Kconfig"
2242 2350
2243 source "crypto/Kconfig" 2351 source "crypto/Kconfig"
2244diff -NurpP --minimal linux-2.6.18.2/arch/sparc/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/process.c 2352Index: linux-2.6.18/arch/sparc/kernel/process.c
2245--- linux-2.6.18.2/arch/sparc/kernel/process.c 2006-09-20 16:58:01 +0200 2353===================================================================
2246+++ linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/process.c 2006-09-25 15:40:02 +0200 2354--- linux-2.6.18.orig/arch/sparc/kernel/process.c
2355+++ linux-2.6.18/arch/sparc/kernel/process.c
2247@@ -705,7 +705,8 @@ pid_t kernel_thread(int (*fn)(void *), v 2356@@ -705,7 +705,8 @@ pid_t kernel_thread(int (*fn)(void *), v
2248 /* Notreached by child. */ 2357 /* Notreached by child. */
2249 "1: mov %%o0, %0\n\t" : 2358 "1: mov %%o0, %0\n\t" :
2250 "=r" (retval) : 2359 "=r" (retval) :
2251- "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED), 2360- "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED),
2252+ "i" (__NR_clone), "r" (flags | 2361+ "i" (__NR_clone), "r" (flags |
2253+ CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD), 2362+ CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD),
2254 "i" (__NR_exit), "r" (fn), "r" (arg) : 2363 "i" (__NR_exit), "r" (fn), "r" (arg) :
2255 "g1", "g2", "g3", "o0", "o1", "memory", "cc"); 2364 "g1", "g2", "g3", "o0", "o1", "memory", "cc");
2256 return retval; 2365 return retval;
2257diff -NurpP --minimal linux-2.6.18.2/arch/sparc/kernel/ptrace.c linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/ptrace.c 2366Index: linux-2.6.18/arch/sparc/kernel/ptrace.c
2258--- linux-2.6.18.2/arch/sparc/kernel/ptrace.c 2006-04-09 13:49:44 +0200 2367===================================================================
2259+++ linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/ptrace.c 2006-10-06 23:10:42 +0200 2368--- linux-2.6.18.orig/arch/sparc/kernel/ptrace.c
2369+++ linux-2.6.18/arch/sparc/kernel/ptrace.c
2260@@ -299,6 +299,10 @@ asmlinkage void do_ptrace(struct pt_regs 2370@@ -299,6 +299,10 @@ asmlinkage void do_ptrace(struct pt_regs
2261 pt_error_return(regs, -ret); 2371 pt_error_return(regs, -ret);
2262 goto out; 2372 goto out;
2263 } 2373 }
2264+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) { 2374+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) {
2266+ goto out_tsk; 2376+ goto out_tsk;
2267+ } 2377+ }
2268 2378
2269 if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH) 2379 if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH)
2270 || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) { 2380 || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) {
2271diff -NurpP --minimal linux-2.6.18.2/arch/sparc/kernel/sys_sparc.c linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/sys_sparc.c 2381Index: linux-2.6.18/arch/sparc/kernel/sys_sparc.c
2382===================================================================
2272--- linux-2.6.18.2/arch/sparc/kernel/sys_sparc.c 2006-09-20 16:58:04 +0200 2383--- linux-2.6.18.orig/arch/sparc/kernel/sys_sparc.c
2273+++ linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/sys_sparc.c 2006-09-20 19:57:58 +0200 2384+++ linux-2.6.18/arch/sparc/kernel/sys_sparc.c
2274@@ -21,6 +21,7 @@ 2385@@ -21,6 +21,7 @@
2275 #include <linux/utsname.h> 2386 #include <linux/utsname.h>
2276 #include <linux/smp.h> 2387 #include <linux/smp.h>
2277 #include <linux/smp_lock.h> 2388 #include <linux/smp_lock.h>
2278+#include <linux/vs_cvirt.h> 2389+#include <linux/vs_cvirt.h>
2293- if (!copy_to_user(name, system_utsname.domainname, nlen)) 2404- if (!copy_to_user(name, system_utsname.domainname, nlen))
2294+ if (!copy_to_user(name, vx_new_uts(domainname), nlen)) 2405+ if (!copy_to_user(name, vx_new_uts(domainname), nlen))
2295 err = 0; 2406 err = 0;
2296 2407
2297 out: 2408 out:
2298diff -NurpP --minimal linux-2.6.18.2/arch/sparc/kernel/sys_sunos.c linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/sys_sunos.c 2409Index: linux-2.6.18/arch/sparc/kernel/sys_sunos.c
2410===================================================================
2299--- linux-2.6.18.2/arch/sparc/kernel/sys_sunos.c 2006-09-20 16:58:06 +0200 2411--- linux-2.6.18.orig/arch/sparc/kernel/sys_sunos.c
2300+++ linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/sys_sunos.c 2006-09-20 17:01:44 +0200 2412+++ linux-2.6.18/arch/sparc/kernel/sys_sunos.c
2301@@ -35,6 +35,7 @@ 2413@@ -35,6 +35,7 @@
2302 #include <linux/smp.h> 2414 #include <linux/smp.h>
2303 #include <linux/smp_lock.h> 2415 #include <linux/smp_lock.h>
2304 #include <linux/syscalls.h> 2416 #include <linux/syscalls.h>
2305+#include <linux/vs_cvirt.h> 2417+#include <linux/vs_cvirt.h>
2326+ ret |= __copy_to_user(&name->ver[0], ptr->version, sizeof(name->ver) - 1); 2438+ ret |= __copy_to_user(&name->ver[0], ptr->version, sizeof(name->ver) - 1);
2327+ ret |= __copy_to_user(&name->mach[0], ptr->machine, sizeof(name->mach) - 1); 2439+ ret |= __copy_to_user(&name->mach[0], ptr->machine, sizeof(name->mach) - 1);
2328 } 2440 }
2329 up_read(&uts_sem); 2441 up_read(&uts_sem);
2330 return ret ? -EFAULT : 0; 2442 return ret ? -EFAULT : 0;
2331diff -NurpP --minimal linux-2.6.18.2/arch/sparc/kernel/systbls.S linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/systbls.S 2443Index: linux-2.6.18/arch/sparc/kernel/systbls.S
2332--- linux-2.6.18.2/arch/sparc/kernel/systbls.S 2006-09-20 16:58:06 +0200 2444===================================================================
2333+++ linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/systbls.S 2006-09-20 17:01:44 +0200 2445--- linux-2.6.18.orig/arch/sparc/kernel/systbls.S
2446+++ linux-2.6.18/arch/sparc/kernel/systbls.S
2334@@ -71,7 +71,7 @@ sys_call_table: 2447@@ -71,7 +71,7 @@ sys_call_table:
2335 /*250*/ .long sparc_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl 2448 /*250*/ .long sparc_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
2336 /*255*/ .long sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep 2449 /*255*/ .long sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
2337 /*260*/ .long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun 2450 /*260*/ .long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun
2338-/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy 2451-/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy
2339+/*265*/ .long sys_timer_delete, sys_timer_create, sys_vserver, sys_io_setup, sys_io_destroy 2452+/*265*/ .long sys_timer_delete, sys_timer_create, sys_vserver, sys_io_setup, sys_io_destroy
2340 /*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 2453 /*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
2341 /*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid 2454 /*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
2342 /*280*/ .long sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat 2455 /*280*/ .long sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
2343diff -NurpP --minimal linux-2.6.18.2/arch/sparc/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/traps.c 2456Index: linux-2.6.18/arch/sparc/kernel/traps.c
2344--- linux-2.6.18.2/arch/sparc/kernel/traps.c 2006-09-20 16:58:06 +0200 2457===================================================================
2345+++ linux-2.6.18.2-vs2.1.1/arch/sparc/kernel/traps.c 2006-09-25 15:40:02 +0200 2458--- linux-2.6.18.orig/arch/sparc/kernel/traps.c
2459+++ linux-2.6.18/arch/sparc/kernel/traps.c
2346@@ -99,7 +99,8 @@ void die_if_kernel(char *str, struct pt_ 2460@@ -99,7 +99,8 @@ void die_if_kernel(char *str, struct pt_
2347 " /_| \\__/ |_\\\n" 2461 " /_| \\__/ |_\\\n"
2348 " \\__U_/\n"); 2462 " \\__U_/\n");
2349 2463
2350- printk("%s(%d): %s [#%d]\n", current->comm, current->pid, str, ++die_counter); 2464- printk("%s(%d): %s [#%d]\n", current->comm, current->pid, str, ++die_counter);
2351+ printk("%s(%d[#%u]): %s [#%d]\n", current->comm, 2465+ printk("%s(%d[#%u]): %s [#%d]\n", current->comm,
2352+ current->pid, current->xid, str, ++die_counter); 2466+ current->pid, current->xid, str, ++die_counter);
2353 show_regs(regs); 2467 show_regs(regs);
2354 2468
2355 __SAVE; __SAVE; __SAVE; __SAVE; 2469 __SAVE; __SAVE; __SAVE; __SAVE;
2356diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/Kconfig linux-2.6.18.2-vs2.1.1/arch/sparc64/Kconfig 2470Index: linux-2.6.18/arch/sparc64/Kconfig
2357--- linux-2.6.18.2/arch/sparc64/Kconfig 2006-09-20 16:58:06 +0200 2471===================================================================
2358+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/Kconfig 2006-09-20 17:01:44 +0200 2472--- linux-2.6.18.orig/arch/sparc64/Kconfig
2473+++ linux-2.6.18/arch/sparc64/Kconfig
2359@@ -431,6 +431,8 @@ endmenu 2474@@ -431,6 +431,8 @@ endmenu
2360 2475
2361 source "arch/sparc64/Kconfig.debug" 2476 source "arch/sparc64/Kconfig.debug"
2362 2477
2363+source "kernel/vserver/Kconfig" 2478+source "kernel/vserver/Kconfig"
2364+ 2479+
2365 source "security/Kconfig" 2480 source "security/Kconfig"
2366 2481
2367 source "crypto/Kconfig" 2482 source "crypto/Kconfig"
2368diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/kernel/binfmt_aout32.c linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/binfmt_aout32.c 2483Index: linux-2.6.18/arch/sparc64/kernel/binfmt_aout32.c
2484===================================================================
2369--- linux-2.6.18.2/arch/sparc64/kernel/binfmt_aout32.c 2006-06-18 04:52:34 +0200 2485--- linux-2.6.18.orig/arch/sparc64/kernel/binfmt_aout32.c
2370+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/binfmt_aout32.c 2006-09-20 17:01:44 +0200 2486+++ linux-2.6.18/arch/sparc64/kernel/binfmt_aout32.c
2371@@ -27,6 +27,7 @@ 2487@@ -27,6 +27,7 @@
2372 #include <linux/binfmts.h> 2488 #include <linux/binfmts.h>
2373 #include <linux/personality.h> 2489 #include <linux/personality.h>
2374 #include <linux/init.h> 2490 #include <linux/init.h>
2375+#include <linux/vs_memory.h> 2491+#include <linux/vs_memory.h>
2376 2492
2377 #include <asm/system.h> 2493 #include <asm/system.h>
2378 #include <asm/uaccess.h> 2494 #include <asm/uaccess.h>
2379diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/process.c 2495Index: linux-2.6.18/arch/sparc64/kernel/process.c
2496===================================================================
2380--- linux-2.6.18.2/arch/sparc64/kernel/process.c 2006-09-20 16:58:06 +0200 2497--- linux-2.6.18.orig/arch/sparc64/kernel/process.c
2381+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/process.c 2006-09-25 15:40:02 +0200 2498+++ linux-2.6.18/arch/sparc64/kernel/process.c
2382@@ -696,7 +696,8 @@ pid_t kernel_thread(int (*fn)(void *), v 2499@@ -696,7 +696,8 @@ pid_t kernel_thread(int (*fn)(void *), v
2383 /* Notreached by child. */ 2500 /* Notreached by child. */
2384 "1:" : 2501 "1:" :
2385 "=r" (retval) : 2502 "=r" (retval) :
2386- "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED), 2503- "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED),
2387+ "i" (__NR_clone), "r" (flags | 2504+ "i" (__NR_clone), "r" (flags |
2388+ CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD), 2505+ CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD),
2389 "i" (__NR_exit), "r" (fn), "r" (arg) : 2506 "i" (__NR_exit), "r" (fn), "r" (arg) :
2390 "g1", "g2", "g3", "o0", "o1", "memory", "cc"); 2507 "g1", "g2", "g3", "o0", "o1", "memory", "cc");
2391 return retval; 2508 return retval;
2392diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/kernel/ptrace.c linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/ptrace.c 2509Index: linux-2.6.18/arch/sparc64/kernel/ptrace.c
2393--- linux-2.6.18.2/arch/sparc64/kernel/ptrace.c 2006-06-18 04:52:35 +0200 2510===================================================================
2394+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/ptrace.c 2006-10-06 23:10:42 +0200 2511--- linux-2.6.18.orig/arch/sparc64/kernel/ptrace.c
2512+++ linux-2.6.18/arch/sparc64/kernel/ptrace.c
2395@@ -212,6 +212,10 @@ asmlinkage void do_ptrace(struct pt_regs 2513@@ -212,6 +212,10 @@ asmlinkage void do_ptrace(struct pt_regs
2396 pt_error_return(regs, -ret); 2514 pt_error_return(regs, -ret);
2397 goto out; 2515 goto out;
2398 } 2516 }
2399+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) { 2517+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) {
2401+ goto out_tsk; 2519+ goto out_tsk;
2402+ } 2520+ }
2403 2521
2404 if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH) 2522 if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH)
2405 || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) { 2523 || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) {
2406diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/kernel/sys_sparc.c linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/sys_sparc.c 2524Index: linux-2.6.18/arch/sparc64/kernel/sys_sparc.c
2525===================================================================
2407--- linux-2.6.18.2/arch/sparc64/kernel/sys_sparc.c 2006-09-20 16:58:06 +0200 2526--- linux-2.6.18.orig/arch/sparc64/kernel/sys_sparc.c
2408+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/sys_sparc.c 2006-09-20 19:57:05 +0200 2527+++ linux-2.6.18/arch/sparc64/kernel/sys_sparc.c
2409@@ -25,6 +25,7 @@ 2528@@ -25,6 +25,7 @@
2410 #include <linux/ipc.h> 2529 #include <linux/ipc.h>
2411 #include <linux/personality.h> 2530 #include <linux/personality.h>
2412 #include <linux/random.h> 2531 #include <linux/random.h>
2413+#include <linux/vs_cvirt.h> 2532+#include <linux/vs_cvirt.h>
2428- if (!copy_to_user(name, system_utsname.domainname, nlen)) 2547- if (!copy_to_user(name, system_utsname.domainname, nlen))
2429+ if (!copy_to_user(name, vx_new_uts(domainname), nlen)) 2548+ if (!copy_to_user(name, vx_new_uts(domainname), nlen))
2430 err = 0; 2549 err = 0;
2431 2550
2432 out: 2551 out:
2433diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/kernel/sys_sparc32.c linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/sys_sparc32.c 2552Index: linux-2.6.18/arch/sparc64/kernel/sys_sparc32.c
2553===================================================================
2434--- linux-2.6.18.2/arch/sparc64/kernel/sys_sparc32.c 2006-09-20 16:58:06 +0200 2554--- linux-2.6.18.orig/arch/sparc64/kernel/sys_sparc32.c
2435+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/sys_sparc32.c 2006-09-25 15:40:02 +0200 2555+++ linux-2.6.18/arch/sparc64/kernel/sys_sparc32.c
2436@@ -787,7 +787,7 @@ asmlinkage long sys32_gettimeofday(struc 2556@@ -787,7 +787,7 @@ asmlinkage long sys32_gettimeofday(struc
2437 { 2557 {
2438 if (tv) { 2558 if (tv) {
2439 struct timeval ktv; 2559 struct timeval ktv;
2440- do_gettimeofday(&ktv); 2560- do_gettimeofday(&ktv);
2441+ vx_gettimeofday(&ktv); 2561+ vx_gettimeofday(&ktv);
2442 if (put_tv32(tv, &ktv)) 2562 if (put_tv32(tv, &ktv))
2443 return -EFAULT; 2563 return -EFAULT;
2444 } 2564 }
2445diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/kernel/sys_sunos32.c linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/sys_sunos32.c 2565Index: linux-2.6.18/arch/sparc64/kernel/sys_sunos32.c
2566===================================================================
2446--- linux-2.6.18.2/arch/sparc64/kernel/sys_sunos32.c 2006-09-20 16:58:06 +0200 2567--- linux-2.6.18.orig/arch/sparc64/kernel/sys_sunos32.c
2447+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/sys_sunos32.c 2006-09-20 17:01:44 +0200 2568+++ linux-2.6.18/arch/sparc64/kernel/sys_sunos32.c
2448@@ -35,6 +35,7 @@ 2569@@ -35,6 +35,7 @@
2449 #include <linux/smp.h> 2570 #include <linux/smp.h>
2450 #include <linux/smp_lock.h> 2571 #include <linux/smp_lock.h>
2451 #include <linux/syscalls.h> 2572 #include <linux/syscalls.h>
2452+#include <linux/vs_cvirt.h> 2573+#include <linux/vs_cvirt.h>
2477- ret |= copy_to_user(&name->mach[0], &system_utsname.machine[0], 2598- ret |= copy_to_user(&name->mach[0], &system_utsname.machine[0],
2478+ ret |= copy_to_user(&name->mach[0], ptr->machine, 2599+ ret |= copy_to_user(&name->mach[0], ptr->machine,
2479 sizeof(name->mach) - 1); 2600 sizeof(name->mach) - 1);
2480 up_read(&uts_sem); 2601 up_read(&uts_sem);
2481 return (ret ? -EFAULT : 0); 2602 return (ret ? -EFAULT : 0);
2482diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/kernel/systbls.S linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/systbls.S 2603Index: linux-2.6.18/arch/sparc64/kernel/systbls.S
2604===================================================================
2483--- linux-2.6.18.2/arch/sparc64/kernel/systbls.S 2006-09-20 16:58:06 +0200 2605--- linux-2.6.18.orig/arch/sparc64/kernel/systbls.S
2484+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/systbls.S 2006-09-20 17:01:44 +0200 2606+++ linux-2.6.18/arch/sparc64/kernel/systbls.S
2485@@ -72,7 +72,7 @@ sys_call_table32: 2607@@ -72,7 +72,7 @@ sys_call_table32:
2486 /*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl 2608 /*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
2487 .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep 2609 .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
2488 /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun 2610 /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun
2489- .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy 2611- .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
2498- .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy 2620- .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy
2499+ .word sys_timer_delete, sys_timer_create, sys_vserver, sys_io_setup, sys_io_destroy 2621+ .word sys_timer_delete, sys_timer_create, sys_vserver, sys_io_setup, sys_io_destroy
2500 /*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 2622 /*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
2501 .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid 2623 .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
2502 /*280*/ .word sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat 2624 /*280*/ .word sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
2503diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/traps.c 2625Index: linux-2.6.18/arch/sparc64/kernel/traps.c
2504--- linux-2.6.18.2/arch/sparc64/kernel/traps.c 2006-09-20 16:58:06 +0200 2626===================================================================
2505+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/kernel/traps.c 2006-09-25 15:40:02 +0200 2627--- linux-2.6.18.orig/arch/sparc64/kernel/traps.c
2628+++ linux-2.6.18/arch/sparc64/kernel/traps.c
2506@@ -2215,7 +2215,8 @@ void die_if_kernel(char *str, struct pt_ 2629@@ -2215,7 +2215,8 @@ void die_if_kernel(char *str, struct pt_
2507 " /_| \\__/ |_\\\n" 2630 " /_| \\__/ |_\\\n"
2508 " \\__U_/\n"); 2631 " \\__U_/\n");
2509 2632
2510- printk("%s(%d): %s [#%d]\n", current->comm, current->pid, str, ++die_counter); 2633- printk("%s(%d): %s [#%d]\n", current->comm, current->pid, str, ++die_counter);
2511+ printk("%s(%d[#%u]): %s [#%d]\n", current->comm, 2634+ printk("%s(%d[#%u]): %s [#%d]\n", current->comm,
2512+ current->pid, current->xid, str, ++die_counter); 2635+ current->pid, current->xid, str, ++die_counter);
2513 notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV); 2636 notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV);
2514 __asm__ __volatile__("flushw"); 2637 __asm__ __volatile__("flushw");
2515 __show_regs(regs); 2638 __show_regs(regs);
2516diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/solaris/fs.c linux-2.6.18.2-vs2.1.1/arch/sparc64/solaris/fs.c 2639Index: linux-2.6.18/arch/sparc64/solaris/fs.c
2517--- linux-2.6.18.2/arch/sparc64/solaris/fs.c 2006-09-20 16:58:06 +0200 2640===================================================================
2518+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/solaris/fs.c 2006-09-20 17:01:44 +0200 2641--- linux-2.6.18.orig/arch/sparc64/solaris/fs.c
2642+++ linux-2.6.18/arch/sparc64/solaris/fs.c
2519@@ -363,7 +363,7 @@ static int report_statvfs(struct vfsmoun 2643@@ -363,7 +363,7 @@ static int report_statvfs(struct vfsmoun
2520 int j = strlen (p); 2644 int j = strlen (p);
2521 2645
2522 if (j > 15) j = 15; 2646 if (j > 15) j = 15;
2523- if (IS_RDONLY(inode)) i = 1; 2647- if (IS_RDONLY(inode)) i = 1;
2532- if (IS_RDONLY(inode)) i = 1; 2656- if (IS_RDONLY(inode)) i = 1;
2533+ if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt)) i = 1; 2657+ if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt)) i = 1;
2534 if (mnt->mnt_flags & MNT_NOSUID) i |= 2; 2658 if (mnt->mnt_flags & MNT_NOSUID) i |= 2;
2535 if (!sysv_valid_dev(inode->i_sb->s_dev)) 2659 if (!sysv_valid_dev(inode->i_sb->s_dev))
2536 return -EOVERFLOW; 2660 return -EOVERFLOW;
2537diff -NurpP --minimal linux-2.6.18.2/arch/sparc64/solaris/misc.c linux-2.6.18.2-vs2.1.1/arch/sparc64/solaris/misc.c 2661Index: linux-2.6.18/arch/sparc64/solaris/misc.c
2538--- linux-2.6.18.2/arch/sparc64/solaris/misc.c 2006-09-20 16:58:06 +0200 2662===================================================================
2539+++ linux-2.6.18.2-vs2.1.1/arch/sparc64/solaris/misc.c 2006-09-20 17:01:44 +0200 2663--- linux-2.6.18.orig/arch/sparc64/solaris/misc.c
2664+++ linux-2.6.18/arch/sparc64/solaris/misc.c
2540@@ -16,6 +16,7 @@ 2665@@ -16,6 +16,7 @@
2541 #include <linux/timex.h> 2666 #include <linux/timex.h>
2542 #include <linux/major.h> 2667 #include <linux/major.h>
2543 #include <linux/compat.h> 2668 #include <linux/compat.h>
2544+#include <linux/vs_cvirt.h> 2669+#include <linux/vs_cvirt.h>
2570- for (p = system_utsname.nodename, q = buffer; 2695- for (p = system_utsname.nodename, q = buffer;
2571+ for (p = vx_new_uts(nodename), q = buffer; 2696+ for (p = vx_new_uts(nodename), q = buffer;
2572 q < r && *p && *p != '.'; *q++ = *p++); 2697 q < r && *p && *p != '.'; *q++ = *p++);
2573 up_read(&uts_sem); 2698 up_read(&uts_sem);
2574 *q = 0; 2699 *q = 0;
2575diff -NurpP --minimal linux-2.6.18.2/arch/um/Kconfig linux-2.6.18.2-vs2.1.1/arch/um/Kconfig 2700Index: linux-2.6.18/arch/um/Kconfig
2576--- linux-2.6.18.2/arch/um/Kconfig 2006-11-04 19:43:22 +0100 2701===================================================================
2577+++ linux-2.6.18.2-vs2.1.1/arch/um/Kconfig 2006-10-18 01:14:30 +0200 2702--- linux-2.6.18.orig/arch/um/Kconfig
2703+++ linux-2.6.18/arch/um/Kconfig
2578@@ -284,6 +284,8 @@ source "drivers/connector/Kconfig" 2704@@ -284,6 +284,8 @@ source "drivers/connector/Kconfig"
2579 2705
2580 source "fs/Kconfig" 2706 source "fs/Kconfig"
2581 2707
2582+source "kernel/vserver/Kconfig" 2708+source "kernel/vserver/Kconfig"
2583+ 2709+
2584 source "security/Kconfig" 2710 source "security/Kconfig"
2585 2711
2586 source "crypto/Kconfig" 2712 source "crypto/Kconfig"
2587diff -NurpP --minimal linux-2.6.18.2/arch/um/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/um/kernel/irq.c 2713Index: linux-2.6.18/arch/um/kernel/irq.c
2588--- linux-2.6.18.2/arch/um/kernel/irq.c 2006-09-20 16:58:06 +0200 2714===================================================================
2589+++ linux-2.6.18.2-vs2.1.1/arch/um/kernel/irq.c 2006-10-13 20:54:08 +0200 2715--- linux-2.6.18.orig/arch/um/kernel/irq.c
2716+++ linux-2.6.18/arch/um/kernel/irq.c
2590@@ -19,6 +19,7 @@ 2717@@ -19,6 +19,7 @@
2591 #include "linux/seq_file.h" 2718 #include "linux/seq_file.h"
2592 #include "linux/profile.h" 2719 #include "linux/profile.h"
2593 #include "linux/hardirq.h" 2720 #include "linux/hardirq.h"
2594+#include "linux/vs_context.h" 2721+#include "linux/vs_context.h"
2613+ irq_exit(); 2740+ irq_exit();
2614+ return 1; 2741+ return 1;
2615 } 2742 }
2616 2743
2617 int um_request_irq(unsigned int irq, int fd, int type, 2744 int um_request_irq(unsigned int irq, int fd, int type,
2618diff -NurpP --minimal linux-2.6.18.2/arch/um/kernel/process_kern.c linux-2.6.18.2-vs2.1.1/arch/um/kernel/process_kern.c 2745Index: linux-2.6.18/arch/um/kernel/process_kern.c
2746===================================================================
2619--- linux-2.6.18.2/arch/um/kernel/process_kern.c 2006-06-18 04:52:38 +0200 2747--- linux-2.6.18.orig/arch/um/kernel/process_kern.c
2620+++ linux-2.6.18.2-vs2.1.1/arch/um/kernel/process_kern.c 2006-11-03 00:38:37 +0100 2748+++ linux-2.6.18/arch/um/kernel/process_kern.c
2621@@ -95,7 +95,7 @@ int kernel_thread(int (*fn)(void *), voi 2749@@ -95,7 +95,7 @@ int kernel_thread(int (*fn)(void *), voi
2622 2750
2623 current->thread.request.u.thread.proc = fn; 2751 current->thread.request.u.thread.proc = fn;
2624 current->thread.request.u.thread.arg = arg; 2752 current->thread.request.u.thread.arg = arg;
2625- pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0, 2753- pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0,
2626+ pid = do_fork(CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD | flags, 0, 2754+ pid = do_fork(CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD | flags, 0,
2627 &current->thread.regs, 0, NULL, NULL); 2755 &current->thread.regs, 0, NULL, NULL);
2628 if(pid < 0) 2756 if(pid < 0)
2629 panic("do_fork failed in kernel_thread, errno = %d", pid); 2757 panic("do_fork failed in kernel_thread, errno = %d", pid);
2630diff -NurpP --minimal linux-2.6.18.2/arch/um/kernel/syscall.c linux-2.6.18.2-vs2.1.1/arch/um/kernel/syscall.c 2758Index: linux-2.6.18/arch/um/kernel/syscall.c
2631--- linux-2.6.18.2/arch/um/kernel/syscall.c 2006-09-20 16:58:06 +0200 2759===================================================================
2632+++ linux-2.6.18.2-vs2.1.1/arch/um/kernel/syscall.c 2006-09-21 16:41:49 +0200 2760--- linux-2.6.18.orig/arch/um/kernel/syscall.c
2761+++ linux-2.6.18/arch/um/kernel/syscall.c
2633@@ -15,6 +15,8 @@ 2762@@ -15,6 +15,8 @@
2634 #include "linux/unistd.h" 2763 #include "linux/unistd.h"
2635 #include "linux/slab.h" 2764 #include "linux/slab.h"
2636 #include "linux/utime.h" 2765 #include "linux/utime.h"
2637+#include <linux/vs_cvirt.h> 2766+#include <linux/vs_cvirt.h>
2680- error |= __copy_to_user(&name->machine,&system_utsname.machine, 2809- error |= __copy_to_user(&name->machine,&system_utsname.machine,
2681+ error |= __copy_to_user(&name->machine,ptr->machine, 2810+ error |= __copy_to_user(&name->machine,ptr->machine,
2682 __OLD_UTS_LEN); 2811 __OLD_UTS_LEN);
2683 error |= __put_user(0,name->machine+__OLD_UTS_LEN); 2812 error |= __put_user(0,name->machine+__OLD_UTS_LEN);
2684 2813
2685diff -NurpP --minimal linux-2.6.18.2/arch/um/sys-x86_64/syscalls.c linux-2.6.18.2-vs2.1.1/arch/um/sys-x86_64/syscalls.c 2814Index: linux-2.6.18/arch/um/sys-x86_64/syscalls.c
2815===================================================================
2686--- linux-2.6.18.2/arch/um/sys-x86_64/syscalls.c 2006-06-18 04:52:42 +0200 2816--- linux-2.6.18.orig/arch/um/sys-x86_64/syscalls.c
2687+++ linux-2.6.18.2-vs2.1.1/arch/um/sys-x86_64/syscalls.c 2006-09-20 17:01:44 +0200 2817+++ linux-2.6.18/arch/um/sys-x86_64/syscalls.c
2688@@ -9,6 +9,7 @@ 2818@@ -9,6 +9,7 @@
2689 #include "linux/shm.h" 2819 #include "linux/shm.h"
2690 #include "linux/utsname.h" 2820 #include "linux/utsname.h"
2691 #include "linux/personality.h" 2821 #include "linux/personality.h"
2692+#include "linux/vs_cvirt.h" 2822+#include "linux/vs_cvirt.h"
2700- err = copy_to_user(name, &system_utsname, sizeof (*name)); 2830- err = copy_to_user(name, &system_utsname, sizeof (*name));
2701+ err = copy_to_user(name, vx_new_utsname(), sizeof (*name)); 2831+ err = copy_to_user(name, vx_new_utsname(), sizeof (*name));
2702 up_read(&uts_sem); 2832 up_read(&uts_sem);
2703 if (personality(current->personality) == PER_LINUX32) 2833 if (personality(current->personality) == PER_LINUX32)
2704 err |= copy_to_user(&name->machine, "i686", 5); 2834 err |= copy_to_user(&name->machine, "i686", 5);
2705diff -NurpP --minimal linux-2.6.18.2/arch/v850/Kconfig linux-2.6.18.2-vs2.1.1/arch/v850/Kconfig 2835Index: linux-2.6.18/arch/v850/Kconfig
2706--- linux-2.6.18.2/arch/v850/Kconfig 2006-06-18 04:52:42 +0200 2836===================================================================
2707+++ linux-2.6.18.2-vs2.1.1/arch/v850/Kconfig 2006-09-20 17:01:44 +0200 2837--- linux-2.6.18.orig/arch/v850/Kconfig
2838+++ linux-2.6.18/arch/v850/Kconfig
2708@@ -326,6 +326,8 @@ source "drivers/usb/Kconfig" 2839@@ -326,6 +326,8 @@ source "drivers/usb/Kconfig"
2709 2840
2710 source "arch/v850/Kconfig.debug" 2841 source "arch/v850/Kconfig.debug"
2711 2842
2712+source "kernel/vserver/Kconfig" 2843+source "kernel/vserver/Kconfig"
2713+ 2844+
2714 source "security/Kconfig" 2845 source "security/Kconfig"
2715 2846
2716 source "crypto/Kconfig" 2847 source "crypto/Kconfig"
2717diff -NurpP --minimal linux-2.6.18.2/arch/v850/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/v850/kernel/irq.c 2848Index: linux-2.6.18/arch/v850/kernel/irq.c
2718--- linux-2.6.18.2/arch/v850/kernel/irq.c 2006-09-20 16:58:06 +0200 2849===================================================================
2719+++ linux-2.6.18.2-vs2.1.1/arch/v850/kernel/irq.c 2006-10-25 03:39:09 +0200 2850--- linux-2.6.18.orig/arch/v850/kernel/irq.c
2851+++ linux-2.6.18/arch/v850/kernel/irq.c
2720@@ -23,6 +23,7 @@ 2852@@ -23,6 +23,7 @@
2721 #include <linux/mm.h> 2853 #include <linux/mm.h>
2722 #include <linux/random.h> 2854 #include <linux/random.h>
2723 #include <linux/seq_file.h> 2855 #include <linux/seq_file.h>
2724+#include <linux/vs_context.h> 2856+#include <linux/vs_context.h>
2736 __do_IRQ(irq, regs); 2868 __do_IRQ(irq, regs);
2737+ __leave_vx_admin(&vxis); 2869+ __leave_vx_admin(&vxis);
2738 irq_exit(); 2870 irq_exit();
2739 return 1; 2871 return 1;
2740 } 2872 }
2741diff -NurpP --minimal linux-2.6.18.2/arch/v850/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/v850/kernel/process.c 2873Index: linux-2.6.18/arch/v850/kernel/process.c
2742--- linux-2.6.18.2/arch/v850/kernel/process.c 2006-09-20 16:58:06 +0200 2874===================================================================
2743+++ linux-2.6.18.2-vs2.1.1/arch/v850/kernel/process.c 2006-09-25 15:40:02 +0200 2875--- linux-2.6.18.orig/arch/v850/kernel/process.c
2876+++ linux-2.6.18/arch/v850/kernel/process.c
2744@@ -83,7 +83,7 @@ int kernel_thread (int (*fn)(void *), vo 2877@@ -83,7 +83,7 @@ int kernel_thread (int (*fn)(void *), vo
2745 /* Clone this thread. Note that we don't pass the clone syscall's 2878 /* Clone this thread. Note that we don't pass the clone syscall's
2746 second argument -- it's ignored for calls from kernel mode (the 2879 second argument -- it's ignored for calls from kernel mode (the
2747 child's SP is always set to the top of the kernel stack). */ 2880 child's SP is always set to the top of the kernel stack). */
2748- arg0 = flags | CLONE_VM; 2881- arg0 = flags | CLONE_VM;
2749+ arg0 = flags | CLONE_VM | CLONE_KTHREAD; 2882+ arg0 = flags | CLONE_VM | CLONE_KTHREAD;
2750 syscall = __NR_clone; 2883 syscall = __NR_clone;
2751 asm volatile ("trap " SYSCALL_SHORT_TRAP 2884 asm volatile ("trap " SYSCALL_SHORT_TRAP
2752 : "=r" (ret), "=r" (syscall) 2885 : "=r" (ret), "=r" (syscall)
2753diff -NurpP --minimal linux-2.6.18.2/arch/v850/kernel/ptrace.c linux-2.6.18.2-vs2.1.1/arch/v850/kernel/ptrace.c 2886Index: linux-2.6.18/arch/v850/kernel/ptrace.c
2754--- linux-2.6.18.2/arch/v850/kernel/ptrace.c 2006-04-09 13:49:44 +0200 2887===================================================================
2755+++ linux-2.6.18.2-vs2.1.1/arch/v850/kernel/ptrace.c 2006-09-25 15:40:02 +0200 2888--- linux-2.6.18.orig/arch/v850/kernel/ptrace.c
2889+++ linux-2.6.18/arch/v850/kernel/ptrace.c
2756@@ -117,6 +117,9 @@ long arch_ptrace(struct task_struct *chi 2890@@ -117,6 +117,9 @@ long arch_ptrace(struct task_struct *chi
2757 { 2891 {
2758 int rval; 2892 int rval;
2759 2893
2760+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT)) 2894+ if (!vx_check(vx_task_xid(child), VX_WATCH_P|VX_IDENT))
2761+ goto out; 2895+ goto out;
2762+ 2896+
2763 switch (request) { 2897 switch (request) {
2764 unsigned long val, copied; 2898 unsigned long val, copied;
2765 2899
2766diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/Kconfig linux-2.6.18.2-vs2.1.1/arch/x86_64/Kconfig 2900Index: linux-2.6.18/arch/x86_64/Kconfig
2767--- linux-2.6.18.2/arch/x86_64/Kconfig 2006-09-20 16:58:06 +0200 2901===================================================================
2768+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/Kconfig 2006-09-20 17:01:44 +0200 2902--- linux-2.6.18.orig/arch/x86_64/Kconfig
2903+++ linux-2.6.18/arch/x86_64/Kconfig
2769@@ -654,6 +654,8 @@ endmenu 2904@@ -654,6 +654,8 @@ endmenu
2770 2905
2771 source "arch/x86_64/Kconfig.debug" 2906 source "arch/x86_64/Kconfig.debug"
2772 2907
2773+source "kernel/vserver/Kconfig" 2908+source "kernel/vserver/Kconfig"
2774+ 2909+
2775 source "security/Kconfig" 2910 source "security/Kconfig"
2776 2911
2777 source "crypto/Kconfig" 2912 source "crypto/Kconfig"
2778diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/ia32/ia32_aout.c linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/ia32_aout.c 2913Index: linux-2.6.18/arch/x86_64/ia32/ia32_aout.c
2779--- linux-2.6.18.2/arch/x86_64/ia32/ia32_aout.c 2006-01-03 17:29:20 +0100 2914===================================================================
2780+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/ia32_aout.c 2006-09-20 17:01:44 +0200 2915--- linux-2.6.18.orig/arch/x86_64/ia32/ia32_aout.c
2916+++ linux-2.6.18/arch/x86_64/ia32/ia32_aout.c
2781@@ -25,6 +25,7 @@ 2917@@ -25,6 +25,7 @@
2782 #include <linux/binfmts.h> 2918 #include <linux/binfmts.h>
2783 #include <linux/personality.h> 2919 #include <linux/personality.h>
2784 #include <linux/init.h> 2920 #include <linux/init.h>
2785+#include <linux/vs_memory.h> 2921+#include <linux/vs_memory.h>
2786 2922
2787 #include <asm/system.h> 2923 #include <asm/system.h>
2788 #include <asm/uaccess.h> 2924 #include <asm/uaccess.h>
2789diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/ia32/ia32_binfmt.c linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/ia32_binfmt.c 2925Index: linux-2.6.18/arch/x86_64/ia32/ia32_binfmt.c
2926===================================================================
2790--- linux-2.6.18.2/arch/x86_64/ia32/ia32_binfmt.c 2006-09-20 16:58:06 +0200 2927--- linux-2.6.18.orig/arch/x86_64/ia32/ia32_binfmt.c
2791+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/ia32_binfmt.c 2006-09-20 17:01:44 +0200 2928+++ linux-2.6.18/arch/x86_64/ia32/ia32_binfmt.c
2792@@ -376,7 +376,8 @@ int ia32_setup_arg_pages(struct linux_bi 2929@@ -376,7 +376,8 @@ int ia32_setup_arg_pages(struct linux_bi
2793 kmem_cache_free(vm_area_cachep, mpnt); 2930 kmem_cache_free(vm_area_cachep, mpnt);
2794 return ret; 2931 return ret;
2795 } 2932 }
2796- mm->stack_vm = mm->total_vm = vma_pages(mpnt); 2933- mm->stack_vm = mm->total_vm = vma_pages(mpnt);
2797+ vx_vmpages_sub(mm, mm->total_vm - vma_pages(mpnt)); 2934+ vx_vmpages_sub(mm, mm->total_vm - vma_pages(mpnt));
2798+ mm->stack_vm = mm->total_vm; 2935+ mm->stack_vm = mm->total_vm;
2799 } 2936 }
2800 2937
2801 for (i = 0 ; i < MAX_ARG_PAGES ; i++) { 2938 for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
2802diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/ia32/ia32entry.S linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/ia32entry.S 2939Index: linux-2.6.18/arch/x86_64/ia32/ia32entry.S
2803--- linux-2.6.18.2/arch/x86_64/ia32/ia32entry.S 2006-09-20 16:58:06 +0200 2940===================================================================
2804+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/ia32entry.S 2006-09-20 17:01:44 +0200 2941--- linux-2.6.18.orig/arch/x86_64/ia32/ia32entry.S
2942+++ linux-2.6.18/arch/x86_64/ia32/ia32entry.S
2805@@ -668,7 +668,7 @@ ia32_sys_call_table: 2943@@ -668,7 +668,7 @@ ia32_sys_call_table:
2806 .quad sys_tgkill /* 270 */ 2944 .quad sys_tgkill /* 270 */
2807 .quad compat_sys_utimes 2945 .quad compat_sys_utimes
2808 .quad sys32_fadvise64_64 2946 .quad sys32_fadvise64_64
2809- .quad quiet_ni_syscall /* sys_vserver */ 2947- .quad quiet_ni_syscall /* sys_vserver */
2810+ .quad sys32_vserver 2948+ .quad sys32_vserver
2811 .quad sys_mbind 2949 .quad sys_mbind
2812 .quad compat_sys_get_mempolicy /* 275 */ 2950 .quad compat_sys_get_mempolicy /* 275 */
2813 .quad sys_set_mempolicy 2951 .quad sys_set_mempolicy
2814diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/ia32/sys_ia32.c linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/sys_ia32.c 2952Index: linux-2.6.18/arch/x86_64/ia32/sys_ia32.c
2815--- linux-2.6.18.2/arch/x86_64/ia32/sys_ia32.c 2006-09-20 16:58:06 +0200 2953===================================================================
2816+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/sys_ia32.c 2006-09-25 15:40:02 +0200 2954--- linux-2.6.18.orig/arch/x86_64/ia32/sys_ia32.c
2955+++ linux-2.6.18/arch/x86_64/ia32/sys_ia32.c
2817@@ -60,6 +60,7 @@ 2956@@ -60,6 +60,7 @@
2818 #include <linux/highuid.h> 2957 #include <linux/highuid.h>
2819 #include <linux/vmalloc.h> 2958 #include <linux/vmalloc.h>
2820 #include <linux/fsnotify.h> 2959 #include <linux/fsnotify.h>
2821+#include <linux/vs_cvirt.h> 2960+#include <linux/vs_cvirt.h>
2865- err=copy_to_user(name, &system_utsname, sizeof (*name)); 3004- err=copy_to_user(name, &system_utsname, sizeof (*name));
2866+ err=copy_to_user(name, vx_new_utsname(), sizeof (*name)); 3005+ err=copy_to_user(name, vx_new_utsname(), sizeof (*name));
2867 up_read(&uts_sem); 3006 up_read(&uts_sem);
2868 if (personality(current->personality) == PER_LINUX32) 3007 if (personality(current->personality) == PER_LINUX32)
2869 err |= copy_to_user(&name->machine, "i686", 5); 3008 err |= copy_to_user(&name->machine, "i686", 5);
2870diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/ia32/syscall32.c linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/syscall32.c 3009Index: linux-2.6.18/arch/x86_64/ia32/syscall32.c
2871--- linux-2.6.18.2/arch/x86_64/ia32/syscall32.c 2005-10-28 20:49:18 +0200 3010===================================================================
2872+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/ia32/syscall32.c 2006-09-20 17:01:44 +0200 3011--- linux-2.6.18.orig/arch/x86_64/ia32/syscall32.c
3012+++ linux-2.6.18/arch/x86_64/ia32/syscall32.c
2873@@ -10,6 +10,7 @@ 3013@@ -10,6 +10,7 @@
2874 #include <linux/init.h> 3014 #include <linux/init.h>
2875 #include <linux/stringify.h> 3015 #include <linux/stringify.h>
2876 #include <linux/security.h> 3016 #include <linux/security.h>
2877+#include <linux/vs_memory.h> 3017+#include <linux/vs_memory.h>
2885- mm->total_vm += npages; 3025- mm->total_vm += npages;
2886+ vx_vmpages_add(mm, npages); 3026+ vx_vmpages_add(mm, npages);
2887 up_write(&mm->mmap_sem); 3027 up_write(&mm->mmap_sem);
2888 return 0; 3028 return 0;
2889 } 3029 }
2890diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/x86_64/kernel/irq.c 3030Index: linux-2.6.18/arch/x86_64/kernel/irq.c
2891--- linux-2.6.18.2/arch/x86_64/kernel/irq.c 2006-09-20 16:58:06 +0200 3031===================================================================
2892+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/kernel/irq.c 2006-10-13 20:54:24 +0200 3032--- linux-2.6.18.orig/arch/x86_64/kernel/irq.c
3033+++ linux-2.6.18/arch/x86_64/kernel/irq.c
2893@@ -15,6 +15,7 @@ 3034@@ -15,6 +15,7 @@
2894 #include <linux/seq_file.h> 3035 #include <linux/seq_file.h>
2895 #include <linux/module.h> 3036 #include <linux/module.h>
2896 #include <linux/delay.h> 3037 #include <linux/delay.h>
2897+#include <linux/vs_context.h> 3038+#include <linux/vs_context.h>
2914 __do_IRQ(irq, regs); 3055 __do_IRQ(irq, regs);
2915+ __leave_vx_admin(&vxis); 3056+ __leave_vx_admin(&vxis);
2916 irq_exit(); 3057 irq_exit();
2917 3058
2918 return 1; 3059 return 1;
2919diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/x86_64/kernel/process.c 3060Index: linux-2.6.18/arch/x86_64/kernel/process.c
2920--- linux-2.6.18.2/arch/x86_64/kernel/process.c 2006-09-20 16:58:06 +0200 3061===================================================================
2921+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/kernel/process.c 2006-09-25 15:40:02 +0200 3062--- linux-2.6.18.orig/arch/x86_64/kernel/process.c
3063+++ linux-2.6.18/arch/x86_64/kernel/process.c
2922@@ -54,7 +54,8 @@ 3064@@ -54,7 +54,8 @@
2923 3065
2924 asmlinkage extern void ret_from_fork(void); 3066 asmlinkage extern void ret_from_fork(void);
2925 3067
2926-unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; 3068-unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
2938+ printk("Pid: %d[#%u], comm: %.20s %s %s %.*s\n", 3080+ printk("Pid: %d[#%u], comm: %.20s %s %s %.*s\n",
2939+ current->pid, current->xid, current->comm, print_tainted(), 3081+ current->pid, current->xid, current->comm, print_tainted(),
2940 system_utsname.release, 3082 system_utsname.release,
2941 (int)strcspn(system_utsname.version, " "), 3083 (int)strcspn(system_utsname.version, " "),
2942 system_utsname.version); 3084 system_utsname.version);
2943diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/kernel/sys_x86_64.c linux-2.6.18.2-vs2.1.1/arch/x86_64/kernel/sys_x86_64.c 3085Index: linux-2.6.18/arch/x86_64/kernel/sys_x86_64.c
3086===================================================================
2944--- linux-2.6.18.2/arch/x86_64/kernel/sys_x86_64.c 2006-01-03 17:29:20 +0100 3087--- linux-2.6.18.orig/arch/x86_64/kernel/sys_x86_64.c
2945+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/kernel/sys_x86_64.c 2006-09-20 17:01:44 +0200 3088+++ linux-2.6.18/arch/x86_64/kernel/sys_x86_64.c
2946@@ -16,6 +16,7 @@ 3089@@ -16,6 +16,7 @@
2947 #include <linux/file.h> 3090 #include <linux/file.h>
2948 #include <linux/utsname.h> 3091 #include <linux/utsname.h>
2949 #include <linux/personality.h> 3092 #include <linux/personality.h>
2950+#include <linux/vs_cvirt.h> 3093+#include <linux/vs_cvirt.h>
2958- err = copy_to_user(name, &system_utsname, sizeof (*name)); 3101- err = copy_to_user(name, &system_utsname, sizeof (*name));
2959+ err = copy_to_user(name, vx_new_utsname(), sizeof (*name)); 3102+ err = copy_to_user(name, vx_new_utsname(), sizeof (*name));
2960 up_read(&uts_sem); 3103 up_read(&uts_sem);
2961 if (personality(current->personality) == PER_LINUX32) 3104 if (personality(current->personality) == PER_LINUX32)
2962 err |= copy_to_user(&name->machine, "i686", 5); 3105 err |= copy_to_user(&name->machine, "i686", 5);
2963diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/kernel/traps.c linux-2.6.18.2-vs2.1.1/arch/x86_64/kernel/traps.c 3106Index: linux-2.6.18/arch/x86_64/kernel/traps.c
2964--- linux-2.6.18.2/arch/x86_64/kernel/traps.c 2006-09-20 16:58:06 +0200 3107===================================================================
2965+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/kernel/traps.c 2006-10-28 19:26:17 +0200 3108--- linux-2.6.18.orig/arch/x86_64/kernel/traps.c
3109+++ linux-2.6.18/arch/x86_64/kernel/traps.c
2966@@ -435,8 +435,9 @@ void show_registers(struct pt_regs *regs 3110@@ -435,8 +435,9 @@ void show_registers(struct pt_regs *regs
2967 3111
2968 printk("CPU %d ", cpu); 3112 printk("CPU %d ", cpu);
2969 __show_regs(regs); 3113 __show_regs(regs);
2970- printk("Process %s (pid: %d, threadinfo %p, task %p)\n", 3114- printk("Process %s (pid: %d, threadinfo %p, task %p)\n",
2995+ "%s[%d:#%u] general protection rip:%lx rsp:%lx error:%lx\n", 3139+ "%s[%d:#%u] general protection rip:%lx rsp:%lx error:%lx\n",
2996+ tsk->comm, tsk->pid, tsk->xid, 3140+ tsk->comm, tsk->pid, tsk->xid,
2997 regs->rip, regs->rsp, error_code); 3141 regs->rip, regs->rsp, error_code);
2998 3142
2999 force_sig(SIGSEGV, tsk); 3143 force_sig(SIGSEGV, tsk);
3000diff -NurpP --minimal linux-2.6.18.2/arch/x86_64/mm/fault.c linux-2.6.18.2-vs2.1.1/arch/x86_64/mm/fault.c 3144Index: linux-2.6.18/arch/x86_64/mm/fault.c
3001--- linux-2.6.18.2/arch/x86_64/mm/fault.c 2006-09-20 16:58:06 +0200 3145===================================================================
3002+++ linux-2.6.18.2-vs2.1.1/arch/x86_64/mm/fault.c 2006-10-28 19:30:33 +0200 3146--- linux-2.6.18.orig/arch/x86_64/mm/fault.c
3147+++ linux-2.6.18/arch/x86_64/mm/fault.c
3003@@ -520,10 +520,10 @@ bad_area_nosemaphore: 3148@@ -520,10 +520,10 @@ bad_area_nosemaphore:
3004 3149
3005 if (exception_trace && unhandled_signal(tsk, SIGSEGV)) { 3150 if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {
3006 printk( 3151 printk(
3007- "%s%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n", 3152- "%s%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
3012+ tsk->comm, tsk->pid, tsk->xid, address, 3157+ tsk->comm, tsk->pid, tsk->xid, address,
3013+ regs->rip, regs->rsp, error_code); 3158+ regs->rip, regs->rsp, error_code);
3014 } 3159 }
3015 3160
3016 tsk->thread.cr2 = address; 3161 tsk->thread.cr2 = address;
3017diff -NurpP --minimal linux-2.6.18.2/arch/xtensa/kernel/irq.c linux-2.6.18.2-vs2.1.1/arch/xtensa/kernel/irq.c 3162Index: linux-2.6.18/arch/xtensa/kernel/irq.c
3018--- linux-2.6.18.2/arch/xtensa/kernel/irq.c 2006-09-20 16:58:06 +0200 3163===================================================================
3019+++ linux-2.6.18.2-vs2.1.1/arch/xtensa/kernel/irq.c 2006-10-13 20:54:36 +0200 3164--- linux-2.6.18.orig/arch/xtensa/kernel/irq.c
3165+++ linux-2.6.18/arch/xtensa/kernel/irq.c
3020@@ -18,6 +18,7 @@ 3166@@ -18,6 +18,7 @@
3021 #include <linux/interrupt.h> 3167 #include <linux/interrupt.h>
3022 #include <linux/irq.h> 3168 #include <linux/irq.h>
3023 #include <linux/kernel_stat.h> 3169 #include <linux/kernel_stat.h>
3024+#include <linux/vs_context.h> 3170+#include <linux/vs_context.h>
3044- 3190-
3045+ __leave_vx_admin(&vxis); 3191+ __leave_vx_admin(&vxis);
3046 irq_exit(); 3192 irq_exit();
3047 3193
3048 return 1; 3194 return 1;
3049diff -NurpP --minimal linux-2.6.18.2/arch/xtensa/kernel/process.c linux-2.6.18.2-vs2.1.1/arch/xtensa/kernel/process.c 3195Index: linux-2.6.18/arch/xtensa/kernel/process.c
3050--- linux-2.6.18.2/arch/xtensa/kernel/process.c 2006-09-20 16:58:06 +0200 3196===================================================================
3051+++ linux-2.6.18.2-vs2.1.1/arch/xtensa/kernel/process.c 2006-09-25 15:40:02 +0200 3197--- linux-2.6.18.orig/arch/xtensa/kernel/process.c
3198+++ linux-2.6.18/arch/xtensa/kernel/process.c
3052@@ -206,7 +206,7 @@ int kernel_thread(int (*fn)(void *), voi 3199@@ -206,7 +206,7 @@ int kernel_thread(int (*fn)(void *), voi
3053 :"=r" (retval) 3200 :"=r" (retval)
3054 :"i" (__NR_clone), "i" (__NR_exit), 3201 :"i" (__NR_clone), "i" (__NR_exit),
3055 "r" (arg), "r" (fn), 3202 "r" (arg), "r" (fn),
3056- "r" (flags | CLONE_VM) 3203- "r" (flags | CLONE_VM)
3057+ "r" (flags | CLONE_VM | CLONE_KTHREAD) 3204+ "r" (flags | CLONE_VM | CLONE_KTHREAD)
3058 : "a2", "a3", "a4", "a5", "a6" ); 3205 : "a2", "a3", "a4", "a5", "a6" );
3059 return retval; 3206 return retval;
3060 } 3207 }
3061diff -NurpP --minimal linux-2.6.18.2/arch/xtensa/kernel/syscalls.c linux-2.6.18.2-vs2.1.1/arch/xtensa/kernel/syscalls.c 3208Index: linux-2.6.18/arch/xtensa/kernel/syscalls.c
3209===================================================================
3062--- linux-2.6.18.2/arch/xtensa/kernel/syscalls.c 2006-09-20 16:58:06 +0200 3210--- linux-2.6.18.orig/arch/xtensa/kernel/syscalls.c
3063+++ linux-2.6.18.2-vs2.1.1/arch/xtensa/kernel/syscalls.c 2006-09-20 17:01:44 +0200 3211+++ linux-2.6.18/arch/xtensa/kernel/syscalls.c
3064@@ -34,6 +34,7 @@ 3212@@ -34,6 +34,7 @@
3065 #include <linux/msg.h> 3213 #include <linux/msg.h>
3066 #include <linux/shm.h> 3214 #include <linux/shm.h>
3067 #include <linux/errno.h> 3215 #include <linux/errno.h>
3068+#include <linux/vs_cvirt.h> 3216+#include <linux/vs_cvirt.h>
3076- if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) 3224- if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
3077+ if (name && !copy_to_user(name, vx_new_utsname(), sizeof (*name))) 3225+ if (name && !copy_to_user(name, vx_new_utsname(), sizeof (*name)))
3078 return 0; 3226 return 0;
3079 return -EFAULT; 3227 return -EFAULT;
3080 } 3228 }
3081diff -NurpP --minimal linux-2.6.18.2/block/cfq-iosched.c linux-2.6.18.2-vs2.1.1/block/cfq-iosched.c 3229Index: linux-2.6.18/block/cfq-iosched.c
3082--- linux-2.6.18.2/block/cfq-iosched.c 2006-09-20 16:58:06 +0200 3230===================================================================
3083+++ linux-2.6.18.2-vs2.1.1/block/cfq-iosched.c 2006-09-25 17:18:03 +0200 3231--- linux-2.6.18.orig/block/cfq-iosched.c
3232+++ linux-2.6.18/block/cfq-iosched.c
3084@@ -326,6 +326,8 @@ static int cfq_queue_empty(request_queue 3233@@ -326,6 +326,8 @@ static int cfq_queue_empty(request_queue
3085 3234
3086 static inline pid_t cfq_queue_pid(struct task_struct *task, int rw) 3235 static inline pid_t cfq_queue_pid(struct task_struct *task, int rw)
3087 { 3236 {
3088+ if (task->xid) 3237+ if (task->xid)
3089+ return task->xid + (1 << 16); 3238+ return task->xid + (1 << 16);
3090 if (rw == READ || rw == WRITE_SYNC) 3239 if (rw == READ || rw == WRITE_SYNC)
3091 return task->pid; 3240 return task->pid;
3092 3241
3093diff -NurpP --minimal linux-2.6.18.2/drivers/block/Kconfig linux-2.6.18.2-vs2.1.1/drivers/block/Kconfig 3242Index: linux-2.6.18/drivers/block/Kconfig
3094--- linux-2.6.18.2/drivers/block/Kconfig 2006-09-20 16:58:07 +0200 3243===================================================================
3095+++ linux-2.6.18.2-vs2.1.1/drivers/block/Kconfig 2006-09-20 17:01:44 +0200 3244--- linux-2.6.18.orig/drivers/block/Kconfig
3245+++ linux-2.6.18/drivers/block/Kconfig
3096@@ -315,6 +315,13 @@ config BLK_DEV_CRYPTOLOOP 3246@@ -315,6 +315,13 @@ config BLK_DEV_CRYPTOLOOP
3097 instead, which can be configured to be on-disk compatible with the 3247 instead, which can be configured to be on-disk compatible with the
3098 cryptoloop device. 3248 cryptoloop device.
3099 3249
3100+config BLK_DEV_VROOT 3250+config BLK_DEV_VROOT
3105+ partition within a virtual server without compromising security. 3255+ partition within a virtual server without compromising security.
3106+ 3256+
3107 config BLK_DEV_NBD 3257 config BLK_DEV_NBD
3108 tristate "Network block device support" 3258 tristate "Network block device support"
3109 depends on NET 3259 depends on NET
3110diff -NurpP --minimal linux-2.6.18.2/drivers/block/Makefile linux-2.6.18.2-vs2.1.1/drivers/block/Makefile 3260Index: linux-2.6.18/drivers/block/Makefile
3111--- linux-2.6.18.2/drivers/block/Makefile 2006-06-18 04:52:46 +0200 3261===================================================================
3112+++ linux-2.6.18.2-vs2.1.1/drivers/block/Makefile 2006-09-20 17:01:44 +0200 3262--- linux-2.6.18.orig/drivers/block/Makefile
3263+++ linux-2.6.18/drivers/block/Makefile
3113@@ -29,4 +29,5 @@ obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryp 3264@@ -29,4 +29,5 @@ obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryp
3114 obj-$(CONFIG_VIODASD) += viodasd.o 3265 obj-$(CONFIG_VIODASD) += viodasd.o
3115 obj-$(CONFIG_BLK_DEV_SX8) += sx8.o 3266 obj-$(CONFIG_BLK_DEV_SX8) += sx8.o
3116 obj-$(CONFIG_BLK_DEV_UB) += ub.o 3267 obj-$(CONFIG_BLK_DEV_UB) += ub.o
3117+obj-$(CONFIG_BLK_DEV_VROOT) += vroot.o 3268+obj-$(CONFIG_BLK_DEV_VROOT) += vroot.o
3118 3269
3119diff -NurpP --minimal linux-2.6.18.2/drivers/block/loop.c linux-2.6.18.2-vs2.1.1/drivers/block/loop.c 3270Index: linux-2.6.18/drivers/block/loop.c
3120--- linux-2.6.18.2/drivers/block/loop.c 2006-09-20 16:58:07 +0200 3271===================================================================
3121+++ linux-2.6.18.2-vs2.1.1/drivers/block/loop.c 2006-09-25 15:40:02 +0200 3272--- linux-2.6.18.orig/drivers/block/loop.c
3273+++ linux-2.6.18/drivers/block/loop.c
3122@@ -72,6 +72,7 @@ 3274@@ -72,6 +72,7 @@
3123 #include <linux/completion.h> 3275 #include <linux/completion.h>
3124 #include <linux/highmem.h> 3276 #include <linux/highmem.h>
3125 #include <linux/gfp.h> 3277 #include <linux/gfp.h>
3126+#include <linux/vs_context.h> 3278+#include <linux/vs_context.h>
3188+ return -EACCES; 3340+ return -EACCES;
3189+ 3341+
3190 mutex_lock(&lo->lo_ctl_mutex); 3342 mutex_lock(&lo->lo_ctl_mutex);
3191 lo->lo_refcnt++; 3343 lo->lo_refcnt++;
3192 mutex_unlock(&lo->lo_ctl_mutex); 3344 mutex_unlock(&lo->lo_ctl_mutex);
3193diff -NurpP --minimal linux-2.6.18.2/drivers/block/vroot.c linux-2.6.18.2-vs2.1.1/drivers/block/vroot.c 3345Index: linux-2.6.18/drivers/block/vroot.c
3194--- linux-2.6.18.2/drivers/block/vroot.c 1970-01-01 01:00:00 +0100 3346===================================================================
3195+++ linux-2.6.18.2-vs2.1.1/drivers/block/vroot.c 2006-09-21 01:26:54 +0200 3347--- /dev/null
3348+++ linux-2.6.18/drivers/block/vroot.c
3196@@ -0,0 +1,281 @@ 3349@@ -0,0 +1,281 @@
3197+/* 3350+/*
3198+ * linux/drivers/block/vroot.c 3351+ * linux/drivers/block/vroot.c
3199+ * 3352+ *
3200+ * written by Herbert P÷tzl, 9/11/2002 3353+ * written by Herbert P÷tzl, 9/11/2002
3473+ 3626+
3474+__setup("max_vroot=", max_vroot_setup); 3627+__setup("max_vroot=", max_vroot_setup);
3475+ 3628+
3476+#endif 3629+#endif
3477+ 3630+
3478diff -NurpP --minimal linux-2.6.18.2/drivers/char/random.c linux-2.6.18.2-vs2.1.1/drivers/char/random.c 3631Index: linux-2.6.18/drivers/char/random.c
3479--- linux-2.6.18.2/drivers/char/random.c 2006-09-20 16:58:13 +0200 3632===================================================================
3480+++ linux-2.6.18.2-vs2.1.1/drivers/char/random.c 2006-09-20 17:01:44 +0200 3633--- linux-2.6.18.orig/drivers/char/random.c
3634+++ linux-2.6.18/drivers/char/random.c
3481@@ -1173,7 +1173,7 @@ static char sysctl_bootid[16]; 3635@@ -1173,7 +1173,7 @@ static char sysctl_bootid[16];
3482 static int proc_do_uuid(ctl_table *table, int write, struct file *filp, 3636 static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
3483 void __user *buffer, size_t *lenp, loff_t *ppos) 3637 void __user *buffer, size_t *lenp, loff_t *ppos)
3484 { 3638 {
3485- ctl_table fake_table; 3639- ctl_table fake_table;
3486+ ctl_table fake_table = {0}; 3640+ ctl_table fake_table = {0};
3487 unsigned char buf[64], tmp_uuid[16], *uuid; 3641 unsigned char buf[64], tmp_uuid[16], *uuid;
3488 3642
3489 uuid = table->data; 3643 uuid = table->data;
3490diff -NurpP --minimal linux-2.6.18.2/drivers/char/sysrq.c linux-2.6.18.2-vs2.1.1/drivers/char/sysrq.c 3644Index: linux-2.6.18/drivers/char/sysrq.c
3491--- linux-2.6.18.2/drivers/char/sysrq.c 2006-09-20 16:58:13 +0200 3645===================================================================
3492+++ linux-2.6.18.2-vs2.1.1/drivers/char/sysrq.c 2006-09-25 15:40:02 +0200 3646--- linux-2.6.18.orig/drivers/char/sysrq.c
3647+++ linux-2.6.18/drivers/char/sysrq.c
3493@@ -35,6 +35,7 @@ 3648@@ -35,6 +35,7 @@
3494 #include <linux/vt_kern.h> 3649 #include <linux/vt_kern.h>
3495 #include <linux/workqueue.h> 3650 #include <linux/workqueue.h>
3496 #include <linux/kexec.h> 3651 #include <linux/kexec.h>
3497+#include <linux/vserver/debug.h> 3652+#include <linux/vserver/debug.h>
3539+ else if ((key >= 'A') && (key <= 'Z')) 3694+ else if ((key >= 'A') && (key <= 'Z'))
3540+ retval = key + 10 - 'A'; 3695+ retval = key + 10 - 'A';
3541 else 3696 else
3542 retval = -1; 3697 retval = -1;
3543 return retval; 3698 return retval;
3544diff -NurpP --minimal linux-2.6.18.2/drivers/char/tty_io.c linux-2.6.18.2-vs2.1.1/drivers/char/tty_io.c 3699Index: linux-2.6.18/drivers/char/tty_io.c
3545--- linux-2.6.18.2/drivers/char/tty_io.c 2006-09-20 16:58:13 +0200 3700===================================================================
3546+++ linux-2.6.18.2-vs2.1.1/drivers/char/tty_io.c 2006-09-25 17:18:30 +0200 3701--- linux-2.6.18.orig/drivers/char/tty_io.c
3702+++ linux-2.6.18/drivers/char/tty_io.c
3547@@ -103,6 +103,7 @@ 3703@@ -103,6 +103,7 @@
3548 #include <linux/selection.h> 3704 #include <linux/selection.h>
3549 3705
3550 #include <linux/kmod.h> 3706 #include <linux/kmod.h>
3551+#include <linux/vs_pid.h> 3707+#include <linux/vs_pid.h>
3577+ 3733+
3578+ pgrp = vx_rmap_pid(pgrp); 3734+ pgrp = vx_rmap_pid(pgrp);
3579 if (pgrp < 0) 3735 if (pgrp < 0)
3580 return -EINVAL; 3736 return -EINVAL;
3581 if (session_of_pgrp(pgrp) != current->signal->session) 3737 if (session_of_pgrp(pgrp) != current->signal->session)
3582diff -NurpP --minimal linux-2.6.18.2/drivers/infiniband/core/uverbs_mem.c linux-2.6.18.2-vs2.1.1/drivers/infiniband/core/uverbs_mem.c 3738Index: linux-2.6.18/drivers/infiniband/core/uverbs_mem.c
3739===================================================================
3583--- linux-2.6.18.2/drivers/infiniband/core/uverbs_mem.c 2006-06-18 04:53:04 +0200 3740--- linux-2.6.18.orig/drivers/infiniband/core/uverbs_mem.c
3584+++ linux-2.6.18.2-vs2.1.1/drivers/infiniband/core/uverbs_mem.c 2006-09-20 17:01:44 +0200 3741+++ linux-2.6.18/drivers/infiniband/core/uverbs_mem.c
3585@@ -36,6 +36,7 @@ 3742@@ -36,6 +36,7 @@
3586 3743
3587 #include <linux/mm.h> 3744 #include <linux/mm.h>
3588 #include <linux/dma-mapping.h> 3745 #include <linux/dma-mapping.h>
3589+#include <linux/vs_memory.h> 3746+#include <linux/vs_memory.h>
3617- work->mm->locked_vm -= work->diff; 3774- work->mm->locked_vm -= work->diff;
3618+ vx_vmlocked_sub(work->mm, work->diff); 3775+ vx_vmlocked_sub(work->mm, work->diff);
3619 up_write(&work->mm->mmap_sem); 3776 up_write(&work->mm->mmap_sem);
3620 mmput(work->mm); 3777 mmput(work->mm);
3621 kfree(work); 3778 kfree(work);
3622diff -NurpP --minimal linux-2.6.18.2/drivers/infiniband/hw/ipath/ipath_user_pages.c linux-2.6.18.2-vs2.1.1/drivers/infiniband/hw/ipath/ipath_user_pages.c 3779Index: linux-2.6.18/drivers/infiniband/hw/ipath/ipath_user_pages.c
3780===================================================================
3623--- linux-2.6.18.2/drivers/infiniband/hw/ipath/ipath_user_pages.c 2006-09-20 16:58:14 +0200 3781--- linux-2.6.18.orig/drivers/infiniband/hw/ipath/ipath_user_pages.c
3624+++ linux-2.6.18.2-vs2.1.1/drivers/infiniband/hw/ipath/ipath_user_pages.c 2006-09-20 17:01:44 +0200 3782+++ linux-2.6.18/drivers/infiniband/hw/ipath/ipath_user_pages.c
3625@@ -33,6 +33,7 @@ 3783@@ -33,6 +33,7 @@
3626 3784
3627 #include <linux/mm.h> 3785 #include <linux/mm.h>
3628 #include <linux/device.h> 3786 #include <linux/device.h>
3629+#include <linux/vs_memory.h> 3787+#include <linux/vs_memory.h>
3665- work->mm->locked_vm -= work->num_pages; 3823- work->mm->locked_vm -= work->num_pages;
3666+ vx_vmlocked_sub(work->mm, work->num_pages); 3824+ vx_vmlocked_sub(work->mm, work->num_pages);
3667 up_write(&work->mm->mmap_sem); 3825 up_write(&work->mm->mmap_sem);
3668 mmput(work->mm); 3826 mmput(work->mm);
3669 kfree(work); 3827 kfree(work);
3670diff -NurpP --minimal linux-2.6.18.2/drivers/md/dm-ioctl.c linux-2.6.18.2-vs2.1.1/drivers/md/dm-ioctl.c 3828Index: linux-2.6.18/drivers/md/dm-ioctl.c
3671--- linux-2.6.18.2/drivers/md/dm-ioctl.c 2006-09-20 16:58:18 +0200 3829===================================================================
3672+++ linux-2.6.18.2-vs2.1.1/drivers/md/dm-ioctl.c 2006-09-25 17:18:55 +0200 3830--- linux-2.6.18.orig/drivers/md/dm-ioctl.c
3831+++ linux-2.6.18/drivers/md/dm-ioctl.c
3673@@ -100,7 +100,8 @@ static struct hash_cell *__get_name_cell 3832@@ -100,7 +100,8 @@ static struct hash_cell *__get_name_cell
3674 unsigned int h = hash_str(str); 3833 unsigned int h = hash_str(str);
3675 3834
3676 list_for_each_entry (hc, _name_buckets + h, name_list) 3835 list_for_each_entry (hc, _name_buckets + h, name_list)
3677- if (!strcmp(hc->name, str)) { 3836- if (!strcmp(hc->name, str)) {
3743+ /* only root and certain contexts can play with this */ 3902+ /* only root and certain contexts can play with this */
3744+ if (!vx_capable(CAP_SYS_ADMIN, VXC_ADMIN_MAPPER)) 3903+ if (!vx_capable(CAP_SYS_ADMIN, VXC_ADMIN_MAPPER))
3745 return -EACCES; 3904 return -EACCES;
3746 3905
3747 if (_IOC_TYPE(command) != DM_IOCTL) 3906 if (_IOC_TYPE(command) != DM_IOCTL)
3748diff -NurpP --minimal linux-2.6.18.2/drivers/md/dm.c linux-2.6.18.2-vs2.1.1/drivers/md/dm.c 3907Index: linux-2.6.18/drivers/md/dm.c
3749--- linux-2.6.18.2/drivers/md/dm.c 2006-09-20 16:58:19 +0200 3908===================================================================
3750+++ linux-2.6.18.2-vs2.1.1/drivers/md/dm.c 2006-09-25 17:21:03 +0200 3909--- linux-2.6.18.orig/drivers/md/dm.c
3910+++ linux-2.6.18/drivers/md/dm.c
3751@@ -74,6 +74,7 @@ struct mapped_device { 3911@@ -74,6 +74,7 @@ struct mapped_device {
3752 rwlock_t map_lock; 3912 rwlock_t map_lock;
3753 atomic_t holders; 3913 atomic_t holders;
3754 atomic_t open_count; 3914 atomic_t open_count;
3755+ xid_t xid; 3915+ xid_t xid;
3769 3929
3770 if (test_bit(DMF_FREEING, &md->flags) || 3930 if (test_bit(DMF_FREEING, &md->flags) ||
3771- test_bit(DMF_DELETING, &md->flags)) { 3931- test_bit(DMF_DELETING, &md->flags)) {
3772- md = NULL; 3932- md = NULL;
3773+ test_bit(DMF_DELETING, &md->flags)) 3933+ test_bit(DMF_DELETING, &md->flags))
3934+ goto out;
3935+
3936+ ret = -EACCES;
3937+ if (!vx_check(md->xid, VX_IDENT))
3774 goto out; 3938 goto out;
3775- } 3939- }
3776 3940
3777+ ret = -EACCES;
3778+ if (!vx_check(md->xid, VX_IDENT))
3779+ goto out;
3780+
3781 dm_get(md); 3941 dm_get(md);
3782 atomic_inc(&md->open_count); 3942 atomic_inc(&md->open_count);
3783- 3943-
3784+ ret = 0; 3944+ ret = 0;
3785 out: 3945 out:
3811 atomic_set(&md->event_nr, 0); 3971 atomic_set(&md->event_nr, 0);
3812+ md->xid = vx_current_xid(); 3972+ md->xid = vx_current_xid();
3813 3973
3814 md->queue = blk_alloc_queue(GFP_KERNEL); 3974 md->queue = blk_alloc_queue(GFP_KERNEL);
3815 if (!md->queue) 3975 if (!md->queue)
3816diff -NurpP --minimal linux-2.6.18.2/drivers/md/dm.h linux-2.6.18.2-vs2.1.1/drivers/md/dm.h 3976Index: linux-2.6.18/drivers/md/dm.h
3817--- linux-2.6.18.2/drivers/md/dm.h 2006-09-20 16:58:19 +0200 3977===================================================================
3818+++ linux-2.6.18.2-vs2.1.1/drivers/md/dm.h 2006-09-25 15:40:02 +0200 3978--- linux-2.6.18.orig/drivers/md/dm.h
3979+++ linux-2.6.18/drivers/md/dm.h
3819@@ -67,6 +67,8 @@ void dm_put_target_type(struct target_ty 3980@@ -67,6 +67,8 @@ void dm_put_target_type(struct target_ty
3820 int dm_target_iterate(void (*iter_func)(struct target_type *tt, 3981 int dm_target_iterate(void (*iter_func)(struct target_type *tt,
3821 void *param), void *param); 3982 void *param), void *param);
3822 3983
3823+xid_t dm_get_xid(struct mapped_device *md); 3984+xid_t dm_get_xid(struct mapped_device *md);
3824+ 3985+
3825 /*----------------------------------------------------------------- 3986 /*-----------------------------------------------------------------
3826 * Useful inlines. 3987 * Useful inlines.
3827 *---------------------------------------------------------------*/ 3988 *---------------------------------------------------------------*/
3828diff -NurpP --minimal linux-2.6.18.2/drivers/s390/cio/cio.c linux-2.6.18.2-vs2.1.1/drivers/s390/cio/cio.c 3989Index: linux-2.6.18/drivers/s390/cio/cio.c
3829--- linux-2.6.18.2/drivers/s390/cio/cio.c 2006-09-20 16:58:27 +0200 3990===================================================================
3830+++ linux-2.6.18.2-vs2.1.1/drivers/s390/cio/cio.c 2006-10-13 20:54:50 +0200 3991--- linux-2.6.18.orig/drivers/s390/cio/cio.c
3992+++ linux-2.6.18/drivers/s390/cio/cio.c
3831@@ -16,6 +16,7 @@ 3993@@ -16,6 +16,7 @@
3832 #include <linux/device.h> 3994 #include <linux/device.h>
3833 #include <linux/kernel_stat.h> 3995 #include <linux/kernel_stat.h>
3834 #include <linux/interrupt.h> 3996 #include <linux/interrupt.h>
3835+#include <linux/vs_context.h> 3997+#include <linux/vs_context.h>
3851 sch->driver->irq(&sch->dev); 4013 sch->driver->irq(&sch->dev);
3852+ __leave_vx_admin(&vxis); 4014+ __leave_vx_admin(&vxis);
3853 } 4015 }
3854 if (sch) 4016 if (sch)
3855 spin_unlock(&sch->lock); 4017 spin_unlock(&sch->lock);
3856diff -NurpP --minimal linux-2.6.18.2/fs/attr.c linux-2.6.18.2-vs2.1.1/fs/attr.c 4018Index: linux-2.6.18/fs/attr.c
3857--- linux-2.6.18.2/fs/attr.c 2006-04-09 13:49:53 +0200 4019===================================================================
3858+++ linux-2.6.18.2-vs2.1.1/fs/attr.c 2006-09-25 15:40:02 +0200 4020--- linux-2.6.18.orig/fs/attr.c
4021+++ linux-2.6.18/fs/attr.c
3859@@ -15,6 +15,9 @@ 4022@@ -15,6 +15,9 @@
3860 #include <linux/fcntl.h> 4023 #include <linux/fcntl.h>
3861 #include <linux/quotaops.h> 4024 #include <linux/quotaops.h>
3862 #include <linux/security.h> 4025 #include <linux/security.h>
3863+#include <linux/proc_fs.h> 4026+#include <linux/proc_fs.h>
3914+ (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid) || 4077+ (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid) ||
3915+ (ia_valid & ATTR_TAG && attr->ia_tag != inode->i_tag)) 4078+ (ia_valid & ATTR_TAG && attr->ia_tag != inode->i_tag))
3916 error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0; 4079 error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
3917 if (!error) 4080 if (!error)
3918 error = inode_setattr(inode, attr); 4081 error = inode_setattr(inode, attr);
3919diff -NurpP --minimal linux-2.6.18.2/fs/binfmt_aout.c linux-2.6.18.2-vs2.1.1/fs/binfmt_aout.c 4082Index: linux-2.6.18/fs/binfmt_aout.c
3920--- linux-2.6.18.2/fs/binfmt_aout.c 2006-04-09 13:49:53 +0200 4083===================================================================
3921+++ linux-2.6.18.2-vs2.1.1/fs/binfmt_aout.c 2006-09-20 17:01:44 +0200 4084--- linux-2.6.18.orig/fs/binfmt_aout.c
4085+++ linux-2.6.18/fs/binfmt_aout.c
3922@@ -24,6 +24,7 @@ 4086@@ -24,6 +24,7 @@
3923 #include <linux/binfmts.h> 4087 #include <linux/binfmts.h>
3924 #include <linux/personality.h> 4088 #include <linux/personality.h>
3925 #include <linux/init.h> 4089 #include <linux/init.h>
3926+#include <linux/vs_memory.h> 4090+#include <linux/vs_memory.h>
3927 4091
3928 #include <asm/system.h> 4092 #include <asm/system.h>
3929 #include <asm/uaccess.h> 4093 #include <asm/uaccess.h>
3930diff -NurpP --minimal linux-2.6.18.2/fs/binfmt_elf.c linux-2.6.18.2-vs2.1.1/fs/binfmt_elf.c 4094Index: linux-2.6.18/fs/binfmt_elf.c
3931--- linux-2.6.18.2/fs/binfmt_elf.c 2006-09-20 16:58:34 +0200 4095===================================================================
3932+++ linux-2.6.18.2-vs2.1.1/fs/binfmt_elf.c 2006-09-20 18:28:33 +0200 4096--- linux-2.6.18.orig/fs/binfmt_elf.c
4097+++ linux-2.6.18/fs/binfmt_elf.c
3933@@ -39,6 +39,8 @@ 4098@@ -39,6 +39,8 @@
3934 #include <linux/syscalls.h> 4099 #include <linux/syscalls.h>
3935 #include <linux/random.h> 4100 #include <linux/random.h>
3936 #include <linux/elf.h> 4101 #include <linux/elf.h>
3937+#include <linux/vs_memory.h> 4102+#include <linux/vs_memory.h>
3938+#include <linux/vs_cvirt.h> 4103+#include <linux/vs_cvirt.h>
3939 #include <asm/uaccess.h> 4104 #include <asm/uaccess.h>
3940 #include <asm/param.h> 4105 #include <asm/param.h>
3941 #include <asm/page.h> 4106 #include <asm/page.h>
3942diff -NurpP --minimal linux-2.6.18.2/fs/binfmt_elf_fdpic.c linux-2.6.18.2-vs2.1.1/fs/binfmt_elf_fdpic.c 4107Index: linux-2.6.18/fs/binfmt_elf_fdpic.c
3943--- linux-2.6.18.2/fs/binfmt_elf_fdpic.c 2006-09-20 16:58:34 +0200 4108===================================================================
3944+++ linux-2.6.18.2-vs2.1.1/fs/binfmt_elf_fdpic.c 2006-09-20 17:01:44 +0200 4109--- linux-2.6.18.orig/fs/binfmt_elf_fdpic.c
4110+++ linux-2.6.18/fs/binfmt_elf_fdpic.c
3945@@ -34,6 +34,7 @@ 4111@@ -34,6 +34,7 @@
3946 #include <linux/elf.h> 4112 #include <linux/elf.h>
3947 #include <linux/elf-fdpic.h> 4113 #include <linux/elf-fdpic.h>
3948 #include <linux/elfcore.h> 4114 #include <linux/elfcore.h>
3949+#include <linux/vs_cvirt.h> 4115+#include <linux/vs_cvirt.h>
3950 4116
3951 #include <asm/uaccess.h> 4117 #include <asm/uaccess.h>
3952 #include <asm/param.h> 4118 #include <asm/param.h>
3953diff -NurpP --minimal linux-2.6.18.2/fs/binfmt_flat.c linux-2.6.18.2-vs2.1.1/fs/binfmt_flat.c 4119Index: linux-2.6.18/fs/binfmt_flat.c
3954--- linux-2.6.18.2/fs/binfmt_flat.c 2006-09-20 16:58:34 +0200 4120===================================================================
3955+++ linux-2.6.18.2-vs2.1.1/fs/binfmt_flat.c 2006-09-20 17:01:44 +0200 4121--- linux-2.6.18.orig/fs/binfmt_flat.c
4122+++ linux-2.6.18/fs/binfmt_flat.c
3956@@ -36,6 +36,7 @@ 4123@@ -36,6 +36,7 @@
3957 #include <linux/init.h> 4124 #include <linux/init.h>
3958 #include <linux/flat.h> 4125 #include <linux/flat.h>
3959 #include <linux/syscalls.h> 4126 #include <linux/syscalls.h>
3960+#include <linux/vs_memory.h> 4127+#include <linux/vs_memory.h>
3961 4128
3962 #include <asm/byteorder.h> 4129 #include <asm/byteorder.h>
3963 #include <asm/system.h> 4130 #include <asm/system.h>
3964diff -NurpP --minimal linux-2.6.18.2/fs/binfmt_som.c linux-2.6.18.2-vs2.1.1/fs/binfmt_som.c 4131Index: linux-2.6.18/fs/binfmt_som.c
3965--- linux-2.6.18.2/fs/binfmt_som.c 2006-09-20 16:58:34 +0200 4132===================================================================
3966+++ linux-2.6.18.2-vs2.1.1/fs/binfmt_som.c 2006-09-20 17:01:44 +0200 4133--- linux-2.6.18.orig/fs/binfmt_som.c
4134+++ linux-2.6.18/fs/binfmt_som.c
3967@@ -28,6 +28,7 @@ 4135@@ -28,6 +28,7 @@
3968 #include <linux/shm.h> 4136 #include <linux/shm.h>
3969 #include <linux/personality.h> 4137 #include <linux/personality.h>
3970 #include <linux/init.h> 4138 #include <linux/init.h>
3971+#include <linux/vs_memory.h> 4139+#include <linux/vs_memory.h>
3972 4140
3973 #include <asm/uaccess.h> 4141 #include <asm/uaccess.h>
3974 #include <asm/pgtable.h> 4142 #include <asm/pgtable.h>
3975diff -NurpP --minimal linux-2.6.18.2/fs/buffer.c linux-2.6.18.2-vs2.1.1/fs/buffer.c 4143Index: linux-2.6.18/fs/buffer.c
3976--- linux-2.6.18.2/fs/buffer.c 2006-11-04 19:43:23 +0100 4144===================================================================
3977+++ linux-2.6.18.2-vs2.1.1/fs/buffer.c 2006-10-18 01:14:30 +0200 4145--- linux-2.6.18.orig/fs/buffer.c
4146+++ linux-2.6.18/fs/buffer.c
3978@@ -162,7 +162,7 @@ EXPORT_SYMBOL(sync_blockdev); 4147@@ -162,7 +162,7 @@ EXPORT_SYMBOL(sync_blockdev);
3979 static void __fsync_super(struct super_block *sb) 4148 static void __fsync_super(struct super_block *sb)
3980 { 4149 {
3981 sync_inodes_sb(sb, 0); 4150 sync_inodes_sb(sb, 0);
3982- DQUOT_SYNC(sb); 4151- DQUOT_SYNC(sb);
3983+ DQUOT_SYNC(sb->s_dqh); 4152+ DQUOT_SYNC(sb->s_dqh);
3984 lock_super(sb); 4153 lock_super(sb);
3985 if (sb->s_dirt && sb->s_op->write_super) 4154 if (sb->s_dirt && sb->s_op->write_super)
3986 sb->s_op->write_super(sb); 4155 sb->s_op->write_super(sb);
3987diff -NurpP --minimal linux-2.6.18.2/fs/dcache.c linux-2.6.18.2-vs2.1.1/fs/dcache.c 4156Index: linux-2.6.18/fs/dcache.c
3988--- linux-2.6.18.2/fs/dcache.c 2006-09-20 16:58:34 +0200 4157===================================================================
3989+++ linux-2.6.18.2-vs2.1.1/fs/dcache.c 2006-09-25 15:40:02 +0200 4158--- linux-2.6.18.orig/fs/dcache.c
4159+++ linux-2.6.18/fs/dcache.c
3990@@ -32,6 +32,7 @@ 4160@@ -32,6 +32,7 @@
3991 #include <linux/seqlock.h> 4161 #include <linux/seqlock.h>
3992 #include <linux/swap.h> 4162 #include <linux/swap.h>
3993 #include <linux/bootmem.h> 4163 #include <linux/bootmem.h>
3994+#include <linux/vs_limit.h> 4164+#include <linux/vs_limit.h>
4044 atomic_inc(&dentry->d_count); 4214 atomic_inc(&dentry->d_count);
4045+ vx_dentry_inc(dentry); 4215+ vx_dentry_inc(dentry);
4046 found = dentry; 4216 found = dentry;
4047 } 4217 }
4048 spin_unlock(&dentry->d_lock); 4218 spin_unlock(&dentry->d_lock);
4049diff -NurpP --minimal linux-2.6.18.2/fs/devpts/inode.c linux-2.6.18.2-vs2.1.1/fs/devpts/inode.c 4219Index: linux-2.6.18/fs/devpts/inode.c
4050--- linux-2.6.18.2/fs/devpts/inode.c 2006-09-20 16:58:34 +0200 4220===================================================================
4051+++ linux-2.6.18.2-vs2.1.1/fs/devpts/inode.c 2006-09-25 15:40:02 +0200 4221--- linux-2.6.18.orig/fs/devpts/inode.c
4222+++ linux-2.6.18/fs/devpts/inode.c
4052@@ -20,7 +20,20 @@ 4223@@ -20,7 +20,20 @@
4053 #include <linux/devpts_fs.h> 4224 #include <linux/devpts_fs.h>
4054 #include <linux/parser.h> 4225 #include <linux/parser.h>
4055 4226
4056-#define DEVPTS_SUPER_MAGIC 0x1cd1 4227-#define DEVPTS_SUPER_MAGIC 0x1cd1
4117+ inode->i_tag = (tag_t)vx_current_xid(); 4288+ inode->i_tag = (tag_t)vx_current_xid();
4118+ inode->i_op = &devpts_file_inode_operations; 4289+ inode->i_op = &devpts_file_inode_operations;
4119 inode->u.generic_ip = tty; 4290 inode->u.generic_ip = tty;
4120 4291
4121 dentry = get_node(number); 4292 dentry = get_node(number);
4122diff -NurpP --minimal linux-2.6.18.2/fs/dquot.c linux-2.6.18.2-vs2.1.1/fs/dquot.c 4293Index: linux-2.6.18/fs/dquot.c
4123--- linux-2.6.18.2/fs/dquot.c 2006-09-20 16:58:34 +0200 4294===================================================================
4124+++ linux-2.6.18.2-vs2.1.1/fs/dquot.c 2006-09-25 15:40:02 +0200 4295--- linux-2.6.18.orig/fs/dquot.c
4296+++ linux-2.6.18/fs/dquot.c
4125@@ -79,6 +79,7 @@ 4297@@ -79,6 +79,7 @@
4126 #include <linux/buffer_head.h> 4298 #include <linux/buffer_head.h>
4127 #include <linux/capability.h> 4299 #include <linux/capability.h>
4128 #include <linux/quotaops.h> 4300 #include <linux/quotaops.h>
4129+#include <linux/vserver/debug.h> 4301+#include <linux/vserver/debug.h>
4992+ hash->dqh_qop->write_info(hash, type); 5164+ hash->dqh_qop->write_info(hash, type);
4993+ mutex_unlock(&dqh_dqopt(hash)->dqonoff_mutex); 5165+ mutex_unlock(&dqh_dqopt(hash)->dqonoff_mutex);
4994 return 0; 5166 return 0;
4995 } 5167 }
4996 5168
4997diff -NurpP --minimal linux-2.6.18.2/fs/exec.c linux-2.6.18.2-vs2.1.1/fs/exec.c 5169Index: linux-2.6.18/fs/exec.c
4998--- linux-2.6.18.2/fs/exec.c 2006-09-20 16:58:34 +0200 5170===================================================================
4999+++ linux-2.6.18.2-vs2.1.1/fs/exec.c 2006-09-25 15:40:02 +0200 5171--- linux-2.6.18.orig/fs/exec.c
5172+++ linux-2.6.18/fs/exec.c
5000@@ -49,6 +49,8 @@ 5173@@ -49,6 +49,8 @@
5001 #include <linux/acct.h> 5174 #include <linux/acct.h>
5002 #include <linux/cn_proc.h> 5175 #include <linux/cn_proc.h>
5003 #include <linux/audit.h> 5176 #include <linux/audit.h>
5004+#include <linux/vs_memory.h> 5177+#include <linux/vs_memory.h>
5032- "%s", system_utsname.nodename); 5205- "%s", system_utsname.nodename);
5033+ "%s", vx_new_uts(nodename)); 5206+ "%s", vx_new_uts(nodename));
5034 up_read(&uts_sem); 5207 up_read(&uts_sem);
5035 if (rc > out_end - out_ptr) 5208 if (rc > out_end - out_ptr)
5036 goto out; 5209 goto out;
5037diff -NurpP --minimal linux-2.6.18.2/fs/ext2/balloc.c linux-2.6.18.2-vs2.1.1/fs/ext2/balloc.c 5210Index: linux-2.6.18/fs/ext2/balloc.c
5038--- linux-2.6.18.2/fs/ext2/balloc.c 2006-09-20 16:58:34 +0200 5211===================================================================
5039+++ linux-2.6.18.2-vs2.1.1/fs/ext2/balloc.c 2006-10-18 01:54:49 +0200 5212--- linux-2.6.18.orig/fs/ext2/balloc.c
5213+++ linux-2.6.18/fs/ext2/balloc.c
5040@@ -16,6 +16,8 @@ 5214@@ -16,6 +16,8 @@
5041 #include <linux/sched.h> 5215 #include <linux/sched.h>
5042 #include <linux/buffer_head.h> 5216 #include <linux/buffer_head.h>
5043 #include <linux/capability.h> 5217 #include <linux/capability.h>
5044+#include <linux/vs_dlimit.h> 5218+#include <linux/vs_dlimit.h>
5089+ DLIMIT_FREE_BLOCK(inode, es_alloc); 5263+ DLIMIT_FREE_BLOCK(inode, es_alloc);
5090+out_dlimit: 5264+out_dlimit:
5091 release_blocks(sb, es_alloc); 5265 release_blocks(sb, es_alloc);
5092 out_dquot: 5266 out_dquot:
5093 DQUOT_FREE_BLOCK(inode, dq_alloc); 5267 DQUOT_FREE_BLOCK(inode, dq_alloc);
5094diff -NurpP --minimal linux-2.6.18.2/fs/ext2/ext2.h linux-2.6.18.2-vs2.1.1/fs/ext2/ext2.h 5268Index: linux-2.6.18/fs/ext2/ext2.h
5095--- linux-2.6.18.2/fs/ext2/ext2.h 2006-09-20 16:58:34 +0200 5269===================================================================
5096+++ linux-2.6.18.2-vs2.1.1/fs/ext2/ext2.h 2006-09-20 19:55:12 +0200 5270--- linux-2.6.18.orig/fs/ext2/ext2.h
5271+++ linux-2.6.18/fs/ext2/ext2.h
5097@@ -165,6 +165,7 @@ extern const struct file_operations ext2 5272@@ -165,6 +165,7 @@ extern const struct file_operations ext2
5098 extern const struct address_space_operations ext2_aops; 5273 extern const struct address_space_operations ext2_aops;
5099 extern const struct address_space_operations ext2_aops_xip; 5274 extern const struct address_space_operations ext2_aops_xip;
5100 extern const struct address_space_operations ext2_nobh_aops; 5275 extern const struct address_space_operations ext2_nobh_aops;
5101+extern int ext2_sync_flags(struct inode *inode); 5276+extern int ext2_sync_flags(struct inode *inode);
5102 5277
5103 /* namei.c */ 5278 /* namei.c */
5104 extern struct inode_operations ext2_dir_inode_operations; 5279 extern struct inode_operations ext2_dir_inode_operations;
5105diff -NurpP --minimal linux-2.6.18.2/fs/ext2/file.c linux-2.6.18.2-vs2.1.1/fs/ext2/file.c 5280Index: linux-2.6.18/fs/ext2/file.c
5106--- linux-2.6.18.2/fs/ext2/file.c 2006-06-18 04:54:33 +0200 5281===================================================================
5107+++ linux-2.6.18.2-vs2.1.1/fs/ext2/file.c 2006-09-25 15:40:02 +0200 5282--- linux-2.6.18.orig/fs/ext2/file.c
5283+++ linux-2.6.18/fs/ext2/file.c
5108@@ -53,6 +53,7 @@ const struct file_operations ext2_file_o 5284@@ -53,6 +53,7 @@ const struct file_operations ext2_file_o
5109 .readv = generic_file_readv, 5285 .readv = generic_file_readv,
5110 .writev = generic_file_writev, 5286 .writev = generic_file_writev,
5111 .sendfile = generic_file_sendfile, 5287 .sendfile = generic_file_sendfile,
5112+ .sendpage = generic_file_sendpage, 5288+ .sendpage = generic_file_sendpage,
5117 #endif 5293 #endif
5118 .setattr = ext2_setattr, 5294 .setattr = ext2_setattr,
5119 .permission = ext2_permission, 5295 .permission = ext2_permission,
5120+ .sync_flags = ext2_sync_flags, 5296+ .sync_flags = ext2_sync_flags,
5121 }; 5297 };
5122diff -NurpP --minimal linux-2.6.18.2/fs/ext2/ialloc.c linux-2.6.18.2-vs2.1.1/fs/ext2/ialloc.c 5298Index: linux-2.6.18/fs/ext2/ialloc.c
5123--- linux-2.6.18.2/fs/ext2/ialloc.c 2006-09-20 16:58:34 +0200 5299===================================================================
5124+++ linux-2.6.18.2-vs2.1.1/fs/ext2/ialloc.c 2006-09-25 15:40:02 +0200 5300--- linux-2.6.18.orig/fs/ext2/ialloc.c
5301+++ linux-2.6.18/fs/ext2/ialloc.c
5125@@ -17,6 +17,8 @@ 5302@@ -17,6 +17,8 @@
5126 #include <linux/backing-dev.h> 5303 #include <linux/backing-dev.h>
5127 #include <linux/buffer_head.h> 5304 #include <linux/buffer_head.h>
5128 #include <linux/random.h> 5305 #include <linux/random.h>
5129+#include <linux/vs_dlimit.h> 5306+#include <linux/vs_dlimit.h>
5175+ DLIMIT_FREE_INODE(inode); 5352+ DLIMIT_FREE_INODE(inode);
5176+fail_dlim: 5353+fail_dlim:
5177 make_bad_inode(inode); 5354 make_bad_inode(inode);
5178 iput(inode); 5355 iput(inode);
5179 return ERR_PTR(err); 5356 return ERR_PTR(err);
5180diff -NurpP --minimal linux-2.6.18.2/fs/ext2/inode.c linux-2.6.18.2-vs2.1.1/fs/ext2/inode.c 5357Index: linux-2.6.18/fs/ext2/inode.c
5181--- linux-2.6.18.2/fs/ext2/inode.c 2006-09-20 16:58:34 +0200 5358===================================================================
5182+++ linux-2.6.18.2-vs2.1.1/fs/ext2/inode.c 2006-11-04 08:24:09 +0100 5359--- linux-2.6.18.orig/fs/ext2/inode.c
5360+++ linux-2.6.18/fs/ext2/inode.c
5183@@ -31,6 +31,7 @@ 5361@@ -31,6 +31,7 @@
5184 #include <linux/writeback.h> 5362 #include <linux/writeback.h>
5185 #include <linux/buffer_head.h> 5363 #include <linux/buffer_head.h>
5186 #include <linux/mpage.h> 5364 #include <linux/mpage.h>
5187+#include <linux/vserver/tag.h> 5365+#include <linux/vserver/tag.h>
5322+ (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid) || 5500+ (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid) ||
5323+ (iattr->ia_valid & ATTR_TAG && iattr->ia_tag != inode->i_tag)) { 5501+ (iattr->ia_valid & ATTR_TAG && iattr->ia_tag != inode->i_tag)) {
5324 error = DQUOT_TRANSFER(inode, iattr) ? -EDQUOT : 0; 5502 error = DQUOT_TRANSFER(inode, iattr) ? -EDQUOT : 0;
5325 if (error) 5503 if (error)
5326 return error; 5504 return error;
5327diff -NurpP --minimal linux-2.6.18.2/fs/ext2/ioctl.c linux-2.6.18.2-vs2.1.1/fs/ext2/ioctl.c 5505Index: linux-2.6.18/fs/ext2/ioctl.c
5328--- linux-2.6.18.2/fs/ext2/ioctl.c 2006-04-09 13:49:53 +0200 5506===================================================================
5329+++ linux-2.6.18.2-vs2.1.1/fs/ext2/ioctl.c 2006-09-20 17:01:44 +0200 5507--- linux-2.6.18.orig/fs/ext2/ioctl.c
5508+++ linux-2.6.18/fs/ext2/ioctl.c
5330@@ -11,6 +11,7 @@ 5509@@ -11,6 +11,7 @@
5331 #include <linux/capability.h> 5510 #include <linux/capability.h>
5332 #include <linux/time.h> 5511 #include <linux/time.h>
5333 #include <linux/sched.h> 5512 #include <linux/sched.h>
5334+#include <linux/mount.h> 5513+#include <linux/mount.h>
5364+ if (IS_RDONLY(inode) || 5543+ if (IS_RDONLY(inode) ||
5365+ (filp && MNT_IS_RDONLY(filp->f_vfsmnt))) 5544+ (filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
5366 return -EROFS; 5545 return -EROFS;
5367 if (get_user(inode->i_generation, (int __user *) arg)) 5546 if (get_user(inode->i_generation, (int __user *) arg))
5368 return -EFAULT; 5547 return -EFAULT;
5369diff -NurpP --minimal linux-2.6.18.2/fs/ext2/namei.c linux-2.6.18.2-vs2.1.1/fs/ext2/namei.c 5548Index: linux-2.6.18/fs/ext2/namei.c
5370--- linux-2.6.18.2/fs/ext2/namei.c 2006-06-18 04:54:33 +0200 5549===================================================================
5371+++ linux-2.6.18.2-vs2.1.1/fs/ext2/namei.c 2006-11-04 08:24:09 +0100 5550--- linux-2.6.18.orig/fs/ext2/namei.c
5551+++ linux-2.6.18/fs/ext2/namei.c
5372@@ -31,6 +31,7 @@ 5552@@ -31,6 +31,7 @@
5373 */ 5553 */
5374 5554
5375 #include <linux/pagemap.h> 5555 #include <linux/pagemap.h>
5376+#include <linux/vserver/tag.h> 5556+#include <linux/vserver/tag.h>
5397 #endif 5577 #endif
5398 .setattr = ext2_setattr, 5578 .setattr = ext2_setattr,
5399 .permission = ext2_permission, 5579 .permission = ext2_permission,
5400+ .sync_flags = ext2_sync_flags, 5580+ .sync_flags = ext2_sync_flags,
5401 }; 5581 };
5402diff -NurpP --minimal linux-2.6.18.2/fs/ext2/super.c linux-2.6.18.2-vs2.1.1/fs/ext2/super.c 5582Index: linux-2.6.18/fs/ext2/super.c
5403--- linux-2.6.18.2/fs/ext2/super.c 2006-09-20 16:58:34 +0200 5583===================================================================
5404+++ linux-2.6.18.2-vs2.1.1/fs/ext2/super.c 2006-09-25 15:40:02 +0200 5584--- linux-2.6.18.orig/fs/ext2/super.c
5585+++ linux-2.6.18/fs/ext2/super.c
5405@@ -228,8 +228,8 @@ static int ext2_show_options(struct seq_ 5586@@ -228,8 +228,8 @@ static int ext2_show_options(struct seq_
5406 } 5587 }
5407 5588
5408 #ifdef CONFIG_QUOTA 5589 #ifdef CONFIG_QUOTA
5409-static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data, size_t len, loff_t off); 5590-static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data, size_t len, loff_t off);
5503+ struct inode *inode = dqh_dqopt(hash)->files[type]; 5684+ struct inode *inode = dqh_dqopt(hash)->files[type];
5504+ struct super_block *sb = hash->dqh_sb; 5685+ struct super_block *sb = hash->dqh_sb;
5505 sector_t blk = off >> EXT2_BLOCK_SIZE_BITS(sb); 5686 sector_t blk = off >> EXT2_BLOCK_SIZE_BITS(sb);
5506 int err = 0; 5687 int err = 0;
5507 int offset = off & (sb->s_blocksize - 1); 5688 int offset = off & (sb->s_blocksize - 1);
5508diff -NurpP --minimal linux-2.6.18.2/fs/ext2/symlink.c linux-2.6.18.2-vs2.1.1/fs/ext2/symlink.c 5689Index: linux-2.6.18/fs/ext2/symlink.c
5509--- linux-2.6.18.2/fs/ext2/symlink.c 2005-08-29 22:25:30 +0200 5690===================================================================
5510+++ linux-2.6.18.2-vs2.1.1/fs/ext2/symlink.c 2006-09-20 17:01:44 +0200 5691--- linux-2.6.18.orig/fs/ext2/symlink.c
5692+++ linux-2.6.18/fs/ext2/symlink.c
5511@@ -38,6 +38,7 @@ struct inode_operations ext2_symlink_ino 5693@@ -38,6 +38,7 @@ struct inode_operations ext2_symlink_ino
5512 .listxattr = ext2_listxattr, 5694 .listxattr = ext2_listxattr,
5513 .removexattr = generic_removexattr, 5695 .removexattr = generic_removexattr,
5514 #endif 5696 #endif
5515+ .sync_flags = ext2_sync_flags, 5697+ .sync_flags = ext2_sync_flags,
5520 .listxattr = ext2_listxattr, 5702 .listxattr = ext2_listxattr,
5521 .removexattr = generic_removexattr, 5703 .removexattr = generic_removexattr,
5522 #endif 5704 #endif
5523+ .sync_flags = ext2_sync_flags, 5705+ .sync_flags = ext2_sync_flags,
5524 }; 5706 };
5525diff -NurpP --minimal linux-2.6.18.2/fs/ext2/xattr.c linux-2.6.18.2-vs2.1.1/fs/ext2/xattr.c 5707Index: linux-2.6.18/fs/ext2/xattr.c
5526--- linux-2.6.18.2/fs/ext2/xattr.c 2006-02-18 14:40:21 +0100 5708===================================================================
5527+++ linux-2.6.18.2-vs2.1.1/fs/ext2/xattr.c 2006-09-20 17:01:44 +0200 5709--- linux-2.6.18.orig/fs/ext2/xattr.c
5710+++ linux-2.6.18/fs/ext2/xattr.c
5528@@ -60,6 +60,7 @@ 5711@@ -60,6 +60,7 @@
5529 #include <linux/mbcache.h> 5712 #include <linux/mbcache.h>
5530 #include <linux/quotaops.h> 5713 #include <linux/quotaops.h>
5531 #include <linux/rwsem.h> 5714 #include <linux/rwsem.h>
5532+#include <linux/vs_dlimit.h> 5715+#include <linux/vs_dlimit.h>
5560 sync_dirty_buffer(bh); 5743 sync_dirty_buffer(bh);
5561+ DLIMIT_FREE_BLOCK(inode, 1); 5744+ DLIMIT_FREE_BLOCK(inode, 1);
5562 DQUOT_FREE_BLOCK(inode, 1); 5745 DQUOT_FREE_BLOCK(inode, 1);
5563 } 5746 }
5564 EXT2_I(inode)->i_file_acl = 0; 5747 EXT2_I(inode)->i_file_acl = 0;
5565diff -NurpP --minimal linux-2.6.18.2/fs/ext3/balloc.c linux-2.6.18.2-vs2.1.1/fs/ext3/balloc.c 5748Index: linux-2.6.18/fs/ext3/balloc.c
5566--- linux-2.6.18.2/fs/ext3/balloc.c 2006-09-20 16:58:34 +0200 5749===================================================================
5567+++ linux-2.6.18.2-vs2.1.1/fs/ext3/balloc.c 2006-10-18 01:54:49 +0200 5750--- linux-2.6.18.orig/fs/ext3/balloc.c
5751+++ linux-2.6.18/fs/ext3/balloc.c
5568@@ -19,6 +19,8 @@ 5752@@ -19,6 +19,8 @@
5569 #include <linux/ext3_jbd.h> 5753 #include <linux/ext3_jbd.h>
5570 #include <linux/quotaops.h> 5754 #include <linux/quotaops.h>
5571 #include <linux/buffer_head.h> 5755 #include <linux/buffer_head.h>
5572+#include <linux/vs_dlimit.h> 5756+#include <linux/vs_dlimit.h>
5598+ int cond; 5782+ int cond;
5599 5783
5600 free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter); 5784 free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
5601 root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count); 5785 root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count);
5602- if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) && 5786- if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) &&
5787+
5788+ vxdprintk(VXD_CBIT(dlim, 3),
5789+ "ext3_has_free_blocks(%p): free=%lu, root=%lu",
5790+ sb, free_blocks, root_blocks);
5791+
5792+ DLIMIT_ADJUST_BLOCK(sb, dx_current_tag(), &free_blocks, &root_blocks);
5793+
5794+ cond = (free_blocks < root_blocks + 1 &&
5795+ !capable(CAP_SYS_RESOURCE) &&
5603- sbi->s_resuid != current->fsuid && 5796 sbi->s_resuid != current->fsuid &&
5604- (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) { 5797- (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
5605- return 0; 5798- return 0;
5606- } 5799- }
5607- return 1; 5800- return 1;
5608+
5609+ vxdprintk(VXD_CBIT(dlim, 3),
5610+ "ext3_has_free_blocks(%p): free=%lu, root=%lu",
5611+ sb, free_blocks, root_blocks);
5612+
5613+ DLIMIT_ADJUST_BLOCK(sb, dx_current_tag(), &free_blocks, &root_blocks);
5614+
5615+ cond = (free_blocks < root_blocks + 1 &&
5616+ !capable(CAP_SYS_RESOURCE) &&
5617+ sbi->s_resuid != current->fsuid &&
5618+ (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))); 5801+ (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid)));
5619+ 5802+
5620+ vxdprintk(VXD_CBIT(dlim, 3), 5803+ vxdprintk(VXD_CBIT(dlim, 3),
5621+ "ext3_has_free_blocks(%p): %lu<%lu+1, %c, %u!=%u r=%d", 5804+ "ext3_has_free_blocks(%p): %lu<%lu+1, %c, %u!=%u r=%d",
5622+ sb, free_blocks, root_blocks, 5805+ sb, free_blocks, root_blocks,
5662+ DLIMIT_FREE_BLOCK(inode, 1); 5845+ DLIMIT_FREE_BLOCK(inode, 1);
5663+out_dlimit: 5846+out_dlimit:
5664 if (fatal) { 5847 if (fatal) {
5665 *errp = fatal; 5848 *errp = fatal;
5666 ext3_std_error(sb, fatal); 5849 ext3_std_error(sb, fatal);
5667diff -NurpP --minimal linux-2.6.18.2/fs/ext3/file.c linux-2.6.18.2-vs2.1.1/fs/ext3/file.c 5850Index: linux-2.6.18/fs/ext3/file.c
5668--- linux-2.6.18.2/fs/ext3/file.c 2006-06-18 04:54:33 +0200 5851===================================================================
5669+++ linux-2.6.18.2-vs2.1.1/fs/ext3/file.c 2006-09-25 15:40:02 +0200 5852--- linux-2.6.18.orig/fs/ext3/file.c
5853+++ linux-2.6.18/fs/ext3/file.c
5670@@ -119,6 +119,7 @@ const struct file_operations ext3_file_o 5854@@ -119,6 +119,7 @@ const struct file_operations ext3_file_o
5671 .release = ext3_release_file, 5855 .release = ext3_release_file,
5672 .fsync = ext3_sync_file, 5856 .fsync = ext3_sync_file,
5673 .sendfile = generic_file_sendfile, 5857 .sendfile = generic_file_sendfile,
5674+ .sendpage = generic_file_sendpage, 5858+ .sendpage = generic_file_sendpage,
5680 #endif 5864 #endif
5681 .permission = ext3_permission, 5865 .permission = ext3_permission,
5682+ .sync_flags = ext3_sync_flags, 5866+ .sync_flags = ext3_sync_flags,
5683 }; 5867 };
5684 5868
5685diff -NurpP --minimal linux-2.6.18.2/fs/ext3/ialloc.c linux-2.6.18.2-vs2.1.1/fs/ext3/ialloc.c 5869Index: linux-2.6.18/fs/ext3/ialloc.c
5686--- linux-2.6.18.2/fs/ext3/ialloc.c 2006-09-20 16:58:34 +0200 5870===================================================================
5687+++ linux-2.6.18.2-vs2.1.1/fs/ext3/ialloc.c 2006-09-25 15:40:02 +0200 5871--- linux-2.6.18.orig/fs/ext3/ialloc.c
5872+++ linux-2.6.18/fs/ext3/ialloc.c
5688@@ -23,6 +23,8 @@ 5873@@ -23,6 +23,8 @@
5689 #include <linux/buffer_head.h> 5874 #include <linux/buffer_head.h>
5690 #include <linux/random.h> 5875 #include <linux/random.h>
5691 #include <linux/bitops.h> 5876 #include <linux/bitops.h>
5692+#include <linux/vs_dlimit.h> 5877+#include <linux/vs_dlimit.h>
5740 DQUOT_DROP(inode); 5925 DQUOT_DROP(inode);
5741+ DLIMIT_FREE_INODE(inode); 5926+ DLIMIT_FREE_INODE(inode);
5742 inode->i_flags |= S_NOQUOTA; 5927 inode->i_flags |= S_NOQUOTA;
5743 inode->i_nlink = 0; 5928 inode->i_nlink = 0;
5744 iput(inode); 5929 iput(inode);
5745diff -NurpP --minimal linux-2.6.18.2/fs/ext3/inode.c linux-2.6.18.2-vs2.1.1/fs/ext3/inode.c 5930Index: linux-2.6.18/fs/ext3/inode.c
5746--- linux-2.6.18.2/fs/ext3/inode.c 2006-09-20 16:58:34 +0200 5931===================================================================
5747+++ linux-2.6.18.2-vs2.1.1/fs/ext3/inode.c 2006-11-04 08:15:22 +0100 5932--- linux-2.6.18.orig/fs/ext3/inode.c
5933+++ linux-2.6.18/fs/ext3/inode.c
5748@@ -36,6 +36,7 @@ 5934@@ -36,6 +36,7 @@
5749 #include <linux/writeback.h> 5935 #include <linux/writeback.h>
5750 #include <linux/mpage.h> 5936 #include <linux/mpage.h>
5751 #include <linux/uio.h> 5937 #include <linux/uio.h>
5752+#include <linux/vserver/tag.h> 5938+#include <linux/vserver/tag.h>
5939+ if ((attr->ia_valid & ATTR_TAG) && IS_TAGGED(inode)) 6125+ if ((attr->ia_valid & ATTR_TAG) && IS_TAGGED(inode))
5940+ inode->i_tag = attr->ia_tag; 6126+ inode->i_tag = attr->ia_tag;
5941 error = ext3_mark_inode_dirty(handle, inode); 6127 error = ext3_mark_inode_dirty(handle, inode);
5942 ext3_journal_stop(handle); 6128 ext3_journal_stop(handle);
5943 } 6129 }
5944diff -NurpP --minimal linux-2.6.18.2/fs/ext3/ioctl.c linux-2.6.18.2-vs2.1.1/fs/ext3/ioctl.c 6130Index: linux-2.6.18/fs/ext3/ioctl.c
5945--- linux-2.6.18.2/fs/ext3/ioctl.c 2006-09-20 16:58:34 +0200 6131===================================================================
5946+++ linux-2.6.18.2-vs2.1.1/fs/ext3/ioctl.c 2006-09-25 15:40:02 +0200 6132--- linux-2.6.18.orig/fs/ext3/ioctl.c
6133+++ linux-2.6.18/fs/ext3/ioctl.c
5947@@ -8,11 +8,13 @@ 6134@@ -8,11 +8,13 @@
5948 */ 6135 */
5949 6136
5950 #include <linux/fs.h> 6137 #include <linux/fs.h>
5951+#include <linux/mount.h> 6138+#include <linux/mount.h>
6056+ } 6243+ }
6057+#endif 6244+#endif
6058 6245
6059 default: 6246 default:
6060 return -ENOTTY; 6247 return -ENOTTY;
6061diff -NurpP --minimal linux-2.6.18.2/fs/ext3/namei.c linux-2.6.18.2-vs2.1.1/fs/ext3/namei.c 6248Index: linux-2.6.18/fs/ext3/namei.c
6062--- linux-2.6.18.2/fs/ext3/namei.c 2006-09-20 16:58:34 +0200 6249===================================================================
6063+++ linux-2.6.18.2-vs2.1.1/fs/ext3/namei.c 2006-09-25 15:40:02 +0200 6250--- linux-2.6.18.orig/fs/ext3/namei.c
6251+++ linux-2.6.18/fs/ext3/namei.c
6064@@ -36,6 +36,7 @@ 6252@@ -36,6 +36,7 @@
6065 #include <linux/quotaops.h> 6253 #include <linux/quotaops.h>
6066 #include <linux/buffer_head.h> 6254 #include <linux/buffer_head.h>
6067 #include <linux/smp_lock.h> 6255 #include <linux/smp_lock.h>
6068+#include <linux/vserver/tag.h> 6256+#include <linux/vserver/tag.h>
6089 .removexattr = generic_removexattr, 6277 .removexattr = generic_removexattr,
6090 #endif 6278 #endif
6091 .permission = ext3_permission, 6279 .permission = ext3_permission,
6092+ .sync_flags = ext3_sync_flags, 6280+ .sync_flags = ext3_sync_flags,
6093 }; 6281 };
6094diff -NurpP --minimal linux-2.6.18.2/fs/ext3/super.c linux-2.6.18.2-vs2.1.1/fs/ext3/super.c 6282Index: linux-2.6.18/fs/ext3/super.c
6095--- linux-2.6.18.2/fs/ext3/super.c 2006-09-20 16:58:34 +0200 6283===================================================================
6096+++ linux-2.6.18.2-vs2.1.1/fs/ext3/super.c 2006-09-25 15:40:02 +0200 6284--- linux-2.6.18.orig/fs/ext3/super.c
6285+++ linux-2.6.18/fs/ext3/super.c
6097@@ -605,12 +605,12 @@ static int ext3_write_dquot(struct dquot 6286@@ -605,12 +605,12 @@ static int ext3_write_dquot(struct dquot
6098 static int ext3_acquire_dquot(struct dquot *dquot); 6287 static int ext3_acquire_dquot(struct dquot *dquot);
6099 static int ext3_release_dquot(struct dquot *dquot); 6288 static int ext3_release_dquot(struct dquot *dquot);
6100 static int ext3_mark_dquot_dirty(struct dquot *dquot); 6289 static int ext3_mark_dquot_dirty(struct dquot *dquot);
6101-static int ext3_write_info(struct super_block *sb, int type); 6290-static int ext3_write_info(struct super_block *sb, int type);
6369+ struct inode *inode = dqh_dqopt(hash)->files[type]; 6558+ struct inode *inode = dqh_dqopt(hash)->files[type];
6370+ struct super_block *sb = hash->dqh_sb; 6559+ struct super_block *sb = hash->dqh_sb;
6371 sector_t blk = off >> EXT3_BLOCK_SIZE_BITS(sb); 6560 sector_t blk = off >> EXT3_BLOCK_SIZE_BITS(sb);
6372 int err = 0; 6561 int err = 0;
6373 int offset = off & (sb->s_blocksize - 1); 6562 int offset = off & (sb->s_blocksize - 1);
6374diff -NurpP --minimal linux-2.6.18.2/fs/ext3/symlink.c linux-2.6.18.2-vs2.1.1/fs/ext3/symlink.c 6563Index: linux-2.6.18/fs/ext3/symlink.c
6375--- linux-2.6.18.2/fs/ext3/symlink.c 2005-08-29 22:25:30 +0200 6564===================================================================
6376+++ linux-2.6.18.2-vs2.1.1/fs/ext3/symlink.c 2006-09-20 17:01:44 +0200 6565--- linux-2.6.18.orig/fs/ext3/symlink.c
6566+++ linux-2.6.18/fs/ext3/symlink.c
6377@@ -40,6 +40,7 @@ struct inode_operations ext3_symlink_ino 6567@@ -40,6 +40,7 @@ struct inode_operations ext3_symlink_ino
6378 .listxattr = ext3_listxattr, 6568 .listxattr = ext3_listxattr,
6379 .removexattr = generic_removexattr, 6569 .removexattr = generic_removexattr,
6380 #endif 6570 #endif
6381+ .sync_flags = ext3_sync_flags, 6571+ .sync_flags = ext3_sync_flags,
6386 .listxattr = ext3_listxattr, 6576 .listxattr = ext3_listxattr,
6387 .removexattr = generic_removexattr, 6577 .removexattr = generic_removexattr,
6388 #endif 6578 #endif
6389+ .sync_flags = ext3_sync_flags, 6579+ .sync_flags = ext3_sync_flags,
6390 }; 6580 };
6391diff -NurpP --minimal linux-2.6.18.2/fs/ext3/xattr.c linux-2.6.18.2-vs2.1.1/fs/ext3/xattr.c 6581Index: linux-2.6.18/fs/ext3/xattr.c
6392--- linux-2.6.18.2/fs/ext3/xattr.c 2006-09-20 16:58:34 +0200 6582===================================================================
6393+++ linux-2.6.18.2-vs2.1.1/fs/ext3/xattr.c 2006-09-20 17:01:44 +0200 6583--- linux-2.6.18.orig/fs/ext3/xattr.c
6584+++ linux-2.6.18/fs/ext3/xattr.c
6394@@ -58,6 +58,7 @@ 6585@@ -58,6 +58,7 @@
6395 #include <linux/mbcache.h> 6586 #include <linux/mbcache.h>
6396 #include <linux/quotaops.h> 6587 #include <linux/quotaops.h>
6397 #include <linux/rwsem.h> 6588 #include <linux/rwsem.h>
6398+#include <linux/vs_dlimit.h> 6589+#include <linux/vs_dlimit.h>
6430+cleanup_dlimit: 6621+cleanup_dlimit:
6431+ DLIMIT_FREE_BLOCK(inode, 1); 6622+ DLIMIT_FREE_BLOCK(inode, 1);
6432 goto cleanup; 6623 goto cleanup;
6433 6624
6434 bad_block: 6625 bad_block:
6435diff -NurpP --minimal linux-2.6.18.2/fs/fcntl.c linux-2.6.18.2-vs2.1.1/fs/fcntl.c 6626Index: linux-2.6.18/fs/fcntl.c
6436--- linux-2.6.18.2/fs/fcntl.c 2006-06-18 04:54:34 +0200 6627===================================================================
6437+++ linux-2.6.18.2-vs2.1.1/fs/fcntl.c 2006-09-20 17:01:44 +0200 6628--- linux-2.6.18.orig/fs/fcntl.c
6629+++ linux-2.6.18/fs/fcntl.c
6438@@ -18,6 +18,7 @@ 6630@@ -18,6 +18,7 @@
6439 #include <linux/ptrace.h> 6631 #include <linux/ptrace.h>
6440 #include <linux/signal.h> 6632 #include <linux/signal.h>
6441 #include <linux/rcupdate.h> 6633 #include <linux/rcupdate.h>
6442+#include <linux/vs_limit.h> 6634+#include <linux/vs_limit.h>
6486- p = find_task_by_pid(pid); 6678- p = find_task_by_pid(pid);
6487+ p = find_task_by_real_pid(pid); 6679+ p = find_task_by_real_pid(pid);
6488 if (p) { 6680 if (p) {
6489 send_sigurg_to_task(p, fown); 6681 send_sigurg_to_task(p, fown);
6490 } 6682 }
6491diff -NurpP --minimal linux-2.6.18.2/fs/file_table.c linux-2.6.18.2-vs2.1.1/fs/file_table.c 6683Index: linux-2.6.18/fs/file_table.c
6492--- linux-2.6.18.2/fs/file_table.c 2006-09-20 16:58:34 +0200 6684===================================================================
6493+++ linux-2.6.18.2-vs2.1.1/fs/file_table.c 2006-09-20 17:01:44 +0200 6685--- linux-2.6.18.orig/fs/file_table.c
6686+++ linux-2.6.18/fs/file_table.c
6494@@ -21,6 +21,8 @@ 6687@@ -21,6 +21,8 @@
6495 #include <linux/fsnotify.h> 6688 #include <linux/fsnotify.h>
6496 #include <linux/sysctl.h> 6689 #include <linux/sysctl.h>
6497 #include <linux/percpu_counter.h> 6690 #include <linux/percpu_counter.h>
6498+#include <linux/vs_limit.h> 6691+#include <linux/vs_limit.h>
6525+ vx_files_dec(file); 6718+ vx_files_dec(file);
6526+ file->f_xid = 0; 6719+ file->f_xid = 0;
6527 file_kill(file); 6720 file_kill(file);
6528 file_free(file); 6721 file_free(file);
6529 } 6722 }
6530diff -NurpP --minimal linux-2.6.18.2/fs/hfsplus/ioctl.c linux-2.6.18.2-vs2.1.1/fs/hfsplus/ioctl.c 6723Index: linux-2.6.18/fs/hfsplus/ioctl.c
6531--- linux-2.6.18.2/fs/hfsplus/ioctl.c 2006-04-09 13:49:53 +0200 6724===================================================================
6532+++ linux-2.6.18.2-vs2.1.1/fs/hfsplus/ioctl.c 2006-09-20 17:01:44 +0200 6725--- linux-2.6.18.orig/fs/hfsplus/ioctl.c
6726+++ linux-2.6.18/fs/hfsplus/ioctl.c
6533@@ -16,6 +16,7 @@ 6727@@ -16,6 +16,7 @@
6534 #include <linux/fs.h> 6728 #include <linux/fs.h>
6535 #include <linux/sched.h> 6729 #include <linux/sched.h>
6536 #include <linux/xattr.h> 6730 #include <linux/xattr.h>
6537+#include <linux/mount.h> 6731+#include <linux/mount.h>
6546+ if (IS_RDONLY(inode) || 6740+ if (IS_RDONLY(inode) ||
6547+ (filp && MNT_IS_RDONLY(filp->f_vfsmnt))) 6741+ (filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
6548 return -EROFS; 6742 return -EROFS;
6549 6743
6550 if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) 6744 if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
6551diff -NurpP --minimal linux-2.6.18.2/fs/inode.c linux-2.6.18.2-vs2.1.1/fs/inode.c 6745Index: linux-2.6.18/fs/inode.c
6552--- linux-2.6.18.2/fs/inode.c 2006-09-20 16:58:35 +0200 6746===================================================================
6553+++ linux-2.6.18.2-vs2.1.1/fs/inode.c 2006-10-29 02:50:41 +0100 6747--- linux-2.6.18.orig/fs/inode.c
6748+++ linux-2.6.18/fs/inode.c
6554@@ -115,6 +115,9 @@ static struct inode *alloc_inode(struct 6749@@ -115,6 +115,9 @@ static struct inode *alloc_inode(struct
6555 struct address_space * const mapping = &inode->i_data; 6750 struct address_space * const mapping = &inode->i_data;
6556 6751
6557 inode->i_sb = sb; 6752 inode->i_sb = sb;
6558+ 6753+
6603- if (!sb->dq_op) 6798- if (!sb->dq_op)
6604+ if (!hash->dqh_qop) 6799+ if (!hash->dqh_qop)
6605 return; /* nothing to do */ 6800 return; /* nothing to do */
6606 spin_lock(&inode_lock); /* This lock is for inodes code */ 6801 spin_lock(&inode_lock); /* This lock is for inodes code */
6607 6802
6608diff -NurpP --minimal linux-2.6.18.2/fs/ioctl.c linux-2.6.18.2-vs2.1.1/fs/ioctl.c 6803Index: linux-2.6.18/fs/ioctl.c
6609--- linux-2.6.18.2/fs/ioctl.c 2006-09-20 16:58:35 +0200 6804===================================================================
6610+++ linux-2.6.18.2-vs2.1.1/fs/ioctl.c 2006-09-25 15:40:02 +0200 6805--- linux-2.6.18.orig/fs/ioctl.c
6806+++ linux-2.6.18/fs/ioctl.c
6611@@ -12,10 +12,19 @@ 6807@@ -12,10 +12,19 @@
6612 #include <linux/fs.h> 6808 #include <linux/fs.h>
6613 #include <linux/security.h> 6809 #include <linux/security.h>
6614 #include <linux/module.h> 6810 #include <linux/module.h>
6615+#include <linux/proc_fs.h> 6811+#include <linux/proc_fs.h>
6675+ break; 6871+ break;
6676+#endif 6872+#endif
6677 default: 6873 default:
6678 if (S_ISREG(filp->f_dentry->d_inode->i_mode)) 6874 if (S_ISREG(filp->f_dentry->d_inode->i_mode))
6679 error = file_ioctl(filp, cmd, arg); 6875 error = file_ioctl(filp, cmd, arg);
6680diff -NurpP --minimal linux-2.6.18.2/fs/ioprio.c linux-2.6.18.2-vs2.1.1/fs/ioprio.c 6876Index: linux-2.6.18/fs/ioprio.c
6681--- linux-2.6.18.2/fs/ioprio.c 2006-09-20 16:58:35 +0200 6877===================================================================
6682+++ linux-2.6.18.2-vs2.1.1/fs/ioprio.c 2006-10-07 04:29:47 +0200 6878--- linux-2.6.18.orig/fs/ioprio.c
6879+++ linux-2.6.18/fs/ioprio.c
6683@@ -104,7 +104,7 @@ asmlinkage long sys_ioprio_set(int which 6880@@ -104,7 +104,7 @@ asmlinkage long sys_ioprio_set(int which
6684 if (!who) 6881 if (!who)
6685 user = current->user; 6882 user = current->user;
6686 else 6883 else
6687- user = find_user(who); 6884- user = find_user(who);
6696- user = find_user(who); 6893- user = find_user(who);
6697+ user = find_user(vx_current_xid(), who); 6894+ user = find_user(vx_current_xid(), who);
6698 6895
6699 if (!user) 6896 if (!user)
6700 break; 6897 break;
6701diff -NurpP --minimal linux-2.6.18.2/fs/jfs/acl.c linux-2.6.18.2-vs2.1.1/fs/jfs/acl.c 6898Index: linux-2.6.18/fs/jfs/acl.c
6702--- linux-2.6.18.2/fs/jfs/acl.c 2006-06-18 04:54:36 +0200 6899===================================================================
6703+++ linux-2.6.18.2-vs2.1.1/fs/jfs/acl.c 2006-09-25 15:40:02 +0200 6900--- linux-2.6.18.orig/fs/jfs/acl.c
6901+++ linux-2.6.18/fs/jfs/acl.c
6704@@ -232,7 +232,8 @@ int jfs_setattr(struct dentry *dentry, s 6902@@ -232,7 +232,8 @@ int jfs_setattr(struct dentry *dentry, s
6705 return rc; 6903 return rc;
6706 6904
6707 if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) || 6905 if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
6708- (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) { 6906- (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {
6709+ (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid) || 6907+ (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid) ||
6710+ (iattr->ia_valid & ATTR_TAG && iattr->ia_tag != inode->i_tag)) { 6908+ (iattr->ia_valid & ATTR_TAG && iattr->ia_tag != inode->i_tag)) {
6711 if (DQUOT_TRANSFER(inode, iattr)) 6909 if (DQUOT_TRANSFER(inode, iattr))
6712 return -EDQUOT; 6910 return -EDQUOT;
6713 } 6911 }
6714diff -NurpP --minimal linux-2.6.18.2/fs/jfs/file.c linux-2.6.18.2-vs2.1.1/fs/jfs/file.c 6912Index: linux-2.6.18/fs/jfs/file.c
6715--- linux-2.6.18.2/fs/jfs/file.c 2006-06-18 04:54:36 +0200 6913===================================================================
6716+++ linux-2.6.18.2-vs2.1.1/fs/jfs/file.c 2006-09-25 15:40:02 +0200 6914--- linux-2.6.18.orig/fs/jfs/file.c
6915+++ linux-2.6.18/fs/jfs/file.c
6717@@ -98,6 +98,7 @@ struct inode_operations jfs_file_inode_o 6916@@ -98,6 +98,7 @@ struct inode_operations jfs_file_inode_o
6718 .setattr = jfs_setattr, 6917 .setattr = jfs_setattr,
6719 .permission = jfs_permission, 6918 .permission = jfs_permission,
6720 #endif 6919 #endif
6721+ .sync_flags = jfs_sync_flags, 6920+ .sync_flags = jfs_sync_flags,
6728 .sendfile = generic_file_sendfile, 6927 .sendfile = generic_file_sendfile,
6729+ .sendpage = generic_file_sendpage, 6928+ .sendpage = generic_file_sendpage,
6730 .fsync = jfs_fsync, 6929 .fsync = jfs_fsync,
6731 .release = jfs_release, 6930 .release = jfs_release,
6732 .ioctl = jfs_ioctl, 6931 .ioctl = jfs_ioctl,
6733diff -NurpP --minimal linux-2.6.18.2/fs/jfs/inode.c linux-2.6.18.2-vs2.1.1/fs/jfs/inode.c 6932Index: linux-2.6.18/fs/jfs/inode.c
6734--- linux-2.6.18.2/fs/jfs/inode.c 2006-09-20 16:58:35 +0200 6933===================================================================
6735+++ linux-2.6.18.2-vs2.1.1/fs/jfs/inode.c 2006-09-20 17:01:44 +0200 6934--- linux-2.6.18.orig/fs/jfs/inode.c
6935+++ linux-2.6.18/fs/jfs/inode.c
6736@@ -22,6 +22,7 @@ 6936@@ -22,6 +22,7 @@
6737 #include <linux/buffer_head.h> 6937 #include <linux/buffer_head.h>
6738 #include <linux/pagemap.h> 6938 #include <linux/pagemap.h>
6739 #include <linux/quotaops.h> 6939 #include <linux/quotaops.h>
6740+#include <linux/vs_dlimit.h> 6940+#include <linux/vs_dlimit.h>
6747 DQUOT_DROP(inode); 6947 DQUOT_DROP(inode);
6748+ DLIMIT_FREE_INODE(inode); 6948+ DLIMIT_FREE_INODE(inode);
6749 } 6949 }
6750 6950
6751 clear_inode(inode); 6951 clear_inode(inode);
6752diff -NurpP --minimal linux-2.6.18.2/fs/jfs/ioctl.c linux-2.6.18.2-vs2.1.1/fs/jfs/ioctl.c 6952Index: linux-2.6.18/fs/jfs/ioctl.c
6753--- linux-2.6.18.2/fs/jfs/ioctl.c 2006-06-18 04:54:36 +0200 6953===================================================================
6754+++ linux-2.6.18.2-vs2.1.1/fs/jfs/ioctl.c 2006-09-20 17:01:44 +0200 6954--- linux-2.6.18.orig/fs/jfs/ioctl.c
6955+++ linux-2.6.18/fs/jfs/ioctl.c
6755@@ -10,6 +10,7 @@ 6956@@ -10,6 +10,7 @@
6756 #include <linux/ctype.h> 6957 #include <linux/ctype.h>
6757 #include <linux/capability.h> 6958 #include <linux/capability.h>
6758 #include <linux/time.h> 6959 #include <linux/time.h>
6759+#include <linux/mount.h> 6960+#include <linux/mount.h>
6779+ ((flags ^ oldflags) & (JFS_APPEND_FL | 6980+ ((flags ^ oldflags) & (JFS_APPEND_FL |
6780+ JFS_IMMUTABLE_FL | JFS_IUNLINK_FL))) { 6981+ JFS_IMMUTABLE_FL | JFS_IUNLINK_FL))) {
6781 if (!capable(CAP_LINUX_IMMUTABLE)) 6982 if (!capable(CAP_LINUX_IMMUTABLE))
6782 return -EPERM; 6983 return -EPERM;
6783 } 6984 }
6784diff -NurpP --minimal linux-2.6.18.2/fs/jfs/jfs_dinode.h linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_dinode.h 6985Index: linux-2.6.18/fs/jfs/jfs_dinode.h
6785--- linux-2.6.18.2/fs/jfs/jfs_dinode.h 2006-06-18 04:54:36 +0200 6986===================================================================
6786+++ linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_dinode.h 2006-09-20 17:01:44 +0200 6987--- linux-2.6.18.orig/fs/jfs/jfs_dinode.h
6988+++ linux-2.6.18/fs/jfs/jfs_dinode.h
6787@@ -162,9 +162,12 @@ struct dinode { 6989@@ -162,9 +162,12 @@ struct dinode {
6788 #define JFS_APPEND_FL 0x01000000 /* writes to file may only append */ 6990 #define JFS_APPEND_FL 0x01000000 /* writes to file may only append */
6789 #define JFS_IMMUTABLE_FL 0x02000000 /* Immutable file */ 6991 #define JFS_IMMUTABLE_FL 0x02000000 /* Immutable file */
6790 6992
6791-#define JFS_FL_USER_VISIBLE 0x03F80000 6993-#define JFS_FL_USER_VISIBLE 0x03F80000
6797-#define JFS_FL_INHERIT 0x03C80000 6999-#define JFS_FL_INHERIT 0x03C80000
6798+#define JFS_FL_INHERIT 0x0BC80000 7000+#define JFS_FL_INHERIT 0x0BC80000
6799 7001
6800 /* These are identical to EXT[23]_IOC_GETFLAGS/SETFLAGS */ 7002 /* These are identical to EXT[23]_IOC_GETFLAGS/SETFLAGS */
6801 #define JFS_IOC_GETFLAGS _IOR('f', 1, long) 7003 #define JFS_IOC_GETFLAGS _IOR('f', 1, long)
6802diff -NurpP --minimal linux-2.6.18.2/fs/jfs/jfs_dtree.c linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_dtree.c 7004Index: linux-2.6.18/fs/jfs/jfs_dtree.c
6803--- linux-2.6.18.2/fs/jfs/jfs_dtree.c 2006-06-18 04:54:36 +0200 7005===================================================================
6804+++ linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_dtree.c 2006-09-25 15:40:02 +0200 7006--- linux-2.6.18.orig/fs/jfs/jfs_dtree.c
7007+++ linux-2.6.18/fs/jfs/jfs_dtree.c
6805@@ -102,6 +102,7 @@ 7008@@ -102,6 +102,7 @@
6806 7009
6807 #include <linux/fs.h> 7010 #include <linux/fs.h>
6808 #include <linux/quotaops.h> 7011 #include <linux/quotaops.h>
6809+#include <linux/vs_dlimit.h> 7012+#include <linux/vs_dlimit.h>
6911+ /* Free dlimit allocation */ 7114+ /* Free dlimit allocation */
6912+ DLIMIT_FREE_BLOCK(ip, xlen); 7115+ DLIMIT_FREE_BLOCK(ip, xlen);
6913 /* Free quota allocation */ 7116 /* Free quota allocation */
6914 DQUOT_FREE_BLOCK(ip, xlen); 7117 DQUOT_FREE_BLOCK(ip, xlen);
6915 7118
6916diff -NurpP --minimal linux-2.6.18.2/fs/jfs/jfs_extent.c linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_extent.c 7119Index: linux-2.6.18/fs/jfs/jfs_extent.c
6917--- linux-2.6.18.2/fs/jfs/jfs_extent.c 2006-09-20 16:58:35 +0200 7120===================================================================
6918+++ linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_extent.c 2006-09-20 17:01:44 +0200 7121--- linux-2.6.18.orig/fs/jfs/jfs_extent.c
7122+++ linux-2.6.18/fs/jfs/jfs_extent.c
6919@@ -18,6 +18,7 @@ 7123@@ -18,6 +18,7 @@
6920 7124
6921 #include <linux/fs.h> 7125 #include <linux/fs.h>
6922 #include <linux/quotaops.h> 7126 #include <linux/quotaops.h>
6923+#include <linux/vs_dlimit.h> 7127+#include <linux/vs_dlimit.h>
6974 dbFree(ip, nxaddr, nxlen); 7178 dbFree(ip, nxaddr, nxlen);
6975+ DLIMIT_FREE_BLOCK(ip, nxlen); 7179+ DLIMIT_FREE_BLOCK(ip, nxlen);
6976 DQUOT_FREE_BLOCK(ip, nxlen); 7180 DQUOT_FREE_BLOCK(ip, nxlen);
6977 goto exit; 7181 goto exit;
6978 } 7182 }
6979diff -NurpP --minimal linux-2.6.18.2/fs/jfs/jfs_filsys.h linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_filsys.h 7183Index: linux-2.6.18/fs/jfs/jfs_filsys.h
6980--- linux-2.6.18.2/fs/jfs/jfs_filsys.h 2005-10-28 20:49:44 +0200 7184===================================================================
6981+++ linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_filsys.h 2006-09-25 15:40:02 +0200 7185--- linux-2.6.18.orig/fs/jfs/jfs_filsys.h
7186+++ linux-2.6.18/fs/jfs/jfs_filsys.h
6982@@ -84,6 +84,7 @@ 7187@@ -84,6 +84,7 @@
6983 #define JFS_DIR_INDEX 0x00200000 /* Persistant index for */ 7188 #define JFS_DIR_INDEX 0x00200000 /* Persistant index for */
6984 /* directory entries */ 7189 /* directory entries */
6985 7190
6986+#define JFS_TAGGED 0x00800000 /* Context Tagging */ 7191+#define JFS_TAGGED 0x00800000 /* Context Tagging */
6987 7192
6988 /* 7193 /*
6989 * buffer cache configuration 7194 * buffer cache configuration
6990diff -NurpP --minimal linux-2.6.18.2/fs/jfs/jfs_imap.c linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_imap.c 7195Index: linux-2.6.18/fs/jfs/jfs_imap.c
6991--- linux-2.6.18.2/fs/jfs/jfs_imap.c 2006-11-04 19:43:23 +0100 7196===================================================================
6992+++ linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_imap.c 2006-11-04 19:12:54 +0100 7197--- linux-2.6.18.orig/fs/jfs/jfs_imap.c
7198+++ linux-2.6.18/fs/jfs/jfs_imap.c
6993@@ -45,6 +45,7 @@ 7199@@ -45,6 +45,7 @@
6994 #include <linux/buffer_head.h> 7200 #include <linux/buffer_head.h>
6995 #include <linux/pagemap.h> 7201 #include <linux/pagemap.h>
6996 #include <linux/quotaops.h> 7202 #include <linux/quotaops.h>
6997+#include <linux/vserver/tag.h> 7203+#include <linux/vserver/tag.h>
7047+ (sbi->gid == -1) ? ip->i_gid : jfs_ip->saved_gid, ip->i_tag)); 7253+ (sbi->gid == -1) ? ip->i_gid : jfs_ip->saved_gid, ip->i_tag));
7048+ 7254+
7049 /* 7255 /*
7050 * mode2 is only needed for storing the higher order bits. 7256 * mode2 is only needed for storing the higher order bits.
7051 * Trust i_mode for the lower order ones 7257 * Trust i_mode for the lower order ones
7052diff -NurpP --minimal linux-2.6.18.2/fs/jfs/jfs_inode.c linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_inode.c 7258Index: linux-2.6.18/fs/jfs/jfs_inode.c
7053--- linux-2.6.18.2/fs/jfs/jfs_inode.c 2006-06-18 04:54:36 +0200 7259===================================================================
7054+++ linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_inode.c 2006-09-25 15:40:02 +0200 7260--- linux-2.6.18.orig/fs/jfs/jfs_inode.c
7261+++ linux-2.6.18/fs/jfs/jfs_inode.c
7055@@ -18,6 +18,8 @@ 7262@@ -18,6 +18,8 @@
7056 7263
7057 #include <linux/fs.h> 7264 #include <linux/fs.h>
7058 #include <linux/quotaops.h> 7265 #include <linux/quotaops.h>
7059+#include <linux/vs_dlimit.h> 7266+#include <linux/vs_dlimit.h>
7141 if (DQUOT_ALLOC_INODE(inode)) { 7348 if (DQUOT_ALLOC_INODE(inode)) {
7142+ DLIMIT_FREE_INODE(inode); 7349+ DLIMIT_FREE_INODE(inode);
7143 DQUOT_DROP(inode); 7350 DQUOT_DROP(inode);
7144 inode->i_flags |= S_NOQUOTA; 7351 inode->i_flags |= S_NOQUOTA;
7145 inode->i_nlink = 0; 7352 inode->i_nlink = 0;
7146diff -NurpP --minimal linux-2.6.18.2/fs/jfs/jfs_inode.h linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_inode.h 7353Index: linux-2.6.18/fs/jfs/jfs_inode.h
7147--- linux-2.6.18.2/fs/jfs/jfs_inode.h 2006-09-20 16:58:35 +0200 7354===================================================================
7148+++ linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_inode.h 2006-09-20 17:01:44 +0200 7355--- linux-2.6.18.orig/fs/jfs/jfs_inode.h
7356+++ linux-2.6.18/fs/jfs/jfs_inode.h
7149@@ -31,6 +31,7 @@ extern void jfs_truncate(struct inode *) 7357@@ -31,6 +31,7 @@ extern void jfs_truncate(struct inode *)
7150 extern void jfs_truncate_nolock(struct inode *, loff_t); 7358 extern void jfs_truncate_nolock(struct inode *, loff_t);
7151 extern void jfs_free_zero_link(struct inode *); 7359 extern void jfs_free_zero_link(struct inode *);
7152 extern struct dentry *jfs_get_parent(struct dentry *dentry); 7360 extern struct dentry *jfs_get_parent(struct dentry *dentry);
7153+extern int jfs_sync_flags(struct inode *); 7361+extern int jfs_sync_flags(struct inode *);
7154 extern void jfs_set_inode_flags(struct inode *); 7362 extern void jfs_set_inode_flags(struct inode *);
7155 extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int); 7363 extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
7156 7364
7157diff -NurpP --minimal linux-2.6.18.2/fs/jfs/jfs_xtree.c linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_xtree.c 7365Index: linux-2.6.18/fs/jfs/jfs_xtree.c
7158--- linux-2.6.18.2/fs/jfs/jfs_xtree.c 2006-01-03 17:29:57 +0100 7366===================================================================
7159+++ linux-2.6.18.2-vs2.1.1/fs/jfs/jfs_xtree.c 2006-09-20 17:01:44 +0200 7367--- linux-2.6.18.orig/fs/jfs/jfs_xtree.c
7368+++ linux-2.6.18/fs/jfs/jfs_xtree.c
7160@@ -21,6 +21,7 @@ 7369@@ -21,6 +21,7 @@
7161 7370
7162 #include <linux/fs.h> 7371 #include <linux/fs.h>
7163 #include <linux/quotaops.h> 7372 #include <linux/quotaops.h>
7164+#include <linux/vs_dlimit.h> 7373+#include <linux/vs_dlimit.h>
7238+ /* update dlimit allocation to reflect freed blocks */ 7447+ /* update dlimit allocation to reflect freed blocks */
7239+ DLIMIT_FREE_BLOCK(ip, nfreed); 7448+ DLIMIT_FREE_BLOCK(ip, nfreed);
7240 /* update quota allocation to reflect freed blocks */ 7449 /* update quota allocation to reflect freed blocks */
7241 DQUOT_FREE_BLOCK(ip, nfreed); 7450 DQUOT_FREE_BLOCK(ip, nfreed);
7242 7451
7243diff -NurpP --minimal linux-2.6.18.2/fs/jfs/namei.c linux-2.6.18.2-vs2.1.1/fs/jfs/namei.c 7452Index: linux-2.6.18/fs/jfs/namei.c
7244--- linux-2.6.18.2/fs/jfs/namei.c 2006-09-20 16:58:35 +0200 7453===================================================================
7245+++ linux-2.6.18.2-vs2.1.1/fs/jfs/namei.c 2006-09-25 15:40:02 +0200 7454--- linux-2.6.18.orig/fs/jfs/namei.c
7455+++ linux-2.6.18/fs/jfs/namei.c
7246@@ -20,6 +20,7 @@ 7456@@ -20,6 +20,7 @@
7247 #include <linux/fs.h> 7457 #include <linux/fs.h>
7248 #include <linux/ctype.h> 7458 #include <linux/ctype.h>
7249 #include <linux/quotaops.h> 7459 #include <linux/quotaops.h>
7250+#include <linux/vserver/tag.h> 7460+#include <linux/vserver/tag.h>
7265 #endif 7475 #endif
7266+ .sync_flags = jfs_sync_flags, 7476+ .sync_flags = jfs_sync_flags,
7267 }; 7477 };
7268 7478
7269 const struct file_operations jfs_dir_operations = { 7479 const struct file_operations jfs_dir_operations = {
7270diff -NurpP --minimal linux-2.6.18.2/fs/jfs/super.c linux-2.6.18.2-vs2.1.1/fs/jfs/super.c 7480Index: linux-2.6.18/fs/jfs/super.c
7271--- linux-2.6.18.2/fs/jfs/super.c 2006-09-20 16:58:35 +0200 7481===================================================================
7272+++ linux-2.6.18.2-vs2.1.1/fs/jfs/super.c 2006-09-25 19:19:06 +0200 7482--- linux-2.6.18.orig/fs/jfs/super.c
7483+++ linux-2.6.18/fs/jfs/super.c
7273@@ -194,7 +194,8 @@ static void jfs_put_super(struct super_b 7484@@ -194,7 +194,8 @@ static void jfs_put_super(struct super_b
7274 enum { 7485 enum {
7275 Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize, 7486 Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize,
7276 Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err, Opt_quota, 7487 Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err, Opt_quota,
7277- Opt_usrquota, Opt_grpquota, Opt_uid, Opt_gid, Opt_umask 7488- Opt_usrquota, Opt_grpquota, Opt_uid, Opt_gid, Opt_umask
7362+ struct inode *inode = dqh_dqopt(hash)->files[type]; 7573+ struct inode *inode = dqh_dqopt(hash)->files[type];
7363+ struct super_block *sb = hash->dqh_sb; 7574+ struct super_block *sb = hash->dqh_sb;
7364 sector_t blk = off >> sb->s_blocksize_bits; 7575 sector_t blk = off >> sb->s_blocksize_bits;
7365 int err = 0; 7576 int err = 0;
7366 int offset = off & (sb->s_blocksize - 1); 7577 int offset = off & (sb->s_blocksize - 1);
7367diff -NurpP --minimal linux-2.6.18.2/fs/jfs/xattr.c linux-2.6.18.2-vs2.1.1/fs/jfs/xattr.c 7578Index: linux-2.6.18/fs/jfs/xattr.c
7368--- linux-2.6.18.2/fs/jfs/xattr.c 2006-06-18 04:54:36 +0200 7579===================================================================
7369+++ linux-2.6.18.2-vs2.1.1/fs/jfs/xattr.c 2006-09-20 17:01:44 +0200 7580--- linux-2.6.18.orig/fs/jfs/xattr.c
7581+++ linux-2.6.18/fs/jfs/xattr.c
7370@@ -23,6 +23,7 @@ 7582@@ -23,6 +23,7 @@
7371 #include <linux/posix_acl_xattr.h> 7583 #include <linux/posix_acl_xattr.h>
7372 #include <linux/quotaops.h> 7584 #include <linux/quotaops.h>
7373 #include <linux/security.h> 7585 #include <linux/security.h>
7374+#include <linux/vs_dlimit.h> 7586+#include <linux/vs_dlimit.h>
7442 DQUOT_FREE_BLOCK(inode, old_blocks); 7654 DQUOT_FREE_BLOCK(inode, old_blocks);
7443+ } 7655+ }
7444 7656
7445 inode->i_ctime = CURRENT_TIME; 7657 inode->i_ctime = CURRENT_TIME;
7446 7658
7447diff -NurpP --minimal linux-2.6.18.2/fs/libfs.c linux-2.6.18.2-vs2.1.1/fs/libfs.c 7659Index: linux-2.6.18/fs/libfs.c
7448--- linux-2.6.18.2/fs/libfs.c 2006-09-20 16:58:35 +0200 7660===================================================================
7449+++ linux-2.6.18.2-vs2.1.1/fs/libfs.c 2006-09-20 17:01:44 +0200 7661--- linux-2.6.18.orig/fs/libfs.c
7662+++ linux-2.6.18/fs/libfs.c
7450@@ -124,7 +124,8 @@ static inline unsigned char dt_type(stru 7663@@ -124,7 +124,8 @@ static inline unsigned char dt_type(stru
7451 * both impossible due to the lock on directory. 7664 * both impossible due to the lock on directory.
7452 */ 7665 */
7453 7666
7454-int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir) 7667-int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
7491 EXPORT_SYMBOL(dcache_readdir); 7704 EXPORT_SYMBOL(dcache_readdir);
7492+EXPORT_SYMBOL(dcache_readdir_filter); 7705+EXPORT_SYMBOL(dcache_readdir_filter);
7493 EXPORT_SYMBOL(generic_read_dir); 7706 EXPORT_SYMBOL(generic_read_dir);
7494 EXPORT_SYMBOL(get_sb_pseudo); 7707 EXPORT_SYMBOL(get_sb_pseudo);
7495 EXPORT_SYMBOL(simple_commit_write); 7708 EXPORT_SYMBOL(simple_commit_write);
7496diff -NurpP --minimal linux-2.6.18.2/fs/lockd/clntproc.c linux-2.6.18.2-vs2.1.1/fs/lockd/clntproc.c 7709Index: linux-2.6.18/fs/lockd/clntproc.c
7497--- linux-2.6.18.2/fs/lockd/clntproc.c 2006-09-20 16:58:35 +0200 7710===================================================================
7498+++ linux-2.6.18.2-vs2.1.1/fs/lockd/clntproc.c 2006-09-25 15:40:02 +0200 7711--- linux-2.6.18.orig/fs/lockd/clntproc.c
7712+++ linux-2.6.18/fs/lockd/clntproc.c
7499@@ -13,6 +13,7 @@ 7713@@ -13,6 +13,7 @@
7500 #include <linux/nfs_fs.h> 7714 #include <linux/nfs_fs.h>
7501 #include <linux/utsname.h> 7715 #include <linux/utsname.h>
7502 #include <linux/smp_lock.h> 7716 #include <linux/smp_lock.h>
7503+#include <linux/vs_cvirt.h> 7717+#include <linux/vs_cvirt.h>
7516- system_utsname.nodename); 7730- system_utsname.nodename);
7517+ vx_new_uts(nodename)); 7731+ vx_new_uts(nodename));
7518 lock->svid = fl->fl_u.nfs_fl.owner->pid; 7732 lock->svid = fl->fl_u.nfs_fl.owner->pid;
7519 lock->fl.fl_start = fl->fl_start; 7733 lock->fl.fl_start = fl->fl_start;
7520 lock->fl.fl_end = fl->fl_end; 7734 lock->fl.fl_end = fl->fl_end;
7521diff -NurpP --minimal linux-2.6.18.2/fs/lockd/mon.c linux-2.6.18.2-vs2.1.1/fs/lockd/mon.c 7735Index: linux-2.6.18/fs/lockd/mon.c
7522--- linux-2.6.18.2/fs/lockd/mon.c 2006-06-18 04:54:37 +0200 7736===================================================================
7523+++ linux-2.6.18.2-vs2.1.1/fs/lockd/mon.c 2006-09-25 15:40:02 +0200 7737--- linux-2.6.18.orig/fs/lockd/mon.c
7738+++ linux-2.6.18/fs/lockd/mon.c
7524@@ -13,6 +13,7 @@ 7739@@ -13,6 +13,7 @@
7525 #include <linux/sunrpc/svc.h> 7740 #include <linux/sunrpc/svc.h>
7526 #include <linux/lockd/lockd.h> 7741 #include <linux/lockd/lockd.h>
7527 #include <linux/lockd/sm_inter.h> 7742 #include <linux/lockd/sm_inter.h>
7528+#include <linux/vs_cvirt.h> 7743+#include <linux/vs_cvirt.h>
7536- || !(p = xdr_encode_string(p, system_utsname.nodename))) 7751- || !(p = xdr_encode_string(p, system_utsname.nodename)))
7537+ || !(p = xdr_encode_string(p, vx_new_uts(nodename)))) 7752+ || !(p = xdr_encode_string(p, vx_new_uts(nodename))))
7538 return ERR_PTR(-EIO); 7753 return ERR_PTR(-EIO);
7539 *p++ = htonl(argp->prog); 7754 *p++ = htonl(argp->prog);
7540 *p++ = htonl(argp->vers); 7755 *p++ = htonl(argp->vers);
7541diff -NurpP --minimal linux-2.6.18.2/fs/locks.c linux-2.6.18.2-vs2.1.1/fs/locks.c 7756Index: linux-2.6.18/fs/locks.c
7542--- linux-2.6.18.2/fs/locks.c 2006-09-20 16:58:35 +0200 7757===================================================================
7543+++ linux-2.6.18.2-vs2.1.1/fs/locks.c 2006-09-25 15:40:02 +0200 7758--- linux-2.6.18.orig/fs/locks.c
7759+++ linux-2.6.18/fs/locks.c
7544@@ -125,6 +125,7 @@ 7760@@ -125,6 +125,7 @@
7545 #include <linux/syscalls.h> 7761 #include <linux/syscalls.h>
7546 #include <linux/time.h> 7762 #include <linux/time.h>
7547 #include <linux/rcupdate.h> 7763 #include <linux/rcupdate.h>
7548+#include <linux/vs_limit.h> 7764+#include <linux/vs_limit.h>
7715+ continue; 7931+ continue;
7716+ 7932+
7717 lock_get_status(q, fl, ++i, ""); 7933 lock_get_status(q, fl, ++i, "");
7718 move_lock_status(&q, &pos, offset); 7934 move_lock_status(&q, &pos, offset);
7719 7935
7720diff -NurpP --minimal linux-2.6.18.2/fs/namei.c linux-2.6.18.2-vs2.1.1/fs/namei.c 7936Index: linux-2.6.18/fs/namei.c
7721--- linux-2.6.18.2/fs/namei.c 2006-09-20 16:58:35 +0200 7937===================================================================
7722+++ linux-2.6.18.2-vs2.1.1/fs/namei.c 2006-11-04 08:24:09 +0100 7938--- linux-2.6.18.orig/fs/namei.c
7939+++ linux-2.6.18/fs/namei.c
7723@@ -32,6 +32,11 @@ 7940@@ -32,6 +32,11 @@
7724 #include <linux/file.h> 7941 #include <linux/file.h>
7725 #include <linux/fcntl.h> 7942 #include <linux/fcntl.h>
7726 #include <linux/namei.h> 7943 #include <linux/namei.h>
7727+#include <linux/proc_fs.h> 7944+#include <linux/proc_fs.h>
8239+#endif 8456+#endif
8240+ 8457+
8241 /* get the link contents into pagecache */ 8458 /* get the link contents into pagecache */
8242 static char *page_getlink(struct dentry * dentry, struct page **ppage) 8459 static char *page_getlink(struct dentry * dentry, struct page **ppage)
8243 { 8460 {
8244diff -NurpP --minimal linux-2.6.18.2/fs/namespace.c linux-2.6.18.2-vs2.1.1/fs/namespace.c 8461Index: linux-2.6.18/fs/namespace.c
8245--- linux-2.6.18.2/fs/namespace.c 2006-09-20 16:58:35 +0200 8462===================================================================
8246+++ linux-2.6.18.2-vs2.1.1/fs/namespace.c 2006-09-25 15:40:02 +0200 8463--- linux-2.6.18.orig/fs/namespace.c
8464+++ linux-2.6.18/fs/namespace.c
8247@@ -22,6 +22,8 @@ 8465@@ -22,6 +22,8 @@
8248 #include <linux/namei.h> 8466 #include <linux/namei.h>
8249 #include <linux/security.h> 8467 #include <linux/security.h>
8250 #include <linux/mount.h> 8468 #include <linux/mount.h>
8251+#include <linux/vserver/namespace.h> 8469+#include <linux/vserver/namespace.h>
8305 } fs_info[] = { 8523 } fs_info[] = {
8306- { MS_SYNCHRONOUS, ",sync" }, 8524- { MS_SYNCHRONOUS, ",sync" },
8307- { MS_DIRSYNC, ",dirsync" }, 8525- { MS_DIRSYNC, ",dirsync" },
8308- { MS_MANDLOCK, ",mand" }, 8526- { MS_MANDLOCK, ",mand" },
8309- { 0, NULL } 8527- { 0, NULL }
8310- };
8311- static struct proc_fs_info mnt_info[] = {
8312- { MNT_NOSUID, ",nosuid" },
8313- { MNT_NODEV, ",nodev" },
8314- { MNT_NOEXEC, ",noexec" },
8315- { MNT_NOATIME, ",noatime" },
8316- { MNT_NODIRATIME, ",nodiratime" },
8317- { 0, NULL }
8318+ { MS_RDONLY, MNT_RDONLY, "ro", "rw" }, 8528+ { MS_RDONLY, MNT_RDONLY, "ro", "rw" },
8319+ { MS_SYNCHRONOUS, 0, ",sync", NULL }, 8529+ { MS_SYNCHRONOUS, 0, ",sync", NULL },
8320+ { MS_DIRSYNC, 0, ",dirsync", NULL }, 8530+ { MS_DIRSYNC, 0, ",dirsync", NULL },
8321+ { MS_MANDLOCK, 0, ",mand", NULL }, 8531+ { MS_MANDLOCK, 0, ",mand", NULL },
8322+ { MS_TAGGED, 0, ",tag", NULL }, 8532+ { MS_TAGGED, 0, ",tag", NULL },
8325+ { 0, MNT_NOSUID, ",nosuid", NULL }, 8535+ { 0, MNT_NOSUID, ",nosuid", NULL },
8326+ { 0, MNT_NODEV, ",nodev", NULL }, 8536+ { 0, MNT_NODEV, ",nodev", NULL },
8327+ { 0, MNT_NOEXEC, ",noexec", NULL }, 8537+ { 0, MNT_NOEXEC, ",noexec", NULL },
8328+ { 0, 0, NULL, NULL } 8538+ { 0, 0, NULL, NULL }
8329 }; 8539 };
8540- static struct proc_fs_info mnt_info[] = {
8541- { MNT_NOSUID, ",nosuid" },
8542- { MNT_NODEV, ",nodev" },
8543- { MNT_NOEXEC, ",noexec" },
8544- { MNT_NOATIME, ",noatime" },
8545- { MNT_NODIRATIME, ",nodiratime" },
8546- { 0, NULL }
8547- };
8330- struct proc_fs_info *fs_infop; 8548- struct proc_fs_info *fs_infop;
8331+ struct proc_fs_info *p; 8549+ struct proc_fs_info *p;
8332+ unsigned long s_flags = mnt->mnt_sb->s_flags; 8550+ unsigned long s_flags = mnt->mnt_sb->s_flags;
8333+ int mnt_flags = mnt->mnt_flags; 8551+ int mnt_flags = mnt->mnt_flags;
8334 8552
8335- mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); 8553- mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
8336- seq_putc(m, ' '); 8554- seq_putc(m, ' ');
8337- seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); 8555- seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
8338- seq_putc(m, ' '); 8556- seq_putc(m, ' ');
8339- mangle(m, mnt->mnt_sb->s_type->name);
8340- seq_puts(m, mnt->mnt_sb->s_flags & MS_RDONLY ? " ro" : " rw");
8341- for (fs_infop = fs_info; fs_infop->flag; fs_infop++) {
8342- if (mnt->mnt_sb->s_flags & fs_infop->flag)
8343- seq_puts(m, fs_infop->str);
8344+ if (vx_flags(VXF_HIDE_MOUNT, 0)) 8557+ if (vx_flags(VXF_HIDE_MOUNT, 0))
8345+ return 0; 8558+ return 0;
8346+ if (!mnt_is_reachable(mnt) && !vx_check(0, VX_WATCH_P)) 8559+ if (!mnt_is_reachable(mnt) && !vx_check(0, VX_WATCH_P))
8347+ return 0; 8560+ return 0;
8348+ 8561+
8352+ } else { 8565+ } else {
8353+ mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); 8566+ mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
8354+ seq_putc(m, ' '); 8567+ seq_putc(m, ' ');
8355+ seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); 8568+ seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
8356+ seq_putc(m, ' '); 8569+ seq_putc(m, ' ');
8357 } 8570+ }
8571 mangle(m, mnt->mnt_sb->s_type->name);
8572- seq_puts(m, mnt->mnt_sb->s_flags & MS_RDONLY ? " ro" : " rw");
8573- for (fs_infop = fs_info; fs_infop->flag; fs_infop++) {
8574- if (mnt->mnt_sb->s_flags & fs_infop->flag)
8575- seq_puts(m, fs_infop->str);
8576- }
8358- for (fs_infop = mnt_info; fs_infop->flag; fs_infop++) { 8577- for (fs_infop = mnt_info; fs_infop->flag; fs_infop++) {
8359- if (mnt->mnt_flags & fs_infop->flag) 8578- if (mnt->mnt_flags & fs_infop->flag)
8360- seq_puts(m, fs_infop->str); 8579- seq_puts(m, fs_infop->str);
8361+ mangle(m, mnt->mnt_sb->s_type->name);
8362+ seq_putc(m, ' '); 8580+ seq_putc(m, ' ');
8363+ for (p = fs_info; (p->s_flag | p->mnt_flag) ; p++) { 8581+ for (p = fs_info; (p->s_flag | p->mnt_flag) ; p++) {
8364+ if ((s_flags & p->s_flag) || (mnt_flags & p->mnt_flag)) { 8582+ if ((s_flags & p->s_flag) || (mnt_flags & p->mnt_flag)) {
8365+ if (p->set_str) 8583+ if (p->set_str)
8366+ seq_puts(m, p->set_str); 8584+ seq_puts(m, p->set_str);
8382- if (mnt->mnt_devname) { 8600- if (mnt->mnt_devname) {
8383- seq_puts(m, "device "); 8601- seq_puts(m, "device ");
8384- mangle(m, mnt->mnt_devname); 8602- mangle(m, mnt->mnt_devname);
8385- } else 8603- } else
8386- seq_puts(m, "no device"); 8604- seq_puts(m, "no device");
8605-
8606- /* mount point */
8607- seq_puts(m, " mounted on ");
8608- seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
8609- seq_putc(m, ' ');
8387+ if (vx_flags(VXF_HIDE_MOUNT, 0)) 8610+ if (vx_flags(VXF_HIDE_MOUNT, 0))
8388+ return 0; 8611+ return 0;
8389+ if (!mnt_is_reachable(mnt) && !vx_check(0, VX_WATCH_P)) 8612+ if (!mnt_is_reachable(mnt) && !vx_check(0, VX_WATCH_P))
8390+ return 0; 8613+ return 0;
8391 8614+
8392- /* mount point */
8393- seq_puts(m, " mounted on ");
8394- seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
8395- seq_putc(m, ' ');
8396+ if (!vx_check(0, VX_ADMIN|VX_WATCH) && 8615+ if (!vx_check(0, VX_ADMIN|VX_WATCH) &&
8397+ mnt == current->fs->rootmnt) { 8616+ mnt == current->fs->rootmnt) {
8398+ seq_puts(m, "device /dev/root mounted on / "); 8617+ seq_puts(m, "device /dev/root mounted on / ");
8399+ } else { 8618+ } else {
8400+ /* device */ 8619+ /* device */
8564- if (!capable(CAP_SYS_ADMIN)) { 8783- if (!capable(CAP_SYS_ADMIN)) {
8565+ if (!vx_capable(CAP_SYS_ADMIN, VXC_SECURE_MOUNT)) { 8784+ if (!vx_capable(CAP_SYS_ADMIN, VXC_SECURE_MOUNT)) {
8566 err = -EPERM; 8785 err = -EPERM;
8567 goto out; 8786 goto out;
8568 } 8787 }
8569diff -NurpP --minimal linux-2.6.18.2/fs/nfs/dir.c linux-2.6.18.2-vs2.1.1/fs/nfs/dir.c 8788Index: linux-2.6.18/fs/nfs/dir.c
8570--- linux-2.6.18.2/fs/nfs/dir.c 2006-11-04 19:43:23 +0100 8789===================================================================
8571+++ linux-2.6.18.2-vs2.1.1/fs/nfs/dir.c 2006-11-04 19:12:54 +0100 8790--- linux-2.6.18.orig/fs/nfs/dir.c
8791+++ linux-2.6.18/fs/nfs/dir.c
8572@@ -28,9 +28,11 @@ 8792@@ -28,9 +28,11 @@
8573 #include <linux/sunrpc/clnt.h> 8793 #include <linux/sunrpc/clnt.h>
8574 #include <linux/nfs_fs.h> 8794 #include <linux/nfs_fs.h>
8575 #include <linux/nfs_mount.h> 8795 #include <linux/nfs_mount.h>
8576+#include <linux/mount.h> 8796+#include <linux/mount.h>
8597+ if ((IS_RDONLY(dir) || MNT_IS_RDONLY(nd->mnt)) && 8817+ if ((IS_RDONLY(dir) || MNT_IS_RDONLY(nd->mnt)) &&
8598+ (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE))) 8818+ (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
8599 return 0; 8819 return 0;
8600 return 1; 8820 return 1;
8601 } 8821 }
8602diff -NurpP --minimal linux-2.6.18.2/fs/nfs/inode.c linux-2.6.18.2-vs2.1.1/fs/nfs/inode.c 8822Index: linux-2.6.18/fs/nfs/inode.c
8603--- linux-2.6.18.2/fs/nfs/inode.c 2006-09-20 16:58:35 +0200 8823===================================================================
8604+++ linux-2.6.18.2-vs2.1.1/fs/nfs/inode.c 2006-09-25 17:21:31 +0200 8824--- linux-2.6.18.orig/fs/nfs/inode.c
8825+++ linux-2.6.18/fs/nfs/inode.c
8605@@ -37,6 +37,7 @@ 8826@@ -37,6 +37,7 @@
8606 #include <linux/vfs.h> 8827 #include <linux/vfs.h>
8607 #include <linux/inet.h> 8828 #include <linux/inet.h>
8608 #include <linux/nfs_xdr.h> 8829 #include <linux/nfs_xdr.h>
8609+#include <linux/vserver/tag.h> 8830+#include <linux/vserver/tag.h>
8694+ inode->i_gid = gid; 8915+ inode->i_gid = gid;
8695+ inode->i_tag = tag; 8916+ inode->i_tag = tag;
8696 8917
8697 if (fattr->valid & (NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4)) { 8918 if (fattr->valid & (NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4)) {
8698 /* 8919 /*
8699diff -NurpP --minimal linux-2.6.18.2/fs/nfs/nfs3xdr.c linux-2.6.18.2-vs2.1.1/fs/nfs/nfs3xdr.c 8920Index: linux-2.6.18/fs/nfs/nfs3xdr.c
8700--- linux-2.6.18.2/fs/nfs/nfs3xdr.c 2006-09-20 16:58:35 +0200 8921===================================================================
8701+++ linux-2.6.18.2-vs2.1.1/fs/nfs/nfs3xdr.c 2006-09-25 17:24:34 +0200 8922--- linux-2.6.18.orig/fs/nfs/nfs3xdr.c
8923+++ linux-2.6.18/fs/nfs/nfs3xdr.c
8702@@ -22,6 +22,7 @@ 8924@@ -22,6 +22,7 @@
8703 #include <linux/nfs3.h> 8925 #include <linux/nfs3.h>
8704 #include <linux/nfs_fs.h> 8926 #include <linux/nfs_fs.h>
8705 #include <linux/nfsacl.h> 8927 #include <linux/nfsacl.h>
8706+#include <linux/vserver/tag.h> 8928+#include <linux/vserver/tag.h>
8786+ p = xdr_encode_sattr(p, args->sattr, 9008+ p = xdr_encode_sattr(p, args->sattr,
8787+ req->rq_task->tk_client->cl_tag); 9009+ req->rq_task->tk_client->cl_tag);
8788 if (args->type == NF3CHR || args->type == NF3BLK) { 9010 if (args->type == NF3CHR || args->type == NF3BLK) {
8789 *p++ = htonl(MAJOR(args->rdev)); 9011 *p++ = htonl(MAJOR(args->rdev));
8790 *p++ = htonl(MINOR(args->rdev)); 9012 *p++ = htonl(MINOR(args->rdev));
8791diff -NurpP --minimal linux-2.6.18.2/fs/nfs/nfsroot.c linux-2.6.18.2-vs2.1.1/fs/nfs/nfsroot.c 9013Index: linux-2.6.18/fs/nfs/nfsroot.c
8792--- linux-2.6.18.2/fs/nfs/nfsroot.c 2006-02-18 14:40:23 +0100 9014===================================================================
8793+++ linux-2.6.18.2-vs2.1.1/fs/nfs/nfsroot.c 2006-09-25 15:40:02 +0200 9015--- linux-2.6.18.orig/fs/nfs/nfsroot.c
9016+++ linux-2.6.18/fs/nfs/nfsroot.c
8794@@ -87,6 +87,7 @@ 9017@@ -87,6 +87,7 @@
8795 #include <linux/root_dev.h> 9018 #include <linux/root_dev.h>
8796 #include <net/ipconfig.h> 9019 #include <net/ipconfig.h>
8797 #include <linux/parser.h> 9020 #include <linux/parser.h>
8798+#include <linux/vs_cvirt.h> 9021+#include <linux/vs_cvirt.h>
8853- cp = system_utsname.nodename; 9076- cp = system_utsname.nodename;
8854+ cp = vx_new_uts(nodename); 9077+ cp = vx_new_uts(nodename);
8855 if (strlen(buf) + strlen(cp) > NFS_MAXPATHLEN) { 9078 if (strlen(buf) + strlen(cp) > NFS_MAXPATHLEN) {
8856 printk(KERN_ERR "Root-NFS: Pathname for remote directory too long.\n"); 9079 printk(KERN_ERR "Root-NFS: Pathname for remote directory too long.\n");
8857 return -1; 9080 return -1;
8858diff -NurpP --minimal linux-2.6.18.2/fs/nfs/super.c linux-2.6.18.2-vs2.1.1/fs/nfs/super.c 9081Index: linux-2.6.18/fs/nfs/super.c
8859--- linux-2.6.18.2/fs/nfs/super.c 2006-09-20 16:58:35 +0200 9082===================================================================
8860+++ linux-2.6.18.2-vs2.1.1/fs/nfs/super.c 2006-09-25 19:20:51 +0200 9083--- linux-2.6.18.orig/fs/nfs/super.c
9084+++ linux-2.6.18/fs/nfs/super.c
8861@@ -40,6 +40,7 @@ 9085@@ -40,6 +40,7 @@
8862 #include <linux/vfs.h> 9086 #include <linux/vfs.h>
8863 #include <linux/inet.h> 9087 #include <linux/inet.h>
8864 #include <linux/nfs_xdr.h> 9088 #include <linux/nfs_xdr.h>
8865+#include <linux/vserver/tag.h> 9089+#include <linux/vserver/tag.h>
8895 clnt->cl_softrtry = 1; 9119 clnt->cl_softrtry = 1;
8896+ clnt->cl_tag = 1; 9120+ clnt->cl_tag = 1;
8897 9121
8898 return clnt; 9122 return clnt;
8899 9123
8900diff -NurpP --minimal linux-2.6.18.2/fs/nfsd/auth.c linux-2.6.18.2-vs2.1.1/fs/nfsd/auth.c 9124Index: linux-2.6.18/fs/nfsd/auth.c
8901--- linux-2.6.18.2/fs/nfsd/auth.c 2006-06-18 04:54:42 +0200 9125===================================================================
8902+++ linux-2.6.18.2-vs2.1.1/fs/nfsd/auth.c 2006-09-25 15:40:02 +0200 9126--- linux-2.6.18.orig/fs/nfsd/auth.c
9127+++ linux-2.6.18/fs/nfsd/auth.c
8903@@ -9,6 +9,7 @@ 9128@@ -9,6 +9,7 @@
8904 #include <linux/sunrpc/svc.h> 9129 #include <linux/sunrpc/svc.h>
8905 #include <linux/sunrpc/svcauth.h> 9130 #include <linux/sunrpc/svcauth.h>
8906 #include <linux/nfsd/nfsd.h> 9131 #include <linux/nfsd/nfsd.h>
8907+#include <linux/vserver/tag.h> 9132+#include <linux/vserver/tag.h>
8932- if ((cred.cr_uid)) { 9157- if ((cred.cr_uid)) {
8933+ if (INOTAG_UID(DX_TAG_NFSD, cred.cr_uid, cred.cr_gid)) { 9158+ if (INOTAG_UID(DX_TAG_NFSD, cred.cr_uid, cred.cr_gid)) {
8934 cap_t(current->cap_effective) &= ~CAP_NFSD_MASK; 9159 cap_t(current->cap_effective) &= ~CAP_NFSD_MASK;
8935 } else { 9160 } else {
8936 cap_t(current->cap_effective) |= (CAP_NFSD_MASK & 9161 cap_t(current->cap_effective) |= (CAP_NFSD_MASK &
8937diff -NurpP --minimal linux-2.6.18.2/fs/nfsd/nfs3xdr.c linux-2.6.18.2-vs2.1.1/fs/nfsd/nfs3xdr.c 9162Index: linux-2.6.18/fs/nfsd/nfs3xdr.c
8938--- linux-2.6.18.2/fs/nfsd/nfs3xdr.c 2006-04-09 13:49:54 +0200 9163===================================================================
8939+++ linux-2.6.18.2-vs2.1.1/fs/nfsd/nfs3xdr.c 2006-09-25 15:40:02 +0200 9164--- linux-2.6.18.orig/fs/nfsd/nfs3xdr.c
9165+++ linux-2.6.18/fs/nfsd/nfs3xdr.c
8940@@ -21,6 +21,7 @@ 9166@@ -21,6 +21,7 @@
8941 #include <linux/sunrpc/svc.h> 9167 #include <linux/sunrpc/svc.h>
8942 #include <linux/nfsd/nfsd.h> 9168 #include <linux/nfsd/nfsd.h>
8943 #include <linux/nfsd/xdr3.h> 9169 #include <linux/nfsd/xdr3.h>
8944+#include <linux/vserver/tag.h> 9170+#include <linux/vserver/tag.h>
8983+ *p++ = htonl((u32) nfsd_rgid(rqstp, 9209+ *p++ = htonl((u32) nfsd_rgid(rqstp,
8984+ TAGINO_GID(DX_TAG(dentry->d_inode), stat->gid, stat->tag))); 9210+ TAGINO_GID(DX_TAG(dentry->d_inode), stat->gid, stat->tag)));
8985 if (S_ISLNK(stat->mode) && stat->size > NFS3_MAXPATHLEN) { 9211 if (S_ISLNK(stat->mode) && stat->size > NFS3_MAXPATHLEN) {
8986 p = xdr_encode_hyper(p, (u64) NFS3_MAXPATHLEN); 9212 p = xdr_encode_hyper(p, (u64) NFS3_MAXPATHLEN);
8987 } else { 9213 } else {
8988diff -NurpP --minimal linux-2.6.18.2/fs/nfsd/nfs4recover.c linux-2.6.18.2-vs2.1.1/fs/nfsd/nfs4recover.c 9214Index: linux-2.6.18/fs/nfsd/nfs4recover.c
8989--- linux-2.6.18.2/fs/nfsd/nfs4recover.c 2006-02-18 14:40:23 +0100 9215===================================================================
8990+++ linux-2.6.18.2-vs2.1.1/fs/nfsd/nfs4recover.c 2006-09-20 17:01:44 +0200 9216--- linux-2.6.18.orig/fs/nfsd/nfs4recover.c
9217+++ linux-2.6.18/fs/nfsd/nfs4recover.c
8991@@ -155,7 +155,7 @@ nfsd4_create_clid_dir(struct nfs4_client 9218@@ -155,7 +155,7 @@ nfsd4_create_clid_dir(struct nfs4_client
8992 dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n"); 9219 dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n");
8993 goto out_put; 9220 goto out_put;
8994 } 9221 }
8995- status = vfs_mkdir(rec_dir.dentry->d_inode, dentry, S_IRWXU); 9222- status = vfs_mkdir(rec_dir.dentry->d_inode, dentry, S_IRWXU);
9013- status = vfs_rmdir(dir->d_inode, dentry); 9240- status = vfs_rmdir(dir->d_inode, dentry);
9014+ status = vfs_rmdir(dir->d_inode, dentry, NULL); 9241+ status = vfs_rmdir(dir->d_inode, dentry, NULL);
9015 mutex_unlock(&dir->d_inode->i_mutex); 9242 mutex_unlock(&dir->d_inode->i_mutex);
9016 return status; 9243 return status;
9017 } 9244 }
9018diff -NurpP --minimal linux-2.6.18.2/fs/nfsd/nfs4xdr.c linux-2.6.18.2-vs2.1.1/fs/nfsd/nfs4xdr.c 9245Index: linux-2.6.18/fs/nfsd/nfs4xdr.c
9019--- linux-2.6.18.2/fs/nfsd/nfs4xdr.c 2006-09-20 16:58:35 +0200 9246===================================================================
9020+++ linux-2.6.18.2-vs2.1.1/fs/nfsd/nfs4xdr.c 2006-09-25 15:40:02 +0200 9247--- linux-2.6.18.orig/fs/nfsd/nfs4xdr.c
9248+++ linux-2.6.18/fs/nfsd/nfs4xdr.c
9021@@ -57,6 +57,7 @@ 9249@@ -57,6 +57,7 @@
9022 #include <linux/nfsd_idmap.h> 9250 #include <linux/nfsd_idmap.h>
9023 #include <linux/nfs4.h> 9251 #include <linux/nfs4.h>
9024 #include <linux/nfs4_acl.h> 9252 #include <linux/nfs4_acl.h>
9025+#include <linux/vserver/tag.h> 9253+#include <linux/vserver/tag.h>
9045+ TAGINO_GID(DX_TAG(dentry->d_inode), 9273+ TAGINO_GID(DX_TAG(dentry->d_inode),
9046+ stat.gid, stat.tag), &p, &buflen); 9274+ stat.gid, stat.tag), &p, &buflen);
9047 if (status == nfserr_resource) 9275 if (status == nfserr_resource)
9048 goto out_resource; 9276 goto out_resource;
9049 if (status) 9277 if (status)
9050diff -NurpP --minimal linux-2.6.18.2/fs/nfsd/nfsxdr.c linux-2.6.18.2-vs2.1.1/fs/nfsd/nfsxdr.c 9278Index: linux-2.6.18/fs/nfsd/nfsxdr.c
9051--- linux-2.6.18.2/fs/nfsd/nfsxdr.c 2006-04-09 13:49:54 +0200 9279===================================================================
9052+++ linux-2.6.18.2-vs2.1.1/fs/nfsd/nfsxdr.c 2006-09-25 15:40:02 +0200 9280--- linux-2.6.18.orig/fs/nfsd/nfsxdr.c
9281+++ linux-2.6.18/fs/nfsd/nfsxdr.c
9053@@ -15,6 +15,7 @@ 9282@@ -15,6 +15,7 @@
9054 #include <linux/nfsd/nfsd.h> 9283 #include <linux/nfsd/nfsd.h>
9055 #include <linux/nfsd/xdr.h> 9284 #include <linux/nfsd/xdr.h>
9056 #include <linux/mm.h> 9285 #include <linux/mm.h>
9057+#include <linux/vserver/tag.h> 9286+#include <linux/vserver/tag.h>
9096+ *p++ = htonl((u32) nfsd_rgid(rqstp, 9325+ *p++ = htonl((u32) nfsd_rgid(rqstp,
9097+ TAGINO_GID(DX_TAG(dentry->d_inode), stat->gid, stat->tag))); 9326+ TAGINO_GID(DX_TAG(dentry->d_inode), stat->gid, stat->tag)));
9098 9327
9099 if (S_ISLNK(type) && stat->size > NFS_MAXPATHLEN) { 9328 if (S_ISLNK(type) && stat->size > NFS_MAXPATHLEN) {
9100 *p++ = htonl(NFS_MAXPATHLEN); 9329 *p++ = htonl(NFS_MAXPATHLEN);
9101diff -NurpP --minimal linux-2.6.18.2/fs/nfsd/vfs.c linux-2.6.18.2-vs2.1.1/fs/nfsd/vfs.c 9330Index: linux-2.6.18/fs/nfsd/vfs.c
9102--- linux-2.6.18.2/fs/nfsd/vfs.c 2006-09-20 16:58:35 +0200 9331===================================================================
9103+++ linux-2.6.18.2-vs2.1.1/fs/nfsd/vfs.c 2006-09-20 17:01:44 +0200 9332--- linux-2.6.18.orig/fs/nfsd/vfs.c
9333+++ linux-2.6.18/fs/nfsd/vfs.c
9104@@ -1158,13 +1158,13 @@ nfsd_create(struct svc_rqst *rqstp, stru 9334@@ -1158,13 +1158,13 @@ nfsd_create(struct svc_rqst *rqstp, stru
9105 err = vfs_create(dirp, dchild, iap->ia_mode, NULL); 9335 err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
9106 break; 9336 break;
9107 case S_IFDIR: 9337 case S_IFDIR:
9108- err = vfs_mkdir(dirp, dchild, iap->ia_mode); 9338- err = vfs_mkdir(dirp, dchild, iap->ia_mode);
9162+ if (EX_RDONLY(exp) || IS_RDONLY(inode) 9392+ if (EX_RDONLY(exp) || IS_RDONLY(inode)
9163+ || MNT_IS_RDONLY(exp->ex_mnt)) 9393+ || MNT_IS_RDONLY(exp->ex_mnt))
9164 return nfserr_rofs; 9394 return nfserr_rofs;
9165 if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode)) 9395 if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
9166 return nfserr_perm; 9396 return nfserr_perm;
9167diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/Makefile linux-2.6.18.2-vs2.1.1/fs/ocfs2/Makefile 9397Index: linux-2.6.18/fs/ocfs2/Makefile
9168--- linux-2.6.18.2/fs/ocfs2/Makefile 2006-01-18 06:08:34 +0100 9398===================================================================
9169+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/Makefile 2006-09-25 15:40:02 +0200 9399--- linux-2.6.18.orig/fs/ocfs2/Makefile
9400+++ linux-2.6.18/fs/ocfs2/Makefile
9170@@ -16,6 +16,7 @@ ocfs2-objs := \ 9401@@ -16,6 +16,7 @@ ocfs2-objs := \
9171 file.o \ 9402 file.o \
9172 heartbeat.o \ 9403 heartbeat.o \
9173 inode.o \ 9404 inode.o \
9174+ ioctl.o \ 9405+ ioctl.o \
9175 journal.o \ 9406 journal.o \
9176 localalloc.o \ 9407 localalloc.o \
9177 mmap.o \ 9408 mmap.o \
9178diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/dlm/dlmfs.c linux-2.6.18.2-vs2.1.1/fs/ocfs2/dlm/dlmfs.c 9409Index: linux-2.6.18/fs/ocfs2/dlm/dlmfs.c
9179--- linux-2.6.18.2/fs/ocfs2/dlm/dlmfs.c 2006-09-20 16:58:35 +0200 9410===================================================================
9180+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/dlm/dlmfs.c 2006-09-25 15:40:02 +0200 9411--- linux-2.6.18.orig/fs/ocfs2/dlm/dlmfs.c
9412+++ linux-2.6.18/fs/ocfs2/dlm/dlmfs.c
9181@@ -44,6 +44,7 @@ 9413@@ -44,6 +44,7 @@
9182 #include <linux/string.h> 9414 #include <linux/string.h>
9183 #include <linux/smp_lock.h> 9415 #include <linux/smp_lock.h>
9184 #include <linux/backing-dev.h> 9416 #include <linux/backing-dev.h>
9185+#include <linux/vs_tag.h> 9417+#include <linux/vs_tag.h>
9200 inode->i_gid = current->fsgid; 9432 inode->i_gid = current->fsgid;
9201+ inode->i_tag = dx_current_fstag(sb); 9433+ inode->i_tag = dx_current_fstag(sb);
9202 inode->i_blksize = PAGE_CACHE_SIZE; 9434 inode->i_blksize = PAGE_CACHE_SIZE;
9203 inode->i_blocks = 0; 9435 inode->i_blocks = 0;
9204 inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; 9436 inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
9205diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/dlmglue.c linux-2.6.18.2-vs2.1.1/fs/ocfs2/dlmglue.c 9437Index: linux-2.6.18/fs/ocfs2/dlmglue.c
9206--- linux-2.6.18.2/fs/ocfs2/dlmglue.c 2006-09-20 16:58:35 +0200 9438===================================================================
9207+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/dlmglue.c 2006-09-25 15:40:02 +0200 9439--- linux-2.6.18.orig/fs/ocfs2/dlmglue.c
9440+++ linux-2.6.18/fs/ocfs2/dlmglue.c
9208@@ -1320,8 +1320,10 @@ static void __ocfs2_stuff_meta_lvb(struc 9441@@ -1320,8 +1320,10 @@ static void __ocfs2_stuff_meta_lvb(struc
9209 lvb->lvb_version = cpu_to_be32(OCFS2_LVB_VERSION); 9442 lvb->lvb_version = cpu_to_be32(OCFS2_LVB_VERSION);
9210 lvb->lvb_isize = cpu_to_be64(i_size_read(inode)); 9443 lvb->lvb_isize = cpu_to_be64(i_size_read(inode));
9211 lvb->lvb_iclusters = cpu_to_be32(oi->ip_clusters); 9444 lvb->lvb_iclusters = cpu_to_be32(oi->ip_clusters);
9212+ lvb->lvb_iflags = cpu_to_be32(oi->ip_flags) & OCFS2_FL_MASK; 9445+ lvb->lvb_iflags = cpu_to_be32(oi->ip_flags) & OCFS2_FL_MASK;
9227 inode->i_gid = be32_to_cpu(lvb->lvb_igid); 9460 inode->i_gid = be32_to_cpu(lvb->lvb_igid);
9228+ inode->i_tag = be16_to_cpu(lvb->lvb_itag); 9461+ inode->i_tag = be16_to_cpu(lvb->lvb_itag);
9229 inode->i_mode = be16_to_cpu(lvb->lvb_imode); 9462 inode->i_mode = be16_to_cpu(lvb->lvb_imode);
9230 inode->i_nlink = be16_to_cpu(lvb->lvb_inlink); 9463 inode->i_nlink = be16_to_cpu(lvb->lvb_inlink);
9231 ocfs2_unpack_timespec(&inode->i_atime, 9464 ocfs2_unpack_timespec(&inode->i_atime,
9232diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/dlmglue.h linux-2.6.18.2-vs2.1.1/fs/ocfs2/dlmglue.h 9465Index: linux-2.6.18/fs/ocfs2/dlmglue.h
9233--- linux-2.6.18.2/fs/ocfs2/dlmglue.h 2006-01-18 06:08:34 +0100 9466===================================================================
9234+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/dlmglue.h 2006-09-25 15:40:02 +0200 9467--- linux-2.6.18.orig/fs/ocfs2/dlmglue.h
9468+++ linux-2.6.18/fs/ocfs2/dlmglue.h
9235@@ -27,7 +27,7 @@ 9469@@ -27,7 +27,7 @@
9236 #ifndef DLMGLUE_H 9470 #ifndef DLMGLUE_H
9237 #define DLMGLUE_H 9471 #define DLMGLUE_H
9238 9472
9239-#define OCFS2_LVB_VERSION 2 9473-#define OCFS2_LVB_VERSION 2
9250+ __be32 lvb_iflags; 9484+ __be32 lvb_iflags;
9251+ __be32 lvb_reserved[2]; 9485+ __be32 lvb_reserved[2];
9252 }; 9486 };
9253 9487
9254 /* ocfs2_meta_lock_full() and ocfs2_data_lock_full() 'arg_flags' flags */ 9488 /* ocfs2_meta_lock_full() and ocfs2_data_lock_full() 'arg_flags' flags */
9255diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/file.c linux-2.6.18.2-vs2.1.1/fs/ocfs2/file.c 9489Index: linux-2.6.18/fs/ocfs2/file.c
9256--- linux-2.6.18.2/fs/ocfs2/file.c 2006-06-18 04:54:44 +0200 9490===================================================================
9257+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/file.c 2006-09-25 15:40:02 +0200 9491--- linux-2.6.18.orig/fs/ocfs2/file.c
9492+++ linux-2.6.18/fs/ocfs2/file.c
9258@@ -44,6 +44,7 @@ 9493@@ -44,6 +44,7 @@
9259 #include "file.h" 9494 #include "file.h"
9260 #include "sysfile.h" 9495 #include "sysfile.h"
9261 #include "inode.h" 9496 #include "inode.h"
9262+#include "ioctl.h" 9497+#include "ioctl.h"
9299 .read = generic_read_dir, 9534 .read = generic_read_dir,
9300 .readdir = ocfs2_readdir, 9535 .readdir = ocfs2_readdir,
9301 .fsync = ocfs2_sync_file, 9536 .fsync = ocfs2_sync_file,
9302+ .ioctl = ocfs2_ioctl, 9537+ .ioctl = ocfs2_ioctl,
9303 }; 9538 };
9304diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/inode.c linux-2.6.18.2-vs2.1.1/fs/ocfs2/inode.c 9539Index: linux-2.6.18/fs/ocfs2/inode.c
9305--- linux-2.6.18.2/fs/ocfs2/inode.c 2006-06-18 04:54:44 +0200 9540===================================================================
9306+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/inode.c 2006-09-25 15:40:02 +0200 9541--- linux-2.6.18.orig/fs/ocfs2/inode.c
9542+++ linux-2.6.18/fs/ocfs2/inode.c
9307@@ -29,6 +29,7 @@ 9543@@ -29,6 +29,7 @@
9308 #include <linux/highmem.h> 9544 #include <linux/highmem.h>
9309 #include <linux/pagemap.h> 9545 #include <linux/pagemap.h>
9310 #include <linux/smp_lock.h> 9546 #include <linux/smp_lock.h>
9311+#include <linux/vs_tag.h> 9547+#include <linux/vs_tag.h>
9479+ inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid, 9715+ inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid,
9480+ /* le16_to_cpu(raw_inode->i_raw_tag)i */ 0); 9716+ /* le16_to_cpu(raw_inode->i_raw_tag)i */ 0);
9481 inode->i_mode = le16_to_cpu(fe->i_mode); 9717 inode->i_mode = le16_to_cpu(fe->i_mode);
9482 inode->i_blksize = (u32) osb->s_clustersize; 9718 inode->i_blksize = (u32) osb->s_clustersize;
9483 if (S_ISLNK(inode->i_mode) && le32_to_cpu(fe->i_clusters) == 0) 9719 if (S_ISLNK(inode->i_mode) && le32_to_cpu(fe->i_clusters) == 0)
9484diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/inode.h linux-2.6.18.2-vs2.1.1/fs/ocfs2/inode.h 9720Index: linux-2.6.18/fs/ocfs2/inode.h
9485--- linux-2.6.18.2/fs/ocfs2/inode.h 2006-09-20 16:58:35 +0200 9721===================================================================
9486+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/inode.h 2006-09-25 15:40:02 +0200 9722--- linux-2.6.18.orig/fs/ocfs2/inode.h
9723+++ linux-2.6.18/fs/ocfs2/inode.h
9487@@ -142,4 +142,7 @@ int ocfs2_mark_inode_dirty(struct ocfs2_ 9724@@ -142,4 +142,7 @@ int ocfs2_mark_inode_dirty(struct ocfs2_
9488 int ocfs2_aio_read(struct file *file, struct kiocb *req, struct iocb *iocb); 9725 int ocfs2_aio_read(struct file *file, struct kiocb *req, struct iocb *iocb);
9489 int ocfs2_aio_write(struct file *file, struct kiocb *req, struct iocb *iocb); 9726 int ocfs2_aio_write(struct file *file, struct kiocb *req, struct iocb *iocb);
9490 9727
9491+void ocfs2_set_inode_flags(struct inode *inode); 9728+void ocfs2_set_inode_flags(struct inode *inode);
9492+int ocfs2_sync_flags(struct inode *inode); 9729+int ocfs2_sync_flags(struct inode *inode);
9493+ 9730+
9494 #endif /* OCFS2_INODE_H */ 9731 #endif /* OCFS2_INODE_H */
9495diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/ioctl.c linux-2.6.18.2-vs2.1.1/fs/ocfs2/ioctl.c 9732Index: linux-2.6.18/fs/ocfs2/ioctl.c
9496--- linux-2.6.18.2/fs/ocfs2/ioctl.c 1970-01-01 01:00:00 +0100 9733===================================================================
9497+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/ioctl.c 2006-09-25 15:40:02 +0200 9734--- /dev/null
9735+++ linux-2.6.18/fs/ocfs2/ioctl.c
9498@@ -0,0 +1,166 @@ 9736@@ -0,0 +1,166 @@
9499+/* 9737+/*
9500+ * linux/fs/ocfs2/ioctl.c 9738+ * linux/fs/ocfs2/ioctl.c
9501+ * 9739+ *
9502+ * Copyright (C) 2006 Herbert Poetzl 9740+ * Copyright (C) 2006 Herbert Poetzl
9660+ default: 9898+ default:
9661+ return -ENOTTY; 9899+ return -ENOTTY;
9662+ } 9900+ }
9663+} 9901+}
9664+ 9902+
9665diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/ioctl.h linux-2.6.18.2-vs2.1.1/fs/ocfs2/ioctl.h 9903Index: linux-2.6.18/fs/ocfs2/ioctl.h
9666--- linux-2.6.18.2/fs/ocfs2/ioctl.h 1970-01-01 01:00:00 +0100 9904===================================================================
9667+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/ioctl.h 2006-09-25 15:40:02 +0200 9905--- /dev/null
9906+++ linux-2.6.18/fs/ocfs2/ioctl.h
9668@@ -0,0 +1,17 @@ 9907@@ -0,0 +1,17 @@
9669+/* 9908+/*
9670+ * ioctl.h 9909+ * ioctl.h
9671+ * 9910+ *
9672+ * Function prototypes 9911+ * Function prototypes
9681+int ocfs2_set_iflags(struct inode *inode, unsigned flags, unsigned mask); 9920+int ocfs2_set_iflags(struct inode *inode, unsigned flags, unsigned mask);
9682+int ocfs2_ioctl(struct inode * inode, struct file * filp, 9921+int ocfs2_ioctl(struct inode * inode, struct file * filp,
9683+ unsigned int cmd, unsigned long arg); 9922+ unsigned int cmd, unsigned long arg);
9684+ 9923+
9685+#endif /* OCFS2_IOCTL_H */ 9924+#endif /* OCFS2_IOCTL_H */
9686diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/namei.c linux-2.6.18.2-vs2.1.1/fs/ocfs2/namei.c 9925Index: linux-2.6.18/fs/ocfs2/namei.c
9687--- linux-2.6.18.2/fs/ocfs2/namei.c 2006-06-18 04:54:44 +0200 9926===================================================================
9688+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/namei.c 2006-09-25 15:40:02 +0200 9927--- linux-2.6.18.orig/fs/ocfs2/namei.c
9928+++ linux-2.6.18/fs/ocfs2/namei.c
9689@@ -40,6 +40,7 @@ 9929@@ -40,6 +40,7 @@
9690 #include <linux/types.h> 9930 #include <linux/types.h>
9691 #include <linux/slab.h> 9931 #include <linux/slab.h>
9692 #include <linux/highmem.h> 9932 #include <linux/highmem.h>
9693+#include <linux/vs_tag.h> 9933+#include <linux/vs_tag.h>
9731 .rename = ocfs2_rename, 9971 .rename = ocfs2_rename,
9732 .setattr = ocfs2_setattr, 9972 .setattr = ocfs2_setattr,
9733 .getattr = ocfs2_getattr, 9973 .getattr = ocfs2_getattr,
9734+ .sync_flags = ocfs2_sync_flags, 9974+ .sync_flags = ocfs2_sync_flags,
9735 }; 9975 };
9736diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/ocfs2.h linux-2.6.18.2-vs2.1.1/fs/ocfs2/ocfs2.h 9976Index: linux-2.6.18/fs/ocfs2/ocfs2.h
9737--- linux-2.6.18.2/fs/ocfs2/ocfs2.h 2006-09-20 16:58:35 +0200 9977===================================================================
9738+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/ocfs2.h 2006-09-25 15:40:02 +0200 9978--- linux-2.6.18.orig/fs/ocfs2/ocfs2.h
9979+++ linux-2.6.18/fs/ocfs2/ocfs2.h
9739@@ -174,6 +174,7 @@ enum ocfs2_mount_options 9980@@ -174,6 +174,7 @@ enum ocfs2_mount_options
9740 OCFS2_MOUNT_NOINTR = 1 << 2, /* Don't catch signals */ 9981 OCFS2_MOUNT_NOINTR = 1 << 2, /* Don't catch signals */
9741 OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */ 9982 OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */
9742 OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */ 9983 OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */
9743+ OCFS2_MOUNT_TAGGED = 1 << 8, /* use tagging */ 9984+ OCFS2_MOUNT_TAGGED = 1 << 8, /* use tagging */
9744 }; 9985 };
9745 9986
9746 #define OCFS2_OSB_SOFT_RO 0x0001 9987 #define OCFS2_OSB_SOFT_RO 0x0001
9747diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/ocfs2_fs.h linux-2.6.18.2-vs2.1.1/fs/ocfs2/ocfs2_fs.h 9988Index: linux-2.6.18/fs/ocfs2/ocfs2_fs.h
9748--- linux-2.6.18.2/fs/ocfs2/ocfs2_fs.h 2006-04-09 13:49:54 +0200 9989===================================================================
9749+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/ocfs2_fs.h 2006-09-25 15:40:02 +0200 9990--- linux-2.6.18.orig/fs/ocfs2/ocfs2_fs.h
9991+++ linux-2.6.18/fs/ocfs2/ocfs2_fs.h
9750@@ -114,6 +114,30 @@ 9992@@ -114,6 +114,30 @@
9751 #define OCFS2_CHAIN_FL (0x00000400) /* Chain allocator */ 9993 #define OCFS2_CHAIN_FL (0x00000400) /* Chain allocator */
9752 #define OCFS2_DEALLOC_FL (0x00000800) /* Truncate log */ 9994 #define OCFS2_DEALLOC_FL (0x00000800) /* Truncate log */
9753 9995
9754+/* Inode attributes */ 9996+/* Inode attributes */
9776+#define OCFS2_IOC_SETFLAGS _IOW('f', 2, long) 10018+#define OCFS2_IOC_SETFLAGS _IOW('f', 2, long)
9777+ 10019+
9778 /* 10020 /*
9779 * Journal Flags (ocfs2_dinode.id1.journal1.i_flags) 10021 * Journal Flags (ocfs2_dinode.id1.journal1.i_flags)
9780 */ 10022 */
9781diff -NurpP --minimal linux-2.6.18.2/fs/ocfs2/super.c linux-2.6.18.2-vs2.1.1/fs/ocfs2/super.c 10023Index: linux-2.6.18/fs/ocfs2/super.c
9782--- linux-2.6.18.2/fs/ocfs2/super.c 2006-09-20 16:58:35 +0200 10024===================================================================
9783+++ linux-2.6.18.2-vs2.1.1/fs/ocfs2/super.c 2006-09-25 17:31:09 +0200 10025--- linux-2.6.18.orig/fs/ocfs2/super.c
10026+++ linux-2.6.18/fs/ocfs2/super.c
9784@@ -141,6 +141,7 @@ enum { 10027@@ -141,6 +141,7 @@ enum {
9785 Opt_hb_local, 10028 Opt_hb_local,
9786 Opt_data_ordered, 10029 Opt_data_ordered,
9787 Opt_data_writeback, 10030 Opt_data_writeback,
9788+ Opt_tag, Opt_notag, Opt_tagid, 10031+ Opt_tag, Opt_notag, Opt_tagid,
9844+ break; 10087+ break;
9845+#endif 10088+#endif
9846 default: 10089 default:
9847 mlog(ML_ERROR, 10090 mlog(ML_ERROR,
9848 "Unrecognized mount option \"%s\" " 10091 "Unrecognized mount option \"%s\" "
9849diff -NurpP --minimal linux-2.6.18.2/fs/open.c linux-2.6.18.2-vs2.1.1/fs/open.c 10092Index: linux-2.6.18/fs/open.c
9850--- linux-2.6.18.2/fs/open.c 2006-09-20 16:58:35 +0200 10093===================================================================
9851+++ linux-2.6.18.2-vs2.1.1/fs/open.c 2006-11-04 08:24:09 +0100 10094--- linux-2.6.18.orig/fs/open.c
10095+++ linux-2.6.18/fs/open.c
9852@@ -28,6 +28,10 @@ 10096@@ -28,6 +28,10 @@
9853 #include <linux/syscalls.h> 10097 #include <linux/syscalls.h>
9854 #include <linux/rcupdate.h> 10098 #include <linux/rcupdate.h>
9855 #include <linux/audit.h> 10099 #include <linux/audit.h>
9856+#include <linux/vs_limit.h> 10100+#include <linux/vs_limit.h>
10045 files->next_fd = fd; 10289 files->next_fd = fd;
10046+ vx_openfd_dec(fd); 10290+ vx_openfd_dec(fd);
10047 } 10291 }
10048 10292
10049 void fastcall put_unused_fd(unsigned int fd) 10293 void fastcall put_unused_fd(unsigned int fd)
10050diff -NurpP --minimal linux-2.6.18.2/fs/proc/array.c linux-2.6.18.2-vs2.1.1/fs/proc/array.c 10294Index: linux-2.6.18/fs/proc/array.c
10051--- linux-2.6.18.2/fs/proc/array.c 2006-09-20 16:58:35 +0200 10295===================================================================
10052+++ linux-2.6.18.2-vs2.1.1/fs/proc/array.c 2006-10-25 03:39:09 +0200 10296--- linux-2.6.18.orig/fs/proc/array.c
10297+++ linux-2.6.18/fs/proc/array.c
10053@@ -75,6 +75,8 @@ 10298@@ -75,6 +75,8 @@
10054 #include <linux/cpuset.h> 10299 #include <linux/cpuset.h>
10055 #include <linux/rcupdate.h> 10300 #include <linux/rcupdate.h>
10056 #include <linux/delayacct.h> 10301 #include <linux/delayacct.h>
10057+#include <linux/vs_context.h> 10302+#include <linux/vs_context.h>
10229- task->pid, 10474- task->pid,
10230+ pid, 10475+ pid,
10231 tcomm, 10476 tcomm,
10232 state, 10477 state,
10233 ppid, 10478 ppid,
10234diff -NurpP --minimal linux-2.6.18.2/fs/proc/base.c linux-2.6.18.2-vs2.1.1/fs/proc/base.c 10479Index: linux-2.6.18/fs/proc/base.c
10235--- linux-2.6.18.2/fs/proc/base.c 2006-09-20 16:58:35 +0200 10480===================================================================
10236+++ linux-2.6.18.2-vs2.1.1/fs/proc/base.c 2006-10-28 16:47:17 +0200 10481--- linux-2.6.18.orig/fs/proc/base.c
10482+++ linux-2.6.18/fs/proc/base.c
10237@@ -71,6 +71,9 @@ 10483@@ -71,6 +71,9 @@
10238 #include <linux/cpuset.h> 10484 #include <linux/cpuset.h>
10239 #include <linux/audit.h> 10485 #include <linux/audit.h>
10240 #include <linux/poll.h> 10486 #include <linux/poll.h>
10241+#include <linux/vs_context.h> 10487+#include <linux/vs_context.h>
10422- task = find_task_by_pid(tgid); 10668- task = find_task_by_pid(tgid);
10423+ task = find_proc_task_by_pid(tgid); 10669+ task = find_proc_task_by_pid(tgid);
10424 if (task) 10670 if (task)
10425 get_task_struct(task); 10671 get_task_struct(task);
10426 rcu_read_unlock(); 10672 rcu_read_unlock();
10427@@ -2060,7 +2117,7 @@ struct dentry *proc_pid_lookup(struct in
10428 inode = proc_pid_make_inode(dir->i_sb, task, PROC_TGID_INO);
10429 if (!inode)
10430 goto out_put_task;
10431-
10432+
10433 inode->i_mode = S_IFDIR|S_IRUGO|S_IXUGO;
10434 inode->i_op = &proc_tgid_base_inode_operations;
10435 inode->i_fop = &proc_tgid_base_operations;
10436@@ -2099,9 +2156,11 @@ static struct dentry *proc_task_lookup(s 10673@@ -2099,9 +2156,11 @@ static struct dentry *proc_task_lookup(s
10437 tid = name_to_int(dentry); 10674 tid = name_to_int(dentry);
10438 if (tid == ~0U) 10675 if (tid == ~0U)
10439 goto out; 10676 goto out;
10440+ if (vx_current_initpid(tid)) 10677+ if (vx_current_initpid(tid))
10486+ continue; 10723+ continue;
10487+ 10724+
10488 len = snprintf(buf, sizeof(buf), "%d", tid); 10725 len = snprintf(buf, sizeof(buf), "%d", tid);
10489 ino = fake_ino(tid, PROC_TID_INO); 10726 ino = fake_ino(tid, PROC_TID_INO);
10490 if (filldir(dirent, buf, len, pos, ino, DT_DIR < 0)) { 10727 if (filldir(dirent, buf, len, pos, ino, DT_DIR < 0)) {
10491diff -NurpP --minimal linux-2.6.18.2/fs/proc/generic.c linux-2.6.18.2-vs2.1.1/fs/proc/generic.c 10728Index: linux-2.6.18/fs/proc/generic.c
10492--- linux-2.6.18.2/fs/proc/generic.c 2006-06-18 04:54:45 +0200 10729===================================================================
10493+++ linux-2.6.18.2-vs2.1.1/fs/proc/generic.c 2006-09-25 15:40:02 +0200 10730--- linux-2.6.18.orig/fs/proc/generic.c
10731+++ linux-2.6.18/fs/proc/generic.c
10494@@ -20,6 +20,7 @@ 10732@@ -20,6 +20,7 @@
10495 #include <linux/namei.h> 10733 #include <linux/namei.h>
10496 #include <linux/bitops.h> 10734 #include <linux/bitops.h>
10497 #include <linux/spinlock.h> 10735 #include <linux/spinlock.h>
10498+#include <linux/vserver/inode.h> 10736+#include <linux/vserver/inode.h>
10548+ } else 10786+ } else
10549+ ent->vx_flags = IATTR_PROC_SYMLINK; 10787+ ent->vx_flags = IATTR_PROC_SYMLINK;
10550 } else { 10788 } else {
10551 kfree(ent); 10789 kfree(ent);
10552 ent = NULL; 10790 ent = NULL;
10553diff -NurpP --minimal linux-2.6.18.2/fs/proc/inode.c linux-2.6.18.2-vs2.1.1/fs/proc/inode.c 10791Index: linux-2.6.18/fs/proc/inode.c
10554--- linux-2.6.18.2/fs/proc/inode.c 2006-09-20 16:58:35 +0200 10792===================================================================
10555+++ linux-2.6.18.2-vs2.1.1/fs/proc/inode.c 2006-09-20 17:01:44 +0200 10793--- linux-2.6.18.orig/fs/proc/inode.c
10794+++ linux-2.6.18/fs/proc/inode.c
10556@@ -168,6 +168,8 @@ struct inode *proc_get_inode(struct supe 10795@@ -168,6 +168,8 @@ struct inode *proc_get_inode(struct supe
10557 inode->i_uid = de->uid; 10796 inode->i_uid = de->uid;
10558 inode->i_gid = de->gid; 10797 inode->i_gid = de->gid;
10559 } 10798 }
10560+ if (de->vx_flags) 10799+ if (de->vx_flags)
10561+ PROC_I(inode)->vx_flags = de->vx_flags; 10800+ PROC_I(inode)->vx_flags = de->vx_flags;
10562 if (de->size) 10801 if (de->size)
10563 inode->i_size = de->size; 10802 inode->i_size = de->size;
10564 if (de->nlink) 10803 if (de->nlink)
10565diff -NurpP --minimal linux-2.6.18.2/fs/proc/internal.h linux-2.6.18.2-vs2.1.1/fs/proc/internal.h 10804Index: linux-2.6.18/fs/proc/internal.h
10566--- linux-2.6.18.2/fs/proc/internal.h 2006-09-20 16:58:35 +0200 10805===================================================================
10567+++ linux-2.6.18.2-vs2.1.1/fs/proc/internal.h 2006-10-25 03:39:09 +0200 10806--- linux-2.6.18.orig/fs/proc/internal.h
10807+++ linux-2.6.18/fs/proc/internal.h
10568@@ -10,6 +10,7 @@ 10808@@ -10,6 +10,7 @@
10569 */ 10809 */
10570 10810
10571 #include <linux/proc_fs.h> 10811 #include <linux/proc_fs.h>
10572+#include <linux/vs_pid.h> 10812+#include <linux/vs_pid.h>
10580- return get_pid_task(proc_pid(inode), PIDTYPE_PID); 10820- return get_pid_task(proc_pid(inode), PIDTYPE_PID);
10581+ return vx_get_proc_task(inode, proc_pid(inode)); 10821+ return vx_get_proc_task(inode, proc_pid(inode));
10582 } 10822 }
10583 10823
10584 static inline int proc_fd(struct inode *inode) 10824 static inline int proc_fd(struct inode *inode)
10585diff -NurpP --minimal linux-2.6.18.2/fs/proc/proc_misc.c linux-2.6.18.2-vs2.1.1/fs/proc/proc_misc.c 10825Index: linux-2.6.18/fs/proc/proc_misc.c
10586--- linux-2.6.18.2/fs/proc/proc_misc.c 2006-09-20 16:58:35 +0200 10826===================================================================
10587+++ linux-2.6.18.2-vs2.1.1/fs/proc/proc_misc.c 2006-09-20 18:36:46 +0200 10827--- linux-2.6.18.orig/fs/proc/proc_misc.c
10828+++ linux-2.6.18/fs/proc/proc_misc.c
10588@@ -52,6 +52,8 @@ 10829@@ -52,6 +52,8 @@
10589 #include <asm/div64.h> 10830 #include <asm/div64.h>
10590 #include "internal.h" 10831 #include "internal.h"
10591 10832
10592+#include <linux/vs_cvirt.h> 10833+#include <linux/vs_cvirt.h>
10661+ vx_new_uts(release), 10902+ vx_new_uts(release),
10662+ vx_new_uts(version)); 10903+ vx_new_uts(version));
10663 return proc_calc_metrics(page, start, off, count, eof, len); 10904 return proc_calc_metrics(page, start, off, count, eof, len);
10664 } 10905 }
10665 10906
10666diff -NurpP --minimal linux-2.6.18.2/fs/proc/root.c linux-2.6.18.2-vs2.1.1/fs/proc/root.c 10907Index: linux-2.6.18/fs/proc/root.c
10667--- linux-2.6.18.2/fs/proc/root.c 2006-09-20 16:58:35 +0200 10908===================================================================
10668+++ linux-2.6.18.2-vs2.1.1/fs/proc/root.c 2006-09-20 17:01:44 +0200 10909--- linux-2.6.18.orig/fs/proc/root.c
10910+++ linux-2.6.18/fs/proc/root.c
10669@@ -24,6 +24,9 @@ struct proc_dir_entry *proc_net, *proc_n 10911@@ -24,6 +24,9 @@ struct proc_dir_entry *proc_net, *proc_n
10670 #ifdef CONFIG_SYSCTL 10912 #ifdef CONFIG_SYSCTL
10671 struct proc_dir_entry *proc_sys_root; 10913 struct proc_dir_entry *proc_sys_root;
10672 #endif 10914 #endif
10673+struct proc_dir_entry *proc_virtual; 10915+struct proc_dir_entry *proc_virtual;
10682 proc_bus = proc_mkdir("bus", NULL); 10924 proc_bus = proc_mkdir("bus", NULL);
10683+ proc_vx_init(); 10925+ proc_vx_init();
10684 } 10926 }
10685 10927
10686 static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat 10928 static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat
10687diff -NurpP --minimal linux-2.6.18.2/fs/quota.c linux-2.6.18.2-vs2.1.1/fs/quota.c 10929Index: linux-2.6.18/fs/quota.c
10688--- linux-2.6.18.2/fs/quota.c 2006-06-18 04:54:47 +0200 10930===================================================================
10689+++ linux-2.6.18.2-vs2.1.1/fs/quota.c 2006-09-25 15:40:02 +0200 10931--- linux-2.6.18.orig/fs/quota.c
10932+++ linux-2.6.18/fs/quota.c
10690@@ -17,47 +17,122 @@ 10933@@ -17,47 +17,122 @@
10691 #include <linux/buffer_head.h> 10934 #include <linux/buffer_head.h>
10692 #include <linux/capability.h> 10935 #include <linux/capability.h>
10693 #include <linux/quotaops.h> 10936 #include <linux/quotaops.h>
10694+#include <linux/major.h> 10937+#include <linux/major.h>
11228- ret = do_quotactl(sb, type, cmds, id, addr); 11471- ret = do_quotactl(sb, type, cmds, id, addr);
11229+ ret = do_quotactl(dqh, type, cmds, id, addr); 11472+ ret = do_quotactl(dqh, type, cmds, id, addr);
11230 if (sb) 11473 if (sb)
11231 drop_super(sb); 11474 drop_super(sb);
11232 11475
11233diff -NurpP --minimal linux-2.6.18.2/fs/quota_v1.c linux-2.6.18.2-vs2.1.1/fs/quota_v1.c 11476Index: linux-2.6.18/fs/quota_v1.c
11234--- linux-2.6.18.2/fs/quota_v1.c 2005-03-02 12:38:45 +0100 11477===================================================================
11235+++ linux-2.6.18.2-vs2.1.1/fs/quota_v1.c 2006-09-25 15:40:02 +0200 11478--- linux-2.6.18.orig/fs/quota_v1.c
11479+++ linux-2.6.18/fs/quota_v1.c
11236@@ -42,12 +42,13 @@ static int v1_read_dqblk(struct dquot *d 11480@@ -42,12 +42,13 @@ static int v1_read_dqblk(struct dquot *d
11237 int type = dquot->dq_type; 11481 int type = dquot->dq_type;
11238 struct v1_disk_dqblk dqblk; 11482 struct v1_disk_dqblk dqblk;
11239 11483
11240- if (!sb_dqopt(dquot->dq_sb)->files[type]) 11484- if (!sb_dqopt(dquot->dq_sb)->files[type])
11341- ret = sb->s_op->quota_write(sb, type, (char *)&dqblk, 11585- ret = sb->s_op->quota_write(sb, type, (char *)&dqblk,
11342+ ret = hash->dqh_sb->s_op->quota_write(hash, type, (char *)&dqblk, 11586+ ret = hash->dqh_sb->s_op->quota_write(hash, type, (char *)&dqblk,
11343 sizeof(struct v1_disk_dqblk), v1_dqoff(0)); 11587 sizeof(struct v1_disk_dqblk), v1_dqoff(0));
11344 if (ret == sizeof(struct v1_disk_dqblk)) 11588 if (ret == sizeof(struct v1_disk_dqblk))
11345 ret = 0; 11589 ret = 0;
11346diff -NurpP --minimal linux-2.6.18.2/fs/quota_v2.c linux-2.6.18.2-vs2.1.1/fs/quota_v2.c 11590Index: linux-2.6.18/fs/quota_v2.c
11347--- linux-2.6.18.2/fs/quota_v2.c 2006-06-18 04:54:47 +0200 11591===================================================================
11348+++ linux-2.6.18.2-vs2.1.1/fs/quota_v2.c 2006-09-25 15:40:02 +0200 11592--- linux-2.6.18.orig/fs/quota_v2.c
11593+++ linux-2.6.18/fs/quota_v2.c
11349@@ -26,14 +26,15 @@ typedef char *dqbuf_t; 11594@@ -26,14 +26,15 @@ typedef char *dqbuf_t;
11350 #define GETENTRIES(buf) ((struct v2_disk_dqblk *)(((char *)buf)+sizeof(struct v2_disk_dqdbheader))) 11595 #define GETENTRIES(buf) ((struct v2_disk_dqblk *)(((char *)buf)+sizeof(struct v2_disk_dqdbheader)))
11351 11596
11352 /* Check whether given file is really vfsv0 quotafile */ 11597 /* Check whether given file is really vfsv0 quotafile */
11353-static int v2_check_quota_file(struct super_block *sb, int type) 11598-static int v2_check_quota_file(struct super_block *sb, int type)
11787- if ((ret = dquot->dq_sb->s_op->quota_read(dquot->dq_sb, type, 12032- if ((ret = dquot->dq_sb->s_op->quota_read(dquot->dq_sb, type,
11788+ if ((ret = dquot->dq_dqh->dqh_sb->s_op->quota_read(dquot->dq_dqh, type, 12033+ if ((ret = dquot->dq_dqh->dqh_sb->s_op->quota_read(dquot->dq_dqh, type,
11789 (char *)&ddquot, sizeof(struct v2_disk_dqblk), offset)) 12034 (char *)&ddquot, sizeof(struct v2_disk_dqblk), offset))
11790 != sizeof(struct v2_disk_dqblk)) { 12035 != sizeof(struct v2_disk_dqblk)) {
11791 if (ret >= 0) 12036 if (ret >= 0)
11792diff -NurpP --minimal linux-2.6.18.2/fs/read_write.c linux-2.6.18.2-vs2.1.1/fs/read_write.c 12037Index: linux-2.6.18/fs/read_write.c
11793--- linux-2.6.18.2/fs/read_write.c 2006-09-20 16:58:35 +0200 12038===================================================================
11794+++ linux-2.6.18.2-vs2.1.1/fs/read_write.c 2006-09-25 15:40:02 +0200 12039--- linux-2.6.18.orig/fs/read_write.c
12040+++ linux-2.6.18/fs/read_write.c
11795@@ -636,12 +636,77 @@ sys_writev(unsigned long fd, const struc 12041@@ -636,12 +636,77 @@ sys_writev(unsigned long fd, const struc
11796 return ret; 12042 return ret;
11797 } 12043 }
11798 12044
11799+ssize_t vfs_sendfile(struct file *out_file, struct file *in_file, loff_t *ppos, 12045+ssize_t vfs_sendfile(struct file *out_file, struct file *in_file, loff_t *ppos,
11940- retval = -EOVERFLOW; 12186- retval = -EOVERFLOW;
11941- 12187-
11942 fput_out: 12188 fput_out:
11943 fput_light(out_file, fput_needed_out); 12189 fput_light(out_file, fput_needed_out);
11944 fput_in: 12190 fput_in:
11945diff -NurpP --minimal linux-2.6.18.2/fs/reiserfs/bitmap.c linux-2.6.18.2-vs2.1.1/fs/reiserfs/bitmap.c 12191Index: linux-2.6.18/fs/reiserfs/bitmap.c
11946--- linux-2.6.18.2/fs/reiserfs/bitmap.c 2006-09-20 16:58:35 +0200 12192===================================================================
11947+++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/bitmap.c 2006-09-20 17:01:44 +0200 12193--- linux-2.6.18.orig/fs/reiserfs/bitmap.c
12194+++ linux-2.6.18/fs/reiserfs/bitmap.c
11948@@ -12,6 +12,7 @@ 12195@@ -12,6 +12,7 @@
11949 #include <linux/reiserfs_fs_sb.h> 12196 #include <linux/reiserfs_fs_sb.h>
11950 #include <linux/reiserfs_fs_i.h> 12197 #include <linux/reiserfs_fs_i.h>
11951 #include <linux/quotaops.h> 12198 #include <linux/quotaops.h>
11952+#include <linux/vs_dlimit.h> 12199+#include <linux/vs_dlimit.h>
12035+ DLIMIT_FREE_BLOCK(hint->inode, blocks); 12282+ DLIMIT_FREE_BLOCK(hint->inode, blocks);
12036+ DQUOT_FREE_BLOCK_NODIRTY(hint->inode, blocks); 12283+ DQUOT_FREE_BLOCK_NODIRTY(hint->inode, blocks);
12037 } 12284 }
12038 12285
12039 return CARRY_ON; 12286 return CARRY_ON;
12040diff -NurpP --minimal linux-2.6.18.2/fs/reiserfs/file.c linux-2.6.18.2-vs2.1.1/fs/reiserfs/file.c 12287Index: linux-2.6.18/fs/reiserfs/file.c
12041--- linux-2.6.18.2/fs/reiserfs/file.c 2006-09-20 16:58:35 +0200 12288===================================================================
12042+++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/file.c 2006-09-25 15:40:02 +0200 12289--- linux-2.6.18.orig/fs/reiserfs/file.c
12290+++ linux-2.6.18/fs/reiserfs/file.c
12043@@ -1572,6 +1572,7 @@ const struct file_operations reiserfs_fi 12291@@ -1572,6 +1572,7 @@ const struct file_operations reiserfs_fi
12044 .release = reiserfs_file_release, 12292 .release = reiserfs_file_release,
12045 .fsync = reiserfs_sync_file, 12293 .fsync = reiserfs_sync_file,
12046 .sendfile = generic_file_sendfile, 12294 .sendfile = generic_file_sendfile,
12047+ .sendpage = generic_file_sendpage, 12295+ .sendpage = generic_file_sendpage,
12052 .listxattr = reiserfs_listxattr, 12300 .listxattr = reiserfs_listxattr,
12053 .removexattr = reiserfs_removexattr, 12301 .removexattr = reiserfs_removexattr,
12054 .permission = reiserfs_permission, 12302 .permission = reiserfs_permission,
12055+ .sync_flags = reiserfs_sync_flags, 12303+ .sync_flags = reiserfs_sync_flags,
12056 }; 12304 };
12057diff -NurpP --minimal linux-2.6.18.2/fs/reiserfs/inode.c linux-2.6.18.2-vs2.1.1/fs/reiserfs/inode.c 12305Index: linux-2.6.18/fs/reiserfs/inode.c
12058--- linux-2.6.18.2/fs/reiserfs/inode.c 2006-09-20 16:58:35 +0200 12306===================================================================
12059+++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/inode.c 2006-09-25 15:40:02 +0200 12307--- linux-2.6.18.orig/fs/reiserfs/inode.c
12308+++ linux-2.6.18/fs/reiserfs/inode.c
12060@@ -16,6 +16,8 @@ 12309@@ -16,6 +16,8 @@
12061 #include <linux/mpage.h> 12310 #include <linux/mpage.h>
12062 #include <linux/writeback.h> 12311 #include <linux/writeback.h>
12063 #include <linux/quotaops.h> 12312 #include <linux/quotaops.h>
12064+#include <linux/vs_dlimit.h> 12313+#include <linux/vs_dlimit.h>
12238+ IS_TAGGED(inode)) 12487+ IS_TAGGED(inode))
12239+ inode->i_tag = attr->ia_tag; 12488+ inode->i_tag = attr->ia_tag;
12240 mark_inode_dirty(inode); 12489 mark_inode_dirty(inode);
12241 error = 12490 error =
12242 journal_end(&th, inode->i_sb, jbegin_count); 12491 journal_end(&th, inode->i_sb, jbegin_count);
12243diff -NurpP --minimal linux-2.6.18.2/fs/reiserfs/ioctl.c linux-2.6.18.2-vs2.1.1/fs/reiserfs/ioctl.c 12492Index: linux-2.6.18/fs/reiserfs/ioctl.c
12244--- linux-2.6.18.2/fs/reiserfs/ioctl.c 2006-09-20 16:58:35 +0200 12493===================================================================
12245+++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/ioctl.c 2006-09-20 17:01:44 +0200 12494--- linux-2.6.18.orig/fs/reiserfs/ioctl.c
12495+++ linux-2.6.18/fs/reiserfs/ioctl.c
12246@@ -4,6 +4,7 @@ 12496@@ -4,6 +4,7 @@
12247 12497
12248 #include <linux/capability.h> 12498 #include <linux/capability.h>
12249 #include <linux/fs.h> 12499 #include <linux/fs.h>
12250+#include <linux/mount.h> 12500+#include <linux/mount.h>
12311+ if (IS_RDONLY(inode) || 12561+ if (IS_RDONLY(inode) ||
12312+ (filp && MNT_IS_RDONLY(filp->f_vfsmnt))) 12562+ (filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
12313 return -EROFS; 12563 return -EROFS;
12314 if (get_user(inode->i_generation, (int __user *)arg)) 12564 if (get_user(inode->i_generation, (int __user *)arg))
12315 return -EFAULT; 12565 return -EFAULT;
12316diff -NurpP --minimal linux-2.6.18.2/fs/reiserfs/namei.c linux-2.6.18.2-vs2.1.1/fs/reiserfs/namei.c 12566Index: linux-2.6.18/fs/reiserfs/namei.c
12317--- linux-2.6.18.2/fs/reiserfs/namei.c 2006-09-20 16:58:35 +0200 12567===================================================================
12318+++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/namei.c 2006-09-25 15:40:02 +0200 12568--- linux-2.6.18.orig/fs/reiserfs/namei.c
12569+++ linux-2.6.18/fs/reiserfs/namei.c
12319@@ -18,6 +18,7 @@ 12570@@ -18,6 +18,7 @@
12320 #include <linux/reiserfs_xattr.h> 12571 #include <linux/reiserfs_xattr.h>
12321 #include <linux/smp_lock.h> 12572 #include <linux/smp_lock.h>
12322 #include <linux/quotaops.h> 12573 #include <linux/quotaops.h>
12323+#include <linux/vs_tag.h> 12574+#include <linux/vs_tag.h>
12361 .removexattr = reiserfs_removexattr, 12612 .removexattr = reiserfs_removexattr,
12362 .permission = reiserfs_permission, 12613 .permission = reiserfs_permission,
12363+ .sync_flags = reiserfs_sync_flags, 12614+ .sync_flags = reiserfs_sync_flags,
12364 12615
12365 }; 12616 };
12366diff -NurpP --minimal linux-2.6.18.2/fs/reiserfs/stree.c linux-2.6.18.2-vs2.1.1/fs/reiserfs/stree.c 12617Index: linux-2.6.18/fs/reiserfs/stree.c
12367--- linux-2.6.18.2/fs/reiserfs/stree.c 2006-09-20 16:58:35 +0200 12618===================================================================
12368+++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/stree.c 2006-09-25 15:40:02 +0200 12619--- linux-2.6.18.orig/fs/reiserfs/stree.c
12620+++ linux-2.6.18/fs/reiserfs/stree.c
12369@@ -56,6 +56,7 @@ 12621@@ -56,6 +56,7 @@
12370 #include <linux/smp_lock.h> 12622 #include <linux/smp_lock.h>
12371 #include <linux/buffer_head.h> 12623 #include <linux/buffer_head.h>
12372 #include <linux/quotaops.h> 12624 #include <linux/quotaops.h>
12373+#include <linux/vs_dlimit.h> 12625+#include <linux/vs_dlimit.h>
12439+ DLIMIT_FREE_SPACE(inode, quota_bytes); 12691+ DLIMIT_FREE_SPACE(inode, quota_bytes);
12440 DQUOT_FREE_SPACE_NODIRTY(inode, quota_bytes); 12692 DQUOT_FREE_SPACE_NODIRTY(inode, quota_bytes);
12441+ } 12693+ }
12442 return retval; 12694 return retval;
12443 } 12695 }
12444diff -NurpP --minimal linux-2.6.18.2/fs/reiserfs/super.c linux-2.6.18.2-vs2.1.1/fs/reiserfs/super.c 12696Index: linux-2.6.18/fs/reiserfs/super.c
12445--- linux-2.6.18.2/fs/reiserfs/super.c 2006-09-20 16:58:35 +0200 12697===================================================================
12446+++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/super.c 2006-09-25 15:40:02 +0200 12698--- linux-2.6.18.orig/fs/reiserfs/super.c
12699+++ linux-2.6.18/fs/reiserfs/super.c
12447@@ -137,7 +137,7 @@ static int remove_save_link_only(struct 12700@@ -137,7 +137,7 @@ static int remove_save_link_only(struct
12448 } 12701 }
12449 12702
12450 #ifdef CONFIG_QUOTA 12703 #ifdef CONFIG_QUOTA
12451-static int reiserfs_quota_on_mount(struct super_block *, int); 12704-static int reiserfs_quota_on_mount(struct super_block *, int);
12736+ struct inode *inode = dqh_dqopt(hash)->files[type]; 12989+ struct inode *inode = dqh_dqopt(hash)->files[type];
12737+ struct super_block *sb = hash->dqh_sb; 12990+ struct super_block *sb = hash->dqh_sb;
12738 unsigned long blk = off >> sb->s_blocksize_bits; 12991 unsigned long blk = off >> sb->s_blocksize_bits;
12739 int err = 0, offset = off & (sb->s_blocksize - 1), tocopy; 12992 int err = 0, offset = off & (sb->s_blocksize - 1), tocopy;
12740 int journal_quota = REISERFS_SB(sb)->s_qf_names[type] != NULL; 12993 int journal_quota = REISERFS_SB(sb)->s_qf_names[type] != NULL;
12741diff -NurpP --minimal linux-2.6.18.2/fs/reiserfs/xattr.c linux-2.6.18.2-vs2.1.1/fs/reiserfs/xattr.c 12994Index: linux-2.6.18/fs/reiserfs/xattr.c
12742--- linux-2.6.18.2/fs/reiserfs/xattr.c 2006-09-20 16:58:35 +0200 12995===================================================================
12743+++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/xattr.c 2006-09-20 17:01:44 +0200 12996--- linux-2.6.18.orig/fs/reiserfs/xattr.c
12997+++ linux-2.6.18/fs/reiserfs/xattr.c
12744@@ -35,6 +35,7 @@ 12998@@ -35,6 +35,7 @@
12745 #include <linux/namei.h> 12999 #include <linux/namei.h>
12746 #include <linux/errno.h> 13000 #include <linux/errno.h>
12747 #include <linux/fs.h> 13001 #include <linux/fs.h>
12748+#include <linux/mount.h> 13002+#include <linux/mount.h>
12756- err = vfs_rmdir(root->d_inode, dir); 13010- err = vfs_rmdir(root->d_inode, dir);
12757+ err = vfs_rmdir(root->d_inode, dir, NULL); 13011+ err = vfs_rmdir(root->d_inode, dir, NULL);
12758 reiserfs_write_unlock_xattrs(inode->i_sb); 13012 reiserfs_write_unlock_xattrs(inode->i_sb);
12759 dput(root); 13013 dput(root);
12760 } else { 13014 } else {
12761diff -NurpP --minimal linux-2.6.18.2/fs/stat.c linux-2.6.18.2-vs2.1.1/fs/stat.c 13015Index: linux-2.6.18/fs/stat.c
12762--- linux-2.6.18.2/fs/stat.c 2006-09-20 16:58:35 +0200 13016===================================================================
12763+++ linux-2.6.18.2-vs2.1.1/fs/stat.c 2006-09-25 15:40:02 +0200 13017--- linux-2.6.18.orig/fs/stat.c
13018+++ linux-2.6.18/fs/stat.c
12764@@ -26,6 +26,7 @@ void generic_fillattr(struct inode *inod 13019@@ -26,6 +26,7 @@ void generic_fillattr(struct inode *inod
12765 stat->nlink = inode->i_nlink; 13020 stat->nlink = inode->i_nlink;
12766 stat->uid = inode->i_uid; 13021 stat->uid = inode->i_uid;
12767 stat->gid = inode->i_gid; 13022 stat->gid = inode->i_gid;
12768+ stat->tag = inode->i_tag; 13023+ stat->tag = inode->i_tag;
12769 stat->rdev = inode->i_rdev; 13024 stat->rdev = inode->i_rdev;
12770 stat->atime = inode->i_atime; 13025 stat->atime = inode->i_atime;
12771 stat->mtime = inode->i_mtime; 13026 stat->mtime = inode->i_mtime;
12772diff -NurpP --minimal linux-2.6.18.2/fs/super.c linux-2.6.18.2-vs2.1.1/fs/super.c 13027Index: linux-2.6.18/fs/super.c
12773--- linux-2.6.18.2/fs/super.c 2006-09-20 16:58:35 +0200 13028===================================================================
12774+++ linux-2.6.18.2-vs2.1.1/fs/super.c 2006-11-03 18:28:44 +0100 13029--- linux-2.6.18.orig/fs/super.c
13030+++ linux-2.6.18/fs/super.c
12775@@ -37,6 +37,8 @@ 13031@@ -37,6 +37,8 @@
12776 #include <linux/idr.h> 13032 #include <linux/idr.h>
12777 #include <linux/kobject.h> 13033 #include <linux/kobject.h>
12778 #include <linux/mutex.h> 13034 #include <linux/mutex.h>
12779+#include <linux/devpts_fs.h> 13035+#include <linux/devpts_fs.h>
12857 mnt = vfs_kern_mount(type, flags, name, data); 13113 mnt = vfs_kern_mount(type, flags, name, data);
12858+out_put: 13114+out_put:
12859 put_filesystem(type); 13115 put_filesystem(type);
12860 return mnt; 13116 return mnt;
12861 } 13117 }
12862diff -NurpP --minimal linux-2.6.18.2/fs/sysfs/mount.c linux-2.6.18.2-vs2.1.1/fs/sysfs/mount.c 13118Index: linux-2.6.18/fs/sysfs/mount.c
12863--- linux-2.6.18.2/fs/sysfs/mount.c 2006-09-20 16:58:35 +0200 13119===================================================================
12864+++ linux-2.6.18.2-vs2.1.1/fs/sysfs/mount.c 2006-09-20 17:01:44 +0200 13120--- linux-2.6.18.orig/fs/sysfs/mount.c
13121+++ linux-2.6.18/fs/sysfs/mount.c
12865@@ -11,8 +11,6 @@ 13122@@ -11,8 +11,6 @@
12866 13123
12867 #include "sysfs.h" 13124 #include "sysfs.h"
12868 13125
12869-/* Random magic number */ 13126-/* Random magic number */
12878- sb->s_magic = SYSFS_MAGIC; 13135- sb->s_magic = SYSFS_MAGIC;
12879+ sb->s_magic = SYSFS_SUPER_MAGIC; 13136+ sb->s_magic = SYSFS_SUPER_MAGIC;
12880 sb->s_op = &sysfs_ops; 13137 sb->s_op = &sysfs_ops;
12881 sb->s_time_gran = 1; 13138 sb->s_time_gran = 1;
12882 sysfs_sb = sb; 13139 sysfs_sb = sb;
12883diff -NurpP --minimal linux-2.6.18.2/fs/udf/super.c linux-2.6.18.2-vs2.1.1/fs/udf/super.c 13140Index: linux-2.6.18/fs/udf/super.c
12884--- linux-2.6.18.2/fs/udf/super.c 2006-09-20 16:58:35 +0200 13141===================================================================
12885+++ linux-2.6.18.2-vs2.1.1/fs/udf/super.c 2006-09-25 15:40:02 +0200 13142--- linux-2.6.18.orig/fs/udf/super.c
13143+++ linux-2.6.18/fs/udf/super.c
12886@@ -1577,7 +1577,7 @@ static int udf_fill_super(struct super_b 13144@@ -1577,7 +1577,7 @@ static int udf_fill_super(struct super_b
12887 13145
12888 /* Fill in the rest of the superblock */ 13146 /* Fill in the rest of the superblock */
12889 sb->s_op = &udf_sb_ops; 13147 sb->s_op = &udf_sb_ops;
12890- sb->dq_op = NULL; 13148- sb->dq_op = NULL;
12891+ sb->s_qop = NULL; 13149+ sb->s_qop = NULL;
12892 sb->s_dirt = 0; 13150 sb->s_dirt = 0;
12893 sb->s_magic = UDF_SUPER_MAGIC; 13151 sb->s_magic = UDF_SUPER_MAGIC;
12894 sb->s_time_gran = 1000; 13152 sb->s_time_gran = 1000;
12895diff -NurpP --minimal linux-2.6.18.2/fs/ufs/super.c linux-2.6.18.2-vs2.1.1/fs/ufs/super.c 13153Index: linux-2.6.18/fs/ufs/super.c
12896--- linux-2.6.18.2/fs/ufs/super.c 2006-09-20 16:58:35 +0200 13154===================================================================
12897+++ linux-2.6.18.2-vs2.1.1/fs/ufs/super.c 2006-09-25 15:40:02 +0200 13155--- linux-2.6.18.orig/fs/ufs/super.c
13156+++ linux-2.6.18/fs/ufs/super.c
12898@@ -931,7 +931,7 @@ magic_found: 13157@@ -931,7 +931,7 @@ magic_found:
12899 * Read ufs_super_block into internal data structures 13158 * Read ufs_super_block into internal data structures
12900 */ 13159 */
12901 sb->s_op = &ufs_super_ops; 13160 sb->s_op = &ufs_super_ops;
12902- sb->dq_op = NULL; /***/ 13161- sb->dq_op = NULL; /***/
12941+ struct inode *inode = dqh_dqopt(hash)->files[type]; 13200+ struct inode *inode = dqh_dqopt(hash)->files[type];
12942+ struct super_block *sb = hash->dqh_sb; 13201+ struct super_block *sb = hash->dqh_sb;
12943 sector_t blk = off >> sb->s_blocksize_bits; 13202 sector_t blk = off >> sb->s_blocksize_bits;
12944 int err = 0; 13203 int err = 0;
12945 int offset = off & (sb->s_blocksize - 1); 13204 int offset = off & (sb->s_blocksize - 1);
12946diff -NurpP --minimal linux-2.6.18.2/fs/xattr.c linux-2.6.18.2-vs2.1.1/fs/xattr.c 13205Index: linux-2.6.18/fs/xattr.c
12947--- linux-2.6.18.2/fs/xattr.c 2006-09-20 16:58:37 +0200 13206===================================================================
12948+++ linux-2.6.18.2-vs2.1.1/fs/xattr.c 2006-09-20 21:08:52 +0200 13207--- linux-2.6.18.orig/fs/xattr.c
13208+++ linux-2.6.18/fs/xattr.c
12949@@ -18,6 +18,7 @@ 13209@@ -18,6 +18,7 @@
12950 #include <linux/module.h> 13210 #include <linux/module.h>
12951 #include <linux/fsnotify.h> 13211 #include <linux/fsnotify.h>
12952 #include <linux/audit.h> 13212 #include <linux/audit.h>
12953+#include <linux/mount.h> 13213+#include <linux/mount.h>
13044- error = removexattr(dentry, name); 13304- error = removexattr(dentry, name);
13045+ error = removexattr(dentry, name, f->f_vfsmnt); 13305+ error = removexattr(dentry, name, f->f_vfsmnt);
13046 fput(f); 13306 fput(f);
13047 return error; 13307 return error;
13048 } 13308 }
13049diff -NurpP --minimal linux-2.6.18.2/fs/xfs/linux-2.6/xfs_file.c linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_file.c 13309Index: linux-2.6.18/fs/xfs/linux-2.6/xfs_file.c
13050--- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_file.c 2006-09-20 16:58:37 +0200 13310===================================================================
13051+++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_file.c 2006-09-25 15:40:02 +0200 13311--- linux-2.6.18.orig/fs/xfs/linux-2.6/xfs_file.c
13312+++ linux-2.6.18/fs/xfs/linux-2.6/xfs_file.c
13052@@ -545,6 +545,7 @@ const struct file_operations xfs_file_op 13313@@ -545,6 +545,7 @@ const struct file_operations xfs_file_op
13053 .aio_read = xfs_file_aio_read, 13314 .aio_read = xfs_file_aio_read,
13054 .aio_write = xfs_file_aio_write, 13315 .aio_write = xfs_file_aio_write,
13055 .sendfile = xfs_file_sendfile, 13316 .sendfile = xfs_file_sendfile,
13056+ .sendpage = generic_file_sendpage, 13317+ .sendpage = generic_file_sendpage,
13063 .sendfile = xfs_file_sendfile_invis, 13324 .sendfile = xfs_file_sendfile_invis,
13064+ .sendpage = generic_file_sendpage, 13325+ .sendpage = generic_file_sendpage,
13065 .splice_read = xfs_file_splice_read_invis, 13326 .splice_read = xfs_file_splice_read_invis,
13066 .splice_write = xfs_file_splice_write_invis, 13327 .splice_write = xfs_file_splice_write_invis,
13067 .unlocked_ioctl = xfs_file_ioctl_invis, 13328 .unlocked_ioctl = xfs_file_ioctl_invis,
13068diff -NurpP --minimal linux-2.6.18.2/fs/xfs/linux-2.6/xfs_ioctl.c linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_ioctl.c 13329Index: linux-2.6.18/fs/xfs/linux-2.6/xfs_ioctl.c
13069--- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_ioctl.c 2006-09-20 16:58:39 +0200 13330===================================================================
13070+++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_ioctl.c 2006-09-20 17:01:44 +0200 13331--- linux-2.6.18.orig/fs/xfs/linux-2.6/xfs_ioctl.c
13332+++ linux-2.6.18/fs/xfs/linux-2.6/xfs_ioctl.c
13071@@ -1095,6 +1095,8 @@ xfs_ioc_fsgeometry( 13333@@ -1095,6 +1095,8 @@ xfs_ioc_fsgeometry(
13072 #define LINUX_XFLAG_APPEND 0x00000020 /* writes to file may only append */ 13334 #define LINUX_XFLAG_APPEND 0x00000020 /* writes to file may only append */
13073 #define LINUX_XFLAG_NODUMP 0x00000040 /* do not dump file */ 13335 #define LINUX_XFLAG_NODUMP 0x00000040 /* do not dump file */
13074 #define LINUX_XFLAG_NOATIME 0x00000080 /* do not update atime */ 13336 #define LINUX_XFLAG_NOATIME 0x00000080 /* do not update atime */
13075+#define LINUX_XFLAG_BARRIER 0x04000000 /* chroot() barrier */ 13337+#define LINUX_XFLAG_BARRIER 0x04000000 /* chroot() barrier */
13086+ if (di_flags & XFS_DIFLAG_BARRIER) 13348+ if (di_flags & XFS_DIFLAG_BARRIER)
13087+ flags |= LINUX_XFLAG_BARRIER; 13349+ flags |= LINUX_XFLAG_BARRIER;
13088 if (di_flags & XFS_DIFLAG_APPEND) 13350 if (di_flags & XFS_DIFLAG_APPEND)
13089 flags |= LINUX_XFLAG_APPEND; 13351 flags |= LINUX_XFLAG_APPEND;
13090 if (di_flags & XFS_DIFLAG_SYNC) 13352 if (di_flags & XFS_DIFLAG_SYNC)
13091diff -NurpP --minimal linux-2.6.18.2/fs/xfs/linux-2.6/xfs_iops.c linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_iops.c 13353Index: linux-2.6.18/fs/xfs/linux-2.6/xfs_iops.c
13092--- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_iops.c 2006-09-20 16:58:39 +0200 13354===================================================================
13093+++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_iops.c 2006-09-25 15:40:02 +0200 13355--- linux-2.6.18.orig/fs/xfs/linux-2.6/xfs_iops.c
13356+++ linux-2.6.18/fs/xfs/linux-2.6/xfs_iops.c
13094@@ -53,6 +53,7 @@ 13357@@ -53,6 +53,7 @@
13095 #include <linux/xattr.h> 13358 #include <linux/xattr.h>
13096 #include <linux/namei.h> 13359 #include <linux/namei.h>
13097 #include <linux/security.h> 13360 #include <linux/security.h>
13098+#include <linux/vserver/tag.h> 13361+#include <linux/vserver/tag.h>
13192 .getxattr = xfs_vn_getxattr, 13455 .getxattr = xfs_vn_getxattr,
13193 .listxattr = xfs_vn_listxattr, 13456 .listxattr = xfs_vn_listxattr,
13194 .removexattr = xfs_vn_removexattr, 13457 .removexattr = xfs_vn_removexattr,
13195+ .sync_flags = xfs_vn_sync_flags, 13458+ .sync_flags = xfs_vn_sync_flags,
13196 }; 13459 };
13197diff -NurpP --minimal linux-2.6.18.2/fs/xfs/linux-2.6/xfs_linux.h linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_linux.h 13460Index: linux-2.6.18/fs/xfs/linux-2.6/xfs_linux.h
13198--- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_linux.h 2006-09-20 16:58:39 +0200 13461===================================================================
13199+++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_linux.h 2006-09-25 17:25:34 +0200 13462--- linux-2.6.18.orig/fs/xfs/linux-2.6/xfs_linux.h
13463+++ linux-2.6.18/fs/xfs/linux-2.6/xfs_linux.h
13200@@ -139,6 +139,7 @@ BUFFER_FNS(PrivateStart, unwritten); 13464@@ -139,6 +139,7 @@ BUFFER_FNS(PrivateStart, unwritten);
13201 #define current_pid() (current->pid) 13465 #define current_pid() (current->pid)
13202 #define current_fsuid(cred) (current->fsuid) 13466 #define current_fsuid(cred) (current->fsuid)
13203 #define current_fsgid(cred) (current->fsgid) 13467 #define current_fsgid(cred) (current->fsgid)
13204+#define current_fstag(cred,vp) (dx_current_fstag(vn_to_inode(vp)->i_sb)) 13468+#define current_fstag(cred,vp) (dx_current_fstag(vn_to_inode(vp)->i_sb))
13205 #define current_test_flags(f) (current->flags & (f)) 13469 #define current_test_flags(f) (current->flags & (f))
13206 #define current_set_flags_nested(sp, f) \ 13470 #define current_set_flags_nested(sp, f) \
13207 (*(sp) = current->flags, current->flags |= (f)) 13471 (*(sp) = current->flags, current->flags |= (f))
13208diff -NurpP --minimal linux-2.6.18.2/fs/xfs/linux-2.6/xfs_super.c linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_super.c 13472Index: linux-2.6.18/fs/xfs/linux-2.6/xfs_super.c
13209--- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_super.c 2006-09-20 16:58:39 +0200 13473===================================================================
13210+++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_super.c 2006-09-25 17:30:17 +0200 13474--- linux-2.6.18.orig/fs/xfs/linux-2.6/xfs_super.c
13475+++ linux-2.6.18/fs/xfs/linux-2.6/xfs_super.c
13211@@ -158,6 +158,7 @@ xfs_revalidate_inode( 13476@@ -158,6 +158,7 @@ xfs_revalidate_inode(
13212 inode->i_nlink = ip->i_d.di_nlink; 13477 inode->i_nlink = ip->i_d.di_nlink;
13213 inode->i_uid = ip->i_d.di_uid; 13478 inode->i_uid = ip->i_d.di_uid;
13214 inode->i_gid = ip->i_d.di_gid; 13479 inode->i_gid = ip->i_d.di_gid;
13215+ inode->i_tag = ip->i_d.di_tag; 13480+ inode->i_tag = ip->i_d.di_tag;
13311+ sb->s_dqh->dqh_qcop = &xfs_quotactl_operations; 13576+ sb->s_dqh->dqh_qcop = &xfs_quotactl_operations;
13312+#endif 13577+#endif
13313 sb->s_op = &xfs_super_operations; 13578 sb->s_op = &xfs_super_operations;
13314 13579
13315 error = bhv_vfs_mount(vfsp, args, NULL); 13580 error = bhv_vfs_mount(vfsp, args, NULL);
13316diff -NurpP --minimal linux-2.6.18.2/fs/xfs/linux-2.6/xfs_sysctl.c linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_sysctl.c 13581Index: linux-2.6.18/fs/xfs/linux-2.6/xfs_sysctl.c
13582===================================================================
13317--- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_sysctl.c 2006-09-20 16:58:39 +0200 13583--- linux-2.6.18.orig/fs/xfs/linux-2.6/xfs_sysctl.c
13318+++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_sysctl.c 2006-09-20 18:32:51 +0200 13584+++ linux-2.6.18/fs/xfs/linux-2.6/xfs_sysctl.c
13319@@ -57,79 +57,79 @@ xfs_stats_clear_proc_handler( 13585@@ -57,79 +57,79 @@ xfs_stats_clear_proc_handler(
13320 STATIC ctl_table xfs_table[] = { 13586 STATIC ctl_table xfs_table[] = {
13321 {XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val, 13587 {XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val,
13322 sizeof(int), 0644, NULL, &proc_dointvec_minmax, 13588 sizeof(int), 0644, NULL, &proc_dointvec_minmax,
13323- &sysctl_intvec, NULL, 13589- &sysctl_intvec, NULL,
13409- &sysctl_intvec, NULL, 13675- &sysctl_intvec, NULL,
13410+ NULL, &sysctl_intvec, NULL, 13676+ NULL, &sysctl_intvec, NULL,
13411 &xfs_params.stats_clear.min, &xfs_params.stats_clear.max}, 13677 &xfs_params.stats_clear.min, &xfs_params.stats_clear.max},
13412 #endif /* CONFIG_PROC_FS */ 13678 #endif /* CONFIG_PROC_FS */
13413 13679
13414diff -NurpP --minimal linux-2.6.18.2/fs/xfs/linux-2.6/xfs_vnode.c linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_vnode.c 13680Index: linux-2.6.18/fs/xfs/linux-2.6/xfs_vnode.c
13415--- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_vnode.c 2006-09-20 16:58:40 +0200 13681===================================================================
13416+++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_vnode.c 2006-09-25 15:40:02 +0200 13682--- linux-2.6.18.orig/fs/xfs/linux-2.6/xfs_vnode.c
13683+++ linux-2.6.18/fs/xfs/linux-2.6/xfs_vnode.c
13417@@ -119,6 +119,7 @@ vn_revalidate_core( 13684@@ -119,6 +119,7 @@ vn_revalidate_core(
13418 inode->i_nlink = vap->va_nlink; 13685 inode->i_nlink = vap->va_nlink;
13419 inode->i_uid = vap->va_uid; 13686 inode->i_uid = vap->va_uid;
13420 inode->i_gid = vap->va_gid; 13687 inode->i_gid = vap->va_gid;
13421+ inode->i_tag = vap->va_tag; 13688+ inode->i_tag = vap->va_tag;
13435+ else 13702+ else
13436+ inode->i_flags &= ~S_BARRIER; 13703+ inode->i_flags &= ~S_BARRIER;
13437 if (vap->va_xflags & XFS_XFLAG_APPEND) 13704 if (vap->va_xflags & XFS_XFLAG_APPEND)
13438 inode->i_flags |= S_APPEND; 13705 inode->i_flags |= S_APPEND;
13439 else 13706 else
13440diff -NurpP --minimal linux-2.6.18.2/fs/xfs/linux-2.6/xfs_vnode.h linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_vnode.h 13707Index: linux-2.6.18/fs/xfs/linux-2.6/xfs_vnode.h
13441--- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_vnode.h 2006-09-20 16:58:40 +0200 13708===================================================================
13442+++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_vnode.h 2006-09-25 15:40:02 +0200 13709--- linux-2.6.18.orig/fs/xfs/linux-2.6/xfs_vnode.h
13710+++ linux-2.6.18/fs/xfs/linux-2.6/xfs_vnode.h
13443@@ -352,6 +352,7 @@ typedef struct bhv_vattr { 13711@@ -352,6 +352,7 @@ typedef struct bhv_vattr {
13444 xfs_nlink_t va_nlink; /* number of references to file */ 13712 xfs_nlink_t va_nlink; /* number of references to file */
13445 uid_t va_uid; /* owner user id */ 13713 uid_t va_uid; /* owner user id */
13446 gid_t va_gid; /* owner group id */ 13714 gid_t va_gid; /* owner group id */
13447+ tag_t va_tag; /* owner group id */ 13715+ tag_t va_tag; /* owner group id */
13463+ XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_PROJID|XFS_AT_GENCOUNT\ 13731+ XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_PROJID|XFS_AT_GENCOUNT\
13464+ XFS_AT_TAG) 13732+ XFS_AT_TAG)
13465 13733
13466 #define XFS_AT_STAT (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\ 13734 #define XFS_AT_STAT (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
13467 XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\ 13735 XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
13468diff -NurpP --minimal linux-2.6.18.2/fs/xfs/quota/xfs_qm_syscalls.c linux-2.6.18.2-vs2.1.1/fs/xfs/quota/xfs_qm_syscalls.c 13736Index: linux-2.6.18/fs/xfs/quota/xfs_qm_syscalls.c
13737===================================================================
13469--- linux-2.6.18.2/fs/xfs/quota/xfs_qm_syscalls.c 2006-09-20 16:58:40 +0200 13738--- linux-2.6.18.orig/fs/xfs/quota/xfs_qm_syscalls.c
13470+++ linux-2.6.18.2-vs2.1.1/fs/xfs/quota/xfs_qm_syscalls.c 2006-09-20 17:01:44 +0200 13739+++ linux-2.6.18/fs/xfs/quota/xfs_qm_syscalls.c
13471@@ -213,7 +213,7 @@ xfs_qm_scall_quotaoff( 13740@@ -213,7 +213,7 @@ xfs_qm_scall_quotaoff(
13472 xfs_qoff_logitem_t *qoffstart; 13741 xfs_qoff_logitem_t *qoffstart;
13473 int nculprits; 13742 int nculprits;
13474 13743
13475- if (!force && !capable(CAP_SYS_ADMIN)) 13744- if (!force && !capable(CAP_SYS_ADMIN))
13502- if (!capable(CAP_SYS_ADMIN)) 13771- if (!capable(CAP_SYS_ADMIN))
13503+ if (!vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL)) 13772+ if (!vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
13504 return XFS_ERROR(EPERM); 13773 return XFS_ERROR(EPERM);
13505 13774
13506 if ((newlim->d_fieldmask & 13775 if ((newlim->d_fieldmask &
13507diff -NurpP --minimal linux-2.6.18.2/fs/xfs/xfs_clnt.h linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_clnt.h 13776Index: linux-2.6.18/fs/xfs/xfs_clnt.h
13508--- linux-2.6.18.2/fs/xfs/xfs_clnt.h 2006-06-18 04:54:50 +0200 13777===================================================================
13509+++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_clnt.h 2006-09-25 15:40:02 +0200 13778--- linux-2.6.18.orig/fs/xfs/xfs_clnt.h
13779+++ linux-2.6.18/fs/xfs/xfs_clnt.h
13510@@ -99,5 +99,7 @@ struct xfs_mount_args { 13780@@ -99,5 +99,7 @@ struct xfs_mount_args {
13511 */ 13781 */
13512 #define XFSMNT2_COMPAT_IOSIZE 0x00000001 /* don't report large preferred 13782 #define XFSMNT2_COMPAT_IOSIZE 0x00000001 /* don't report large preferred
13513 * I/O size in stat(2) */ 13783 * I/O size in stat(2) */
13514+#define XFSMNT2_TAGGED 0x80000000 /* context tagging */ 13784+#define XFSMNT2_TAGGED 0x80000000 /* context tagging */
13515+ 13785+
13516 13786
13517 #endif /* __XFS_CLNT_H__ */ 13787 #endif /* __XFS_CLNT_H__ */
13518diff -NurpP --minimal linux-2.6.18.2/fs/xfs/xfs_dinode.h linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_dinode.h 13788Index: linux-2.6.18/fs/xfs/xfs_dinode.h
13519--- linux-2.6.18.2/fs/xfs/xfs_dinode.h 2006-09-20 16:58:40 +0200 13789===================================================================
13520+++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_dinode.h 2006-09-25 15:40:02 +0200 13790--- linux-2.6.18.orig/fs/xfs/xfs_dinode.h
13791+++ linux-2.6.18/fs/xfs/xfs_dinode.h
13521@@ -53,7 +53,8 @@ typedef struct xfs_dinode_core 13792@@ -53,7 +53,8 @@ typedef struct xfs_dinode_core
13522 __uint32_t di_gid; /* owner's group id */ 13793 __uint32_t di_gid; /* owner's group id */
13523 __uint32_t di_nlink; /* number of links to file */ 13794 __uint32_t di_nlink; /* number of links to file */
13524 __uint16_t di_projid; /* owner's project id */ 13795 __uint16_t di_projid; /* owner's project id */
13525- __uint8_t di_pad[8]; /* unused, zeroed space */ 13796- __uint8_t di_pad[8]; /* unused, zeroed space */
13553- XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG) 13824- XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG)
13554+ XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_BARRIER | \ 13825+ XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_BARRIER | \
13555+ XFS_DIFLAG_IUNLINK) 13826+ XFS_DIFLAG_IUNLINK)
13556 13827
13557 #endif /* __XFS_DINODE_H__ */ 13828 #endif /* __XFS_DINODE_H__ */
13558diff -NurpP --minimal linux-2.6.18.2/fs/xfs/xfs_fs.h linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_fs.h 13829Index: linux-2.6.18/fs/xfs/xfs_fs.h
13559--- linux-2.6.18.2/fs/xfs/xfs_fs.h 2006-09-20 16:58:40 +0200 13830===================================================================
13560+++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_fs.h 2006-09-25 15:40:02 +0200 13831--- linux-2.6.18.orig/fs/xfs/xfs_fs.h
13832+++ linux-2.6.18/fs/xfs/xfs_fs.h
13561@@ -68,6 +68,8 @@ struct fsxattr { 13833@@ -68,6 +68,8 @@ struct fsxattr {
13562 #define XFS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ 13834 #define XFS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */
13563 #define XFS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ 13835 #define XFS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */
13564 #define XFS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ 13836 #define XFS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */
13565+#define XFS_XFLAG_BARRIER 0x00004000 /* chroot() barrier */ 13837+#define XFS_XFLAG_BARRIER 0x00004000 /* chroot() barrier */
13575+ __u16 bs_tag; /* context tagging */ 13847+ __u16 bs_tag; /* context tagging */
13576+ unsigned char bs_pad[12]; /* pad space, unused */ 13848+ unsigned char bs_pad[12]; /* pad space, unused */
13577 __u32 bs_dmevmask; /* DMIG event mask */ 13849 __u32 bs_dmevmask; /* DMIG event mask */
13578 __u16 bs_dmstate; /* DMIG state info */ 13850 __u16 bs_dmstate; /* DMIG state info */
13579 __u16 bs_aextents; /* attribute number of extents */ 13851 __u16 bs_aextents; /* attribute number of extents */
13580diff -NurpP --minimal linux-2.6.18.2/fs/xfs/xfs_inode.c linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_inode.c 13852Index: linux-2.6.18/fs/xfs/xfs_inode.c
13581--- linux-2.6.18.2/fs/xfs/xfs_inode.c 2006-09-20 16:58:40 +0200 13853===================================================================
13582+++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_inode.c 2006-09-25 15:40:02 +0200 13854--- linux-2.6.18.orig/fs/xfs/xfs_inode.c
13855+++ linux-2.6.18/fs/xfs/xfs_inode.c
13583@@ -50,6 +50,7 @@ 13856@@ -50,6 +50,7 @@
13584 #include "xfs_mac.h" 13857 #include "xfs_mac.h"
13585 #include "xfs_acl.h" 13858 #include "xfs_acl.h"
13586 13859
13587+#include <linux/vs_tag.h> 13860+#include <linux/vs_tag.h>
13643 ip->i_d.di_gid = current_fsgid(cr); 13916 ip->i_d.di_gid = current_fsgid(cr);
13644+ ip->i_d.di_tag = current_fstag(cr, vp); 13917+ ip->i_d.di_tag = current_fstag(cr, vp);
13645 ip->i_d.di_projid = prid; 13918 ip->i_d.di_projid = prid;
13646 memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); 13919 memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad));
13647 13920
13648diff -NurpP --minimal linux-2.6.18.2/fs/xfs/xfs_itable.c linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_itable.c 13921Index: linux-2.6.18/fs/xfs/xfs_itable.c
13649--- linux-2.6.18.2/fs/xfs/xfs_itable.c 2006-09-20 16:58:40 +0200 13922===================================================================
13650+++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_itable.c 2006-09-25 15:40:02 +0200 13923--- linux-2.6.18.orig/fs/xfs/xfs_itable.c
13924+++ linux-2.6.18/fs/xfs/xfs_itable.c
13651@@ -78,6 +78,7 @@ xfs_bulkstat_one_iget( 13925@@ -78,6 +78,7 @@ xfs_bulkstat_one_iget(
13652 buf->bs_mode = dic->di_mode; 13926 buf->bs_mode = dic->di_mode;
13653 buf->bs_uid = dic->di_uid; 13927 buf->bs_uid = dic->di_uid;
13654 buf->bs_gid = dic->di_gid; 13928 buf->bs_gid = dic->di_gid;
13655+ buf->bs_tag = dic->di_tag; 13929+ buf->bs_tag = dic->di_tag;
13662 buf->bs_gid = INT_GET(dic->di_gid, ARCH_CONVERT); 13936 buf->bs_gid = INT_GET(dic->di_gid, ARCH_CONVERT);
13663+ buf->bs_tag = INT_GET(dic->di_tag, ARCH_CONVERT); 13937+ buf->bs_tag = INT_GET(dic->di_tag, ARCH_CONVERT);
13664 buf->bs_size = INT_GET(dic->di_size, ARCH_CONVERT); 13938 buf->bs_size = INT_GET(dic->di_size, ARCH_CONVERT);
13665 buf->bs_atime.tv_sec = INT_GET(dic->di_atime.t_sec, ARCH_CONVERT); 13939 buf->bs_atime.tv_sec = INT_GET(dic->di_atime.t_sec, ARCH_CONVERT);
13666 buf->bs_atime.tv_nsec = INT_GET(dic->di_atime.t_nsec, ARCH_CONVERT); 13940 buf->bs_atime.tv_nsec = INT_GET(dic->di_atime.t_nsec, ARCH_CONVERT);
13667diff -NurpP --minimal linux-2.6.18.2/fs/xfs/xfs_mount.h linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_mount.h 13941Index: linux-2.6.18/fs/xfs/xfs_mount.h
13668--- linux-2.6.18.2/fs/xfs/xfs_mount.h 2006-09-20 16:58:40 +0200 13942===================================================================
13669+++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_mount.h 2006-09-25 15:40:02 +0200 13943--- linux-2.6.18.orig/fs/xfs/xfs_mount.h
13944+++ linux-2.6.18/fs/xfs/xfs_mount.h
13670@@ -460,6 +460,7 @@ typedef struct xfs_mount { 13945@@ -460,6 +460,7 @@ typedef struct xfs_mount {
13671 #define XFS_MOUNT_NO_PERCPU_SB (1ULL << 23) /* don't use per-cpu superblock 13946 #define XFS_MOUNT_NO_PERCPU_SB (1ULL << 23) /* don't use per-cpu superblock
13672 counters */ 13947 counters */
13673 13948
13674+#define XFS_MOUNT_TAGGED (1ULL << 31) /* context tagging */ 13949+#define XFS_MOUNT_TAGGED (1ULL << 31) /* context tagging */
13675 13950
13676 /* 13951 /*
13677 * Default minimum read and write sizes. 13952 * Default minimum read and write sizes.
13678diff -NurpP --minimal linux-2.6.18.2/fs/xfs/xfs_vfsops.c linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_vfsops.c 13953Index: linux-2.6.18/fs/xfs/xfs_vfsops.c
13679--- linux-2.6.18.2/fs/xfs/xfs_vfsops.c 2006-09-20 16:58:40 +0200 13954===================================================================
13680+++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_vfsops.c 2006-09-25 15:40:02 +0200 13955--- linux-2.6.18.orig/fs/xfs/xfs_vfsops.c
13956+++ linux-2.6.18/fs/xfs/xfs_vfsops.c
13681@@ -300,6 +300,8 @@ xfs_start_flags( 13957@@ -300,6 +300,8 @@ xfs_start_flags(
13682 13958
13683 if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE) 13959 if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE)
13684 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; 13960 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE;
13685+ if (ap->flags2 & XFSMNT2_TAGGED) 13961+ if (ap->flags2 & XFSMNT2_TAGGED)
13724+ args->flags2 |= XFSMNT2_TAGGED; 14000+ args->flags2 |= XFSMNT2_TAGGED;
13725+#endif 14001+#endif
13726 } else if (!strcmp(this_char, "osyncisdsync")) { 14002 } else if (!strcmp(this_char, "osyncisdsync")) {
13727 /* no-op, this is now the default */ 14003 /* no-op, this is now the default */
13728 cmn_err(CE_WARN, 14004 cmn_err(CE_WARN,
13729diff -NurpP --minimal linux-2.6.18.2/fs/xfs/xfs_vnodeops.c linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_vnodeops.c 14005Index: linux-2.6.18/fs/xfs/xfs_vnodeops.c
13730--- linux-2.6.18.2/fs/xfs/xfs_vnodeops.c 2006-09-20 16:58:40 +0200 14006===================================================================
13731+++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_vnodeops.c 2006-09-25 15:40:02 +0200 14007--- linux-2.6.18.orig/fs/xfs/xfs_vnodeops.c
14008+++ linux-2.6.18/fs/xfs/xfs_vnodeops.c
13732@@ -160,6 +160,7 @@ xfs_getattr( 14009@@ -160,6 +160,7 @@ xfs_getattr(
13733 vap->va_mode = ip->i_d.di_mode; 14010 vap->va_mode = ip->i_d.di_mode;
13734 vap->va_uid = ip->i_d.di_uid; 14011 vap->va_uid = ip->i_d.di_uid;
13735 vap->va_gid = ip->i_d.di_gid; 14012 vap->va_gid = ip->i_d.di_gid;
13736+ vap->va_tag = ip->i_d.di_tag; 14013+ vap->va_tag = ip->i_d.di_tag;
13825+ if (vap->va_xflags & XFS_XFLAG_BARRIER) 14102+ if (vap->va_xflags & XFS_XFLAG_BARRIER)
13826+ di_flags |= XFS_DIFLAG_BARRIER; 14103+ di_flags |= XFS_DIFLAG_BARRIER;
13827 if (vap->va_xflags & XFS_XFLAG_APPEND) 14104 if (vap->va_xflags & XFS_XFLAG_APPEND)
13828 di_flags |= XFS_DIFLAG_APPEND; 14105 di_flags |= XFS_DIFLAG_APPEND;
13829 if (vap->va_xflags & XFS_XFLAG_SYNC) 14106 if (vap->va_xflags & XFS_XFLAG_SYNC)
13830diff -NurpP --minimal linux-2.6.18.2/include/asm-arm/tlb.h linux-2.6.18.2-vs2.1.1/include/asm-arm/tlb.h 14107Index: linux-2.6.18/include/asm-arm/tlb.h
13831--- linux-2.6.18.2/include/asm-arm/tlb.h 2006-06-18 04:54:58 +0200 14108===================================================================
13832+++ linux-2.6.18.2-vs2.1.1/include/asm-arm/tlb.h 2006-09-20 17:01:44 +0200 14109--- linux-2.6.18.orig/include/asm-arm/tlb.h
14110+++ linux-2.6.18/include/asm-arm/tlb.h
13833@@ -28,6 +28,7 @@ 14111@@ -28,6 +28,7 @@
13834 #else /* !CONFIG_MMU */ 14112 #else /* !CONFIG_MMU */
13835 14113
13836 #include <asm/pgalloc.h> 14114 #include <asm/pgalloc.h>
13837+#include <linux/vs_memory.h> 14115+#include <linux/vs_memory.h>
13838 14116
13839 /* 14117 /*
13840 * TLB handling. This allows us to remove pages from the page 14118 * TLB handling. This allows us to remove pages from the page
13841diff -NurpP --minimal linux-2.6.18.2/include/asm-arm26/tlb.h linux-2.6.18.2-vs2.1.1/include/asm-arm26/tlb.h 14119Index: linux-2.6.18/include/asm-arm26/tlb.h
13842--- linux-2.6.18.2/include/asm-arm26/tlb.h 2006-01-03 17:30:02 +0100 14120===================================================================
13843+++ linux-2.6.18.2-vs2.1.1/include/asm-arm26/tlb.h 2006-09-20 17:01:44 +0200 14121--- linux-2.6.18.orig/include/asm-arm26/tlb.h
14122+++ linux-2.6.18/include/asm-arm26/tlb.h
13844@@ -3,6 +3,7 @@ 14123@@ -3,6 +3,7 @@
13845 14124
13846 #include <asm/pgalloc.h> 14125 #include <asm/pgalloc.h>
13847 #include <asm/tlbflush.h> 14126 #include <asm/tlbflush.h>
13848+#include <linux/vs_memory.h> 14127+#include <linux/vs_memory.h>
13849 14128
13850 /* 14129 /*
13851 * TLB handling. This allows us to remove pages from the page 14130 * TLB handling. This allows us to remove pages from the page
13852diff -NurpP --minimal linux-2.6.18.2/include/asm-arm26/unistd.h linux-2.6.18.2-vs2.1.1/include/asm-arm26/unistd.h 14131Index: linux-2.6.18/include/asm-arm26/unistd.h
13853--- linux-2.6.18.2/include/asm-arm26/unistd.h 2006-09-20 16:58:40 +0200 14132===================================================================
13854+++ linux-2.6.18.2-vs2.1.1/include/asm-arm26/unistd.h 2006-09-20 17:01:44 +0200 14133--- linux-2.6.18.orig/include/asm-arm26/unistd.h
14134+++ linux-2.6.18/include/asm-arm26/unistd.h
13855@@ -302,6 +302,8 @@ 14135@@ -302,6 +302,8 @@
13856 #define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279) 14136 #define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
13857 #define __NR_waitid (__NR_SYSCALL_BASE+280) 14137 #define __NR_waitid (__NR_SYSCALL_BASE+280)
13858 14138
13859+#define __NR_vserver (__NR_SYSCALL_BASE+313) 14139+#define __NR_vserver (__NR_SYSCALL_BASE+313)
13860+ 14140+
13861 /* 14141 /*
13862 * The following SWIs are ARM private. FIXME - make appropriate for arm26 14142 * The following SWIs are ARM private. FIXME - make appropriate for arm26
13863 */ 14143 */
13864diff -NurpP --minimal linux-2.6.18.2/include/asm-generic/tlb.h linux-2.6.18.2-vs2.1.1/include/asm-generic/tlb.h 14144Index: linux-2.6.18/include/asm-generic/tlb.h
13865--- linux-2.6.18.2/include/asm-generic/tlb.h 2006-09-20 16:58:40 +0200 14145===================================================================
13866+++ linux-2.6.18.2-vs2.1.1/include/asm-generic/tlb.h 2006-09-20 17:01:44 +0200 14146--- linux-2.6.18.orig/include/asm-generic/tlb.h
14147+++ linux-2.6.18/include/asm-generic/tlb.h
13867@@ -14,6 +14,7 @@ 14148@@ -14,6 +14,7 @@
13868 #define _ASM_GENERIC__TLB_H 14149 #define _ASM_GENERIC__TLB_H
13869 14150
13870 #include <linux/swap.h> 14151 #include <linux/swap.h>
13871+#include <linux/vs_memory.h> 14152+#include <linux/vs_memory.h>
13872 #include <asm/pgalloc.h> 14153 #include <asm/pgalloc.h>
13873 #include <asm/tlbflush.h> 14154 #include <asm/tlbflush.h>
13874 14155
13875diff -NurpP --minimal linux-2.6.18.2/include/asm-i386/elf.h linux-2.6.18.2-vs2.1.1/include/asm-i386/elf.h 14156Index: linux-2.6.18/include/asm-i386/elf.h
13876--- linux-2.6.18.2/include/asm-i386/elf.h 2006-09-20 16:58:40 +0200 14157===================================================================
13877+++ linux-2.6.18.2-vs2.1.1/include/asm-i386/elf.h 2006-09-25 15:40:02 +0200 14158--- linux-2.6.18.orig/include/asm-i386/elf.h
14159+++ linux-2.6.18/include/asm-i386/elf.h
13878@@ -75,7 +75,7 @@ typedef struct user_fxsr_struct elf_fpxr 14160@@ -75,7 +75,7 @@ typedef struct user_fxsr_struct elf_fpxr
13879 the loader. We need to make sure that it is out of the way of the program 14161 the loader. We need to make sure that it is out of the way of the program
13880 that it will "exec", and that there is sufficient room for the brk. */ 14162 that it will "exec", and that there is sufficient room for the brk. */
13881 14163
13882-#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2) 14164-#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
13891-#define ELF_PLATFORM (system_utsname.machine) 14173-#define ELF_PLATFORM (system_utsname.machine)
13892+#define ELF_PLATFORM (vx_new_uts(machine)) 14174+#define ELF_PLATFORM (vx_new_uts(machine))
13893 14175
13894 #define SET_PERSONALITY(ex, ibcs2) do { } while (0) 14176 #define SET_PERSONALITY(ex, ibcs2) do { } while (0)
13895 14177
13896diff -NurpP --minimal linux-2.6.18.2/include/asm-ia64/tlb.h linux-2.6.18.2-vs2.1.1/include/asm-ia64/tlb.h 14178Index: linux-2.6.18/include/asm-ia64/tlb.h
13897--- linux-2.6.18.2/include/asm-ia64/tlb.h 2006-09-20 16:58:40 +0200 14179===================================================================
13898+++ linux-2.6.18.2-vs2.1.1/include/asm-ia64/tlb.h 2006-09-20 17:01:44 +0200 14180--- linux-2.6.18.orig/include/asm-ia64/tlb.h
14181+++ linux-2.6.18/include/asm-ia64/tlb.h
13899@@ -40,6 +40,7 @@ 14182@@ -40,6 +40,7 @@
13900 #include <linux/mm.h> 14183 #include <linux/mm.h>
13901 #include <linux/pagemap.h> 14184 #include <linux/pagemap.h>
13902 #include <linux/swap.h> 14185 #include <linux/swap.h>
13903+#include <linux/vs_memory.h> 14186+#include <linux/vs_memory.h>
13904 14187
13905 #include <asm/pgalloc.h> 14188 #include <asm/pgalloc.h>
13906 #include <asm/processor.h> 14189 #include <asm/processor.h>
13907diff -NurpP --minimal linux-2.6.18.2/include/asm-mips/irq.h linux-2.6.18.2-vs2.1.1/include/asm-mips/irq.h 14190Index: linux-2.6.18/include/asm-mips/irq.h
13908--- linux-2.6.18.2/include/asm-mips/irq.h 2006-09-20 16:58:41 +0200 14191===================================================================
13909+++ linux-2.6.18.2-vs2.1.1/include/asm-mips/irq.h 2006-10-13 20:55:06 +0200 14192--- linux-2.6.18.orig/include/asm-mips/irq.h
14193+++ linux-2.6.18/include/asm-mips/irq.h
13910@@ -10,6 +10,7 @@ 14194@@ -10,6 +10,7 @@
13911 #define _ASM_IRQ_H 14195 #define _ASM_IRQ_H
13912 14196
13913 #include <linux/linkage.h> 14197 #include <linux/linkage.h>
13914+#include <linux/vs_context.h> 14198+#include <linux/vs_context.h>
13927 __do_IRQ((irq), (regs)); \ 14211 __do_IRQ((irq), (regs)); \
13928+ __leave_vx_admin(&vxis); \ 14212+ __leave_vx_admin(&vxis); \
13929 irq_exit(); \ 14213 irq_exit(); \
13930 } while (0) 14214 } while (0)
13931 14215
13932diff -NurpP --minimal linux-2.6.18.2/include/asm-powerpc/systbl.h linux-2.6.18.2-vs2.1.1/include/asm-powerpc/systbl.h 14216Index: linux-2.6.18/include/asm-powerpc/systbl.h
13933--- linux-2.6.18.2/include/asm-powerpc/systbl.h 2006-09-20 16:58:41 +0200 14217===================================================================
13934+++ linux-2.6.18.2-vs2.1.1/include/asm-powerpc/systbl.h 2006-09-20 20:01:36 +0200 14218--- linux-2.6.18.orig/include/asm-powerpc/systbl.h
14219+++ linux-2.6.18/include/asm-powerpc/systbl.h
13935@@ -260,7 +260,7 @@ COMPAT_SYS_SPU(fstatfs64) 14220@@ -260,7 +260,7 @@ COMPAT_SYS_SPU(fstatfs64)
13936 SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64) 14221 SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
13937 PPC_SYS_SPU(rtas) 14222 PPC_SYS_SPU(rtas)
13938 OLDSYS(debug_setcontext) 14223 OLDSYS(debug_setcontext)
13939-SYSCALL(ni_syscall) 14224-SYSCALL(ni_syscall)
13940+SYSX(sys_vserver, sys32_vserver, sys_vserver) 14225+SYSX(sys_vserver, sys32_vserver, sys_vserver)
13941 SYSCALL(ni_syscall) 14226 SYSCALL(ni_syscall)
13942 COMPAT_SYS(mbind) 14227 COMPAT_SYS(mbind)
13943 COMPAT_SYS(get_mempolicy) 14228 COMPAT_SYS(get_mempolicy)
13944diff -NurpP --minimal linux-2.6.18.2/include/asm-powerpc/unistd.h linux-2.6.18.2-vs2.1.1/include/asm-powerpc/unistd.h 14229Index: linux-2.6.18/include/asm-powerpc/unistd.h
13945--- linux-2.6.18.2/include/asm-powerpc/unistd.h 2006-09-20 16:58:41 +0200 14230===================================================================
13946+++ linux-2.6.18.2-vs2.1.1/include/asm-powerpc/unistd.h 2006-09-20 17:01:44 +0200 14231--- linux-2.6.18.orig/include/asm-powerpc/unistd.h
14232+++ linux-2.6.18/include/asm-powerpc/unistd.h
13947@@ -275,7 +275,7 @@ 14233@@ -275,7 +275,7 @@
13948 #endif 14234 #endif
13949 #define __NR_rtas 255 14235 #define __NR_rtas 255
13950 #define __NR_sys_debug_setcontext 256 14236 #define __NR_sys_debug_setcontext 256
13951-/* Number 257 is reserved for vserver */ 14237-/* Number 257 is reserved for vserver */
13952+#define __NR_vserver 257 14238+#define __NR_vserver 257
13953 /* 258 currently unused */ 14239 /* 258 currently unused */
13954 #define __NR_mbind 259 14240 #define __NR_mbind 259
13955 #define __NR_get_mempolicy 260 14241 #define __NR_get_mempolicy 260
13956diff -NurpP --minimal linux-2.6.18.2/include/asm-s390/unistd.h linux-2.6.18.2-vs2.1.1/include/asm-s390/unistd.h 14242Index: linux-2.6.18/include/asm-s390/unistd.h
13957--- linux-2.6.18.2/include/asm-s390/unistd.h 2006-09-20 16:58:43 +0200 14243===================================================================
13958+++ linux-2.6.18.2-vs2.1.1/include/asm-s390/unistd.h 2006-09-20 17:01:44 +0200 14244--- linux-2.6.18.orig/include/asm-s390/unistd.h
14245+++ linux-2.6.18/include/asm-s390/unistd.h
13959@@ -255,7 +255,7 @@ 14246@@ -255,7 +255,7 @@
13960 #define __NR_clock_gettime (__NR_timer_create+6) 14247 #define __NR_clock_gettime (__NR_timer_create+6)
13961 #define __NR_clock_getres (__NR_timer_create+7) 14248 #define __NR_clock_getres (__NR_timer_create+7)
13962 #define __NR_clock_nanosleep (__NR_timer_create+8) 14249 #define __NR_clock_nanosleep (__NR_timer_create+8)
13963-/* Number 263 is reserved for vserver */ 14250-/* Number 263 is reserved for vserver */
13964+#define __NR_vserver 263 14251+#define __NR_vserver 263
13965 #define __NR_fadvise64_64 264 14252 #define __NR_fadvise64_64 264
13966 #define __NR_statfs64 265 14253 #define __NR_statfs64 265
13967 #define __NR_fstatfs64 266 14254 #define __NR_fstatfs64 266
13968diff -NurpP --minimal linux-2.6.18.2/include/asm-sparc/unistd.h linux-2.6.18.2-vs2.1.1/include/asm-sparc/unistd.h 14255Index: linux-2.6.18/include/asm-sparc/unistd.h
13969--- linux-2.6.18.2/include/asm-sparc/unistd.h 2006-09-20 16:58:43 +0200 14256===================================================================
13970+++ linux-2.6.18.2-vs2.1.1/include/asm-sparc/unistd.h 2006-09-20 17:01:44 +0200 14257--- linux-2.6.18.orig/include/asm-sparc/unistd.h
14258+++ linux-2.6.18/include/asm-sparc/unistd.h
13971@@ -283,7 +283,7 @@ 14259@@ -283,7 +283,7 @@
13972 #define __NR_timer_getoverrun 264 14260 #define __NR_timer_getoverrun 264
13973 #define __NR_timer_delete 265 14261 #define __NR_timer_delete 265
13974 #define __NR_timer_create 266 14262 #define __NR_timer_create 266
13975-/* #define __NR_vserver 267 Reserved for VSERVER */ 14263-/* #define __NR_vserver 267 Reserved for VSERVER */
13976+#define __NR_vserver 267 14264+#define __NR_vserver 267
13977 #define __NR_io_setup 268 14265 #define __NR_io_setup 268
13978 #define __NR_io_destroy 269 14266 #define __NR_io_destroy 269
13979 #define __NR_io_submit 270 14267 #define __NR_io_submit 270
13980diff -NurpP --minimal linux-2.6.18.2/include/asm-sparc64/tlb.h linux-2.6.18.2-vs2.1.1/include/asm-sparc64/tlb.h 14268Index: linux-2.6.18/include/asm-sparc64/tlb.h
13981--- linux-2.6.18.2/include/asm-sparc64/tlb.h 2006-09-20 16:58:43 +0200 14269===================================================================
13982+++ linux-2.6.18.2-vs2.1.1/include/asm-sparc64/tlb.h 2006-09-20 17:01:44 +0200 14270--- linux-2.6.18.orig/include/asm-sparc64/tlb.h
14271+++ linux-2.6.18/include/asm-sparc64/tlb.h
13983@@ -2,6 +2,7 @@ 14272@@ -2,6 +2,7 @@
13984 #define _SPARC64_TLB_H 14273 #define _SPARC64_TLB_H
13985 14274
13986 #include <linux/swap.h> 14275 #include <linux/swap.h>
13987+#include <linux/vs_memory.h> 14276+#include <linux/vs_memory.h>
13988 #include <asm/pgalloc.h> 14277 #include <asm/pgalloc.h>
13989 #include <asm/tlbflush.h> 14278 #include <asm/tlbflush.h>
13990 #include <asm/mmu_context.h> 14279 #include <asm/mmu_context.h>
13991diff -NurpP --minimal linux-2.6.18.2/include/asm-sparc64/unistd.h linux-2.6.18.2-vs2.1.1/include/asm-sparc64/unistd.h 14280Index: linux-2.6.18/include/asm-sparc64/unistd.h
13992--- linux-2.6.18.2/include/asm-sparc64/unistd.h 2006-09-20 16:58:43 +0200 14281===================================================================
13993+++ linux-2.6.18.2-vs2.1.1/include/asm-sparc64/unistd.h 2006-09-20 17:01:44 +0200 14282--- linux-2.6.18.orig/include/asm-sparc64/unistd.h
14283+++ linux-2.6.18/include/asm-sparc64/unistd.h
13994@@ -285,7 +285,7 @@ 14284@@ -285,7 +285,7 @@
13995 #define __NR_timer_getoverrun 264 14285 #define __NR_timer_getoverrun 264
13996 #define __NR_timer_delete 265 14286 #define __NR_timer_delete 265
13997 #define __NR_timer_create 266 14287 #define __NR_timer_create 266
13998-/* #define __NR_vserver 267 Reserved for VSERVER */ 14288-/* #define __NR_vserver 267 Reserved for VSERVER */
13999+#define __NR_vserver 267 14289+#define __NR_vserver 267
14000 #define __NR_io_setup 268 14290 #define __NR_io_setup 268
14001 #define __NR_io_destroy 269 14291 #define __NR_io_destroy 269
14002 #define __NR_io_submit 270 14292 #define __NR_io_submit 270
14003diff -NurpP --minimal linux-2.6.18.2/include/asm-x86_64/unistd.h linux-2.6.18.2-vs2.1.1/include/asm-x86_64/unistd.h 14293Index: linux-2.6.18/include/asm-x86_64/unistd.h
14004--- linux-2.6.18.2/include/asm-x86_64/unistd.h 2006-09-20 16:58:43 +0200 14294===================================================================
14005+++ linux-2.6.18.2-vs2.1.1/include/asm-x86_64/unistd.h 2006-09-20 17:01:44 +0200 14295--- linux-2.6.18.orig/include/asm-x86_64/unistd.h
14296+++ linux-2.6.18/include/asm-x86_64/unistd.h
14006@@ -532,7 +532,7 @@ __SYSCALL(__NR_tgkill, sys_tgkill) 14297@@ -532,7 +532,7 @@ __SYSCALL(__NR_tgkill, sys_tgkill)
14007 #define __NR_utimes 235 14298 #define __NR_utimes 235
14008 __SYSCALL(__NR_utimes, sys_utimes) 14299 __SYSCALL(__NR_utimes, sys_utimes)
14009 #define __NR_vserver 236 14300 #define __NR_vserver 236
14010-__SYSCALL(__NR_vserver, sys_ni_syscall) 14301-__SYSCALL(__NR_vserver, sys_ni_syscall)
14011+__SYSCALL(__NR_vserver, sys_vserver) 14302+__SYSCALL(__NR_vserver, sys_vserver)
14012 #define __NR_mbind 237 14303 #define __NR_mbind 237
14013 __SYSCALL(__NR_mbind, sys_mbind) 14304 __SYSCALL(__NR_mbind, sys_mbind)
14014 #define __NR_set_mempolicy 238 14305 #define __NR_set_mempolicy 238
14015diff -NurpP --minimal linux-2.6.18.2/include/linux/Kbuild linux-2.6.18.2-vs2.1.1/include/linux/Kbuild 14306Index: linux-2.6.18/include/linux/Kbuild
14016--- linux-2.6.18.2/include/linux/Kbuild 2006-11-04 19:43:24 +0100 14307===================================================================
14017+++ linux-2.6.18.2-vs2.1.1/include/linux/Kbuild 2006-10-18 01:14:30 +0200 14308--- linux-2.6.18.orig/include/linux/Kbuild
14309+++ linux-2.6.18/include/linux/Kbuild
14018@@ -341,3 +341,6 @@ unifdef-y += xfrm.h 14310@@ -341,3 +341,6 @@ unifdef-y += xfrm.h
14019 unifdef-y += zftape.h 14311 unifdef-y += zftape.h
14020 14312
14021 objhdr-y += version.h 14313 objhdr-y += version.h
14022+ 14314+
14023+header-y += vserver/ 14315+header-y += vserver/
14024+ 14316+
14025diff -NurpP --minimal linux-2.6.18.2/include/linux/capability.h linux-2.6.18.2-vs2.1.1/include/linux/capability.h 14317Index: linux-2.6.18/include/linux/capability.h
14026--- linux-2.6.18.2/include/linux/capability.h 2006-06-18 04:55:15 +0200 14318===================================================================
14027+++ linux-2.6.18.2-vs2.1.1/include/linux/capability.h 2006-09-20 17:01:45 +0200 14319--- linux-2.6.18.orig/include/linux/capability.h
14320+++ linux-2.6.18/include/linux/capability.h
14028@@ -235,6 +235,7 @@ typedef __u32 kernel_cap_t; 14321@@ -235,6 +235,7 @@ typedef __u32 kernel_cap_t;
14029 arbitrary SCSI commands */ 14322 arbitrary SCSI commands */
14030 /* Allow setting encryption key on loopback filesystem */ 14323 /* Allow setting encryption key on loopback filesystem */
14031 /* Allow setting zone reclaim policy */ 14324 /* Allow setting zone reclaim policy */
14032+/* Allow the selection of a security context */ 14325+/* Allow the selection of a security context */
14043+#define CAP_CONTEXT 31 14336+#define CAP_CONTEXT 31
14044+ 14337+
14045 #ifdef __KERNEL__ 14338 #ifdef __KERNEL__
14046 /* 14339 /*
14047 * Bounding set 14340 * Bounding set
14048diff -NurpP --minimal linux-2.6.18.2/include/linux/devpts_fs.h linux-2.6.18.2-vs2.1.1/include/linux/devpts_fs.h 14341Index: linux-2.6.18/include/linux/devpts_fs.h
14049--- linux-2.6.18.2/include/linux/devpts_fs.h 2004-08-14 12:55:59 +0200 14342===================================================================
14050+++ linux-2.6.18.2-vs2.1.1/include/linux/devpts_fs.h 2006-09-20 17:01:45 +0200 14343--- linux-2.6.18.orig/include/linux/devpts_fs.h
14344+++ linux-2.6.18/include/linux/devpts_fs.h
14051@@ -30,5 +30,7 @@ static inline void devpts_pty_kill(int n 14345@@ -30,5 +30,7 @@ static inline void devpts_pty_kill(int n
14052 14346
14053 #endif 14347 #endif
14054 14348
14055+#define DEVPTS_SUPER_MAGIC 0x00001cd1 14349+#define DEVPTS_SUPER_MAGIC 0x00001cd1
14056+ 14350+
14057 14351
14058 #endif /* _LINUX_DEVPTS_FS_H */ 14352 #endif /* _LINUX_DEVPTS_FS_H */
14059diff -NurpP --minimal linux-2.6.18.2/include/linux/ext2_fs.h linux-2.6.18.2-vs2.1.1/include/linux/ext2_fs.h 14353Index: linux-2.6.18/include/linux/ext2_fs.h
14060--- linux-2.6.18.2/include/linux/ext2_fs.h 2006-09-20 16:58:43 +0200 14354===================================================================
14061+++ linux-2.6.18.2-vs2.1.1/include/linux/ext2_fs.h 2006-11-04 08:24:09 +0100 14355--- linux-2.6.18.orig/include/linux/ext2_fs.h
14356+++ linux-2.6.18/include/linux/ext2_fs.h
14062@@ -192,10 +192,17 @@ struct ext2_group_desc 14357@@ -192,10 +192,17 @@ struct ext2_group_desc
14063 #define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ 14358 #define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */
14064 #define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ 14359 #define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
14065 #define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ 14360 #define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
14066+#define EXT2_BARRIER_FL 0x04000000 /* Barrier for chroot() */ 14361+#define EXT2_BARRIER_FL 0x04000000 /* Barrier for chroot() */
14104+#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ 14399+#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */
14105+#define EXT2_MOUNT_TAGGED (1<<24) /* Enable Context Tags */ 14400+#define EXT2_MOUNT_TAGGED (1<<24) /* Enable Context Tags */
14106 14401
14107 14402
14108 #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt 14403 #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
14109diff -NurpP --minimal linux-2.6.18.2/include/linux/ext3_fs.h linux-2.6.18.2-vs2.1.1/include/linux/ext3_fs.h 14404Index: linux-2.6.18/include/linux/ext3_fs.h
14110--- linux-2.6.18.2/include/linux/ext3_fs.h 2006-09-20 16:58:43 +0200 14405===================================================================
14111+++ linux-2.6.18.2-vs2.1.1/include/linux/ext3_fs.h 2006-09-25 15:40:02 +0200 14406--- linux-2.6.18.orig/include/linux/ext3_fs.h
14407+++ linux-2.6.18/include/linux/ext3_fs.h
14112@@ -181,10 +181,20 @@ struct ext3_group_desc 14408@@ -181,10 +181,20 @@ struct ext3_group_desc
14113 #define EXT3_NOTAIL_FL 0x00008000 /* file tail should not be merged */ 14409 #define EXT3_NOTAIL_FL 0x00008000 /* file tail should not be merged */
14114 #define EXT3_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ 14410 #define EXT3_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
14115 #define EXT3_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ 14411 #define EXT3_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
14116+#define EXT3_BARRIER_FL 0x04000000 /* Barrier for chroot() */ 14412+#define EXT3_BARRIER_FL 0x04000000 /* Barrier for chroot() */
14161 int create, int extend_disksize); 14457 int create, int extend_disksize);
14162+extern int ext3_sync_flags(struct inode *inode); 14458+extern int ext3_sync_flags(struct inode *inode);
14163 14459
14164 extern void ext3_read_inode (struct inode *); 14460 extern void ext3_read_inode (struct inode *);
14165 extern int ext3_write_inode (struct inode *, int); 14461 extern int ext3_write_inode (struct inode *, int);
14166diff -NurpP --minimal linux-2.6.18.2/include/linux/ext3_jbd.h linux-2.6.18.2-vs2.1.1/include/linux/ext3_jbd.h 14462Index: linux-2.6.18/include/linux/ext3_jbd.h
14167--- linux-2.6.18.2/include/linux/ext3_jbd.h 2005-08-29 22:25:41 +0200 14463===================================================================
14168+++ linux-2.6.18.2-vs2.1.1/include/linux/ext3_jbd.h 2006-09-25 15:40:02 +0200 14464--- linux-2.6.18.orig/include/linux/ext3_jbd.h
14465+++ linux-2.6.18/include/linux/ext3_jbd.h
14169@@ -77,10 +77,10 @@ 14466@@ -77,10 +77,10 @@
14170 #define EXT3_QUOTA_TRANS_BLOCKS(sb) (test_opt(sb, QUOTA) ? 2 : 0) 14467 #define EXT3_QUOTA_TRANS_BLOCKS(sb) (test_opt(sb, QUOTA) ? 2 : 0)
14171 /* Amount of blocks needed for quota insert/delete - we do some block writes 14468 /* Amount of blocks needed for quota insert/delete - we do some block writes
14172 * but inode, sb and group updates are done only once */ 14469 * but inode, sb and group updates are done only once */
14173-#define EXT3_QUOTA_INIT_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_INIT_ALLOC*\ 14470-#define EXT3_QUOTA_INIT_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_INIT_ALLOC*\
14179+#define EXT3_QUOTA_DEL_BLOCKS(sb) (test_opt(sb, QUOTA) ? \ 14476+#define EXT3_QUOTA_DEL_BLOCKS(sb) (test_opt(sb, QUOTA) ? \
14180+ (DQUOT_DEL_ALLOC*(EXT3_SINGLEDATA_TRANS_BLOCKS-3)+3+DQUOT_DEL_REWRITE) : 0) 14477+ (DQUOT_DEL_ALLOC*(EXT3_SINGLEDATA_TRANS_BLOCKS-3)+3+DQUOT_DEL_REWRITE) : 0)
14181 #else 14478 #else
14182 #define EXT3_QUOTA_TRANS_BLOCKS(sb) 0 14479 #define EXT3_QUOTA_TRANS_BLOCKS(sb) 0
14183 #define EXT3_QUOTA_INIT_BLOCKS(sb) 0 14480 #define EXT3_QUOTA_INIT_BLOCKS(sb) 0
14184diff -NurpP --minimal linux-2.6.18.2/include/linux/fs.h linux-2.6.18.2-vs2.1.1/include/linux/fs.h 14481Index: linux-2.6.18/include/linux/fs.h
14185--- linux-2.6.18.2/include/linux/fs.h 2006-09-20 16:58:43 +0200 14482===================================================================
14186+++ linux-2.6.18.2-vs2.1.1/include/linux/fs.h 2006-11-01 01:01:33 +0100 14483--- linux-2.6.18.orig/include/linux/fs.h
14484+++ linux-2.6.18/include/linux/fs.h
14187@@ -119,6 +119,8 @@ extern int dir_notify_enable; 14485@@ -119,6 +119,8 @@ extern int dir_notify_enable;
14188 #define MS_PRIVATE (1<<18) /* change to private */ 14486 #define MS_PRIVATE (1<<18) /* change to private */
14189 #define MS_SLAVE (1<<19) /* change to slave */ 14487 #define MS_SLAVE (1<<19) /* change to slave */
14190 #define MS_SHARED (1<<20) /* change to shared */ 14488 #define MS_SHARED (1<<20) /* change to shared */
14191+#define MS_TAGGED (1<<24) /* use generic inode tagging */ 14489+#define MS_TAGGED (1<<24) /* use generic inode tagging */
14386 extern int dcache_readdir(struct file *, void *, filldir_t); 14684 extern int dcache_readdir(struct file *, void *, filldir_t);
14387+extern int dcache_readdir_filter(struct file *, void *, filldir_t, int (*)(struct dentry *)); 14685+extern int dcache_readdir_filter(struct file *, void *, filldir_t, int (*)(struct dentry *));
14388 extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); 14686 extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
14389 extern int simple_statfs(struct dentry *, struct kstatfs *); 14687 extern int simple_statfs(struct dentry *, struct kstatfs *);
14390 extern int simple_link(struct dentry *, struct inode *, struct dentry *); 14688 extern int simple_link(struct dentry *, struct inode *, struct dentry *);
14391diff -NurpP --minimal linux-2.6.18.2/include/linux/init_task.h linux-2.6.18.2-vs2.1.1/include/linux/init_task.h 14689Index: linux-2.6.18/include/linux/init_task.h
14392--- linux-2.6.18.2/include/linux/init_task.h 2006-09-20 16:58:43 +0200 14690===================================================================
14393+++ linux-2.6.18.2-vs2.1.1/include/linux/init_task.h 2006-10-18 02:19:40 +0200 14691--- linux-2.6.18.orig/include/linux/init_task.h
14692+++ linux-2.6.18/include/linux/init_task.h
14394@@ -128,6 +128,10 @@ extern struct group_info init_groups; 14693@@ -128,6 +128,10 @@ extern struct group_info init_groups;
14395 .pi_lock = SPIN_LOCK_UNLOCKED, \ 14694 .pi_lock = SPIN_LOCK_UNLOCKED, \
14396 INIT_TRACE_IRQFLAGS \ 14695 INIT_TRACE_IRQFLAGS \
14397 INIT_LOCKDEP \ 14696 INIT_LOCKDEP \
14398+ .xid = 0, \ 14697+ .xid = 0, \
14400+ .nid = 0, \ 14699+ .nid = 0, \
14401+ .nx_info = NULL, \ 14700+ .nx_info = NULL, \
14402 } 14701 }
14403 14702
14404 14703
14405diff -NurpP --minimal linux-2.6.18.2/include/linux/ipc.h linux-2.6.18.2-vs2.1.1/include/linux/ipc.h 14704Index: linux-2.6.18/include/linux/ipc.h
14406--- linux-2.6.18.2/include/linux/ipc.h 2004-08-14 12:54:46 +0200 14705===================================================================
14407+++ linux-2.6.18.2-vs2.1.1/include/linux/ipc.h 2006-09-20 17:01:45 +0200 14706--- linux-2.6.18.orig/include/linux/ipc.h
14707+++ linux-2.6.18/include/linux/ipc.h
14408@@ -66,6 +66,7 @@ struct kern_ipc_perm 14708@@ -66,6 +66,7 @@ struct kern_ipc_perm
14409 mode_t mode; 14709 mode_t mode;
14410 unsigned long seq; 14710 unsigned long seq;
14411 void *security; 14711 void *security;
14412+ xid_t xid; 14712+ xid_t xid;
14413 }; 14713 };
14414 14714
14415 #endif /* __KERNEL__ */ 14715 #endif /* __KERNEL__ */
14416diff -NurpP --minimal linux-2.6.18.2/include/linux/kernel.h linux-2.6.18.2-vs2.1.1/include/linux/kernel.h 14716Index: linux-2.6.18/include/linux/kernel.h
14417--- linux-2.6.18.2/include/linux/kernel.h 2006-09-20 16:58:43 +0200 14717===================================================================
14418+++ linux-2.6.18.2-vs2.1.1/include/linux/kernel.h 2006-09-20 17:01:45 +0200 14718--- linux-2.6.18.orig/include/linux/kernel.h
14719+++ linux-2.6.18/include/linux/kernel.h
14419@@ -17,6 +17,7 @@ 14720@@ -17,6 +17,7 @@
14420 #include <asm/bug.h> 14721 #include <asm/bug.h>
14421 14722
14422 extern const char linux_banner[]; 14723 extern const char linux_banner[];
14423+extern const char vx_linux_banner[]; 14724+extern const char vx_linux_banner[];
14424 14725
14425 #define INT_MAX ((int)(~0U>>1)) 14726 #define INT_MAX ((int)(~0U>>1))
14426 #define INT_MIN (-INT_MAX - 1) 14727 #define INT_MIN (-INT_MAX - 1)
14427diff -NurpP --minimal linux-2.6.18.2/include/linux/loop.h linux-2.6.18.2-vs2.1.1/include/linux/loop.h 14728Index: linux-2.6.18/include/linux/loop.h
14428--- linux-2.6.18.2/include/linux/loop.h 2006-06-18 04:55:19 +0200 14729===================================================================
14429+++ linux-2.6.18.2-vs2.1.1/include/linux/loop.h 2006-09-25 15:40:02 +0200 14730--- linux-2.6.18.orig/include/linux/loop.h
14731+++ linux-2.6.18/include/linux/loop.h
14430@@ -45,6 +45,7 @@ struct loop_device { 14732@@ -45,6 +45,7 @@ struct loop_device {
14431 struct loop_func_table *lo_encryption; 14733 struct loop_func_table *lo_encryption;
14432 __u32 lo_init[2]; 14734 __u32 lo_init[2];
14433 uid_t lo_key_owner; /* Who set the key */ 14735 uid_t lo_key_owner; /* Who set the key */
14434+ xid_t lo_xid; 14736+ xid_t lo_xid;
14435 int (*ioctl)(struct loop_device *, int cmd, 14737 int (*ioctl)(struct loop_device *, int cmd,
14436 unsigned long arg); 14738 unsigned long arg);
14437 14739
14438diff -NurpP --minimal linux-2.6.18.2/include/linux/major.h linux-2.6.18.2-vs2.1.1/include/linux/major.h 14740Index: linux-2.6.18/include/linux/major.h
14439--- linux-2.6.18.2/include/linux/major.h 2006-06-18 04:55:19 +0200 14741===================================================================
14440+++ linux-2.6.18.2-vs2.1.1/include/linux/major.h 2006-09-20 17:01:45 +0200 14742--- linux-2.6.18.orig/include/linux/major.h
14743+++ linux-2.6.18/include/linux/major.h
14441@@ -15,6 +15,7 @@ 14744@@ -15,6 +15,7 @@
14442 #define HD_MAJOR IDE0_MAJOR 14745 #define HD_MAJOR IDE0_MAJOR
14443 #define PTY_SLAVE_MAJOR 3 14746 #define PTY_SLAVE_MAJOR 3
14444 #define TTY_MAJOR 4 14747 #define TTY_MAJOR 4
14445+#define VROOT_MAJOR 4 14748+#define VROOT_MAJOR 4
14446 #define TTYAUX_MAJOR 5 14749 #define TTYAUX_MAJOR 5
14447 #define LP_MAJOR 6 14750 #define LP_MAJOR 6
14448 #define VCS_MAJOR 7 14751 #define VCS_MAJOR 7
14449diff -NurpP --minimal linux-2.6.18.2/include/linux/mount.h linux-2.6.18.2-vs2.1.1/include/linux/mount.h 14752Index: linux-2.6.18/include/linux/mount.h
14450--- linux-2.6.18.2/include/linux/mount.h 2006-09-20 16:58:44 +0200 14753===================================================================
14451+++ linux-2.6.18.2-vs2.1.1/include/linux/mount.h 2006-09-25 15:40:02 +0200 14754--- linux-2.6.18.orig/include/linux/mount.h
14755+++ linux-2.6.18/include/linux/mount.h
14452@@ -27,12 +27,16 @@ struct namespace; 14756@@ -27,12 +27,16 @@ struct namespace;
14453 #define MNT_NOEXEC 0x04 14757 #define MNT_NOEXEC 0x04
14454 #define MNT_NOATIME 0x08 14758 #define MNT_NOATIME 0x08
14455 #define MNT_NODIRATIME 0x10 14759 #define MNT_NODIRATIME 0x10
14456+#define MNT_RDONLY 0x20 14760+#define MNT_RDONLY 0x20
14472 int mnt_pinned; 14776 int mnt_pinned;
14473+ tag_t mnt_tag; /* tagging used for vfsmount */ 14777+ tag_t mnt_tag; /* tagging used for vfsmount */
14474 }; 14778 };
14475 14779
14476 static inline struct vfsmount *mntget(struct vfsmount *mnt) 14780 static inline struct vfsmount *mntget(struct vfsmount *mnt)
14477diff -NurpP --minimal linux-2.6.18.2/include/linux/net.h linux-2.6.18.2-vs2.1.1/include/linux/net.h 14781Index: linux-2.6.18/include/linux/net.h
14478--- linux-2.6.18.2/include/linux/net.h 2006-09-20 16:58:44 +0200 14782===================================================================
14479+++ linux-2.6.18.2-vs2.1.1/include/linux/net.h 2006-09-20 17:47:13 +0200 14783--- linux-2.6.18.orig/include/linux/net.h
14784+++ linux-2.6.18/include/linux/net.h
14480@@ -62,6 +62,7 @@ typedef enum { 14785@@ -62,6 +62,7 @@ typedef enum {
14481 #define SOCK_NOSPACE 2 14786 #define SOCK_NOSPACE 2
14482 #define SOCK_PASSCRED 3 14787 #define SOCK_PASSCRED 3
14483 #define SOCK_PASSSEC 4 14788 #define SOCK_PASSSEC 4
14484+#define SOCK_USER_SOCKET 5 14789+#define SOCK_USER_SOCKET 5
14485 14790
14486 #ifndef ARCH_HAS_SOCKET_TYPES 14791 #ifndef ARCH_HAS_SOCKET_TYPES
14487 /** 14792 /**
14488diff -NurpP --minimal linux-2.6.18.2/include/linux/nfs_mount.h linux-2.6.18.2-vs2.1.1/include/linux/nfs_mount.h 14793Index: linux-2.6.18/include/linux/nfs_mount.h
14489--- linux-2.6.18.2/include/linux/nfs_mount.h 2005-08-29 22:25:42 +0200 14794===================================================================
14490+++ linux-2.6.18.2-vs2.1.1/include/linux/nfs_mount.h 2006-09-25 15:40:02 +0200 14795--- linux-2.6.18.orig/include/linux/nfs_mount.h
14796+++ linux-2.6.18/include/linux/nfs_mount.h
14491@@ -61,6 +61,7 @@ struct nfs_mount_data { 14797@@ -61,6 +61,7 @@ struct nfs_mount_data {
14492 #define NFS_MOUNT_NOACL 0x0800 /* 4 */ 14798 #define NFS_MOUNT_NOACL 0x0800 /* 4 */
14493 #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ 14799 #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */
14494 #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ 14800 #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
14495+#define NFS_MOUNT_TAGGED 0x8000 /* context tagging */ 14801+#define NFS_MOUNT_TAGGED 0x8000 /* context tagging */
14496 #define NFS_MOUNT_FLAGMASK 0xFFFF 14802 #define NFS_MOUNT_FLAGMASK 0xFFFF
14497 14803
14498 #endif 14804 #endif
14499diff -NurpP --minimal linux-2.6.18.2/include/linux/percpu.h linux-2.6.18.2-vs2.1.1/include/linux/percpu.h 14805Index: linux-2.6.18/include/linux/percpu.h
14500--- linux-2.6.18.2/include/linux/percpu.h 2006-04-09 13:49:57 +0200 14806===================================================================
14501+++ linux-2.6.18.2-vs2.1.1/include/linux/percpu.h 2006-09-20 17:01:45 +0200 14807--- linux-2.6.18.orig/include/linux/percpu.h
14808+++ linux-2.6.18/include/linux/percpu.h
14502@@ -8,7 +8,7 @@ 14809@@ -8,7 +8,7 @@
14503 14810
14504 /* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */ 14811 /* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */
14505 #ifndef PERCPU_ENOUGH_ROOM 14812 #ifndef PERCPU_ENOUGH_ROOM
14506-#define PERCPU_ENOUGH_ROOM 32768 14813-#define PERCPU_ENOUGH_ROOM 32768
14507+#define PERCPU_ENOUGH_ROOM 65536 14814+#define PERCPU_ENOUGH_ROOM 65536
14508 #endif 14815 #endif
14509 14816
14510 /* Must be an lvalue. */ 14817 /* Must be an lvalue. */
14511diff -NurpP --minimal linux-2.6.18.2/include/linux/pid.h linux-2.6.18.2-vs2.1.1/include/linux/pid.h 14818Index: linux-2.6.18/include/linux/pid.h
14512--- linux-2.6.18.2/include/linux/pid.h 2006-06-18 04:55:21 +0200 14819===================================================================
14513+++ linux-2.6.18.2-vs2.1.1/include/linux/pid.h 2006-10-06 23:09:03 +0200 14820--- linux-2.6.18.orig/include/linux/pid.h
14821+++ linux-2.6.18/include/linux/pid.h
14514@@ -8,7 +8,8 @@ enum pid_type 14822@@ -8,7 +8,8 @@ enum pid_type
14515 PIDTYPE_PID, 14823 PIDTYPE_PID,
14516 PIDTYPE_PGID, 14824 PIDTYPE_PGID,
14517 PIDTYPE_SID, 14825 PIDTYPE_SID,
14518- PIDTYPE_MAX 14826- PIDTYPE_MAX
14519+ PIDTYPE_MAX, 14827+ PIDTYPE_MAX,
14520+ PIDTYPE_REALPID 14828+ PIDTYPE_REALPID
14521 }; 14829 };
14522 14830
14523 /* 14831 /*
14524diff -NurpP --minimal linux-2.6.18.2/include/linux/proc_fs.h linux-2.6.18.2-vs2.1.1/include/linux/proc_fs.h 14832Index: linux-2.6.18/include/linux/proc_fs.h
14525--- linux-2.6.18.2/include/linux/proc_fs.h 2006-09-20 16:58:44 +0200 14833===================================================================
14526+++ linux-2.6.18.2-vs2.1.1/include/linux/proc_fs.h 2006-09-20 17:46:14 +0200 14834--- linux-2.6.18.orig/include/linux/proc_fs.h
14835+++ linux-2.6.18/include/linux/proc_fs.h
14527@@ -55,6 +55,7 @@ struct proc_dir_entry { 14836@@ -55,6 +55,7 @@ struct proc_dir_entry {
14528 nlink_t nlink; 14837 nlink_t nlink;
14529 uid_t uid; 14838 uid_t uid;
14530 gid_t gid; 14839 gid_t gid;
14531+ int vx_flags; 14840+ int vx_flags;
14543 int (*proc_read)(struct task_struct *task, char *page); 14852 int (*proc_read)(struct task_struct *task, char *page);
14544+ int (*proc_vid_read)(int vid, char *page); 14853+ int (*proc_vid_read)(int vid, char *page);
14545 } op; 14854 } op;
14546 struct proc_dir_entry *pde; 14855 struct proc_dir_entry *pde;
14547 struct inode vfs_inode; 14856 struct inode vfs_inode;
14548diff -NurpP --minimal linux-2.6.18.2/include/linux/quota.h linux-2.6.18.2-vs2.1.1/include/linux/quota.h 14857Index: linux-2.6.18/include/linux/quota.h
14549--- linux-2.6.18.2/include/linux/quota.h 2006-09-20 16:58:44 +0200 14858===================================================================
14550+++ linux-2.6.18.2-vs2.1.1/include/linux/quota.h 2006-09-25 15:40:02 +0200 14859--- linux-2.6.18.orig/include/linux/quota.h
14860+++ linux-2.6.18/include/linux/quota.h
14551@@ -55,6 +55,13 @@ extern spinlock_t dq_data_lock; 14861@@ -55,6 +55,13 @@ extern spinlock_t dq_data_lock;
14552 #define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10)) 14862 #define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10))
14553 #define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS) 14863 #define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)
14554 14864
14555+/* are NULL dqhash ptrs valid? */ 14865+/* are NULL dqhash ptrs valid? */
14724+#endif /* CONFIG_QUOTACTL */ 15034+#endif /* CONFIG_QUOTACTL */
14725+ 15035+
14726 #else 15036 #else
14727 15037
14728 # /* nodep */ include <sys/cdefs.h> 15038 # /* nodep */ include <sys/cdefs.h>
14729diff -NurpP --minimal linux-2.6.18.2/include/linux/quotaops.h linux-2.6.18.2-vs2.1.1/include/linux/quotaops.h 15039Index: linux-2.6.18/include/linux/quotaops.h
14730--- linux-2.6.18.2/include/linux/quotaops.h 2006-09-20 16:58:44 +0200 15040===================================================================
14731+++ linux-2.6.18.2-vs2.1.1/include/linux/quotaops.h 2006-09-25 15:40:02 +0200 15041--- linux-2.6.18.orig/include/linux/quotaops.h
15042+++ linux-2.6.18/include/linux/quotaops.h
14732@@ -19,7 +19,7 @@ 15043@@ -19,7 +19,7 @@
14733 /* 15044 /*
14734 * declaration of quota_function calls in kernel. 15045 * declaration of quota_function calls in kernel.
14735 */ 15046 */
14736-extern void sync_dquots(struct super_block *sb, int type); 15047-extern void sync_dquots(struct super_block *sb, int type);
14899+#define DQUOT_SYNC(hash) do { } while(0) 15210+#define DQUOT_SYNC(hash) do { } while(0)
14900+#define DQUOT_OFF(hash) do { } while(0) 15211+#define DQUOT_OFF(hash) do { } while(0)
14901 #define DQUOT_TRANSFER(inode, iattr) (0) 15212 #define DQUOT_TRANSFER(inode, iattr) (0)
14902 static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) 15213 static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
14903 { 15214 {
14904diff -NurpP --minimal linux-2.6.18.2/include/linux/reiserfs_fs.h linux-2.6.18.2-vs2.1.1/include/linux/reiserfs_fs.h 15215Index: linux-2.6.18/include/linux/reiserfs_fs.h
14905--- linux-2.6.18.2/include/linux/reiserfs_fs.h 2006-09-20 16:58:44 +0200 15216===================================================================
14906+++ linux-2.6.18.2-vs2.1.1/include/linux/reiserfs_fs.h 2006-09-20 17:01:45 +0200 15217--- linux-2.6.18.orig/include/linux/reiserfs_fs.h
15218+++ linux-2.6.18/include/linux/reiserfs_fs.h
14907@@ -829,6 +829,18 @@ struct stat_data_v1 { 15219@@ -829,6 +829,18 @@ struct stat_data_v1 {
14908 #define REISERFS_COMPR_FL EXT2_COMPR_FL 15220 #define REISERFS_COMPR_FL EXT2_COMPR_FL
14909 #define REISERFS_NOTAIL_FL EXT2_NOTAIL_FL 15221 #define REISERFS_NOTAIL_FL EXT2_NOTAIL_FL
14910 15222
14911+/* unfortunately reiserfs sdattr is only 16 bit */ 15223+/* unfortunately reiserfs sdattr is only 16 bit */
14929 int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); 15241 int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
14930+int reiserfs_sync_flags(struct inode *inode); 15242+int reiserfs_sync_flags(struct inode *inode);
14931 15243
14932 /* namei.c */ 15244 /* namei.c */
14933 void set_de_name_and_namelen(struct reiserfs_dir_entry *de); 15245 void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
14934diff -NurpP --minimal linux-2.6.18.2/include/linux/reiserfs_fs_sb.h linux-2.6.18.2-vs2.1.1/include/linux/reiserfs_fs_sb.h 15246Index: linux-2.6.18/include/linux/reiserfs_fs_sb.h
15247===================================================================
14935--- linux-2.6.18.2/include/linux/reiserfs_fs_sb.h 2006-02-18 14:40:35 +0100 15248--- linux-2.6.18.orig/include/linux/reiserfs_fs_sb.h
14936+++ linux-2.6.18.2-vs2.1.1/include/linux/reiserfs_fs_sb.h 2006-09-25 15:40:02 +0200 15249+++ linux-2.6.18/include/linux/reiserfs_fs_sb.h
14937@@ -456,6 +456,7 @@ enum reiserfs_mount_options { 15250@@ -456,6 +456,7 @@ enum reiserfs_mount_options {
14938 REISERFS_POSIXACL, 15251 REISERFS_POSIXACL,
14939 REISERFS_BARRIER_NONE, 15252 REISERFS_BARRIER_NONE,
14940 REISERFS_BARRIER_FLUSH, 15253 REISERFS_BARRIER_FLUSH,
14941+ REISERFS_TAGGED, 15254+ REISERFS_TAGGED,
14942 15255
14943 /* Actions on error */ 15256 /* Actions on error */
14944 REISERFS_ERROR_PANIC, 15257 REISERFS_ERROR_PANIC,
14945diff -NurpP --minimal linux-2.6.18.2/include/linux/sched.h linux-2.6.18.2-vs2.1.1/include/linux/sched.h 15258Index: linux-2.6.18/include/linux/sched.h
14946--- linux-2.6.18.2/include/linux/sched.h 2006-09-20 16:58:44 +0200 15259===================================================================
14947+++ linux-2.6.18.2-vs2.1.1/include/linux/sched.h 2006-10-06 23:09:03 +0200 15260--- linux-2.6.18.orig/include/linux/sched.h
15261+++ linux-2.6.18/include/linux/sched.h
14948@@ -24,6 +24,7 @@ 15262@@ -24,6 +24,7 @@
14949 #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ 15263 #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
14950 #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ 15264 #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
14951 #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ 15265 #define CLONE_STOPPED 0x02000000 /* Start in stopped state */
14952+#define CLONE_KTHREAD 0x10000000 /* clone a kernel thread */ 15266+#define CLONE_KTHREAD 0x10000000 /* clone a kernel thread */
15073-extern struct user_struct * alloc_uid(uid_t); 15387-extern struct user_struct * alloc_uid(uid_t);
15074+extern struct user_struct * alloc_uid(xid_t, uid_t); 15388+extern struct user_struct * alloc_uid(xid_t, uid_t);
15075 static inline struct user_struct *get_uid(struct user_struct *u) 15389 static inline struct user_struct *get_uid(struct user_struct *u)
15076 { 15390 {
15077 atomic_inc(&u->__count); 15391 atomic_inc(&u->__count);
15078diff -NurpP --minimal linux-2.6.18.2/include/linux/security.h linux-2.6.18.2-vs2.1.1/include/linux/security.h 15392Index: linux-2.6.18/include/linux/security.h
15079--- linux-2.6.18.2/include/linux/security.h 2006-09-20 16:58:44 +0200 15393===================================================================
15080+++ linux-2.6.18.2-vs2.1.1/include/linux/security.h 2006-09-25 15:40:02 +0200 15394--- linux-2.6.18.orig/include/linux/security.h
15395+++ linux-2.6.18/include/linux/security.h
15081@@ -1137,7 +1137,7 @@ struct security_operations { 15396@@ -1137,7 +1137,7 @@ struct security_operations {
15082 int (*capable) (struct task_struct * tsk, int cap); 15397 int (*capable) (struct task_struct * tsk, int cap);
15083 int (*acct) (struct file * file); 15398 int (*acct) (struct file * file);
15084 int (*sysctl) (struct ctl_table * table, int op); 15399 int (*sysctl) (struct ctl_table * table, int op);
15085- int (*quotactl) (int cmds, int type, int id, struct super_block * sb); 15400- int (*quotactl) (int cmds, int type, int id, struct super_block * sb);
15106- struct super_block * sb) 15421- struct super_block * sb)
15107+ struct dqhash * hash) 15422+ struct dqhash * hash)
15108 { 15423 {
15109 return 0; 15424 return 0;
15110 } 15425 }
15111diff -NurpP --minimal linux-2.6.18.2/include/linux/shmem_fs.h linux-2.6.18.2-vs2.1.1/include/linux/shmem_fs.h 15426Index: linux-2.6.18/include/linux/shmem_fs.h
15112--- linux-2.6.18.2/include/linux/shmem_fs.h 2006-04-09 13:49:57 +0200 15427===================================================================
15113+++ linux-2.6.18.2-vs2.1.1/include/linux/shmem_fs.h 2006-09-20 17:01:45 +0200 15428--- linux-2.6.18.orig/include/linux/shmem_fs.h
15429+++ linux-2.6.18/include/linux/shmem_fs.h
15114@@ -8,6 +8,9 @@ 15430@@ -8,6 +8,9 @@
15115 15431
15116 #define SHMEM_NR_DIRECT 16 15432 #define SHMEM_NR_DIRECT 16
15117 15433
15118+#define TMPFS_SUPER_MAGIC 0x01021994 15434+#define TMPFS_SUPER_MAGIC 0x01021994
15119+ 15435+
15120+ 15436+
15121 struct shmem_inode_info { 15437 struct shmem_inode_info {
15122 spinlock_t lock; 15438 spinlock_t lock;
15123 unsigned long flags; 15439 unsigned long flags;
15124diff -NurpP --minimal linux-2.6.18.2/include/linux/stat.h linux-2.6.18.2-vs2.1.1/include/linux/stat.h 15440Index: linux-2.6.18/include/linux/stat.h
15125--- linux-2.6.18.2/include/linux/stat.h 2006-06-18 04:55:25 +0200 15441===================================================================
15126+++ linux-2.6.18.2-vs2.1.1/include/linux/stat.h 2006-09-25 15:40:02 +0200 15442--- linux-2.6.18.orig/include/linux/stat.h
15443+++ linux-2.6.18/include/linux/stat.h
15127@@ -63,6 +63,7 @@ struct kstat { 15444@@ -63,6 +63,7 @@ struct kstat {
15128 unsigned int nlink; 15445 unsigned int nlink;
15129 uid_t uid; 15446 uid_t uid;
15130 gid_t gid; 15447 gid_t gid;
15131+ tag_t tag; 15448+ tag_t tag;
15132 dev_t rdev; 15449 dev_t rdev;
15133 loff_t size; 15450 loff_t size;
15134 struct timespec atime; 15451 struct timespec atime;
15135diff -NurpP --minimal linux-2.6.18.2/include/linux/sunrpc/auth.h linux-2.6.18.2-vs2.1.1/include/linux/sunrpc/auth.h 15452Index: linux-2.6.18/include/linux/sunrpc/auth.h
15136--- linux-2.6.18.2/include/linux/sunrpc/auth.h 2006-09-20 16:58:44 +0200 15453===================================================================
15137+++ linux-2.6.18.2-vs2.1.1/include/linux/sunrpc/auth.h 2006-09-25 15:40:02 +0200 15454--- linux-2.6.18.orig/include/linux/sunrpc/auth.h
15455+++ linux-2.6.18/include/linux/sunrpc/auth.h
15138@@ -27,6 +27,7 @@ 15456@@ -27,6 +27,7 @@
15139 struct auth_cred { 15457 struct auth_cred {
15140 uid_t uid; 15458 uid_t uid;
15141 gid_t gid; 15459 gid_t gid;
15142+ tag_t tag; 15460+ tag_t tag;
15143 struct group_info *group_info; 15461 struct group_info *group_info;
15144 }; 15462 };
15145 15463
15146diff -NurpP --minimal linux-2.6.18.2/include/linux/sunrpc/clnt.h linux-2.6.18.2-vs2.1.1/include/linux/sunrpc/clnt.h 15464Index: linux-2.6.18/include/linux/sunrpc/clnt.h
15147--- linux-2.6.18.2/include/linux/sunrpc/clnt.h 2006-06-18 04:55:25 +0200 15465===================================================================
15148+++ linux-2.6.18.2-vs2.1.1/include/linux/sunrpc/clnt.h 2006-09-25 15:40:02 +0200 15466--- linux-2.6.18.orig/include/linux/sunrpc/clnt.h
15467+++ linux-2.6.18/include/linux/sunrpc/clnt.h
15149@@ -52,7 +52,8 @@ struct rpc_clnt { 15468@@ -52,7 +52,8 @@ struct rpc_clnt {
15150 cl_intr : 1,/* interruptible */ 15469 cl_intr : 1,/* interruptible */
15151 cl_autobind : 1,/* use getport() */ 15470 cl_autobind : 1,/* use getport() */
15152 cl_oneshot : 1,/* dispose after use */ 15471 cl_oneshot : 1,/* dispose after use */
15153- cl_dead : 1;/* abandoned */ 15472- cl_dead : 1;/* abandoned */
15154+ cl_dead : 1,/* abandoned */ 15473+ cl_dead : 1,/* abandoned */
15155+ cl_tag : 1;/* context tagging */ 15474+ cl_tag : 1;/* context tagging */
15156 15475
15157 struct rpc_rtt * cl_rtt; /* RTO estimator data */ 15476 struct rpc_rtt * cl_rtt; /* RTO estimator data */
15158 struct rpc_portmap * cl_pmap; /* port mapping */ 15477 struct rpc_portmap * cl_pmap; /* port mapping */
15159diff -NurpP --minimal linux-2.6.18.2/include/linux/syscalls.h linux-2.6.18.2-vs2.1.1/include/linux/syscalls.h 15478Index: linux-2.6.18/include/linux/syscalls.h
15160--- linux-2.6.18.2/include/linux/syscalls.h 2006-09-20 16:58:44 +0200 15479===================================================================
15161+++ linux-2.6.18.2-vs2.1.1/include/linux/syscalls.h 2006-09-25 15:40:02 +0200 15480--- linux-2.6.18.orig/include/linux/syscalls.h
15481+++ linux-2.6.18/include/linux/syscalls.h
15162@@ -293,6 +293,8 @@ asmlinkage long sys_symlink(const char _ 15482@@ -293,6 +293,8 @@ asmlinkage long sys_symlink(const char _
15163 asmlinkage long sys_unlink(const char __user *pathname); 15483 asmlinkage long sys_unlink(const char __user *pathname);
15164 asmlinkage long sys_rename(const char __user *oldname, 15484 asmlinkage long sys_rename(const char __user *oldname,
15165 const char __user *newname); 15485 const char __user *newname);
15166+asmlinkage long sys_copyfile(const char __user *from, const char __user *to, 15486+asmlinkage long sys_copyfile(const char __user *from, const char __user *to,
15167+ umode_t mode); 15487+ umode_t mode);
15168 asmlinkage long sys_chmod(const char __user *filename, mode_t mode); 15488 asmlinkage long sys_chmod(const char __user *filename, mode_t mode);
15169 asmlinkage long sys_fchmod(unsigned int fd, mode_t mode); 15489 asmlinkage long sys_fchmod(unsigned int fd, mode_t mode);
15170 15490
15171diff -NurpP --minimal linux-2.6.18.2/include/linux/sysctl.h linux-2.6.18.2-vs2.1.1/include/linux/sysctl.h 15491Index: linux-2.6.18/include/linux/sysctl.h
15172--- linux-2.6.18.2/include/linux/sysctl.h 2006-11-04 19:43:24 +0100 15492===================================================================
15173+++ linux-2.6.18.2-vs2.1.1/include/linux/sysctl.h 2006-10-18 01:14:30 +0200 15493--- linux-2.6.18.orig/include/linux/sysctl.h
15494+++ linux-2.6.18/include/linux/sysctl.h
15174@@ -93,6 +93,7 @@ enum 15495@@ -93,6 +93,7 @@ enum
15175 KERN_CAP_BSET=14, /* int: capability bounding set */ 15496 KERN_CAP_BSET=14, /* int: capability bounding set */
15176 KERN_PANIC=15, /* int: panic timeout */ 15497 KERN_PANIC=15, /* int: panic timeout */
15177 KERN_REALROOTDEV=16, /* real root device to mount after initrd */ 15498 KERN_REALROOTDEV=16, /* real root device to mount after initrd */
15178+ KERN_VSHELPER=17, /* string: path to vshelper policy agent */ 15499+ KERN_VSHELPER=17, /* string: path to vshelper policy agent */
15179 15500
15180 KERN_SPARC_REBOOT=21, /* reboot command on Sparc */ 15501 KERN_SPARC_REBOOT=21, /* reboot command on Sparc */
15181 KERN_CTLALTDEL=22, /* int: allow ctl-alt-del to reboot */ 15502 KERN_CTLALTDEL=22, /* int: allow ctl-alt-del to reboot */
15182@@ -917,6 +918,9 @@ typedef int ctl_handler (ctl_table *tabl 15503@@ -932,6 +933,9 @@ typedef int ctl_handler (ctl_table *tabl
15183 typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, 15504 typedef int proc_handler (ctl_table *ctl, int write, struct file * filp,
15184 void __user *buffer, size_t *lenp, loff_t *ppos); 15505 void __user *buffer, size_t *lenp, loff_t *ppos);
15185 15506
15186+typedef int virt_handler (struct ctl_table *ctl, int write, xid_t xid, 15507+typedef int virt_handler (struct ctl_table *ctl, int write, xid_t xid,
15187+ void **datap, size_t *lenp); 15508+ void **datap, size_t *lenp);
15188+ 15509+
15189 extern int proc_dostring(ctl_table *, int, struct file *, 15510 extern int proc_dostring(ctl_table *, int, struct file *,
15190 void __user *, size_t *, loff_t *); 15511 void __user *, size_t *, loff_t *);
15191 extern int proc_dointvec(ctl_table *, int, struct file *, 15512 extern int proc_dointvec(ctl_table *, int, struct file *,
15192@@ -998,6 +1002,7 @@ struct ctl_table 15513@@ -1013,6 +1017,7 @@ struct ctl_table
15193 mode_t mode; 15514 mode_t mode;
15194 ctl_table *child; 15515 ctl_table *child;
15195 proc_handler *proc_handler; /* Callback for text formatting */ 15516 proc_handler *proc_handler; /* Callback for text formatting */
15196+ virt_handler *virt_handler; /* Context virtualization */ 15517+ virt_handler *virt_handler; /* Context virtualization */
15197 ctl_handler *strategy; /* Callback function for all r/w */ 15518 ctl_handler *strategy; /* Callback function for all r/w */
15198 struct proc_dir_entry *de; /* /proc control block */ 15519 struct proc_dir_entry *de; /* /proc control block */
15199 void *extra1; 15520 void *extra1;
15200diff -NurpP --minimal linux-2.6.18.2/include/linux/sysfs.h linux-2.6.18.2-vs2.1.1/include/linux/sysfs.h 15521Index: linux-2.6.18/include/linux/sysfs.h
15201--- linux-2.6.18.2/include/linux/sysfs.h 2006-06-18 04:55:25 +0200 15522===================================================================
15202+++ linux-2.6.18.2-vs2.1.1/include/linux/sysfs.h 2006-09-20 17:01:45 +0200 15523--- linux-2.6.18.orig/include/linux/sysfs.h
15524+++ linux-2.6.18/include/linux/sysfs.h
15203@@ -12,6 +12,8 @@ 15525@@ -12,6 +12,8 @@
15204 15526
15205 #include <asm/atomic.h> 15527 #include <asm/atomic.h>
15206 15528
15207+#define SYSFS_SUPER_MAGIC 0x62656572 15529+#define SYSFS_SUPER_MAGIC 0x62656572
15208+ 15530+
15209 struct kobject; 15531 struct kobject;
15210 struct module; 15532 struct module;
15211 15533
15212diff -NurpP --minimal linux-2.6.18.2/include/linux/time.h linux-2.6.18.2-vs2.1.1/include/linux/time.h 15534Index: linux-2.6.18/include/linux/time.h
15213--- linux-2.6.18.2/include/linux/time.h 2006-09-20 16:58:44 +0200 15535===================================================================
15214+++ linux-2.6.18.2-vs2.1.1/include/linux/time.h 2006-09-25 17:35:05 +0200 15536--- linux-2.6.18.orig/include/linux/time.h
15537+++ linux-2.6.18/include/linux/time.h
15215@@ -174,6 +174,9 @@ static inline void timespec_add_ns(struc 15538@@ -174,6 +174,9 @@ static inline void timespec_add_ns(struc
15216 } 15539 }
15217 a->tv_nsec = ns; 15540 a->tv_nsec = ns;
15218 } 15541 }
15219+ 15542+
15220+#include <linux/vs_time.h> 15543+#include <linux/vs_time.h>
15221+ 15544+
15222 #endif /* __KERNEL__ */ 15545 #endif /* __KERNEL__ */
15223 15546
15224 #define NFDBITS __NFDBITS 15547 #define NFDBITS __NFDBITS
15225diff -NurpP --minimal linux-2.6.18.2/include/linux/types.h linux-2.6.18.2-vs2.1.1/include/linux/types.h 15548Index: linux-2.6.18/include/linux/types.h
15226--- linux-2.6.18.2/include/linux/types.h 2006-09-20 16:58:44 +0200 15549===================================================================
15227+++ linux-2.6.18.2-vs2.1.1/include/linux/types.h 2006-09-25 15:40:02 +0200 15550--- linux-2.6.18.orig/include/linux/types.h
15551+++ linux-2.6.18/include/linux/types.h
15228@@ -37,6 +37,9 @@ typedef __kernel_uid32_t uid_t; 15552@@ -37,6 +37,9 @@ typedef __kernel_uid32_t uid_t;
15229 typedef __kernel_gid32_t gid_t; 15553 typedef __kernel_gid32_t gid_t;
15230 typedef __kernel_uid16_t uid16_t; 15554 typedef __kernel_uid16_t uid16_t;
15231 typedef __kernel_gid16_t gid16_t; 15555 typedef __kernel_gid16_t gid16_t;
15232+typedef unsigned int xid_t; 15556+typedef unsigned int xid_t;
15233+typedef unsigned int nid_t; 15557+typedef unsigned int nid_t;
15234+typedef unsigned int tag_t; 15558+typedef unsigned int tag_t;
15235 15559
15236 #ifdef CONFIG_UID16 15560 #ifdef CONFIG_UID16
15237 /* This is defined by include/asm-{arch}/posix_types.h */ 15561 /* This is defined by include/asm-{arch}/posix_types.h */
15238diff -NurpP --minimal linux-2.6.18.2/include/linux/vroot.h linux-2.6.18.2-vs2.1.1/include/linux/vroot.h 15562Index: linux-2.6.18/include/linux/vroot.h
15239--- linux-2.6.18.2/include/linux/vroot.h 1970-01-01 01:00:00 +0100 15563===================================================================
15240+++ linux-2.6.18.2-vs2.1.1/include/linux/vroot.h 2006-09-20 17:01:45 +0200 15564--- /dev/null
15565+++ linux-2.6.18/include/linux/vroot.h
15241@@ -0,0 +1,51 @@ 15566@@ -0,0 +1,51 @@
15242+ 15567+
15243+/* 15568+/*
15244+ * include/linux/vroot.h 15569+ * include/linux/vroot.h
15245+ * 15570+ *
15288+ 15613+
15289+#define VROOT_SET_DEV 0x5600 15614+#define VROOT_SET_DEV 0x5600
15290+#define VROOT_CLR_DEV 0x5601 15615+#define VROOT_CLR_DEV 0x5601
15291+ 15616+
15292+#endif /* _LINUX_VROOT_H */ 15617+#endif /* _LINUX_VROOT_H */
15293diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_base.h linux-2.6.18.2-vs2.1.1/include/linux/vs_base.h 15618Index: linux-2.6.18/include/linux/vs_base.h
15294--- linux-2.6.18.2/include/linux/vs_base.h 1970-01-01 01:00:00 +0100 15619===================================================================
15295+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_base.h 2006-11-03 03:19:24 +0100 15620--- /dev/null
15621+++ linux-2.6.18/include/linux/vs_base.h
15296@@ -0,0 +1,131 @@ 15622@@ -0,0 +1,131 @@
15297+#ifndef _VX_VS_BASE_H 15623+#ifndef _VX_VS_BASE_H
15298+#define _VX_VS_BASE_H 15624+#define _VX_VS_BASE_H
15299+ 15625+
15300+#include "vserver/context.h" 15626+#include "vserver/context.h"
15423+#define vx_current_initpid(n) \ 15749+#define vx_current_initpid(n) \
15424+ (current->vx_info && \ 15750+ (current->vx_info && \
15425+ (current->vx_info->vx_initpid == (n))) 15751+ (current->vx_info->vx_initpid == (n)))
15426+ 15752+
15427+#endif 15753+#endif
15428diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_context.h linux-2.6.18.2-vs2.1.1/include/linux/vs_context.h 15754Index: linux-2.6.18/include/linux/vs_context.h
15429--- linux-2.6.18.2/include/linux/vs_context.h 1970-01-01 01:00:00 +0100 15755===================================================================
15430+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_context.h 2006-10-20 03:18:45 +0200 15756--- /dev/null
15757+++ linux-2.6.18/include/linux/vs_context.h
15431@@ -0,0 +1,243 @@ 15758@@ -0,0 +1,243 @@
15432+#ifndef _VX_VS_CONTEXT_H 15759+#ifndef _VX_VS_CONTEXT_H
15433+#define _VX_VS_CONTEXT_H 15760+#define _VX_VS_CONTEXT_H
15434+ 15761+
15435+#include <linux/kernel.h> 15762+#include <linux/kernel.h>
15670+ 15997+
15671+ 15998+
15672+#else 15999+#else
15673+#warning duplicate inclusion 16000+#warning duplicate inclusion
15674+#endif 16001+#endif
15675diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_cowbl.h linux-2.6.18.2-vs2.1.1/include/linux/vs_cowbl.h 16002Index: linux-2.6.18/include/linux/vs_cowbl.h
15676--- linux-2.6.18.2/include/linux/vs_cowbl.h 1970-01-01 01:00:00 +0100 16003===================================================================
15677+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_cowbl.h 2006-11-04 05:16:09 +0100 16004--- /dev/null
16005+++ linux-2.6.18/include/linux/vs_cowbl.h
15678@@ -0,0 +1,44 @@ 16006@@ -0,0 +1,44 @@
15679+#ifndef _VX_VS_COWBL_H 16007+#ifndef _VX_VS_COWBL_H
15680+#define _VX_VS_COWBL_H 16008+#define _VX_VS_COWBL_H
15681+ 16009+
15682+#include <linux/fs.h> 16010+#include <linux/fs.h>
15718+} 16046+}
15719+ 16047+
15720+#else 16048+#else
15721+#warning duplicate inclusion 16049+#warning duplicate inclusion
15722+#endif 16050+#endif
15723diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_cvirt.h linux-2.6.18.2-vs2.1.1/include/linux/vs_cvirt.h 16051Index: linux-2.6.18/include/linux/vs_cvirt.h
15724--- linux-2.6.18.2/include/linux/vs_cvirt.h 1970-01-01 01:00:00 +0100 16052===================================================================
15725+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_cvirt.h 2006-09-25 15:40:02 +0200 16053--- /dev/null
16054+++ linux-2.6.18/include/linux/vs_cvirt.h
15726@@ -0,0 +1,59 @@ 16055@@ -0,0 +1,59 @@
15727+#ifndef _VX_VS_CVIRT_H 16056+#ifndef _VX_VS_CVIRT_H
15728+#define _VX_VS_CVIRT_H 16057+#define _VX_VS_CVIRT_H
15729+ 16058+
15730+#include "vserver/cvirt.h" 16059+#include "vserver/cvirt.h"
15781+ 16110+
15782+ 16111+
15783+#else 16112+#else
15784+#warning duplicate inclusion 16113+#warning duplicate inclusion
15785+#endif 16114+#endif
15786diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_dlimit.h linux-2.6.18.2-vs2.1.1/include/linux/vs_dlimit.h 16115Index: linux-2.6.18/include/linux/vs_dlimit.h
15787--- linux-2.6.18.2/include/linux/vs_dlimit.h 1970-01-01 01:00:00 +0100 16116===================================================================
15788+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_dlimit.h 2006-10-18 01:55:44 +0200 16117--- /dev/null
16118+++ linux-2.6.18/include/linux/vs_dlimit.h
15789@@ -0,0 +1,213 @@ 16119@@ -0,0 +1,213 @@
15790+#ifndef _VX_VS_DLIMIT_H 16120+#ifndef _VX_VS_DLIMIT_H
15791+#define _VX_VS_DLIMIT_H 16121+#define _VX_VS_DLIMIT_H
15792+ 16122+
15793+#include "vserver/dlimit.h" 16123+#include "vserver/dlimit.h"
15998+ 16328+
15999+ 16329+
16000+#else 16330+#else
16001+#warning duplicate inclusion 16331+#warning duplicate inclusion
16002+#endif 16332+#endif
16003diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_limit.h linux-2.6.18.2-vs2.1.1/include/linux/vs_limit.h 16333Index: linux-2.6.18/include/linux/vs_limit.h
16004--- linux-2.6.18.2/include/linux/vs_limit.h 1970-01-01 01:00:00 +0100 16334===================================================================
16005+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_limit.h 2006-09-25 15:40:02 +0200 16335--- /dev/null
16336+++ linux-2.6.18/include/linux/vs_limit.h
16006@@ -0,0 +1,137 @@ 16337@@ -0,0 +1,137 @@
16007+#ifndef _VX_VS_LIMIT_H 16338+#ifndef _VX_VS_LIMIT_H
16008+#define _VX_VS_LIMIT_H 16339+#define _VX_VS_LIMIT_H
16009+ 16340+
16010+#include "vserver/limit.h" 16341+#include "vserver/limit.h"
16139+ 16470+
16140+ 16471+
16141+#else 16472+#else
16142+#warning duplicate inclusion 16473+#warning duplicate inclusion
16143+#endif 16474+#endif
16144diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_memory.h linux-2.6.18.2-vs2.1.1/include/linux/vs_memory.h 16475Index: linux-2.6.18/include/linux/vs_memory.h
16145--- linux-2.6.18.2/include/linux/vs_memory.h 1970-01-01 01:00:00 +0100 16476===================================================================
16146+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_memory.h 2006-09-25 15:40:02 +0200 16477--- /dev/null
16478+++ linux-2.6.18/include/linux/vs_memory.h
16147@@ -0,0 +1,149 @@ 16479@@ -0,0 +1,149 @@
16148+#ifndef _VX_VS_MEMORY_H 16480+#ifndef _VX_VS_MEMORY_H
16149+#define _VX_VS_MEMORY_H 16481+#define _VX_VS_MEMORY_H
16150+ 16482+
16151+#include "vserver/limit.h" 16483+#include "vserver/limit.h"
16292+#endif 16624+#endif
16293+ 16625+
16294+#else 16626+#else
16295+#warning duplicate inclusion 16627+#warning duplicate inclusion
16296+#endif 16628+#endif
16297diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_network.h linux-2.6.18.2-vs2.1.1/include/linux/vs_network.h 16629Index: linux-2.6.18/include/linux/vs_network.h
16298--- linux-2.6.18.2/include/linux/vs_network.h 1970-01-01 01:00:00 +0100 16630===================================================================
16299+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_network.h 2006-10-28 18:31:23 +0200 16631--- /dev/null
16632+++ linux-2.6.18/include/linux/vs_network.h
16300@@ -0,0 +1,247 @@ 16633@@ -0,0 +1,247 @@
16301+#ifndef _NX_VS_NETWORK_H 16634+#ifndef _NX_VS_NETWORK_H
16302+#define _NX_VS_NETWORK_H 16635+#define _NX_VS_NETWORK_H
16303+ 16636+
16304+#include "vserver/network.h" 16637+#include "vserver/network.h"
16543+ 16876+
16544+ 16877+
16545+#else 16878+#else
16546+#warning duplicate inclusion 16879+#warning duplicate inclusion
16547+#endif 16880+#endif
16548diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_pid.h linux-2.6.18.2-vs2.1.1/include/linux/vs_pid.h 16881Index: linux-2.6.18/include/linux/vs_pid.h
16549--- linux-2.6.18.2/include/linux/vs_pid.h 1970-01-01 01:00:00 +0100 16882===================================================================
16550+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_pid.h 2006-11-01 07:29:16 +0100 16883--- /dev/null
16884+++ linux-2.6.18/include/linux/vs_pid.h
16551@@ -0,0 +1,106 @@ 16885@@ -0,0 +1,106 @@
16552+#ifndef _VX_VS_PID_H 16886+#ifndef _VX_VS_PID_H
16553+#define _VX_VS_PID_H 16887+#define _VX_VS_PID_H
16554+ 16888+
16555+#include "vserver/debug.h" 16889+#include "vserver/debug.h"
16653+ 16987+
16654+ 16988+
16655+#else 16989+#else
16656+#warning duplicate inclusion 16990+#warning duplicate inclusion
16657+#endif 16991+#endif
16658diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_sched.h linux-2.6.18.2-vs2.1.1/include/linux/vs_sched.h 16992Index: linux-2.6.18/include/linux/vs_sched.h
16659--- linux-2.6.18.2/include/linux/vs_sched.h 1970-01-01 01:00:00 +0100 16993===================================================================
16660+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_sched.h 2006-09-25 15:40:02 +0200 16994--- /dev/null
16995+++ linux-2.6.18/include/linux/vs_sched.h
16661@@ -0,0 +1,107 @@ 16996@@ -0,0 +1,107 @@
16662+#ifndef _VX_VS_SCHED_H 16997+#ifndef _VX_VS_SCHED_H
16663+#define _VX_VS_SCHED_H 16998+#define _VX_VS_SCHED_H
16664+ 16999+
16665+#include "vserver/sched.h" 17000+#include "vserver/sched.h"
16764+} 17099+}
16765+ 17100+
16766+#else 17101+#else
16767+#warning duplicate inclusion 17102+#warning duplicate inclusion
16768+#endif 17103+#endif
16769diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_socket.h linux-2.6.18.2-vs2.1.1/include/linux/vs_socket.h 17104Index: linux-2.6.18/include/linux/vs_socket.h
16770--- linux-2.6.18.2/include/linux/vs_socket.h 1970-01-01 01:00:00 +0100 17105===================================================================
16771+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_socket.h 2006-09-25 15:40:02 +0200 17106--- /dev/null
17107+++ linux-2.6.18/include/linux/vs_socket.h
16772@@ -0,0 +1,64 @@ 17108@@ -0,0 +1,64 @@
16773+#ifndef _VX_VS_SOCKET_H 17109+#ifndef _VX_VS_SOCKET_H
16774+#define _VX_VS_SOCKET_H 17110+#define _VX_VS_SOCKET_H
16775+ 17111+
16776+#include "vserver/debug.h" 17112+#include "vserver/debug.h"
16832+ 17168+
16833+ 17169+
16834+#else 17170+#else
16835+#warning duplicate inclusion 17171+#warning duplicate inclusion
16836+#endif 17172+#endif
16837diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_tag.h linux-2.6.18.2-vs2.1.1/include/linux/vs_tag.h 17173Index: linux-2.6.18/include/linux/vs_tag.h
16838--- linux-2.6.18.2/include/linux/vs_tag.h 1970-01-01 01:00:00 +0100 17174===================================================================
16839+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_tag.h 2006-09-25 15:40:02 +0200 17175--- /dev/null
17176+++ linux-2.6.18/include/linux/vs_tag.h
16840@@ -0,0 +1,45 @@ 17177@@ -0,0 +1,45 @@
16841+#ifndef _VX_VS_TAG_H 17178+#ifndef _VX_VS_TAG_H
16842+#define _VX_VS_TAG_H 17179+#define _VX_VS_TAG_H
16843+ 17180+
16844+#include <linux/kernel.h> 17181+#include <linux/kernel.h>
16881+} 17218+}
16882+ 17219+
16883+#else 17220+#else
16884+#warning duplicate inclusion 17221+#warning duplicate inclusion
16885+#endif 17222+#endif
16886diff -NurpP --minimal linux-2.6.18.2/include/linux/vs_time.h linux-2.6.18.2-vs2.1.1/include/linux/vs_time.h 17223Index: linux-2.6.18/include/linux/vs_time.h
16887--- linux-2.6.18.2/include/linux/vs_time.h 1970-01-01 01:00:00 +0100 17224===================================================================
16888+++ linux-2.6.18.2-vs2.1.1/include/linux/vs_time.h 2006-09-25 15:40:02 +0200 17225--- /dev/null
17226+++ linux-2.6.18/include/linux/vs_time.h
16889@@ -0,0 +1,19 @@ 17227@@ -0,0 +1,19 @@
16890+#ifndef _VX_VS_TIME_H 17228+#ifndef _VX_VS_TIME_H
16891+#define _VX_VS_TIME_H 17229+#define _VX_VS_TIME_H
16892+ 17230+
16893+ 17231+
16904+#endif 17242+#endif
16905+ 17243+
16906+#else 17244+#else
16907+#warning duplicate inclusion 17245+#warning duplicate inclusion
16908+#endif 17246+#endif
16909diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/Kbuild linux-2.6.18.2-vs2.1.1/include/linux/vserver/Kbuild 17247Index: linux-2.6.18/include/linux/vserver/Kbuild
16910--- linux-2.6.18.2/include/linux/vserver/Kbuild 1970-01-01 01:00:00 +0100 17248===================================================================
16911+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/Kbuild 2006-10-09 23:23:37 +0200 17249--- /dev/null
17250+++ linux-2.6.18/include/linux/vserver/Kbuild
16912@@ -0,0 +1,9 @@ 17251@@ -0,0 +1,9 @@
16913+ 17252+
16914+unifdef-y += context_cmd.h network_cmd.h namespace_cmd.h \ 17253+unifdef-y += context_cmd.h network_cmd.h namespace_cmd.h \
16915+ cacct_cmd.h cvirt_cmd.h limit_cmd.h dlimit_cmd.h \ 17254+ cacct_cmd.h cvirt_cmd.h limit_cmd.h dlimit_cmd.h \
16916+ inode_cmd.h sched_cmd.h signal_cmd.h debug_cmd.h 17255+ inode_cmd.h sched_cmd.h signal_cmd.h debug_cmd.h
16917+ 17256+
16918+unifdef-y += switch.h network.h monitor.h 17257+unifdef-y += switch.h network.h monitor.h
16919+ 17258+
16920+unifdef-y += legacy.h 17259+unifdef-y += legacy.h
16921+ 17260+
16922diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/cacct.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/cacct.h 17261Index: linux-2.6.18/include/linux/vserver/cacct.h
16923--- linux-2.6.18.2/include/linux/vserver/cacct.h 1970-01-01 01:00:00 +0100 17262===================================================================
16924+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/cacct.h 2006-09-25 15:40:02 +0200 17263--- /dev/null
17264+++ linux-2.6.18/include/linux/vserver/cacct.h
16925@@ -0,0 +1,15 @@ 17265@@ -0,0 +1,15 @@
16926+#ifndef _VX_CACCT_H 17266+#ifndef _VX_CACCT_H
16927+#define _VX_CACCT_H 17267+#define _VX_CACCT_H
16928+ 17268+
16929+ 17269+
16936+ VXA_SOCK_OTHER, 17276+ VXA_SOCK_OTHER,
16937+ VXA_SOCK_SIZE /* array size */ 17277+ VXA_SOCK_SIZE /* array size */
16938+}; 17278+};
16939+ 17279+
16940+#endif /* _VX_CACCT_H */ 17280+#endif /* _VX_CACCT_H */
16941diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/cacct_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/cacct_cmd.h 17281Index: linux-2.6.18/include/linux/vserver/cacct_cmd.h
16942--- linux-2.6.18.2/include/linux/vserver/cacct_cmd.h 1970-01-01 01:00:00 +0100 17282===================================================================
16943+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/cacct_cmd.h 2006-09-25 15:40:02 +0200 17283--- /dev/null
17284+++ linux-2.6.18/include/linux/vserver/cacct_cmd.h
16944@@ -0,0 +1,23 @@ 17285@@ -0,0 +1,23 @@
16945+#ifndef _VX_CACCT_CMD_H 17286+#ifndef _VX_CACCT_CMD_H
16946+#define _VX_CACCT_CMD_H 17287+#define _VX_CACCT_CMD_H
16947+ 17288+
16948+ 17289+
16963+ 17304+
16964+extern int vc_sock_stat(struct vx_info *, void __user *); 17305+extern int vc_sock_stat(struct vx_info *, void __user *);
16965+ 17306+
16966+#endif /* __KERNEL__ */ 17307+#endif /* __KERNEL__ */
16967+#endif /* _VX_CACCT_CMD_H */ 17308+#endif /* _VX_CACCT_CMD_H */
16968diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/cacct_def.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/cacct_def.h 17309Index: linux-2.6.18/include/linux/vserver/cacct_def.h
16969--- linux-2.6.18.2/include/linux/vserver/cacct_def.h 1970-01-01 01:00:00 +0100 17310===================================================================
16970+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/cacct_def.h 2006-09-25 15:40:02 +0200 17311--- /dev/null
17312+++ linux-2.6.18/include/linux/vserver/cacct_def.h
16971@@ -0,0 +1,43 @@ 17313@@ -0,0 +1,43 @@
16972+#ifndef _VX_CACCT_DEF_H 17314+#ifndef _VX_CACCT_DEF_H
16973+#define _VX_CACCT_DEF_H 17315+#define _VX_CACCT_DEF_H
16974+ 17316+
16975+#include <asm/atomic.h> 17317+#include <asm/atomic.h>
17010+} 17352+}
17011+ 17353+
17012+#endif 17354+#endif
17013+ 17355+
17014+#endif /* _VX_CACCT_DEF_H */ 17356+#endif /* _VX_CACCT_DEF_H */
17015diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/cacct_int.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/cacct_int.h 17357Index: linux-2.6.18/include/linux/vserver/cacct_int.h
17016--- linux-2.6.18.2/include/linux/vserver/cacct_int.h 1970-01-01 01:00:00 +0100 17358===================================================================
17017+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/cacct_int.h 2006-09-25 15:40:02 +0200 17359--- /dev/null
17360+++ linux-2.6.18/include/linux/vserver/cacct_int.h
17018@@ -0,0 +1,21 @@ 17361@@ -0,0 +1,21 @@
17019+#ifndef _VX_CACCT_INT_H 17362+#ifndef _VX_CACCT_INT_H
17020+#define _VX_CACCT_INT_H 17363+#define _VX_CACCT_INT_H
17021+ 17364+
17022+ 17365+
17035+ return atomic_read(&cacct->sock[type][pos].total); 17378+ return atomic_read(&cacct->sock[type][pos].total);
17036+} 17379+}
17037+ 17380+
17038+#endif /* __KERNEL__ */ 17381+#endif /* __KERNEL__ */
17039+#endif /* _VX_CACCT_INT_H */ 17382+#endif /* _VX_CACCT_INT_H */
17040diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/context.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/context.h 17383Index: linux-2.6.18/include/linux/vserver/context.h
17041--- linux-2.6.18.2/include/linux/vserver/context.h 1970-01-01 01:00:00 +0100 17384===================================================================
17042+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/context.h 2006-09-25 15:40:02 +0200 17385--- /dev/null
17386+++ linux-2.6.18/include/linux/vserver/context.h
17043@@ -0,0 +1,219 @@ 17387@@ -0,0 +1,219 @@
17044+#ifndef _VX_CONTEXT_H 17388+#ifndef _VX_CONTEXT_H
17045+#define _VX_CONTEXT_H 17389+#define _VX_CONTEXT_H
17046+ 17390+
17047+#include <linux/types.h> 17391+#include <linux/types.h>
17258+ 17602+
17259+#endif /* __KERNEL__ */ 17603+#endif /* __KERNEL__ */
17260+#else /* _VX_CONTEXT_H */ 17604+#else /* _VX_CONTEXT_H */
17261+#warning duplicate inclusion 17605+#warning duplicate inclusion
17262+#endif /* _VX_CONTEXT_H */ 17606+#endif /* _VX_CONTEXT_H */
17263diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/context_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/context_cmd.h 17607Index: linux-2.6.18/include/linux/vserver/context_cmd.h
17264--- linux-2.6.18.2/include/linux/vserver/context_cmd.h 1970-01-01 01:00:00 +0100 17608===================================================================
17265+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/context_cmd.h 2006-09-29 18:00:31 +0200 17609--- /dev/null
17610+++ linux-2.6.18/include/linux/vserver/context_cmd.h
17266@@ -0,0 +1,123 @@ 17611@@ -0,0 +1,123 @@
17267+#ifndef _VX_CONTEXT_CMD_H 17612+#ifndef _VX_CONTEXT_CMD_H
17268+#define _VX_CONTEXT_CMD_H 17613+#define _VX_CONTEXT_CMD_H
17269+ 17614+
17270+ 17615+
17385+extern int vc_get_bcaps(struct vx_info *, void __user *); 17730+extern int vc_get_bcaps(struct vx_info *, void __user *);
17386+extern int vc_set_bcaps(struct vx_info *, void __user *); 17731+extern int vc_set_bcaps(struct vx_info *, void __user *);
17387+ 17732+
17388+#endif /* __KERNEL__ */ 17733+#endif /* __KERNEL__ */
17389+#endif /* _VX_CONTEXT_CMD_H */ 17734+#endif /* _VX_CONTEXT_CMD_H */
17390diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/cvirt.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/cvirt.h 17735Index: linux-2.6.18/include/linux/vserver/cvirt.h
17391--- linux-2.6.18.2/include/linux/vserver/cvirt.h 1970-01-01 01:00:00 +0100 17736===================================================================
17392+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/cvirt.h 2006-09-25 15:40:02 +0200 17737--- /dev/null
17738+++ linux-2.6.18/include/linux/vserver/cvirt.h
17393@@ -0,0 +1,24 @@ 17739@@ -0,0 +1,24 @@
17394+#ifndef _VX_CVIRT_H 17740+#ifndef _VX_CVIRT_H
17395+#define _VX_CVIRT_H 17741+#define _VX_CVIRT_H
17396+ 17742+
17397+ 17743+
17413+ 17759+
17414+int vx_do_syslog(int, char __user *, int); 17760+int vx_do_syslog(int, char __user *, int);
17415+ 17761+
17416+#endif /* __KERNEL__ */ 17762+#endif /* __KERNEL__ */
17417+#endif /* _VX_CVIRT_H */ 17763+#endif /* _VX_CVIRT_H */
17418diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/cvirt_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/cvirt_cmd.h 17764Index: linux-2.6.18/include/linux/vserver/cvirt_cmd.h
17419--- linux-2.6.18.2/include/linux/vserver/cvirt_cmd.h 1970-01-01 01:00:00 +0100 17765===================================================================
17420+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/cvirt_cmd.h 2006-09-27 20:25:55 +0200 17766--- /dev/null
17767+++ linux-2.6.18/include/linux/vserver/cvirt_cmd.h
17421@@ -0,0 +1,53 @@ 17768@@ -0,0 +1,53 @@
17422+#ifndef _VX_CVIRT_CMD_H 17769+#ifndef _VX_CVIRT_CMD_H
17423+#define _VX_CVIRT_CMD_H 17770+#define _VX_CVIRT_CMD_H
17424+ 17771+
17425+ 17772+
17470+#ifdef __KERNEL__ 17817+#ifdef __KERNEL__
17471+extern int vc_virt_stat(struct vx_info *, void __user *); 17818+extern int vc_virt_stat(struct vx_info *, void __user *);
17472+ 17819+
17473+#endif /* __KERNEL__ */ 17820+#endif /* __KERNEL__ */
17474+#endif /* _VX_CVIRT_CMD_H */ 17821+#endif /* _VX_CVIRT_CMD_H */
17475diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/cvirt_def.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/cvirt_def.h 17822Index: linux-2.6.18/include/linux/vserver/cvirt_def.h
17476--- linux-2.6.18.2/include/linux/vserver/cvirt_def.h 1970-01-01 01:00:00 +0100 17823===================================================================
17477+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/cvirt_def.h 2006-09-27 20:31:22 +0200 17824--- /dev/null
17825+++ linux-2.6.18/include/linux/vserver/cvirt_def.h
17478@@ -0,0 +1,84 @@ 17826@@ -0,0 +1,84 @@
17479+#ifndef _VX_CVIRT_DEF_H 17827+#ifndef _VX_CVIRT_DEF_H
17480+#define _VX_CVIRT_DEF_H 17828+#define _VX_CVIRT_DEF_H
17481+ 17829+
17482+#include <linux/jiffies.h> 17830+#include <linux/jiffies.h>
17558+} 17906+}
17559+ 17907+
17560+#endif 17908+#endif
17561+ 17909+
17562+#endif /* _VX_CVIRT_DEF_H */ 17910+#endif /* _VX_CVIRT_DEF_H */
17563diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/debug.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/debug.h 17911Index: linux-2.6.18/include/linux/vserver/debug.h
17564--- linux-2.6.18.2/include/linux/vserver/debug.h 1970-01-01 01:00:00 +0100 17912===================================================================
17565+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/debug.h 2006-11-03 18:16:21 +0100 17913--- /dev/null
17914+++ linux-2.6.18/include/linux/vserver/debug.h
17566@@ -0,0 +1,112 @@ 17915@@ -0,0 +1,112 @@
17567+#ifndef _VX_DEBUG_H 17916+#ifndef _VX_DEBUG_H
17568+#define _VX_DEBUG_H 17917+#define _VX_DEBUG_H
17569+ 17918+
17570+ 17919+
17674+#define vxd_assert(c,f,x...) do { } while (0) 18023+#define vxd_assert(c,f,x...) do { } while (0)
17675+#endif 18024+#endif
17676+ 18025+
17677+ 18026+
17678+#endif /* _VX_DEBUG_H */ 18027+#endif /* _VX_DEBUG_H */
17679diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/debug_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/debug_cmd.h 18028Index: linux-2.6.18/include/linux/vserver/debug_cmd.h
17680--- linux-2.6.18.2/include/linux/vserver/debug_cmd.h 1970-01-01 01:00:00 +0100 18029===================================================================
17681+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/debug_cmd.h 2006-10-26 00:00:28 +0200 18030--- /dev/null
18031+++ linux-2.6.18/include/linux/vserver/debug_cmd.h
17682@@ -0,0 +1,58 @@ 18032@@ -0,0 +1,58 @@
17683+#ifndef _VX_DEBUG_CMD_H 18033+#ifndef _VX_DEBUG_CMD_H
17684+#define _VX_DEBUG_CMD_H 18034+#define _VX_DEBUG_CMD_H
17685+ 18035+
17686+ 18036+
17736+ 18086+
17737+#endif /* CONFIG_COMPAT */ 18087+#endif /* CONFIG_COMPAT */
17738+ 18088+
17739+#endif /* __KERNEL__ */ 18089+#endif /* __KERNEL__ */
17740+#endif /* _VX_DEBUG_CMD_H */ 18090+#endif /* _VX_DEBUG_CMD_H */
17741diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/dlimit.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/dlimit.h 18091Index: linux-2.6.18/include/linux/vserver/dlimit.h
17742--- linux-2.6.18.2/include/linux/vserver/dlimit.h 1970-01-01 01:00:00 +0100 18092===================================================================
17743+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/dlimit.h 2006-09-25 15:40:02 +0200 18093--- /dev/null
18094+++ linux-2.6.18/include/linux/vserver/dlimit.h
17744@@ -0,0 +1,53 @@ 18095@@ -0,0 +1,53 @@
17745+#ifndef _VX_DLIMIT_H 18096+#ifndef _VX_DLIMIT_H
17746+#define _VX_DLIMIT_H 18097+#define _VX_DLIMIT_H
17747+ 18098+
17748+#include "switch.h" 18099+#include "switch.h"
17793+ 18144+
17794+#endif /* __KERNEL__ */ 18145+#endif /* __KERNEL__ */
17795+#else /* _VX_DLIMIT_H */ 18146+#else /* _VX_DLIMIT_H */
17796+#warning duplicate inclusion 18147+#warning duplicate inclusion
17797+#endif /* _VX_DLIMIT_H */ 18148+#endif /* _VX_DLIMIT_H */
17798diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/dlimit_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/dlimit_cmd.h 18149Index: linux-2.6.18/include/linux/vserver/dlimit_cmd.h
17799--- linux-2.6.18.2/include/linux/vserver/dlimit_cmd.h 1970-01-01 01:00:00 +0100 18150===================================================================
17800+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/dlimit_cmd.h 2006-10-26 00:00:28 +0200 18151--- /dev/null
18152+++ linux-2.6.18/include/linux/vserver/dlimit_cmd.h
17801@@ -0,0 +1,74 @@ 18153@@ -0,0 +1,74 @@
17802+#ifndef _VX_DLIMIT_CMD_H 18154+#ifndef _VX_DLIMIT_CMD_H
17803+#define _VX_DLIMIT_CMD_H 18155+#define _VX_DLIMIT_CMD_H
17804+ 18156+
17805+ 18157+
17871+ 18223+
17872+#endif /* CONFIG_COMPAT */ 18224+#endif /* CONFIG_COMPAT */
17873+ 18225+
17874+#endif /* __KERNEL__ */ 18226+#endif /* __KERNEL__ */
17875+#endif /* _VX_DLIMIT_CMD_H */ 18227+#endif /* _VX_DLIMIT_CMD_H */
17876diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/global.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/global.h 18228Index: linux-2.6.18/include/linux/vserver/global.h
17877--- linux-2.6.18.2/include/linux/vserver/global.h 1970-01-01 01:00:00 +0100 18229===================================================================
17878+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/global.h 2006-09-25 15:40:02 +0200 18230--- /dev/null
18231+++ linux-2.6.18/include/linux/vserver/global.h
17879@@ -0,0 +1,8 @@ 18232@@ -0,0 +1,8 @@
17880+#ifndef _VX_GLOBAL_H 18233+#ifndef _VX_GLOBAL_H
17881+#define _VX_GLOBAL_H 18234+#define _VX_GLOBAL_H
17882+ 18235+
17883+ 18236+
17884+extern atomic_t vx_global_ctotal; 18237+extern atomic_t vx_global_ctotal;
17885+extern atomic_t vx_global_cactive; 18238+extern atomic_t vx_global_cactive;
17886+ 18239+
17887+#endif /* _VX_GLOBAL_H */ 18240+#endif /* _VX_GLOBAL_H */
17888diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/history.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/history.h 18241Index: linux-2.6.18/include/linux/vserver/history.h
17889--- linux-2.6.18.2/include/linux/vserver/history.h 1970-01-01 01:00:00 +0100 18242===================================================================
17890+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/history.h 2006-10-07 17:50:52 +0200 18243--- /dev/null
18244+++ linux-2.6.18/include/linux/vserver/history.h
17891@@ -0,0 +1,197 @@ 18245@@ -0,0 +1,197 @@
17892+#ifndef _VX_HISTORY_H 18246+#ifndef _VX_HISTORY_H
17893+#define _VX_HISTORY_H 18247+#define _VX_HISTORY_H
17894+ 18248+
17895+ 18249+
18084+ 18438+
18085+ 18439+
18086+#endif /* CONFIG_VSERVER_HISTORY */ 18440+#endif /* CONFIG_VSERVER_HISTORY */
18087+ 18441+
18088+#endif /* _VX_HISTORY_H */ 18442+#endif /* _VX_HISTORY_H */
18089diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/inode.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/inode.h 18443Index: linux-2.6.18/include/linux/vserver/inode.h
18090--- linux-2.6.18.2/include/linux/vserver/inode.h 1970-01-01 01:00:00 +0100 18444===================================================================
18091+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/inode.h 2006-09-25 15:40:02 +0200 18445--- /dev/null
18446+++ linux-2.6.18/include/linux/vserver/inode.h
18092@@ -0,0 +1,38 @@ 18447@@ -0,0 +1,38 @@
18093+#ifndef _VX_INODE_H 18448+#ifndef _VX_INODE_H
18094+#define _VX_INODE_H 18449+#define _VX_INODE_H
18095+ 18450+
18096+ 18451+
18126+#define FIOC_SETXFLG _IOW('x', 6, long) 18481+#define FIOC_SETXFLG _IOW('x', 6, long)
18127+ 18482+
18128+#else /* _VX_INODE_H */ 18483+#else /* _VX_INODE_H */
18129+#warning duplicate inclusion 18484+#warning duplicate inclusion
18130+#endif /* _VX_INODE_H */ 18485+#endif /* _VX_INODE_H */
18131diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/inode_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/inode_cmd.h 18486Index: linux-2.6.18/include/linux/vserver/inode_cmd.h
18132--- linux-2.6.18.2/include/linux/vserver/inode_cmd.h 1970-01-01 01:00:00 +0100 18487===================================================================
18133+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/inode_cmd.h 2006-10-26 00:00:28 +0200 18488--- /dev/null
18489+++ linux-2.6.18/include/linux/vserver/inode_cmd.h
18134@@ -0,0 +1,61 @@ 18490@@ -0,0 +1,61 @@
18135+#ifndef _VX_INODE_CMD_H 18491+#ifndef _VX_INODE_CMD_H
18136+#define _VX_INODE_CMD_H 18492+#define _VX_INODE_CMD_H
18137+ 18493+
18138+ 18494+
18191+ 18547+
18192+#endif /* CONFIG_COMPAT */ 18548+#endif /* CONFIG_COMPAT */
18193+ 18549+
18194+#endif /* __KERNEL__ */ 18550+#endif /* __KERNEL__ */
18195+#endif /* _VX_INODE_CMD_H */ 18551+#endif /* _VX_INODE_CMD_H */
18196diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/legacy.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/legacy.h 18552Index: linux-2.6.18/include/linux/vserver/legacy.h
18197--- linux-2.6.18.2/include/linux/vserver/legacy.h 1970-01-01 01:00:00 +0100 18553===================================================================
18198+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/legacy.h 2006-09-20 17:01:45 +0200 18554--- /dev/null
18555+++ linux-2.6.18/include/linux/vserver/legacy.h
18199@@ -0,0 +1,49 @@ 18556@@ -0,0 +1,49 @@
18200+#ifndef _VX_LEGACY_H 18557+#ifndef _VX_LEGACY_H
18201+#define _VX_LEGACY_H 18558+#define _VX_LEGACY_H
18202+ 18559+
18203+#include "switch.h" 18560+#include "switch.h"
18244+extern int vc_new_s_context(uint32_t, void __user *); 18601+extern int vc_new_s_context(uint32_t, void __user *);
18245+extern int vc_set_ipv4root(uint32_t, void __user *); 18602+extern int vc_set_ipv4root(uint32_t, void __user *);
18246+ 18603+
18247+#endif /* __KERNEL__ */ 18604+#endif /* __KERNEL__ */
18248+#endif /* _VX_LEGACY_H */ 18605+#endif /* _VX_LEGACY_H */
18249diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/limit.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/limit.h 18606Index: linux-2.6.18/include/linux/vserver/limit.h
18250--- linux-2.6.18.2/include/linux/vserver/limit.h 1970-01-01 01:00:00 +0100 18607===================================================================
18251+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/limit.h 2006-09-25 15:40:02 +0200 18608--- /dev/null
18609+++ linux-2.6.18/include/linux/vserver/limit.h
18252@@ -0,0 +1,66 @@ 18610@@ -0,0 +1,66 @@
18253+#ifndef _VX_LIMIT_H 18611+#ifndef _VX_LIMIT_H
18254+#define _VX_LIMIT_H 18612+#define _VX_LIMIT_H
18255+ 18613+
18256+ 18614+
18314+ 18672+
18315+#define NUM_LIMITS 24 18673+#define NUM_LIMITS 24
18316+ 18674+
18317+#endif /* __KERNEL__ */ 18675+#endif /* __KERNEL__ */
18318+#endif /* _VX_LIMIT_H */ 18676+#endif /* _VX_LIMIT_H */
18319diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/limit_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/limit_cmd.h 18677Index: linux-2.6.18/include/linux/vserver/limit_cmd.h
18320--- linux-2.6.18.2/include/linux/vserver/limit_cmd.h 1970-01-01 01:00:00 +0100 18678===================================================================
18321+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/limit_cmd.h 2006-09-25 15:40:02 +0200 18679--- /dev/null
18680+++ linux-2.6.18/include/linux/vserver/limit_cmd.h
18322@@ -0,0 +1,69 @@ 18681@@ -0,0 +1,69 @@
18323+#ifndef _VX_LIMIT_CMD_H 18682+#ifndef _VX_LIMIT_CMD_H
18324+#define _VX_LIMIT_CMD_H 18683+#define _VX_LIMIT_CMD_H
18325+ 18684+
18326+ 18685+
18387+ 18746+
18388+#endif /* CONFIG_IA32_EMULATION */ 18747+#endif /* CONFIG_IA32_EMULATION */
18389+ 18748+
18390+#endif /* __KERNEL__ */ 18749+#endif /* __KERNEL__ */
18391+#endif /* _VX_LIMIT_CMD_H */ 18750+#endif /* _VX_LIMIT_CMD_H */
18392diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/limit_def.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/limit_def.h 18751Index: linux-2.6.18/include/linux/vserver/limit_def.h
18393--- linux-2.6.18.2/include/linux/vserver/limit_def.h 1970-01-01 01:00:00 +0100 18752===================================================================
18394+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/limit_def.h 2006-09-25 15:40:02 +0200 18753--- /dev/null
18754+++ linux-2.6.18/include/linux/vserver/limit_def.h
18395@@ -0,0 +1,47 @@ 18755@@ -0,0 +1,47 @@
18396+#ifndef _VX_LIMIT_DEF_H 18756+#ifndef _VX_LIMIT_DEF_H
18397+#define _VX_LIMIT_DEF_H 18757+#define _VX_LIMIT_DEF_H
18398+ 18758+
18399+#include <asm/atomic.h> 18759+#include <asm/atomic.h>
18438+} 18798+}
18439+ 18799+
18440+#endif 18800+#endif
18441+ 18801+
18442+#endif /* _VX_LIMIT_DEF_H */ 18802+#endif /* _VX_LIMIT_DEF_H */
18443diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/limit_int.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/limit_int.h 18803Index: linux-2.6.18/include/linux/vserver/limit_int.h
18444--- linux-2.6.18.2/include/linux/vserver/limit_int.h 1970-01-01 01:00:00 +0100 18804===================================================================
18445+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/limit_int.h 2006-09-25 15:40:02 +0200 18805--- /dev/null
18806+++ linux-2.6.18/include/linux/vserver/limit_int.h
18446@@ -0,0 +1,83 @@ 18807@@ -0,0 +1,83 @@
18447+#ifndef _VX_LIMIT_INT_H 18808+#ifndef _VX_LIMIT_INT_H
18448+#define _VX_LIMIT_INT_H 18809+#define _VX_LIMIT_INT_H
18449+ 18810+
18450+ 18811+
18525+ return 0; 18886+ return 0;
18526+} 18887+}
18527+ 18888+
18528+#endif /* __KERNEL__ */ 18889+#endif /* __KERNEL__ */
18529+#endif /* _VX_LIMIT_INT_H */ 18890+#endif /* _VX_LIMIT_INT_H */
18530diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/monitor.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/monitor.h 18891Index: linux-2.6.18/include/linux/vserver/monitor.h
18531--- linux-2.6.18.2/include/linux/vserver/monitor.h 1970-01-01 01:00:00 +0100 18892===================================================================
18532+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/monitor.h 2006-10-07 17:50:13 +0200 18893--- /dev/null
18894+++ linux-2.6.18/include/linux/vserver/monitor.h
18533@@ -0,0 +1,95 @@ 18895@@ -0,0 +1,95 @@
18534+#ifndef _VX_MONITOR_H 18896+#ifndef _VX_MONITOR_H
18535+#define _VX_MONITOR_H 18897+#define _VX_MONITOR_H
18536+ 18898+
18537+ 18899+
18624+ }; 18986+ };
18625+}; 18987+};
18626+ 18988+
18627+ 18989+
18628+#endif /* _VX_MONITOR_H */ 18990+#endif /* _VX_MONITOR_H */
18629diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/namespace.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/namespace.h 18991Index: linux-2.6.18/include/linux/vserver/namespace.h
18630--- linux-2.6.18.2/include/linux/vserver/namespace.h 1970-01-01 01:00:00 +0100 18992===================================================================
18631+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/namespace.h 2006-09-20 17:01:45 +0200 18993--- /dev/null
18994+++ linux-2.6.18/include/linux/vserver/namespace.h
18632@@ -0,0 +1,15 @@ 18995@@ -0,0 +1,15 @@
18633+#ifndef _VX_NAMESPACE_H 18996+#ifndef _VX_NAMESPACE_H
18634+#define _VX_NAMESPACE_H 18997+#define _VX_NAMESPACE_H
18635+ 18998+
18636+ 18999+
18643+extern int vx_set_namespace(struct vx_info *, struct namespace *, struct fs_struct *); 19006+extern int vx_set_namespace(struct vx_info *, struct namespace *, struct fs_struct *);
18644+ 19007+
18645+#else /* _VX_NAMESPACE_H */ 19008+#else /* _VX_NAMESPACE_H */
18646+#warning duplicate inclusion 19009+#warning duplicate inclusion
18647+#endif /* _VX_NAMESPACE_H */ 19010+#endif /* _VX_NAMESPACE_H */
18648diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/namespace_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/namespace_cmd.h 19011Index: linux-2.6.18/include/linux/vserver/namespace_cmd.h
19012===================================================================
19013--- /dev/null
18649--- linux-2.6.18.2/include/linux/vserver/namespace_cmd.h 1970-01-01 01:00:00 +0100 19014+++ linux-2.6.18/include/linux/vserver/namespace_cmd.h
18650+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/namespace_cmd.h 2006-09-25 15:40:02 +0200
18651@@ -0,0 +1,17 @@ 19015@@ -0,0 +1,17 @@
18652+#ifndef _VX_NAMESPACE_CMD_H 19016+#ifndef _VX_NAMESPACE_CMD_H
18653+#define _VX_NAMESPACE_CMD_H 19017+#define _VX_NAMESPACE_CMD_H
18654+ 19018+
18655+ 19019+
18664+extern int vc_enter_namespace(struct vx_info *, void __user *); 19028+extern int vc_enter_namespace(struct vx_info *, void __user *);
18665+extern int vc_set_namespace(struct vx_info *, void __user *); 19029+extern int vc_set_namespace(struct vx_info *, void __user *);
18666+ 19030+
18667+#endif /* __KERNEL__ */ 19031+#endif /* __KERNEL__ */
18668+#endif /* _VX_NAMESPACE_CMD_H */ 19032+#endif /* _VX_NAMESPACE_CMD_H */
18669diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/network.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/network.h 19033Index: linux-2.6.18/include/linux/vserver/network.h
18670--- linux-2.6.18.2/include/linux/vserver/network.h 1970-01-01 01:00:00 +0100 19034===================================================================
18671+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/network.h 2006-09-25 15:40:02 +0200 19035--- /dev/null
19036+++ linux-2.6.18/include/linux/vserver/network.h
18672@@ -0,0 +1,142 @@ 19037@@ -0,0 +1,142 @@
18673+#ifndef _VX_NETWORK_H 19038+#ifndef _VX_NETWORK_H
18674+#define _VX_NETWORK_H 19039+#define _VX_NETWORK_H
18675+ 19040+
18676+#include <linux/types.h> 19041+#include <linux/types.h>
18810+ 19175+
18811+#endif /* __KERNEL__ */ 19176+#endif /* __KERNEL__ */
18812+#else /* _VX_NETWORK_H */ 19177+#else /* _VX_NETWORK_H */
18813+#warning duplicate inclusion 19178+#warning duplicate inclusion
18814+#endif /* _VX_NETWORK_H */ 19179+#endif /* _VX_NETWORK_H */
18815diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/network_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/network_cmd.h 19180Index: linux-2.6.18/include/linux/vserver/network_cmd.h
18816--- linux-2.6.18.2/include/linux/vserver/network_cmd.h 1970-01-01 01:00:00 +0100 19181===================================================================
18817+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/network_cmd.h 2006-09-25 15:40:02 +0200 19182--- /dev/null
19183+++ linux-2.6.18/include/linux/vserver/network_cmd.h
18818@@ -0,0 +1,89 @@ 19184@@ -0,0 +1,89 @@
18819+#ifndef _VX_NETWORK_CMD_H 19185+#ifndef _VX_NETWORK_CMD_H
18820+#define _VX_NETWORK_CMD_H 19186+#define _VX_NETWORK_CMD_H
18821+ 19187+
18822+ 19188+
18903+extern int vc_get_ncaps(struct nx_info *, void __user *); 19269+extern int vc_get_ncaps(struct nx_info *, void __user *);
18904+extern int vc_set_ncaps(struct nx_info *, void __user *); 19270+extern int vc_set_ncaps(struct nx_info *, void __user *);
18905+ 19271+
18906+#endif /* __KERNEL__ */ 19272+#endif /* __KERNEL__ */
18907+#endif /* _VX_CONTEXT_CMD_H */ 19273+#endif /* _VX_CONTEXT_CMD_H */
18908diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/sched.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/sched.h 19274Index: linux-2.6.18/include/linux/vserver/sched.h
18909--- linux-2.6.18.2/include/linux/vserver/sched.h 1970-01-01 01:00:00 +0100 19275===================================================================
18910+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/sched.h 2006-09-25 15:40:02 +0200 19276--- /dev/null
19277+++ linux-2.6.18/include/linux/vserver/sched.h
18911@@ -0,0 +1,26 @@ 19278@@ -0,0 +1,26 @@
18912+#ifndef _VX_SCHED_H 19279+#ifndef _VX_SCHED_H
18913+#define _VX_SCHED_H 19280+#define _VX_SCHED_H
18914+ 19281+
18915+ 19282+
18933+ 19300+
18934+#endif /* __KERNEL__ */ 19301+#endif /* __KERNEL__ */
18935+#else /* _VX_SCHED_H */ 19302+#else /* _VX_SCHED_H */
18936+#warning duplicate inclusion 19303+#warning duplicate inclusion
18937+#endif /* _VX_SCHED_H */ 19304+#endif /* _VX_SCHED_H */
18938diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/sched_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/sched_cmd.h 19305Index: linux-2.6.18/include/linux/vserver/sched_cmd.h
18939--- linux-2.6.18.2/include/linux/vserver/sched_cmd.h 1970-01-01 01:00:00 +0100 19306===================================================================
18940+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/sched_cmd.h 2006-09-25 15:40:02 +0200 19307--- /dev/null
19308+++ linux-2.6.18/include/linux/vserver/sched_cmd.h
18941@@ -0,0 +1,72 @@ 19309@@ -0,0 +1,72 @@
18942+#ifndef _VX_SCHED_CMD_H 19310+#ifndef _VX_SCHED_CMD_H
18943+#define _VX_SCHED_CMD_H 19311+#define _VX_SCHED_CMD_H
18944+ 19312+
18945+ 19313+
19009+extern int vc_set_sched_v3(struct vx_info *, void __user *); 19377+extern int vc_set_sched_v3(struct vx_info *, void __user *);
19010+extern int vc_set_sched(struct vx_info *, void __user *); 19378+extern int vc_set_sched(struct vx_info *, void __user *);
19011+ 19379+
19012+#endif /* __KERNEL__ */ 19380+#endif /* __KERNEL__ */
19013+#endif /* _VX_SCHED_CMD_H */ 19381+#endif /* _VX_SCHED_CMD_H */
19014diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/sched_def.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/sched_def.h 19382Index: linux-2.6.18/include/linux/vserver/sched_def.h
19015--- linux-2.6.18.2/include/linux/vserver/sched_def.h 1970-01-01 01:00:00 +0100 19383===================================================================
19016+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/sched_def.h 2006-09-25 15:40:02 +0200 19384--- /dev/null
19385+++ linux-2.6.18/include/linux/vserver/sched_def.h
19017@@ -0,0 +1,67 @@ 19386@@ -0,0 +1,67 @@
19018+#ifndef _VX_SCHED_DEF_H 19387+#ifndef _VX_SCHED_DEF_H
19019+#define _VX_SCHED_DEF_H 19388+#define _VX_SCHED_DEF_H
19020+ 19389+
19021+#include <linux/spinlock.h> 19390+#include <linux/spinlock.h>
19080+} 19449+}
19081+ 19450+
19082+#endif 19451+#endif
19083+ 19452+
19084+#endif /* _VX_SCHED_DEF_H */ 19453+#endif /* _VX_SCHED_DEF_H */
19085diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/signal.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/signal.h 19454Index: linux-2.6.18/include/linux/vserver/signal.h
19086--- linux-2.6.18.2/include/linux/vserver/signal.h 1970-01-01 01:00:00 +0100 19455===================================================================
19087+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/signal.h 2006-09-20 17:01:45 +0200 19456--- /dev/null
19457+++ linux-2.6.18/include/linux/vserver/signal.h
19088@@ -0,0 +1,14 @@ 19458@@ -0,0 +1,14 @@
19089+#ifndef _VX_SIGNAL_H 19459+#ifndef _VX_SIGNAL_H
19090+#define _VX_SIGNAL_H 19460+#define _VX_SIGNAL_H
19091+ 19461+
19092+ 19462+
19098+ 19468+
19099+#endif /* __KERNEL__ */ 19469+#endif /* __KERNEL__ */
19100+#else /* _VX_SIGNAL_H */ 19470+#else /* _VX_SIGNAL_H */
19101+#warning duplicate inclusion 19471+#warning duplicate inclusion
19102+#endif /* _VX_SIGNAL_H */ 19472+#endif /* _VX_SIGNAL_H */
19103diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/signal_cmd.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/signal_cmd.h 19473Index: linux-2.6.18/include/linux/vserver/signal_cmd.h
19104--- linux-2.6.18.2/include/linux/vserver/signal_cmd.h 1970-01-01 01:00:00 +0100 19474===================================================================
19105+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/signal_cmd.h 2006-09-27 20:45:47 +0200 19475--- /dev/null
19476+++ linux-2.6.18/include/linux/vserver/signal_cmd.h
19106@@ -0,0 +1,43 @@ 19477@@ -0,0 +1,43 @@
19107+#ifndef _VX_SIGNAL_CMD_H 19478+#ifndef _VX_SIGNAL_CMD_H
19108+#define _VX_SIGNAL_CMD_H 19479+#define _VX_SIGNAL_CMD_H
19109+ 19480+
19110+ 19481+
19145+extern int vc_get_pflags(uint32_t pid, void __user *); 19516+extern int vc_get_pflags(uint32_t pid, void __user *);
19146+extern int vc_set_pflags(uint32_t pid, void __user *); 19517+extern int vc_set_pflags(uint32_t pid, void __user *);
19147+ 19518+
19148+#endif /* __KERNEL__ */ 19519+#endif /* __KERNEL__ */
19149+#endif /* _VX_SIGNAL_CMD_H */ 19520+#endif /* _VX_SIGNAL_CMD_H */
19150diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/switch.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/switch.h 19521Index: linux-2.6.18/include/linux/vserver/switch.h
19151--- linux-2.6.18.2/include/linux/vserver/switch.h 1970-01-01 01:00:00 +0100 19522===================================================================
19152+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/switch.h 2006-09-25 15:40:02 +0200 19523--- /dev/null
19524+++ linux-2.6.18/include/linux/vserver/switch.h
19153@@ -0,0 +1,100 @@ 19525@@ -0,0 +1,100 @@
19154+#ifndef _VX_SWITCH_H 19526+#ifndef _VX_SWITCH_H
19155+#define _VX_SWITCH_H 19527+#define _VX_SWITCH_H
19156+ 19528+
19157+#include <linux/types.h> 19529+#include <linux/types.h>
19249+#else /* __KERNEL__ */ 19621+#else /* __KERNEL__ */
19250+#define __user 19622+#define __user
19251+#endif /* __KERNEL__ */ 19623+#endif /* __KERNEL__ */
19252+ 19624+
19253+#endif /* _VX_SWITCH_H */ 19625+#endif /* _VX_SWITCH_H */
19254diff -NurpP --minimal linux-2.6.18.2/include/linux/vserver/tag.h linux-2.6.18.2-vs2.1.1/include/linux/vserver/tag.h 19626Index: linux-2.6.18/include/linux/vserver/tag.h
19255--- linux-2.6.18.2/include/linux/vserver/tag.h 1970-01-01 01:00:00 +0100 19627===================================================================
19256+++ linux-2.6.18.2-vs2.1.1/include/linux/vserver/tag.h 2006-09-25 15:40:02 +0200 19628--- /dev/null
19629+++ linux-2.6.18/include/linux/vserver/tag.h
19257@@ -0,0 +1,153 @@ 19630@@ -0,0 +1,153 @@
19258+#ifndef _DX_TAG_H 19631+#ifndef _DX_TAG_H
19259+#define _DX_TAG_H 19632+#define _DX_TAG_H
19260+ 19633+
19261+ 19634+
19406+#else 19779+#else
19407+#define dx_propagate_tag(n,i) do { } while (0) 19780+#define dx_propagate_tag(n,i) do { } while (0)
19408+#endif 19781+#endif
19409+ 19782+
19410+#endif /* _DX_TAG_H */ 19783+#endif /* _DX_TAG_H */
19411diff -NurpP --minimal linux-2.6.18.2/include/net/af_unix.h linux-2.6.18.2-vs2.1.1/include/net/af_unix.h 19784Index: linux-2.6.18/include/net/af_unix.h
19412--- linux-2.6.18.2/include/net/af_unix.h 2006-09-20 16:58:44 +0200 19785===================================================================
19413+++ linux-2.6.18.2-vs2.1.1/include/net/af_unix.h 2006-09-25 15:40:02 +0200 19786--- linux-2.6.18.orig/include/net/af_unix.h
19787+++ linux-2.6.18/include/net/af_unix.h
19414@@ -17,9 +17,9 @@ extern spinlock_t unix_table_lock; 19788@@ -17,9 +17,9 @@ extern spinlock_t unix_table_lock;
19415 19789
19416 extern atomic_t unix_tot_inflight; 19790 extern atomic_t unix_tot_inflight;
19417 19791
19418-static inline struct sock *first_unix_socket(int *i) 19792-static inline struct sock *first_unix_socket(int *i)
19451+ *i = 0; 19825+ *i = 0;
19452+ return next_unix_socket(i, NULL); 19826+ return next_unix_socket(i, NULL);
19453 } 19827 }
19454 19828
19455 #define forall_unix_sockets(i, s) \ 19829 #define forall_unix_sockets(i, s) \
19456diff -NurpP --minimal linux-2.6.18.2/include/net/inet_hashtables.h linux-2.6.18.2-vs2.1.1/include/net/inet_hashtables.h 19830Index: linux-2.6.18/include/net/inet_hashtables.h
19831===================================================================
19457--- linux-2.6.18.2/include/net/inet_hashtables.h 2006-09-20 16:58:44 +0200 19832--- linux-2.6.18.orig/include/net/inet_hashtables.h
19458+++ linux-2.6.18.2-vs2.1.1/include/net/inet_hashtables.h 2006-09-20 17:01:45 +0200 19833+++ linux-2.6.18/include/net/inet_hashtables.h
19459@@ -271,6 +271,25 @@ static inline int inet_iif(const struct 19834@@ -271,6 +271,25 @@ static inline int inet_iif(const struct
19460 return ((struct rtable *)skb->dst)->rt_iif; 19835 return ((struct rtable *)skb->dst)->rt_iif;
19461 } 19836 }
19462 19837
19463+/* 19838+/*
19489- (!inet->rcv_saddr || inet->rcv_saddr == daddr) && 19864- (!inet->rcv_saddr || inet->rcv_saddr == daddr) &&
19490+ inet_addr_match(sk->sk_nx_info, daddr, inet->rcv_saddr) && 19865+ inet_addr_match(sk->sk_nx_info, daddr, inet->rcv_saddr) &&
19491 (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) && 19866 (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) &&
19492 !sk->sk_bound_dev_if) 19867 !sk->sk_bound_dev_if)
19493 goto sherry_cache; 19868 goto sherry_cache;
19494diff -NurpP --minimal linux-2.6.18.2/include/net/inet_sock.h linux-2.6.18.2-vs2.1.1/include/net/inet_sock.h 19869Index: linux-2.6.18/include/net/inet_sock.h
19495--- linux-2.6.18.2/include/net/inet_sock.h 2006-09-20 16:58:44 +0200 19870===================================================================
19496+++ linux-2.6.18.2-vs2.1.1/include/net/inet_sock.h 2006-09-20 17:01:45 +0200 19871--- linux-2.6.18.orig/include/net/inet_sock.h
19872+++ linux-2.6.18/include/net/inet_sock.h
19497@@ -114,6 +114,7 @@ struct inet_sock { 19873@@ -114,6 +114,7 @@ struct inet_sock {
19498 /* Socket demultiplex comparisons on incoming packets. */ 19874 /* Socket demultiplex comparisons on incoming packets. */
19499 __u32 daddr; 19875 __u32 daddr;
19500 __u32 rcv_saddr; 19876 __u32 rcv_saddr;
19501+ __u32 rcv_saddr2; /* Second bound ipv4 addr, for ipv4root */ 19877+ __u32 rcv_saddr2; /* Second bound ipv4 addr, for ipv4root */
19502 __u16 dport; 19878 __u16 dport;
19503 __u16 num; 19879 __u16 num;
19504 __u32 saddr; 19880 __u32 saddr;
19505diff -NurpP --minimal linux-2.6.18.2/include/net/inet_timewait_sock.h linux-2.6.18.2-vs2.1.1/include/net/inet_timewait_sock.h 19881Index: linux-2.6.18/include/net/inet_timewait_sock.h
19882===================================================================
19506--- linux-2.6.18.2/include/net/inet_timewait_sock.h 2006-09-20 16:58:44 +0200 19883--- linux-2.6.18.orig/include/net/inet_timewait_sock.h
19507+++ linux-2.6.18.2-vs2.1.1/include/net/inet_timewait_sock.h 2006-09-20 17:01:45 +0200 19884+++ linux-2.6.18/include/net/inet_timewait_sock.h
19508@@ -115,6 +115,10 @@ struct inet_timewait_sock { 19885@@ -115,6 +115,10 @@ struct inet_timewait_sock {
19509 #define tw_refcnt __tw_common.skc_refcnt 19886 #define tw_refcnt __tw_common.skc_refcnt
19510 #define tw_hash __tw_common.skc_hash 19887 #define tw_hash __tw_common.skc_hash
19511 #define tw_prot __tw_common.skc_prot 19888 #define tw_prot __tw_common.skc_prot
19512+#define tw_xid __tw_common.skc_xid 19889+#define tw_xid __tw_common.skc_xid
19514+#define tw_nid __tw_common.skc_nid 19891+#define tw_nid __tw_common.skc_nid
19515+#define tw_nx_info __tw_common.skc_nx_info 19892+#define tw_nx_info __tw_common.skc_nx_info
19516 volatile unsigned char tw_substate; 19893 volatile unsigned char tw_substate;
19517 /* 3 bits hole, try to pack */ 19894 /* 3 bits hole, try to pack */
19518 unsigned char tw_rcv_wscale; 19895 unsigned char tw_rcv_wscale;
19519diff -NurpP --minimal linux-2.6.18.2/include/net/route.h linux-2.6.18.2-vs2.1.1/include/net/route.h 19896Index: linux-2.6.18/include/net/route.h
19520--- linux-2.6.18.2/include/net/route.h 2006-09-20 16:58:44 +0200 19897===================================================================
19521+++ linux-2.6.18.2-vs2.1.1/include/net/route.h 2006-10-18 04:06:32 +0200 19898--- linux-2.6.18.orig/include/net/route.h
19899+++ linux-2.6.18/include/net/route.h
19522@@ -27,11 +27,14 @@ 19900@@ -27,11 +27,14 @@
19523 #include <net/dst.h> 19901 #include <net/dst.h>
19524 #include <net/inetpeer.h> 19902 #include <net/inetpeer.h>
19525 #include <net/flow.h> 19903 #include <net/flow.h>
19526+#include <net/inet_sock.h> 19904+#include <net/inet_sock.h>
19621+ } 19999+ }
19622+ if (!fl.fl4_dst || !fl.fl4_src) { 20000+ if (!fl.fl4_dst || !fl.fl4_src) {
19623 err = __ip_route_output_key(rp, &fl); 20001 err = __ip_route_output_key(rp, &fl);
19624 if (err) 20002 if (err)
19625 return err; 20003 return err;
19626diff -NurpP --minimal linux-2.6.18.2/include/net/sock.h linux-2.6.18.2-vs2.1.1/include/net/sock.h 20004Index: linux-2.6.18/include/net/sock.h
19627--- linux-2.6.18.2/include/net/sock.h 2006-09-20 16:58:44 +0200 20005===================================================================
19628+++ linux-2.6.18.2-vs2.1.1/include/net/sock.h 2006-09-20 17:01:45 +0200 20006--- linux-2.6.18.orig/include/net/sock.h
20007+++ linux-2.6.18/include/net/sock.h
19629@@ -118,6 +118,10 @@ struct sock_common { 20008@@ -118,6 +118,10 @@ struct sock_common {
19630 atomic_t skc_refcnt; 20009 atomic_t skc_refcnt;
19631 unsigned int skc_hash; 20010 unsigned int skc_hash;
19632 struct proto *skc_prot; 20011 struct proto *skc_prot;
19633+ xid_t skc_xid; 20012+ xid_t skc_xid;
19646+#define sk_nid __sk_common.skc_nid 20025+#define sk_nid __sk_common.skc_nid
19647+#define sk_nx_info __sk_common.skc_nx_info 20026+#define sk_nx_info __sk_common.skc_nx_info
19648 unsigned char sk_shutdown : 2, 20027 unsigned char sk_shutdown : 2,
19649 sk_no_check : 2, 20028 sk_no_check : 2,
19650 sk_userlocks : 4; 20029 sk_userlocks : 4;
19651diff -NurpP --minimal linux-2.6.18.2/init/version.c linux-2.6.18.2-vs2.1.1/init/version.c 20030Index: linux-2.6.18/init/version.c
19652--- linux-2.6.18.2/init/version.c 2006-09-20 16:58:44 +0200 20031===================================================================
19653+++ linux-2.6.18.2-vs2.1.1/init/version.c 2006-09-20 17:01:45 +0200 20032--- linux-2.6.18.orig/init/version.c
20033+++ linux-2.6.18/init/version.c
19654@@ -32,3 +32,8 @@ EXPORT_SYMBOL(system_utsname); 20034@@ -32,3 +32,8 @@ EXPORT_SYMBOL(system_utsname);
19655 const char linux_banner[] = 20035 const char linux_banner[] =
19656 "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" 20036 "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
19657 LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; 20037 LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
19658+ 20038+
19659+const char vx_linux_banner[] = 20039+const char vx_linux_banner[] =
19660+ "Linux version %s (" LINUX_COMPILE_BY "@" 20040+ "Linux version %s (" LINUX_COMPILE_BY "@"
19661+ LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") %s\n"; 20041+ LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") %s\n";
19662+ 20042+
19663diff -NurpP --minimal linux-2.6.18.2/ipc/mqueue.c linux-2.6.18.2-vs2.1.1/ipc/mqueue.c 20043Index: linux-2.6.18/ipc/mqueue.c
19664--- linux-2.6.18.2/ipc/mqueue.c 2006-09-20 16:58:44 +0200 20044===================================================================
19665+++ linux-2.6.18.2-vs2.1.1/ipc/mqueue.c 2006-09-20 17:01:45 +0200 20045--- linux-2.6.18.orig/ipc/mqueue.c
20046+++ linux-2.6.18/ipc/mqueue.c
19666@@ -29,6 +29,8 @@ 20047@@ -29,6 +29,8 @@
19667 #include <linux/audit.h> 20048 #include <linux/audit.h>
19668 #include <linux/signal.h> 20049 #include <linux/signal.h>
19669 #include <linux/mutex.h> 20050 #include <linux/mutex.h>
19670+#include <linux/vs_context.h> 20051+#include <linux/vs_context.h>
19716- err = vfs_unlink(dentry->d_parent->d_inode, dentry); 20097- err = vfs_unlink(dentry->d_parent->d_inode, dentry);
19717+ err = vfs_unlink(dentry->d_parent->d_inode, dentry, NULL); 20098+ err = vfs_unlink(dentry->d_parent->d_inode, dentry, NULL);
19718 out_err: 20099 out_err:
19719 dput(dentry); 20100 dput(dentry);
19720 20101
19721diff -NurpP --minimal linux-2.6.18.2/ipc/msg.c linux-2.6.18.2-vs2.1.1/ipc/msg.c 20102Index: linux-2.6.18/ipc/msg.c
19722--- linux-2.6.18.2/ipc/msg.c 2006-09-20 16:58:44 +0200 20103===================================================================
19723+++ linux-2.6.18.2-vs2.1.1/ipc/msg.c 2006-09-25 15:40:02 +0200 20104--- linux-2.6.18.orig/ipc/msg.c
20105+++ linux-2.6.18/ipc/msg.c
19724@@ -103,6 +103,7 @@ static int newque(key_t key, int msgflg) 20106@@ -103,6 +103,7 @@ static int newque(key_t key, int msgflg)
19725 20107
19726 msq->q_perm.mode = msgflg & S_IRWXUGO; 20108 msq->q_perm.mode = msgflg & S_IRWXUGO;
19727 msq->q_perm.key = key; 20109 msq->q_perm.key = key;
19728+ msq->q_perm.xid = vx_current_xid(); 20110+ msq->q_perm.xid = vx_current_xid();
19737+ return 0; 20119+ return 0;
19738+ 20120+
19739 return seq_printf(s, 20121 return seq_printf(s,
19740 "%10d %10d %4o %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n", 20122 "%10d %10d %4o %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n",
19741 msq->q_perm.key, 20123 msq->q_perm.key,
19742diff -NurpP --minimal linux-2.6.18.2/ipc/sem.c linux-2.6.18.2-vs2.1.1/ipc/sem.c 20124Index: linux-2.6.18/ipc/sem.c
19743--- linux-2.6.18.2/ipc/sem.c 2006-09-20 16:58:44 +0200 20125===================================================================
19744+++ linux-2.6.18.2-vs2.1.1/ipc/sem.c 2006-09-25 15:40:02 +0200 20126--- linux-2.6.18.orig/ipc/sem.c
20127+++ linux-2.6.18/ipc/sem.c
19745@@ -78,6 +78,7 @@ 20128@@ -78,6 +78,7 @@
19746 #include <linux/capability.h> 20129 #include <linux/capability.h>
19747 #include <linux/seq_file.h> 20130 #include <linux/seq_file.h>
19748 #include <linux/mutex.h> 20131 #include <linux/mutex.h>
19749+#include <linux/vs_limit.h> 20132+#include <linux/vs_limit.h>
19784+ return 0; 20167+ return 0;
19785+ 20168+
19786 return seq_printf(s, 20169 return seq_printf(s,
19787 "%10d %10d %4o %10lu %5u %5u %5u %5u %10lu %10lu\n", 20170 "%10d %10d %4o %10lu %5u %5u %5u %5u %10lu %10lu\n",
19788 sma->sem_perm.key, 20171 sma->sem_perm.key,
19789diff -NurpP --minimal linux-2.6.18.2/ipc/shm.c linux-2.6.18.2-vs2.1.1/ipc/shm.c 20172Index: linux-2.6.18/ipc/shm.c
19790--- linux-2.6.18.2/ipc/shm.c 2006-09-20 16:58:44 +0200 20173===================================================================
19791+++ linux-2.6.18.2-vs2.1.1/ipc/shm.c 2006-09-25 15:40:02 +0200 20174--- linux-2.6.18.orig/ipc/shm.c
20175+++ linux-2.6.18/ipc/shm.c
19792@@ -32,6 +32,8 @@ 20176@@ -32,6 +32,8 @@
19793 #include <linux/ptrace.h> 20177 #include <linux/ptrace.h>
19794 #include <linux/seq_file.h> 20178 #include <linux/seq_file.h>
19795 #include <linux/mutex.h> 20179 #include <linux/mutex.h>
19796+#include <linux/vs_context.h> 20180+#include <linux/vs_context.h>
19852+ return 0; 20236+ return 0;
19853+ 20237+
19854 if (sizeof(size_t) <= sizeof(int)) 20238 if (sizeof(size_t) <= sizeof(int))
19855 format = SMALL_STRING; 20239 format = SMALL_STRING;
19856 else 20240 else
19857diff -NurpP --minimal linux-2.6.18.2/ipc/util.c linux-2.6.18.2-vs2.1.1/ipc/util.c 20241Index: linux-2.6.18/ipc/util.c
19858--- linux-2.6.18.2/ipc/util.c 2006-09-20 16:58:44 +0200 20242===================================================================
19859+++ linux-2.6.18.2-vs2.1.1/ipc/util.c 2006-09-25 15:40:02 +0200 20243--- linux-2.6.18.orig/ipc/util.c
20244+++ linux-2.6.18/ipc/util.c
19860@@ -157,7 +157,9 @@ int ipc_findkey(struct ipc_ids* ids, key 20245@@ -157,7 +157,9 @@ int ipc_findkey(struct ipc_ids* ids, key
19861 */ 20246 */
19862 for (id = 0; id <= max_id; id++) { 20247 for (id = 0; id <= max_id; id++) {
19863 p = ids->entries->p[id]; 20248 p = ids->entries->p[id];
19864- if(p==NULL) 20249- if(p==NULL)
19876+ if (!vx_check(ipcp->xid, VX_WATCH_P|VX_IDENT)) /* maybe just VX_IDENT? */ 20261+ if (!vx_check(ipcp->xid, VX_WATCH_P|VX_IDENT)) /* maybe just VX_IDENT? */
19877+ return -1; 20262+ return -1;
19878 requested_mode = (flag >> 6) | (flag >> 3) | flag; 20263 requested_mode = (flag >> 6) | (flag >> 3) | flag;
19879 granted_mode = ipcp->mode; 20264 granted_mode = ipcp->mode;
19880 if (current->euid == ipcp->cuid || current->euid == ipcp->uid) 20265 if (current->euid == ipcp->cuid || current->euid == ipcp->uid)
19881diff -NurpP --minimal linux-2.6.18.2/kernel/Makefile linux-2.6.18.2-vs2.1.1/kernel/Makefile 20266Index: linux-2.6.18/kernel/Makefile
19882--- linux-2.6.18.2/kernel/Makefile 2006-09-20 16:58:44 +0200 20267===================================================================
19883+++ linux-2.6.18.2-vs2.1.1/kernel/Makefile 2006-09-20 17:38:59 +0200 20268--- linux-2.6.18.orig/kernel/Makefile
20269+++ linux-2.6.18/kernel/Makefile
19884@@ -10,6 +10,8 @@ obj-y = sched.o fork.o exec_domain.o 20270@@ -10,6 +10,8 @@ obj-y = sched.o fork.o exec_domain.o
19885 kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ 20271 kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
19886 hrtimer.o rwsem.o 20272 hrtimer.o rwsem.o
19887 20273
19888+obj-y += vserver/ 20274+obj-y += vserver/
19889+ 20275+
19890 obj-$(CONFIG_STACKTRACE) += stacktrace.o 20276 obj-$(CONFIG_STACKTRACE) += stacktrace.o
19891 obj-y += time/ 20277 obj-y += time/
19892 obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o 20278 obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
19893diff -NurpP --minimal linux-2.6.18.2/kernel/capability.c linux-2.6.18.2-vs2.1.1/kernel/capability.c 20279Index: linux-2.6.18/kernel/capability.c
19894--- linux-2.6.18.2/kernel/capability.c 2006-09-20 16:58:44 +0200 20280===================================================================
19895+++ linux-2.6.18.2-vs2.1.1/kernel/capability.c 2006-10-07 04:29:47 +0200 20281--- linux-2.6.18.orig/kernel/capability.c
20282+++ linux-2.6.18/kernel/capability.c
19896@@ -246,6 +246,9 @@ EXPORT_SYMBOL(__capable); 20283@@ -246,6 +246,9 @@ EXPORT_SYMBOL(__capable);
19897 20284
19898 int capable(int cap) 20285 int capable(int cap)
19899 { 20286 {
19900+ /* here for now so we don't require task locking */ 20287+ /* here for now so we don't require task locking */
19901+ if (vx_check_bit(VXC_CAP_MASK, cap) && !vx_mcaps(1L << cap)) 20288+ if (vx_check_bit(VXC_CAP_MASK, cap) && !vx_mcaps(1L << cap))
19902+ return 0; 20289+ return 0;
19903 return __capable(current, cap); 20290 return __capable(current, cap);
19904 } 20291 }
19905 EXPORT_SYMBOL(capable); 20292 EXPORT_SYMBOL(capable);
19906diff -NurpP --minimal linux-2.6.18.2/kernel/compat.c linux-2.6.18.2-vs2.1.1/kernel/compat.c 20293Index: linux-2.6.18/kernel/compat.c
19907--- linux-2.6.18.2/kernel/compat.c 2006-09-20 16:58:44 +0200 20294===================================================================
19908+++ linux-2.6.18.2-vs2.1.1/kernel/compat.c 2006-09-25 15:40:02 +0200 20295--- linux-2.6.18.orig/kernel/compat.c
20296+++ linux-2.6.18/kernel/compat.c
19909@@ -813,7 +813,7 @@ asmlinkage long compat_sys_time(compat_t 20297@@ -813,7 +813,7 @@ asmlinkage long compat_sys_time(compat_t
19910 compat_time_t i; 20298 compat_time_t i;
19911 struct timeval tv; 20299 struct timeval tv;
19912 20300
19913- do_gettimeofday(&tv); 20301- do_gettimeofday(&tv);
19922- do_settimeofday(&tv); 20310- do_settimeofday(&tv);
19923+ vx_settimeofday(&tv); 20311+ vx_settimeofday(&tv);
19924 return 0; 20312 return 0;
19925 } 20313 }
19926 20314
19927diff -NurpP --minimal linux-2.6.18.2/kernel/exit.c linux-2.6.18.2-vs2.1.1/kernel/exit.c 20315Index: linux-2.6.18/kernel/exit.c
19928--- linux-2.6.18.2/kernel/exit.c 2006-09-20 16:58:44 +0200 20316===================================================================
19929+++ linux-2.6.18.2-vs2.1.1/kernel/exit.c 2006-10-28 18:31:23 +0200 20317--- linux-2.6.18.orig/kernel/exit.c
20318+++ linux-2.6.18/kernel/exit.c
19930@@ -38,6 +38,9 @@ 20319@@ -38,6 +38,9 @@
19931 #include <linux/pipe_fs_i.h> 20320 #include <linux/pipe_fs_i.h>
19932 #include <linux/audit.h> /* for audit_free() */ 20321 #include <linux/audit.h> /* for audit_free() */
19933 #include <linux/resource.h> 20322 #include <linux/resource.h>
19934+#include <linux/vs_limit.h> 20323+#include <linux/vs_limit.h>
19997+ exit_nx_info(tsk); 20386+ exit_nx_info(tsk);
19998+ 20387+
19999 /* PF_DEAD causes final put_task_struct after we schedule. */ 20388 /* PF_DEAD causes final put_task_struct after we schedule. */
20000 preempt_disable(); 20389 preempt_disable();
20001 BUG_ON(tsk->flags & PF_DEAD); 20390 BUG_ON(tsk->flags & PF_DEAD);
20002diff -NurpP --minimal linux-2.6.18.2/kernel/fork.c linux-2.6.18.2-vs2.1.1/kernel/fork.c 20391Index: linux-2.6.18/kernel/fork.c
20003--- linux-2.6.18.2/kernel/fork.c 2006-09-20 16:58:44 +0200 20392===================================================================
20004+++ linux-2.6.18.2-vs2.1.1/kernel/fork.c 2006-09-25 15:40:02 +0200 20393--- linux-2.6.18.orig/kernel/fork.c
20394+++ linux-2.6.18/kernel/fork.c
20005@@ -45,6 +45,10 @@ 20395@@ -45,6 +45,10 @@
20006 #include <linux/cn_proc.h> 20396 #include <linux/cn_proc.h>
20007 #include <linux/delayacct.h> 20397 #include <linux/delayacct.h>
20008 #include <linux/taskstats_kern.h> 20398 #include <linux/taskstats_kern.h>
20009+#include <linux/vs_context.h> 20399+#include <linux/vs_context.h>
20011+#include <linux/vs_limit.h> 20401+#include <linux/vs_limit.h>
20012+#include <linux/vs_memory.h> 20402+#include <linux/vs_memory.h>
20013 20403
20014 #include <asm/pgtable.h> 20404 #include <asm/pgtable.h>
20015 #include <asm/pgalloc.h> 20405 #include <asm/pgalloc.h>
20016@@ -104,6 +108,8 @@ void free_task(struct task_struct *tsk) 20406@@ -105,6 +109,8 @@ void free_task(struct task_struct *tsk)
20017 { 20407 {
20018 free_thread_info(tsk->thread_info); 20408 free_thread_info(tsk->thread_info);
20019 rt_mutex_debug_task_free(tsk); 20409 rt_mutex_debug_task_free(tsk);
20020+ clr_vx_info(&tsk->vx_info); 20410+ clr_vx_info(&tsk->vx_info);
20021+ clr_nx_info(&tsk->nx_info); 20411+ clr_nx_info(&tsk->nx_info);
20022 free_task_struct(tsk); 20412 free_task_struct(tsk);
20023 } 20413 }
20024 EXPORT_SYMBOL(free_task); 20414 EXPORT_SYMBOL(free_task);
20025@@ -205,6 +211,8 @@ static inline int dup_mmap(struct mm_str 20415@@ -206,6 +212,8 @@ static inline int dup_mmap(struct mm_str
20026 mm->free_area_cache = oldmm->mmap_base; 20416 mm->free_area_cache = oldmm->mmap_base;
20027 mm->cached_hole_size = ~0UL; 20417 mm->cached_hole_size = ~0UL;
20028 mm->map_count = 0; 20418 mm->map_count = 0;
20029+ __set_mm_counter(mm, file_rss, 0); 20419+ __set_mm_counter(mm, file_rss, 0);
20030+ __set_mm_counter(mm, anon_rss, 0); 20420+ __set_mm_counter(mm, anon_rss, 0);
20031 cpus_clear(mm->cpu_vm_mask); 20421 cpus_clear(mm->cpu_vm_mask);
20032 mm->mm_rb = RB_ROOT; 20422 mm->mm_rb = RB_ROOT;
20033 rb_link = &mm->mm_rb.rb_node; 20423 rb_link = &mm->mm_rb.rb_node;
20034@@ -216,7 +224,7 @@ static inline int dup_mmap(struct mm_str 20424@@ -217,7 +225,7 @@ static inline int dup_mmap(struct mm_str
20035 20425
20036 if (mpnt->vm_flags & VM_DONTCOPY) { 20426 if (mpnt->vm_flags & VM_DONTCOPY) {
20037 long pages = vma_pages(mpnt); 20427 long pages = vma_pages(mpnt);
20038- mm->total_vm -= pages; 20428- mm->total_vm -= pages;
20039+ vx_vmpages_sub(mm, pages); 20429+ vx_vmpages_sub(mm, pages);
20040 vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file, 20430 vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file,
20041 -pages); 20431 -pages);
20042 continue; 20432 continue;
20043@@ -323,8 +331,6 @@ static struct mm_struct * mm_init(struct 20433@@ -324,8 +332,6 @@ static struct mm_struct * mm_init(struct
20044 INIT_LIST_HEAD(&mm->mmlist); 20434 INIT_LIST_HEAD(&mm->mmlist);
20045 mm->core_waiters = 0; 20435 mm->core_waiters = 0;
20046 mm->nr_ptes = 0; 20436 mm->nr_ptes = 0;
20047- set_mm_counter(mm, file_rss, 0); 20437- set_mm_counter(mm, file_rss, 0);
20048- set_mm_counter(mm, anon_rss, 0); 20438- set_mm_counter(mm, anon_rss, 0);
20049 spin_lock_init(&mm->page_table_lock); 20439 spin_lock_init(&mm->page_table_lock);
20050 rwlock_init(&mm->ioctx_list_lock); 20440 rwlock_init(&mm->ioctx_list_lock);
20051 mm->ioctx_list = NULL; 20441 mm->ioctx_list = NULL;
20052@@ -333,6 +339,7 @@ static struct mm_struct * mm_init(struct 20442@@ -334,6 +340,7 @@ static struct mm_struct * mm_init(struct
20053 20443
20054 if (likely(!mm_alloc_pgd(mm))) { 20444 if (likely(!mm_alloc_pgd(mm))) {
20055 mm->def_flags = 0; 20445 mm->def_flags = 0;
20056+ set_vx_info(&mm->mm_vx_info, current->vx_info); 20446+ set_vx_info(&mm->mm_vx_info, current->vx_info);
20057 return mm; 20447 return mm;
20058 } 20448 }
20059 free_mm(mm); 20449 free_mm(mm);
20060@@ -364,6 +371,7 @@ void fastcall __mmdrop(struct mm_struct 20450@@ -365,6 +372,7 @@ void fastcall __mmdrop(struct mm_struct
20061 BUG_ON(mm == &init_mm); 20451 BUG_ON(mm == &init_mm);
20062 mm_free_pgd(mm); 20452 mm_free_pgd(mm);
20063 destroy_context(mm); 20453 destroy_context(mm);
20064+ clr_vx_info(&mm->mm_vx_info); 20454+ clr_vx_info(&mm->mm_vx_info);
20065 free_mm(mm); 20455 free_mm(mm);
20066 } 20456 }
20067 20457
20068@@ -469,6 +477,7 @@ static struct mm_struct *dup_mm(struct t 20458@@ -504,6 +512,7 @@ static struct mm_struct *dup_mm(struct t
20069 goto fail_nomem; 20459 goto fail_nomem;
20070 20460
20071 memcpy(mm, oldmm, sizeof(*mm)); 20461 memcpy(mm, oldmm, sizeof(*mm));
20072+ mm->mm_vx_info = NULL; 20462+ mm->mm_vx_info = NULL;
20073 20463
20074 if (!mm_init(mm)) 20464 if (!mm_init(mm))
20075 goto fail_nomem; 20465 goto fail_nomem;
20076@@ -496,6 +505,7 @@ fail_nocontext: 20466@@ -531,6 +540,7 @@ fail_nocontext:
20077 * If init_new_context() failed, we cannot use mmput() to free the mm 20467 * If init_new_context() failed, we cannot use mmput() to free the mm
20078 * because it calls destroy_context() 20468 * because it calls destroy_context()
20079 */ 20469 */
20080+ clr_vx_info(&mm->mm_vx_info); 20470+ clr_vx_info(&mm->mm_vx_info);
20081 mm_free_pgd(mm); 20471 mm_free_pgd(mm);
20082 free_mm(mm); 20472 free_mm(mm);
20083 return NULL; 20473 return NULL;
20084@@ -691,6 +701,8 @@ static struct files_struct *dup_fd(struc 20474@@ -726,6 +736,8 @@ static struct files_struct *dup_fd(struc
20085 struct file *f = *old_fds++; 20475 struct file *f = *old_fds++;
20086 if (f) { 20476 if (f) {
20087 get_file(f); 20477 get_file(f);
20088+ /* FIXME: sum it first for check and performance */ 20478+ /* FIXME: sum it first for check and performance */
20089+ vx_openfd_inc(open_files - i); 20479+ vx_openfd_inc(open_files - i);
20090 } else { 20480 } else {
20091 /* 20481 /*
20092 * The fd may be claimed in the fd bitmap but not yet 20482 * The fd may be claimed in the fd bitmap but not yet
20093@@ -947,6 +959,8 @@ static struct task_struct *copy_process( 20483@@ -982,6 +994,8 @@ static struct task_struct *copy_process(
20094 { 20484 {
20095 int retval; 20485 int retval;
20096 struct task_struct *p = NULL; 20486 struct task_struct *p = NULL;
20097+ struct vx_info *vxi; 20487+ struct vx_info *vxi;
20098+ struct nx_info *nxi; 20488+ struct nx_info *nxi;
20099 20489
20100 if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS)) 20490 if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
20101 return ERR_PTR(-EINVAL); 20491 return ERR_PTR(-EINVAL);
20102@@ -979,12 +993,30 @@ static struct task_struct *copy_process( 20492@@ -1014,12 +1028,30 @@ static struct task_struct *copy_process(
20103 DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled); 20493 DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
20104 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled); 20494 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
20105 #endif 20495 #endif
20106+ init_vx_info(&p->vx_info, current->vx_info); 20496+ init_vx_info(&p->vx_info, current->vx_info);
20107+ init_nx_info(&p->nx_info, current->nx_info); 20497+ init_nx_info(&p->nx_info, current->nx_info);
20129- goto bad_fork_free; 20519- goto bad_fork_free;
20130+ goto bad_fork_cleanup_vm; 20520+ goto bad_fork_cleanup_vm;
20131 } 20521 }
20132 20522
20133 atomic_inc(&p->user->__count); 20523 atomic_inc(&p->user->__count);
20134@@ -1247,6 +1279,18 @@ static struct task_struct *copy_process( 20524@@ -1282,6 +1314,18 @@ static struct task_struct *copy_process(
20135 20525
20136 total_forks++; 20526 total_forks++;
20137 spin_unlock(&current->sighand->siglock); 20527 spin_unlock(&current->sighand->siglock);
20138+ 20528+
20139+ /* p is copy of current */ 20529+ /* p is copy of current */
20148+ if (nxi) 20538+ if (nxi)
20149+ claim_nx_info(nxi, p); 20539+ claim_nx_info(nxi, p);
20150 write_unlock_irq(&tasklist_lock); 20540 write_unlock_irq(&tasklist_lock);
20151 proc_fork_connector(p); 20541 proc_fork_connector(p);
20152 return p; 20542 return p;
20153@@ -1288,6 +1332,9 @@ bad_fork_cleanup_count: 20543@@ -1323,6 +1367,9 @@ bad_fork_cleanup_count:
20154 put_group_info(p->group_info); 20544 put_group_info(p->group_info);
20155 atomic_dec(&p->user->processes); 20545 atomic_dec(&p->user->processes);
20156 free_uid(p->user); 20546 free_uid(p->user);
20157+bad_fork_cleanup_vm: 20547+bad_fork_cleanup_vm:
20158+ if (p->mm && !(clone_flags & CLONE_VM)) 20548+ if (p->mm && !(clone_flags & CLONE_VM))
20159+ vx_pages_sub(p->vx_info, RLIMIT_AS, p->mm->total_vm); 20549+ vx_pages_sub(p->vx_info, RLIMIT_AS, p->mm->total_vm);
20160 bad_fork_free: 20550 bad_fork_free:
20161 free_task(p); 20551 free_task(p);
20162 fork_out: 20552 fork_out:
20163@@ -1349,6 +1396,15 @@ long do_fork(unsigned long clone_flags, 20553@@ -1384,6 +1431,15 @@ long do_fork(unsigned long clone_flags,
20164 20554
20165 if (!pid) 20555 if (!pid)
20166 return -EAGAIN; 20556 return -EAGAIN;
20167+ 20557+
20168+ /* kernel threads are host only */ 20558+ /* kernel threads are host only */
20174+ } 20564+ }
20175+ 20565+
20176 nr = pid->nr; 20566 nr = pid->nr;
20177 if (unlikely(current->ptrace)) { 20567 if (unlikely(current->ptrace)) {
20178 trace = fork_traceflag (clone_flags); 20568 trace = fork_traceflag (clone_flags);
20179diff -NurpP --minimal linux-2.6.18.2/kernel/irq/handle.c linux-2.6.18.2-vs2.1.1/kernel/irq/handle.c 20569Index: linux-2.6.18/kernel/irq/handle.c
20180--- linux-2.6.18.2/kernel/irq/handle.c 2006-09-20 16:58:44 +0200 20570===================================================================
20181+++ linux-2.6.18.2-vs2.1.1/kernel/irq/handle.c 2006-10-29 20:13:29 +0100 20571--- linux-2.6.18.orig/kernel/irq/handle.c
20572+++ linux-2.6.18/kernel/irq/handle.c
20182@@ -15,6 +15,7 @@ 20573@@ -15,6 +15,7 @@
20183 #include <linux/random.h> 20574 #include <linux/random.h>
20184 #include <linux/interrupt.h> 20575 #include <linux/interrupt.h>
20185 #include <linux/kernel_stat.h> 20576 #include <linux/kernel_stat.h>
20186+#include <linux/vs_context.h> 20577+#include <linux/vs_context.h>
20219 desc->chip->end(irq); 20610 desc->chip->end(irq);
20220+ __leave_vx_admin(&vxis); 20611+ __leave_vx_admin(&vxis);
20221 spin_unlock(&desc->lock); 20612 spin_unlock(&desc->lock);
20222 20613
20223 return 1; 20614 return 1;
20224diff -NurpP --minimal linux-2.6.18.2/kernel/kthread.c linux-2.6.18.2-vs2.1.1/kernel/kthread.c 20615Index: linux-2.6.18/kernel/kthread.c
20225--- linux-2.6.18.2/kernel/kthread.c 2006-09-20 16:58:44 +0200 20616===================================================================
20226+++ linux-2.6.18.2-vs2.1.1/kernel/kthread.c 2006-09-20 17:01:45 +0200 20617--- linux-2.6.18.orig/kernel/kthread.c
20618+++ linux-2.6.18/kernel/kthread.c
20227@@ -123,7 +123,7 @@ static void keventd_create_kthread(void 20619@@ -123,7 +123,7 @@ static void keventd_create_kthread(void
20228 } else { 20620 } else {
20229 wait_for_completion(&create->started); 20621 wait_for_completion(&create->started);
20230 read_lock(&tasklist_lock); 20622 read_lock(&tasklist_lock);
20231- create->result = find_task_by_pid(pid); 20623- create->result = find_task_by_pid(pid);
20232+ create->result = find_task_by_real_pid(pid); 20624+ create->result = find_task_by_real_pid(pid);
20233 read_unlock(&tasklist_lock); 20625 read_unlock(&tasklist_lock);
20234 } 20626 }
20235 complete(&create->done); 20627 complete(&create->done);
20236diff -NurpP --minimal linux-2.6.18.2/kernel/pid.c linux-2.6.18.2-vs2.1.1/kernel/pid.c 20628Index: linux-2.6.18/kernel/pid.c
20237--- linux-2.6.18.2/kernel/pid.c 2006-09-20 16:58:44 +0200 20629===================================================================
20238+++ linux-2.6.18.2-vs2.1.1/kernel/pid.c 2006-10-29 20:12:58 +0100 20630--- linux-2.6.18.orig/kernel/pid.c
20631+++ linux-2.6.18/kernel/pid.c
20239@@ -26,6 +26,7 @@ 20632@@ -26,6 +26,7 @@
20240 #include <linux/init.h> 20633 #include <linux/init.h>
20241 #include <linux/bootmem.h> 20634 #include <linux/bootmem.h>
20242 #include <linux/hash.h> 20635 #include <linux/hash.h>
20243+#include <linux/vs_pid.h> 20636+#include <linux/vs_pid.h>
20268+ else if (type == PIDTYPE_REALPID) 20661+ else if (type == PIDTYPE_REALPID)
20269+ type = PIDTYPE_PID; 20662+ type = PIDTYPE_PID;
20270 return pid_task(find_pid(nr), type); 20663 return pid_task(find_pid(nr), type);
20271 } 20664 }
20272 20665
20273diff -NurpP --minimal linux-2.6.18.2/kernel/posix-timers.c linux-2.6.18.2-vs2.1.1/kernel/posix-timers.c 20666Index: linux-2.6.18/kernel/posix-timers.c
20274--- linux-2.6.18.2/kernel/posix-timers.c 2006-06-18 04:55:31 +0200 20667===================================================================
20275+++ linux-2.6.18.2-vs2.1.1/kernel/posix-timers.c 2006-10-06 23:10:42 +0200 20668--- linux-2.6.18.orig/kernel/posix-timers.c
20669+++ linux-2.6.18/kernel/posix-timers.c
20276@@ -48,6 +48,7 @@ 20670@@ -48,6 +48,7 @@
20277 #include <linux/wait.h> 20671 #include <linux/wait.h>
20278 #include <linux/workqueue.h> 20672 #include <linux/workqueue.h>
20279 #include <linux/module.h> 20673 #include <linux/module.h>
20280+#include <linux/vs_context.h> 20674+#include <linux/vs_context.h>
20329- (!(rtn = find_task_by_pid(event->sigev_notify_thread_id)) || 20723- (!(rtn = find_task_by_pid(event->sigev_notify_thread_id)) ||
20330+ (!(rtn = find_task_by_real_pid(event->sigev_notify_thread_id)) || 20724+ (!(rtn = find_task_by_real_pid(event->sigev_notify_thread_id)) ||
20331 rtn->tgid != current->tgid || 20725 rtn->tgid != current->tgid ||
20332 (event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL)) 20726 (event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL))
20333 return NULL; 20727 return NULL;
20334diff -NurpP --minimal linux-2.6.18.2/kernel/printk.c linux-2.6.18.2-vs2.1.1/kernel/printk.c 20728Index: linux-2.6.18/kernel/printk.c
20335--- linux-2.6.18.2/kernel/printk.c 2006-09-20 16:58:44 +0200 20729===================================================================
20336+++ linux-2.6.18.2-vs2.1.1/kernel/printk.c 2006-09-25 17:37:24 +0200 20730--- linux-2.6.18.orig/kernel/printk.c
20731+++ linux-2.6.18/kernel/printk.c
20337@@ -31,6 +31,8 @@ 20732@@ -31,6 +31,8 @@
20338 #include <linux/security.h> 20733 #include <linux/security.h>
20339 #include <linux/bootmem.h> 20734 #include <linux/bootmem.h>
20340 #include <linux/syscalls.h> 20735 #include <linux/syscalls.h>
20341+#include <linux/vs_context.h> 20736+#include <linux/vs_context.h>
20415 20810
20416+ __leave_vx_admin(&vxis); 20811+ __leave_vx_admin(&vxis);
20417 preempt_enable(); 20812 preempt_enable();
20418 return printed_len; 20813 return printed_len;
20419 } 20814 }
20420diff -NurpP --minimal linux-2.6.18.2/kernel/ptrace.c linux-2.6.18.2-vs2.1.1/kernel/ptrace.c 20815Index: linux-2.6.18/kernel/ptrace.c
20421--- linux-2.6.18.2/kernel/ptrace.c 2006-09-20 16:58:44 +0200 20816===================================================================
20422+++ linux-2.6.18.2-vs2.1.1/kernel/ptrace.c 2006-10-07 04:29:47 +0200 20817--- linux-2.6.18.orig/kernel/ptrace.c
20818+++ linux-2.6.18/kernel/ptrace.c
20423@@ -144,6 +144,11 @@ static int may_attach(struct task_struct 20819@@ -144,6 +144,11 @@ static int may_attach(struct task_struct
20424 dumpable = task->mm->dumpable; 20820 dumpable = task->mm->dumpable;
20425 if (!dumpable && !capable(CAP_SYS_PTRACE)) 20821 if (!dumpable && !capable(CAP_SYS_PTRACE))
20426 return -EPERM; 20822 return -EPERM;
20427+ if (!vx_check(task->xid, VX_ADMIN_P|VX_IDENT)) 20823+ if (!vx_check(task->xid, VX_ADMIN_P|VX_IDENT))
20441+ goto out_put_task_struct; 20837+ goto out_put_task_struct;
20442+ 20838+
20443 if (request == PTRACE_ATTACH) { 20839 if (request == PTRACE_ATTACH) {
20444 ret = ptrace_attach(child); 20840 ret = ptrace_attach(child);
20445 goto out_put_task_struct; 20841 goto out_put_task_struct;
20446diff -NurpP --minimal linux-2.6.18.2/kernel/sched.c linux-2.6.18.2-vs2.1.1/kernel/sched.c 20842Index: linux-2.6.18/kernel/sched.c
20447--- linux-2.6.18.2/kernel/sched.c 2006-11-04 19:43:24 +0100 20843===================================================================
20448+++ linux-2.6.18.2-vs2.1.1/kernel/sched.c 2006-10-28 19:04:30 +0200 20844--- linux-2.6.18.orig/kernel/sched.c
20845+++ linux-2.6.18/kernel/sched.c
20449@@ -55,6 +55,9 @@ 20846@@ -55,6 +55,9 @@
20450 #include <asm/tlb.h> 20847 #include <asm/tlb.h>
20451 20848
20452 #include <asm/unistd.h> 20849 #include <asm/unistd.h>
20453+#include <linux/vs_context.h> 20850+#include <linux/vs_context.h>
20754 if (array) { 21151 if (array) {
20755+ vx_activate_task(p); 21152+ vx_activate_task(p);
20756 __activate_task(p, task_rq(p)); 21153 __activate_task(p, task_rq(p));
20757 resched_task(rq->curr); 21154 resched_task(rq->curr);
20758 } 21155 }
20759diff -NurpP --minimal linux-2.6.18.2/kernel/sched_hard.h linux-2.6.18.2-vs2.1.1/kernel/sched_hard.h 21156Index: linux-2.6.18/kernel/sched_hard.h
20760--- linux-2.6.18.2/kernel/sched_hard.h 1970-01-01 01:00:00 +0100 21157===================================================================
20761+++ linux-2.6.18.2-vs2.1.1/kernel/sched_hard.h 2006-09-25 18:55:03 +0200 21158--- /dev/null
21159+++ linux-2.6.18/kernel/sched_hard.h
20762@@ -0,0 +1,324 @@ 21160@@ -0,0 +1,324 @@
20763+ 21161+
20764+#ifdef CONFIG_VSERVER_IDLELIMIT 21162+#ifdef CONFIG_VSERVER_IDLELIMIT
20765+ 21163+
20766+/* 21164+/*
21082+ return 1; 21480+ return 1;
21083+} 21481+}
21084+ 21482+
21085+#endif /* CONFIG_VSERVER_HARDCPU */ 21483+#endif /* CONFIG_VSERVER_HARDCPU */
21086+ 21484+
21087diff -NurpP --minimal linux-2.6.18.2/kernel/sched_mon.h linux-2.6.18.2-vs2.1.1/kernel/sched_mon.h 21485Index: linux-2.6.18/kernel/sched_mon.h
21088--- linux-2.6.18.2/kernel/sched_mon.h 1970-01-01 01:00:00 +0100 21486===================================================================
21089+++ linux-2.6.18.2-vs2.1.1/kernel/sched_mon.h 2006-10-15 04:18:52 +0200 21487--- /dev/null
21488+++ linux-2.6.18/kernel/sched_mon.h
21090@@ -0,0 +1,200 @@ 21489@@ -0,0 +1,200 @@
21091+ 21490+
21092+#include <linux/vserver/monitor.h> 21491+#include <linux/vserver/monitor.h>
21093+ 21492+
21094+#ifdef CONFIG_VSERVER_MONITOR 21493+#ifdef CONFIG_VSERVER_MONITOR
21286+#define vxm_update_sched(s,v,c) do { } while (0) 21685+#define vxm_update_sched(s,v,c) do { } while (0)
21287+#define vxm_rq_max_min(q,c) do { } while (0) 21686+#define vxm_rq_max_min(q,c) do { } while (0)
21288+ 21687+
21289+#endif /* CONFIG_VSERVER_MONITOR */ 21688+#endif /* CONFIG_VSERVER_MONITOR */
21290+ 21689+
21291diff -NurpP --minimal linux-2.6.18.2/kernel/signal.c linux-2.6.18.2-vs2.1.1/kernel/signal.c 21690Index: linux-2.6.18/kernel/signal.c
21292--- linux-2.6.18.2/kernel/signal.c 2006-09-20 16:58:44 +0200 21691===================================================================
21293+++ linux-2.6.18.2-vs2.1.1/kernel/signal.c 2006-10-25 03:39:09 +0200 21692--- linux-2.6.18.orig/kernel/signal.c
21693+++ linux-2.6.18/kernel/signal.c
21294@@ -23,6 +23,7 @@ 21694@@ -23,6 +23,7 @@
21295 #include <linux/ptrace.h> 21695 #include <linux/ptrace.h>
21296 #include <linux/signal.h> 21696 #include <linux/signal.h>
21297 #include <linux/capability.h> 21697 #include <linux/capability.h>
21298+#include <linux/vserver/debug.h> 21698+#include <linux/vserver/debug.h>
21361+ continue; 21761+ continue;
21362+ 21762+
21363 if (sig_kernel_stop(signr)) { 21763 if (sig_kernel_stop(signr)) {
21364 /* 21764 /*
21365 * The default action is to stop all threads in 21765 * The default action is to stop all threads in
21366diff -NurpP --minimal linux-2.6.18.2/kernel/softirq.c linux-2.6.18.2-vs2.1.1/kernel/softirq.c 21766Index: linux-2.6.18/kernel/softirq.c
21367--- linux-2.6.18.2/kernel/softirq.c 2006-09-20 16:58:44 +0200 21767===================================================================
21368+++ linux-2.6.18.2-vs2.1.1/kernel/softirq.c 2006-09-25 17:56:22 +0200 21768--- linux-2.6.18.orig/kernel/softirq.c
21769+++ linux-2.6.18/kernel/softirq.c
21369@@ -17,6 +17,7 @@ 21770@@ -17,6 +17,7 @@
21370 #include <linux/kthread.h> 21771 #include <linux/kthread.h>
21371 #include <linux/rcupdate.h> 21772 #include <linux/rcupdate.h>
21372 #include <linux/smp.h> 21773 #include <linux/smp.h>
21373+#include <linux/vs_context.h> 21774+#include <linux/vs_context.h>
21396 21797
21397+ __leave_vx_admin(&vxis); 21798+ __leave_vx_admin(&vxis);
21398 account_system_vtime(current); 21799 account_system_vtime(current);
21399 _local_bh_enable(); 21800 _local_bh_enable();
21400 } 21801 }
21401diff -NurpP --minimal linux-2.6.18.2/kernel/sys.c linux-2.6.18.2-vs2.1.1/kernel/sys.c 21802Index: linux-2.6.18/kernel/sys.c
21402--- linux-2.6.18.2/kernel/sys.c 2006-09-20 16:58:44 +0200 21803===================================================================
21403+++ linux-2.6.18.2-vs2.1.1/kernel/sys.c 2006-09-25 15:40:02 +0200 21804--- linux-2.6.18.orig/kernel/sys.c
21805+++ linux-2.6.18/kernel/sys.c
21404@@ -10,6 +10,7 @@ 21806@@ -10,6 +10,7 @@
21405 #include <linux/mman.h> 21807 #include <linux/mman.h>
21406 #include <linux/smp_lock.h> 21808 #include <linux/smp_lock.h>
21407 #include <linux/notifier.h> 21809 #include <linux/notifier.h>
21408+#include <linux/kmod.h> 21810+#include <linux/kmod.h>
21625- !capable(CAP_SYS_RESOURCE)) 22027- !capable(CAP_SYS_RESOURCE))
21626+ !vx_capable(CAP_SYS_RESOURCE, VXC_SET_RLIMIT)) 22028+ !vx_capable(CAP_SYS_RESOURCE, VXC_SET_RLIMIT))
21627 return -EPERM; 22029 return -EPERM;
21628 if (resource == RLIMIT_NOFILE && new_rlim.rlim_max > NR_OPEN) 22030 if (resource == RLIMIT_NOFILE && new_rlim.rlim_max > NR_OPEN)
21629 return -EPERM; 22031 return -EPERM;
21630diff -NurpP --minimal linux-2.6.18.2/kernel/sysctl.c linux-2.6.18.2-vs2.1.1/kernel/sysctl.c 22032Index: linux-2.6.18/kernel/sysctl.c
21631--- linux-2.6.18.2/kernel/sysctl.c 2006-11-04 19:43:24 +0100 22033===================================================================
21632+++ linux-2.6.18.2-vs2.1.1/kernel/sysctl.c 2006-10-18 01:14:31 +0200 22034--- linux-2.6.18.orig/kernel/sysctl.c
22035+++ linux-2.6.18/kernel/sysctl.c
21633@@ -45,6 +45,7 @@ 22036@@ -45,6 +45,7 @@
21634 #include <linux/syscalls.h> 22037 #include <linux/syscalls.h>
21635 #include <linux/nfs_fs.h> 22038 #include <linux/nfs_fs.h>
21636 #include <linux/acpi.h> 22039 #include <linux/acpi.h>
21637+#include <linux/vserver/cvirt.h> 22040+#include <linux/vserver/cvirt.h>
21638 22041
21639 #include <asm/uaccess.h> 22042 #include <asm/uaccess.h>
21640 #include <asm/processor.h> 22043 #include <asm/processor.h>
21641@@ -90,6 +91,7 @@ static int ngroups_max = NGROUPS_MAX;
21642 #ifdef CONFIG_KMOD
21643 extern char modprobe_path[]; 22044@@ -93,6 +94,7 @@ extern char modprobe_path[];
22045 #ifdef CONFIG_FB_SPLASH
22046 extern char fbsplash_path[];
21644 #endif 22047 #endif
21645+extern char vshelper_path[]; 22048+extern char vshelper_path[];
21646 #ifdef CONFIG_CHR_DEV_SG 22049 #ifdef CONFIG_CHR_DEV_SG
21647 extern int sg_big_buff; 22050 extern int sg_big_buff;
21648 #endif 22051 #endif
21649@@ -235,6 +237,7 @@ static ctl_table kern_table[] = { 22052@@ -248,6 +250,7 @@ static ctl_table kern_table[] = {
21650 .maxlen = sizeof(system_utsname.sysname), 22053 .maxlen = sizeof(system_utsname.sysname),
21651 .mode = 0444, 22054 .mode = 0444,
21652 .proc_handler = &proc_doutsstring, 22055 .proc_handler = &proc_doutsstring,
21653+ .virt_handler = &vx_uts_virt_handler, 22056+ .virt_handler = &vx_uts_virt_handler,
21654 .strategy = &sysctl_string, 22057 .strategy = &sysctl_string,
21655 }, 22058 },
21656 { 22059 {
21657@@ -244,6 +247,7 @@ static ctl_table kern_table[] = { 22060@@ -257,6 +260,7 @@ static ctl_table kern_table[] = {
21658 .maxlen = sizeof(system_utsname.release), 22061 .maxlen = sizeof(system_utsname.release),
21659 .mode = 0444, 22062 .mode = 0444,
21660 .proc_handler = &proc_doutsstring, 22063 .proc_handler = &proc_doutsstring,
21661+ .virt_handler = &vx_uts_virt_handler, 22064+ .virt_handler = &vx_uts_virt_handler,
21662 .strategy = &sysctl_string, 22065 .strategy = &sysctl_string,
21663 }, 22066 },
21664 { 22067 {
21665@@ -253,6 +257,7 @@ static ctl_table kern_table[] = { 22068@@ -266,6 +270,7 @@ static ctl_table kern_table[] = {
21666 .maxlen = sizeof(system_utsname.version), 22069 .maxlen = sizeof(system_utsname.version),
21667 .mode = 0444, 22070 .mode = 0444,
21668 .proc_handler = &proc_doutsstring, 22071 .proc_handler = &proc_doutsstring,
21669+ .virt_handler = &vx_uts_virt_handler, 22072+ .virt_handler = &vx_uts_virt_handler,
21670 .strategy = &sysctl_string, 22073 .strategy = &sysctl_string,
21671 }, 22074 },
21672 { 22075 {
21673@@ -262,6 +267,7 @@ static ctl_table kern_table[] = { 22076@@ -275,6 +280,7 @@ static ctl_table kern_table[] = {
21674 .maxlen = sizeof(system_utsname.nodename), 22077 .maxlen = sizeof(system_utsname.nodename),
21675 .mode = 0644, 22078 .mode = 0644,
21676 .proc_handler = &proc_doutsstring, 22079 .proc_handler = &proc_doutsstring,
21677+ .virt_handler = &vx_uts_virt_handler, 22080+ .virt_handler = &vx_uts_virt_handler,
21678 .strategy = &sysctl_string, 22081 .strategy = &sysctl_string,
21679 }, 22082 },
21680 { 22083 {
21681@@ -271,6 +277,7 @@ static ctl_table kern_table[] = { 22084@@ -284,6 +290,7 @@ static ctl_table kern_table[] = {
21682 .maxlen = sizeof(system_utsname.domainname), 22085 .maxlen = sizeof(system_utsname.domainname),
21683 .mode = 0644, 22086 .mode = 0644,
21684 .proc_handler = &proc_doutsstring, 22087 .proc_handler = &proc_doutsstring,
21685+ .virt_handler = &vx_uts_virt_handler, 22088+ .virt_handler = &vx_uts_virt_handler,
21686 .strategy = &sysctl_string, 22089 .strategy = &sysctl_string,
21687 }, 22090 },
21688 { 22091 {
21689@@ -407,6 +414,15 @@ static ctl_table kern_table[] = { 22092@@ -431,6 +438,15 @@ static ctl_table kern_table[] = {
21690 .strategy = &sysctl_string, 22093 .strategy = &sysctl_string,
21691 }, 22094 },
21692 #endif 22095 #endif
21693+ { 22096+ {
21694+ .ctl_name = KERN_VSHELPER, 22097+ .ctl_name = KERN_VSHELPER,
21700+ .strategy = &sysctl_string, 22103+ .strategy = &sysctl_string,
21701+ }, 22104+ },
21702 #ifdef CONFIG_CHR_DEV_SG 22105 #ifdef CONFIG_CHR_DEV_SG
21703 { 22106 {
21704 .ctl_name = KERN_SG_BIG_BUFF, 22107 .ctl_name = KERN_SG_BIG_BUFF,
21705@@ -1611,16 +1627,20 @@ static ssize_t proc_writesys(struct file 22108@@ -1635,16 +1651,20 @@ static ssize_t proc_writesys(struct file
21706 int proc_dostring(ctl_table *table, int write, struct file *filp, 22109 int proc_dostring(ctl_table *table, int write, struct file *filp,
21707 void __user *buffer, size_t *lenp, loff_t *ppos) 22110 void __user *buffer, size_t *lenp, loff_t *ppos)
21708 { 22111 {
21709- size_t len; 22112- size_t len;
21710+ size_t len, maxlen; 22113+ size_t len, maxlen;
21728+ table->virt_handler(table, write, filp->f_xid, &data, &maxlen); 22131+ table->virt_handler(table, write, filp->f_xid, &data, &maxlen);
21729+ 22132+
21730 if (write) { 22133 if (write) {
21731 len = 0; 22134 len = 0;
21732 p = buffer; 22135 p = buffer;
21733@@ -1631,20 +1651,20 @@ int proc_dostring(ctl_table *table, int 22136@@ -1655,20 +1675,20 @@ int proc_dostring(ctl_table *table, int
21734 break; 22137 break;
21735 len++; 22138 len++;
21736 } 22139 }
21737- if (len >= table->maxlen) 22140- if (len >= table->maxlen)
21738- len = table->maxlen-1; 22141- len = table->maxlen-1;
21757- if(copy_to_user(buffer, table->data, len)) 22160- if(copy_to_user(buffer, table->data, len))
21758+ if(copy_to_user(buffer, data, len)) 22161+ if(copy_to_user(buffer, data, len))
21759 return -EFAULT; 22162 return -EFAULT;
21760 if (len < *lenp) { 22163 if (len < *lenp) {
21761 if(put_user('\n', ((char __user *) buffer) + len)) 22164 if(put_user('\n', ((char __user *) buffer) + len))
21762diff -NurpP --minimal linux-2.6.18.2/kernel/time.c linux-2.6.18.2-vs2.1.1/kernel/time.c 22165Index: linux-2.6.18/kernel/time.c
21763--- linux-2.6.18.2/kernel/time.c 2006-09-20 16:58:44 +0200 22166===================================================================
21764+++ linux-2.6.18.2-vs2.1.1/kernel/time.c 2006-09-25 15:40:02 +0200 22167--- linux-2.6.18.orig/kernel/time.c
22168+++ linux-2.6.18/kernel/time.c
21765@@ -61,7 +61,7 @@ asmlinkage long sys_time(time_t __user * 22169@@ -61,7 +61,7 @@ asmlinkage long sys_time(time_t __user *
21766 time_t i; 22170 time_t i;
21767 struct timeval tv; 22171 struct timeval tv;
21768 22172
21769- do_gettimeofday(&tv); 22173- do_gettimeofday(&tv);
21805- do_gettimeofday(&x); 22209- do_gettimeofday(&x);
21806+ vx_gettimeofday(&x); 22210+ vx_gettimeofday(&x);
21807 tv->tv_sec = x.tv_sec; 22211 tv->tv_sec = x.tv_sec;
21808 tv->tv_nsec = x.tv_usec * NSEC_PER_USEC; 22212 tv->tv_nsec = x.tv_usec * NSEC_PER_USEC;
21809 } 22213 }
21810diff -NurpP --minimal linux-2.6.18.2/kernel/timer.c linux-2.6.18.2-vs2.1.1/kernel/timer.c 22214Index: linux-2.6.18/kernel/timer.c
21811--- linux-2.6.18.2/kernel/timer.c 2006-09-20 16:58:44 +0200 22215===================================================================
21812+++ linux-2.6.18.2-vs2.1.1/kernel/timer.c 2006-11-03 00:38:37 +0100 22216--- linux-2.6.18.orig/kernel/timer.c
22217+++ linux-2.6.18/kernel/timer.c
21813@@ -34,6 +34,9 @@ 22218@@ -34,6 +34,9 @@
21814 #include <linux/cpu.h> 22219 #include <linux/cpu.h>
21815 #include <linux/syscalls.h> 22220 #include <linux/syscalls.h>
21816 #include <linux/delay.h> 22221 #include <linux/delay.h>
21817+#include <linux/vs_cvirt.h> 22222+#include <linux/vs_cvirt.h>
21846 rcu_read_lock(); 22251 rcu_read_lock();
21847 pid = rcu_dereference(current->real_parent)->tgid; 22252 pid = rcu_dereference(current->real_parent)->tgid;
21848 rcu_read_unlock(); 22253 rcu_read_unlock();
21849+ return vx_map_pid(pid); 22254+ return vx_map_pid(pid);
21850+} 22255+}
22256+
22257+#ifdef __alpha__
21851 22258
21852- return pid; 22259- return pid;
21853+#ifdef __alpha__
21854+
21855+/* 22260+/*
21856+ * The Alpha uses getxpid, getxuid, and getxgid instead. 22261+ * The Alpha uses getxpid, getxuid, and getxgid instead.
21857+ */ 22262+ */
21858+ 22263+
21859+asmlinkage long do_getxpid(long *ppid) 22264+asmlinkage long do_getxpid(long *ppid)
21874+ if (vx_flags(VXF_VIRT_UPTIME, 0)) 22279+ if (vx_flags(VXF_VIRT_UPTIME, 0))
21875+ vx_vsi_uptime(&tp, NULL); 22280+ vx_vsi_uptime(&tp, NULL);
21876 val.uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0); 22281 val.uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0);
21877 22282
21878 val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT); 22283 val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT);
21879diff -NurpP --minimal linux-2.6.18.2/kernel/user.c linux-2.6.18.2-vs2.1.1/kernel/user.c 22284Index: linux-2.6.18/kernel/user.c
21880--- linux-2.6.18.2/kernel/user.c 2006-09-20 16:58:44 +0200 22285===================================================================
21881+++ linux-2.6.18.2-vs2.1.1/kernel/user.c 2006-09-20 17:01:45 +0200 22286--- linux-2.6.18.orig/kernel/user.c
22287+++ linux-2.6.18/kernel/user.c
21882@@ -23,8 +23,8 @@ 22288@@ -23,8 +23,8 @@
21883 #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8) 22289 #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8)
21884 #define UIDHASH_SZ (1 << UIDHASH_BITS) 22290 #define UIDHASH_SZ (1 << UIDHASH_BITS)
21885 #define UIDHASH_MASK (UIDHASH_SZ - 1) 22291 #define UIDHASH_MASK (UIDHASH_SZ - 1)
21886-#define __uidhashfn(uid) (((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK) 22292-#define __uidhashfn(uid) (((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK)
21965- uid_hash_insert(&root_user, uidhashentry(0)); 22371- uid_hash_insert(&root_user, uidhashentry(0));
21966+ uid_hash_insert(&root_user, uidhashentry(0,0)); 22372+ uid_hash_insert(&root_user, uidhashentry(0,0));
21967 spin_unlock_irq(&uidhash_lock); 22373 spin_unlock_irq(&uidhash_lock);
21968 22374
21969 return 0; 22375 return 0;
21970diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/Kconfig linux-2.6.18.2-vs2.1.1/kernel/vserver/Kconfig 22376Index: linux-2.6.18/kernel/vserver/Kconfig
21971--- linux-2.6.18.2/kernel/vserver/Kconfig 1970-01-01 01:00:00 +0100 22377===================================================================
21972+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/Kconfig 2006-10-20 03:20:49 +0200 22378--- /dev/null
22379+++ linux-2.6.18/kernel/vserver/Kconfig
21973@@ -0,0 +1,273 @@ 22380@@ -0,0 +1,273 @@
21974+# 22381+#
21975+# Linux VServer configuration 22382+# Linux VServer configuration
21976+# 22383+#
21977+ 22384+
22242+config VSERVER_NGNET 22649+config VSERVER_NGNET
22243+ bool 22650+ bool
22244+ depends on EXPERIMENTAL && !VSERVER_LEGACYNET 22651+ depends on EXPERIMENTAL && !VSERVER_LEGACYNET
22245+ default y 22652+ default y
22246+ 22653+
22247diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/Makefile linux-2.6.18.2-vs2.1.1/kernel/vserver/Makefile 22654Index: linux-2.6.18/kernel/vserver/Makefile
22248--- linux-2.6.18.2/kernel/vserver/Makefile 1970-01-01 01:00:00 +0100 22655===================================================================
22249+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/Makefile 2006-09-25 15:40:02 +0200 22656--- /dev/null
22657+++ linux-2.6.18/kernel/vserver/Makefile
22250@@ -0,0 +1,17 @@ 22658@@ -0,0 +1,17 @@
22251+# 22659+#
22252+# Makefile for the Linux vserver routines. 22660+# Makefile for the Linux vserver routines.
22253+# 22661+#
22254+ 22662+
22263+vserver-$(CONFIG_VSERVER_LEGACY) += legacy.o 22671+vserver-$(CONFIG_VSERVER_LEGACY) += legacy.o
22264+vserver-$(CONFIG_VSERVER_LEGACYNET) += legacynet.o 22672+vserver-$(CONFIG_VSERVER_LEGACYNET) += legacynet.o
22265+vserver-$(CONFIG_VSERVER_HISTORY) += history.o 22673+vserver-$(CONFIG_VSERVER_HISTORY) += history.o
22266+vserver-$(CONFIG_VSERVER_MONITOR) += monitor.o 22674+vserver-$(CONFIG_VSERVER_MONITOR) += monitor.o
22267+ 22675+
22268diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/cacct.c linux-2.6.18.2-vs2.1.1/kernel/vserver/cacct.c 22676Index: linux-2.6.18/kernel/vserver/cacct.c
22269--- linux-2.6.18.2/kernel/vserver/cacct.c 1970-01-01 01:00:00 +0100 22677===================================================================
22270+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/cacct.c 2006-09-25 15:40:02 +0200 22678--- /dev/null
22679+++ linux-2.6.18/kernel/vserver/cacct.c
22271@@ -0,0 +1,43 @@ 22680@@ -0,0 +1,43 @@
22272+/* 22681+/*
22273+ * linux/kernel/vserver/cacct.c 22682+ * linux/kernel/vserver/cacct.c
22274+ * 22683+ *
22275+ * Virtual Server: Context Accounting 22684+ * Virtual Server: Context Accounting
22310+ if (copy_to_user (data, &vc_data, sizeof(vc_data))) 22719+ if (copy_to_user (data, &vc_data, sizeof(vc_data)))
22311+ return -EFAULT; 22720+ return -EFAULT;
22312+ return 0; 22721+ return 0;
22313+} 22722+}
22314+ 22723+
22315diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/cacct_init.h linux-2.6.18.2-vs2.1.1/kernel/vserver/cacct_init.h 22724Index: linux-2.6.18/kernel/vserver/cacct_init.h
22316--- linux-2.6.18.2/kernel/vserver/cacct_init.h 1970-01-01 01:00:00 +0100 22725===================================================================
22317+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/cacct_init.h 2006-09-25 15:40:02 +0200 22726--- /dev/null
22727+++ linux-2.6.18/kernel/vserver/cacct_init.h
22318@@ -0,0 +1,25 @@ 22728@@ -0,0 +1,25 @@
22319+ 22729+
22320+ 22730+
22321+static inline void vx_info_init_cacct(struct _vx_cacct *cacct) 22731+static inline void vx_info_init_cacct(struct _vx_cacct *cacct)
22322+{ 22732+{
22339+static inline void vx_info_exit_cacct(struct _vx_cacct *cacct) 22749+static inline void vx_info_exit_cacct(struct _vx_cacct *cacct)
22340+{ 22750+{
22341+ return; 22751+ return;
22342+} 22752+}
22343+ 22753+
22344diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/cacct_proc.h linux-2.6.18.2-vs2.1.1/kernel/vserver/cacct_proc.h 22754Index: linux-2.6.18/kernel/vserver/cacct_proc.h
22345--- linux-2.6.18.2/kernel/vserver/cacct_proc.h 1970-01-01 01:00:00 +0100 22755===================================================================
22346+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/cacct_proc.h 2006-09-25 15:40:02 +0200 22756--- /dev/null
22757+++ linux-2.6.18/kernel/vserver/cacct_proc.h
22347@@ -0,0 +1,58 @@ 22758@@ -0,0 +1,58 @@
22348+#ifndef _VX_CACCT_PROC_H 22759+#ifndef _VX_CACCT_PROC_H
22349+#define _VX_CACCT_PROC_H 22760+#define _VX_CACCT_PROC_H
22350+ 22761+
22351+#include <linux/vserver/cacct_int.h> 22762+#include <linux/vserver/cacct_int.h>
22401+ 22812+
22402+ return length; 22813+ return length;
22403+} 22814+}
22404+ 22815+
22405+#endif /* _VX_CACCT_PROC_H */ 22816+#endif /* _VX_CACCT_PROC_H */
22406diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/context.c linux-2.6.18.2-vs2.1.1/kernel/vserver/context.c 22817Index: linux-2.6.18/kernel/vserver/context.c
22407--- linux-2.6.18.2/kernel/vserver/context.c 1970-01-01 01:00:00 +0100 22818===================================================================
22408+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/context.c 2006-10-28 18:15:09 +0200 22819--- /dev/null
22820+++ linux-2.6.18/kernel/vserver/context.c
22409@@ -0,0 +1,1076 @@ 22821@@ -0,0 +1,1076 @@
22410+/* 22822+/*
22411+ * linux/kernel/vserver/context.c 22823+ * linux/kernel/vserver/context.c
22412+ * 22824+ *
22413+ * Virtual Server: Context Support 22825+ * Virtual Server: Context Support
23481+ 23893+
23482+#include <linux/module.h> 23894+#include <linux/module.h>
23483+ 23895+
23484+EXPORT_SYMBOL_GPL(free_vx_info); 23896+EXPORT_SYMBOL_GPL(free_vx_info);
23485+ 23897+
23486diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/cvirt.c linux-2.6.18.2-vs2.1.1/kernel/vserver/cvirt.c 23898Index: linux-2.6.18/kernel/vserver/cvirt.c
23487--- linux-2.6.18.2/kernel/vserver/cvirt.c 1970-01-01 01:00:00 +0100 23899===================================================================
23488+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/cvirt.c 2006-10-02 02:28:37 +0200 23900--- /dev/null
23901+++ linux-2.6.18/kernel/vserver/cvirt.c
23489@@ -0,0 +1,318 @@ 23902@@ -0,0 +1,318 @@
23490+/* 23903+/*
23491+ * linux/kernel/vserver/cvirt.c 23904+ * linux/kernel/vserver/cvirt.c
23492+ * 23905+ *
23493+ * Virtual Server: Context Virtualization 23906+ * Virtual Server: Context Virtualization
23803+ return 0; 24216+ return 0;
23804+} 24217+}
23805+ 24218+
23806+#endif 24219+#endif
23807+ 24220+
23808diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/cvirt_init.h linux-2.6.18.2-vs2.1.1/kernel/vserver/cvirt_init.h 24221Index: linux-2.6.18/kernel/vserver/cvirt_init.h
23809--- linux-2.6.18.2/kernel/vserver/cvirt_init.h 1970-01-01 01:00:00 +0100 24222===================================================================
23810+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/cvirt_init.h 2006-09-25 15:40:02 +0200 24223--- /dev/null
24224+++ linux-2.6.18/kernel/vserver/cvirt_init.h
23811@@ -0,0 +1,75 @@ 24225@@ -0,0 +1,75 @@
23812+ 24226+
23813+ 24227+
23814+extern uint64_t vx_idle_jiffies(void); 24228+extern uint64_t vx_idle_jiffies(void);
23815+ 24229+
23882+void vx_info_exit_cvirt_pc(struct _vx_cvirt_pc *cvirt_pc, int cpu) 24296+void vx_info_exit_cvirt_pc(struct _vx_cvirt_pc *cvirt_pc, int cpu)
23883+{ 24297+{
23884+ return; 24298+ return;
23885+} 24299+}
23886+ 24300+
23887diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/cvirt_proc.h linux-2.6.18.2-vs2.1.1/kernel/vserver/cvirt_proc.h 24301Index: linux-2.6.18/kernel/vserver/cvirt_proc.h
23888--- linux-2.6.18.2/kernel/vserver/cvirt_proc.h 1970-01-01 01:00:00 +0100 24302===================================================================
23889+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/cvirt_proc.h 2006-09-25 15:40:02 +0200 24303--- /dev/null
24304+++ linux-2.6.18/kernel/vserver/cvirt_proc.h
23890@@ -0,0 +1,67 @@ 24305@@ -0,0 +1,67 @@
23891+#ifndef _VX_CVIRT_PROC_H 24306+#ifndef _VX_CVIRT_PROC_H
23892+#define _VX_CVIRT_PROC_H 24307+#define _VX_CVIRT_PROC_H
23893+ 24308+
23894+#include <linux/sched.h> 24309+#include <linux/sched.h>
23953+ int length = 0; 24368+ int length = 0;
23954+ return length; 24369+ return length;
23955+} 24370+}
23956+ 24371+
23957+#endif /* _VX_CVIRT_PROC_H */ 24372+#endif /* _VX_CVIRT_PROC_H */
23958diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/debug.c linux-2.6.18.2-vs2.1.1/kernel/vserver/debug.c 24373Index: linux-2.6.18/kernel/vserver/debug.c
23959--- linux-2.6.18.2/kernel/vserver/debug.c 1970-01-01 01:00:00 +0100 24374===================================================================
23960+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/debug.c 2006-09-25 15:40:02 +0200 24375--- /dev/null
24376+++ linux-2.6.18/kernel/vserver/debug.c
23961@@ -0,0 +1,37 @@ 24377@@ -0,0 +1,37 @@
23962+/* 24378+/*
23963+ * kernel/vserver/debug.c 24379+ * kernel/vserver/debug.c
23964+ * 24380+ *
23965+ * Copyright (C) 2005 Herbert P÷tzl 24381+ * Copyright (C) 2005 Herbert P÷tzl
23994+} 24410+}
23995+ 24411+
23996+ 24412+
23997+EXPORT_SYMBOL_GPL(dump_vx_info); 24413+EXPORT_SYMBOL_GPL(dump_vx_info);
23998+ 24414+
23999diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/dlimit.c linux-2.6.18.2-vs2.1.1/kernel/vserver/dlimit.c 24415Index: linux-2.6.18/kernel/vserver/dlimit.c
24000--- linux-2.6.18.2/kernel/vserver/dlimit.c 1970-01-01 01:00:00 +0100 24416===================================================================
24001+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/dlimit.c 2006-09-25 15:40:02 +0200 24417--- /dev/null
24418+++ linux-2.6.18/kernel/vserver/dlimit.c
24002@@ -0,0 +1,527 @@ 24419@@ -0,0 +1,527 @@
24003+/* 24420+/*
24004+ * linux/kernel/vserver/dlimit.c 24421+ * linux/kernel/vserver/dlimit.c
24005+ * 24422+ *
24006+ * Virtual Server: Context Disk Limits 24423+ * Virtual Server: Context Disk Limits
24525+#include <linux/module.h> 24942+#include <linux/module.h>
24526+ 24943+
24527+EXPORT_SYMBOL_GPL(locate_dl_info); 24944+EXPORT_SYMBOL_GPL(locate_dl_info);
24528+EXPORT_SYMBOL_GPL(rcu_free_dl_info); 24945+EXPORT_SYMBOL_GPL(rcu_free_dl_info);
24529+ 24946+
24530diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/helper.c linux-2.6.18.2-vs2.1.1/kernel/vserver/helper.c 24947Index: linux-2.6.18/kernel/vserver/helper.c
24531--- linux-2.6.18.2/kernel/vserver/helper.c 1970-01-01 01:00:00 +0100 24948===================================================================
24532+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/helper.c 2006-09-25 15:40:02 +0200 24949--- /dev/null
24950+++ linux-2.6.18/kernel/vserver/helper.c
24533@@ -0,0 +1,208 @@ 24951@@ -0,0 +1,208 @@
24534+/* 24952+/*
24535+ * linux/kernel/vserver/helper.c 24953+ * linux/kernel/vserver/helper.c
24536+ * 24954+ *
24537+ * Virtual Context Support 24955+ * Virtual Context Support
24737+ } 25155+ }
24738+ 25156+
24739+ return do_vshelper(vshelper_path, argv, envp, 1); 25157+ return do_vshelper(vshelper_path, argv, envp, 1);
24740+} 25158+}
24741+ 25159+
24742diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/history.c linux-2.6.18.2-vs2.1.1/kernel/vserver/history.c 25160Index: linux-2.6.18/kernel/vserver/history.c
24743--- linux-2.6.18.2/kernel/vserver/history.c 1970-01-01 01:00:00 +0100 25161===================================================================
24744+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/history.c 2006-10-20 03:18:58 +0200 25162--- /dev/null
25163+++ linux-2.6.18/kernel/vserver/history.c
24745@@ -0,0 +1,263 @@ 25164@@ -0,0 +1,263 @@
24746+/* 25165+/*
24747+ * kernel/vserver/history.c 25166+ * kernel/vserver/history.c
24748+ * 25167+ *
24749+ * Virtual Context History Backtrace 25168+ * Virtual Context History Backtrace
25004+ return ret; 25423+ return ret;
25005+} 25424+}
25006+ 25425+
25007+#endif /* CONFIG_COMPAT */ 25426+#endif /* CONFIG_COMPAT */
25008+ 25427+
25009diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/init.c linux-2.6.18.2-vs2.1.1/kernel/vserver/init.c 25428Index: linux-2.6.18/kernel/vserver/init.c
25010--- linux-2.6.18.2/kernel/vserver/init.c 1970-01-01 01:00:00 +0100 25429===================================================================
25011+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/init.c 2006-09-25 15:40:02 +0200 25430--- /dev/null
25431+++ linux-2.6.18/kernel/vserver/init.c
25012@@ -0,0 +1,46 @@ 25432@@ -0,0 +1,46 @@
25013+/* 25433+/*
25014+ * linux/kernel/init.c 25434+ * linux/kernel/init.c
25015+ * 25435+ *
25016+ * Virtual Server Init 25436+ * Virtual Server Init
25054+ 25474+
25055+ 25475+
25056+module_init(init_vserver); 25476+module_init(init_vserver);
25057+module_exit(exit_vserver); 25477+module_exit(exit_vserver);
25058+ 25478+
25059diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/inode.c linux-2.6.18.2-vs2.1.1/kernel/vserver/inode.c 25479Index: linux-2.6.18/kernel/vserver/inode.c
25060--- linux-2.6.18.2/kernel/vserver/inode.c 1970-01-01 01:00:00 +0100 25480===================================================================
25061+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/inode.c 2006-09-25 15:40:02 +0200 25481--- /dev/null
25482+++ linux-2.6.18/kernel/vserver/inode.c
25062@@ -0,0 +1,369 @@ 25483@@ -0,0 +1,369 @@
25063+/* 25484+/*
25064+ * linux/kernel/vserver/inode.c 25485+ * linux/kernel/vserver/inode.c
25065+ * 25486+ *
25066+ * Virtual Server: File System Support 25487+ * Virtual Server: File System Support
25427+ 25848+
25428+EXPORT_SYMBOL_GPL(__dx_propagate_tag); 25849+EXPORT_SYMBOL_GPL(__dx_propagate_tag);
25429+ 25850+
25430+#endif /* CONFIG_PROPAGATE */ 25851+#endif /* CONFIG_PROPAGATE */
25431+ 25852+
25432diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/legacy.c linux-2.6.18.2-vs2.1.1/kernel/vserver/legacy.c 25853Index: linux-2.6.18/kernel/vserver/legacy.c
25433--- linux-2.6.18.2/kernel/vserver/legacy.c 1970-01-01 01:00:00 +0100 25854===================================================================
25434+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/legacy.c 2006-09-25 15:40:02 +0200 25855--- /dev/null
25856+++ linux-2.6.18/kernel/vserver/legacy.c
25435@@ -0,0 +1,113 @@ 25857@@ -0,0 +1,113 @@
25436+/* 25858+/*
25437+ * linux/kernel/vserver/legacy.c 25859+ * linux/kernel/vserver/legacy.c
25438+ * 25860+ *
25439+ * Virtual Server: Legacy Funtions 25861+ * Virtual Server: Legacy Funtions
25544+out_put: 25966+out_put:
25545+ put_vx_info(new_vxi); 25967+ put_vx_info(new_vxi);
25546+ return ret; 25968+ return ret;
25547+} 25969+}
25548+ 25970+
25549diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/legacynet.c linux-2.6.18.2-vs2.1.1/kernel/vserver/legacynet.c 25971Index: linux-2.6.18/kernel/vserver/legacynet.c
25550--- linux-2.6.18.2/kernel/vserver/legacynet.c 1970-01-01 01:00:00 +0100 25972===================================================================
25551+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/legacynet.c 2006-09-20 17:01:45 +0200 25973--- /dev/null
25974+++ linux-2.6.18/kernel/vserver/legacynet.c
25552@@ -0,0 +1,84 @@ 25975@@ -0,0 +1,84 @@
25553+ 25976+
25554+/* 25977+/*
25555+ * linux/kernel/vserver/legacynet.c 25978+ * linux/kernel/vserver/legacynet.c
25556+ * 25979+ *
25632+ put_nx_info(new_nxi); 26055+ put_nx_info(new_nxi);
25633+ return 0; 26056+ return 0;
25634+} 26057+}
25635+ 26058+
25636+ 26059+
25637diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/limit.c linux-2.6.18.2-vs2.1.1/kernel/vserver/limit.c 26060Index: linux-2.6.18/kernel/vserver/limit.c
25638--- linux-2.6.18.2/kernel/vserver/limit.c 1970-01-01 01:00:00 +0100 26061===================================================================
25639+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/limit.c 2006-09-25 15:40:02 +0200 26062--- /dev/null
26063+++ linux-2.6.18/kernel/vserver/limit.c
25640@@ -0,0 +1,297 @@ 26064@@ -0,0 +1,297 @@
25641+/* 26065+/*
25642+ * linux/kernel/vserver/limit.c 26066+ * linux/kernel/vserver/limit.c
25643+ * 26067+ *
25644+ * Virtual Server: Context Limits 26068+ * Virtual Server: Context Limits
25933+ val->totalswap = totalswap; 26357+ val->totalswap = totalswap;
25934+ val->freeswap = freeswap; 26358+ val->freeswap = freeswap;
25935+ return; 26359+ return;
25936+} 26360+}
25937+ 26361+
25938diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/limit_init.h linux-2.6.18.2-vs2.1.1/kernel/vserver/limit_init.h 26362Index: linux-2.6.18/kernel/vserver/limit_init.h
25939--- linux-2.6.18.2/kernel/vserver/limit_init.h 1970-01-01 01:00:00 +0100 26363===================================================================
25940+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/limit_init.h 2006-09-25 15:40:02 +0200 26364--- /dev/null
26365+++ linux-2.6.18/kernel/vserver/limit_init.h
25941@@ -0,0 +1,33 @@ 26366@@ -0,0 +1,33 @@
25942+ 26367+
25943+ 26368+
25944+static inline void vx_info_init_limit(struct _vx_limit *limit) 26369+static inline void vx_info_init_limit(struct _vx_limit *limit)
25945+{ 26370+{
25970+ limit, vlimit_name[lim], lim, (long)value); 26395+ limit, vlimit_name[lim], lim, (long)value);
25971+ } 26396+ }
25972+#endif 26397+#endif
25973+} 26398+}
25974+ 26399+
25975diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/limit_proc.h linux-2.6.18.2-vs2.1.1/kernel/vserver/limit_proc.h 26400Index: linux-2.6.18/kernel/vserver/limit_proc.h
25976--- linux-2.6.18.2/kernel/vserver/limit_proc.h 1970-01-01 01:00:00 +0100 26401===================================================================
25977+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/limit_proc.h 2006-09-25 15:40:02 +0200 26402--- /dev/null
26403+++ linux-2.6.18/kernel/vserver/limit_proc.h
25978@@ -0,0 +1,71 @@ 26404@@ -0,0 +1,71 @@
25979+#ifndef _VX_LIMIT_PROC_H 26405+#ifndef _VX_LIMIT_PROC_H
25980+#define _VX_LIMIT_PROC_H 26406+#define _VX_LIMIT_PROC_H
25981+ 26407+
25982+ 26408+
26045+} 26471+}
26046+ 26472+
26047+#endif /* _VX_LIMIT_PROC_H */ 26473+#endif /* _VX_LIMIT_PROC_H */
26048+ 26474+
26049+ 26475+
26050diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/monitor.c linux-2.6.18.2-vs2.1.1/kernel/vserver/monitor.c 26476Index: linux-2.6.18/kernel/vserver/monitor.c
26051--- linux-2.6.18.2/kernel/vserver/monitor.c 1970-01-01 01:00:00 +0100 26477===================================================================
26052+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/monitor.c 2006-10-28 19:33:51 +0200 26478--- /dev/null
26479+++ linux-2.6.18/kernel/vserver/monitor.c
26053@@ -0,0 +1,142 @@ 26480@@ -0,0 +1,142 @@
26054+/* 26481+/*
26055+ * kernel/vserver/monitor.c 26482+ * kernel/vserver/monitor.c
26056+ * 26483+ *
26057+ * Virtual Context Scheduler Monitor 26484+ * Virtual Context Scheduler Monitor
26191+ return ret; 26618+ return ret;
26192+} 26619+}
26193+ 26620+
26194+#endif /* CONFIG_COMPAT */ 26621+#endif /* CONFIG_COMPAT */
26195+ 26622+
26196diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/namespace.c linux-2.6.18.2-vs2.1.1/kernel/vserver/namespace.c 26623Index: linux-2.6.18/kernel/vserver/namespace.c
26197--- linux-2.6.18.2/kernel/vserver/namespace.c 1970-01-01 01:00:00 +0100 26624===================================================================
26198+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/namespace.c 2006-09-25 15:40:02 +0200 26625--- /dev/null
26626+++ linux-2.6.18/kernel/vserver/namespace.c
26199@@ -0,0 +1,101 @@ 26627@@ -0,0 +1,101 @@
26200+/* 26628+/*
26201+ * linux/kernel/vserver/namespace.c 26629+ * linux/kernel/vserver/namespace.c
26202+ * 26630+ *
26203+ * Virtual Server: Context Namespace Support 26631+ * Virtual Server: Context Namespace Support
26296+ put_namespace(ns); 26724+ put_namespace(ns);
26297+ put_fs_struct(fs); 26725+ put_fs_struct(fs);
26298+ return ret; 26726+ return ret;
26299+} 26727+}
26300+ 26728+
26301diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/network.c linux-2.6.18.2-vs2.1.1/kernel/vserver/network.c 26729Index: linux-2.6.18/kernel/vserver/network.c
26302--- linux-2.6.18.2/kernel/vserver/network.c 1970-01-01 01:00:00 +0100 26730===================================================================
26303+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/network.c 2006-09-25 15:40:02 +0200 26731--- /dev/null
26732+++ linux-2.6.18/kernel/vserver/network.c
26304@@ -0,0 +1,752 @@ 26733@@ -0,0 +1,752 @@
26305+/* 26734+/*
26306+ * linux/kernel/vserver/network.c 26735+ * linux/kernel/vserver/network.c
26307+ * 26736+ *
26308+ * Virtual Server: Network Support 26737+ * Virtual Server: Network Support
27052+#include <linux/module.h> 27481+#include <linux/module.h>
27053+ 27482+
27054+EXPORT_SYMBOL_GPL(free_nx_info); 27483+EXPORT_SYMBOL_GPL(free_nx_info);
27055+EXPORT_SYMBOL_GPL(unhash_nx_info); 27484+EXPORT_SYMBOL_GPL(unhash_nx_info);
27056+ 27485+
27057diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/proc.c linux-2.6.18.2-vs2.1.1/kernel/vserver/proc.c 27486Index: linux-2.6.18/kernel/vserver/proc.c
27058--- linux-2.6.18.2/kernel/vserver/proc.c 1970-01-01 01:00:00 +0100 27487===================================================================
27059+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/proc.c 2006-10-28 19:36:07 +0200 27488--- /dev/null
27489+++ linux-2.6.18/kernel/vserver/proc.c
27060@@ -0,0 +1,892 @@ 27490@@ -0,0 +1,892 @@
27061+/* 27491+/*
27062+ * linux/kernel/vserver/proc.c 27492+ * linux/kernel/vserver/proc.c
27063+ * 27493+ *
27064+ * Virtual Context Support 27494+ * Virtual Context Support
27948+ put_nx_info(nxi); 28378+ put_nx_info(nxi);
27949+out: 28379+out:
27950+ return buffer - orig; 28380+ return buffer - orig;
27951+} 28381+}
27952+ 28382+
27953diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/sched.c linux-2.6.18.2-vs2.1.1/kernel/vserver/sched.c 28383Index: linux-2.6.18/kernel/vserver/sched.c
27954--- linux-2.6.18.2/kernel/vserver/sched.c 1970-01-01 01:00:00 +0100 28384===================================================================
27955+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/sched.c 2006-10-28 17:24:28 +0200 28385--- /dev/null
28386+++ linux-2.6.18/kernel/vserver/sched.c
27956@@ -0,0 +1,318 @@ 28387@@ -0,0 +1,318 @@
27957+/* 28388+/*
27958+ * linux/kernel/vserver/sched.c 28389+ * linux/kernel/vserver/sched.c
27959+ * 28390+ *
27960+ * Virtual Server: Scheduler Support 28391+ * Virtual Server: Scheduler Support
28270+ return -EFAULT; 28701+ return -EFAULT;
28271+ 28702+
28272+ return do_set_sched(vxi, &vc_data); 28703+ return do_set_sched(vxi, &vc_data);
28273+} 28704+}
28274+ 28705+
28275diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/sched_init.h linux-2.6.18.2-vs2.1.1/kernel/vserver/sched_init.h 28706Index: linux-2.6.18/kernel/vserver/sched_init.h
28276--- linux-2.6.18.2/kernel/vserver/sched_init.h 1970-01-01 01:00:00 +0100 28707===================================================================
28277+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/sched_init.h 2006-10-28 17:28:00 +0200 28708--- /dev/null
28709+++ linux-2.6.18/kernel/vserver/sched_init.h
28278@@ -0,0 +1,49 @@ 28710@@ -0,0 +1,49 @@
28279+ 28711+
28280+static inline void vx_info_init_sched(struct _vx_sched *sched) 28712+static inline void vx_info_init_sched(struct _vx_sched *sched)
28281+{ 28713+{
28282+ static struct lock_class_key tokens_lock_key; 28714+ static struct lock_class_key tokens_lock_key;
28323+static inline 28755+static inline
28324+void vx_info_exit_sched_pc(struct _vx_sched_pc *sched_pc, int cpu) 28756+void vx_info_exit_sched_pc(struct _vx_sched_pc *sched_pc, int cpu)
28325+{ 28757+{
28326+ return; 28758+ return;
28327+} 28759+}
28328diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/sched_proc.h linux-2.6.18.2-vs2.1.1/kernel/vserver/sched_proc.h 28760Index: linux-2.6.18/kernel/vserver/sched_proc.h
28329--- linux-2.6.18.2/kernel/vserver/sched_proc.h 1970-01-01 01:00:00 +0100 28761===================================================================
28330+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/sched_proc.h 2006-09-25 15:40:02 +0200 28762--- /dev/null
28763+++ linux-2.6.18/kernel/vserver/sched_proc.h
28331@@ -0,0 +1,59 @@ 28764@@ -0,0 +1,59 @@
28332+#ifndef _VX_SCHED_PROC_H 28765+#ifndef _VX_SCHED_PROC_H
28333+#define _VX_SCHED_PROC_H 28766+#define _VX_SCHED_PROC_H
28334+ 28767+
28335+ 28768+
28386+ ); 28819+ );
28387+ return length; 28820+ return length;
28388+} 28821+}
28389+ 28822+
28390+#endif /* _VX_SCHED_PROC_H */ 28823+#endif /* _VX_SCHED_PROC_H */
28391diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/signal.c linux-2.6.18.2-vs2.1.1/kernel/vserver/signal.c 28824Index: linux-2.6.18/kernel/vserver/signal.c
28392--- linux-2.6.18.2/kernel/vserver/signal.c 1970-01-01 01:00:00 +0100 28825===================================================================
28393+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/signal.c 2006-10-25 03:39:09 +0200 28826--- /dev/null
28827+++ linux-2.6.18/kernel/vserver/signal.c
28394@@ -0,0 +1,136 @@ 28828@@ -0,0 +1,136 @@
28395+/* 28829+/*
28396+ * linux/kernel/vserver/signal.c 28830+ * linux/kernel/vserver/signal.c
28397+ * 28831+ *
28398+ * Virtual Server: Signal Support 28832+ * Virtual Server: Signal Support
28526+ if (copy_to_user (data, &vc_data, sizeof(vc_data))) 28960+ if (copy_to_user (data, &vc_data, sizeof(vc_data)))
28527+ ret = -EFAULT; 28961+ ret = -EFAULT;
28528+ return ret; 28962+ return ret;
28529+} 28963+}
28530+ 28964+
28531diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/switch.c linux-2.6.18.2-vs2.1.1/kernel/vserver/switch.c 28965Index: linux-2.6.18/kernel/vserver/switch.c
28532--- linux-2.6.18.2/kernel/vserver/switch.c 1970-01-01 01:00:00 +0100 28966===================================================================
28533+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/switch.c 2006-10-29 02:04:29 +0100 28967--- /dev/null
28968+++ linux-2.6.18/kernel/vserver/switch.c
28534@@ -0,0 +1,497 @@ 28969@@ -0,0 +1,497 @@
28535+/* 28970+/*
28536+ * linux/kernel/vserver/switch.c 28971+ * linux/kernel/vserver/switch.c
28537+ * 28972+ *
28538+ * Virtual Server: Syscall Switch 28973+ * Virtual Server: Syscall Switch
29027+{ 29462+{
29028+ return do_vserver(cmd, id, data, 1); 29463+ return do_vserver(cmd, id, data, 1);
29029+} 29464+}
29030+ 29465+
29031+#endif /* CONFIG_COMPAT */ 29466+#endif /* CONFIG_COMPAT */
29032diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/sysctl.c linux-2.6.18.2-vs2.1.1/kernel/vserver/sysctl.c 29467Index: linux-2.6.18/kernel/vserver/sysctl.c
29033--- linux-2.6.18.2/kernel/vserver/sysctl.c 1970-01-01 01:00:00 +0100 29468===================================================================
29034+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/sysctl.c 2006-10-27 18:51:01 +0200 29469--- /dev/null
29470+++ linux-2.6.18/kernel/vserver/sysctl.c
29035@@ -0,0 +1,242 @@ 29471@@ -0,0 +1,242 @@
29036+/* 29472+/*
29037+ * kernel/vserver/sysctl.c 29473+ * kernel/vserver/sysctl.c
29038+ * 29474+ *
29039+ * Virtual Context Support 29475+ * Virtual Context Support
29273+EXPORT_SYMBOL_GPL(vx_debug_dlim); 29709+EXPORT_SYMBOL_GPL(vx_debug_dlim);
29274+EXPORT_SYMBOL_GPL(vx_debug_quota); 29710+EXPORT_SYMBOL_GPL(vx_debug_quota);
29275+EXPORT_SYMBOL_GPL(vx_debug_cvirt); 29711+EXPORT_SYMBOL_GPL(vx_debug_cvirt);
29276+EXPORT_SYMBOL_GPL(vx_debug_misc); 29712+EXPORT_SYMBOL_GPL(vx_debug_misc);
29277+ 29713+
29278diff -NurpP --minimal linux-2.6.18.2/kernel/vserver/vci_config.h linux-2.6.18.2-vs2.1.1/kernel/vserver/vci_config.h 29714Index: linux-2.6.18/kernel/vserver/vci_config.h
29279--- linux-2.6.18.2/kernel/vserver/vci_config.h 1970-01-01 01:00:00 +0100 29715===================================================================
29280+++ linux-2.6.18.2-vs2.1.1/kernel/vserver/vci_config.h 2006-10-15 04:30:02 +0200 29716--- /dev/null
29717+++ linux-2.6.18/kernel/vserver/vci_config.h
29281@@ -0,0 +1,80 @@ 29718@@ -0,0 +1,80 @@
29282+ 29719+
29283+enum { 29720+enum {
29284+ VCI_KCBIT_LEGACY = 1, 29721+ VCI_KCBIT_LEGACY = 1,
29285+ VCI_KCBIT_LEGACYNET, 29722+ VCI_KCBIT_LEGACYNET,
29357+ (7 << VCI_KCBIT_TAGGED) | 29794+ (7 << VCI_KCBIT_TAGGED) |
29358+#endif 29795+#endif
29359+ 0; 29796+ 0;
29360+} 29797+}
29361+ 29798+
29362diff -NurpP --minimal linux-2.6.18.2/mm/filemap.c linux-2.6.18.2-vs2.1.1/mm/filemap.c 29799Index: linux-2.6.18/mm/filemap.c
29363--- linux-2.6.18.2/mm/filemap.c 2006-09-20 16:58:44 +0200 29800===================================================================
29364+++ linux-2.6.18.2-vs2.1.1/mm/filemap.c 2006-10-25 03:39:09 +0200 29801--- linux-2.6.18.orig/mm/filemap.c
29802+++ linux-2.6.18/mm/filemap.c
29365@@ -1253,6 +1253,31 @@ int file_send_actor(read_descriptor_t * 29803@@ -1253,6 +1253,31 @@ int file_send_actor(read_descriptor_t *
29366 return written; 29804 return written;
29367 } 29805 }
29368 29806
29369+/* FIXME: It would be as simple as this, if we had a (void __user*) to write. 29807+/* FIXME: It would be as simple as this, if we had a (void __user*) to write.
29632+} 30070+}
29633+ 30071+
29634 ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, 30072 ssize_t generic_file_readv(struct file *filp, const struct iovec *iov,
29635 unsigned long nr_segs, loff_t *ppos) 30073 unsigned long nr_segs, loff_t *ppos)
29636 { 30074 {
29637diff -NurpP --minimal linux-2.6.18.2/mm/filemap_xip.c linux-2.6.18.2-vs2.1.1/mm/filemap_xip.c 30075Index: linux-2.6.18/mm/filemap_xip.c
29638--- linux-2.6.18.2/mm/filemap_xip.c 2006-09-20 16:58:44 +0200 30076===================================================================
29639+++ linux-2.6.18.2-vs2.1.1/mm/filemap_xip.c 2006-09-20 17:01:45 +0200 30077--- linux-2.6.18.orig/mm/filemap_xip.c
30078+++ linux-2.6.18/mm/filemap_xip.c
29640@@ -13,6 +13,7 @@ 30079@@ -13,6 +13,7 @@
29641 #include <linux/module.h> 30080 #include <linux/module.h>
29642 #include <linux/uio.h> 30081 #include <linux/uio.h>
29643 #include <linux/rmap.h> 30082 #include <linux/rmap.h>
29644+#include <linux/vs_memory.h> 30083+#include <linux/vs_memory.h>
29645 #include <asm/tlbflush.h> 30084 #include <asm/tlbflush.h>
29646 #include "filemap.h" 30085 #include "filemap.h"
29647 30086
29648diff -NurpP --minimal linux-2.6.18.2/mm/fremap.c linux-2.6.18.2-vs2.1.1/mm/fremap.c 30087Index: linux-2.6.18/mm/fremap.c
29649--- linux-2.6.18.2/mm/fremap.c 2006-09-20 16:58:44 +0200 30088===================================================================
29650+++ linux-2.6.18.2-vs2.1.1/mm/fremap.c 2006-09-20 17:01:45 +0200 30089--- linux-2.6.18.orig/mm/fremap.c
30090+++ linux-2.6.18/mm/fremap.c
29651@@ -15,6 +15,7 @@ 30091@@ -15,6 +15,7 @@
29652 #include <linux/rmap.h> 30092 #include <linux/rmap.h>
29653 #include <linux/module.h> 30093 #include <linux/module.h>
29654 #include <linux/syscalls.h> 30094 #include <linux/syscalls.h>
29655+#include <linux/vs_memory.h> 30095+#include <linux/vs_memory.h>
29663+ if (!vx_rsspages_avail(mm, 1)) 30103+ if (!vx_rsspages_avail(mm, 1))
29664+ goto unlock; 30104+ goto unlock;
29665 30105
29666 if (pte_none(*pte) || !zap_pte(mm, vma, addr, pte)) 30106 if (pte_none(*pte) || !zap_pte(mm, vma, addr, pte))
29667 inc_mm_counter(mm, file_rss); 30107 inc_mm_counter(mm, file_rss);
29668diff -NurpP --minimal linux-2.6.18.2/mm/hugetlb.c linux-2.6.18.2-vs2.1.1/mm/hugetlb.c 30108Index: linux-2.6.18/mm/hugetlb.c
29669--- linux-2.6.18.2/mm/hugetlb.c 2006-09-20 16:58:44 +0200 30109===================================================================
29670+++ linux-2.6.18.2-vs2.1.1/mm/hugetlb.c 2006-09-20 17:01:45 +0200 30110--- linux-2.6.18.orig/mm/hugetlb.c
30111+++ linux-2.6.18/mm/hugetlb.c
29671@@ -19,6 +19,7 @@ 30112@@ -19,6 +19,7 @@
29672 #include <asm/pgtable.h> 30113 #include <asm/pgtable.h>
29673 30114
29674 #include <linux/hugetlb.h> 30115 #include <linux/hugetlb.h>
29675+#include <linux/vs_memory.h> 30116+#include <linux/vs_memory.h>
29676 #include "internal.h" 30117 #include "internal.h"
29677 30118
29678 const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; 30119 const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL;
29679diff -NurpP --minimal linux-2.6.18.2/mm/memory.c linux-2.6.18.2-vs2.1.1/mm/memory.c 30120Index: linux-2.6.18/mm/memory.c
29680--- linux-2.6.18.2/mm/memory.c 2006-11-04 19:43:24 +0100 30121===================================================================
29681+++ linux-2.6.18.2-vs2.1.1/mm/memory.c 2006-11-04 19:12:54 +0100 30122--- linux-2.6.18.orig/mm/memory.c
30123+++ linux-2.6.18/mm/memory.c
29682@@ -1965,6 +1965,11 @@ static int do_swap_page(struct mm_struct 30124@@ -1966,6 +1966,11 @@ static int do_swap_page(struct mm_struct
29683 grab_swap_token(); 30125 grab_swap_token();
29684 } 30126 }
29685 30127
29686+ if (!vx_rsspages_avail(mm, 1)) { 30128+ if (!vx_rsspages_avail(mm, 1)) {
29687+ ret = VM_FAULT_OOM; 30129+ ret = VM_FAULT_OOM;
29689+ } 30131+ }
29690+ 30132+
29691 delayacct_clear_flag(DELAYACCT_PF_SWAPIN); 30133 delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
29692 mark_page_accessed(page); 30134 mark_page_accessed(page);
29693 lock_page(page); 30135 lock_page(page);
29694@@ -2037,6 +2042,8 @@ static int do_anonymous_page(struct mm_s 30136@@ -2038,6 +2043,8 @@ static int do_anonymous_page(struct mm_s
29695 /* Allocate our own private page. */ 30137 /* Allocate our own private page. */
29696 pte_unmap(page_table); 30138 pte_unmap(page_table);
29697 30139
29698+ if (!vx_rsspages_avail(mm, 1)) 30140+ if (!vx_rsspages_avail(mm, 1))
29699+ goto oom; 30141+ goto oom;
29700 if (unlikely(anon_vma_prepare(vma))) 30142 if (unlikely(anon_vma_prepare(vma)))
29701 goto oom; 30143 goto oom;
29702 page = alloc_zeroed_user_highpage(vma, address); 30144 page = alloc_zeroed_user_highpage(vma, address);
29703@@ -2115,6 +2122,9 @@ static int do_no_page(struct mm_struct * 30145@@ -2116,6 +2123,9 @@ static int do_no_page(struct mm_struct *
29704 smp_rmb(); /* serializes i_size against truncate_count */ 30146 smp_rmb(); /* serializes i_size against truncate_count */
29705 } 30147 }
29706 retry: 30148 retry:
29707+ /* FIXME: is that check useful here? */ 30149+ /* FIXME: is that check useful here? */
29708+ if (!vx_rsspages_avail(mm, 1)) 30150+ if (!vx_rsspages_avail(mm, 1))
29709+ return VM_FAULT_OOM; 30151+ return VM_FAULT_OOM;
29710 new_page = vma->vm_ops->nopage(vma, address & PAGE_MASK, &ret); 30152 new_page = vma->vm_ops->nopage(vma, address & PAGE_MASK, &ret);
29711 /* 30153 /*
29712 * No smp_rmb is needed here as long as there's a full 30154 * No smp_rmb is needed here as long as there's a full
29713@@ -2275,21 +2285,32 @@ static inline int handle_pte_fault(struc 30155@@ -2276,21 +2286,32 @@ static inline int handle_pte_fault(struc
29714 pte_t entry; 30156 pte_t entry;
29715 pte_t old_entry; 30157 pte_t old_entry;
29716 spinlock_t *ptl; 30158 spinlock_t *ptl;
29717+ int ret, type = VXPT_UNKNOWN; 30159+ int ret, type = VXPT_UNKNOWN;
29718 30160
29747+ type = VXPT_SWAP; 30189+ type = VXPT_SWAP;
29748+ goto out; 30190+ goto out;
29749 } 30191 }
29750 30192
29751 ptl = pte_lockptr(mm, pmd); 30193 ptl = pte_lockptr(mm, pmd);
29752@@ -2297,9 +2318,12 @@ static inline int handle_pte_fault(struc 30194@@ -2298,9 +2319,12 @@ static inline int handle_pte_fault(struc
29753 if (unlikely(!pte_same(*pte, entry))) 30195 if (unlikely(!pte_same(*pte, entry)))
29754 goto unlock; 30196 goto unlock;
29755 if (write_access) { 30197 if (write_access) {
29756- if (!pte_write(entry)) 30198- if (!pte_write(entry))
29757- return do_wp_page(mm, vma, address, 30199- return do_wp_page(mm, vma, address,
29762+ goto out; 30204+ goto out;
29763+ } 30205+ }
29764 entry = pte_mkdirty(entry); 30206 entry = pte_mkdirty(entry);
29765 } 30207 }
29766 entry = pte_mkyoung(entry); 30208 entry = pte_mkyoung(entry);
29767@@ -2319,7 +2343,10 @@ static inline int handle_pte_fault(struc 30209@@ -2320,7 +2344,10 @@ static inline int handle_pte_fault(struc
29768 } 30210 }
29769 unlock: 30211 unlock:
29770 pte_unmap_unlock(pte, ptl); 30212 pte_unmap_unlock(pte, ptl);
29771- return VM_FAULT_MINOR; 30213- return VM_FAULT_MINOR;
29772+ ret = VM_FAULT_MINOR; 30214+ ret = VM_FAULT_MINOR;
29774+ vx_page_fault(mm, vma, type, ret); 30216+ vx_page_fault(mm, vma, type, ret);
29775+ return ret; 30217+ return ret;
29776 } 30218 }
29777 30219
29778 /* 30220 /*
29779diff -NurpP --minimal linux-2.6.18.2/mm/mlock.c linux-2.6.18.2-vs2.1.1/mm/mlock.c 30221Index: linux-2.6.18/mm/mlock.c
29780--- linux-2.6.18.2/mm/mlock.c 2006-04-09 13:49:58 +0200 30222===================================================================
29781+++ linux-2.6.18.2-vs2.1.1/mm/mlock.c 2006-09-20 17:01:45 +0200 30223--- linux-2.6.18.orig/mm/mlock.c
30224+++ linux-2.6.18/mm/mlock.c
29782@@ -10,6 +10,7 @@ 30225@@ -10,6 +10,7 @@
29783 #include <linux/mm.h> 30226 #include <linux/mm.h>
29784 #include <linux/mempolicy.h> 30227 #include <linux/mempolicy.h>
29785 #include <linux/syscalls.h> 30228 #include <linux/syscalls.h>
29786+#include <linux/vs_memory.h> 30229+#include <linux/vs_memory.h>
29833+ if (!vx_vmlocked_avail(current->mm, current->mm->total_vm)) 30276+ if (!vx_vmlocked_avail(current->mm, current->mm->total_vm))
29834+ goto out; 30277+ goto out;
29835 if (!(flags & MCL_CURRENT) || (current->mm->total_vm <= lock_limit) || 30278 if (!(flags & MCL_CURRENT) || (current->mm->total_vm <= lock_limit) ||
29836 capable(CAP_IPC_LOCK)) 30279 capable(CAP_IPC_LOCK))
29837 ret = do_mlockall(flags); 30280 ret = do_mlockall(flags);
29838diff -NurpP --minimal linux-2.6.18.2/mm/mmap.c linux-2.6.18.2-vs2.1.1/mm/mmap.c 30281Index: linux-2.6.18/mm/mmap.c
29839--- linux-2.6.18.2/mm/mmap.c 2006-09-20 16:58:45 +0200 30282===================================================================
29840+++ linux-2.6.18.2-vs2.1.1/mm/mmap.c 2006-09-20 17:01:45 +0200 30283--- linux-2.6.18.orig/mm/mmap.c
30284+++ linux-2.6.18/mm/mmap.c
29841@@ -1137,10 +1137,10 @@ munmap_back: 30285@@ -1137,10 +1137,10 @@ munmap_back:
29842 kmem_cache_free(vm_area_cachep, vma); 30286 kmem_cache_free(vm_area_cachep, vma);
29843 } 30287 }
29844 out: 30288 out:
29845- mm->total_vm += len >> PAGE_SHIFT; 30289- mm->total_vm += len >> PAGE_SHIFT;
29926+ (security_vm_enough_memory(vma_pages(vma)) || 30370+ (security_vm_enough_memory(vma_pages(vma)) ||
29927+ !vx_vmpages_avail(mm, vma_pages(vma)))) 30371+ !vx_vmpages_avail(mm, vma_pages(vma))))
29928 return -ENOMEM; 30372 return -ENOMEM;
29929 vma_link(mm, vma, prev, rb_link, rb_parent); 30373 vma_link(mm, vma, prev, rb_link, rb_parent);
29930 return 0; 30374 return 0;
29931@@ -2085,5 +2094,7 @@ int may_expand_vm(struct mm_struct *mm, 30375@@ -2086,5 +2095,7 @@ int may_expand_vm(struct mm_struct *mm,
29932 30376
29933 if (cur + npages > lim) 30377 if (cur + npages > lim)
29934 return 0; 30378 return 0;
29935+ if (!vx_vmpages_avail(mm, npages)) 30379+ if (!vx_vmpages_avail(mm, npages))
29936+ return 0; 30380+ return 0;
29937 return 1; 30381 return 1;
29938 } 30382 }
29939diff -NurpP --minimal linux-2.6.18.2/mm/mremap.c linux-2.6.18.2-vs2.1.1/mm/mremap.c 30383Index: linux-2.6.18/mm/mremap.c
29940--- linux-2.6.18.2/mm/mremap.c 2006-09-20 16:58:45 +0200 30384===================================================================
29941+++ linux-2.6.18.2-vs2.1.1/mm/mremap.c 2006-09-20 17:01:45 +0200 30385--- linux-2.6.18.orig/mm/mremap.c
30386+++ linux-2.6.18/mm/mremap.c
29942@@ -18,6 +18,7 @@ 30387@@ -18,6 +18,7 @@
29943 #include <linux/highmem.h> 30388 #include <linux/highmem.h>
29944 #include <linux/security.h> 30389 #include <linux/security.h>
29945 #include <linux/syscalls.h> 30390 #include <linux/syscalls.h>
29946+#include <linux/vs_memory.h> 30391+#include <linux/vs_memory.h>
29986- mm->locked_vm += pages; 30431- mm->locked_vm += pages;
29987+ vx_vmlocked_add(mm, pages); 30432+ vx_vmlocked_add(mm, pages);
29988 make_pages_present(addr + old_len, 30433 make_pages_present(addr + old_len,
29989 addr + new_len); 30434 addr + new_len);
29990 } 30435 }
29991diff -NurpP --minimal linux-2.6.18.2/mm/nommu.c linux-2.6.18.2-vs2.1.1/mm/