diff -urN 2.3.42/CREDITS 2.3.42aa3/CREDITS
--- 2.3.42/CREDITS	Thu Feb  3 06:05:57 2000
+++ 2.3.42aa3/CREDITS	Wed Feb  9 03:48:26 2000
@@ -1446,6 +1446,13 @@
 D: XF86_8514
 D: cfdisk (curses based disk partitioning program)
 
+N: Heinz Mauelshagen
+E: mge@EZ-Darmstadt.Telekom.de
+D: Logical Volume Manager
+S: Bartningstr. 12
+S: 64289 Darmstadt
+S: Germany
+
 N: Mike McLagan
 E: mike.mclagan@linux.org
 W: http://www.invlogic.com/~mmclagan
diff -urN 2.3.42/Documentation/Configure.help 2.3.42aa3/Documentation/Configure.help
--- 2.3.42/Documentation/Configure.help	Thu Feb  3 06:05:57 2000
+++ 2.3.42aa3/Documentation/Configure.help	Wed Feb  9 03:48:26 2000
@@ -1253,6 +1253,30 @@
   called on26.o. You must also have a high-level driver for the type
   of device that you want to support.
 
+Logical Volume Manager (LVM) support
+CONFIG_BLK_DEV_LVM
+  This driver lets you combine several hard disks, hard disk partitions,
+  multiple devices or even loop devices (for evaluation purposes) into
+  a volume group. Imagine a volume group as a kind of virtual disk.
+  Logical volumes, which can be thought of as virtual partitions,
+  can be created in the volume group.  You can resize volume groups and
+  logical volumes after creation time, corresponding to new capacity needs.
+  Logical volumes are accessed as block devices named
+  /dev/VolumeGroupName/LogicalVolumeName.
+
+  For details see /usr/src/linux/Documentaion/LVM-HOWTO.
+
+  To get the newest software see <http://linux.msede.com/lvm>.
+
+Logical Volume Manager proc filesystem information
+CONFIG_LVM_PROC_FS
+  If you say Y here, you are able to access overall Logical Volume Manager,
+  Volume Group, Logical and Physical Volume information in /proc/lvm.
+  
+  To use this option, you have to check, that the "proc filesystem support"
+  (CONFIG_PROC_FS) is enabled too.
+
+
 Multiple devices driver support
 CONFIG_BLK_DEV_MD
   This driver lets you combine several hard disk partitions into one
diff -urN 2.3.42/Documentation/LVM-HOWTO 2.3.42aa3/Documentation/LVM-HOWTO
--- 2.3.42/Documentation/LVM-HOWTO	Thu Jan  1 01:00:00 1970
+++ 2.3.42aa3/Documentation/LVM-HOWTO	Wed Feb  9 03:48:26 2000
@@ -0,0 +1,118 @@
+Heinz Mauelshagen's LVM (Logical Volume Manager) howto.             01/28/1999
+
+
+Abstract:
+---------
+The LVM adds a kind of virtual disks and virtual partitions functionality
+to the Linux operating system
+
+It achieves this by adding an additional layer between the physical peripherals
+and the i/o interface in the kernel.
+
+This allows the concatenation of several disk partitions or total disks
+(so-called physical volumes or PVs) or even multiple devices
+to form a storage pool (so-called Volume Group or VG) with
+allocation units called physical extents (called PE).
+You can think of the volume group as a virtual disk.
+Please see scenario below.
+
+Some or all PEs of this VG then can be allocated to so-called Logical Volumes
+or LVs in units called logical extents or LEs.
+Each LE is mapped to a corresponding PE.
+LEs and PEs are equal in size.
+Logical volumes are a kind of virtual partitions.
+
+
+The LVs can be used through device special files similar to the known
+/dev/sd[a-z]* or /dev/hd[a-z]* named /dev/VolumeGroupName/LogicalVolumeName.
+
+But going beyond this, you are able to extend or reduce
+VGs _AND_ LVs at runtime!
+
+So...
+If for example the capacity of a LV gets too small and your VG containing
+this LV is full, you could add another PV to that VG and simply extend
+the LV afterwards.
+If you reduce or delete a LV you can use the freed capacity for different
+LVs in the same VG.
+
+
+The above scenario looks like this:
+
+     /------------------------------------------\
+     |  /--PV2---\      VG 1      /--PVn---\    |
+     |  |-VGDA---|                |-VGDA-- |    |
+     |  |PE1PE2..|                |PE1PE2..|    |
+     |  |        |     ......     |        |    |
+     |  |        |                |        |    |
+     |  |    /-----------------------\     |    |
+     |  |    \-------LV 1------------/     |    |
+     |  |   ..PEn|                |   ..PEn|    |
+     |  \--------/                \--------/    |
+     \------------------------------------------/
+
+PV 1 could be /dev/sdc1 sized 3GB
+PV n could be /dev/sde1 sized 4GB
+VG 1 could be test_vg
+LV 1 could be /dev/test_vg/test_lv
+VGDA is the volume group descriptor area holding the LVM metadata
+PE1 up to PEn is the number of physical extents on each disk(partition)
+
+
+
+Installation steps see INSTALL and insmod(1)/modprobe(1), kmod/kerneld(8)
+to load the logical volume manager module if you did not bind it
+into the kernel.
+
+
+Configuration steps for getting the above scenario:
+
+1. Set the partition system id to 0xFE on /dev/sdc1 and /dev/sde1.
+
+2. do a "pvcreate /dev/sd[ce]1"
+   For testing purposes you can use more than one partition on a disk.
+   You should not use more than one partition because in the case of
+   a striped LV you'll have a performance breakdown.
+
+3. do a "vgcreate test_vg /dev/sd[ce]1" to create the new VG named "test_vg"
+   which has the total capacity of both partitions.
+   vgcreate activates (transfers the metadata into the LVM driver in the kernel)
+   the new volume group too to be able to create LVs in the next step.
+
+4. do a "lvcreate -L1500 -ntest_lv test_vg" to get a 1500MB linear LV named
+   "test_lv" and it's block device special "/dev/test_vg/test_lv".
+
+   Or do a "lvcreate -i2 -I4 -l1500 -nanother_test_lv test_vg" to get a 100 LE
+   large logical volume with 2 stripes and stripesize 4 KB.
+
+5. For example generate a filesystem in one LV with
+   "mke2fs /dev/test_vg/test_lv" and mount it.
+
+6. extend /dev/test_vg/test_lv to 1600MB with relative size by
+   "lvextend -L+100 /dev/test_vg/test_lv"
+   or with absolute size by
+   "lvextend -L1600 /dev/test_vg/test_lv"
+ 
+7. reduce /dev/test_vg/test_lv to 900 logical extents with relative extents by
+   "lvreduce -l-700 /dev/test_vg/test_lv"
+   or with absolute extents by
+   "lvreduce -l900 /dev/test_vg/test_lv"
+ 
+9. rename a VG by deactivating it with
+   "vgchange -an test_vg"   # only VGs with _no_ open LVs can be deactivated!
+   "vgrename test_vg whatever"
+   and reactivate it again by
+   "vgchange -ay whatever"
+
+9. rename a LV after closing it by
+   "lvchange -an /dev/whatever/test_lv" # only closed LVs can be deactivated
+   "lvrename  /dev/whatever/test_lv  /dev/whatever/whatvolume"
+   or by
+   "lvrename  whatever test_lv whatvolume"
+   and reactivate it again by
+   "lvchange -ay /dev/whatever/whatvolume"
+
+10. if you own Ted Tso's resize2fs program, you are able to resize the
+    ext2 type filesystems contained in logical volumes without destroyiing
+    the data by
+    "e2fsadm -L+100 /dev/test_vg/another_test_lv"
diff -urN 2.3.42/MAINTAINERS 2.3.42aa3/MAINTAINERS
--- 2.3.42/MAINTAINERS	Thu Feb  3 06:05:57 2000
+++ 2.3.42aa3/MAINTAINERS	Wed Feb  9 03:48:26 2000
@@ -578,6 +578,13 @@
 W:	http://people.redhat.com/zab/maestro/
 S:	Supported
 
+LOGICAL VOLUME MANAGER
+P:	Heinz Mauelshagen
+M:	linux-LVM@EZ-Darmstadt.Telekom.de
+L:	linux-LVM@msede.com
+W:	http://linux.msede.com/lvm
+S:	Maintained
+
 M68K
 P:	Jes Sorensen
 M:	Jes.Sorensen@cern.ch
diff -urN 2.3.42/Makefile 2.3.42aa3/Makefile
--- 2.3.42/Makefile	Thu Feb  3 06:05:57 2000
+++ 2.3.42aa3/Makefile	Wed Feb  9 03:48:28 2000
@@ -330,13 +330,15 @@
 	   echo \#define LINUX_COMPILE_DOMAIN ; \
 	 fi >> .ver
 	@echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -1`\" >> .ver
-	@mv -f .ver $@
+	@cp .ver $@
+	@rm .ver
 
 include/linux/version.h: ./Makefile
 	@echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
 	@echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
 	@echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver
-	@mv -f .ver $@
+	@cp .ver $@
+	@rm .ver
 
 init/version.o: init/version.c include/linux/compile.h include/config/MARKER
 	$(CC) $(CFLAGS) -DUTS_MACHINE='"$(ARCH)"' -c -o init/version.o init/version.c
diff -urN 2.3.42/arch/alpha/kernel/Makefile 2.3.42aa3/arch/alpha/kernel/Makefile
--- 2.3.42/arch/alpha/kernel/Makefile	Wed Dec  8 00:05:25 1999
+++ 2.3.42aa3/arch/alpha/kernel/Makefile	Wed Feb  9 03:48:26 2000
@@ -14,7 +14,7 @@
 
 O_TARGET := kernel.o
 O_OBJS   := entry.o traps.o process.o osf_sys.o irq.o signal.o setup.o \
-	    ptrace.o time.o semaphore.o
+	    ptrace.o time.o semaphore.o i8259.o rtc_irq.o
 OX_OBJS  := alpha_ksyms.o
 
 
diff -urN 2.3.42/arch/alpha/kernel/alpha_ksyms.c 2.3.42aa3/arch/alpha/kernel/alpha_ksyms.c
--- 2.3.42/arch/alpha/kernel/alpha_ksyms.c	Fri Dec 17 18:17:06 1999
+++ 2.3.42aa3/arch/alpha/kernel/alpha_ksyms.c	Wed Feb  9 03:48:26 2000
@@ -36,6 +36,7 @@
 extern struct hwrpb_struct *hwrpb;
 extern void dump_thread(struct pt_regs *, struct user *);
 extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
+extern spinlock_t kernel_flag;
 
 /* these are C runtime functions with special calling conventions: */
 extern void __divl (void);
@@ -155,13 +156,17 @@
  */
 
 #ifdef __SMP__
+EXPORT_SYMBOL(kernel_flag);
 EXPORT_SYMBOL(synchronize_irq);
 EXPORT_SYMBOL(flush_tlb_all);
 EXPORT_SYMBOL(flush_tlb_mm);
 EXPORT_SYMBOL(flush_tlb_page);
 EXPORT_SYMBOL(flush_tlb_range);
+EXPORT_SYMBOL(smp_imb);
 EXPORT_SYMBOL(cpu_data);
-EXPORT_SYMBOL(cpu_number_map);
+EXPORT_SYMBOL(smp_num_cpus);
+EXPORT_SYMBOL(__cpu_number_map);
+EXPORT_SYMBOL(__cpu_logical_map);
 EXPORT_SYMBOL(global_bh_lock);
 EXPORT_SYMBOL(global_bh_count);
 EXPORT_SYMBOL(synchronize_bh);
diff -urN 2.3.42/arch/alpha/kernel/i8259.c 2.3.42aa3/arch/alpha/kernel/i8259.c
--- 2.3.42/arch/alpha/kernel/i8259.c	Thu Jan  1 01:00:00 1970
+++ 2.3.42aa3/arch/alpha/kernel/i8259.c	Wed Feb  9 03:48:26 2000
@@ -0,0 +1,123 @@
+/* started hacking from linux-2.3.30pre6/arch/i386/kernel/i8259.c */
+
+#include <linux/init.h>
+#include <linux/cache.h>
+#include <linux/sched.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+
+#include <asm/io.h>
+#include <asm/delay.h>
+
+/*
+ * This is the 'legacy' 8259A Programmable Interrupt Controller,
+ * present in the majority of PC/AT boxes.
+ */
+
+static void enable_8259A_irq(unsigned int irq);
+static void disable_8259A_irq(unsigned int irq);
+
+/* shutdown is same as "disable" */
+#define end_8259A_irq		enable_8259A_irq
+#define shutdown_8259A_irq	disable_8259A_irq
+
+static void mask_and_ack_8259A(unsigned int);
+
+static unsigned int startup_8259A_irq(unsigned int irq)
+{
+	enable_8259A_irq(irq);
+	return 0; /* never anything pending */
+}
+
+static struct hw_interrupt_type i8259A_irq_type = {
+	"XT-PIC",
+	startup_8259A_irq,
+	shutdown_8259A_irq,
+	enable_8259A_irq,
+	disable_8259A_irq,
+	mask_and_ack_8259A,
+	end_8259A_irq
+};
+
+/*
+ * 8259A PIC functions to handle ISA devices:
+ */
+
+/*
+ * This contains the irq mask for both 8259A irq controllers,
+ */
+static unsigned int cached_irq_mask = 0xffff;
+
+#define __byte(x,y) 	(((unsigned char *)&(y))[x])
+#define cached_21	(__byte(0,cached_irq_mask))
+#define cached_A1	(__byte(1,cached_irq_mask))
+
+/*
+ * These have to be protected by the irq controller spinlock
+ * before being called.
+ */
+static void disable_8259A_irq(unsigned int irq)
+{
+	unsigned int mask = 1 << irq;
+	cached_irq_mask |= mask;
+	if (irq & 8)
+		outb(cached_A1,0xA1);
+	else
+		outb(cached_21,0x21);
+}
+
+static void enable_8259A_irq(unsigned int irq)
+{
+	unsigned int mask = ~(1 << irq);
+	cached_irq_mask &= mask;
+	if (irq & 8)
+		outb(cached_A1,0xA1);
+	else
+		outb(cached_21,0x21);
+}
+
+static void mask_and_ack_8259A(unsigned int irq)
+{
+	disable_8259A_irq(irq);
+
+	/* Ack the interrupt making it the lowest priority */
+	/*  First the slave .. */
+	if (irq > 7) {
+		outb(0xE0 | (irq - 8), 0xa0);
+		irq = 2;
+	}
+	/* .. then the master */
+	outb(0xE0 | irq, 0x20);
+}
+
+static void init_8259A(void)
+{
+	outb(0xff, 0x21);	/* mask all of 8259A-1 */
+	outb(0xff, 0xA1);	/* mask all of 8259A-2 */
+}
+
+/*
+ * IRQ2 is cascade interrupt to second interrupt controller
+ */
+static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
+
+void __init
+init_ISA_irqs (void)
+{
+	int i;
+
+	for (i = 0; i < NR_IRQS; i++) {
+		if (i == RTC_IRQ)
+			continue;
+		if (i >= 16)
+			break;
+		irq_desc[i].status = IRQ_DISABLED;
+		/*
+		 * 16 old-style INTA-cycle interrupts:
+		 */
+		irq_desc[i].handler = &i8259A_irq_type;
+	}
+
+	init_8259A();
+	setup_irq(2, &irq2);
+}
diff -urN 2.3.42/arch/alpha/kernel/irq.c 2.3.42aa3/arch/alpha/kernel/irq.c
--- 2.3.42/arch/alpha/kernel/irq.c	Thu Dec  9 02:27:27 1999
+++ 2.3.42aa3/arch/alpha/kernel/irq.c	Wed Feb  9 03:48:26 2000
@@ -39,6 +39,7 @@
 #ifndef __SMP__
 int __local_irq_count;
 int __local_bh_count;
+unsigned long __irq_attempt[NR_IRQS];
 #endif
 
 #if NR_IRQS > 128
@@ -57,12 +58,6 @@
 
 
 /*
- * Shadow-copy of masked interrupts.
- */
-
-unsigned long _alpha_irq_masks[2] = { ~0UL, ~0UL };
-
-/*
  * The ack_irq routine used by 80% of the systems.
  */
 
@@ -135,7 +130,7 @@
 			return;
 		}
 	}
-	handle_irq(j, j, regs);
+	handle_irq(j, regs);
 #else
 	unsigned long pic;
 
@@ -169,77 +164,201 @@
 void 
 srm_device_interrupt(unsigned long vector, struct pt_regs * regs)
 {
-	int irq, ack;
+	int irq;
 
-	ack = irq = (vector - 0x800) >> 4;
-	handle_irq(irq, ack, regs);
+	irq = (vector - 0x800) >> 4;
+	handle_irq(irq, regs);
 }
 
 
 /*
+ * Special irq handlers.
+ */
+
+void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
+
+/*
  * Initial irq handlers.
  */
 
-static struct irqaction timer_irq = { NULL, 0, 0, NULL, NULL, NULL};
-spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED;
-irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { [0 ... NR_IRQS-1] = {0,} };
+static void enable_none(unsigned int irq) { }
+static unsigned int startup_none(unsigned int irq) { return 0; }
+static void disable_none(unsigned int irq) { }
+static void ack_none(unsigned int irq)
+{
+	printk("unexpected IRQ trap at vector %02x\n", irq);
+}
+
+/* startup is the same as "enable", shutdown is same as "disable" */
+#define shutdown_none	disable_none
+#define end_none	enable_none
+
+struct hw_interrupt_type no_irq_type = {
+	"none",
+	startup_none,
+	shutdown_none,
+	enable_none,
+	disable_none,
+	ack_none,
+	end_none
+};
 
+spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED;
+irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned =
+				{ [0 ... NR_IRQS-1] = { 0, &no_irq_type, }};
 
-static inline void
-mask_irq(unsigned long irq)
+int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action)
 {
-	set_bit(irq, _alpha_irq_masks);
-	alpha_mv.update_irq_hw(irq, alpha_irq_mask, 0);
-}
+	int status;
+	int cpu = smp_processor_id();
 
-static inline void
-unmask_irq(unsigned long irq)
-{
-	clear_bit(irq, _alpha_irq_masks);
-	alpha_mv.update_irq_hw(irq, alpha_irq_mask, 1);
+	kstat.irqs[cpu][irq]++;
+	irq_enter(cpu, irq);
+
+	status = 1;	/* Force the "do bottom halves" bit */
+
+	do {
+		if (!(action->flags & SA_INTERRUPT))
+			__sti();
+		else
+			__cli();
+
+		status |= action->flags;
+		action->handler(irq, action->dev_id, regs);
+		action = action->next;
+	} while (action);
+	if (status & SA_SAMPLE_RANDOM)
+		add_interrupt_randomness(irq);
+	__cli();
+
+	irq_exit(cpu, irq);
+
+	return status;
 }
 
+/*
+ * Generic enable/disable code: this just calls
+ * down into the PIC-specific version for the actual
+ * hardware disable after having gotten the irq
+ * controller lock. 
+ */
 void
-disable_irq_nosync(unsigned int irq_nr)
+disable_irq_nosync(unsigned int irq)
 {
 	unsigned long flags;
 
-	save_and_cli(flags);
-	mask_irq(irq_nr);
-	restore_flags(flags);
+	spin_lock_irqsave(&irq_controller_lock, flags);
+	if (!irq_desc[irq].depth++) {
+		irq_desc[irq].status |= IRQ_DISABLED;
+		irq_desc[irq].handler->disable(irq);
+	}
+	spin_unlock_irqrestore(&irq_controller_lock, flags);
 }
 
+/*
+ * Synchronous version of the above, making sure the IRQ is
+ * no longer running on any other IRQ..
+ */
 void
-disable_irq(unsigned int irq_nr)
+disable_irq(unsigned int irq)
 {
-	/* This works non-SMP, and SMP until we write code to distribute
-	   interrupts to more that cpu 0.  */
-	disable_irq_nosync(irq_nr);
+	disable_irq_nosync(irq);
+
+	if (!local_irq_count(smp_processor_id())) {
+		do {
+			barrier();
+		} while (irq_desc[irq].status & IRQ_INPROGRESS);
+	}
 }
 
 void
-enable_irq(unsigned int irq_nr)
+enable_irq(unsigned int irq)
 {
 	unsigned long flags;
 
-	save_and_cli(flags);
-	unmask_irq(irq_nr);
-	restore_flags(flags);
+	spin_lock_irqsave(&irq_controller_lock, flags);
+	switch (irq_desc[irq].depth) {
+	case 1: {
+		unsigned int status = irq_desc[irq].status & ~IRQ_DISABLED;
+		irq_desc[irq].status = status;
+		if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
+			irq_desc[irq].status = status | IRQ_REPLAY;
+			hw_resend_irq(irq_desc[irq].handler,irq); /* noop */
+		}
+		irq_desc[irq].handler->enable(irq);
+		/* fall-through */
+	}
+	default:
+		irq_desc[irq].depth--;
+		break;
+	case 0:
+		printk("enable_irq() unbalanced from %p\n",
+		       __builtin_return_address(0));
+	}
+	spin_unlock_irqrestore(&irq_controller_lock, flags);
 }
 
 int
-check_irq(unsigned int irq)
+setup_irq(unsigned int irq, struct irqaction * new)
 {
-	return irq_desc[irq].action ? -EBUSY : 0;
+	int shared = 0;
+	struct irqaction *old, **p;
+	unsigned long flags;
+
+	/*
+	 * Some drivers like serial.c use request_irq() heavily,
+	 * so we have to be careful not to interfere with a
+	 * running system.
+	 */
+	if (new->flags & SA_SAMPLE_RANDOM) {
+		/*
+		 * This function might sleep, we want to call it first,
+		 * outside of the atomic block.
+		 * Yes, this might clear the entropy pool if the wrong
+		 * driver is attempted to be loaded, without actually
+		 * installing a new handler, but is this really a problem,
+		 * only the sysadmin is able to do this.
+		 */
+		rand_initialize_irq(irq);
+	}
+
+	/*
+	 * The following block of code has to be executed atomically
+	 */
+	spin_lock_irqsave(&irq_controller_lock,flags);
+	p = &irq_desc[irq].action;
+	if ((old = *p) != NULL) {
+		/* Can't share interrupts unless both agree to */
+		if (!(old->flags & new->flags & SA_SHIRQ)) {
+			spin_unlock_irqrestore(&irq_controller_lock,flags);
+			return -EBUSY;
+		}
+
+		/* add new interrupt at end of irq queue */
+		do {
+			p = &old->next;
+			old = *p;
+		} while (old);
+		shared = 1;
+	}
+
+	*p = new;
+
+	if (!shared) {
+		irq_desc[irq].depth = 0;
+		irq_desc[irq].status &= ~IRQ_DISABLED;
+		irq_desc[irq].handler->startup(irq);
+	}
+	spin_unlock_irqrestore(&irq_controller_lock,flags);
+	return 0;
 }
 
 int
 request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
 	    unsigned long irqflags, const char * devname, void *dev_id)
 {
-	int shared = 0;
-	struct irqaction * action, **p;
-	unsigned long flags;
+	int retval;
+	struct irqaction * action;
 
 	if (irq >= ACTUAL_NR_IRQS)
 		return -EINVAL;
@@ -248,36 +367,25 @@
 	if (!handler)
 		return -EINVAL;
 
-	p = &irq_desc[irq].action;
-	action = *p;
-	if (action) {
-		/* Can't share interrupts unless both agree to */
-		if (!(action->flags & irqflags & SA_SHIRQ))
-			return -EBUSY;
-
-		/* Can't share interrupts unless both are same type */
-		if ((action->flags ^ irqflags) & SA_INTERRUPT)
-			return -EBUSY;
-
-		/* Add new interrupt at end of irq queue */
-		do {
-			p = &action->next;
-			action = *p;
-		} while (action);
-		shared = 1;
+#if 1
+	/*
+	 * Sanity-check: shared interrupts should REALLY pass in
+	 * a real dev-ID, otherwise we'll have trouble later trying
+	 * to figure out which interrupt is which (messes up the
+	 * interrupt freeing logic etc).
+	 */
+	if (irqflags & SA_SHIRQ) {
+		if (!dev_id)
+			printk("Bad boy: %s (at %p) called us without a dev_id!\n",
+			       devname, __builtin_return_address(0));
 	}
+#endif
 
-	action = &timer_irq;
-	if (irq != TIMER_IRQ) {
-		action = (struct irqaction *)
+	action = (struct irqaction *)
 			kmalloc(sizeof(struct irqaction), GFP_KERNEL);
-	}
 	if (!action)
 		return -ENOMEM;
 
-	if (irqflags & SA_SAMPLE_RANDOM)
-		rand_initialize_irq(irq);
-
 	action->handler = handler;
 	action->flags = irqflags;
 	action->mask = 0;
@@ -285,20 +393,16 @@
 	action->next = NULL;
 	action->dev_id = dev_id;
 
-	save_and_cli(flags);
-	*p = action;
-
-	if (!shared)
-		unmask_irq(irq);
-
-	restore_flags(flags);
-	return 0;
+	retval = setup_irq(irq, action);
+	if (retval)
+		kfree(action);
+	return retval;
 }
-		
+
 void
 free_irq(unsigned int irq, void *dev_id)
 {
-	struct irqaction * action, **p;
+	struct irqaction **p;
 	unsigned long flags;
 
 	if (irq >= ACTUAL_NR_IRQS) {
@@ -309,25 +413,39 @@
 		printk("Trying to free reserved IRQ %d\n", irq);
 		return;
 	}
-	for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next) {
-		if (action->dev_id != dev_id)
-			continue;
+	spin_lock_irqsave(&irq_controller_lock,flags);
+	p = &irq_desc[irq].action;
+	for (;;) {
+		struct irqaction * action = *p;
+		if (action) {
+			struct irqaction **pp = p;
+			p = &action->next;
+			if (action->dev_id != dev_id)
+				continue;
 
-		/* Found it - now free it */
-		save_and_cli(flags);
-		*p = action->next;
-		if (!irq_desc[irq].action)
-			mask_irq(irq);
-		restore_flags(flags);
-		kfree(action);
+			/* Found it - now remove it from the list of entries */
+			*pp = action->next;
+			if (!irq_desc[irq].action) {
+				irq_desc[irq].status |= IRQ_DISABLED;
+				irq_desc[irq].handler->shutdown(irq);
+			}
+			spin_unlock_irqrestore(&irq_controller_lock,flags);
+
+			/* Wait to make sure it's not being used on another CPU */
+			while (irq_desc[irq].status & IRQ_INPROGRESS)
+				barrier();
+			kfree(action);
+			return;
+		}
+		printk("Trying to free free IRQ%d\n",irq);
+		spin_unlock_irqrestore(&irq_controller_lock,flags);
 		return;
 	}
-	printk("Trying to free free IRQ%d\n",irq);
 }
 
 int get_irq_list(char *buf)
 {
-	int i;
+	int i, j;
 	struct irqaction * action;
 	char *p = buf;
 
@@ -335,6 +453,8 @@
 	p += sprintf(p, "           ");
 	for (i = 0; i < smp_num_cpus; i++)
 		p += sprintf(p, "CPU%d       ", i);
+	for (i = 0; i < smp_num_cpus; i++)
+		p += sprintf(p, "TRY%d       ", i);
 	*p++ = '\n';
 #endif
 
@@ -346,13 +466,14 @@
 #ifndef __SMP__
 		p += sprintf(p, "%10u ", kstat_irqs(i));
 #else
-		{
-		  int j;
-		  for (j = 0; j < smp_num_cpus; j++)
-			  p += sprintf(p, "%10u ",
-				       kstat.irqs[cpu_logical_map(j)][i]);
-		}
+		for (j = 0; j < smp_num_cpus; j++)
+			p += sprintf(p, "%10u ",
+				     kstat.irqs[cpu_logical_map(j)][i]);
+		for (j = 0; j < smp_num_cpus; j++)
+			p += sprintf(p, "%10lu ",
+				     irq_attempt(cpu_logical_map(j), i));
 #endif
+		p += sprintf(p, " %14s", irq_desc[i].handler->typename);
 		p += sprintf(p, "  %c%s",
 			     (action->flags & SA_INTERRUPT)?'+':' ',
 			     action->name);
@@ -364,6 +485,13 @@
 		}
 		*p++ = '\n';
 	}
+#if CONFIG_SMP
+	p += sprintf(p, "LOC: ");
+	for (j = 0; j < smp_num_cpus; j++)
+		p += sprintf(p, "%10lu ",
+			     cpu_data[cpu_logical_map(j)].smp_local_irq_count);
+	p += sprintf(p, "\n");
+#endif
 	return p - buf;
 }
 
@@ -638,139 +766,157 @@
 }
 #endif /* __SMP__ */
 
-static void
-unexpected_irq(int irq, struct pt_regs * regs)
-{
-#if 0
-#if 1
-	printk("device_interrupt: unexpected interrupt %d\n", irq);
-#else
-	struct irqaction *action;
-	int i;
-
-	printk("IO device interrupt, irq = %d\n", irq);
-	printk("PC = %016lx PS=%04lx\n", regs->pc, regs->ps);
-	printk("Expecting: ");
-	for (i = 0; i < ACTUAL_NR_IRQS; i++)
-		if ((action = irq_desc[i].action))
-			while (action->handler) {
-				printk("[%s:%d] ", action->name, i);
-				action = action->next;
-			}
-	printk("\n");
-#endif
-#endif
-
-#if defined(CONFIG_ALPHA_JENSEN)
-	/* ??? Is all this just debugging, or are the inb's and outb's
-	   necessary to make things work?  */
-	printk("64=%02x, 60=%02x, 3fa=%02x 2fa=%02x\n",
-	       inb(0x64), inb(0x60), inb(0x3fa), inb(0x2fa));
-	outb(0x0c, 0x3fc);
-	outb(0x0c, 0x2fc);
-	outb(0,0x61);
-	outb(0,0x461);
-#endif
-}
-
+/*
+ * do_IRQ handles all normal device IRQ's (the special
+ * SMP cross-CPU interrupts have their own specific
+ * handlers).
+ */
 void
-handle_irq(int irq, int ack, struct pt_regs * regs)
-{
-	struct irqaction * action;
+handle_irq(int irq, struct pt_regs * regs)
+{	
+	/* 
+	 * We ack quickly, we don't want the irq controller
+	 * thinking we're snobs just because some other CPU has
+	 * disabled global interrupts (we have already done the
+	 * INT_ACK cycles, it's too late to try to pretend to the
+	 * controller that we aren't taking the interrupt).
+	 *
+	 * 0 return value means that this irq is already being
+	 * handled by some other CPU. (or is disabled)
+	 */
 	int cpu = smp_processor_id();
+	irq_desc_t *desc;
+	struct irqaction * action;
+	unsigned int status;
 
 	if ((unsigned) irq > ACTUAL_NR_IRQS) {
 		printk("device_interrupt: illegal interrupt %d\n", irq);
 		return;
 	}
 
-#if 0
-	/* A useful bit of code to find out if an interrupt is going wild.  */
-	{
-	  static unsigned int last_msg, last_cc;
-	  static int last_irq, count;
-	  unsigned int cc;
-
-	  __asm __volatile("rpcc %0" : "=r"(cc));
-	  ++count;
-	  if (cc - last_msg > 150000000 || irq != last_irq) {
-		printk("handle_irq: irq %d count %d cc %u @ %p\n",
-		       irq, count, cc-last_cc, regs->pc);
-		count = 0;
-		last_msg = cc;
-		last_irq = irq;
-	  }
-	  last_cc = cc;
+	irq_attempt(cpu, irq)++;
+	desc = irq_desc + irq;
+	spin_lock_irq(&irq_controller_lock); /* mask also the RTC */
+	desc->handler->ack(irq);
+	/*
+	   REPLAY is when Linux resends an IRQ that was dropped earlier
+	   WAITING is used by probe to mark irqs that are being tested
+	   */
+	status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING);
+	status |= IRQ_PENDING; /* we _want_ to handle it */
+
+	/*
+	 * If the IRQ is disabled for whatever reason, we cannot
+	 * use the action we have.
+	 */
+	action = NULL;
+	if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
+		action = desc->action;
+		status &= ~IRQ_PENDING; /* we commit to handling */
+		status |= IRQ_INPROGRESS; /* we are handling it */
 	}
-#endif
+	desc->status = status;
+	spin_unlock(&irq_controller_lock);
 
-	irq_enter(cpu, irq);
-	kstat.irqs[cpu][irq] += 1;
-	action = irq_desc[irq].action;
+	/*
+	 * If there is no IRQ handler or it was disabled, exit early.
+	   Since we set PENDING, if another processor is handling
+	   a different instance of this same irq, the other processor
+	   will take care of it.
+	 */
+	if (!action)
+		return;
 
 	/*
-	 * For normal interrupts, we mask it out, and then ACK it.
-	 * This way another (more timing-critical) interrupt can
-	 * come through while we're doing this one.
-	 *
-	 * Note! An irq without a handler gets masked and acked, but
-	 * never unmasked. The autoirq stuff depends on this (it looks
-	 * at the masks before and after doing the probing).
-	 */
-	if (ack >= 0) {
-		mask_irq(ack);
-		alpha_mv.ack_irq(ack);
-	}
-	if (action) {
-		if (action->flags & SA_SAMPLE_RANDOM)
-			add_interrupt_randomness(irq);
-		do {
-			action->handler(irq, action->dev_id, regs);
-			action = action->next;
-		} while (action);
-		if (ack >= 0)
-			unmask_irq(ack);
-	} else {
-		unexpected_irq(irq, regs);
+	 * Edge triggered interrupts need to remember
+	 * pending events.
+	 * This applies to any hw interrupts that allow a second
+	 * instance of the same irq to arrive while we are in do_IRQ
+	 * or in the handler. But the code here only handles the _second_
+	 * instance of the irq, not the third or fourth. So it is mostly
+	 * useful for irq hardware that does not mask cleanly in an
+	 * SMP environment.
+	 */
+	for (;;) {
+		handle_IRQ_event(irq, regs, action);
+		spin_lock(&irq_controller_lock);
+		
+		if (!(desc->status & IRQ_PENDING)
+		    || (desc->status & IRQ_LEVEL))
+			break;
+		desc->status &= ~IRQ_PENDING;
+		spin_unlock(&irq_controller_lock);
 	}
-	irq_exit(cpu, irq);
+	desc->status &= ~IRQ_INPROGRESS;
+	if (!(desc->status & IRQ_DISABLED))
+		desc->handler->end(irq);
+	spin_unlock(&irq_controller_lock);
 }
 
-
 /*
- * Start listening for interrupts..
+ * IRQ autodetection code..
+ *
+ * This depends on the fact that any interrupt that
+ * comes in on to an unassigned handler will get stuck
+ * with "IRQ_WAITING" cleared and the interrupt
+ * disabled.
  */
-
 unsigned long
 probe_irq_on(void)
 {
-	struct irqaction * action;
-	unsigned long irqs = 0;
-	unsigned long delay;
 	unsigned int i;
+	unsigned long delay;
 
-	/* Handle only the first 64 IRQs here.  This is enough for
-	   [E]ISA, which is the only thing that needs probing anyway.  */
-	for (i = (ACTUAL_NR_IRQS - 1) & 63; i > 0; i--) {
-		if (!(PROBE_MASK & (1UL << i))) {
-			continue;
-		}
-		action = irq_desc[i].action;
-		if (!action) {
-			enable_irq(i);
-			irqs |= (1UL << i);
+	/* Something may have generated an irq long ago and we want to
+	   flush such a longstanding irq before considering it as spurious. */
+	spin_lock_irq(&irq_controller_lock);
+	for (i = NR_IRQS-1; i > 0; i--) 
+		if (!irq_desc[i].action) 
+			irq_desc[i].handler->startup(i);
+	spin_unlock_irq(&irq_controller_lock);
+
+	/* Wait for longstanding interrupts to trigger. */
+	for (delay = jiffies + HZ/50; time_after(delay, jiffies); )
+		/* about 20ms delay */ synchronize_irq();
+
+	/* enable any unassigned irqs (we must startup again here because
+	   if a longstanding irq happened in the previous stage, it may have
+	   masked itself) first, enable any unassigned irqs. */
+	spin_lock_irq(&irq_controller_lock);
+	for (i = NR_IRQS-1; i > 0; i--) {
+		if (!irq_desc[i].action) {
+			irq_desc[i].status |= IRQ_AUTODETECT | IRQ_WAITING;
+			if(irq_desc[i].handler->startup(i))
+				irq_desc[i].status |= IRQ_PENDING;
 		}
 	}
+	spin_unlock_irq(&irq_controller_lock);
 
 	/*
-	 * Wait about 100ms for spurious interrupts to mask themselves
-	 * out again...
+	 * Wait for spurious interrupts to trigger
 	 */
-	for (delay = jiffies + HZ/10; time_before(jiffies, delay); )
-		barrier();
+	for (delay = jiffies + HZ/10; time_after(delay, jiffies); )
+		/* about 100ms delay */ synchronize_irq();
+
+	/*
+	 * Now filter out any obviously spurious interrupts
+	 */
+	spin_lock_irq(&irq_controller_lock);
+	for (i=0; i<NR_IRQS; i++) {
+		unsigned int status = irq_desc[i].status;
 
-	/* Now filter out any obviously spurious interrupts.  */
-	return irqs & ~alpha_irq_mask;
+		if (!(status & IRQ_AUTODETECT))
+			continue;
+		
+		/* It triggered already - consider it spurious. */
+		if (!(status & IRQ_WAITING)) {
+			irq_desc[i].status = status & ~IRQ_AUTODETECT;
+			irq_desc[i].handler->shutdown(i);
+		}
+	}
+	spin_unlock_irq(&irq_controller_lock);
+
+	return 0x12345678;
 }
 
 /*
@@ -780,19 +926,35 @@
  */
 
 int
-probe_irq_off(unsigned long irqs)
+probe_irq_off(unsigned long unused)
 {
-	int i;
-	
-	/* Handle only the first 64 IRQs here.  This is enough for
-	   [E]ISA, which is the only thing that needs probing anyway.  */
-        irqs &= alpha_irq_mask;
-	if (!irqs)
-		return 0;
-	i = ffz(~irqs);
-	if (irqs != (1UL << i))
-		i = -i;
-	return i;
+	int i, irq_found, nr_irqs;
+
+	if (unused != 0x12345678)
+		printk("Bad IRQ probe from %lx\n", (&unused)[-1]);
+
+	nr_irqs = 0;
+	irq_found = 0;
+	spin_lock_irq(&irq_controller_lock);
+	for (i=0; i<NR_IRQS; i++) {
+		unsigned int status = irq_desc[i].status;
+
+		if (!(status & IRQ_AUTODETECT))
+			continue;
+
+		if (!(status & IRQ_WAITING)) {
+			if (!nr_irqs)
+				irq_found = i;
+			nr_irqs++;
+		}
+		irq_desc[i].status = status & ~IRQ_AUTODETECT;
+		irq_desc[i].handler->shutdown(i);
+	}
+	spin_unlock_irq(&irq_controller_lock);
+
+	if (nr_irqs > 1)
+		irq_found = -irq_found;
+	return irq_found;
 }
 
 
@@ -815,7 +977,12 @@
 #endif
 		break;
 	case 1:
-		handle_irq(RTC_IRQ, -1, &regs);
+#ifdef __SMP__
+		cpu_data[smp_processor_id()].smp_local_irq_count++;
+		smp_percpu_timer_interrupt(&regs);
+		if (smp_processor_id() == smp_boot_cpuid)
+#endif
+			handle_irq(RTC_IRQ, &regs);
 		return;
 	case 2:
 		alpha_mv.machine_check(vector, la_ptr, &regs);
diff -urN 2.3.42/arch/alpha/kernel/process.c 2.3.42aa3/arch/alpha/kernel/process.c
--- 2.3.42/arch/alpha/kernel/process.c	Wed Dec  8 00:05:25 1999
+++ 2.3.42aa3/arch/alpha/kernel/process.c	Wed Feb  9 03:48:26 2000
@@ -30,9 +30,11 @@
 #include <linux/reboot.h>
 #include <linux/console.h>
 
+#if 0
 #ifdef CONFIG_RTC
 #include <linux/mc146818rtc.h>
 #endif
+#endif
 
 #include <asm/reg.h>
 #include <asm/uaccess.h>
@@ -139,9 +141,11 @@
 #endif
 	}
 
+#if 0
 #ifdef CONFIG_RTC
 	/* Reset rtc to defaults.  */
 	rtc_kill_pit();
+#endif
 #endif
 
 	if (alpha_mv.kill_arch)
diff -urN 2.3.42/arch/alpha/kernel/rtc_irq.c 2.3.42aa3/arch/alpha/kernel/rtc_irq.c
--- 2.3.42/arch/alpha/kernel/rtc_irq.c	Thu Jan  1 01:00:00 1970
+++ 2.3.42aa3/arch/alpha/kernel/rtc_irq.c	Wed Feb  9 03:48:26 2000
@@ -0,0 +1,26 @@
+/* RTC irq callbacks, 1999 Andrea Arcangeli <andrea@suse.de> */
+
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/irq.h>
+
+static void enable_rtc(unsigned int irq) { }
+static unsigned int startup_rtc(unsigned int irq) { return 0; }
+#define shutdown_rtc	enable_rtc
+#define end_rtc		enable_rtc
+#define ack_rtc		enable_rtc
+#define disable_rtc	enable_rtc
+
+void __init
+init_RTC_irq(void)
+{
+	static struct hw_interrupt_type rtc_irq_type = { "RTC",
+							 startup_rtc,
+							 shutdown_rtc,
+							 enable_rtc,
+							 disable_rtc,
+							 ack_rtc,
+							 end_rtc };
+	irq_desc[RTC_IRQ].status = IRQ_DISABLED;
+	irq_desc[RTC_IRQ].handler = &rtc_irq_type;
+}
diff -urN 2.3.42/arch/alpha/kernel/semaphore.c 2.3.42aa3/arch/alpha/kernel/semaphore.c
--- 2.3.42/arch/alpha/kernel/semaphore.c	Tue Sep 14 14:34:22 1999
+++ 2.3.42aa3/arch/alpha/kernel/semaphore.c	Wed Feb  9 03:48:26 2000
@@ -127,3 +127,39 @@
 {
 	return waking_non_zero_trylock(sem);
 }
+
+/* RW spinlock-based semaphores, 2000 Andrea Arcangeli <andrea@suse.de> */
+
+void down_read_failed(struct rw_semaphore * sem)
+{
+	struct task_struct *tsk = current;
+	DECLARE_WAITQUEUE(wait, tsk);
+
+	add_wait_queue_exclusive(&sem->wait, &wait);
+
+	do {
+		__set_task_state(tsk, TASK_UNINTERRUPTIBLE|TASK_EXCLUSIVE);
+		spin_unlock_irq(&sem->lock);
+		schedule();
+		spin_lock_irq(&sem->lock);
+	} while (sem->wr);
+
+	remove_wait_queue(&sem->wait, &wait);
+}
+
+void down_write_failed(struct rw_semaphore * sem)
+{
+	struct task_struct *tsk = current;
+	DECLARE_WAITQUEUE(wait, tsk);
+
+	add_wait_queue_exclusive(&sem->wait, &wait);
+
+	do {
+		__set_task_state(tsk, TASK_UNINTERRUPTIBLE|TASK_EXCLUSIVE);
+		spin_unlock_irq(&sem->lock);
+		schedule();
+		spin_lock_irq(&sem->lock);
+	} while (sem->rd || sem->wr);
+
+	remove_wait_queue(&sem->wait, &wait);
+}
diff -urN 2.3.42/arch/alpha/kernel/setup.c 2.3.42aa3/arch/alpha/kernel/setup.c
--- 2.3.42/arch/alpha/kernel/setup.c	Wed Dec  8 00:05:25 1999
+++ 2.3.42aa3/arch/alpha/kernel/setup.c	Wed Feb  9 03:48:26 2000
@@ -30,9 +30,11 @@
 #include <linux/ioport.h>
 #include <linux/bootmem.h>
 
+#if 0
 #ifdef CONFIG_RTC
 #include <linux/timex.h>
 #endif
+#endif
 #ifdef CONFIG_BLK_DEV_INITRD
 #include <linux/blk.h>
 #endif
@@ -462,6 +464,7 @@
 	/* Reserve standard resources.  */
 	reserve_std_resources();
 
+#if 0
 	/* Initialize the timers.  */
 	/* ??? There is some circumstantial evidence that this needs
 	   to be done now rather than later in time_init, which would
@@ -470,6 +473,7 @@
 	rtc_init_pit();
 #else
 	alpha_mv.init_pit();
+#endif
 #endif
 
 	/* 
diff -urN 2.3.42/arch/alpha/kernel/signal.c 2.3.42aa3/arch/alpha/kernel/signal.c
--- 2.3.42/arch/alpha/kernel/signal.c	Wed Nov 24 18:22:03 1999
+++ 2.3.42aa3/arch/alpha/kernel/signal.c	Wed Feb  9 03:48:28 2000
@@ -437,6 +437,8 @@
 		err |= __copy_to_user(frame->extramask, &set->sig[1], 
 				      sizeof(frame->extramask));
 	}
+	if (err)
+		goto give_sigsegv;
 
 	/* Set up to return from userspace.  If provided, use a stub
 	   already in userspace.  */
@@ -499,6 +501,8 @@
 	err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, sw,
 				set->sig[0], oldsp);
 	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
+	if (err)
+		goto give_sigsegv;
 
 	/* Set up to return from userspace.  If provided, use a stub
 	   already in userspace.  */
diff -urN 2.3.42/arch/alpha/kernel/smp.c 2.3.42aa3/arch/alpha/kernel/smp.c
--- 2.3.42/arch/alpha/kernel/smp.c	Wed Dec  8 00:05:25 1999
+++ 2.3.42aa3/arch/alpha/kernel/smp.c	Wed Feb  9 03:48:27 2000
@@ -62,6 +62,7 @@
 static unsigned long smp_secondary_alive;
 
 unsigned long cpu_present_mask;	/* Which cpus ids came online.  */
+static unsigned long __cpu_present_mask __initdata = 0; /* cpu reported in the hwrpb */
 
 static int max_cpus = -1;	/* Command-line limitation.  */
 int smp_boot_cpuid;		/* Which processor we booted from.  */
@@ -70,7 +71,7 @@
 int smp_threads_ready;		/* True once the per process idle is forked. */
 cycles_t cacheflush_time;
 
-int cpu_number_map[NR_CPUS];
+int __cpu_number_map[NR_CPUS];
 int __cpu_logical_map[NR_CPUS];
 
 extern void calibrate_delay(void);
@@ -432,7 +433,7 @@
 
 	idle->processor = cpuid;
 	__cpu_logical_map[cpunum] = cpuid;
-	cpu_number_map[cpuid] = cpunum;
+	__cpu_number_map[cpuid] = cpunum;
 	idle->has_cpu = 1; /* we schedule the first task manually */
  
 	del_from_runqueue(idle);
@@ -461,7 +462,7 @@
 
 	/* we must invalidate our stuff as we failed to boot the CPU */
 	__cpu_logical_map[cpunum] = -1;
-	cpu_number_map[cpuid] = -1;
+	__cpu_number_map[cpuid] = -1;
 
 	/* the idle task is local to us so free it as we don't use it */
 	free_task_struct(idle);
@@ -506,7 +507,7 @@
 			if ((cpu->flags & 0x1cc) == 0x1cc) {
 				smp_num_probed++;
 				/* Assume here that "whami" == index */
-				cpu_present_mask |= (1L << i);
+				__cpu_present_mask |= (1L << i);
 				cpu->pal_revision = boot_cpu_palrev;
 			}
 
@@ -517,11 +518,12 @@
 		}
 	} else {
 		smp_num_probed = 1;
-		cpu_present_mask = (1L << smp_boot_cpuid);
+		__cpu_present_mask = (1L << smp_boot_cpuid);
 	}
+	cpu_present_mask = 1L << smp_boot_cpuid;
 
 	printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n",
-	       smp_num_probed, cpu_present_mask);
+	       smp_num_probed, __cpu_present_mask);
 }
 
 /*
@@ -534,11 +536,11 @@
 	unsigned long bogosum;
 
 	/* Take care of some initial bookkeeping.  */
-	memset(cpu_number_map, -1, sizeof(cpu_number_map));
+	memset(__cpu_number_map, -1, sizeof(__cpu_number_map));
 	memset(__cpu_logical_map, -1, sizeof(__cpu_logical_map));
 	memset(ipi_data, 0, sizeof(ipi_data));
 
-	cpu_number_map[smp_boot_cpuid] = 0;
+	__cpu_number_map[smp_boot_cpuid] = 0;
 	__cpu_logical_map[0] = smp_boot_cpuid;
 	current->processor = smp_boot_cpuid;
 
@@ -565,13 +567,14 @@
 		if (i == smp_boot_cpuid)
 			continue;
 
-	        if (((cpu_present_mask >> i) & 1) == 0)
+	        if (((__cpu_present_mask >> i) & 1) == 0)
 			continue;
 
 		if (smp_boot_one_cpu(i, cpu_count))
 			continue;
 
 		cpu_count++;
+		cpu_present_mask |= 1L << i;
 	}
 
 	if (cpu_count == 1) {
@@ -722,7 +725,7 @@
 		return -EBUSY;
 
 	while (*(void **)lock)
-		schedule();
+		barrier();
 	goto again;
 }
 
@@ -865,6 +868,22 @@
 	}
 
 	return 0;
+}
+
+static void
+ipi_imb(void)
+{
+	imb();
+}
+
+void
+smp_imb(void)
+{
+	/* Must wait other processors to flush their icache before continue. */
+	if (smp_call_function(ipi_imb, NULL, 1, 1))
+		printk(KERN_CRIT "smp_imb: timed out\n");
+
+	imb();
 }
 
 static void
diff -urN 2.3.42/arch/alpha/kernel/sys_dp264.c 2.3.42aa3/arch/alpha/kernel/sys_dp264.c
--- 2.3.42/arch/alpha/kernel/sys_dp264.c	Wed Dec  8 00:05:25 1999
+++ 2.3.42aa3/arch/alpha/kernel/sys_dp264.c	Wed Feb  9 03:48:26 2000
@@ -14,6 +14,7 @@
 #include <linux/sched.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 
 #include <asm/ptrace.h>
 #include <asm/system.h>
@@ -36,60 +37,158 @@
  * HACK ALERT! only the boot cpu is used for interrupts.
  */
 
+static void enable_tsunami_irq(unsigned int irq);
+static void disable_tsunami_irq(unsigned int irq);
+static void enable_clipper_irq(unsigned int irq);
+static void disable_clipper_irq(unsigned int irq);
+
+#define end_tsunami_irq		enable_tsunami_irq
+#define shutdown_tsunami_irq	disable_tsunami_irq
+#define mask_and_ack_tsunami_irq	disable_tsunami_irq
+
+#define end_clipper_irq		enable_clipper_irq
+#define shutdown_clipper_irq	disable_clipper_irq
+#define mask_and_ack_clipper_irq	disable_clipper_irq
+
+
+static unsigned int
+startup_tsunami_irq(unsigned int irq)
+{ 
+	enable_tsunami_irq(irq);
+	return 0; /* never anything pending */
+}
+
+static unsigned int
+startup_clipper_irq(unsigned int irq)
+{ 
+	enable_clipper_irq(irq);
+	return 0; /* never anything pending */
+}
+
+static struct hw_interrupt_type tsunami_irq_type = {
+	"TSUNAMI",
+	startup_tsunami_irq,
+	shutdown_tsunami_irq,
+	enable_tsunami_irq,
+	disable_tsunami_irq,
+	mask_and_ack_tsunami_irq,
+	end_tsunami_irq
+};
+
+static struct hw_interrupt_type clipper_irq_type = {
+	"CLIPPER",
+	startup_clipper_irq,
+	shutdown_clipper_irq,
+	enable_clipper_irq,
+	disable_clipper_irq,
+	mask_and_ack_clipper_irq,
+	end_clipper_irq
+};
+
+static unsigned long cached_irq_mask = ~0UL;
+
+#define TSUNAMI_SET_IRQ_MASK(cpu, value)	\
+do {						\
+	volatile unsigned long *csr;		\
+						\
+	csr = &TSUNAMI_cchip->dim##cpu##.csr;	\
+	*csr = (value);				\
+	mb();					\
+	*csr;					\
+} while(0)
+
+static inline void
+do_flush_irq_mask(unsigned long value)
+{
+	switch (TSUNAMI_bootcpu)
+	{
+	case 0:
+		TSUNAMI_SET_IRQ_MASK(0, value);
+		break;
+	case 1:
+		TSUNAMI_SET_IRQ_MASK(1, value);
+		break;
+	case 2:
+		TSUNAMI_SET_IRQ_MASK(2, value);
+		break;
+	case 3:
+		TSUNAMI_SET_IRQ_MASK(3, value);
+		break;
+	}
+}
+
+#ifdef CONFIG_SMP
+static inline void
+do_flush_smp_irq_mask(unsigned long value)
+{
+	extern unsigned long cpu_present_mask;
+	unsigned long other_cpus = cpu_present_mask & ~(1L << TSUNAMI_bootcpu);
+
+	if (other_cpus & 1)
+		TSUNAMI_SET_IRQ_MASK(0, value);
+	if (other_cpus & 2)
+		TSUNAMI_SET_IRQ_MASK(1, value);
+	if (other_cpus & 4)
+		TSUNAMI_SET_IRQ_MASK(2, value);
+	if (other_cpus & 8)
+		TSUNAMI_SET_IRQ_MASK(3, value);
+}
+#endif
+
 static void
-dp264_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p)
+dp264_flush_irq_mask(unsigned long mask)
 {
-	volatile unsigned long *csr;
+	unsigned long value;
 
-	if (TSUNAMI_bootcpu < 2) {
-		if (!TSUNAMI_bootcpu)
-			csr = &TSUNAMI_cchip->dim0.csr;
-		else
-			csr = &TSUNAMI_cchip->dim1.csr;
-	} else {
-		if (TSUNAMI_bootcpu == 2)
-			csr = &TSUNAMI_cchip->dim2.csr;
-		else
-			csr = &TSUNAMI_cchip->dim3.csr;
-	}
+#ifdef CONFIG_SMP
+	value = ~mask;
+	do_flush_smp_irq_mask(value);
+#endif
 
-	*csr = ~mask;
-	mb();
-	*csr;
-
-	if (irq < 16) {
-		if (irq >= 8)
-			outb(mask >> 8, 0xA1);	/* ISA PIC2 */
-		else
-			outb(mask, 0x21);	/* ISA PIC1 */
-	}
+	value = ~mask | (1UL << 55) | 0xffff; /* isa irqs always enabled */
+	do_flush_irq_mask(value);
 }
 
 static void
-clipper_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p)
+enable_tsunami_irq(unsigned int irq)
 {
-	if (irq >= 16) {
-		volatile unsigned long *csr;
+	cached_irq_mask &= ~(1UL << irq);
+	dp264_flush_irq_mask(cached_irq_mask);
+}
 
-		if (TSUNAMI_bootcpu < 2)
-			if (!TSUNAMI_bootcpu)
-				csr = &TSUNAMI_cchip->dim0.csr;
-			else
-				csr = &TSUNAMI_cchip->dim1.csr;
-		else
-			if (TSUNAMI_bootcpu == 2)
-				csr = &TSUNAMI_cchip->dim2.csr;
-			else
-				csr = &TSUNAMI_cchip->dim3.csr;
-		
-		*csr = (~mask >> 16) | (1UL << 55); /* master ISA enable */
-		mb();
-		*csr;
-	}
-	else if (irq >= 8)
-		outb(mask >> 8, 0xA1);	/* ISA PIC2 */
-	else
-		outb(mask, 0x21);	/* ISA PIC1 */
+static void
+disable_tsunami_irq(unsigned int irq)
+{
+	cached_irq_mask |= 1UL << irq;
+	dp264_flush_irq_mask(cached_irq_mask);
+}
+
+static void
+clipper_flush_irq_mask(unsigned long mask)
+{
+	unsigned long value;
+
+#ifdef CONFIG_SMP
+	value = ~mask >> 16;
+	do_flush_smp_irq_mask(value);
+#endif
+
+	value = (~mask >> 16) | (1UL << 55); /* master ISA enable */
+	do_flush_irq_mask(value);
+}
+
+static void
+enable_clipper_irq(unsigned int irq)
+{
+	cached_irq_mask &= ~(1UL << irq);
+	clipper_flush_irq_mask(cached_irq_mask);
+}
+
+static void
+disable_clipper_irq(unsigned int irq)
+{
+	cached_irq_mask |= 1UL << irq;
+	clipper_flush_irq_mask(cached_irq_mask);
 }
 
 static void
@@ -126,9 +225,9 @@
 static void 
 dp264_srm_device_interrupt(unsigned long vector, struct pt_regs * regs)
 {
-	int irq, ack;
+	int irq;
 
-	ack = irq = (vector - 0x800) >> 4;
+	irq = (vector - 0x800) >> 4;
 
 	/*
 	 * The SRM console reports PCI interrupts with a vector calculated by:
@@ -142,17 +241,17 @@
 	 * so we don't count them.
 	 */
 	if (irq >= 32)
-		ack = irq = irq - 16;
+		irq -= 16;
 
-	handle_irq(irq, ack, regs);
+	handle_irq(irq, regs);
 }
 
 static void 
 clipper_srm_device_interrupt(unsigned long vector, struct pt_regs * regs)
 {
-	int irq, ack;
+	int irq;
 
-	ack = irq = (vector - 0x800) >> 4;
+	irq = (vector - 0x800) >> 4;
 
 	/*
 	 * The SRM console reports PCI interrupts with a vector calculated by:
@@ -166,7 +265,22 @@
 	 *
 	 * Eg IRQ 24 is DRIR bit 8, etc, etc
 	 */
-	handle_irq(irq, ack, regs);
+	handle_irq(irq, regs);
+}
+
+static void __init
+init_TSUNAMI_irqs(struct hw_interrupt_type * ops)
+{
+	int i;
+
+	for (i = 0; i < NR_IRQS; i++) {
+		if (i == RTC_IRQ)
+			continue;
+		if (i < 16)
+			continue;
+		irq_desc[i].status = IRQ_DISABLED | IRQ_LEVEL;
+		irq_desc[i].handler = ops;
+	}
 }
 
 static void __init
@@ -180,10 +294,11 @@
 	if (alpha_using_srm)
 		alpha_mv.device_interrupt = dp264_srm_device_interrupt;
 
-	dp264_update_irq_hw(16, alpha_irq_mask, 0);
+	init_ISA_irqs();
+	init_RTC_irq();
+	init_TSUNAMI_irqs(&tsunami_irq_type);
 
-        enable_irq(55);     /* Enable ISA interrupt controller.  */
-	enable_irq(2);
+	dp264_flush_irq_mask(~0UL);
 }
 
 static void __init
@@ -197,10 +312,11 @@
 	if (alpha_using_srm)
 		alpha_mv.device_interrupt = clipper_srm_device_interrupt;
 
-	clipper_update_irq_hw(16, alpha_irq_mask, 0);
+	init_ISA_irqs();
+	init_RTC_irq();
+	init_TSUNAMI_irqs(&clipper_irq_type);
 
-        enable_irq(55);     /* Enable ISA interrupt controller.  */
-	enable_irq(2);
+	clipper_flush_irq_mask(~0UL);
 }
 
 
@@ -431,9 +547,6 @@
 	min_mem_address:	DEFAULT_MEM_BASE,
 
 	nr_irqs:		64,
-	irq_probe_mask:		TSUNAMI_PROBE_MASK,
-	update_irq_hw:		dp264_update_irq_hw,
-	ack_irq:		common_ack_irq,
 	device_interrupt:	dp264_device_interrupt,
 
 	init_arch:		tsunami_init_arch,
@@ -458,9 +571,6 @@
 	min_mem_address:	DEFAULT_MEM_BASE,
 
 	nr_irqs:		64,
-	irq_probe_mask:		TSUNAMI_PROBE_MASK,
-	update_irq_hw:		dp264_update_irq_hw,
-	ack_irq:		common_ack_irq,
 	device_interrupt:	dp264_device_interrupt,
 
 	init_arch:		tsunami_init_arch,
@@ -484,9 +594,6 @@
 	min_mem_address:	DEFAULT_MEM_BASE,
 
 	nr_irqs:		64,
-	irq_probe_mask:		TSUNAMI_PROBE_MASK,
-	update_irq_hw:		dp264_update_irq_hw,
-	ack_irq:		common_ack_irq,
 	device_interrupt:	dp264_device_interrupt,
 
 	init_arch:		tsunami_init_arch,
@@ -510,9 +617,6 @@
 	min_mem_address:	DEFAULT_MEM_BASE,
 
 	nr_irqs:		64,
-	irq_probe_mask:		TSUNAMI_PROBE_MASK,
-	update_irq_hw:		clipper_update_irq_hw,
-	ack_irq:		common_ack_irq,
 	device_interrupt:	dp264_device_interrupt,
 
 	init_arch:		tsunami_init_arch,
diff -urN 2.3.42/arch/alpha/kernel/sys_sx164.c 2.3.42aa3/arch/alpha/kernel/sys_sx164.c
--- 2.3.42/arch/alpha/kernel/sys_sx164.c	Wed Dec  8 00:05:25 1999
+++ 2.3.42aa3/arch/alpha/kernel/sys_sx164.c	Wed Feb  9 03:48:27 2000
@@ -14,6 +14,8 @@
 #include <linux/sched.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
 
 #include <asm/ptrace.h>
 #include <asm/system.h>
@@ -26,47 +28,83 @@
 #include <asm/core_pyxis.h>
 
 #include "proto.h"
-#include <asm/hw_irq.h>
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
 
+/* Note invert on MASK bits. */
+static unsigned long cached_irq_mask;
+
+static inline void
+sx164_change_irq_mask(unsigned long mask)
+{
+	*(vulp)PYXIS_INT_MASK = mask;
+	mb();
+	*(vulp)PYXIS_INT_MASK;
+}
+
+static inline void
+sx164_enable_irq(unsigned int irq)
+{
+	sx164_change_irq_mask(cached_irq_mask |= 1UL << (irq - 16));
+}
+
 static void
-sx164_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p)
+sx164_disable_irq(unsigned int irq)
 {
-	if (irq >= 16) {
-		/* Make CERTAIN none of the bogus ints get enabled */
-		*(vulp)PYXIS_INT_MASK =
-			~((long)mask >> 16) & ~0x000000000000003bUL;
-		mb();
-		/* ... and read it back to make sure it got written.  */
-		*(vulp)PYXIS_INT_MASK;
-	}
-	else if (irq >= 8)
-		outb(mask >> 8, 0xA1);	/* ISA PIC2 */
-	else
-		outb(mask, 0x21);	/* ISA PIC1 */
+	sx164_change_irq_mask(cached_irq_mask &= ~(1UL << (irq - 16)));
+}
+
+static unsigned int
+sx164_startup_irq(unsigned int irq)
+{
+	sx164_enable_irq(irq);
+	return 0;
+}
+
+static inline void
+sx164_srm_enable_irq(unsigned int irq)
+{
+	cserve_ena(irq - 16);
 }
 
 static void
-sx164_srm_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p)
+sx164_srm_disable_irq(unsigned int irq)
 {
-	if (irq >= 16) {
-		if (unmask_p)
-			cserve_ena(irq - 16);
-		else
-			cserve_dis(irq - 16);
-	}
-	else if (irq >= 8)
-		outb(mask >> 8, 0xA1);	/* ISA PIC2 */
-	else
-		outb(mask, 0x21);	/* ISA PIC1 */
+	cserve_dis(irq - 16);
 }
 
+static unsigned int
+sx164_srm_startup_irq(unsigned int irq)
+{
+	sx164_srm_enable_irq(irq);
+	return 0;
+}
+
+static struct hw_interrupt_type sx164_irq_type = {
+	typename:	"SX164",
+	startup:	sx164_startup_irq,
+	shutdown:	sx164_disable_irq,
+	enable:		sx164_enable_irq,
+	disable:	sx164_disable_irq,
+	ack:		sx164_disable_irq,
+	end:		sx164_enable_irq,
+};
+
+static struct hw_interrupt_type sx164_srm_irq_type = {
+	typename:	"SX164-SRM",
+	startup:	sx164_srm_startup_irq,
+	shutdown:	sx164_srm_disable_irq,
+	enable:		sx164_srm_enable_irq,
+	disable:	sx164_srm_disable_irq,
+	ack:		sx164_srm_disable_irq,
+	end:		sx164_srm_enable_irq,
+};
+
 static void 
 sx164_device_interrupt(unsigned long vector, struct pt_regs *regs)
 {
-	unsigned long pld, tmp;
+	unsigned long pld;
 	unsigned int i;
 
 	/* Read the interrupt summary register of PYXIS */
@@ -93,35 +131,48 @@
 			continue;
 		} else {
 			/* if not timer int */
-			handle_irq(16 + i, 16 + i, regs);
+			handle_irq(16 + i, regs);
 		}
-		*(vulp)PYXIS_INT_REQ = 1UL << i; mb();
-		tmp = *(vulp)PYXIS_INT_REQ;
+
+		*(vulp)PYXIS_INT_REQ = 1UL << i;
+		mb();
+		*(vulp)PYXIS_INT_REQ;
 	}
 }
 
 static void
 sx164_init_irq(void)
 {
+	struct hw_interrupt_type *ops;
+	long i;
+
 	outb(0, DMA1_RESET_REG);
 	outb(0, DMA2_RESET_REG);
 	outb(DMA_MODE_CASCADE, DMA2_MODE_REG);
 	outb(0, DMA2_MASK_REG);
 
+	init_ISA_irqs();
+	init_RTC_irq();
+
 	if (alpha_using_srm) {
-		alpha_mv.update_irq_hw = sx164_srm_update_irq_hw;
 		alpha_mv.device_interrupt = srm_device_interrupt;
+		ops = &sx164_srm_irq_type;
 	}
 	else {
-		/* Note invert on MASK bits. */
-		*(vulp)PYXIS_INT_MASK  = ~((long)alpha_irq_mask >> 16);
-		mb();
-		*(vulp)PYXIS_INT_MASK;
+		sx164_change_irq_mask(0);
+		ops = &sx164_irq_type;
+	}
+
+	for (i = 16; i < 40; ++i) {
+		/* Make CERTAIN none of the bogus ints get enabled.  */
+		if ((0x3b0000 >> i) & 1)
+			continue;
+		irq_desc[i].status = IRQ_DISABLED;
+		irq_desc[i].handler = ops;
 	}
 
-	enable_irq(16 + 6);	/* enable timer */
-	enable_irq(16 + 7);	/* enable ISA PIC cascade */
-	enable_irq(2);		/* enable cascade */
+	ops->startup(16 + 6);	/* enable timer */
+	ops->startup(16 + 7);	/* enable ISA PIC cascade */
 }
 
 /*
@@ -202,9 +253,6 @@
 	min_mem_address:	DEFAULT_MEM_BASE,
 
 	nr_irqs:		40,
-	irq_probe_mask:		_PROBE_MASK(40),
-	update_irq_hw:		sx164_update_irq_hw,
-	ack_irq:		common_ack_irq,
 	device_interrupt:	sx164_device_interrupt,
 
 	init_arch:		pyxis_init_arch,
diff -urN 2.3.42/arch/alpha/kernel/time.c 2.3.42aa3/arch/alpha/kernel/time.c
--- 2.3.42/arch/alpha/kernel/time.c	Wed Dec  8 00:05:25 1999
+++ 2.3.42aa3/arch/alpha/kernel/time.c	Wed Feb  9 03:48:27 2000
@@ -31,6 +31,8 @@
 #include <linux/mm.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -88,13 +90,7 @@
 	__u32 now;
 	long nticks;
 
-#ifdef __SMP__
-	/* When SMP, do this for *all* CPUs, but only do the rest for
-           the boot CPU.  */
-	smp_percpu_timer_interrupt(regs);
-	if (smp_processor_id() != smp_boot_cpuid)
-		return;
-#else
+#ifndef __SMP__
 	/* Not SMP, do kernel PC profiling here.  */
 	if (!user_mode(regs))
 		alpha_do_profile(regs->pc);
@@ -167,6 +163,7 @@
 	  )*60 + sec; /* finally seconds */
 }
 
+#if 0
 /*
  * Initialize Programmable Interval Timers with standard values.  Some
  * drivers depend on them being initialized (e.g., joystick driver).
@@ -213,6 +210,7 @@
 	sti();
 }
 #endif
+#endif
 
 void
 common_init_pit (void)
@@ -248,10 +246,15 @@
 void
 time_init(void)
 {
-	void (*irq_handler)(int, void *, struct pt_regs *);
 	unsigned int year, mon, day, hour, min, sec, cc1, cc2;
 	unsigned long cycle_freq, one_percent;
 	long diff;
+	static struct irqaction timer_irqaction  = { timer_interrupt,
+						     SA_INTERRUPT, 0, "timer",
+						     NULL, NULL};
+
+	/* Startup the timer source. */
+	alpha_mv.init_pit();
 
 	/*
 	 * The Linux interpretation of the CMOS clock register contents:
@@ -337,9 +340,7 @@
 	state.partial_tick = 0L;
 
 	/* setup timer */ 
-	irq_handler = timer_interrupt;
-	if (request_irq(TIMER_IRQ, irq_handler, 0, "timer", NULL))
-		panic("Could not allocate timer IRQ!");
+	setup_irq(TIMER_IRQ, &timer_irqaction);
 }
 
 /*
diff -urN 2.3.42/arch/alpha/mm/fault.c 2.3.42aa3/arch/alpha/mm/fault.c
--- 2.3.42/arch/alpha/mm/fault.c	Wed Nov 24 18:22:03 1999
+++ 2.3.42aa3/arch/alpha/mm/fault.c	Wed Feb  9 03:48:28 2000
@@ -130,13 +130,13 @@
 	 * make sure we exit gracefully rather than endlessly redo
 	 * the fault.
 	 */
+survive:
 	fault = handle_mm_fault(current, vma, address, cause > 0);
-	up(&mm->mmap_sem);
-
 	if (fault < 0)
 		goto out_of_memory;
 	if (fault == 0)
 		goto do_sigbus;
+	up(&mm->mmap_sem);
 
 	return;
 
@@ -177,13 +177,23 @@
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-	printk(KERN_ALERT "VM: killing process %s(%d)\n",
-	       current->comm, current->pid);
-	if (!user_mode(regs))
-		goto no_context;
-	do_exit(SIGKILL);
+	if (current->pid == 1)
+	{
+		current->policy |= SCHED_YIELD;
+		schedule();
+		goto survive;
+	}
+	up(&mm->mmap_sem);
+	if (user_mode(regs))
+	{
+		printk(KERN_ALERT "VM: killing process %s(%d)\n",
+		       current->comm, current->pid);
+		do_exit(SIGKILL);
+	}
+	goto no_context;
 
 do_sigbus:
+	up(&mm->mmap_sem);
 	/*
 	 * Send a sigbus, regardless of whether we were in kernel
 	 * or user mode.
diff -urN 2.3.42/arch/i386/kernel/irq.c 2.3.42aa3/arch/i386/kernel/irq.c
--- 2.3.42/arch/i386/kernel/irq.c	Sun Jan 30 15:43:27 2000
+++ 2.3.42aa3/arch/i386/kernel/irq.c	Wed Feb  9 03:48:29 2000
@@ -733,8 +733,24 @@
 	unsigned long delay;
 	unsigned long val;
 
+	/* 
+	 * something may have generated an irq long ago and we want to
+	 * flush such a longstanding irq before considering it as spurious. 
+	 */
+	spin_lock_irq(&irq_controller_lock);
+	for (i = NR_IRQS-1; i > 0; i--) 
+		if (!irq_desc[i].action) 
+			irq_desc[i].handler->startup(i);
+	spin_unlock_irq(&irq_controller_lock);
+
+	/* Wait for longstanding interrupts to trigger. */
+	for (delay = jiffies + HZ/50; time_after(delay, jiffies); )
+		/* about 20ms delay */ synchronize_irq();
+
 	/*
-	 * first, enable any unassigned irqs
+	 * enable any unassigned irqs
+	 * (we must startup again here because if a longstanding irq
+	 * happened in the previous stage, it may have masked itself)
 	 */
 	spin_lock_irq(&irq_controller_lock);
 	for (i = NR_IRQS-1; i > 0; i--) {
diff -urN 2.3.42/arch/i386/kernel/signal.c 2.3.42aa3/arch/i386/kernel/signal.c
--- 2.3.42/arch/i386/kernel/signal.c	Sun Jan 30 15:43:34 2000
+++ 2.3.42aa3/arch/i386/kernel/signal.c	Wed Feb  9 03:48:28 2000
@@ -419,13 +419,19 @@
 		           ? current->exec_domain->signal_invmap[sig]
 		           : sig),
 		          &frame->sig);
+	if (err)
+		goto give_sigsegv;
 
 	err |= setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]);
+	if (err)
+		goto give_sigsegv;
 
 	if (_NSIG_WORDS > 1) {
 		err |= __copy_to_user(frame->extramask, &set->sig[1],
 				      sizeof(frame->extramask));
 	}
+	if (err)
+		goto give_sigsegv;
 
 	/* Set up to return from userspace.  If provided, use a stub
 	   already in userspace.  */
@@ -486,6 +492,8 @@
 	err |= __put_user(&frame->info, &frame->pinfo);
 	err |= __put_user(&frame->uc, &frame->puc);
 	err |= __copy_to_user(&frame->info, info, sizeof(*info));
+	if (err)
+		goto give_sigsegv;
 
 	/* Create the ucontext.  */
 	err |= __put_user(0, &frame->uc.uc_flags);
@@ -497,6 +505,8 @@
 	err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate,
 			        regs, set->sig[0]);
 	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
+	if (err)
+		goto give_sigsegv;
 
 	/* Set up to return from userspace.  If provided, use a stub
 	   already in userspace.  */
diff -urN 2.3.42/arch/i386/kernel/traps.c 2.3.42aa3/arch/i386/kernel/traps.c
--- 2.3.42/arch/i386/kernel/traps.c	Sun Jan 30 15:43:27 2000
+++ 2.3.42aa3/arch/i386/kernel/traps.c	Wed Feb  9 03:48:29 2000
@@ -172,9 +172,8 @@
 		printk("\nCall Trace: ");
 		stack = (unsigned long *) esp;
 		i = 1;
-		module_start = PAGE_OFFSET + (max_mapnr << PAGE_SHIFT);
-		module_start = ((module_start + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1));
-		module_end = module_start + MODULE_RANGE;
+		module_start = VMALLOC_START;
+		module_end = VMALLOC_END;
 		while (((long) stack & 4095) != 0) {
 			addr = *stack++;
 			/*
diff -urN 2.3.42/arch/i386/mm/fault.c 2.3.42aa3/arch/i386/mm/fault.c
--- 2.3.42/arch/i386/mm/fault.c	Sun Jan 30 15:43:27 2000
+++ 2.3.42aa3/arch/i386/mm/fault.c	Wed Feb  9 03:48:28 2000
@@ -32,6 +32,7 @@
 {
 	struct vm_area_struct * vma;
 	unsigned long start = (unsigned long) addr;
+	int fault;
 
 	if (!size)
 		return 1;
@@ -51,8 +52,12 @@
 	start &= PAGE_MASK;
 
 	for (;;) {
-		if (handle_mm_fault(current, vma, start, 1) <= 0)
-			goto bad_area;
+survive:
+		fault =  handle_mm_fault(current, vma, start, 1);
+		if (!fault)
+			goto do_sigbus;
+		if (fault < 0)
+			goto out_of_memory;
 		if (!size)
 			break;
 		size--;
@@ -75,6 +80,19 @@
 
 bad_area:
 	return 0;
+
+do_sigbus:
+	force_sig(SIGBUS, current);
+	goto bad_area;
+
+out_of_memory:
+	if (current->pid == 1)
+	{
+		current->policy |= SCHED_YIELD;
+		schedule();
+		goto survive;
+	}
+	goto bad_area;
 }
 
 static void __init handle_wp_test (void)
@@ -192,6 +210,7 @@
 	 * make sure we exit gracefully rather than endlessly redo
 	 * the fault.
 	 */
+survive:
 	{
 		int fault = handle_mm_fault(tsk, vma, address, write);
 		if (fault < 0)
@@ -288,10 +307,39 @@
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
+	if (tsk->pid == 1)
+	{
+		tsk->policy |= SCHED_YIELD;
+		schedule();
+		goto survive;
+	}
 	up(&mm->mmap_sem);
-	printk("VM: killing process %s\n", tsk->comm);
 	if (error_code & 4)
-		do_exit(SIGKILL);
+	{
+		if (tsk->oom_kill_try++ > 10 ||
+		    !((regs->eflags >> 12) & 3))
+		{
+			printk(KERN_ALERT "VM: killing process %s\n",
+			       tsk->comm);
+			do_exit(SIGKILL);
+		}
+		else
+		{
+			/*
+			 * The task is running with privilegies and so we
+			 * trust it and we give it a chance to die gracefully.
+			 */
+			printk(KERN_ALERT "VM: terminating process %s\n",
+			       tsk->comm);
+			force_sig(SIGTERM, current);
+			if (tsk->oom_kill_try > 1)
+			{
+				tsk->policy |= SCHED_YIELD;
+				schedule();
+			}
+			return;
+		}
+	}
 	goto no_context;
 
 do_sigbus:
diff -urN 2.3.42/drivers/block/Config.in 2.3.42aa3/drivers/block/Config.in
--- 2.3.42/drivers/block/Config.in	Sun Jan 30 15:43:37 2000
+++ 2.3.42aa3/drivers/block/Config.in	Wed Feb  9 03:48:26 2000
@@ -197,6 +197,10 @@
 
 comment 'Additional Block Devices'
 
+tristate 'Logical volume manager (LVM) support' CONFIG_BLK_DEV_LVM N
+if [ "$CONFIG_BLK_DEV_LVM" != "n" ]; then
+  bool '   LVM information in proc filesystem' CONFIG_LVM_PROC_FS Y
+fi
 tristate 'Loopback device support' CONFIG_BLK_DEV_LOOP
 if [ "$CONFIG_NET" = "y" ]; then
    tristate 'Network block device support' CONFIG_BLK_DEV_NBD
diff -urN 2.3.42/drivers/block/Makefile 2.3.42aa3/drivers/block/Makefile
--- 2.3.42/drivers/block/Makefile	Sun Jan 30 15:43:27 2000
+++ 2.3.42aa3/drivers/block/Makefile	Wed Feb  9 03:48:26 2000
@@ -322,6 +322,14 @@
   endif
 endif
 
+ifeq ($(CONFIG_BLK_DEV_LVM),y)
+L_OBJS += lvm.o lvm-snap.o
+else
+   ifeq ($(CONFIG_BLK_DEV_LVM),m)
+   M_OBJS += lvm-mod.o
+   endif
+endif
+
 ifeq ($(CONFIG_BLK_DEV_MD),y)
 LX_OBJS += md.o
 
@@ -383,3 +391,6 @@
 
 ide-probe-mod.o: ide-probe.o ide-geometry.o
 	$(LD) $(LD_RFLAG) -r -o $@ ide-probe.o ide-geometry.o
+
+lvm-mod.o: lvm.o lvm-snap.o
+	$(LD) -r -o $@ lvm.o lvm-snap.o
diff -urN 2.3.42/drivers/block/README.lvm 2.3.42aa3/drivers/block/README.lvm
--- 2.3.42/drivers/block/README.lvm	Thu Jan  1 01:00:00 1970
+++ 2.3.42aa3/drivers/block/README.lvm	Wed Feb  9 03:48:26 2000
@@ -0,0 +1,8 @@
+
+This is the Logical Volume Manager driver for Linux,
+
+Tools, library that manage logical volumes can be found
+at <http://linux.msede.com/lvm>.
+
+There you can obtain actual driver versions too.
+
diff -urN 2.3.42/drivers/block/ll_rw_blk.c 2.3.42aa3/drivers/block/ll_rw_blk.c
--- 2.3.42/drivers/block/ll_rw_blk.c	Sun Jan 30 15:43:37 2000
+++ 2.3.42aa3/drivers/block/ll_rw_blk.c	Wed Feb  9 03:48:29 2000
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 1991, 1992 Linus Torvalds
  * Copyright (C) 1994,      Karl Keyte: Added support for disk statistics
+ * Elevator latency, (C) 2000  Andrea Arcangeli <andrea@suse.de> SuSE
  */
 
 /*
@@ -26,6 +27,14 @@
 
 #include <linux/module.h>
 
+#if defined CONFIG_BLK_DEV_LVM || defined CONFIG_BLK_DEV_LVM_MODULE
+#include <linux/lvm.h>
+   /* function pointer to the LVM driver remapping function
+      which will be setup during driver/module init; neccessary
+      to be able to load LVM as a module */
+int (*lvm_map_ptr) (struct buffer_head *, int) = NULL;
+#endif
+
 /*
  * MAC Floppy IWM hooks
  */
@@ -67,7 +76,7 @@
 
 /* This specifies how many sectors to read ahead on the disk.  */
 
-int read_ahead[MAX_BLKDEV] = {0, };
+int read_ahead[MAX_BLKDEV];
 
 /* blk_dev_struct is:
  *	*request_fn
@@ -83,7 +92,7 @@
  *
  * if (!blk_size[MAJOR]) then no minor size checking is done.
  */
-int * blk_size[MAX_BLKDEV] = { NULL, NULL, };
+int * blk_size[MAX_BLKDEV];
 
 /*
  * blksize_size contains the size of all block-devices:
@@ -92,7 +101,7 @@
  *
  * if (!blksize_size[MAJOR]) then 1024 bytes is assumed.
  */
-int * blksize_size[MAX_BLKDEV] = { NULL, NULL, };
+int * blksize_size[MAX_BLKDEV];
 
 /*
  * hardsect_size contains the size of the hardware sector of a device.
@@ -106,17 +115,17 @@
  * This is currently set by some scsi devices and read by the msdos fs driver.
  * Other uses may appear later.
  */
-int * hardsect_size[MAX_BLKDEV] = { NULL, NULL, };
+int * hardsect_size[MAX_BLKDEV];
 
 /*
  * The following tunes the read-ahead algorithm in mm/filemap.c
  */
-int * max_readahead[MAX_BLKDEV] = { NULL, NULL, };
+int * max_readahead[MAX_BLKDEV];
 
 /*
  * Max number of sectors per request
  */
-int * max_sectors[MAX_BLKDEV] = { NULL, NULL, };
+int * max_sectors[MAX_BLKDEV];
 
 static inline int get_max_sectors(kdev_t dev)
 {
@@ -140,6 +149,18 @@
 	return &blk_dev[major].request_queue;
 }
 
+static inline int get_request_latency(elevator_t * elevator, int rw)
+{
+	int latency;
+
+	if (rw != READ)
+		latency = elevator->write_latency;
+	else
+		latency = elevator->read_latency;
+
+	return latency;
+}
+
 void blk_cleanup_queue(request_queue_t * q)
 {
 	memset(q, 0, sizeof(*q));
@@ -201,6 +222,10 @@
 	 */
 	q->use_plug		= 1;
 	q->head_active		= 1;
+
+	q->elevator.read_latency = ELEVATOR_READ_LATENCY;
+	q->elevator.write_latency = ELEVATOR_WRITE_LATENCY;
+	q->elevator.max_bomb_segments = ELEVATOR_MAX_BOMB_SEGMENTS;
 }
 
 /*
@@ -374,6 +399,89 @@
 		printk(KERN_ERR "drive_stat_acct: cmd not R/W?\n");
 }
 
+static inline int seek_to_not_starving_chunk(struct request ** req, int * lat)
+{
+	struct request * tmp = *req;
+	int found = 0, pos = 0;
+	int last_pos = 0, __lat = *lat;
+
+	do {
+		if (tmp->elevator_latency <= 0)
+		{
+			*req = tmp;
+			found = 1;
+			last_pos = pos;
+			if (last_pos >= __lat)
+				break;
+		}
+		pos += tmp->nr_segments;
+	} while ((tmp = tmp->next));
+	*lat -= last_pos;
+
+	return found;
+}
+
+#define elevator_starve_rest_of_queue(req)			\
+do {								\
+	struct request * tmp = (req);				\
+	for ((tmp) = (tmp)->next; (tmp); (tmp) = (tmp)->next)	\
+		(tmp)->elevator_latency--;			\
+} while (0)
+
+static inline void elevator_queue(struct request * req,
+				  struct request * tmp,
+				  int latency,
+				  request_queue_t * q)
+{
+	struct request * head;
+	int starving;
+
+	starving = seek_to_not_starving_chunk(&tmp, &latency);
+	head = tmp;
+
+	for (;; tmp = tmp->next)
+	{
+		if ((latency -= tmp->nr_segments) <= 0)
+		{
+			tmp = head;
+
+			if (starving)
+				break;
+
+			if (q->head_active && !q->plugged)
+				break;
+
+			req->next = tmp;
+			q->current_request = req;
+			goto after_link;
+		}
+
+		if (!tmp->next)
+			break;
+
+		{
+			const int after_current = IN_ORDER(tmp,req);
+			const int before_next = IN_ORDER(req,tmp->next);
+
+			if (!IN_ORDER(tmp,tmp->next)) {
+				if (after_current || before_next)
+					break;
+			} else {
+				if (after_current && before_next)
+					break;
+			}
+		}
+	}
+
+	req->next = tmp->next;
+	tmp->next = req;
+
+ after_link:
+	req->elevator_latency = latency;
+
+	elevator_starve_rest_of_queue(req);
+}
+
 /*
  * add-request adds a request to the linked list.
  * It disables interrupts (aquires the request spinlock) so that it can muck
@@ -389,9 +497,11 @@
 	int major = MAJOR(req->rq_dev);
 	struct request * tmp;
 	unsigned long flags;
+	int latency;
 
 	drive_stat_acct(req, req->nr_sectors, 1);
-	req->next = NULL;
+
+	latency = get_request_latency(&q->elevator, req->cmd);
 
 	/*
 	 * We use the goto to reduce locking complexity
@@ -399,23 +509,12 @@
 	spin_lock_irqsave(&io_request_lock,flags);
 
 	if (!(tmp = q->current_request)) {
+		req->next = NULL;
+		req->elevator_latency = latency;
 		q->current_request = req;
 		goto out;
 	}
-	for ( ; tmp->next ; tmp = tmp->next) {
-		const int after_current = IN_ORDER(tmp,req);
-		const int before_next = IN_ORDER(req,tmp->next);
-
-		if (!IN_ORDER(tmp,tmp->next)) {
-			if (after_current || before_next)
-				break;
-		} else {
-			if (after_current && before_next)
-				break;
-		}
-	}
-	req->next = tmp->next;
-	tmp->next = req;
+	elevator_queue(req, tmp, latency, q);
 
 	/*
 	 * FIXME(eric) I don't understand why there is a need for this
@@ -443,7 +542,8 @@
  */
 static inline void attempt_merge (request_queue_t * q,
 				  struct request *req, 
-				  int max_sectors)
+				  int max_sectors,
+				  int max_bomb_segments)
 {
 	struct request *next = req->next;
 
@@ -453,6 +553,8 @@
 		return;
 	if (next->sem || req->cmd != next->cmd || req->rq_dev != next->rq_dev || req->nr_sectors + next->nr_sectors > max_sectors)
 		return;
+	if (req->nr_segments + next->nr_segments > max_bomb_segments)
+		return;
 
 	/*
 	 * If we are not allowed to merge these requests, then
@@ -463,6 +565,8 @@
 	if(!(q->merge_requests_fn)(q, req, next))
 		return;
 
+	if (next->elevator_latency < req->elevator_latency)
+		req->elevator_latency = next->elevator_latency;
 	req->bhtail->b_reqnext = next->bh;
 	req->bhtail = next->bhtail;
 	req->nr_sectors += next->nr_sectors;
@@ -471,23 +575,35 @@
 	wake_up (&wait_for_request);
 }
 
+#define read_pendings(req)			\
+({						\
+	int __ret = 0;				\
+	struct request * tmp = (req);		\
+	do {					\
+		if (tmp->cmd == READ)		\
+		{				\
+			__ret = 1;		\
+			break;			\
+		}				\
+		tmp = tmp->next;		\
+	} while (tmp);				\
+	__ret;					\
+})
+
 static void __make_request(request_queue_t * q,
 			   int major,
 			   int rw, 
 			   struct buffer_head * bh)
 {
 	unsigned int sector, count;
-	struct request * req;
-	int rw_ahead, max_req, max_sectors;
+	struct request * req, * prev;
+	int rw_ahead, max_req, max_sectors, max_bomb_segments = INT_MAX;
 	unsigned long flags;
+	int latency, starving;
 
 	count = bh->b_size >> 9;
 	sector = bh->b_rsector;
 
-	/* It had better not be a new buffer by the time we see it */
-	if (buffer_new(bh))
-		BUG();
-
 	/* Only one thread can actually submit the I/O. */
 	if (test_and_set_bit(BH_Lock, &bh->b_state))
 		return;
@@ -571,6 +687,8 @@
 	 */
 	max_sectors = get_max_sectors(bh->b_rdev);
 
+	latency = get_request_latency(&q->elevator, rw);
+
 	/*
 	 * Now we acquire the request spinlock, we have to be mega careful
 	 * not to schedule or do something nonatomic
@@ -586,6 +704,10 @@
 		goto get_rq;
 	}
 
+	/* avoid write-bombs to not hurt iteractiveness of reads */
+	if (rw != READ && read_pendings(req))
+		max_bomb_segments = q->elevator.max_bomb_segments;
+
 	if (q->head_active && !q->plugged) {
 		/*
 		 * The scsi disk and cdrom drivers completely remove the request
@@ -599,8 +721,11 @@
 		 */
 		if ((req = req->next) == NULL)
 			goto get_rq;
+		latency -= req->nr_segments;
 	}
 
+	starving = seek_to_not_starving_chunk(&req, &latency);
+	prev = NULL;
 	do {
 		if (req->sem)
 			continue;
@@ -610,8 +735,12 @@
 			continue;
 		if (req->rq_dev != bh->b_rdev)
 			continue;
+		if (req->nr_segments > max_bomb_segments)
+				continue;
 		/* Can we add it to the end of this request? */
 		if (req->sector + req->nr_sectors == sector) {
+			if (latency - req->nr_segments < 0)
+				break;
 			/*
 			 * The merge_fn is a more advanced way
 			 * of accomplishing the same task.  Instead
@@ -630,10 +759,18 @@
 			req->bhtail = bh;
 		    	req->nr_sectors += count;
 			drive_stat_acct(req, count, 0);
+
+			/* latency stuff */
+			if ((latency -= req->nr_segments) < req->elevator_latency)
+				req->elevator_latency = latency;
+			elevator_starve_rest_of_queue(req);
+
 			/* Can we now merge this req with the next? */
-			attempt_merge(q, req, max_sectors);
+			attempt_merge(q, req, max_sectors, max_bomb_segments);
 		/* or to the beginning? */
 		} else if (req->sector - count == sector) {
+			if (!prev && starving)
+				continue;
 			/*
 			 * The merge_fn is a more advanced way
 			 * of accomplishing the same task.  Instead
@@ -655,13 +792,22 @@
 		    	req->sector = sector;
 		    	req->nr_sectors += count;
 			drive_stat_acct(req, count, 0);
+
+			/* latency stuff */
+			if (latency < --req->elevator_latency)
+				req->elevator_latency = latency;
+			elevator_starve_rest_of_queue(req);
+
+			if (prev)
+				attempt_merge(q, prev, max_sectors, max_bomb_segments);
 		} else
 			continue;
 
 		spin_unlock_irqrestore(&io_request_lock,flags);
 	    	return;
 
-	} while ((req = req->next) != NULL);
+	} while (prev = req,
+		 (latency -= req->nr_segments) >= 0 && (req = req->next) != NULL);
 
 /* find an unused request. */
 get_rq:
@@ -688,7 +834,6 @@
 	req->sem = NULL;
 	req->bh = bh;
 	req->bhtail = bh;
-	req->next = NULL;
 	add_request(q, req);
 	return;
 
@@ -701,7 +846,7 @@
 	request_queue_t * q;
 	unsigned long flags;
 	
-	q = get_queue(bh->b_dev);
+	q = get_queue(bh->b_rdev);
 
 	__make_request(q, major, rw, bh);
 
@@ -751,13 +896,34 @@
 			       correct_size, bh[i]->b_size);
 			goto sorry;
 		}
-
-		/* Md remaps blocks now */
+		/* LVM and MD remap blocks now */
+#if defined CONFIG_BLK_DEV_LVM || defined CONFIG_BLK_DEV_LVM_MODULE
+		major = MAJOR(bh[i]->b_dev);
+		if (major == LVM_BLK_MAJOR) {
+			if (lvm_map_ptr == NULL) {
+				printk(KERN_ERR
+				     "Bad lvm_map_ptr in ll_rw_block\n");
+				goto sorry;
+			}
+			if ((lvm_map_ptr) (bh[i], rw) != 0) {
+				printk(KERN_ERR
+				       "Bad lvm_map in ll_rw_block\n");
+				goto sorry;
+			}
+			/* remap major too ... */
+			major = MAJOR(bh[i]->b_rdev);
+		} else {
+			bh[i]->b_rdev = bh[i]->b_dev;
+			bh[i]->b_rsector = bh[i]->b_blocknr * (bh[i]->b_size >> 9);
+		}
+#else
 		bh[i]->b_rdev = bh[i]->b_dev;
 		bh[i]->b_rsector=bh[i]->b_blocknr*(bh[i]->b_size >> 9);
+#endif
 #ifdef CONFIG_BLK_DEV_MD
 		if (major==MD_MAJOR &&
-		    md_map (MINOR(bh[i]->b_dev), &bh[i]->b_rdev,
+		    /* changed             v   to allow LVM to remap */
+		    md_map (MINOR(bh[i]->b_rdev), &bh[i]->b_rdev,
 			    &bh[i]->b_rsector, bh[i]->b_size >> 9)) {
 		        printk (KERN_ERR
 				"Bad md_map in ll_rw_block\n");
@@ -774,21 +940,27 @@
 
 	for (i = 0; i < nr; i++) {
 		set_bit(BH_Req, &bh[i]->b_state);
+#if defined CONFIG_BLK_DEV_LVM || defined CONFIG_BLK_DEV_LVM_MODULE
+		if (MAJOR(bh[i]->b_dev) == LVM_BLK_MAJOR)
+		{
+			make_request(MAJOR(bh[i]->b_rdev), rw, bh[i]);
+			continue;
+		}
+#endif
 #ifdef CONFIG_BLK_DEV_MD
 		if (MAJOR(bh[i]->b_dev) == MD_MAJOR) {
-			md_make_request(MINOR (bh[i]->b_dev), rw, bh[i]);
+			/* remap device for MD too      v */
+			md_make_request(MINOR (bh[i]->b_rdev), rw, bh[i]);
 			continue;
 		}
 #endif
 		__make_request(q, MAJOR(bh[i]->b_rdev), rw, bh[i]);
-	}
 
-	spin_lock_irqsave(&io_request_lock,flags);
-	if( !q->plugged )
-	{
-		(q->request_fn)(q);
+		spin_lock_irqsave(&io_request_lock,flags);
+		if(!q->plugged)
+			(q->request_fn)(q);
+		spin_unlock_irqrestore(&io_request_lock,flags);
 	}
-	spin_unlock_irqrestore(&io_request_lock,flags);
 	return;
 
       sorry:
@@ -869,7 +1041,6 @@
 	req = all_requests + NR_REQUEST;
 	while (--req >= all_requests) {
 		req->rq_status = RQ_INACTIVE;
-		req->next = NULL;
 	}
 	memset(ro_bits,0,sizeof(ro_bits));
 	memset(max_readahead, 0, sizeof(max_readahead));
@@ -960,6 +1131,9 @@
 #ifdef CONFIG_SJCD
 	sjcd_init();
 #endif CONFIG_SJCD
+#ifdef CONFIG_BLK_DEV_LVM
+	lvm_init();
+#endif
 #ifdef CONFIG_BLK_DEV_MD
 	md_init();
 #endif CONFIG_BLK_DEV_MD
@@ -981,3 +1155,4 @@
 EXPORT_SYMBOL(blk_init_queue);
 EXPORT_SYMBOL(blk_cleanup_queue);
 EXPORT_SYMBOL(blk_queue_headactive);
+EXPORT_SYMBOL(blk_queue_pluggable);
diff -urN 2.3.42/drivers/block/lvm-snap.c 2.3.42aa3/drivers/block/lvm-snap.c
--- 2.3.42/drivers/block/lvm-snap.c	Thu Jan  1 01:00:00 1970
+++ 2.3.42aa3/drivers/block/lvm-snap.c	Wed Feb  9 03:48:26 2000
@@ -0,0 +1,414 @@
+/* linux/drivers/block/lvm-snap.c
+
+   Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
+  
+   LVM snapshotting */
+
+#include <linux/lvm.h>
+#include <linux/kernel.h>
+#include <linux/vmalloc.h>
+#include <linux/blkdev.h>
+#include <linux/smp_lock.h>
+
+
+extern const char *const lvm_name;
+extern int lvm_blocksizes[];
+
+void lvm_snapshot_release(lv_t *);
+
+#define hashfn(dev,block,mask,chunk_size) \
+	((HASHDEV(dev)^((block)/(chunk_size))) & (mask))
+
+static inline lv_block_exception_t *
+lvm_find_exception_table(kdev_t org_dev, unsigned long org_start, lv_t * lv)
+{
+	struct list_head * hash_table = lv->lv_snapshot_hash_table, * next;
+	unsigned long mask = lv->lv_snapshot_hash_mask;
+	int chunk_size = lv->lv_chunk_size;
+	lv_block_exception_t * ret;
+	int i = 0;
+
+	hash_table = &hash_table[hashfn(org_dev, org_start, mask, chunk_size)];
+	ret = NULL;
+	for (next = hash_table->next; next != hash_table; next = next->next)
+	{
+		lv_block_exception_t * exception;
+
+		exception = list_entry(next, lv_block_exception_t, hash);
+		if (exception->rsector_org == org_start &&
+		    exception->rdev_org == org_dev)
+		{
+			if (i)
+			{
+				/* fun, isn't it? :) */
+				list_del(next);
+				list_add(next, hash_table);
+			}
+			ret = exception;
+			break;
+		}
+		i++;
+	}
+	return ret;
+}
+
+static inline void lvm_hash_link(lv_block_exception_t * exception,
+				 kdev_t org_dev, unsigned long org_start,
+				 lv_t * lv)
+{
+	struct list_head * hash_table = lv->lv_snapshot_hash_table;
+	unsigned long mask = lv->lv_snapshot_hash_mask;
+	int chunk_size = lv->lv_chunk_size;
+
+	hash_table = &hash_table[hashfn(org_dev, org_start, mask, chunk_size)];
+	list_add(&exception->hash, hash_table);
+}
+
+int lvm_snapshot_remap_block(kdev_t * org_dev, unsigned long * org_sector,
+			     unsigned long pe_start, lv_t * lv)
+{
+	int ret;
+	unsigned long pe_off, pe_adjustment, __org_start;
+	kdev_t __org_dev;
+	int chunk_size = lv->lv_chunk_size;
+	lv_block_exception_t * exception;
+
+	pe_off = pe_start % chunk_size;
+	pe_adjustment = (*org_sector-pe_off) % chunk_size;
+	__org_start = *org_sector - pe_adjustment;
+	__org_dev = *org_dev;
+
+	ret = 0;
+	exception = lvm_find_exception_table(__org_dev, __org_start, lv);
+	if (exception)
+	{
+		*org_dev = exception->rdev_new;
+		*org_sector = exception->rsector_new + pe_adjustment;
+		ret = 1;
+	}
+	return ret;
+}
+
+static void lvm_drop_snapshot(lv_t * lv_snap, const char * reason)
+{
+	kdev_t last_dev;
+	int i;
+
+	/* no exception storage space available for this snapshot
+	   or error on this snapshot --> release it */
+	invalidate_buffers(lv_snap->lv_dev);
+
+	for (i = last_dev = 0; i < lv_snap->lv_remap_ptr; i++) {
+		if ( lv_snap->lv_block_exception[i].rdev_new != last_dev) {
+			last_dev = lv_snap->lv_block_exception[i].rdev_new;
+			invalidate_buffers(last_dev);
+		}
+	}
+
+	lvm_snapshot_release(lv_snap);
+
+	printk(KERN_INFO
+	       "%s -- giving up to snapshot %s on %s due %s\n",
+	       lvm_name, lv_snap->lv_snapshot_org->lv_name, lv_snap->lv_name,
+	       reason);
+}
+
+static inline void lvm_snapshot_prepare_blocks(unsigned long * blocks,
+					       unsigned long start,
+					       int nr_sectors,
+					       int blocksize)
+{
+	int i, sectors_per_block, nr_blocks;
+
+	sectors_per_block = blocksize >> 9;
+	nr_blocks = nr_sectors / sectors_per_block;
+	start /= sectors_per_block;
+
+	for (i = 0; i < nr_blocks; i++)
+		blocks[i] = start++;
+}
+
+static inline int get_blksize(kdev_t dev)
+{
+	int correct_size = BLOCK_SIZE, i, major;
+
+	major = MAJOR(dev);
+	if (blksize_size[major])
+	{
+		i = blksize_size[major][MINOR(dev)];
+		if (i)
+			correct_size = i;
+	}
+	return correct_size;
+}
+
+#ifdef DEBUG_SNAPSHOT
+static inline void invalidate_snap_cache(unsigned long start, unsigned long nr,
+					 kdev_t dev)
+{
+	struct buffer_head * bh;
+	int sectors_per_block, i, blksize, minor;
+
+	minor = MINOR(dev);
+	blksize = lvm_blocksizes[minor];
+	sectors_per_block = blksize >> 9;
+	nr /= sectors_per_block;
+	start /= sectors_per_block;
+
+	for (i = 0; i < nr; i++)
+	{
+		bh = get_hash_table(dev, start++, blksize);
+		if (bh)
+			bforget(bh);
+	}
+}
+#endif
+
+/*
+ * copy on write handler for one snapshot logical volume
+ *
+ * read the original blocks and store it/them on the new one(s).
+ * if there is no exception storage space free any longer --> release snapshot.
+ *
+ * this routine gets called for each _first_ write to a physical chunk.
+ */
+int lvm_snapshot_COW(kdev_t org_phys_dev,
+		     unsigned long org_phys_sector,
+		     unsigned long org_pe_start,
+		     unsigned long org_virt_sector,
+		     lv_t * lv_snap)
+{
+	const char * reason;
+	unsigned long org_start, snap_start, snap_phys_dev, virt_start, pe_off;
+	int idx = lv_snap->lv_remap_ptr, chunk_size = lv_snap->lv_chunk_size;
+	struct kiobuf * iobuf;
+	unsigned long blocks[KIO_MAX_SECTORS];
+	int blksize_snap, blksize_org, min_blksize, max_blksize;
+	int max_sectors, nr_sectors;
+
+	/* check if we are out of snapshot space */
+	if (idx >= lv_snap->lv_remap_end)
+		goto fail_out_of_space;
+
+	/* calculate physical boundaries of source chunk */
+	pe_off = org_pe_start % chunk_size;
+	org_start = org_phys_sector - ((org_phys_sector-pe_off) % chunk_size);
+	virt_start = org_virt_sector - (org_phys_sector - org_start);
+
+	/* calculate physical boundaries of destination chunk */
+	snap_phys_dev = lv_snap->lv_block_exception[idx].rdev_new;
+	snap_start = lv_snap->lv_block_exception[idx].rsector_new;
+
+#ifdef DEBUG_SNAPSHOT
+	printk(KERN_INFO
+	       "%s -- COW: "
+	       "org %02d:%02d faulting %lu start %lu, "
+	       "snap %02d:%02d start %lu, "
+	       "size %d, pe_start %lu pe_off %lu, virt_sec %lu\n",
+	       lvm_name,
+	       MAJOR(org_phys_dev), MINOR(org_phys_dev), org_phys_sector,
+	       org_start,
+	       MAJOR(snap_phys_dev), MINOR(snap_phys_dev), snap_start,
+	       chunk_size,
+	       org_pe_start, pe_off,
+	       org_virt_sector);
+#endif
+
+	iobuf = lv_snap->lv_iobuf;
+
+	blksize_org = get_blksize(org_phys_dev);
+	blksize_snap = get_blksize(snap_phys_dev);
+	max_blksize = max(blksize_org, blksize_snap);
+	min_blksize = min(blksize_org, blksize_snap);
+	max_sectors = KIO_MAX_SECTORS * (min_blksize>>9);
+
+	if (chunk_size % (max_blksize>>9))
+		goto fail_blksize;
+
+	while (chunk_size)
+	{
+		nr_sectors = min(chunk_size, max_sectors);
+		chunk_size -= nr_sectors;
+
+		iobuf->length = nr_sectors << 9;
+
+		lvm_snapshot_prepare_blocks(blocks, org_start,
+					    nr_sectors, blksize_org);
+		if (brw_kiovec(READ, 1, &iobuf, org_phys_dev,
+			       blocks, blksize_org) != (nr_sectors<<9))
+			goto fail_raw_read;
+
+		lvm_snapshot_prepare_blocks(blocks, snap_start,
+					    nr_sectors, blksize_snap);
+		if (brw_kiovec(WRITE, 1, &iobuf, snap_phys_dev,
+			       blocks, blksize_snap) != (nr_sectors<<9))
+			goto fail_raw_write;
+	}
+
+#ifdef DEBUG_SNAPSHOT
+	/* invalidate the logcial snapshot buffer cache */
+	invalidate_snap_cache(virt_start, lv_snap->lv_chunk_size,
+			      lv_snap->lv_dev);
+#endif
+
+	/* the original chunk is now stored on the snapshot volume
+	   so update the execption table */
+	lv_snap->lv_block_exception[idx].rdev_org = org_phys_dev;
+	lv_snap->lv_block_exception[idx].rsector_org = org_start;
+	lvm_hash_link(lv_snap->lv_block_exception + idx,
+		      org_phys_dev, org_start, lv_snap);
+	lv_snap->lv_remap_ptr = idx + 1;
+	return 0;
+
+	/* slow path */
+ out:
+	lvm_drop_snapshot(lv_snap, reason);
+	return 1;
+
+ fail_out_of_space:
+	reason = "out of space";
+	goto out;
+ fail_raw_read:
+	reason = "read error";
+	goto out;
+ fail_raw_write:
+	reason = "write error";
+	goto out;
+ fail_blksize:
+	reason = "blocksize error";
+	goto out;
+}
+
+static int lvm_snapshot_alloc_iobuf_pages(struct kiobuf * iobuf, int sectors)
+{
+	int bytes, nr_pages, err, i;
+
+	bytes = sectors << 9;
+	nr_pages = (bytes + ~PAGE_MASK) >> PAGE_SHIFT;
+	err = expand_kiobuf(iobuf, nr_pages);
+	if (err)
+		goto out;
+
+	err = -ENOMEM;
+	iobuf->locked = 1;
+	iobuf->nr_pages = 0;
+	for (i = 0; i < nr_pages; i++)
+	{
+		struct page * page;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27)
+		page = alloc_page(GFP_KERNEL);
+		if (!page)
+			goto out;
+#else
+		{
+			unsigned long addr = __get_free_page(GFP_USER);
+			if (!addr)
+				goto out;
+			iobuf->pagelist[i] = addr;
+			page = mem_map + MAP_NR(addr);
+		}
+#endif
+
+		iobuf->maplist[i] = page;
+		/* the only point to lock the page here is to be allowed
+		   to share unmap_kiobuf() in the fail-path */
+#ifndef LockPage
+#define LockPage(map) set_bit(PG_locked, &(map)->flags)
+#endif
+		LockPage(page);
+		iobuf->nr_pages++;
+	}
+	iobuf->offset = 0;
+
+	err = 0;
+ out:
+	return err;
+}
+
+static int calc_max_buckets(void)
+{
+	unsigned long mem;
+
+	mem = num_physpages << PAGE_SHIFT;
+	mem /= 100;
+	mem *= 2;
+	mem /= sizeof(struct list_head);
+
+	return mem;
+}
+
+static int lvm_snapshot_alloc_hash_table(lv_t * lv)
+{
+	int err;
+	unsigned long buckets, max_buckets, size;
+	struct list_head * hash;
+
+	buckets = lv->lv_remap_end;
+	max_buckets = calc_max_buckets();
+	buckets = min(buckets, max_buckets);
+	while (buckets & (buckets-1))
+		buckets &= (buckets-1);
+
+	size = buckets * sizeof(struct list_head);
+
+	err = -ENOMEM;
+	hash = vmalloc(size);
+	lv->lv_snapshot_hash_table = hash;
+
+	if (!hash)
+		goto out;
+
+	lv->lv_snapshot_hash_mask = buckets-1;
+	while (buckets--)
+		INIT_LIST_HEAD(hash+buckets);
+	err = 0;
+ out:
+	return err;
+}
+
+int lvm_snapshot_alloc(lv_t * lv_snap)
+{
+	int err, blocksize, max_sectors;
+
+	err = alloc_kiovec(1, &lv_snap->lv_iobuf);
+	if (err)
+		goto out;
+
+	blocksize = lvm_blocksizes[MINOR(lv_snap->lv_dev)];
+	max_sectors = KIO_MAX_SECTORS << (PAGE_SHIFT-9);
+
+	err = lvm_snapshot_alloc_iobuf_pages(lv_snap->lv_iobuf, max_sectors);
+	if (err)
+		goto out_free_kiovec;
+
+	err = lvm_snapshot_alloc_hash_table(lv_snap);
+	if (err)
+		goto out_free_kiovec;
+ out:
+	return err;
+
+ out_free_kiovec:
+	unmap_kiobuf(lv_snap->lv_iobuf);
+	free_kiovec(1, &lv_snap->lv_iobuf);
+	goto out;
+}
+
+void lvm_snapshot_release(lv_t * lv)
+{
+	if (lv->lv_block_exception)
+	{
+		vfree(lv->lv_block_exception);
+		lv->lv_block_exception = NULL;
+	}
+	if (lv->lv_snapshot_hash_table)
+	{
+		vfree(lv->lv_snapshot_hash_table);
+		lv->lv_snapshot_hash_table = NULL;
+	}
+	if (lv->lv_iobuf)
+	{
+		free_kiovec(1, &lv->lv_iobuf);
+		lv->lv_iobuf = NULL;
+	}
+}
diff -urN 2.3.42/drivers/block/lvm.c 2.3.42aa3/drivers/block/lvm.c
--- 2.3.42/drivers/block/lvm.c	Thu Jan  1 01:00:00 1970
+++ 2.3.42aa3/drivers/block/lvm.c	Wed Feb  9 03:48:26 2000
@@ -0,0 +1,2579 @@
+/*
+ * kernel/lvm.c
+ *
+ * Copyright (C) 1997 - 2000  Heinz Mauelshagen, Germany
+ *
+ * February-November 1997
+ * April-May,July-August,November 1998
+ * January-March,May,July,September,October 1999
+ *
+ *
+ * LVM driver is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ * 
+ * LVM driver is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU CC; see the file C6 2000  Heinz Mauelshagen, Germany
+ *
+ * FebruaryE+		vfree(lveiebruaryE+		vsl,
+ *  ANY WARRANTY; ogen, Germany
	}ddr);
+		}
+#e}
+#e}
+j1t page any
+ *
+ * Febman00:00 1WARR]ctors;
 FebMa copy onap.c, org_phys_dev,
+			the GNU General Pu_m1+		gize;
+	struct list_head * has
+	       "snap %02d:%02d start %lu, "
+	       "size %d, pe_start %lu pe_off %lu, virt_sec %lu\n",
+	       lvm_name,
+	       MAJOR(org_phys_dev), MINOR(org_phys_dev), org_phys_sector,
+	       org_start,
+	       MAJOR(snap_phys_dev), MINOR(snap_phys_dev)lly.
+	
+		t,
+	  diyhturn;
 
 y %NOR(snap_phys_dr tha* LVart c_table(lv_sr sizeof(struct list_hpage;
+
+#if LINUX_VERSION_CODE >= KERNEL_nr_ba3/drivers/block/lvm.c
--- 2.3.42/drivers/blockct_of_qTisize_seb Qffer_head * ber_head * ber_head * ber_head * ber_head * ber_head * ber_head * ber_head * ber_head * ber_head * ber_head * +	unsigned long mask =ts)
n err;
+}
+
+static int calc_max_buckets(vog maskdoeTspace:-calc_max_buckets(vog maslc_max_buckets(vog maslc_max_buck.6uyOiT,
 				      sizeof(frame->ve_org sizeof(frame->ve_org sizeof(frame->ve_org sizeof(frt(frame->ve_org sizeof(I_org)_kiovec 935buc5  9 0Nuct list_hpage;
oblv_snap->lv_iobuf);c_max_buc_ofTestination x_b,
 			P[i]->b_dev) == LVM_Bcan act pshot_a+	       chunk_gen, *	May,Juled 6r_head * ber_head * ber_he	May,Juled 6r_head * 2->b_rdeblock(f CONFIG_BLK_DEV_LVM
+	lv February-No(de_next)
+					blK_DEV_LVMw
+ *
+ * Febr_next)
+	0      chunk_gen, *n);
+}
+
+static inline void lvm_snapshot_prepare_blocks(unsigned long * blocks,
+				urn;
 
 y %NOR(snap_phys_dr tha* LV471,23 +u7 = exceptioNuct g mask =ts)
n err; Baev)tC)
+	{
+		vfree(l L* ibe unmap_k thee_k tiT,Qaev)t, &lv->lv_iobub  9 [	goto out_free_kiovec;
+ out:
e Foi{
+		fblocks,
++	err = l{
+	if %Oo+rRIFrw, bhs, pe_admAuc_ofTestination x_b,
 			P[i]->b_dev) ==Hc_ofTestinatiut:
e Foi3.42aa3/arch/i386/kerner6/kernuf = NULJuled 6--reqoge_fn is ,* berGermany
+ *
+ * F V==Hc_ofTestinrch/ieuGrg siz-le->ve_oout:
e Foi{
r tha* LV471,23 +u7 = exceptioNuMerGedeblock(f COz-le->er_hesM_hea@
 	waked * ber_hn x_b,Gedeb_hn x_b,Gedeb_hn x_b,Geys_dev use the_phys_	lie_phy_rd_Gedhn x_b,software; you ca	 t_of_e[i]->b_rdev,
+		    /* changed             v   t/i386/kerneri_	lie_phy_rd_Gedhn x_b,softw3ou c-  	req->sectorsizeIFoi{
r tev->lv_iobuf);
+e it a mask =,=Hc_ofTestinrch/ieuGrrt,
+	 =if (last_pos >= __laP rw)t * lv)iev;
 		bh[i]uf);
vember 1998
+ _dr tha*= lvm_snapshot_allo_ lv)iev;
;l6st blksize_snap	      v   t/i386/kerneri_	lillnk_size = lv->lvo x_b,GedlHc_of*
+ _onize_irq();
+
 	/*
-	 * first, enable   "sifirst, enables5e_Se, enable   "sifirst, erg, blksizest_head * hash;
+
+	bed, use hy_rd_G  /* 0p 	/*
-	 eb  9 03:48:26nhy_8-e_oout:  v   t/i386/kernerh[i]->b,
 	>lv_iobuf 5NOR ai386/kernerh[i]->b,
 	>lvap_ /* 0P
+
+#if LINUace.  ->lvo x>ele, enable  clle ((tmp = tmp->n;l6s46,7er_head * ber_head * ber_head * ber_head * ber_head * ber_head * ber_head * sc, &frame->fpslaceouh_table)
+	{
+		vfree(l>9le();
+		m_hash_lir_head * /laceouh_tizelvm_snapshot_alloc(lv_t * lvPLock/lvc
 	>;4g * b enreahead * sc, &frame->  t/i_alloc(lv_v {
-	use thsg * boaceouh	er	lillnk_size = lv->lvo[_aceouh	er	l i oaceouh	er	lillnk_M		 (latenClist_ene(l>ignedr_head * ber_head, 1, &i	Irion,+_2head, 1, &i	Irion,+4	l i ordr thwk.h>
+
+
+extern const cher(&fra-reqogeDber_headion);
+		u_ed, use hy_rd_G  /* 0p 	/*
atencyt, snap_phys_dev, virt_start, p.42a
+		vfrx(/blo(v_t * lv)
+{;505,8"ys_dev, * ber_herx(/blo(lvm_find_excp 	/[OiT,
 ;
+}
+wbuckets =snap-p#t_size;
+}
+
+#ifdef DE_t *);
+
+#definu+			 */uBLK_DEV_NBD
diff = NULL;
++[OiTc, V_NBD
diff = NULL;
rdev, viap-p#t, V_NBD
diff = NULL;
rdev, via(rs)
+8"ys_dev, * bUace  Mvec = NULL;
rdev, via(rs)
+8"ys_dev, * ock_exception d_size;
+}
+
	atic void _nh	er	V_N1  Mvec =4b_sizeg * b enreahead * sc, &frmp->n;l6s46,7er_head * be9/laceouh_tizelv b enreahid _nh	 b enreahidw"ist_hpagec;l6s46,7er_heDk.h>) 2000hys_dr
+	   tarOd, 1, &eahidd * haapy on write handlerf+ad * sc, &frmp->n;l6,7er_heDk.h>) 2000hy
e Foi{
r tha* LV471,23 +u7o ap.c, or
+	3 2000hysned long x_b,Phaapyl
+    or er _headef DE	l i oactSil
+this r update t_snaps - pe_adjust1DME.lvm
--- 2.3.42/driwR/(nu+			 */uBLK_DEV_NBDfd;
 Fe3 +u7 3vm_sed l0.tor_org == org free_kioveyson  Mvec4b_s,Juled 6r_head * 2->b_rdeblock(f CONFIG_BLK_DEV_LVM
+	lv February-No(deob_he	May,M   er_h_HEAD(hash+bucketa(rs)
+8"ys_dev, * oso(deob_he	
+
+	q->t2e_DEV_LV
+in:_t * lv)
+L
+8"yshys_dr
+doieblock(f CONFIG_BLK_DEV_LVM
+		E	buckets = min(bucketss/y = gegoto r < reqdonize_ir = geen
+  boo_Hry that m)1_dev)];
+	max_sectrame->ve_org sizeof(I_org)_kiovNIize = lv->lvo[ lv)
+L
+8"cll*ir = geen
+ cep386/kernerh[i]%/* no  ->lv+rq(ev)tCdonizeead * ber_he	May,Julp386/kernerh[i]%/*k_e);
+EXPORd * ber_head _sector - oLV
Stion d_size;naps eoecifiyer_head * ber	a2rdev, via(rs)
+8"y(&tmp, lv->alloc(lv_t * lvPLock/lvc
 	>;4g * b enreahead sned long *  LV471,23 +u7 int s = mmax_sectors|stinrch/ sned lph_tableslacral Public License as  o ex_bl_hn x_b,G6NBD
d(,
e Foi{
+		fblocks,
++	err = l{
+	if %Oo+rRIFrw, bhs, pe_admAuc_ofTestination x_b,
 			P[i]->b_dev) ==Hc_ofTestinatiut:
e Foi3.42aa3/arch/i386/kerner6/kernuf = NULJuled 6--reqoge_fn is ,* berGermany
+ *
+ * F V==Hc_ofTestinrch/ieuGrg siz-le->ve_oout:
e Foi{
Testinatiut:
e Foi3.42aa3/arc NULL;
rdev1,
+	h+han endle*u; uest *ne3/arc NULL;
rdev1,
+	h+haps eoecifiyer_headpace available for this snapshot
+	  u/lloc(lv_t * lve ot_a intmax_sectorufiyer_headpace availa V==[OiT,
 ;
+}
+wbuckets =snap-p#t_size;
+}
+
+#ifsh+bucketa(rs)
+8"ysea(rs)wbucke ber_h berust1DMEr r update t_snaps - ed long x_b,PhEthEthEthintma 6r_head x_b,1r the tin_unlock_irqrestore(&fblocks,
++	erf %Oo+rRm_se_unlocmon[i * berubucke ber_h berust1DMEr r update t_snaps - ed long x_b,Punlocmon[ik1,23 +u7 int snuMerr_hcyt, snFoi3.4r_herx(/blo(lvm_focks; /i386/kerner6/kernuf doieblonces and_ofToreqdonize_ir = geen
+  boo_Hry that nt * lat)
+{
+	struct reat)
+opt,
igned lossct reat)
+opt,
igned losys_dei* b eidd * haapy on write=bloc+
+extEthEthintma 6r_head x_f %Oo+ps/vers/brNULL.lv
-	 * f%lu, "Bst_tx_f %la V==U}
+	retuTayvaila V==[OiT,
 ;
+}
+wbucketsre ad * s ibe un, = ge-s, = ge-s, = g[nreatx_f %la V==sline vox_b,1r the 
+		/* the only poiu
+
+#ifsh+bucketa)1_then
@@ -463,6 +565#ifsh+bu - 2.3.42/drivers/block/lsivers/block/lse}
+	retuTayvaila V==[OiT,
 ;
+}
hea] S86/kerner6/kercketa)1_th*
@@ -2O* the only poiu
+
+#ifsh+es5e_Se, enable iobuf);
+hea] S86/ke l{
+	if %,d dei* giving up t86/kerner6/kercke_fn is ,* berGermany
+ *
+ * F V==Hc_ofTestinrch/ieuGrg siz-le->ve_oout:
e Foi{
Telatpoiu
+
starving;
+	starving;
+	st tion_table(kdev_t org_dev,ap blocks now */
+#(5e_Se, enaint chuHV6su==Hc_ofTestinrch/ieuGrc,7er_heGermany
+ *
+ * FebruaryE+		vfree(lveiebruary->lv_iobuf);
+e it a mask =,=Hc_ofTestinrch/ieuGrrt,
+	 CC; see tt,
+	  * F;
+	 }uoNuct g mask =ts)
_dev, unnWei* givinh;
-	req->ne,)BdEketsre adr _heT8-	r]->b_state);
+#if definedp lise3cket-urN 2. int s = mmavR-rcke_fu
+
star tev->lv_iobuf);6Pt and,exception_t *
+lvm_find_exception_table(kdev_t org_dev, unsignedM
+		fr_o3kets =snap-p#tloc(lv_t * lvPLock/lvc
-en
+ cep386/kernerloc(lv_t * lvPLock/lvc
-en
+ cep386/k berev, unsignedM
+		fr_o3kor - oLV
Stiev, unsignedM
+		fr_o3kor - o==Hc_oev, unsignedM
+		fr_o3kets ctSev, unsignedM
+		fr_o3k != locks and store it/them ev, unsignedM
+		fr_o3k != locks and store it/ !=/them ev, unsi
+8"0n_t *
+lvm_find_excepher(&fra-re thsg * bs and stock) nt s = mmavR-rcke_fu
+lv_iobuf>lv_iobuf);6Pt and,exc/ke"0n_t *
+lpher(&fra-reTest19zelv b enre11n_t *
+lpher(&fra-reTest281_then
@@ -11n_t *
+l eidd * ;
+}
+
+#i	starfang funors);
+		chuieuGrut:
e Foi{
12n_t *
+lpher(&fra-reTest33gegoto r < r1/ bhs,+l eidd * ;st_latencn berE	l i oactSil,nt s = mmavR-rcke_fu
 * F VLV
Stion ibe or - o==Hc_o enablG  /* 0p p 	/*
-	 TODO48:26nhy_8-+lvm_find_eline vobu}
+wbuckets unnd)
+		gotpages = (t org_dev, G  /* 0p g = ori oa	lie_phy= "BD
d	lie_phy0.8ehead pe_admAuc_ofTestioi{4/1/ bhs)\n_tabg = ori oad srta	lie_phy= "	lie_phy0.8ehe{4/1/ bhs)"ntk(KERN_INFOaddr)_NR	_entry(next, (KERN_INF	DEVICE_OFF(oaceou) = 0; i < lv_snap->lck_sizesnap->lv_block_except[i]->b__excep	er	V_NMODc_ofTesSep	 oNuMe_NMODk;
+		  RN_INFOaODk;
+		  Germ	{
+			*req = tmtor.readesnap-r the ter	er	V_NMODk;
+		  +		{
+			*req = tmp;
+			p-r the ter	er; i++) {
+		if ( lv_snap->lv_block_exception[i].rdev_new != last_devnh;
__excep	eew != last_devhdrezesnap->lv_block_excepif desnap->lv_block_excepfsesnap->lv_block_excep&i	Irfsesnap->lv_block_excep) {
+			last_dev = lv_snap-(/blo(	last_dev = lv_snap-dev, 		last_dev = lv_snap->lv_block_exct_dev = lvasm/p-p#tk_exct_dev = lvasm/eq->rq_k_exct_dev = lvasm/u_NBD
d__excep	er	V_Nnt;
+	_sk =,=Der	er; i++) {
+		if ( lvd+			p-r the ter	er; i++) {
+		iprin_exct_.c
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,MD_MA	er; i++) {
+		ipripg+			p-r the ter	er; i++) {
+		ierrno(	last_dev = lv_snap-d_remap_(KERN_INF	_entCORRECT);
-		As_deva)!= next->rq_dev\
+	0   va) <rner6MIN);
-		As_de accomplva) = rner6MIN);
-		As_de;v\
+	0   va) >rner6MAX);
-		As_de accomplva) = ner6MAX);
-		As_de;		return;
  	/*
 	ERN_INF	s(lvr()	( {
+				->ui 			  = RQ{
+				->eui 			  ) 0p p 	/*
-	 Es(las= (
+	} whileroun,yp_dev, /er	er	V_NMODk;
+	nk(lvlv Februart(y GNU ;v_snap-ob_he	May,M   t(y GNU ;v_July-Aurs(last_dev);
+vlv t(y GNU ;v_Ju the ter	erc
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,M3 ) 0lksize, max_blksiummy_oaceou 
+	/* av( next))
 		retur* ;v_July-Aulksize, max_blksiummy_oaceou 
+	/* av(  GNU ;v_Ju the tfile C6 2000  He_ir = gev( st * heanta)1*, st * heonize*, uih _fueadi ;v_file C6 2000  He_ir- 2.3v( st * heanta)1*, st * heonize*d * befile C6 200 int s = mmax3v( st * heanta)1*, st * heonize*d * befile C6 200int s = +	/* inv( st * heanta)1*, st * heonize*d * file C6 2000  He_ir+	/* inv( st * heanta)1*, st * heonize*d * befile C6 200 int s =  = gev( st * heanta)1*, st * heonize*, uih _fueadi ;v_ext != hash_table; nener6PROC_FS= RQ hash_table; nePROC_FSer	erc
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,M3 ) 0lksize, 2000  H&i	Irion,+4	lt(yg = or,yg = orr,yoffize_); ( * file C6 200				\
&i	Irion,+4	lSuSE
(g = or,yg = orr,yoffize_); ( =);
+
&		\
&i	Irion,+4	l;v_July-Aulksize, 2000  H&i	Irion,+4	lt(yg = or,yg = orr,yoffize_); e_); ( * Ju the t-r the ter	er	V_Nner6HD_ berevs_per_blocbruaryE(yg = *e_); ( * Ju the tfor tes(las= (ption_tab* b en>lv_chunk_size,
+			 re it/them E(y lv_sn*_fueadi*_size)
+	{
+		n--> re*d * chunk_size,
+			      lv_sn_size)
+	{
+		n--ize)
+	{
+		n-so update the execptio--> reled * chunk_size,
+			 (lv_sr sizeo ;v_snap-ot_release(lv_snap);
+
+	printk(Kr tEbe es(las= (
+	} whileroun,yp_d /* 0p p 	/*
-	 In(las= (
+	} whileroun,yp_dev, /erlksize, max_blksvlv Fframv(  GNU ;v_rs(last_dev				\
+	for ((tmlevator_latency)
+	*e_); ( *  ter	er	V_Nner6HD_ berevrs(last max_				\
cbruaryor ((tmlg = *e_); ( * Ju the tlksize, 2000  Hned llevator_latency)
+	*e_); ( * lksize, 200 * F VLV
Sti ll); e_ max_*( * lksize, 200 * F Vossct r(_); ( * lksize, 200 * - oLV
Sti ll); e_g = or,y+
+	printklksize, 200 * - oossct r(_); e_g = or,y); ( * lksize, 200 * - o
rdev1,
+	h+h ll); e_g = or,y+
+	printklksize, max_blks(/bvlv t(yevator_)
+opt,
* next !	V_Nner60P
+INght);
+
lksize,st * heanta)1*blks(/n,+4ta)1(_); ( * tionmax_blkser	li,+4ta)1(_st * heanta)1*( * Ju the tv_iobuf;
+
>;4g * rl+		E_g = ord * ch, "
+	       "k =ts)t(yg = or,yg = or,y); ( * v_iobuf;
+
>;4g * rcmpt(yg = or,yg = or( * v_iobufg = ori oadtrrkern(yg = or,yg = oc( * r tEND In(las= (
+	} whileroun,yp_d /* 0p p 	/atx_f %la V==sdescrip i;
[OiTc
+	stars, /erlksize, g+	prvg[ABS6MAX)VGvec;]ntklksize,p
+	prpvp ocks(unsiglksize,+
+	prlvp ocks(unsiglksize,pnit()pep ocks(unsiglksize,pnit()pep1)
 		return;p 	/aned  +u7 ite=bloc+
+extEthEtto(deoibe LV 2->b_rd, /er,yp_	V_Nst * he{* tio;
+
 g+2->b_r;* tio;
+
    ->b_r;* }
 g+   +	fot;erlksize, g+   +	fot, g+   +	f[ABS6MAX)LV]turn;p 	/aRdev);
 
ut:
e Foseb  9 =snap-p#t_s), /erlksize,p, blidd * sc, &p, blidd * scntklksize,p
+flush* sc, &,p
+flush* scntklksize,p
+* b enr sc, &p, * b enr scsiglksize,pni_head sc, &,,pni_head scsiglksize,+e re it/ sc, &,+e re it/ scsiglksize,+
+ sc, &,,ctors;
+ectors;
t !	V_Nner6TOTALLock/lvclksize, 2000  HFos/n,ng *d>n;lyhturnJu the tfolksize,g = op    "o[ ber_LEN] * r tlksize,g = orootvg[ ber_LEN]nt ma0R(re, /erlksize,u;
+
   mmax3yhturndev_new;
+			invalidate_bu = ner6 ber * file C6 2000_secto0 * file C6 2000_adreq =to0 * file C6u;
+
 g+ile ((re0 * file C6lv->lint s = mmax+ile ((re0 * file C6ud srt_blksvopa	lie_phy= ner6DRIc_o_IOPHc_ofTes;xct_.c
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,MD_MAfile C6+#(5e_Se, enaint chuHV6s(_blksginnintklksize,+#(5e_Se, enaint chuHV6s(_blks it/ginnintkJuly-Aulk * heginni		retori oaginnocks(unsiglk * heginni		retori oa it/ginnocks(unsigJu the tfolksize,ng *  LV_t_blks0_sectoSPIN)b,G6NUNb,G6ED;v_ext != hash_table; nener6PROC_FS= RQ hash_table; nePROC_FSer	erc
+ *
+ * Copyright <ask =,=Hc_ofTest(y_rd3,M31_MAfile C6579 @@
+i	Irdir	major00  H&i	Irmajor0=e{* tio0rd3,Mner6 ber, S_IFREG | S_IRUGO,* tio1nt ch ch c* tios(unc* tio0  H&i	Irion,+4	lc* tios(uncos(uncos(uncos(uncos(unc* } * Ju the t-r the terfile C6579 @@
oniz mmarblockslint s = fops0=e{* 	p-p#t:1);
+
=snap-p#t-so mmax:1);
+
=snammax,_org nap);:	int s = +	/* inc* } * er	erc
+ *
+ * Copyright <ask =,=Hc_ofTes(_rd3,M38)erfile C6579 @@
oniz mmarblockslint e_irfops0=e{* 	 * lvtor);
+ock_i,_orv->lv_tor);
+ov->lv,* 	p-p#t:1);
+
e_ir = ge-so mmax:1);
+
e_ir- 2.,_org nap);:	int e_ir+	/* in,_orfsync_tor);
+ofsyncc* } * July-Aulksize,evator_l);
+ooaceou mmarblockslint e_irfops0=ion x_mmax:1);
+
e_ir- 2.,_org nap);:	int e_ir+	/* in,_orp-p#t:1);
+
e_ir = ge-so} * Ju the tfor t)
+opt,

ut:
e Fose /erlksize,evator_cbrsize %d,	\
cbrsize %[MAX)LV]tur_dev);
+		}
+	}
+
+MAX)LV]nt ma0R(ree file C6 2000  He_blkMAX)LV]nt ma0R(ree file C6evator_)
+opt,
een
+  boo_0=e{* tioaddr)_NR,+}
+
+ead * #free_k Mner6 ber,+}
+
+e_bu &frmad * ree_k M0,
+}
+
+xtEthEt    i+bucoc+
+e phyhift; eithther verion->b_lcoc+
+eree_k M1,
+}
+
+maximum ry t;
-	reon d_oaceouh.c 2.3.4
+ *
+ * Copyright <ask =,=Hc_ofTes(_rd3,M4inrchioadX)LV,+}
+
+maximum xtEthEt   >b_lcoaceouseree_k Mblks(/bvlv ,+}
+
+nh;
-aliz>> PAGEache **/
 		 weeithther do Foi3.4    cseree_Ju the tk Mblkscbrsize %,}
+
+ry t;
-	r->lv_dev)]; 	>;4g *NUX_+}
+
+oaceouh	er_hin	goto outcopi; eithther verl);
+oe_blk]ev)]; 	>adX)LV,+}
+
+xtEthEt r >b_lcoaceouseree_k Ms(unc+}
+
+nh(las= (ree_k Ms(unc+}
+
+
+	starvw */ne i)
+opt,

ut:
e (nh(las= ), /er} *  ter	er	V_NMODk;
+		/*
-	 M,M   tnh;
-aliz>> PA..nap->lv_chunvlv Februart(y GNU * July-Au	/*
-	 D changeh;
-aliz>> PA..nap->lv_	er	V_NFe3 +u7 3v
+Fe3 +u7 3vm(t_dev);
+vlv t(y GNU  * July-Aurev &&vlv t);
+vlv t(y GNU * Ju the t-r thehead	er	V_NMODk;
->lv_{);
+
lkator_)
+opt,
*)
+opt,t_free_		return; 	>;4g vlv Fframv()turn; 	>+
+nhned  _b,s)
+opt,
areq->s_heT8kernEV_Lrmad * ree_k Mblks(/bvlv t(y&een
+  boo_( * tiof) % )
+opt,t		chu!2000
@@ -0,,ctors)
+opt,t_free_)
+opt,t		ch;0,,ctors(snap_ps)
+opt,t_frt;
+	un!2000
@(dev)mmavR-rcke_fu
)
+opt,t_frt;mad * >geen
+  boo_Hmad *@ -0,,ctorsors)
+opt,t_free_)
+opt,t_frt;
+	u;0,,ctors}0,,ctorseen
+  boo_Hine int)
+opt,t_frt;
+	u;0,,ctors)
+opt,t_frt;
+	un=y&een
+  boo_;0,,ctconst char,ctors)
+opt,t		chu=y&een
+  boo_;0,,ctorseen
+  boo_Hine int		returors}0,n; 	>+
+*u; uest *f
+				printtiT,Qaevhash_tak.c ree_k Mblks out_free_blks ou; ter	er	V_Nner6HD_ berev 	>+
+*u; uest *f
+				printtiT,Qae(/blo(lvree_k Mblkscbruaryor (ee_blkscbruary;v_Ju the ter	erc
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,M3 ) 0+		govm_find_excet(y_org_dFAULnaint ct(yaddr)_NR),_blksiummy_oaceou 
+	/* a( * tio_new;
+		*org_secto(_org_dFAULnaint c(addr)_NR),_0intkJuly-Autio_newoac[addr)_NR]. = lv->lv_ee_blksiummy_oaceou 
+	/* a;Autio_newoac[addr)_NR].vNIize =
+	/* avcks(unsigJu the tfo 	>+
+oftwar= (erustroot(deDAvree_	/*
-iof) % *rootvgsnapshotticeptiongock_i_stin_p  .3.4lvv( nootvg, &vg)turors}0,/* 0p -iof) % regis+721,hunk_s(Nner6CHARnext, ,SNAPSHOT
+	&int s = fops)==MD_otticeptio* ret;
+ 	int i =page * pregis+721,hunk_s+ * eddr =SNAPSHOT
);0,,ctorsg sizeo-EIOturors}0,-iof) % regis+721) {
+	t(yaddr)_NR,SNAPSHOT
+	&int e_irfops)==MD_otticeptio* ret;
+ age * pregis+721) {
+	t+ * eddr =SNAPSHOT
);0,,ctorsf) % unregis+721,hunk_s(Nner6CHARnext, ,SNAPSHOT
)==MD_MA ption_t * ret;
+ 	int i =page * punregis+721,hunk_s+ * eddr =SNAPSHOT
);0,,ctorsg sizeo-EIOturors}0,ext != hash_table; nener6PROC_FS= RQ hash_table; nePROC_FSer	erc
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,M25_MA ptiLV
StiH&i	Ir+4	lSmajor0(Mner6 ber, S_IFREG | S_IRUGO,* tiooooooooooooooooooooooooooo&&i	Irnoot, 		\
&i	Irion,+4	lSuSE
;+		  uly-Autio
+i	Irregis+72t(y&&i	Irnoot, &0  H&i	Irmajor
;+		  u the t-r the ter_t * ret;
+ 	int 	{
+		ooooooooooooagege * p"er	er	V_NMODk;
+	ooooooooooooaM,M   "tkJuly-AutiooooooooooaD chan"e_Ju the tk Moooooooooa suNBD
dfu4,6 eh;
-alizeddr = tk Moooooooooi oa	lie_ph=SNAPSHOT
);0, tk Mut:
+	retur} +
+nh;
Februart() /t);
+vlv t() /* 0p p 	er	V_NMODk;
+		/*
-	 M,M   tob_he	M..nap->lv_snap-ob_he	May,M   t(y GNU  {);
+
lkator_)
+opt,
*)
+opt,t_free_		re,
*)
+opt,t_fr_			}
+			/* r0p -iof) % unregis+721,hunk_s(Nner6CHARnext, ,SNAPSHOT
)==MD_otticeptio* ret;
+ 	int i =page * punregis+721,hunk_s+ * eddr =SNAPSHOT
);0,,ct}p -iof) % unregis+721) {
+	t(yaddr)_NR,SNAPSHOT
)==MD_otticeptio* ret;
+ 	int i =page * punregis+721) {
+	t+ * eddr =SNAPSHOT
);0,,ct} ter	erc
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,M3 ) 0+		govm __org_start,t(y_org_dFAULnaint ct(yaddr)_NR)intkJuly-Autio_newoac[addr)_NR]. = lv->lv_ee_		returors_newoac[addr)_NR].vNIize =
+	/* avcks(unsigJu the tfo 	>)
+opt,t_free_)
+opt,t_fr_			}
+	)
+opt,t		ch;0,,ct(snap_ps)
+opt,t_fru!2000
@@ -0,,ctorsf) % )
+opt,t8:26 20&een
+  boo_( 			 kdev,ctors)
+opt,t_fr_			}
+	)
+opt,tys_s0,,ctors)
+opt,t_free_)
+opt,t_frt;
+	u;0,,ct}fo 	>+
+deN_ER _b,s)
+opt,
f
+		chain	ree_k Mf) % )
+opt,t8:26 20&een
+  boo_( )
+opt,t_fr_			}t;
+	un=y)
+opt,t_frt;
+	u;0,urors_newe_blkMAdr)_NR]ee_		returors_ne
+	min_blkMAdr)_NR]ee_		returext != hash_table; nener6PROC_FS= RQ hash_table; nePROC_FSer	erc
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,M3 ) 0k Mutsct H&i	Irmajor0(Mner6 ber, &&i	Irnoot
;+		  uly-Autio&i	Irunregis+72t(y&&i	Irnoot, 0  H&i	Irmajor.low,+4t
;+		  u the igJu the tfo 	>+
+*u; uest *f
+		his snapshot
+	   or hash_tak.c ree_k Mblks out_free_		returext !	V_Nner6HD_ berev 	>+
+*u; uest *f
+		his snapshot
+	   or(/blo(lvree_k Mblkscbruaryor (ee_s(unsigJu the tfo 	>* ret;
+ 	int 	{
+page * pM,M   tsuNBD
dfu4,6 dBD
diff = dr =SNAPSHOT
);0, tk Mut:
+	tur} +
+snap-ob_he	May,M   t()eree_Ju thehead	er	V_NMODk;
->lv_p p 	/*
-	 ate t_snaps - ed to eh;
-alizeSNAP&fraiectosap->lv_	er	V_NFe3 +u7 3v
+Fe3 +u7 3vm(t max_blksvlv Fframv(  GNU  * July-Au max_&&vlv t);
+vlv Fframv(  GNU igJu the t{* tio;
+
 turn; 	>;_adreq =toCURRENT_TIer * e_k Mblks0_sectoSPIN)b,G6NUNb,G6ED;v_ex&,,pni_head sc.0_sectoUNb,G6_PE;ex&,,pni_head sc.data.head *cto\ex&,,pni_head sc.data.pead *cto\ex&,,pni_head sc.data.peaarranty of
+ *  	>+
+Ih;
-alizeSVGc
+	stars, /er 	>	Wed   = org_v <= ABS6MAX)VGg_vtor-vg[v]
+			/* r0p -io+
+Ih;
-alizeSLV ->(deoissoci>> PAG /er 	>	Wed   = org_v < ABS6MAX)LVg_vtor--0,,ctors+
+nhnd_oABS6MAX)VGvnehangw */
f r >b_lcVGv /er 	>tiongo   +	f[v]. g+2->b_r = ABS6MAX)VGger 	>tiongo   +	f[v].    ->b_rff %1turors}0,n; 	>ut:
+	tur} +
+;4g vlv Fframv()->lv_p p 	////////////////////////////////////////////////////////////////////,
++	err =harD
d d_oaceouhaps - eddev, G  ////////////////////////////////////////////////////////////////////* 0p 	/*
-	 charD
d d_oaceouhmmax3pshot bev, /erlksize, 200int s = M
+		E_st * heanta)1*anta),* tioooooooooooooooooooooooost * heonize*oniz)e{* tio;
+
 << 9;
+
+		lm(t_dta)->i
+
+exter
+		INIT_LIST_fo 	>* ret;
+ 	int LIST_fo 	>oooooooooage * pint s = M
+		
+		l: %d cVG#: %d cy,Me: 0x%X 00_se: %ddr = tk Moooooooooi oaHOT
+	 << 9,	>lvCHR( << 9),eoniz->fay,M COW,
+	sigJu the tfo 	>+
+ateangw *r napshot PAG /er 	>f) % ! s(lvr())sg sizeo-EACCES r0p -io+
+G V==sine vobuonizeM
+		 /er 	>f) % >lvCHR( << 9) (aMAX)VG)sg sizeo-ENXIOturer	er	V_NMODk;
+	oooMOD 	{Cptemuf 5NOsigJu the tfo 	>int s = mmax+ile (ven tk Mut:
+	retur} +
+int s = M
+		E)->lv_p p 	/*
-	 charD
d d_oaceouhi/o-or trol3pshot bev, *
-	 O:
e Fbufg =ngV_Lr&i	ID
dout:
dod(,
e Fat Fbufreq , Foi3.s	lie_phblockev, G  /* 0lksize, 200int s =  = gev( st * heanta)1*anta),ost * heonize*oniz,* tiooooooooooooooooooooooooourg_phy x_b,_fueadi a)e{* tio;
+
 << 9;
+
+		lm(t_dta)->i
+
+extertio;
+
lnk_M		 (ltertioueadi  lCOW),op,
 turtioueadi ; ogen,tionmax_ *av_iob(  GNU*) anext !	V_Nner60P
+INght);
+
lk * heanta)1*anta)_sav;e_Ju the tk Mbleouh_tizelvm_snapshotbleouh_tizelvm_snaps; tk Mbleouh_tizelhead * sc, &bleouh_tizelhead * sc; tk Mble &bl r0p -io+
+Foi3.wisufgc	lie_p sc,lain	abIFoiun#t, V_raiectos	 /er 	>(y GNU  blks0_se; tk M-)
+		INIT_LIST_HIOCTLfo 	>* ret;
+ 	int LIST_fo 	>oooooooooage * pint s = p-p#t:phy x_b,: 0x%X 0
+		l: %d c"fo 	>oooooooooaVG#: %d cy,Me: 0x%Xdr = tk Moooooooooi oaHOT
+	hy x_b,_f << 9,	>lvCHR( << 9),eoniz->fay,M  ;v_Ju the ter	er	V_Nner6TOTALLock/lvc 	>f) % 0  HFos/n,ng *d>n;l>MD_og sizeo-EACCES r0Ju the terp -io+
+Main	hy x_b, switch	 /er 	>switch	(	hy x_b,r--0,,ctors+
+
+ * the BD
d /er 	>tiony
+ n x_b,G6NBD
:
+  LV_try_again: tk Moooooo=4b_sizeg (y&een
W,
+	sig ,* berGerf(+
+ * !	  = RQ
+ * !	 {
+				->pax_r--0,		INIT_LIST_HIOCTLfo 	> ption_t * ret;
+ 	int 	{
+paint s = p-p#t:pge is =snap-pby pax_%d ...dr = tk Mooooooooot * lvPLock/lvc
 	>;4g  -- COW,
+	sigJu the toooooooooooosrt, mask,  (y&een
W,
+	sig ,* berGetio;
+errupticto_sleep_on (y&een
ginnintk ,* berGetio;) % {
+				->sigpenEV_Lrnapshog sizeo-EINTR;er	er	V_Nner6TOTALLock/lvc 	> berGetio;) % 0  HFos/n,ng *d>n;l>MD_og sizeo-EACCES r0Ju the tavR-rcke_fu
)o by
+ *_try_againntk ,* berGe}tk ,* berGe0_secto{
+				->pax; tk Moooooo=4b_smask,  (y&een
W,
+	sig ,* berGeut:
+	return 0,,ctors+
+ason =NAP&flie_phy byens Foiapshot/tools+libo;
+ermmarbbilityd /er 	>tiony
+ n x_0P
+IOPHc_ofTes:ig ,* berGerf	(	hyct g _w *r ( ar;
+&blksvopa	lie_phchunk_si % ud srt))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig ,* berGeut:
+	return 0,	er	V_Nner6TOTALLock/lvc 	> be+
+
+ * Fos/nnaps - ed  /er 	>tiony
+ n x_ock/l:ig ,* berGe0  HFos/n,ng *d>n;lyh1sig ,* berGe	Wed   = org_v < ABS6MAX)VGg_vtor-{vc 	> berGetio;) % vg[v]
!2000
@@ -0,,ctors-rcke_fu
 * F Vossct r(_vintk ,* berGetio}tk ,* berGe}tker	er	V_NMODk;
+	ooooooooo(snap_ps0P
+temuf 5NO (y&__e-s,ay,M   )==M1h tavR-rcke_fu
MOD 	{Cptemuf 5NOsigooooooooo(snap_ps0P
+temuf 5NO (y&__e-s,ay,M   )=>M1h tavR-rcke_fu
MOD DECptemuf 5NOsigJu theo+
+MODk;
->lv_ ,* berGe0_sectorg_+
+*u/* inv0_sec>lv_ ,* berGewake_	Ma;
+errupticto (y&een
ginnintk ,* berGeut:
+	returJu theo+
+ner6TOTALLock/l->lv_p p  	> be+
+
+ */mask,  i/oche(virt_start,lnk_Magec;sct riagec;b enreaMA ption_t *ages = (t org_ (sct 's
 *buf;
gw *r +void's
pvsct )  /er 	>tiony
+ PE)b,G6NUNb,G6:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct f
+	_w *r ( &pni_head sc, ar;
+unk_si % pni_head sc, ))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooo=witch	(	pni_head sc.0_se@ -0,,ctors-rcke_ny
+ n,G6_PE:0,,ctors-rcke_fu
	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  +	xg_ptor-{vc 	> berGetio berGerf	(	vg[>lvCHR( << 9)]->p [p]n!2000
@(dev)mmavR-rcke_fu
 ption_t *ni_head sc.data.pead *ct=v)mmavR-rcke_fu
 ption_t vg[>lvCHR( << 9)]->p [p]->p  nk_sizavR-rcke_fu
 ption_t 			 kdev,ctors berGetio}tk ,* beev,ctors berGetiorf	(	p6 20vg[>lvCHR( << 9)]->p  +	x)sg sizeo-ENXIOturerke_fu
 ption_t *ni_head sc.0_sectoUNb,G6_PE;ex&,,ors-rcke_fu
	sync_
+	t(ypni_head sc.data.head *);erke_fu
 ption_t *ni_head sc.0_sectob,G6_PE;ex&,,ors-rcke_fu
			 kdev0,,ctors-rcke_ny
+ UNb,G6_PE:erke_fu
 ption_t *ni_head sc.0_sectoUNb,G6_PE;ex&,,ors-rcke_fu
pni_head sc.data.head *cto\ex&,,fu
 ption_t *ni_head sc.data.pead *cto\ex&,,fu
 ption_t *ni_head sc.data.peaarranty of
+ 7er_head * be9/lake_	M (y&een
 it/ginnintk&,,ors-rcke_fu
			 kdev0,,ctors-rcke_	V_= KE:erke_fu
 ption_t g sizeo-EINVAL;tk ,* berGe}tker ,* berGeut:
+	return 0,,ctors+
+re it(vi>lv_iobulnk_Mag(afd d_sned lothe Ft_start,lnk_Ma)  /er 	>tiony
+ LELocMAP:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct f
+	_w *r ( &+e re it/ sc, ar;
 tk Mooooooooot * lvPLock/lvc
 	>unk_si % +e re it/ sc, ))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooo	Wed  lctorg_l==Mvg[>lvCHR( << 9)]->l  +	xg_ltor-{vc 	> berGetio;) % vg[>lvCHR( << 9)]->l [l]n!2000
@(dev)mmavR-rcke_fu
 pt;4g * rcmpt(yvg[>lvCHR( << 9)]->l [l]       "org  Mooooooooot * lvPLock/lvc
 	>;e re it/ sc.     "o)			  )-{vc 	> berGetio be	Wed  lectorg_le==Mvg[>lvCHR( << 9)]->l [l]     hintma ed_(ltertio * lvPLock/lvc
 	>;etor-{vc 	> berGetio berGerf	(	vg[>lvCHR( << 9)]->l [l]     vNIize = l[le].d *ct=v)mmavR-rcke_fu
 ption_t ;e re it/ sc.oldad *cdev)mmavR-rcke_fu
 ption_t vg[>lvCHR( << 9)]->l [l]     vNIize = l[le].pect=v)mmavR-rcke_fu
 ption_t ;e re it/ sc.oldaper-{vc 	> berGetio berGe_t vg[>lvCHR( << 9)]->l [l]     vNIize = l[le].d *ctg  Mooooooooot * lvPLock/l;e re it/ sc. !=/+	err avR-rcke_fu
 ption_t vg[>lvCHR( << 9)]->l [l]     vNIize = l[le].pectg  Mooooooooot * lvPLock/l;e re it/ sc. !=/pltertio * lvPLock/lvc
 	>ut:
+	retur * lvPLock/lvc
 	>}ev,ctors berGetio}tk ,* be ption_t g sizeo-EINVAL;tk ,* berGetio}tk ,* berGe}tker ption_t g sizeo-ENXIOturer0,,ctors+
+aV
Sti a(deDAvree_ 	>tiony
+ >lvCREATE:erke_fu
 ptg sizeo * F VLV
Sti ll << 9,	arg)turn 0,,ctors+
+re ct rast_dD
dife(deDAvree_ 	>tiony
+ >lvocMOVE:erke_fu
 ptg sizeo * F Vossct r(_ << 9)turn 0,,ctors+
+lnk_M	 a(tx_f %la V==sree_ 	>tiony
+ >lvEXTEND:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	vg[>lvCHR( << 9)]->p  vNI==Mvg[>lvCHR( << 9)]->p  +	xr-{vc 	> berGetio	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  +	xg_ptor-{vc 	> berGetio berf	(	vg[>lvCHR( << 9)]->p [p]n=2000
@@ -0,,ctors-rcke_fu
 berf	(	(	vg[>lvCHR( << 9)]->p [p]n=g  Mooooooooot * lvPLock/lvia(rs)
v( snk_si % pv, ), ,Septembe)n=2000
@@ -0,,ctors-rcke_fu
 be_t * ret;
+ 	int CRITg  Mooooooooot * lvPLock/lvc
 	>age * p>lvEXTEND:via(rs)
v* calcpsho%d, ne %ddr = tk Mooooooooo * lvPLock/lvc
 	>;4g  -- CO__LINE__)tertio * lvPLock/lvc
 	>ut:
+	r%lu, virt_ * lvPLock/lvc
 	>}ev,ctors berGetiorGerf	(	hyct f
+	_w *r ( vg[>lvCHR( << 9)]->p [p], ar;
 tk Mooooooooot * lvPLock/lvc
 	>k/lvc
 	>unk_si % pv, ))rnapsh tavR-rcke_fu
-rcke_fu
g sizeo-EFAULnsig tk Moooooo ption_t vg[>lvCHR( << 9)]->p [p]->p  ouh_tictoPV_ACTIVErt_ * lvPLock/lvc
 	>+
+We
 *b't neesnap_pPEd, pe tavR-rcke_fu
-rcke_fu
;
gf ( lvut;
+ flikeEV_LVpnit(, pec>lv_ ,* berGe ption_t vg[>lvCHR( << 9)]->p [p]->peee_		returors berGe ption_t vg[>lvCHR( << 9)]->p  vNIven tk M berGe ption_t vg[>lvCHR( << 9)]->p  D
dven tk M berGe ption_t vg[>lvCHR( << 9)]->pnitn, = +=r avR-rcke_fu
 ption_t vg[>lvCHR( << 9)]->p [p]->peitn, =next !	V_Nner60P
+INght);
+
lvPLock/lvc
 	>+
+nhned  a iummyeanta)1a-reqs +	y_mle ((>lv_ ,* berGe ption_t vg[>lvCHR( << 9)]->p [p]->anta)1=r avR-rcke_fu
 ption_t blks(/n,+4ta)1(_vg[>lvCHR( << 9)]->p [p]->p  nk_s r0Ju the tavR-rcke_fu
vc
 	>ut:
+	retur * lvPLock/lvc
}tk ,* berGetio}tk ,* berGe}tk-rcke_fu
g sizeo-EPERMturn 0,,ctors+
+re	h+h a(tx_f %la V==sree_ 	>tiony
+ >lvt_a in:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct f
+	_w *r ( p    "o, ar;
+unk_si % p    "o))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooo	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  +	xg_ptor-{vc 	> berGetiorf	(	vg[>lvCHR( << 9)]->p [p]n!2000
@(de v)mmavR-rcke_fu
 pt;4g * rcmpt(yvg[>lvCHR( << 9)]->p [p]->p    "org  Mooooooooot * lvPLock/lvc
 	>p    "o)			  )-{vc 	> berGetio berf	(	vg[>lvCHR( << 9)]->p [p]     vNIl>MD_og sizeo-EPERMtur berGe ption_t vg[>lvCHR( << 9)]->pnitn, = -=v_ ,* berGe ption_t vg[>lvCHR( << 9)]->p [p]->peitn, =nex berGe ption_t vg[>lvCHR( << 9)]->p  vNI--nex berGe ption_t vg[>lvCHR( << 9)]->p  D
d--nex		INIT_LIST_HVFREt);
+
lvPLock/lvc
* ret;
+ 	int LIST_fo 	>oooooooooLock/lvc
 	>age * p8"ys_d% dr =SNAPSHOT
CO__LINE__)terJu the t- !	V_Nner60P
+INght);
+
lvPLock/lvc
blkser	li,+4ta)1(_vg[>lvCHR( << 9)]->p [p]->anta)s r0Ju the tavR-rcke_fu
vc
8"ys_d(_vg[>lvCHR( << 9)]->p [p])tertio * lvPLock/l+
+MakeEpsh
+	starvot
+	 or this sna>lv_ ,* berGe ption	Wed  g_p==Mvg[>lvCHR( << 9)]->p  +	x-1g_ptorv_ ,* berGe ption_t vg[>lvCHR( << 9)]->p [p] = vg[>lvCHR( << 9)]->p [pvec;]ntk berGe ption_t vg[>lvCHR( << 9)]->p [pvec;]ee_		returors berGe ptionut:
+	retur * lvPLock/l}tk ,* berGe}tk-rcke_fu
g sizeo-ENXIOturer0,,ctors+
+ouh	er	lillnk_M		 ilitydtenClsi tx_f %la V==sree_ 	>tiony
+ >lvSP
+EXTENDABLn:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct f
+	_w *r ( &lnk_M		 (l, ar;
+unk_si % lnk_M		 (l))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Mooooooii % lnk_M		 (l6 20>lvEXTENDABLn ||urors berGe ptiolnk_M		 (l6 20~>lvEXTENDABLnr-{vc 	> berGetiorf	(	lnk_M		 (l6 20>lvEXTENDABLn)tk berGe ption_t vg[>lvCHR( << 9)]->vg ouh_tic|20>lvEXTENDABLntur * lvPLock/luly-Autioooooooooo_t vg[>lvCHR( << 9)]->vg ouh_tic&20~>lvEXTENDABLn;tk ,* berGe}onst cg sizeo-EINVAL;tk ,* berGeut:
+	return 0,,ctors+
+ion-tx_f %la V==sdata (t:
e ap_p g+	plk * h)sree_ 	>tiony
+ >lvScep38:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct g _w *r ( ar;
+vg[>lvCHR( << 9)]
+unk_si %  g+	))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooout:
+	return 0,,ctors+
+ion-tx_f %la V==scle ((>lv_ ,* beny
+ >lvScep38_iobuf 5NO:ig ,* berGerf	(	hyct g _w *r ( ar;
+& g+ile (
+unk_si %  g+ile ())rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooout:
+	return 0,,ctors+
+ion-tx_f %la V==scle ((>lv_ ,* beny
+ >lvScep38_iobu
+#if LI: tk Moooooo	Wed  lcto = org_v < ABS6MAX)VGg_vtor-{vc 	> berGetio;) % vg[v]
!2000
@@ -0,,ctors-rcke_fu
rf	(	hyct g _w *r ( ar;vecl+
-	  ber_LEN
 tk Mooooooooot * lvPLock/lvc
 	>k/lvvg[v]->vg   "org  Mooooooooot * lvPLock/lvc
 	>>>>>> ber_LEN)rnapsh tavR-rcke_fu
-rcke_g sizeo-EFAULnsig ,* berGek/l}tk ,* berGe}tk-rcke_fu
g sizeo0turer0,,ctors+
+aV
Sti,+re ct ,+lnk_M	  r >b	h+h a(
+		u_ed, use h /er 	>tiony
+ n vCREATE:erke_fu
ny
+ n vocMOVE:erke_fu
ny
+ n vEXTEND:ig ,* beny
+ n voca in:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct f
+	_w *r ( &;
+ect, ar;
+unk_si % ;
+ect))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Mooooooii % hy x_b, != n vocMOVEr-{vc 	> berGetio;) % hyct f
+	_w *r ( &;
, ;
+ect.;
, unk_si % ;
+ ))rnapsh tavR-rcke_fu
-rcg sizeo-EFAULnsig ,* berGe}ig tk Moooooo=witch	(	hy x_b,r--0,,ctors 	>tiony
+ n vCREATE:erke_fu
ke_fu
 ptg sizeo * - oLV
Sti ll << 9,	;
+ect.;
SHOT
+	&in)dev0,,ctors-rcke_ny
+ n vocMOVE:erke_fu
ke_fu
 ptg sizeo * - oossct r(_ << 9,	;
+ect.;
SHOT
+	%02d:%02,ctors-rcke_ny
+ n vEXTEND:ig ,* berGe beny
+ n voca in:ig ,* berGefu
 ptg sizeo * - o
rdev1,
+	h+h ll << 9,	;
+ect.;
SHOT
+	&in)dev ,* berGe}ig t0,,ctors+
+ion-ouh_ticsi a(
+		u_ed, use hby+e_bu  /er 	>tiony
+ n v cep386/k ber:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct f
+	_w *r ( &;
+ouh_tizelvm_snaps, ar;
 tk Mooooooooot * lvPLock/lvc
 	>unk_si % +leouh_tizelvm_snapsho))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Mooooooii % +leouh_tizelvm_snaps.;
6 2000
@@ g sizeo-EINVAL;tk ,* berGe;) % hyct f
+	_w *r ( &;
, ;
+ouh_tizelvm_snaps.;

 tk Mooooooooot * lvPLock/lvc
 	>unk_si % +le ))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooo	Wed  lctorg_l==Mvg[>lvCHR( << 9)]->l  +	xg_ltor-{vc 	> berGetio;) % vg[>lvCHR( << 9)]->l [l]n!2000
@(dev)mmavR-rcke_fu
 pt;4g * rcmpt(yvg[>lvCHR( << 9)]->l [l]       "org  Mooooooooot * lvPLock/lvc
 	>;
+ouh_tizelvm_snaps.;
   "o)			  )-{vc 	> berGetio berf	(	hyct g _w *r ( ;
+ouh_tizelvm_snaps.;

 tk Mooooooooot * lvPLock/lvc
 	>n_t vg[>lvCHR( << 9)]->l [l]
 tk Mooooooooot * lvPLock/lvc
 	>n_t unk_si % ;
+ ))rnapsh tavR-rcke_fu
-rcfu
g sizeo-EFAULnsig tk Moooooo ptionii % +l.   vNIize = l
!2000
@@ -0,,ctors-rcke_fu
_t unk_ = vg[>lvCHR( << 9)]->l [l]     hintma ed_(l * tk Mooooooooot * lvPLock/lunk_si % pnit)tertio * lvPLock/lvc
rf	(	hyct g _w *r ( ;
.   vNIize = l
 tk Mooooooooot * lvPLock/lvc
 	>k/lvc
 vg[>lvCHR( << 9)]->l [l]     vNIize = l
 tk Mooooooooot * lvPLock/lvc
 	>k/lvc
      rnapsh tavR-rcke_fu
-rcke_fu
g sizeo-EFAULnsig,ctors berGetio}tk ,* be ption_t g sizeoetur * lvPLock/l}tk ,* berGe}tk-rcke_fu
g sizeo-ENXIOturer0,,ctors+
+ion-ouh_ticsi a(
+		u_ed, use hby+nhnd_o /er 	>tiony
+ n v cep386/kerner:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct f
+	_w *r ( &;
+ouh_tizelhead * sc, ar;
 tk Mooooooooot * lvPLock/lvc
 	>unk_si % +leouh_tizelhead * sc))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Mooooooii % % +lpee_bleouh_tizelhead * sc.  )6 2000
@@ g sizeo-EINVAL;tk ,* berGelee_bleouh_tizelhead * sc.  _head tur ,* berGerf	(	vg[>lvCHR( << 9)]->l [l]n 2000
@@ g sizeo-ENXIOturtk ,* berGe;) % hyct f
+	_w *r ( &;
, ;
p,>unk_si % +le ))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooorf	(	hyct g _w *r ( ;
p, vg[>lvCHR( << 9)]->l [l]
 tk Mooooooooot * lvPLock/lvc
 unk_si % +le ))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooorf	(	+l.   vNIize = l
!2000
@@ -0,,ctors-rcke_unk_ = vg[>lvCHR( << 9)]->l [l]     hintma ed_(l *lunk_si % pnit)tertio * lvPLocrf	(	hyct g _w *r ( ;
.   vNIize = l
 tk Mooooooooot * lvPLock/lvc
 	>kvg[>lvCHR( << 9)]->l [l]     vNIize = l
 tk Mooooooooot * lvPLock/lvc
 	>k     rnapsh tavR-rcke_fu
-rcg sizeo-EFAULnsig ,* berGe}ig ,* berGeut:
+	return 0,,ctors+
+asable a *ages = (t org_  /er 	>tiony
+ PV6CHANGr:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct f
+	_w *r ( &p, blidd * sc, ar;
 tk Mooooooooot * lvPLock/lvc
 	>unk_si % p, blidd * sc))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooo	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  +	xg_ptor-{vc 	> berGetiorf	(	vg[>lvCHR( << 9)]->p [p]n!2000
@(dev)mmavR-rcke_fu
 pt;4g * rcmpt(yvg[>lvCHR( << 9)]->p [p]->p    "org  Mooooooooot * lvPLock/lvc
 	>p  blidd * sc.p    "o)			  )-{vc- !	V_Nner60P
+INght);
+
lvPLock/lvc
anta)_sav = vg[>lvCHR( << 9)]->p [p]->anta) r0Ju the tavR-rcke_fu
vc
rf	(	hyct f
+	_w *r ( vg[>lvCHR( << 9)]->p [p], tk Mooooooooot * lvPLock/lvc
 	>k/lvc
p  blidd * sc.p , tk Mooooooooot * lvPLock/lvc
 	>k/lvc
unk_si % pv, ))rnapsh tavR-rcke_fu
-rcke_g sizeo-EFAULnsig tk Moooooo ption+
+We
 *b't neesnap_pPEd, pe tavR-rcke_fu
-rcke_;
gf ( lvut;
+ fa V==U}
V_LVpnit(, pec>lv_ ,* berGe ptionvg[>lvCHR( << 9)]->p [p]->peee_		retur- !	V_Nner60P
+INght);
+
lvPLock/lvc
vg[>lvCHR( << 9)]->p [p]->anta)1= anta)_sav;e_Ju the tk M be ption_t g sizeoetur * lvPLock/l}tk ,* berGe}tk-rcke_fu
g sizeo-ENXIOturer0,,ctors+
+ion-*ages = (t org_ data (p
+	pout:
e Foit:
e)  /er 	>tiony
+ PV6Scep38:ig ,* berGerf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOtur ,* berGerf	(	hyct f
+	_w *r ( &p, * b enr sc, ar;
 tk Mooooooooot * lvPLock/lvc
 	>unk_si % p, * b enr sc))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooo	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  +	xg_ptor-{vc 	> berGetiorf	(	vg[>lvCHR( << 9)]->p [p]n!2000
@)-{vc 	> berGetio berf	(	;4g * rcmpt(yvg[>lvCHR( << 9)]->p [p]->p    "org  Mooooooooot * lvPLock/lvc
 	>vc
p  * b enr sc.p    "o)			  )-{vc 	> berGetio beLocrf	(	hyct g _w *r ( p  * b enr sc.p 
 tk Mooooooooot * lvPLock/lvc
 	>k/lvc
 vg[>lvCHR( << 9)]->p [p], tk Mooooooooot * lvPLock/lvc
 	>k/lvc
>unk_si % pv, ))rnapsh tavR-rcke_fu
-rcke_fu
g sizeo-EFAULnsigavR-rcke_fu
vc
 	>ut:
+	retur * lvPLock/lvc
}tk ,* berGetio}tk ,* berGe}tk-rcke_fu
g sizeo-ENXIOturer0,,ctors+
+*ages = (t org_ latenc flush/innapshot_  /er 	>tiony
+ PV6FLUSH:ur ,* berGerf	(	hyct f
+	_w *r ( &p, flush* sc, ar;
+unk_si % p  flush* sc))rnapsh tavR-rcke_fu
g sizeo-EFAULnsig tk Moooooo	Wed   = org_v < ABS6MAX)VGg_vtor-{vc 	> berGetio;) % vg[v]
 2000
@@ or thnultertio * lvPLoc	Wed  pctorg_p==Mvg[v]->p  +	xg_ptor-{vc 	> berGetio berf	(	vg[v]->p [p]n!2000
@(dev)mmavR-rcke_fu
 ption;4g * rcmpt(yvg[v]->p [p]->p    "org  Mooooooooot * lvPLock/lvc
 	>vc
p  flush* sc.p    "o)			  )-{vc 	> berGetio beLoc	sync_
+	t(yvg[v]->p [p]->p  d *);erke_fu
 ption_t ke_;
napshot__latencst(yvg[v]->p [p]->p  d *);erke_fu
 ption_t ke_ut:
+	retur * lvPLock/lvc
}tk ,* berGetio}tk ,* berGe}tk-rcke_fu
g sizeoeturn 0,,ctors	V_= KE:erke_fu
 pt* ret;
+ 	int WARNIN_fo 	>oooooooooLock/lage * pint s = p-p#t:punkn>n;lhy x_b, %xdr = tk Mooooooooo * lvPi oaHOT
+	hy x_b,intk ,* berGeut:
+	r-EINVAL;tk ,*}0, tk Mut:
+	retur} +
+int s =  = gev>lv_p p 	/*
-	 charD
d d_oaceouhclot cgshot bev, /erlksize, 200int s = +	/* inv( st * heanta)1*anta),ost * heonize*oniz) t{* 		INIT_LIST_fo 	>;
+
 << 9;
+
+		lm(t_dta)->i
+
+extertio* ret;
+ 	int LIST_fo 	>oooooooooage * pint s = +	/* inv cVG#: %ddr =SNAPSHOT
CO>lvCHR( << 9) ;v_Ju the ter	er	V_NMODk;
+	ooorf	(	0P
+temuf 5NO (y&__e-s,ay,M   )=>M )-MOD DECptemuf 5NOsigJu the ter	er	V_Nner6TOTALLock/lvc 	>f) % 0  HFos/n,ng *d>n;l>MD_o{0,,ctorseen
Fos/n,ng *d>n;lyhturnk/lvc
blkse = mmax+ile ((re1turors}0,Ju the tfo 	>f) % 0  He = mmax+ile ((>MD_o0  He = mmax+ile (--nex bef) % 0_sectto{
+				->pax_o{0,,ctorse_sectorg_+
+*u/* inv0_sec>lv_ ,* bewake_	Ma;
+errupticto (y&een
ginnintk ,*}0, tk Mut:
+	retur} +
+int s = +	/* inv()->lv_p p p 	////////////////////////////////////////////////////////////////////,
++	err B0_secoaceouhaps - eddev, G  ////////////////////////////////////////////////////////////////////* 0p 	/*
-	 b0_secoaceouhmmax3pshot bev, /erlksize, 200int e_ir- 2.3( st * heanta)1*anta),ost * heonize*oniz)e{* tio;
+
 << 9;
+
+		lm(t_dta)->i
+
+exter
+		INIT_LIST___entry(nOPENertio* ret;
+ 	int LIST_fo 	>oooooooooage * pint e_ir- 2.3
+		l: %d cVG#: %d cLV#: %d cy,Me: 0x%Xdr = tk Moooooooooi oaHOT
+	 << 9,	>lvry(( << 9),eLVvry(( << 9),eoniz->fay,M  ;v_Ju the ter	er	V_Nner6TOTALLock/lvc 	>f) % 0  HFos/n,ng *d>n;l>MD_og sizeo-EPERMturJu the tfo 	>f) % vg[>lvry(( << 9)]n!2000
@(dev)mmavR-rc% vg[>lvry(( << 9)]->vg ouh_tic&	>lvACTIVE)(dev)mmavR-rcvg[>lvry(( << 9)]->lv[LVvry(( << 9)]n!2000
@(dev)mmavR-rcLVvry(( << 9) >	  = Rv)mmavR-rcLVvry(( << 9) <cvg[>lvry(( << 9)]->lv +	xr-{vc0,,ctors+
+Cson =parDlllvuLV ng *d>n;l(Ethinsct )  /er 	>tiof) % vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv ouh_tic&	n v PINDOWN)tk-rcke_fu
g sizeo-EPERMturn ,ctors+
+Cson =_dD
dife(Eth_b, - 2.3f r >b_date);
  /er 	>tiof) % oniz->fay,M c&	O_RDWR)-{vc 	> berGef) % ! % vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv ouh_tic&	n vACTIVE)h tavR-rcke_fu
g sizeo-EPERMtur berGe ptf) % ! % vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv _NBD
dc&	n vWRITE)h tavR-rcke_fu
g sizeo-EACCES r0 berGe}ig tk Mooof) % vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv mmax3yapsh tavR-rcke_vg[>lvry(( << 9)]->lv mmaxven tk M bevg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv mmaxven ter	er	V_NMODk;
+	ooooooMOD 	{Cptemuf 5NOsigJu the tfo		INIT_LIST___entry(nOPENertiovc
* ret;
+ 	int LIST_fo 	>oooooooooLocage * pint e_ir- 2.3
+		l: %d cVG#: %d cLV#: %d cunk_: %ddr = tk Mooooooooo * i oaHOT
+	 << 9,	>lvry(( << 9),eLVvry(( << 9),);
+
lvPLock/lvc
vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv o    turJu the tfo 	>ke_ut:
+	retur * }0, tk Mut:
+	r-ENXIOtur} +
+int e_ir- 2.3()->lv_p p 	/*
-	 b0_secoaceouhi/o-or trol3pshot bev, / tfile C6 2000  He_ir = gev(st * heanta)1*anta),ost * heonize*oniz,* tioooooooooooooooooooooooourg_phy x_b,_fueadi a)e{* tio;
+
 << 9;
+
+		lm(t_dta)->i
+
+extertio max_*av_iob(  GNU*) anex  ,evator_cbrgeomejor0*hdiob( evator_cbrgeomejor0*) anex
+		INIT_LIST_HIOCTLfo 	>* ret;
+ 	int LIST_fo 	>oooooooooage * pint e_ir = gev
+		l: %d chy x_b,: 0x%X 0av_: %X c"fo 	>oooooooooaVG#: %dl cLV#: %ddr = tk Moooooooooi oaHOT
+	 << 9,	hy x_b,_f(fueadi  ar;
 tk Mooooooooo>lvry(( << 9),eLVvry(( << 9) turJu the tfo 	>switch	(	hy x_b,r--0,,ctors+
+g sizeo aceouh	er_h /er 	>tiony
+ ry(0P
SIZr:ig		INIT_LIST_HIOCTLfo 	> ption* ret;
+ 	int LIST_fo 	>oooooooooLock/lage * pint e_ir = gev* pry(0P
SIZr: %udr = tk Mooooooooo * lvPi oaHOT
+	vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv o    turJu the t berGe benyct g _w *r ( (6lv->*) ar;
+& g[>lvry(( << 9)]->\ tk Mooooooooot * lvPLock/lvc
 	>k/lvc
>lv[LVvry(( << 9)]->lv o   ,* tioooooooooooooooooooooounk_si %  g[>lvry(( << 9)]->\ tk Mooooooooot * lvPLock/lvc
 	>k/lv[LVvry(( << 9)]->lv o    intk ,* berGe			 kdev0,0,,ctors+
+flush latenc cach_h /er 	>tiony
+ ry(FLSBUF:erke_fu
 pt+
+ateangw *r napshot PAG /er 	>rGe ptf) % ! sw *r ())sg sizeo-EACCES r0p 		INIT_LIST_HIOCTLfo 	> ption* ret;
+ 	int LIST_fo 	>oooooooooLock/lage * pint e_ir = gev* pry(FLSBUFdr =SNAPSHOT
);0,Ju the t berGe be	sync_
+	t(y_dta)->i
+
+exter	_;
napshot__latencs(_dta)->i
+
+extertio berGe			 kdev0,0,,ctors+
+son->b_d a		chuf r b0_secoaceouh /er 	>tiony
+ ry(RAk/l:ig ,* berGe+
+ateangw *r napshot PAG /er 	>rGe ptf) % ! sw *r ())sg sizeo-EACCES r0p 		INIT_LIST_HIOCTLfo 	> ption* ret;
+ 	int LIST_fo 	>oooooooooLock/lage * pint e_ir = gev* pry(RAk/l: %d sectorsuf r %02X:%02Xdr = tk Mooooooooo * lvPi oaHOT
+	(6lv->) ar;
+MAdr)(y_dta)->i
+
+ex,_ << 9)turJu the t berGe beii % % +v->) ar; <rner6MIN);
-		As_de ||urors berGe ptio% +v->) ar; >rner6MAX);
-		As_de cg sizeo-EINVAL;tk ,* berGeutad_a		chkMAdr)_NR]eeer	_vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv utad_a		chiob( +v->) ar;tertio berGe			 kdev0,0,,ctors+
+ion-{
+				->b_d a		chusontd lo /er 	>tiony
+ ry(RAG/l:ig		INIT_LIST_HIOCTLfo 	> ption* ret;
+ 	int LIST_fo 	>oooooooooLock/lage * pint e_ir = gev* pry(RAG/ldr =SNAPSHOT
);0,Ju the t berGe benyct g _w *r ( (6lv->*) ar;
 tk Mooooooooot * lvPLock/&vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv utad_a		ch,* tioooooooooooooooooooooounk_si %  g[>lvry(( << 9)]->lv[LVvry(( << 9)]->\ tk Mooooooooot * lvPLock/lvc
 	>k/lv utad_a		ch intk ,* berGe			 kdev0,0,,ctors+
+ion-opt,
geomejor0*/er 	>tiony
+ HDIO60P
GEO:ig		INIT_LIST_HIOCTLfo 	> ption* ret;
+ 	int LIST_fo 	>oooooooooLock/lage * pint e_ir = gev* pHDIO60P
GEOdr =SNAPSHOT
);0,Ju the t berGe beii % hd6 2000
@@ g sizeo-EINVAL;tk ,* berGe{vc 	> berGetio the execw;
+			chicto64;vc 	> berGetio the execw;
+	sectorsu= 32;vc 	> berGetioeadi ;tarty of
+ 7er_head * bd srt_cylheadrsu= vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv o    / tk Mooooooooot * lvPLock/lvc
 			chic/	sectorssig tk Moooooo ptrf	(	hyct g _w *r ( mlg = *) &hd->		chi
+&		chi
 tk Mooooooooot * lvPLock/lvc
 	>k    si % 		chi))rnaps ||urors berGe ptio benyct g _w *r ( (6g = *) &hd->sectors
+&sectors
 tk Mooooooooot * lvPLock/lvc
 	>k    si % sectors))rnaps ||urors berGe ptio benyct g _w *r ( (6d srt*) &hd->cylheadrs
 tk Mooooooooot * lvPLock/lvc
 	>k&cylheadrs
k    si % cylheadrs))rnaps ||urors berGe ptio benyct g _w *r ( (6lv->*) &hd->start
+&start
 tk Mooooooooot * lvPLock/lvc
 	>k    si % start))rnapsh tavR-rcke_fu
-rcg sizeo-EFAULnsig ,* berGe}ig t		INIT_LIST_HIOCTLfo 	> ption_t * ret;
+ 	int LIST_fo 	>oooooooooLock/lvc
age * pint e_ir = gev* pcylheadrs: %ddr = tk Mooooooooo * lvPLoci oaHOT
+	vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->\ tk Mooooooooot * lvPLock/lvc
 	>;4 o    /			chic/	sectors);0,Ju the t berGe be			 kdev0,0,,ctors+
+son-_NBD
dctenCicsi a(
+		u_ed, use h /er 	>tiony
+ n v ET_ACCESS:ig ,* berGe+
+ateangw *r napshot PAG /er 	>rGe ptf) % ! sw *r ())sg sizeo-EACCES r0Lock/lvc
vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv _NBD
dc=f(fueadi  ar;tertio berGe			 kdev0,0,,ctors+
+son-ouh_tictenCicsi a(
+		u_ed, use h /er 	>tiony
+ n v ET_Scep38:ig ,* berGe+
+ateangw *r napshot PAG /er 	>rGe ptf) % ! sw *r ())sg sizeo-EACCES r0Lock/lvc
f) % ! % (fueadi  ar;c&	n vACTIVE)(dev)mmavR-rcke_fu
vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv mmax3>M1h
g sizeo-EPERMtur berGe ptvg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv ouh_tic=f(fueadi  ar;tertio berGe			 kdev0,0,,ctors+
+son-hintma  PAGtenCicsi a(
+		u_ed, use h /er 	>tiony
+ n v ET_ALLOCATTes:ig ,* berGe+
+ateangw *r napshot PAG /er 	>rGe ptf) % ! sw *r ())sg sizeo-EACCES r0Lock/lvc
vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv _intma  PAG=f(fueadi  ar;tertio berGe			 kdev0,0,,ctors	V_= KE:erke_fu
 pt* ret;
+ 	int WARNIN_fo 	>oooooooooLock/lage * pint e_ir = ge:punkn>n;lhy x_b, %ddr = tk Mooooooooo * lvPi oaHOT
+	hy x_b,intk ,* berGeut:
+	r-EINVAL;tk ,*}0, tk Mut:
+	retur} +
+int e_ir = gev()->lv_p p 	/*
-	 b0_secoaceouhclot cgshot bev, /erlksize, 200int e_ir+	/* inv( st * heanta)1*anta),ost * heonize*oniz) t{*  io;
+
 << 9;
+
+		lm(t_dta)->i
+
+exter
+		INIT_LIST_fo 	>* ret;
+ 	int LIST_fo 	>oooooooooage * pint e_ir+	/* inv
+		l: %d cVG#: %d cLV#: %ddr = tk Moooooooooi oaHOT
+	 << 9,	>lvry(( << 9),eLVvry(( << 9) turJu the tfo 	>sync_
+	t(y_dta)->i
+
+exterooof) % vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv mmax3yap1h tavR-rcvg[>lvry(( << 9)]->lv mmax--nex bevg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv mmax--nexer	er	V_NMODk;
+	oooMOD DECptemuf 5NOsigJu the terk Mut:
+	retur} +
+int e_ir+	/* inv()->lv_p p t != hash_table; nener6PROC_FS= RQ hash_table; nePROC_FSer	/*
-	 Ste t_snaps - ed /&i	I-Fnizsystemap->lv_	 hash_ Mner6PROC_BUFtio% i3yaps ? iummy_lat : &lat[sz]) ter	erc
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,M25_MAlksize, 200int &i	Irion,+4	l (6g =  *pag
+	h =  **start
+off_t pos
krg_phye ()* July-Aulksize, 200int &i	Irion,+4	l (6g =  *pag
+	h =  **start
+off_t pos
 tk Mooooooooot * lvPLock/lvc
 	>rg_phye (
krg_pwhest  igJu the t{* tio;
+
c
kr, lCOp, v,  g+ile (e9,	p  ble (e9,	l  ble (e9,	l  mmax+ile (e9, tk Mooool  mmax+tn, =,Vpnit_bytes,	l  l);
+oexceftwarit_bytes,	secondsnex  ,evsize,off_t sznex  ,off_t sz_la a;Autioh =  _intma  PA_tenC,=_dD
dife_tenC,=rw_tenC,=st ipes_tenC;Autioh =  *;
   "oee_		returorsevsize,h =  *lat e_		returorsevsize,h =  iummy_lat[160]g_+
+o   huf r 2d, nes->lv_p 		INIT_LIST___entPROC_0P
+IN
+		ooo* ret;
+ 	int LIST_fo 	>oooooooooage *0int &i	Irion,+4	l CALLED  pos: %lu phye (: %d cwhest : %ddr = tk Moooooooooi oaHOT
+	pos
khye (
kwhest  turJu the tfo 	>f) % pos3yaps || lat e2000
@)-{vc 	> besz_la au= vg+ile (e9u= p  ble (e9ee_bleble (e9ee_blemmax+ile (e9cto\ex&,,fu
l  mmax+tn, =u= pnit_bytesee_blel);
+oexceftwarit_bytesy of
+ 7er0,,ctors+
+soarchuf r D
difityd /er 	>tio	Wed   = org_v < ABS6MAX)VGg_vtor-{vc 	> berGe;) % vg[v]
!2000
@@ -0,,ctors-rcke_vg+ile (e9ven tk M berGe ptp  ble (e9e+=Mvg[v]->p  cur;vc 	> berGetioe  ble (e9e+=Mvg[v]->l  cur;vc 	> berGetiorf	(	vg[v]->   vNIl>MD_o{vc 	> berGetio be	Wed  lctorg_l==Mvg[v]->l  +	xg_ltor-{vc 	> berGetiorGetiorf	(	vg[v]->  [l]n!2000
@@ -0,,ctors-rcke_fu
 be_t *nit_bytese+=Mvg[v]->l [l]     hintma ed_(ltertio * lvPLock/lvc
 	>rf	(	vg[v]->  [l]     l);
+oexceftwarn!2000
@@ -0,,ctors-rcke_fu
 be_t tioe  l);
+oexceftwarit_bytesy+= tk Mooooooooot * lvPLock/lvcvg[v]->  [l]     re it/u ttertio * lvPLock/lvc
 	>}ertio * lvPLock/lvc
 	>rf	(	vg[v]->  [l]     mmax3>M0@ -0,,ctors-rcke_fu
 be_t tioe  mmax+ile (e9ven tk M berGe ption_t &,,fu
l  mmax+tn, =u+=Mvg[v]->l [l]     mmaxtertio * lvPLock/lvc
 	>}ertio * lvPLock/lvc
}ur * lvPLock/lvc
}tk ,* berGetio}tk ,* berGe}tk-rcke_}tk-rcke_*nit_bytese*=lunk_si % pnit)tertio * e  l);
+oexceftwarit_bytesy*=lunk_si % e  l);
+oexceftwarit)
+ 7er0,,ctorsrf	(	lat !2000
@@ -0,		INIT_LIST_HVFREt);
+
lvPLoc* ret;
+ 	int LIST_fo 	>oooooooooLock/lage * pv"ys_d% dr =SNAPSHOT
CO__LINE__)terJu the tPLock/lvcv"ys_d(_latintk ,* berGe	at e_		returorsrGe}ig tk Mooo+
+2freq s: firsagec;ion-o    ec;bintma e latenc= tk Moooooo2b, ec;fie_pap_p a(rs)
p-pbatenc  /er 	>tio	Wed  ictorg_i==M2g_itor-{vc 	> berGeszy of
+ 7er_head szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l"BD
d"er	er	V_NMODk;
+	oooooooooooot * lvPLock/l"m,M   "tkJuly-Autioooooooooot * lvPLock/l"d chan"e_Ju the tk Mooooooooot * lvPLock/l" %s\ndr  tk Mooooooooot * lvPLock/l"Tn, =:  %d VGge  %d PVge  %d LVge  = tk Mooooooooo * lvPLock/lv;4g * srta	lie_phc tk Mooooooooo * lvPLock/lv g+ile (e9,	vg+ile (e9u=ap1 ? "" : "s = tk Mooooooooo * lvPLock/lvp  ble (e9,	p  ble (e9eeap1 ? "" : "s = tk Mooooooooo * lvPLock/lvl  ble (e9,	l  ble (e9eeap1 ? "" : "s )
+ 7er_head szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l"(%d LVge mmax = tk Mooooooooo * lvPLock/lvl  mmax+ile (e9, tk Mooooooooo * lvPLock/lvl  mmax+ile (e9eeap1 ? "" : "s )
+ 7er_head ii % +lemmax+tn, =u>M0@ szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l Mooooooooot * lvPLock/l" %dfreq s)dr = tk Mooooooooot * lvPLock/lvc
 	>rGe ption_t &,,fu
l  mmax+tn, =)
+ 7er_head nst c * lvPLock/lvc
 	>k zy+=Ms* retf0(Mner6PROC_BUF
 ") )
+ 7er_head szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l"\nGlob =: %lu bytesy a(rs)
p-p  IOP&flie_ph: %d c  = tk Mooooooooo * lvPLock/lvvg+ile (e9u*+unk_si %  g+	) + tk Mooooooooo * lvPLock/lvp  ble (e9 *lunk_si % pv+	) + tk Mooooooooo * lvPLock/lvl  ble (e9 *lunk_si % lv+	) + tk Mooooooooo * lvPLock/lv*nit_bytese+oe  l);
+oexceftwarit_bytesy+esz_la a= tk Mooooooooo * lvPLock/lv;4g vopa	lie_ph2d:%02,ctors-rcseconds=toCURRENT_TIer *0i_adreq 
+ 7er_head ii % seconds==MD_o;_adreq =toCURRENT_TIery+esecondsnex  ,_head ii % seconds=/ 864003>M0@ -0,,ctors-rcke_ zy+=Ms* retf0(Mner6PROC_BUF
 "%d dayge  = tk Mooooooooo * lvPLock/lv lvPLock/lvc
 	>k econds=/ 86400= tk Mooooooooo * lvPLock/lv lvPLock/lvc
 	>k econds=/ 864003yaps || tk Mooooooooo * lvPLock/lv lvPLock/lvc
 	>k econds=/ 864003>p1 ? "s": "")sig ,* berGe}ig ,* berGe zy+=Ms* retf0(Mner6PROC_BUF
 "%d:%02d:%02d D
difedr = tk Mooooooooot * lvPLock/lvc
 	>rGe ptio% seconds=% 86400) /t3600= tk Mooooooooo * lvPLock/lv lvPLock/lvc
 % seconds=% 3600) /t60= tk Mooooooooo * lvPLock/lv lvPLock/lvc
 seconds=% 60)sig tk Moooooorf	(	vg+ile (e9u>M0@ -0,,ctors-rcke_	Wed   = org_v < ABS6MAX)VGg_vtor-{vc 	> berGetioooo+
+tx_f %la V==sree_ 	>tio 	> berGe;) % vg[v]
!2000
@@ -0,,ctors-rcke_vc
 	>rgD
dife_tenC= o' 'tertio * lvPLock/lvc
rf	(	!	(	vg[v]->vg ouh_tic&	>lvACTIVE)) tavR-rcke_fu
-rcke_fu
;
D
dife_tenC= o'I'tertio * lvPLock/lvc
szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l Mooooooo"\nVG: %cge  [%d PV, %d LV/%, - 2.] " tk Mooooooooot * lvPLock/l Mooooooo"pPEdSnk_: %d KBdr  tk Mooooooooot * lvPLock/l Mooooooo"p Usage [KB/PE]: %d /%, tn, =u " tk Mooooooooot * lvPLock/l Mooooooo"%d /%, #t, V %d /%, "ys_ = tk Mooooooooot * lvPLock/lvc
 	>rGe_dD
dife_tenC, tk Mooooooooot * lvPLock/lvc
 	>rGevg[v]->vg   "org  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->p  currg  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->l  currg  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->l  - 2.rg  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->pmin_bl >>p1rg  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->pmin_bl *>vg[v]->pmitn, =u>>p1rg  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->pmitn, =,g  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->pmihintma ed *>vg[v]->pmin_bl >>p1rg  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->pmihintma edrg  Mooooooooot * lvPLock/lvc
 	>>>>>(>vg[v]->pmitn, =u->vg[v]->pmihintma ed) * tk Mooooooooot * lvPLock/lc
 	>>>>>vg[v]->pmin_bl >>p1rg  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->pmitn, =u->vg[v]->pmihintma ed)sig tk Moooooo ption_t +
+*ages = (t org_s(>lv_ ,* berGe ption_t szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l Mooooooo"\n  PVge "rg  Mooooooooot * lvPLock/lvc
 	>>>>>vg[v]->p  cureeap1 ? ": " : "s:");erke_fu
 ption_t ke_cy of
+ 7er_head * be9/Loc	Wed  pctorg_p==Mvg[v]->p  +	xg_ptor-{vc 	> berGetio betio berf	(	vg[v]->p [p]n!2000
@@ -0,,ctors-rcke_fu
 be_t tio;
D
dife_tenC= o'A'n tk M berGe ption_t &,,fu
rf	(	!	(	vg[v]->p [p]->p  ouh_tic&oPV_ACTIVE)) tavR-rcke_fu
-rcke_fu
ke_fu
;
D
dife_tenC= o'I'tertio * lvPLock/lvc






_intma  PA_tenC= o'A'n tk M berGe ption_t &,,fu
rf	(	!	(	vg[v]->p [p]->p  _intma 	 (l6&oPV_ALLOCATABLn)) tavR-rcke_fu
-rcke_fu
ke_fu
_intma  PA_tenC= o'N'n tk M berGe ption_t &,,fu
szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l Mooooooooot * "[%cgc] %-21s=%8d /%-6du " tk Mooooooooot * lvPLock/l Mooooooooooooo"%8d /%-6du %8d /%-6d = tk Mooooooooo * lvPLock/lv lvPLock/lvc
 	_dD
dife_tenC, tk Mooooooooot * lvPLock/lvc
 	>rGeke_fu
_intma  PA_tenC, tk Mooooooooot * lvPLock/lvc
 	>rGeke_fu
vg[v]->p [p]->p    "org  Mooooooooot * lvPLock/lvc
 	>vc
eke_fu
vg[v]->p [p]->pmitn, =u*g  Mooooooooot * lvPLock/lvc
 	>vc
eke_fu
vg[v]->p [p]->pmin_bl >>p1rg  Mooooooooot * lvPLock/lvc
 	>>>>>ke_fu
vg[v]->p [p]->pmitn, =rg  Mooooooooot * lvPLock/lvc
 	>>>>>ke_fu
vg[v]->p [p]->pmihintma ed *g  Mooooooooot * lvPLock/lvc
 	>vc
eke_fu
vg[v]->p [p]->pmin_bl >>p1rg  Mooooooooot * lvPLock/lvc
 	>>>>>ke_fu
vg[v]->p [p]->pmihintma edrg  Mooooooooot * lvPLock/lvc
 	>>>>>	>>>>>(>vg[v]->p [p]->pmitn, =u- tk Mooooooooo * lvPLock/lv lvPLock/lvc
 	>kvg[v]->p [p]->pmihintma ed)u*g  Mooooooooot * lvPLock/lvc
 	>vc
eke_fu
vg[v]->p [p]->pmin_bl >>p1rg  Mooooooooot * lvPLock/lvc
 	>>>>>ke_fu
vg[v]->p [p]->pmitn, =u- tk Mooooooooo * lvPLock/lv lvPLock/lvc
 	vg[v]->p [p]->pmihintma ed)n tk M berGe ption_t &,,fu
cven tk M berGe ption_t &,,fu
rf	(	h==Mvg[v]->p  cur@ szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l Mooooooooot * lvPLock/lLock/l Mooooooo"\n  ooooo")tertio * lvPLock/lvc
 	>}ertio * lvPLock/lvc
}ur tk Moooooo ption_t +
+
+		u_ed, use s(>lv_ ,* berGe ption_t szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l Mooooooo"\n    LVge  = tk Mooooooooo * lvPLock/lvc
 	>>>>>vg[v]->l  cureeap1 ? ": " : "s:");erke_fu
 ption_t ke_cy of
+ 7er_head * be9/Loc	Wed  lctorg_l==Mvg[v]->l  +	xg_ltor-{vc 	> berGetiorGetiotiorf	(	vg[v]->  [l]n!2000
@@ -0,,ctors-rcke_fu
 be_t tio;
D
dife_tenC= o'A'n tk M berGe ption_t &,,fu
rf	(	!	(	vg[v]->l [l]     ouh_tic&	n vACTIVE)h tavR-rcke_fu
-rcke_fu
ke_fu
;
D
dife_tenC= o'I'tertio * lvPLock/lvc






rw_tenC= o'R'n tk M berGe ption_t &,,fu
rf	(	vg[v]->l [l]     hNBD
dc&	n vWRITE)
rw_tenC= o'W'tertio * lvPLock/lvc






_intma  PA_tenC= o'D'n tk M berGe ption_t &,,fu
rf	(	vg[v]->l [l]     hintma  PAG&	n vCONTIGUOUS) tavR-rcke_fu
-rcke_fu
ke_fu
_intma  PA_tenC= o'C'n tk M berGe ption_t &,,fu
st ipes_tenC= o'L'n tk M berGe ption_t &,,fu
rf	(	vg[v]->l [l]     st ipes3>M1h
st ipes_tenC= o'S'n tk M berGe ption_t &,,fu
szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l Mooooooooot * "[%cgcgcgc = tk Mooooooooo * lvPLock/lv lvPLock/lvc
 	_dD
dife_tenC, tk Mooooooooot * lvPLock/lvc
 	>rGeke_fu
rw_tenC, tk Mooooooooot * lvPLock/lvc
 	>rGeke_fu
_intma  PA_tenC, tk Mooooooooot * lvPLock/lvc
 	>rGeke_fu
st ipes_tenC)n tk M berGe ption_t &,,fu
rf	(	vg[v]->l [l]     st ipes3>M1h tk Mooooooooot * lvPLock/lvc zy+=Ms* retf0(Mner6PROC_BUF
 "%-2d = tk Mooooooooot * lvPLock/lvc
 	>rGe ption_t vg[v]->l [l]     st ipes)n tk M berGe ption_t &,,fu
uly-Autioooooooooot * lvPLock/lvc zy+=Ms* retf0(Mner6PROC_BUF
 "oo")tertio * lvPLock/lvc
 	>/lvl    "oee_;4g * rrchr	(	vg[v]->l [l]     HOT
CO'/')n tk M berGe ption_t &,,fu
rf	(	l    "oe!2000
@@ l    "oven tk M berGe ption_t &,,fu
nst cl    "oee_vg[v]->l [l]     HOT
n tk M berGe ption_t &,,fu
szy+=Ms* retf0(Mner6PROC_BUF
 "] %-25s =SNASHOT
);0,k M berGe ption_t &,,fu
rf	(	l g * rl2.3( ;
   "o)	>M25_MAtioooooooooot * lvPLock/lvc zy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/lvc
 	>rGe ption_t "\n  oooooock/lvc
 	>rGe ption_t ")n tk M berGe ption_t &,,fu
szy+=Ms* retf0(Mner6PROC_BUF
 "%9d /%-6du   = tk Mooooooooo * lvPLock/lv lvPLock/lvc
 	vg[v]->l [l]     s_bl >>p1rg  Mooooooooot * lvPLock/lvc
 	>>>>>ke_fu
vg[v]->l [l]     s_bl />vg[v]->pmin_bl)sig tk Moooooo ption_t vc
 	>rf	(	vg[v]->  [l]     mmax3=apsh tavR-rcke_fu
-rcke_fu
&,,fu
szy+=Ms* retf0(Mner6PROC_BUF
 "clot ")n tk M berGe ption_t &,,fu
uly-Autioooooooooot * lvPLock/lvc zy+=Ms* retf0(Mner6PROC_BUF
 "%dx mmax = tk Mooooooooo * lvPLock/lv/lvc
 	>>>>>ke_fu
vg[v]->l [l]     mmax)n tk M berGe ption_t &,,fu
cven tk M berGe ption_t &,,fu
rf	(	h==Mvg[v]->l  cur@ szy+=Ms* retf0(Mner6PROC_BUF
 tk Mooooooooot * lvPLock/l Mooooooooot * lvPLock/lLock/l Mooooooo"\n  ooooooo")tertio * lvPLock/lvc
 	>}ertio * lvPLock/lvc
}urooo ption_t vc
 	>rf	(	vg[v]->   cureeapsh tavR-rcke_fu
-rcke_fu
 zy+=Ms* retf0(Mner6PROC_BUF
 "non ")n tk M berGe ption_t  zy+=Ms* retf0(Mner6PROC_BUF
 "\n")n tk M berGe ption}tk ,* berGetio}tk ,* berGe}tker ption_t rf	(	lat =2000
@@ -0,,ctors-rcke_ii % % 	at e_va(rs)
v( sze)n=2000
@@ -0,,ctors-rcke_fu
szy of
+ 7er_head ke_fu
rt:
+	rs* retf0(Mpag
+	age *0va(rs)
v* calco%d, ne %ddr = tk Mooooooooo * lvPLock/lvc
 	>PLock/lv;4g  -- CO__LINE__)tertio * lvPLoc}ig ,* berGe}ig ,* berGe z_la au= sznex  ,rGe}ig ,*} tfo 	>f) % pos3>
szy-M1h
-0,,ctorsv"ys_d(_latintk ,* be	at e_		returorsrGeut:
+	retur * }0, tk M*;tarty o&lat[pos]terooof) % szy-Mpos3<phye ()
rt:
+	rszy-Mposterooonst c * lvPLock/lvc
 	>rt:
+	rhye (tur} +
+int &i	Irion,+4	l ()->lv_Ju the +
+t != hash_table; nener6PROC_FS= RQ hash_table; nePROC_FS->lv_p p 	/*
-	 b0_secoaceouhste t_snaps - ed 	Wed/usr/src/, nux/d chans/b0_se/ll_rw_blk.c*
-	 (ss_dinitay,M   /;4g vnit)ev, /erlksize, 200int  it(( st * hebatenc_		chu*bh
krg_prw)e{* tio;
+
 << 9;
+
+		lm(tbh->b d *);erke_rg_prnty of
+ 7erueadi head tur ,*ueadi unk_ = bh->b s_bl >>p9tur ,*ueadi rsector_tmp = bh->b b0_sen9 *lunk_tur ,*ueadi rsector_sav;e_ ,*kd *__prd *__mp = bh->b +	err avRkd *__prd *_sav;e_ ,*lv+	 *;
u= vg[>lvry(( << 9)]->lv[LVvry(( << 9)]tur ,*uthe execeadi pmintart
+ 7er0,erooof) % !3( ;
     ouh_tic&	n vACTIVE)h
-0,,ctors* ret;
+ 	int ALERTfo 	>oooooooooLocage *0int  it: ll_rw_blk 	Wed_dD
dife(Eth%s\n = tk Mooooooooo * i oaHOT
+	;
     HOT
);0,k M beut:
+	r-1tur * }0, t	/*
rf	(	l      hNBD
dc&	n vSNAPSHOT)ev* ret;
+ age * p%02d:%02d  b0_se: %lu prw: %ddr =SNAPSHOT
COMAdr)m(tbh->b d *),+
+		lm(tbh->b d *), bh->b b0_sen9,=rw);0,>lv_p _t +
+takeEcaFoitf snapshot chunk te);
s be	We-Autioooocson =	Wedte);	 (l6
+		u_ed, use h /er 	>ii % % +l     hNBD
dc&	n vSNAPSHOT)(dev)mmavR-rcMAdr)m(tbh->b d *)rnaps dev)mmavR-rcMAdr)m(tbh->b d *)rnapMAdr)_NR dev)	er	V_NWRITEAv)mmavR-rc% rwn=20WRITEA || rwn=20WRITE))tkJuly-Autioooooorwn=20WRITE)e_Ju the tk M{ t	/*
* ret;
+ age * pdod losnapshot te);
 f r %02d:%02d[%02d:%02d]  b b0_sen9: %lu pb_rsector: %ludr =SNAPSHOT
COMAdr)m(tbh->b d *),+
+		lm(tbh->b d *), MAdr)m(tbh->b d *),+
+		lm(tbh->b d *), bh->b b0_sen9,=bh->b rsector);0,>lv_orsrGeut:
+	retur * }0, t	er	V_NWRITEAv)mmaii % % rwn=20WRITE || rwn=20WRITEA)(dev)July-Autioii % rwn=20WRITE dev)Ju the tk Mooooo! % +l     hNBD
dc&	n vWRITE))
-0,,ctors* ret;
+ 	int CRITg  Mooooooooot * age *0int  it: ll_rw_blk te);
 f r utadt:
e Eth%s\n = tk Mooooooooo * i oaHOT
+	;
     HOT
);0,k M beut:
+	r-1tur * }0, t0,		INIT_LIST_HMAP		ooo* ret;
+ 	int LIST_fo 	>oooooooooage *0int  it( << 9:%d c*rd *:p%02d:%02d  *rsector: %lu c"fo 	>oooooooooaunk_:%ludr = tk Moooooooooi oaHOT
+	 << 9, tk MoooooooooMAdr)m(trd *__mp),);
+
lvPLock/l
+		lm(trd *__mp),);
+
lvPLock/lrsector_tmp
k     turJu the tfo 	>f) % rsector_tmp + unk_ > ;
     o    r-0,,ctors* ret;
+ 	int ALERTfo 	>oooooooooLocage *0int  it *rsector: %lu  r unk_: %lu wradi f r" tk Mooooooooot *"( << 9: %2ddr =SNAPSHOT
COrsector_tmp
k    ,_ << 9)turk M beut:
+	r-1tur * }0, tk/lrsector_sav = rsector_tmptur * rd *_savM be=trd *__mpsig tl g *econd re it:p _t +
+, near  itpd lo /er 	>rf	(	l      st ipes3< 2 r-0,,ctorsnhnd_o= rsector_tmp />vg[>lvry(( << 9)]->pmin_bl;s+
+ion-ap_pnhnd_o /er 	>tiopmintartee_;4     vNIize = l[nhnd_].p
n tk M bersector_tmp = ;4     vNIize = l[nhnd_].p
 + tk Mooooooooo * lvPLo% rsector_tmp %>vg[>lvry(( << 9)]->pmin_bl)turk M beud *__mp  be=t;4     vNIize = l[nhnd_].+	err 0,		INIT_LIST_HMAP		ooo c
* ret;
+ 	int LIST_fo 	>oooooooooLoca   vNIize = l[%ld].p
: %d crd *:p%02d:%02d  rsector:%ld\n = tk Mooooooooo * nhnd_= tk Mooooooooo * i      vNIize = l[nhnd_].p
= tk Mooooooooo * MAdr)m(trd *__mp),);
+
lvPLock/lk/l
+		lm(trd *__mp),);
+
lvPLock/l bersector_tmp turJu the tfo 	>+
+st iped  itpd lo /er 	>}onst c-0,,ctorsueadi ut ipe_head tur ,* beueadi ut ipe_lengthsig tk Mooout ipe_lengthu= vg[>lvry(( << 9)]->pmin_bl *>l      st ipes; tk Mooout ipe_nhnd_o= % rsector_tmp %>ut ipe_length) /tl      st ipesnk_tur ,*orsnhnd_o= rsector_tmp />ut ipe_lengthu+urors berGe ptio% ut ipe_nhnd_o%tl      st ipes)u*g  Mooooooooot *% +l     hintma ed_(l /tl      st ipes)turk M bepmintartee_;4     vNIize = l[nhnd_].p
n tk M bersector_tmp = ;4     vNIize = l[nhnd_].p
 + tk Mooooooooo * lvPLo% rsector_tmp %>ut ipe_length) - tk Mooooooooo * lvPLo% ut ipe_nhnd_o%tl      st ipes)u*tl      st ipesnk_ - tk Mooooooooo * lvPLout ipe_nhnd_o/tl      st ipesu*g  Mooooooooot * lvPLo(	l      st ipes3-M1h
*tl      st ipesnk_tur ,*orsrd *__mp = ;4     vNIize = l[nhnd_].+	err 0,		INIT_LIST_HMAP		ooo c
* ret;(	int LIST_fo	ooLoca   vNIize = l[%ld].p
: %d crd *:p%02d:%02d  rsector:%ld\n fo	ooLocaut ipe_length: %ldLout ipe_nhnd_: %ld\n = t	oo * nhnd_= t	oo * i      vNIize = l[nhnd_].p
= t	oo * MAdr)m(trd *__mp),);	/lk/l
+		lm(trd *__mp),);	ock/lrsector_tmp
);	ock/lut ipe_length
);	ock/lut ipe_nhnd_)terJu the tPLo} tfo 	>+
+hand(l *ages = (
rdevts ed ap_psct r /er 	>rf	(	pe_l;
+o sc. _secttoLOCK_PEr-{vc 	> bef) % rd *__mp ==	pe_l;
+o sc.data.p  d *(dev)mmavR-rcke_rsector_tmp >=	pe_l;
+o sc.data.p  offson-dev)mmavR-rcke_rsector_tmp <	(	pe_l;
+o sc.data.p  offson-g tk Moooooo ption_t vc
 	>vg[>lvry(( << 9)]->pmin_bl)r-{vc 	> berGesleep_on (y&een
 it/ginnintk ,*k M bersector_tmp = rsector_sav;e_ ,*k M beud *__mp  be=trd *_sav;e_ ,*******goto l g *econd re itnex  ,rGe}ig ,*} tfo 	>+
+statisize,>lv_Jer	V_NWRITEAv)mmaii % rwn=20WRITE || rwn=20WRITEA)v)July-Autioii % rwn=20WRITE)v)Ju the tk Moooi      vNIize = l[nhnd_].te);
sven tk Muly-Autiooooi      vNIize = l[nhnd_].utadsven ter 	>+
+snapshot , use hexceftwarnhand(d loarn*ages = (oaceouhaddrD
dcb inv /er 	>rf	(	l      hNBD
dc&	(	n vSNAPSHOT |	n vSNAPSHOT_ORG)r--0,,ctors+
+origin= (
+		u_ed, use h /er 	>tiorf	(	l      hNBD
dc&	n vSNAPSHOT_ORG) -0,		INIT_WRITEAv)mmavR-rcaii % rwn=20WRITE || rwn=20WRITEA)v)July-AutiovR-rcaii % rwn=20WRITE)e_Ju the tk Moooooo{vc 	> berGetioe  	 *;
_ptrsig tk Moooooo pt+
+starte==U}
firsagsnapshot _b, loop aprugh
_initf ap_m(>lv_ ,* berGe pt	Wed  l
_ptr = ;4     snapshot_n
rd; tk Mooooooooo * lvPi _ptr !e_		returorsrGeoooooo * lvPi _ptr =Pi _ptr     snapshot_n
rd) -0,	o * lvPd>n;(&i _ptr     snapshot_sem)n tk M berGe ption+
+do we+stie_phav hexceftwarnstorage 	Wede-s,gsnapshot "ys_?sree_ 	>tio 	> berGe;) % i _ptr     l);
+oexceftwarn!2000
@@ -0,			kd *__p_ +	err 			uthe execeadi __sectorsig t			_ +	ee=trd *__mpsig			_ sector = rsector_tmptur			;) %!l g *napshot_re it/l);
+(&rd *__mp,ur						 berGe&rsector_tmp
);						 berGepmintart
);						 berGei _ptr))tk				+
+aV
Sti a new  itpd lo /er				rnty ol g *napshot_COW(rd *__mp,ur						 berGe rsector_tmp
);						 berGeepmintart
);						 berGe rsector_sav
);						 berGe i _ptr)tur			ud *__mp  be=t_ +	err 			rsector_tmp = __sectorsigk M berGe ption}tk	 berGe up(&i _ptr     snapshot_sem)n tk M berGe pt}tk ,* berGe}tk-rcke_}onst c-0,,ctors rs+
+g  it snapshot 
+		u_ed, use h /er	Pd>n;(&i      snapshot_sem)n tk M berGerf	(	l      l);
+oexceftwarn!2000
@@ tk Moooooooooi oa*napshot_re it/l);
+ (y&rd *__mp,e&rsector_tmp
epmintart
 lexter	_up(&i      snapshot_sem)n tk M be}ig ,*} tfo 	>bh->b r+	ee be=trd *__mpsig 	>bh->b rsector = rsector_tmpturerk Mut:
+	rut:tur} +
+int  it(()->lv_p p 	/*
-	 int  it(snapshot 
+		u_ed, use hste t_snaps - edsev, /erp 	/*
-	 eb, lnt  it(snapshot 
+		u_ed, use hste t_snaps - edsev, /erp p 	/*
-	 ;
+ern= (ste t_snaps - edsev, /erp 	er	V_Nner6HD_ berp 	/*
-	 generSti "hard-opt,"+e_buev, /er max_lnt hd   "oe(,h =  *lat,o;
+
 << 9)e{* tio;
+
l2.3=oeturn  	>f) % vg[>lvry(( << 9)]n=2000
@ || tk Mooooovg[>lvry(( << 9)]->lv[LVvry(( << 9)]n 2000
@@ g size;e_ ,*l2.3=ol g * rl2.3( vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv   "o)	- 5;e_ ,*lvt  emcpyd(_lat,/&vg[>lvry(( << 9)]->lv[LVvry(( << 9)]->lv   "o[5],*l2.)n tk Mlat[l2.]  of
+ 7erg size;e_}0,Ju the tfop 	/*
-	 e-s,gone never6d suldLbeEcalled...ap->lv_	erc
+ *
+ * Copyright (ask =,=Hc_ofTest(y_rd3,M30_MAlksize, max_lnt iummy_oaceouo scuesag% rscuesa_cueunit(*()* July-Aulksize, max_lnt iummy_oaceouo scuesag%  max igJu the t{* ti* ret;
+ 	int EMER_fo 	>ooooooooage * poops,*got_lnt rscuesa f r %02d:%02d [sector: %lu]\n = tk MooooooooNAPSHOT
C tk MooooooooMAdr)m(tCURRENT->rq d *), tk MooooooooM+		lm(tCURRENT->rq d *), tk MooooooooCURRENT->sector);0,erg size;e_}0,p p 	/*
-	 charD
d d_oaceouhste t_snaps - ed VGDA+aV
Stiap->lv_;
+
do_vg+iV
Sti (o;
+
 << 9,o max_*av_)e{* tio;
+
snaporg_ << 9;
+f
+ 7erueadi  lCOp;e_ ,*lv+	 lvnex bevgit(*vgiptrsig tk Mrf	(	vg[>lvCHR( << 9)]6!2000
@@ g sizeo-EPERMturn ,ctii % % vgiptr;
+ka(rs)
v( snk_si %  g+	), GFPptemRe)n=2000
@@ -0,,ctors* ret;
+ 	int CRITg  Mooooooooot * age *-O>lvCREATE:+ka(rs)
v* calcVGco%d, ne %ddr = tk Mooooooooo * ;4g  -- CO__LINE__)tertio * ut:
+	r-ENOMEM;ig ,*} tfo 	>+
+ion-ap_ptx_f %la V==sout:
e Foi /er 	>rf	(	hyct f
+	_w *r ( vgiptr, ar;
+unk_si %  g+	))rnapsh -0,,ctorsk"ys_d(_vgiptr)tertio * ut:
+	r-EFAULnsig ,*} tfo 	>+
+we+aFoinon-apat D
dife so far...i /er 	>vgiptr->vg ouh_tic&= ~>lvACTIVEnex bevg[>lvCHR( << 9)]6  vgiptrsig tk Mvg[>lvCHR( << 9)]->pmihintma ed 
+f
+ 7errf	(	vg[>lvCHR( << 9)]->p  +	x (aABS6MAX)PV@ -0,,ctors* ret;
+ 	int WARNIN_fo 	>oooooooooLocage *-OCab't D
difSti VG: ABS6MAX)PV too sa(rsdr = tk Mooooooooo * ;4g  -- )tertio * k"ys_d(_vg[>lvCHR( << 9)])n tk M bevg[>lvCHR( << 9)]6  		returorsrGeut:
+	r-EPERMtur be}+ 7errf	(	vg[>lvCHR( << 9)]->l  +	x (aABS6MAX)LV@ -0,,ctors* ret;
+ 	int WARNIN_fo 	>oooooooooLocage *-OCab't D
difSti VG: ABS6MAX)LV too sa(rs f r %udr = tk Mooooooooo * ;4g  -- COvg[>lvCHR( << 9)]->l  +	x)tertio * k"ys_d(_vg[>lvCHR( << 9)])n tk M bevg[>lvCHR( << 9)]6  		returorsrGeut:
+	r-EPERMtur be}+ fo 	>+
+ion-ap_p*ages = (t org_ out:
e Fosi /er 	>vg[>lvCHR( << 9)]->p  D
d = vg[>lvCHR( << 9)]->p  cureeorg_er 	>	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  +	xg_ptor-{vc 	> be+
+w *r t;
+ faddrD
dc /er 	>tiorf	(	% pvp = vg[>lvCHR( << 9)]->p [p])n!2000
@@ -0,,ctors-rcvg[>lvCHR( << 9)]->p [p]n
+ka(rs)
v( snk_si % pv+	), GFPptemRe;ig ,* berGerf	(	vg[>lvCHR( << 9)]->p [p]n
2000
@@ -0,,ctors-rcke_* ret;
+ 	int CRITg  Mooooooooot * oot * age *-O>lvCREATE:+ka(rs)
v* calcPV o%d, ne %ddr = tk Mooooooooo * lvPLoc;4g  -- CO__LINE__)tertio * lvPLocdo_vg+insct 
+  << 9)turk M betio * ut:
+	r-ENOMEM;ig ,*rGe pt}tk ,* berGerf	(	hyct f
+	_w *r ( vg[>lvCHR( << 9)]->p [p], pvp
 tk Mooooooooot * lvPLock/lvc
 	>unk_si % p, 	))rnapsh -0,,ctorslvPLocdo_vg+insct 
+  << 9)turk M betio * ut:
+	r-EFAULnsig ,* berGe}ig t,ctors rs+
+We
 *b't neesnap_pPEd, pe tavR-rcke_fu
;
gf ( lvut;
+ fa V==U}
V_LVpnit(, pec(ss_dbelow)sree_ 	>tio 	>vg[>lvCHR( << 9)]->p [p]->peee_		retur 	>tio 	>vg[>lvCHR( << 9)]->p [p]->peihintma ed 
+f
+ 7ertio 	>vg[>lvCHR( << 9)]->p [p]->pv ouh_tic=fPV_ACTIVE
+ 7ertio 	>vg[>lvCHR( << 9)]->p  D
dven tk M berGevg[>lvCHR( << 9)]->p  curven ter	er	V_Nner60P
+INght);
+
lvPLoc/	 ;
 *rt D iummyeanta)1	Wedfs +	y_mle ((ree_ 	>tio 	>vg[>lvCHR( << 9)]->p [p]->anta)1= tk Moooooooooi oaion,+4ta)1(yvg[>lvCHR( << 9)]->p [p]->p  d *);erJu the tk Mooo}ur be}+ fo 	>+
+ion-ap_p
+		u_ed, use hsut:
e Fosi /er 	>vg[>lvCHR( << 9)]->l  cureeorger 	>	Wed  lctorg_l==Mvg[>lvCHR( << 9)]->l  +	xg_ltor-{vc 	> be+
+w *r t;
+ faddrD
dc /er 	>tiorf	(	% lvp = vg[>lvCHR( << 9)]->l [l])n!2000
@@ -0,,ctors-rcrf	(	hyct f
+	_w *r ( &lv
 lep,lunk_si % lv+	))rnapsh -0,,ctorslvPLocdo_vg+insct 
+  << 9)turk M betio * ut:
+	r-EFAULnsig ,* berGe}ig 	>tio 	>vg[>lvCHR( << 9)]->  [l]ne_		retur	 -0,		o;
+
* csig t		
* cne_do_l  cV
Sti( << 9,olv.   HOT
CO&lexter		crf	(* c)tk		 -0,			cdo_vg+insct ( << 9)tur			cut:
+	r* csig		c}tk ,* berGe}tk-rcke_}tk-rc}+ fo 	>+
+Second paU}
to	hyrrect(snapshot 
+		u_ed, use  V=hich+aFoinonur ,*orsnh pl
+ fdurd lofirsagpaU}
abct r /er 	>	Wed  lctorg_l==Mvg[>lvCHR( << 9)]->l  +	xg_ltor-{vc 	> berf	(	vg[>lvCHR( << 9)]->l [l]n!2000
@-dev)mmavR-rcke_vg[>lvCHR( << 9)]->l [l]     hNBD
dc&	n vSNAPSHOT)({vc 	> berGesnaporg_ << 9;
+vg[>lvCHR( << 9)]->l [l]     snapshot_ << 9;ig ,* berGerf	(	vg[>lvCHR( << 9)]->lv[LVvry((snaporg_ << 9)]n!2000
@@ -0,,ctors-rcke_+
+ion-po;
+er
to	origin= (
+		u_ed, use h /er 	>tiorGetioe  	 *;
_ptr;
+vg[>lvCHR( << 9)]->l [l]     snapshot_ov_io tk Mooooooooot * lvPLock/lvcvg[>lvCHR( << 9)]->lv[LVvry((snaporg_ << 9)]sig tk Moooooo pt+
+set neBD
daryofieldicsi origin= (
+		u_ed, use h /er 	>tiorGetioe  ptr     hNBD
dc|=	n vSNAPSHOT_ORG;er 	>tiorGetioe  ptr     snapshot_ << 9y of
+ 7er_head ke_e  ptr     snapshot_ov_io ;
_ptrsig7er_head ke_e  ptr     snapshot_pr	ee=t		retur tk Moooooo pt+
+fib, last(snapshot 
+		u_ed, use snh ap_pchainh /er 	>tiorGetio=hito (yi _ptr     snapshot_n
rdn!2000
@@ tk MooooooooolvPi _ptr =Pi _ptr     snapshot_n
rdsig tk Moooooo pt+
+set ban =po;
+er
to	e-s,glast(one inhourenew 
+		u_ed, use h /er 	>tiorGetiovg[>lvCHR( << 9)]->l [l]     snapshot_pr	ee=t;
_ptrsig tk Moooooo pt+
+last(
+		u_ed, use hnow=po;
+s
to	ourenew snapshot , use h /er 	>tiorGetioe  ptr     snapshot_n
rdn
+vg[>lvCHR( << 9)]->l [l]sig tk Moooooo pt+
+now=po;
+
to	e-eenew one  /er 	>tiorGetioe  ptr =Pi _ptr     snapshot_n
rdsig tk Moooooo pt+
+set neBD
daryofieldicsi new snapshot 
+		u_ed, use h /er 	>tiorGetioe  ptr     snapshot_n
rdn
+		returorsrGeooooooe  ptr     vNIize = lio tk Mooooooooot *vg[>lvCHR( << 9)]->lv[LVvry((snaporg_ << 9)]     vNIize = lturorsrGeooooooe  ptr     hintma ed_(l o tk Mooooooooot *vg[>lvCHR( << 9)]->lv[LVvry((snaporg_ << 9)]     hintma ed_(ltertio * lvPLoce  ptr     vNIize =llio tk Mooooooooot *vg[>lvCHR( << 9)]->lv[LVvry((snaporg_ << 9)]     vNIize =(ltertio * lvPLoce  ptr     unk_ = tk Mooooooooot *vg[>lvCHR( << 9)]->lv[LVvry((snaporg_ << 9)]     snk_tur ,*orsrGe}tk-rcke_}tk-rc}+ fo 	>vg+ile (ven ter 	>+
+let's go D
dife  /er 	>vg[>lvCHR( << 9)]->vg ouh_tic|=	>lvACTIVEnexer	er	V_NMODk;
+	oooMOD 	{Cptemuf 5NOsigJu the t  Mut:
+	retur} +
+do_vg+iV
Sti ()->lv_p p 	/*
-	 charD
d d_oaceouhste t_snaps - ed VGDA+insct ev, /erlksize, 200do_vg+insct 
+ ;
+
 << 9)e{* tio;
+
isig tk Mrf	(	vg[>lvCHR( << 9)]6 2000
@@ g sizeo-ENXIOturer	er	V_Nner6TOTALLock/lvc 	>f) % vg[>lvCHR( << 9)]->l  mmax3>M0= RQ0  HFos/n,ng *d>n;leapsh tJuly-Autioii % vg[>lvCHR( << 9)]->l  mmax3>M0)e_Ju the tk Mooog sizeo-EPERMturn ,ct+
+let's go _dD
dife( /er 	>vg[>lvCHR( << 9)]->vg ouh_tic&= ~>lvACTIVEnexn ,ct+
+"ys_dV_LV /er 	>+
+firsag"ys_dsnapshot 
+		u_ed, use  V /er 	>	Wed  ictorg_i==Mvg[>lvCHR( << 9)]->l  +	xg_itor-{vc 	> berf	(	vg[>lvCHR( << 9)]->l [i]n!2000
@-dev)mmavR-rcke_vg[>lvCHR( << 9)]->l [i]     hNBD
dc&	n vSNAPSHOT)({vc 	> berGedo_l  insct 
+  << 9,000
@, i)turk M betiovNIize ->stateee_TASK 	{TERRUPTIBLE
+ 7ertio 	>scheM   _req ouag% 1)n tk M be}ig ,*} t_t +
+th2.3fys_de-eeresa  /er 	>	Wed  ictorg_i==Mvg[>lvCHR( << 9)]->l  +	xg_itor-{vc 	> berf	(	vg[>lvCHR( << 9)]->l [i]n!2000
@)({vc 	> berGedo_l  insct 
+  << 9,000
@, i)turk M betiovNIize ->stateee_TASK 	{TERRUPTIBLE
+ 7ertio 	>scheM   _req ouag% 1)n tk M be}ig ,*} tn ,ct+
+"ys_dPV V /er 	>	Wed  ictorg_i==Mvg[>lvCHR( << 9)]->p  +	xg_itor-{vc 	> berf	(	vg[>lvCHR( << 9)]->p [i]n!2000
@)({vc		INIT_LIST_HVFREt);
+
lvPLoc* ret;
+ 	int LIST_fo 	>oooooooooLock/lage * pk"ys_d% dr =SNAPSHOT
CO__LINE__)terJu the t	er	V_Nner60P
+INght);
+
lvPLocNAPSclear,+4ta)1(yvg[>lvCHR( << 9)]->p [i]->anta))terJu the tPLock/lvck"ys_d(_vg[>lvCHR( << 9)]->p [i])
+ 7ertio 	>vg[>lvCHR( << 9)]->p [i] e_		returorsrGe}ig Ge}ig t		INIT_LIST_HVFREt);
+
* ret;
+ 	int LIST_lage * pk"ys_d% dr =SNAPSHOT
CO__LINE__)terJu the t * k"ys_d(_vg[>lvCHR( << 9)])n tk Mvg[>lvCHR( << 9)]6  		returfo 	>vg+ile (--nexer	er	V_NMODk;
+	oooMOD DECptemuf 5NOsigJu the t  Mut:
+	retur} +
+do_vg+insct 
+)->lv_p p 	/*
-	 charD
d d_oaceouhste t_snaps - ed 
+		u_ed, use haV
Stiap->lv_lksize, 200do_l  cV
Sti (o;
+
 << 9,oh =  *;
   "o,oe  	 *;
)e{* tio;
+
l,*l2,*l_n
wCOp, unk_tur ,*ueadi    ouh_ti_save;e_ ,*lv+l);
+oexceftwarit *;
be = ;4     l);
+oexceftwar;e_ ,*lv+	 *;
 ptr =P		returfo 	>rf	(	% pep = ;4     vNIize = l)6 2000
@@ g sizeo-EINVAL;tk ,*rf	(	l      chunk s_bl >Nner6SNAPSHOT_MAX)CHUNK@ g sizeo-EINVAL;tker 	>	Wed  lctorg_l==Mvg[>lvCHR( << 9)]->l  +	xg_ltor-{vc 	> berf	(	vg[>lvCHR( << 9)]->l [l]n!2000
@-de  tk MooooooooNAPSstrcmp	(	vg[>lvCHR( << 9)]->l [l]     HOT
COlv   "o)	eapsh tavR-rcke_g sizeo-EEXISnsig ,*} tfo 	>+
+inhny
+ si l  insct (),	l  bV
Sti() pair;>	Wedeg.	l ize "oedo  Ve-s,g /er 	>l_n
wcto-1tur * rf	(	vg[>lvCHR( << 9)]->l [l
     Humber]6 2000
@@ l_n
wctol
     Humberterooonst c{er 	>tio	Wed  lctorg_l==Mvg[>lvCHR( << 9)]->l  +	xg_ltor-{vc 	> be berf	(	vg[>lvCHR( << 9)]->l [l]n 2000
@@ rf	(	l_n
wctto-1@ l_n
wctoln tk M be}ig ,*} t_t rf	(	l_n
wctto-1@ ut:
+	r-EPERMtur belctol_n
wturfo 	>rf	(	% ;
 ptr =Pka(rs)
v( snk_si % lv+	), GFPptemRe)n=2000
@@ -;0,,ctors* ret;
+ 	int CRITlage * pn vCREATE:+ka(rs)
v* calcLVco%d, ne %ddr = tk Mooooooooo * lvPLock/lv;4g  -- CO__LINE__)tertio * ut:
+	r-ENOMEM;ig ,*} tfo 	>+
+hycts* e;_aded LVg /er 	>lvt  emcpyd(_(6g = *) ;
 ptr,e(,h =  *) ;
,lunk_si % lv+	))turfo 	>   ouh_ti_save =Pi _ptr     suh_ti;e_ ,*lv+ptr     suh_tic&= ~LV_ACTIVE
+ 7ere  ptr     snapshot_ov_io o\ex&,,e  ptr     snapshot_pr	ee=t\ex&,,e  ptr     snapshot_n
rdn
+		returorsi _ptr     l);
+oexceftwarn
+		retur	erc
+ *
+ * Copyright <ask =,=Hc_ofTes(_rd3,M4)ex&,,e  ptr     snapshot_sem;
+
UTEX; tJuly-Autioinita
UTEX(&i _ptr     snapshot_sem)n tJu the t  Mvg[>lvCHR( << 9)]->  [l]ne_;
_ptrsig tk M+
+ion-ap_pPEhsut:
e Fosif
+	+w *r t;
+ fifVe-s,vc 	> bers no snapshot 
+		u_ed, use h /er 	>f) % !3( ;
 ptr     hNBD
dc&	n vSNAPSHOT))-{vc 	> besnk_ = e  ptr     hintma ed_(l *lunk_si % pnit)tertio * rf	(	% ;
 ptr     vNIize = lio_va(rs)
v( s_bl)r-
2000
@@ -0,,ctors-rc* ret;
+ 	int CRITg  Mooooooooot * ootage * pn vCREATE:+va(rs)
v* calcLV_CURRENT_PEhsi %d Byti "g  Mooooooooot * ootao%d, ne %ddr = tk Mooooooooo * lvP;4g  -- CO    ,___LINE__)terJ	INIT_LIST_HVFREt);
+
lvPLoc* ret;
+ 	int LIST_lage * pv"ys_d% dr =SNAPSHOT
CO__LINE__)terJu the tPLock/lvck"ys_d(_i _ptr)tur 	>tio 	>vg[>lvCHR( << 9)]->  [l]ne_		retur betio * ut:
+	r-ENOMEM;ig ,*rGe}+ 7er0,,ctorsrf	(	hyct f
+	_w *r ( ;
 ptr     vNIize = l
epmp
k     @ -0,,ctors-rcv"ys_d(_i _ptr     vNIize = l); tPLock/lvck"ys_d(_i _ptr)tur 	>tio 	>vg[>lvCHR( << 9)]->  [l]ne_		retur betio * ut:
+	r-EFAULnsig ,* be}ig tk Mooo+
+hyrrect(ap_pPEhile (+inhPV V /er 	>tio	Wed  lectorg_le <ae  ptr     hintma ed_(lg_letor-{vc 	> be bevg[>lvCHR( << 9)]->pmihintma edven tk M berGe	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  cur;_ptor-{vc 	> berGetiorf	(	vg[>lvCHR( << 9)]->p [p]->p  d *-
2 tk Mooooooooo * lvi _ptr     vNIize = l[le].+	e) tk Mooooooooot *vg[>lvCHR( << 9)]->p [p]->peihintma edven tk M berGe}tk-rcke_}tk-rc}onst c{er 	>tio+
+Get(snapshot exceftwarndata _b, l);
+ , pec /er 	>tiorf	(	l ben!2000
@)({vc 	> berGee  ptr     snapshot_ov_ioer 	>tiorGetiovg[>lvCHR( << 9)]->l [LVvry((e  ptr     snapshot_ << 9)]tur ,* berGe;) % i _ptr     snapshot_ov_i!2000
@@ -0,,ctors-rcke_snk_ = e  ptr     re it/u t *lunk_si % lv+l);
+oexceftwarit)
+ 7erors-rcke_ii % % i _ptr     l);
+oexceftwarn
+va(rs)
v( s_bl)r-
2000
@@ -0,,ctors-rc-rcke_* ret;
+ 	int CRITg  Mooooooooot * oot * ootage * pdo_l  cV
Sti:+va(rs)
v* calcLV_BLOCK_EXCEPTTes " tk Mooooooooot * lvPLock/"si %d byteco%d, ne %ddr = tk Mooooooooo * lvPLock/l;4g  -- CO    ,___LINE__)terJ	INIT_LIST_HVFREt);
+
lvPLoclvPLoc* ret;
+ 	int LIST_lage * pv"ys_d% dr =SNAPSHOT
CO__LINE__)terJu the tPLock/lvcck/lvck"ys_d(_i _ptr)tur 	>tio 	>tio 	>vg[>lvCHR( << 9)]->  [l]ne_		retur betio * tio * ut:
+	r-ENOMEM;ig ,*rGe ptrGe}tk-rcke_+ 7erors-rcke_ii % hyct f
+	_w *r ( ;
 ptr     l);
+oexceftwar,	l be
k     @ -0,,ctors-rcors-rcv"ys_d(_i _ptr     l);
+oexceftwar)tur 	>tio 	>tio 	>k"ys_d(_i _ptr)tur 	>tio 	>tio 	>vg[>lvCHR( << 9)]->  [l]ne_		retur betio * tio * ut:
+	r-EFAULnsig ,* berGevc
}ur tk Moooooo pt+
+ion-po;
+er
to	origin= (
+		u_ed, use h /er 	>tiorGetioe  ptr =Pi _ptr     snapshot_or;terer 	>tiorGetioe  ptr     snapshot_ << 9y of
+ 7er_head ke_e  ptr     snapshot_ov_io ;
_ptrsig7er_head ke_e  ptr     snapshot_pr	ee=t		returk Moooooo pt+
+walk aprugh
ap_psnapshot 
 pec /er 	>tiorGetio=hito (yi _ptr     snapshot_n
rdn!2000
@@ tk MooooooooolvPi _ptr =Pi _ptr     snapshot_n
rdsigk Moooooo pt+
+now=i _ptr po;
+s
to	ap_p
ast(exisiz losnapshot nh ap_pchainh /er 	>tiorGetiovg[>lvCHR( << 9)]->l [l]     snapshot_pr	ee=t;
_ptrsigk Moooooo pt+
+ourenew one now=ban =po;
+s
to	ap_ppr	eiou,glast(nh ap_pchainh /er 	>tiorGetio;
_ptr;
+vg[>lvCHR( << 9)]->l [l]sigk Moooooo pt+
+now=i _ptr po;
+s
to	ourenew 
ast(snapshot 
+		u_ed, use s /er 	>tiorGetioe  ptr     snapshot_ov_io ;
_ptr     snapshot_pr	e     snapshot_or;ter 	>tiorGetioe  ptr     snapshot_n
rdn
+		returorsrGeooooooe  ptr     vNIize = liooe  ptr     snapshot_ov_     vNIize = lturorsrGeooooooe  ptr     hintma ed_(l ooe  ptr     snapshot_ov_     hintma ed_(ltertio * lvPLoce  ptr     vNIize =lliooe  ptr     snapshot_ov_     vNIize =(ltertio * lvPLoce  ptr     unk_ =oe  ptr     snapshot_ov_     snk_tur ,*orsrGe ,*lv+ptr     su ipes3=oe  ptr     snapshot_ov_     st ipes; tk MooorGe ,*lv+ptr     su ipesnk_ =oe  ptr     snapshot_ov_     st ipesnk_tur	oooo{vc		;
+
* csig t		* cne_i oa*napshot_hintm(i _ptr)tur		rf	(* c)tk		-0,			v"ys_(i _ptr     l);
+oexceftwar)tur			k"ys_(i _ptr)tur			vg[>lvCHR( << 9)]->  [l]ne_		retur			rnt
+	r* csig		}tk	 ber}tk ,* berGe}onst c-0,,ctors rs-rcv"ys_d(_i _ptr     l);
+oexceftwar)tur 	>tio 	>tiok"ys_d(_i _ptr)tur 	>tio 	>tiovg[>lvCHR( << 9)]->  [l]ne_		retur betio * tiout:
+	r-EFAULnsig ,* berGe}ig 	>tio}onst c-0,,ctors rsk"ys_d(_vg[>lvCHR( << 9)]->l [l])tur 	>tio 	>vg[>lvCHR( << 9)]->  [l]ne_		retur betio * ut:
+	r-EINVAL;tk ,*ke_}tk-rc}o+
+if	(	vg[>lvCHR( << 9)]->l [l]     hNBD
dc&	n vSNAPSHOT)(>lv_p _t ;
_ptr;
+vg[>lvCHR( << 9)]->l [l]sigk Mi oaionopt,.part[M+		l(i _ptr     +	e)].ntart_secty of
+ 7eri oaionopt,.part[M+		l(i _ptr     +	e)].nr_sects3=oe  ptr     snk_tur ,*i oa*nk_[M+		l(i _ptr     +	e)]3=oe  ptr     snk_ >>p1nex bevgil  +	p[M+		l(i _ptr     +	e)].vg  umber;
+vg[>lvCHR( << 9)]->vg  umbernex bevgil  +	p[M+		l(i _ptr     +	e)].   Humber3=oe  ptr      umbernex bener6CORRECT_READ_AHEADd(_i _ptr     utad_a		ch)
+ 7erg ad_a		ch[MAdr)_NR] = e  ptr     read_a		ch;er 	>vg[>lvCHR( << 9)]->l  curven tk Mlv+ptr     suh_tic=    ouh_ti_save;e_ tk M+
+oftwarhinyfadd	ourenew snapshot LVg /er 	>;) % i _ptr     hNBD
dc&	n vSNAPSHOT)({vc 	> be+
+sync ap_porigin= (
+		u_ed, use h /er 	>tiofsync d *-(oe  ptr     snapshot_ov_     d *);erke_ be+
+put	ourselve into	ap_pchainh /er 	>tio;
_ptr     snapshot_pr	e     snapshot_n
rdn
+;
_ptrsigk Moooe  ptr     snapshot_ov_     hNBD
dc|=	n vSNAPSHOT_ORG;er 	>}urerk Mut:
+	retur} +
+do_l  cV
Sti ()->lv_p p 	/*
-	 charD
d d_oaceouhste t_snaps - ed 
+		u_ed, use hinsct ev, /erlksize, 200do_l  insct 
+ ;
+
 << 9,oh =  *;
   "o,o;
+
l)({vc 	>u;
+
l2COp;e_ ,*lv+	 *;
_ptrsig tk M;) % ictto-1@ {er 	>tio	Wed  lctorg_l==Mvg[>lvCHR( << 9)]->l  +	xg_ltor-{vc 	> be berf	(	vg[>lvCHR( << 9)]->l [l]n!2000
@-dev)mmavR-rcke_oooNAPSstrcmp	(	vg[>lvCHR( << 9)]->l [l]     HOT
COlv   "o)	eapshc-0,,ctors rs-rcbV
Sktur ,*orsrGe}tk-rcke_}tk-rc}+ fo 	>;
_ptr;
+vg[>lvCHR( << 9)]->l [l]sigk M;) % ic=Mvg[>lvCHR( << 9)]->l  +	x)({vc		INIT_ner6TOTALLock/lvc 	> 	>;) % i _ptr     mmax3>M0= RQ0  HFos/n,ng *d>n;leapsh tJuly-Autio 	>;) % i _ptr     mmax3>M0)e_Ju the tk Moooooout:
+	r-EBUSY;ig tk Mooo+
+hson =	Weddele- ed tf snapshot sourouh=hitovc 	> berGesnapshot , use hstie_pexisidc /er 	>tiorf	(	% lv_ptr     hNBD
dc&	n vSNAPSHOT_ORG) dev)mmavR-rcke_i _ptr     snapshot_n
rdn!2000
@@ tk Moooooog sizeo-EPERMturn ,ctk Mlv+ptr     suh_tic|=	n vSPINDOWN;ig tk Mooo+
+sync ap_pbatencsh /er 	>tiofsync d *-(oe  ptr     d *);ern ,ctk Mlv+ptr     suh_tic&= ~LV_ACTIVE
+  tk Mooo+
+invalidSti ap_pbatencsh /er 	>tioinvalidSti_batencsh(oe  ptr     d *);ern ,ctk M+
+g set generze,hdh /er 	>tio;
oaionopt,.part[M+		l(i _ptr     +	e)].ntart_secty o-1tur * 7eri oaionopt,.part[M+		l(i _ptr     +	e)].nr_sects3=o0tur * 7eri oa*nk_[M+		l(i _ptr     +	e)]3=o0;ern ,ctk M+
+g set VG/LVg itpd lo /er 	> bevgil  +	p[M+		l(i _ptr     +	e)].vg  umber;
+ABS6MAX)VGger 	> bevgil  +	p[M+		l(i _ptr     +	e)].   Humber3=o-1tur *  tk Mooo+
+hyrrect(ap_pPEhile (+inhPV VifVe-s,ers no snapshot 
+		u_ed, use h /er 	> 	>f) % !3( ;
 ptr     hNBD
dc&	n vSNAPSHOT))-{vc 	> bek M+
+o:
e ifVe-s,ers no snapshot 
+		u_ed, use hbecaut cwe+s = -Autiooooooooooap_p
  vNIize = l[]hsut:
e V==U}
ap_porigin= (
+		u_ed, use h /er 	>tiotio	Wed  lectorg_le <ae  ptr     hintma ed_(lg_letor-{vc 	> be be bevg[>lvCHR( << 9)]->pmihintma ed--nex ,* berGe pt	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  cur;_ptor-{vc 	> berGetio 	>f) % 	vg[>lvCHR( << 9)]->p [p]->p  d *-
2 tk Mooooooooo * lv* lvi _ptr     vNIize = l[le].+	e) tk Mooooooooot *t *vg[>lvCHR( << 9)]->p [p]->peihintma ed--nex ,* berGe pt}ig ,* berGe}ig ,* berGev"ys_d(_i _ptr     vNIize = l); tPLock/+
+n vSNAPSHOT  /er 	>tio}onst c-0,/*ur ,* berGe;) % i _ptr     l);
+oexceftwarn!2000
@@ -0,avR-rcke_fu
;
+
isig 	>tio 	>tiokd *__p
ast +	err avR berGe pt	Wed  icto
ast +	ectorg_i==Me  ptr     re it/ptrs_itor-{vc 	> be ,* berGe;) % i _ptr     l);
+oexceftwar[i].rd *_new !to
ast +	e@ -0,,ctors-rcke_fu
 be
ast +	ectoi _ptr     l);
+oexceftwar[i].rd *_newtertio * lvPLock/lvc
rnvalidSti_batencsh(oeast +	e@;erke_fu
 ption_t ke_cNIize ->stateee_TASK 	{TERRUPTIBLE
+ 7ertio 	>7ertio 	>scheM   _req ouag% 1)n tk M berGe ption}tk ,* berGetio}tk ,* berGe}tk /er 	>tiotio+
+g  ct 
e-s,gsnapshot 
+		u_ed, use hf
+	+ap_pchainh /er 	>tiorGe;
_ptr     snapshot_pr	e     snapshot_n
rdn
+;
_ptr     snapshot_n
rdsigk Moooooo;) % i _ptr     snapshot_n
rdn!2000
@@o{vc 	> berGetioe  ptr     snapshot_n
rd     snapshot_pr	ee= tk MooooooooolvPi _ptr     snapshot_pr	esig ,* berGe}ig 	>tio 	>+
+no mor_psnapshots?sree_ 	>tio 	>;) % i _ptr     snapshot_ov_     snapshot_n
rdn
2000
@@ tk Moooooooooi  ptr     snapshot_ov_     hNBD
dc&= ~LV_SNAPSHOT_ORG;er	oi oa*napshot_releas_(i _ptr)turrGevc
}ur tJ	INIT_LIST_HVFREt);
+
lvP* ret;
+ 	int LIST_lage * pk"ys_d% dr =SNAPSHOT
CO__LINE__)terJu the t * tiok"ys_d(_i _ptr)tur 	>tiovg[>lvCHR( << 9)]->  [l]ne_		retur betiovg[>lvCHR( << 9)]->l  cur--nex ,* beut:
+	retur * }0, tk Mg sizeo-ENXIOtur} +
+do_l  insct 
+)->lv_p p 	/*
-	 charD
d d_oaceouhste t_snaps - ed 
+		u_ed, use h
rdevd /Mg duc ev, /erlksize, 200do_l  
rdevd_g duc  (o;
+
 << 9,oh =  *;
   "o,oe  	 *;
)e{* tio;
+
l,*l2,*p
k    ,_old hintma ed_(ltertiou;
+32 	 evd,    ouh_ti_save;e_ ,*pnit(*peturfo 	>rf	(	% pep = ;4     vNIize = l)6 2000
@@ g sizeo-EINVAL;tker 	>	Wed  lctorg_l==Mvg[>lvCHR( << 9)]->l  +	xg_ltor-{vc 	> berf	(	vg[>lvCHR( << 9)]->l [l]n!2000
@-dev)mmavR-rcke_NAPSstrcmp	(	vg[>lvCHR( << 9)]->l [l]     HOT
COlv   "o)	eapsh tavR-rcke_bV
Sktur ,*} tk M;) % icttovg[>lvCHR( << 9)]->l  +	x)(g sizeo-ENXIOturerooo+
+hson =	WedD
dife snapshot  /er 	>rf	(	l      hNBD
dc&	(	n vSNAPSHOT|n vSNAPSHOT_ORG)r-g sizeo-EPERMturn ,ctii % %  lio_va(rs)
v( s_bl = ;4     vNIize =(l *lunk_si % pnit)e)n=2000
@@ -0,,ctors* ret;
+ 	int CRITg  Mooooooooot * age *-Odo_l  
rdevd_g duc :+va(rs)
v* calcLV_CURRENT_PEh" tk Mooooooooot *"si %d Byti o%d, ne %ddr = tk Mooooooooo * ;4g  -- CO    ,___LINE__)tertio * ut:
+	r-ENOMEM;ig ,*} tfo 	>+
+ion-ap_pPEhsut:
e Fosif
+	+w *r t;
+ f /er 	>rf	(	hyct f
+	_w *r (  l
epmp
k     @ -0,,ctorsv"ys_d(_pe)tertio * ut:
+	r-EFAULnsig ,*} tfoJ	INIT_LIST_		ooo* ret;
+ 	int LIST_fo 	>oooooooooage *-ofsync d *-_b, "fo 	>oooooooooarnvalidSti_batencshf r %s [%s]+inh%s\n = tk Mooooooooo;4g  -- COvg[>lvCHR( << 9)]->l [l]     HOT
Cig 	>tio 	>tiokd *  "oe(,vg[>lvCHR( << 9)]->l [l]     d *), tk Moooooooo+vg[>lvCHR( << 9)]->vg  -- )terJu the tfo 	>vg[>lvCHR( << 9)]->l [l]     suh_tic|=	n vSPINDOWN;igtiofsync d *-(ovg[>lvCHR( << 9)]->l [l]     d *);fo 	>vg[>lvCHR( << 9)]->l [l]     suh_tic&= ~LV_ACTIVE
+ 7errnvalidSti_batencsh(ovg[>lvCHR( << 9)]->l [l]     d *);fofo 	>+
+g duc  hintma  PAGile (ncshonhPV(s)r /er 	>	Wed  lectorg_le <avg[>lvCHR( << 9)]->l [l]     hintma ed_(lg_letor-{vc 	> bevg[>lvCHR( << 9)]->pmihintma ed--nex ,* be	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  cur;_ptor-{vc 	> berGef) % 	vg[>lvCHR( << 9)]->p [p]->p  d *-
2 tk Mooooooooo * vg[>lvCHR( << 9)]->l [l]     vNIize = l[le].+	e)-{vc 	> be be bevg[>lvCHR( << 9)]->p [p]->peihintma ed--nex ,* berGe ptbV
Sktur ,*orsrGe}tk-rcke_}tk-rc}+ fo		INIT_LIST_HVFREt);
+
* ret;
+ 	int LIST_lage * pv"ys_d% dr =SNAPSHOT
CO__LINE__)terJu the ter 	>+
+save po;
+er
to	"old"SNA/pe po;
+er
arrayr /er 	>pmp1;
+vg[>lvCHR( << 9)]->l [l]     vNIize = lturorsevd ;
+vg[>lvCHR( << 9)]->l [l]     vNIize =le;e_ tk M+
+save mmax3ile (ncg /er 	>lv mmax3=+vg[>lvCHR( << 9)]->l [l]     mmax;e_ tk M+
+save #csi old hintma ed 
+		u_ed
rdevts  /er 	>old hintma ed_(l3=+vg[>lvCHR( << 9)]->l [l]     hintma ed_(lterfo 	>+
+hycts* e;_aded LVg /er 	>lv ouh_ti_save =Pi      suh_ti;e_ ,*lv     suh_tic|=	n vSPINDOWN;igtio;
     ouh_tic&= ~LV_ACTIVE
+ 7ere t  emcpyd(_(6g = *) vg[>lvCHR( << 9)]->l [l],_(6g = *) ;
,lunk_si % lv+	))tur * vg[>lvCHR( << 9)]->l [l]     vNIize = l =	petur * vg[>lvCHR( << 9)]->l [l]     mmax3=+   mmax;e_ tk M+
+save availi	 (l6i/o+statisize,data  /er 	>+
+, near 
+		u_ed, use h /er 	>f) % vg[>lvCHR( << 9)]->l [l]     su ipes3< 2 r-0,,ctors+
+Cson =wpat 
ast(LE+s =llLbeEw *dh /er 	> 	>f) % evd >+vg[>lvCHR( << 9)]->l [l]     vNIize =leh tavR-rcke_evd 
+vg[>lvCHR( << 9)]->l [l]     vNIize =le;e_tiotio	Wed  lectorg_le <aevdg_letor-{vc 	> be bevg[>lvCHR( << 9)]->l [l]     vNIize = l[le].utads  =	pep1[le].utads;vc 	> be bevg[>lvCHR( << 9)]->l [l]     vNIize = l[le].te);
s =	pep1[le].te);
s;tk ,*ke_}tk-rc+
+st iped 
+		u_ed, use h /er 	>}onst c-0,,ctorsu;
+
i, j, sourou,_oast, evd, old ut ipe_    ,_new ut ipe_    ;ern ,ctk Mold ut ipe_     =	old hintma ed_(l3/ vg[>lvCHR( << 9)]->l [l]     su ipes;tk ,*ke_new ut ipe_    3=+vg[>lvCHR( << 9)]->l [l]     hintma ed_(l / tk Moooooo ption_t vc
 	>vg[>lvCHR( << 9)]->l [l]     su ipes;tk ,*ke_evd 
+old ut ipe_    ;er 	> 	>f) % evd >+new ut ipe_    )_evd 
+new ut ipe_    ;errGe pt	Wed  ictosourouh=_oasty of
+ 7er_head ke_i <avg[>lvCHR( << 9)]->l [l]     su ipes;_itor-{vc 	> be ,*	Wed  jctorg_j <aevdg_jtor-{vc 	> be be bevg[>lvCHR( << 9)]->l [l]     vNIize = l[oast+j].utads 2 tk Mooooooooo * pep1[sourou+j].utads;vc 	> be be bevg[>lvCHR( << 9)]->l [l]     vNIize = l[oast+j].te);
s = tk Mooooooooo * pep1[sourou+j].te);
s;tk ,*ke_rGe}ig ,* berGe ourouh+
+old ut ipe_    ;er 	> 	>rGedasty h+
+new ut ipe_    ;errGe pt}ig ,*} t_t v"ys_d(_pep1);>pmp1;
+		returfotk-rc+
+
rdevd ap_pPEhile (+inhPV V /er 	>	Wed  lectorg_le <avg[>lvCHR( << 9)]->l [l]     hintma ed_(lg_letor-{vc 	> bevg[>lvCHR( << 9)]->pmihintma edven tk M be	Wed  pctorg_p==Mvg[>lvCHR( << 9)]->p  cur;_ptor-{vc 	> berGef) % vg[>lvCHR( << 9)]->p [p]->p  d *-
2 tk Mooooooooo *vg[>lvCHR( << 9)]->l [l]     vNIize = l[le].+	e)-{vc 	> be be bevg[>lvCHR( << 9)]->p [p]->peihintma edven tk M berGe ptbV
Sktur ,*orsrGe}tk-rcke_}tk-rc}+ fo 	>;
oaionopt,.part[M+		l(vg[>lvCHR( << 9)]->l [l]     d *)].ntart_secty of
+ 7eri oaionopt,.part[M+		l(vg[>lvCHR( << 9)]->l [l]     d *)].nr_sects3=ur 	>tiovg[>lvCHR( << 9)]->  [l]     snk_tur ,*i oa*nk_[M+		l(vg[>lvCHR( << 9)]->l [l]     d *)]3=ur 	>tiovg[>lvCHR( << 9)]->  [l]     snk_ >>p1nex be+
+vgil  +	p
arrayrdo  b't hav hto	b_pchanged heFoi /erex bener6CORRECT_READ_AHEADd(_vg[>lvCHR( << 9)]->  [l]     utad_a		ch)
+ 7erg ad_a		ch[MAdr)_NR] = vg[>lvCHR( << 9)]->  [l]     utad_a		ch;fo 	>vg[>lvCHR( << 9)]->l [l]     suh_tic=    ouh_ti_save;e_ tk Mut:
+	retur} +
+do_l  
rdevd_g duc  ()->lv_p p 	/*
-	 ste t_snaps - ed initialik_ ionopt, vari	 (lsap->lv_	erNIT__ vnitaps 
+_ vnitaps g%  maxri oaionvnit(( st * heionopt, *i oaiopt,))tkJuly-Au maxr_ vnitri oaionvnit(( st * heionopt, *i oaiopt,)igJu the t{* ti
;
+
i3=o0;ern 		INIT_LIST_HGENDISK);
+
* ret;
+ 	int LIST_lage * pi oaionopt,dr =SNAPSHOT
)terJu the ter 	>	Wed  ictorg_i==MMAX)LV;_itor-{vc 	> bei oaionopt,.part[i].ntart_secty o-1t +
+a maxrparti  PAGison = /er 	>tio;
oa*nk_[i]ne_i oaionopt,.part[i].nr_sects3=o0tur * 7eri oal);
+*nk_s[i]ne_BLOCK_SIZE;ig ,*} tfo 	>bl+*nk_a*nk_[MAdr)_NR] = e oal);
+*nk_s;fo 	>bl+a*nk_[MAdr)_NR] = e oa    ;ern ,ctg size;e_} +
+int ion vnitr()->lv_p p 	er	V_Nner60P
+INght);	/*
-	 ste t_snaps - ed to	ion-an emptyeanta)*
-	*
-	 Gets3an emptyeanta)hto	b_p;
 *rted into	ap_panta)hhash
);-	 so-apat Dp*ages = (t org_ cab't b_psce (nd.ap-> T-s,ers ana
+	hto	d chans/b0_se/md.c*
-	ap-> I Ve-s,ge-eere= (e-sng?*
-	ap->/erlk * heanta)h*i oaion,+4ta)1(y 200d	e)-{vc 	>lk * heanta)h*anta)_e-s,g=P		returfo 	>+
+n;
+ e-eeoaceouhbyp;
 *rtd loD iummyeanta).i /er 	>anta)_e-s,g=Pion,empty,+4ta)1();erke_rgta)_e-s,->i +	ecto+	err avR;
 *rt,+4ta)_hash1(y 2ta)_e-s,)
+ 7erg sizey 2ta)_e-s,;e_}0,p p 	/*
-	 ste t_snaps - ed to	clear3an anta)*
-	*
-	/er max_lnt clear,+4ta)1(ylk * heanta)h*anta))({vc		INIT_I_FREtIN_fo 	>anta)->i statee|=	I_FREtIN_terJu the t * clear,+4ta)1(yanta))ter7erg size;e_}0,Ju the +
+t !	V_Nner60P
+INght->lv_p p 	/ mye* rl2.3>lv_;
, ne  200int * rl2.3( h =  *s1)e{* tio;
+
l2.3=oeturn  	>=hito (ys1[l2.] napsh l2.ven tk Mg sizeylee;e_}0,p p 	/ mye* rcmp	>lv_;
, ne  200int * rcmp	(	h =  *s1,oh =  *s2 r-0,,ct=hito (y*s1rnaps de *s2rnapsh -0,,ctorsf) % *s1rnap*s2 rut:
+	r-1tur *  	>l1ven s2ven tk M} tk M;) % *s1r=aps de *s2reapshcut:
+	retur * ut:
+	r-1tur}0,p p 	/ mye* rrchr	>lv_;
, ne h =  *;
t * rrchr	(	h =  *s1,oh =  ch -0,,cth =  *s2g=P		returfo 	>=hito (y*s1rnapsh -0,,ctorsf) % *s1reapch s2g=Ps1tur *  	>l1ven tk M} tk Mut:
+	rs2tur}0,p p 	/ mye emcpyd>lv_;
, ne  max_lnt  emcpyd(_h =  *oast, h =  *sourou,_;
+
s    r-0,,ct	Wed  ;s_bl >Nrg_s_bl--) *oast++ = *sourouven t}
thef -urN 2.3.42/d chans/b0_se/rd.c 2.3.42aa3/d chans/b0_se/rd.c
-* p2.3.42/d chans/b0_se/rd.c	Sun Jan 30 15:43:28 2000
+++ 2.3.42aa3/d chans/b0_se/rd.c	Wed Feb  9 03:48:29 2000
@@ -270,7 +270,7 @@
 		}t 	}t 	f) %rbh r-0- 		s/n,bit(BH_Protected,e&rbh->b state)tur		mark_batenc_protected%rbh ;
 		bV
ly-%rbh ;
 	}t 
@@ -290,7 +290,10 @@
 	switch1(cmd r-0 		ny
+ BLKFLSBUF:0 			;) %!cap	 (l(CAP_SYS_ADM+	)r-g sizeo-EACCES;
-			;nvalidSti_batencs(anta)->i rd *);fo			+
+special:cwe+wa
+
to	releas_ge-eeramopt,  emory
);			orsft's not 
 keV==U}
ap_poap_r l);
+oaceou V=he -Au			orse-s,eroctl+o:
e flushu Vawayrap_pbatenc caiso.o /er			oastroy_batencs(anta)->i rd *);f 			bV
Sktu 
M berGe pt	ny
+ BLK0P
SIZE: 	>+
+R sizeooaceouhs_bl */
@@ -391,7 +394,7 @@
 	;
+
isi 
M		Wed ictor g_i==MNUM_RAMDISKS;_itor
-		;nvalidSti_batencs(MKDEV(MAdr)_NR, i));fo		oastroy_batencs(MKDEV(MAdr)_NR, i));f 
M	unregistnc_bl+oac( MAdr)_NR, "ramopt," );f 	bl+acleanup_cueun(BLK LIFAULn_QUEUE(MAdr)_NR));fthef -urN 2.3.42/d chans/h = /rtc.c 2.3.42aa3/d chans/h = /rtc.c
-* p2.3.42/d chans/h = /rtc.c	Sun Jan 30 15:43:37 2000
+++ 2.3.42aa3/d chans/h = /rtc.c	Wed Feb  9 03:48:27 2000
@@ -94,14 +94,18 @@
 lksize, 200rtc_roctl(lk * heanta)h*anta),ylk * hefito *fito,f 		ctorsuthe exec 200cmd, uthe execeadi av_);f 
c		InNIT__ alpha__
 lksize,uthe exec 200rtc_poll(lk * hefito *fito, poll_t	 (l6*ginnintkJu the  
 lksize, max_ion,rtc_req  (lk * hertc_req  *rtc_rm)n  lksize, max_ion,rtc_alm_req  (lk * hertc_req  *alm_rm)terJ	InNIT__ alpha__
 lksize, max_rtc_dropped_irq(uthe execeadi data);f 
Mlksize, max_son,rtc_irq,bit(uthe exech =  bnnintMlksize, max_mask,rtc_irq,bit(uthe exech =  bnnintkJu the  
 lksize,;
, ne uthe exech =  rtc_is_updatd l( max ;t 
@@ -129,6 +133,7 @@
 lksize,const uthe exech =  days,+4_mo[] = 
 {0, 31,o28, 31,o30, 31,o30, 31,o31,o30, 31,o30, 31};f 
c		InNIT__ alpha__
 	/*  *	A hanyrainy ;
+errupt+hand(lr. IheruthV==U}
SA 	{TERRUPT_son,*  *	so-apat theFoirs no possibilityeof,conflictd lo==U}
ap_
@@ -156,6 +161,7 @@
 	;) %atomic utad(&rtc_ouh_ti) & RTC_TIMER_ON)f 		mod_req r(&rtc_irq,req r, jhefiu V+ HZ/rtc_freqV+ 2*HZ/100 ;t }tkJu the  
 	/*  *	Now
_iniap_ptariou,gfito operSt eds-apat w h
r t_s.
@@ -169,6 +175,9 @@
 lksize,s*nk_ahertc_utad(lk * hefito *fito, h =  *lat,f 			*nk_aheile (=SNoffit(*ppos)f {v_	erNIT__ alpha__
+	g sizeo-EIO; tJuly-A 	DECLARE_WAITQUEUE(ginn,_cNIize );f 	uthe execeadi data;f 	s*nk_aheretval;
@@ -200,6 +209,7 @@
 	insct /ginn_cueun(&rtc_ginn,_&ginnint 
 	in:
+	rut:val;
kJu the  }  
 lksize,;
00rtc_roctl(lk * heanta)h*anta),ylk * hefito *fito,suthe exec 200cmd,
@@ -210,6 +220,7 @@
 	lk * hertc_req  wreq ; t 
 	switch1(cmd r-0c		InNIT__ alpha__
 	ny
+ RTC_AIE_OFF:	+
+Mask
_iarmc 20. enab. bnn	*/
 	-0 		mask,rtc_irq,bit(RTC_AIE);
@@ -259,6 +270,7 @@
 		son,rtc_irq,bit(RTC_UIE);
 		rnt
+	r0;
 	}tkJu the  	ny
+ RTC_ALM_READ:	+
+Rtad	ap_ppr	sze 
_iarmcreq  */
 	-0 			/*@@ -392,6 +404,7 @@
 		sp+4_un);
+oirqresaorn(&rtc_);
+, flags);
 		rnt
+	r0;
 	}tkJ	InNIT__ alpha__
 	ny
+ RTC_IRQP_READ:	+
+Rtad	ap_pperiodze,IRQ rSti.	*/
 	-0 		rnt
+	rput_w *r(rtc_freq, (uthe execeadi *)av_);f@@ -431,7 +444,7 @@
 		sp+4_un);
+oirqresaorn(&rtc_);
+, flags);
 		rnt
+	r0;
 	}t-	erNIT__ alpha__
+July-A 	ny
+ RTC_EPOCH_READ:	+
+Rtad	ap_pepoch.	*/
 	-0 		rnt
+	rput_w *r (epoch, (uthe execeadi *)av_);f@@ -482,13 +495,14 @@
 
 lksize,;
00rtc_releas_(lk * heanta)h*anta),ylk * hefito *fito)f {v_	uthe execeadi flagsterJ	InNIT__ alpha__
 		/* 	-> T
+	roff
_ini;
+erruptshonce e-eeoaceouhrs no eadier* 	-> inEw *,-_b, clear3e-eeoata.* 	->/f 
M	unhe exech =  tmptu-	uthe execeadi flagste 
 	sp+4_);
+oirqsave(&rtc_);
+, flags);
 	tmp = CMOS_READ(RTC_CONTROL);f@@ -504,6 +518,7 @@
 		del_req r(&rtc_irq,req r ;
 	}t 
kJu the  	MOD DECptemuf 5NOsi 
 	sp+4_);
+oirqsave (&rtc_);
+, flags);
@@ -513,6 +528,7 @@
 	int
+	r0;
 }f 
c		InNIT__ alpha__
 lksize,uthe exec 200rtc_poll(lk * hefito *fito, poll_t	 (l6*ginni
r-0 	uthe execeadi l, flagste@@ -527,6 +543,7 @@
 		int
+	rPOLLIN |rPOLLRDNORMtu 	int
+	r0;
 }fkJu the  
 	/*  *	Tp_ptariou,gfito operSt eds-wuhste t_s.
@@ -537,7 +554,11 @@
 	itc_utad,f 	00
@,		+
+No te);
 */
 	00
@,		+
+No utaddir->lv_	erNIT__ alpha__
+	00
@,
+July-A 	rtc_poll,
kJu the  	rtc_roctl,f 	00
@,		+
+No m+	p
*/
 	rtc_mmax,
@@ -599,12 +620,14 @@
 		g sizeo-EIO;  	}t 
kJ	InNIT__ alpha__
 	if(rscuesa_irq(RTC_IRQ,0rtc_r
+errupt,
SA 	{TERRUPT, "rtc",000
@))
 	-0 			/ Yeah right,
seed loD,errq 8rdo  b't even hitrap_pbas.
*/
 		* ret;(	int ERR "rtc:,IRQ %dhrs noag"ys_.dr =SRTC_IRQ);
 		rnt
+	r-EIO;  	}tkJu the  
 	rscuesa_region(RTC_PORT(0)=SRTC_IO_EXTENT, "rtc");
 Ju the +
+__sparc__ vs.
oap_rs */
@@ -641,12 +664,14 @@
 	;) %guess)
 		* ret;("rtc:,%spepoch (%lu)eoatecteddr =Sguess,pepoch);
 Ju the
kJ	InNIT__ alpha__
 	initareq r(&rtc_irq,req r ;
 	rtc_irq,req r.aps - ed =_rtc_dropped_irq;
 	sp+4_);
+oirqsave(&rtc_);
+, flags);
 	+
+Initialik_ periodze,freq.
to	CMOS+g set NITault,
=hich+rs 1024Hz
*/
 	CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) |r0x06)=SRTC_FREQ_SELECT);
 	sp+4_un);
+oirqresaorn(&rtc_);
+, flags);
kJu the  	rtc_freqV= 1024si 
 	* ret;(	int INFO "Re= (Teq  C);
+ D chan v"SRTC_c_ofTest"dr );
@@ -676,6 +701,7 @@
 mod   _exit(rtc_exit);
 EXPORT_NO_SYMBOLS;f 
c		InNIT__ alpha__
 	/*  * 	At,IRQ rStis >= 4096Hz,3an an+errupt+may	ion-los 
_itoionp_r.*  *	(usuhinyfdurd loan IDE-opt, r
+errupt,
==U}
IRQ unmaskd looff)
@@ -701,6 +727,7 @@
 	itc_irq,data |= (CMOS_READ(RTC_	{TR_FLAGS) & 0xF0);	+
+g start
*/
 	sp+4_un);
+oirqresaorn(&rtc_);
+, flags);
 }fkJu the  
 	/*  *	Infoh
r t_sxecvia "/proc/d chan/rtc".
@@ -889,6 +916,7 @@
 	}
 }f 
c		InNIT__ alpha__
 	/*  * U *dhto	dis	 (l/enablei;
+erruptsh	WedDny one of,UIE, AIE, PIE.*  * RumourehD,ern-apat ;) youif
+b	ap_pan+errupt+enable/dis	 (l
@@ -926,3 +954,4 @@
 	itc_irq,data =r0;
 	sp+4_un);
+oirqresaorn(&rtc_);
+, flags);
 }fkJu the thef -urN 2.3.42/fs/b0_se +	e.c 2.3.42aa3/fs/b0_se +	e.c
-* p2.3.42/fs/b0_se +	e.c	Sun Jan 30 15:43:39 2000
+++ 2.3.42aa3/fs/b0_se +	e.c	Wed Feb  9 03:48:28 2000
@@ -70,39 +70,53 @@
 			;) %h = srnapl);
+*nk_)
 				fd =_bV
Sd;f 			bh =_fn(+	e,pl);
+,pl);
+*nk_);fo			;) %!bh)tk				rnt
+	rte);ten ?rte);ten :o-EIO; t			;) %!batenc_uptodSti(bh))tk				ginn_on_batenc(bh ;
 		}
 July-A 		bh =_ionblk(+	e,pl);
+,pl);
+*nk_);fo		;) %!bh)tk			rnt
+	rte);ten ?rte);ten :o-EIO;  
-		;) %h = srnapl);
+*nk_ de !batenc_uptodSti(bh))r-0-		ctif(!fitp->f_utada || -		ctors!g ad_a		ch[MAdr)(d *)])r-0-		ctrs+
+We
 *Ve-s,geoh	Wec_de-eeread	of,a sd ll_pbatenc */
-		ctrsbV
ly-%bh ;
-		ctrsbh =_bV
Sd(+	e,l);
+,l);
+*nk_);f-		ct}onst c-0-		ctrs+
+Rtad-a		ch befor_pte);
 */
-		ctrsb);
+* =_r ad_a		ch[MAdr)(d *)] / (l);
+*nk_ >> 9) / 2;
-		ctrs;) %l);
+ +sb);
+* >
s    rb);
+* =_*nk_ -rb);
+;
-		ctrs;) %l);
+* >
NBUF rb);
+*=NBUF;fo		;) %!batenc_uptodSti(bh))tk		-0,		o ;) %h = sr=apl);
+*nk_)
+		ctrsginn_on_batenc(bh ;
+		ctuly-Au		ct{f 		ctorbh
 pe[0] = bh;
-		ctrsfor(i=1; i<l);
+*;_itor-0-		ctrsorbh
 pe[i]ne_ionblk (+	e,pl);
++i,pl);
+*nk_);f-		ctrsorif(!bh
 pe[i]r-0-			=hito(i >= 0) bV
ly-%bh
 pe[i--]);f-			rnt
+	rte);ten ?rte);ten :o-EIO; -		ctrsor}; -		ctrs};
+		ctrs;) %!fitp->f_utada ||s!g ad_a		ch[MAdr)(d *)])r-0+		ctrsor+
+We
 *Ve-s,geoh	Wec_de-eeread	of,a sd ll_pbatenc */
+		ctrsorb);
+* =_1;
+		ctrs}onst c-0,		ctrsor+
+Rtad-a		ch befor_pte);
 */
+		ctrsorb);
+* =_r ad_a		ch[MAdr)(d *)] / (l);
+*nk_ >> 9) / 2;
+		ctrsorif %l);
+ +sb);
+* >
s    rb);
+* =_*nk_ -rb);
+;
+		ctrsorif %l);
+* >
NBUF rb);
+*=NBUF;fo		ctrsorif %!b);
+*)rb);
+* =_1;
+		ctrsrsfor(i=1; i<l);
+*;_itor
+		ctrsrs-0,		ctrsororbh
 pe[i]ne_ionblk (+	e,pl);
++i,pl);
+*nk_);f,		ctrsoror;) %!bh
 pe[i]rtk			-0,			c =hito(i >= 0) bV
ly-%bh
 pe[i--]);f,			c rnt
+	rte);ten ?rte);ten :o-EIO; t		,*orsrGe}tk		ctrsor}
+		ctrs}f 		ctorll_rwal);
+(READ,pl);
+*,rbh
 pe ;
 		rsrsfor(i=1; i<l);
+*;_itor bV
ly-%bh
 pe[i] ;
 		rsrsginn_on_batenc(bh ;
-		ctrsor
+		ctrs;) %!batenc_uptodSti(bh))r-0,			c bV
ly-%bh ;
,			c rnt
+	rte);ten ?rte);ten :o-EIO; t		,*or}f 		ct};
 		};
 Ju the
 		b);
+++;
-		;) %!bh)t-			rnt
+	rte);ten ?rte);ten :o-EIO;  		* 
+offset +sbh->b data;f 		offset =r0;
 		*pposh+
+h = ste@@ -522,7 +536,7 @@
 	;) %sb de ;nvalidSti_anta)s%sb))
 		* ret;("VFS:pbasyeanta)shonhchanged media.dr );
 
-	;nvalidSti_batencs(d *);fo	oastroy_batencs(d *);f 
 	;) %bdops->revalidSti)
 		bdops->revalidSti(d *);fthef -urN 2.3.42/fs/batenc.c 2.3.42aa3/fs/batenc.c
-* p2.3.42/fs/batenc.c	Sun Jan  9 20:45:31 2000
+++ 2.3.42aa3/fs/batenc.c	Wed Feb  9 03:48:29 2000
@@ -94,6 +94,7 @@
 kmem_caisoit(*bh_caisop;
 
 lksize,;
00grow_batencs(an+
s    ;erlksize, maxr_ refito_batenc(lk * hebatenc_		ch *);f 
 /> T-s,ers w *dhby soq  architect Fosieohastimateeavailablei emory.
*/
 atomic hebatencmem_pag
s =	ATOMIC_	{IT(0);
@@ -277,11 +278,14 @@
 
  max_sync d *(kd *__p+	e) c-0-	sync batencs(d *, 0);
 	sync supncs(d *);f 	sync anta)s%d *);f-	sync batencs(d *, 0);
 	DQUOT_SYNC(d *);fo	+
+sync _iniap_pdirtypbatencshouagto	disk+o:
e _aftnc_ _iniap_tk	 behigh level layncshfinished genera ed batenc dirtypdatatk	 be(Wedwe'inirnt
+	rt=U}
soq  batenc stie_pdirtypoh ap_pl);
+oaceoutk	 besotbV
Skd loap_psemanizeicsi e-s,gc_in)->lv_	sync batencs(d *, 0);
 		/* 	-> FIXME(erze)-wuhneesnao+sync ap_p*ages = (oaceou VheFo.* 	-> T-s,ers becaut csoq  (scsi),controllncshhav hhugeeasce (icsif@@ -412,40 +416,6 @@
 	int
+	r* csi }f 
- max_;nvalidSti_batencs(kd *__p+	e) -{
-	;nt n
 pe;f-f-	sp+4_);
+(&lru_
 pe_);
+);f-	for(n
 pectorg_n
 pec< NR_LISns_n
 petor-{v-		lk * hebatenc_		ch * bh;
-		;
+
isi-	intry:
-		bh =_lru_
 pe[n
 pe];
-		;) %!bh)t-			continue;
-			Wed ictonr_batencs_type[n
 pe]*2 ; --i3>M0=;sbh =_bh->b n
rd_freer-{v-			;) %bh->b devrnap+	e) -				continue;
-			;) %batenc_);
+ed(bh))r-0-				atomic inc(&bh->b ile ();f-				sp+4_un);
+(&lru_
 pe_);
+);f-				ginn_on_batenc(bh ;
-				sp+4_);
+(&lru_
 pe_);
+);f-				atomic dec(&bh->b ile ();f-				goto	retry;f-			}
-			;) %atomic utad(&bh->b ile ()) -				continue;
-			clear,bit(BH_Protected,e&bh->b state)tu-			clear,bit(BH_UptodSti,e&bh->b state)tu-			clear,bit(BH_Dirty,e&bh->b state)tu-			clear,bit(BH_Req, &bh->b state)tu-		}
-	}f-	sp+4_un);
+(&lru_
 pe_);
+);f-}f-
 /> Aftncpseveral hourscsi eediou,gana
ges*,rap_pfollowd lohash*  * aps - ed won.  Do noagmD
dct=U}
it... -Dav M*  */
@@ -464,10 +434,13 @@
 
 lksize,_ vn, ne__ vmaxr_ hash_un)ink(lk * hebatenc_		ch *bh)tr-0-	;) %bh->b n
rd)
-		bh->b n
rd->b ppr	ee=tbh->b ppr	esi-	*(bh->b ppr	e) =_bh->b n
rdsi-	bh->b ppr	ene_		retur	;) %bh->b ppr	e)ur	{fo		;) %bh->b n
rd)
+			bh->b n
rd->b ppr	ee=tbh->b ppr	esi+		*(bh->b ppr	e) =_bh->b n
rdsi+		bh->b ppr	ene_		retur	}  }  
 lksize, maxr_ vn *rt,+4to_lru_
 pe(lk * hebatenc_		ch * bh,_;
+
b
 pe 
@@ -514,17 +487,12 @@
 	bh->b n
rd_freee=tbh->b pr	e_freee=t		retu }f 
-/> T-_pfollowd lotwo aps - eds must(operSte atomichiny
- * becaut cap_y,controliap_ptisibilityeof,a batenc 		ch
- * to	ap_presa si e-e kernel.
- */
-lksize,_ vn, ne__ vmaxr_ insct /f
+	_cueuns(lk * hebatenc_		ch *bh)t 	/ must(b_pchinesnt=U}
boU}
ap_phash_t	 (l_);
+-_b, ap_p
ru_
 pe_);
+0,,ctheld, /erlksize,vmaxr_ insct /f
+	_cueuns(lk * hebatenc_		ch *bh)tr-0-	te);
_);
+(&hash_t	 (l_);
+)tu-	;) %bh->b ppr	e)u-		_ hash_un)ink(bh ;
,	_ hash_un)ink(bh ;
 	_ insct /f
+	_lru_
 pe(bh,_bh->b 
 pe ;
-	te);
_un);
+(&hash_t	 (l_);
+)tu }  
 lksize, maxrvn *rt,+4to_cueuns(lk * hebatenc_		ch *bh)t@@ -547,6 +515,8 @@
 	lk * hebh_free_		ch *		ch = &free_
 pe[BUFSIZE_	{DEX%bh->b s    ];
 	lk * hebatenc_		ch **bh* 
+&		ch->
 pe;fr
+	bh->b state3=oeturn 	sp+4_);
+(&		ch->
;
+)tu 	bh->b devr= B_FREt;
 	if(!*bh*)r-0@@ -604,11 +574,75 @@
 	int
+	r0;
 }f 
c+
+If_;nvalidSti_batencs()-wie_ptrash1dirtypbatencs,ern-meads soq  kd der 	>of fs+hyrruftwarnis god loon. Trashd lodirtypdata _iway,ermp
e losd l* tio;
	Wema  PAGapat washste t *dhto	b_pjust(saorndpoh ap_p*ages = (layncfo 	>byrap_pw *r.urfo 	>Thu,grnvalidSti_batencshin generalpw ag
hrs noaghinwow*dhto	trash1dirtyfo 	>batencs. FWedexamp
eeroctl(FLSBLKBUF rexpects3dirtypdata to	b_ppr	szrvnd.apfo 	>NOTE:+Ih ap_pcy
+ =he -rap_pw *r+g  ct d,a g  ct	 (l-media-disk+even he t * theFo's stie_pdirtypdata noagsyncndpoh disk+(due,a bag(nh ap_poaceouhd chaner 	>oc due,anv* calcsi e-e w *r),>byrnoagoastroyd loap_pdirtypbatencshwuhilelder 	>genera e+hyrruftwarnalsotoh ap_pn
rdnmediap;
 *rted,rapu,garparametncps,vc 	>neBD
danyrao+hand(l e-s,gc_se(nh ap_pmos 
safe+way possibto (tryd l* tioto noaghyrruftnalsotap_pn
w-opt, r
 *rted ==U}
ap_pdata beeadid loao t * the old now=hyrrufted opt,). Alsot	Wede-eeramopt, ap_pnat
+= (e-sng* tioto do _d>ocder
to	releas_ge-eeramopt,  emory s,geohoastroypdirtypbatencs.urfo 	>Th	sz areotwo specialgc_ses. NWemalpw ag
hrmp
e ap_poaceouhd chaner 	>eohissue,a sync oh ap_poaceouh(==U}ouagginnd loI/O=hymp
eta  PA)-_b, t * then3an anvalidSti_batencshc_iniapatrdo  b't trashespdirtypbatencs.-	/er max__ vnvalidSti_batencs(kd *__p+	e,y 200d	stroy_dirty_batencs) t{* 	;
+
i, n
 pe, slepdsi+	lk * hebatenc_		ch * bh,_* bh n
rdsi+ t intry:
+	llepd3=oetur	sp+4_);
+(&lru_
 pe_);
+);f+	for(n
 pectorg_n
 pec< NR_LISns_n
 petor-{v+		bh =_lru_
 pe[n
 pe];
o		;) %!bh)tk			continue;
+			Wed ictonr_batencs_type[n
 pe]g_i=>M0=;sbh =_bh n
rd,y --)tk		-0,			bh n
rd =_bh->b n
rd_free; t			;) %bh->b devrnap+	e) +				continue;
+			;) %batenc_);
+ed(bh))r-0+				atomic inc(&bh->b ile ();f+				sp+4_un);
+(&lru_
 pe_);
+);fk				ginn_on_batenc(bh ;
+				slepd3=o1;f+				sp+4_);
+(&lru_
 pe_);
+);fk				atomic dec(&bh->b ile ();f+			}
g t			te);
_);
+(&hash_t	 (l_);
+)tut			;) %!atomic utad(&bh->b ile ()-dev)			ors (+	stroy_dirty_batencs ||s!batenc_dirty(bh))rtk			-0,				_ insct /f
+	_cueuns(bh ;
+				put_east "ys_(bh ;
+			} t			te);
_un);
+(&hash_t	 (l_);
+)tut			;) %slepd) +				goto	ouasig		}tk	}tkoua:ur	sp+4_un);
+(&lru_
 pe_);
+);fk	;) %slepd) +		goto	retry;fr}0,p, max_son,l);
+*nk_(kd *__p+	e,y 200*nk_)
 {f 	
rdezey 2t(*bl+*nk_a*nk_[];
-	;
+
i, n
 pe;f-	sk * hebatenc_		ch * bh,_*bhn
rdsi+	;
+
i, n
 pe, slepdsi+	lk * hebatenc_		ch * bh,_* bh n
rdsi 
 	;) %!bl+*nk_a*nk_[MAdr)(d *)])
 		rnt
+	;
@@ -626,41 +660,57 @@
 	lync batencs(d *, 2);f 	bl+*nk_a*nk_[MAdr)(d *)][M+		l(+	e)]3=o    ;e 
-	+
+We
neesnao+b_pqu);
 careful howhwuh *Ve-s,g-hwuhareosctd loentries
-	_* arle dpoh ap_pfreee
 pe, _b, w_ cab	ion-_d>a loops;) wuhareonoaghareful.
-	_*/ t intry:
+	llepd3=oetur	sp+4_);
+(&lru_
 pe_);
+);f 	for(n
 pectorg_n
 pec< NR_LISns_n
 petor-{v-	repeat:
-		sp+4_);
+(&lru_
 pe_);
+);f 		bh =_lru_
 pe[n
 pe];
-			Wed ictonr_batencs_type[n
 pe]*2 ; --i3>M0=;sbh =_bhn
rd)-{v-			;)%!bh)t-				bV
Sktu-t-			bhn
rd =_bh->b n
rd_free; v-			;) %bh->b devrnap+	e) -				 continue;
-			;) %bh->b s   r=ap*nk_)
-				 continue;
o		;) %!bh)tk			continue;
+			Wed ictonr_batencs_type[n
 pe]g_i=>M0=;sbh =_bh n
rd,y --)tk		-0,			bh n
rd =_bh->b n
rd_free; t			;) %bh->b devrnap+	e ||sbh->b s   r=ap*nk_)
+				continue;
 			;) %batenc_);
+ed(bh))r-0 				atomic inc(&bh->b ile ();f 				sp+4_un);
+(&lru_
 pe_);
+);f 				ginn_on_batenc(bh ;
+				slepd3=o1;f+				sp+4_);
+(&lru_
 pe_);
+);f 				atomic dec(&bh->b ile ();f-				goto	repeat;f-			}
-			;) %bh->b devr=ap+	e &&sbh->b s   r!=
s    r-0-				clear,bit(BH_Dirty,e&bh->b state)tu-				clear,bit(BH_UptodSti,e&bh->b state)tu-				clear,bit(BH_Req, &bh->b state)tu 			}
-			;) %atomic utad(&bh->b ile ()	eapshc-0, t			te);
_);
+(&hash_t	 (l_);
+)tut			;) %!atomic utad(&bh->b ile ()rtk			-0,				;) %batenc_dirty(bh))0,					* ret;(	int WARNIN_fo					oooooooason,l);
+*nk_:p+	e %s batenc_dirty %lu_*nk_ %hu\n = t					oooooookd *  "o(+	e),_bh->b l);
+nr,sbh->b s   );f 				_ insct /f
+	_cueuns(bh ;
 				put_east "ys_(bh ;
 			} t			uly-Au			-0,				;) %atomic son,latenc_clean(bh))0,					_ refito_batenc(bh ;
+				clear,bit(BH_UptodSti,e&bh->b state)tu+				* ret;(	int WARNIN_fo				oooooooason,l);
+*nk_:p"fo				oooooooab ile ( %d,p+	e %s,pl);
+ %lu,if
+	+%p\n = t				oooooooatomic utad(&bh->b ile (),pld *  "o(bh->b dev)= t				ooooooobh->b l);
+nr,s__bailtin_rnt
+	_addr	ss(0) ;
+			} t			te);
_un);
+(&hash_t	 (l_);
+)tut			;) %slepd) +				goto	ouasi 		}
-		sp+4_un);
+(&lru_
 pe_);
+);f 	} tkoua:ur	sp+4_un);
+(&lru_
 pe_);
+);fk	;) %slepd) +		goto	retry;f }  
 	/*@@ -785,30 +835,29 @@
 		atomic son(&bh->b ile (, 1)n  	}t 	sp+4_un);
+(&free_
 pe[i*nk_].);
+)tu-	;) %!bh)t-		goto	refitltu-t-	+
+OK, FINALLY wuhknow=apat this batenc s,ge-eeo:
e one of,its kd d,
-	_* wuhhold h	reference (b ile (>0)=Siters wn);
+ed, _b, iters clean.
-	_*/ -	initabatenc(bh, evd,latenc_io_lync,000
@)si-	bh->b +	ecto+	err-	bh->b l);
+nr =rb);
+;
-	bh->b state3=o1 << BH_Mappedtur	;) %bh)ur	{fo		+
+OK, FINALLY wuhknow=apat this batenc s,ge-eeo:
e one of t		,*oits kd d, wuhhold h	reference (b ile (>0)=Siters wn);
+ed, t		,*o_b, iters clean. */
+		initabatenc(bh, evd,latenc_io_lync,000
@)si+		bh->b +	ecto+	err 		bh->b l);
+nr =rb);
+;
 		bh->b state3=o1 << BH_Mappedtu 
-	+
+I
 *rtrap_pbatenc into	ap_pregular 
isidc /e-	in *rt,+4to_cueuns(bh ;
-	goto	ouasig		+
+I
 *rtrap_pbatenc into	ap_pregular 
isidc /e+		in *rt,+4to_cueuns(bh ;
+	oua:ur		touch_batenc(bh ;
+		int
+	rbh;
r	}  
 		/* 	-> I) wuhl);
+ =hito refitld loap_pfreee
 pe, soq body+may* 	-> cV
Sti ap_pbatenc firpec... search
ap_phashu Vagain.* 	->/f-refitl:
 	infitl "ys_
 pe(l   );f 	goto	repeat;f-oua:u-	int
+	rbh;
 }  
 	/ -1 -> no neesnao+flush
@@ -820,8 +869,11 @@
 f 	dirty =
s   _batencs_type[BUF_DIRTY] >> PAGE_SHIFT;
 	totctonr_free_batenc_pag
s( ;
-	hard_dirty_limitctototc* bdf_prm.b_un.nfrD
d / 100;f-	soft_dirty_limitctohard_dirty_limitc>>p1nex	totc-=
s   _batencs_type[BUF_PROTECTED] >> PAGE_SHIFT;
, t	dirty *= 200tur	soft_dirty_limitctototc* bdf_prm.b_un.nfrD
dtur	hard_dirty_limitctosoft_dirty_limitc* 2;
 
 	;) %dirty >osoft_dirty_limit)
 	-0@@ -848,29 +900,39 @@
 	wakeup_bdflush(state)tu }f 
-lksize,;
, ne  max__ mark_dirty(lk * hebatenc_		ch *bh,y 200flag)erlksize,_ vn, ne__ vmaxr_ mark_dirty(lk * hebatenc_		ch *bh,y 200flag)er-0 	bh->b flushreq  = jhefiu V+ (flag ? bdf_prm.b_un.ag
 supnc : bdf_prm.b_un.ag
 batenc ;
-	clear,bit(BH_New, &bh->b state)tu 	refito_batenc(bh ;
 }f 
c+
+atomic hanswar,	ap_pw *r+must(c_inibalance_dirty()>byrh_b, t * ashsoarna,ern-becoq  possibto ao+b);
+ */
 vmaxr_ mark_batenc_dirty(lk * hebatenc_		ch *bh,y 200flag)er-0-	_ mark_dirty(bh,yflag)tur	;) %!atomic son,latenc_dirty(bh))0,		_ mark_dirty(bh,yflag)tur}
g t max_mark_batenc_dirty(lk * hebatenc_		ch *bh,y 200flag)et{* 	_ mark_batenc_dirty(bh,yflag)tur	balance_dirty(bh->b dev);f }  
 	/*  * Apbatenc may	neesnao+b_p ct d,f
+	+one batenc 
 pecao+anoap_r*  * (e.g.-_d>c_se(nthrs noags = -ddDny mor_). Hand(l e-s,.*  */
-lksize,_ vn, ne__ vmaxr_ infito_batenc(lk * hebatenc_		ch *bh)urlksize, maxr_ refito_batenc(lk * hebatenc_		ch *bh)tr-0 	;
+
dis t *r= BUF_CLEAN;
 	;) %batenc_);
+ed(bh))
 		dis t *r= BUF_LOCKED;
 	;) %batenc_dirty(bh))0 		dis t *r= BUF_DIRTYtur	;) %batenc_protected%bh))0,		dis t *r= BUF_PROTECTED;
 	;) %dis t *r!=_bh->b 
 pe r-0 		_ insct /f
+	_lru_
 pe(bh,_bh->b 
 pe ;
 		bh->b 
 pectodis t *;
@@ -890,8 +952,6 @@
  */
 vmaxr_ bV
ly-%lk * hebatenc_		ch * buf)er-0-	touch_batenc(buf)tu-t 	;) %atomic utad(&buf->b ile ()rr-0 		atomic dec(&buf->b ile ();
 		rnt
+	;
@@ -912,12 +972,10 @@
 	te);
_);
+(&hash_t	 (l_);
+)tu 	;) %!atomic dec_and_test(&buf->b ile () ||sbatenc_);
+ed(buf))0 		goto	+4_usetu-	;) %buf->b ppr	e)u-		_ hash_un)ink(buf)tu+	_ hash_un)ink(buf)tu 	te);
_un);
+(&hash_t	 (l_);
+)tu 	_ insct /f
+	_lru_
 pe(buf, buf->b 
 pe ;
 	sp+4_un);
+(&lru_
 pe_);
+);f-	buf->b state3=oetu 	put_east "ys_(buf)tu 	rnt
+	;
 
@@ -1225,6 +1283,7 @@
 		clear,bit(BH_UptodSti,e&bh->b state)tu 		clear,bit(BH_Mapped,e&bh->b state)tu 		clear,bit(BH_Req, &bh->b state)tu+		clear,bit(BH_New, &bh->b state)tu 	}  }  
@@ -1303,7 +1362,6 @@
 
 lksize, maxrunmap_underlyd l_metadata(lk * hebatenc_		ch * bh)er-0-#;) 0
 	;) %batenc_new(bh))r-0 		lk * hebatenc_		ch *old bh;
 
@@ -1316,7 +1374,6 @@
 			_ bforgon(old bh ;
 		}
 	}t-	u the  }  
 	/*@@ -1326,7 +1383,7 @@
 ;
+
b
_se te);
_futl pag
(lk * hedentry *oantry,ylk * hepag
 *pag
)tr-0 	lk * heanta)h*anta)cto+	ntry->d anta);
-	;
+
err,
isig	;
+
err,
i,	nees_balance_dirty3=oetu 	uthe execeadi b);
+;
 	lk * hebatenc_		ch *bh,_*		ch;f 
@@ -1364,12 +1421,19 @@
 			unmap_underlyd l_metadata(bh ;
 		}
 		s/n,bit(BH_UptodSti,e&bh->b state)tu-		mark_batenc_dirty(bh,0);fo		;) %!atomic son,latenc_dirty(bh))0,		-0,			_ mark_dirty(bh,y0);fo			nees_balance_dirty3=o1sig		}t f 		bh =_bh->b e-s, pag
;
 		b);
+++;
 	}>=hito (bh !=_		ch)
+ ur	;) %nees_balance_dirty)0,		balance_dirty(bh->b dev);frn 	SetPag
UptodSti(pag
)tu 	int
+	r0;
 oua:u@@ -1416,12 +1480,12 @@
 			;) %err)
 				goto	ouasi 			unmap_underlyd l_metadata(bh ;
-		}
-		;) %batenc_new(bh))r-0-			zeroto	=rb);
+_evdg
-			;) %b);
+_start
< zerof
+	)
-				zerof
+		=rb);
+_start;t-			continue;
+			;) %batenc_new(bh))r-0+				zeroto	=rb);
+_evdg
,				;) %b);
+_start
< zerof
+	)
,					zerof
+		=rb);
+_start;t+				continue;
+			}
 		}
 		;) %!batenc_uptodSti(bh)-dev 		ctors%b);
+_start
< zerof
+	 ||sb);
+_evd >oto))r-0@@ -1475,7 +1539,7 @@
 				*artial3=o1si 		}onst c-0 			*/n,bit(BH_UptodSti,e&bh->b state)tu-			;) %!test_and_*/n,bit(BH_Dirty,e&bh->b state))r-0+			;) %!atomic son,latenc_dirty(bh))r-0 				_ mark_dirty(bh,y0);f 				nees_balance_dirty3=o1si 			} @@ -2000,7 +2064,7 @@
  */
 ;
+
try_to_free_batencs(lk * hepag
 * pag
)tr-0-	sk * hebatenc_		ch * tmp,_* bh =	pag
->batencssi+	lk * hebatenc_		ch * tmp,_* p,_* bh =	pag
->batencssi 	;
+
indexr= BUFSIZE_	{DEX%bh->b s    si 	;
+
int;f 
@@ -2009,7 +2073,7 @@
 	sp+4_);
+(&free_
 pe[index].);
+)tu 	tmp = bh;
 	do-{v-		lk * hebatenc_		ch * p = tmptu+		* 
+tmptu f 		tmp = tmp->b e-s, pag
;
 		;) %batenc_basy(p))
@@ -2025,13 +2089,10 @@
 		/> T-_pbatenc can+b_peiap_r oh ap_pregularv 		c* cueuns>oc oh ap_pfreee
 pe..v 		c*/
-		;) %p->b devr=apB_FREt)r-0+		;) %p->b devr!apB_FREt)0,			_ insct /f
+	_cueuns(p);fo		uly-A 			_ insct /f
+	_free_
 pe(p,
index ;
-		}onst c-0-			;) %p->b ppr	e)u-				_ hash_un)ink(p)tu-			_ insct /f
+	_lru_
 pe(p,
p->b 
 pe ;
-		}
 		__put_wnw *d_batenc_		ch(p)tu 	}>=hito (tmp !=_bh ;
 	sp+4_un);
+(&wnw *d_
 pe_);
+);f@@ -2051,7 +2112,8 @@
 
 basy_batenc_pag
:
 	+
+Uhhuh,ylkart
te);
ba
+ so-apat wuh *b't evd up ==U}
ae_pdirtyppag
s */
-	wakeup_bdflush(0)tur	;) %batenc_dirty(p))0,		wakeup_bdflush(0)tu 	int3=oetu 	goto	ouasi } @@ -2065,7 +2127,7 @@
 	 200fle dp=oe=SNo
+edp=oe=Sdirty3=oe, w *dh=oe=SNastw *dh=oesi 	;
+
protectedh=oesi 	;
+
n
 pe;f-	sksize,c =  *lat_types[NR_LISn]3=o{ "CLEAN", "LOCKED", "DIRTY"s};
+	sksize,c =  *lat_types[NR_LISn]3=o{ "CLEAN", "LOCKED", "DIRTY", "PROTECTED", };
 Ju the
 
 	* ret;("Batenc memory: 	>%6dkB\n = @@ -2091,10 +2153,16 @@
 				w *d++=SNastw *dh=ofle d;f 			bh =_bh->b n
rd_free;  		}o=hito (bh !=_lru_
 pe[n
 pe] ;
-		* ret;("%8s: %dhbatencs,e%dhw *dh(Nast=%d),p"fo		-0+			;
+
tmp = nr_batencs_type[n
 pe]g0+			;) %fle dp!= tmp)u+				* ret;("%9s: ST_l->0fle dp%d,pre t_sxec%ddr = t				ooooooobat_types[n
 pe],0fle d, tmp)sig		}tk		* ret;("%9s: %dhbatencs,e%lu kbyti,e%dhw *dh(Nast=%d),p"f 		oooooooa%d );
+ed, %d protected,e%dSdirtydr = -		ooooooobat_types[n
 pe],0fle d, w *d=SNastw *d= -		ooooooo);
+ed, protected,edirty); t		,*orsrGbat_types[n
 pe],0fle d, s   _batencs_type[n
 pe]>>10, t		,*orsrGw *d=SNastw *d=o);
+ed, protected,edirty);  	}t 	sp+4_un);
+(&lru_
 pe_);
+);f Ju the
@@ -2210,7 +2278,7 @@
  * ashae_pdirtypbatencs liv
s _o:
e_(nh ap_pDIRTY_lrue
 pe.
  * As-wuhnehan brows_ge-eeLOCKEDo_b, CLEAN_lrue
 pescap_y,areoinfact
  * hymp
etlyGw *less.-	/e-lksize, maxrflush_dirty_batencs(an+
ison  flushreq )erlksize, 200flush_dirty_batencs(an+
ison  flushreq )er-0 	lk * hebatenc_		ch * bh,_*n
rdsi 	 200flush*dh=oe=Si;f@@ -2259,6 +2327,8 @@
 	}
 	oua_un);
+:t 	sp+4_un);
+(&lru_
 pe_);
+);f+
+	g sizeoflush*d;
 }  
 	/ f@@ -2342,6 +2412,7 @@
  */
 ;
+
bdflush( maxr* wnw *d) f {v_	 200flush*d;
 		/* 	->	Wehhav ha bare-bonosieask,lk * h, _b, re= lyGshleldgfitl* 	->	_d>a few mor_pe-sngshso "top" _b, /proc/2/{exe,root,cwd} @@ -2363,7 +2434,7 @@
 		Wed ;;)r-0 		CHECK_EMERGENCY_SYNC  
-		flush_dirty_batencs(0);fo		flush*dh=oflush_dirty_batencs(0);f 
 		/> I) wakeup_bdflush-wie_pwakeupGw f 		oooaftnc ourebdflush_done wakeup,	ap_n @@ -2378,10 +2449,10 @@
 		/>v 		c* If theFoiareostie_pa loa si dirtypbatencs arle d,v 		c* skipoap_psleep _b, flush-soq  mor_. OtheFwi *,-we -		o*psleep 	WedDo=hito. t		,* gonao+sleep ginnd loa wakeup.v 		c*/
-		;) %balance_dirty state(NghtV)
< 0)u-			sisod   _req oua(5*HZ);fo		;) %!flush*dh||sbalance_dirty state(NghtV)
< 0)u+			sisod   ();f 		+
+Rtmember
to	mark u,gaserutnd lootheFwi *f 		oooap_pn
rdnsisod   -wie_pb);
+.
*/
 		_ son,vNIize =state(TASK_RUNNIN_);fthef -urN 2.3.42/fs/dcaiso.c 2.3.42aa3/fs/dcaiso.c
-* p2.3.42/fs/dcaiso.c	Sun Jan 30 15:43:39 2000
+++ 2.3.42aa3/fs/dcaiso.c	Wed Feb  9 03:48:28 2000
@@ -57,6 +57,15 @@
 	 200iummy[2];
 }o+	ntry=stat3=o{e=Se=S45=Se=};f 
clk * he{fo	+
+Enlarid loaoo	much+rs noagh good idea sd c  hoaoo	larie caisotk	 bemay	ionera e+aoo	much+col
 p eds nh ap_phash1podevtihiny
k	 beslowd lodowh ap_psystem. */
+	 200iimit_percevt;e_} dcaiso_ctl+=o{ 2, };
+ 200icaiso_ctl_min[]3=o{ 0, };
+ 200icaiso_ctl_max[]3=o{ 100, };
+
 lksize,;
, ne  maxrd "ys_(lk * hedentry *oantry)tr-0 	;) %d	ntry->d op &&sd	ntry->d op->d releas_)
@@ -428,6 +437,20 @@
 	int
+	r0;
 }f 
clksize,;
, ne  maxrpr	sh rek_icaiso_memory( max et{* 	uthe execeadi     ,_iimit;f+
+	    3=+(+	ntry=stat.nr_wnw *d *lunk_si(lk * hedentry)) >> PAGE_SHIFT;
,	limitctonum_*agepag
s *0icaiso_ctl.iimit_percevt / 100;fk	;) %s_bl >Nlimit)
r	{fo		);
+_kernel();fo		prute_icaiso(+	ntry=stat.nr_wnw *d >> 2);fo		un);
+okernel();fo	}fr}0,p,#def ne NAME_ALLOC_LEN(len)	((len+16) & ~15)
 
 lk * hedentry * d hintm(lk * hedentry *rpare (, const lk * heqlk _*nOT
)f@@ -435,6 +458,7 @@
 	c =  * lk ;
 	lk * hedentry *oantry
+ ur	pr	sh rek_icaiso_memory();f 	dentry = kmem_caisoihintm(+	ntry=caiso, GFP_	intEL); 
 	;) %!oantry)tr		int
+	r		retuthef -urN 2.3.42/fs/exec.c 2.3.42aa3/fs/exec.c
-* p2.3.42/fs/exec.c	Wed Jan  5 17:42:51 2000
+++ 2.3.42aa3/fs/exec.c	Wed Feb  9 03:48:28 2000
@@ -277,13 +277,13 @@
 	pmdh=opmdihintm(pgd, _ddr	ss)tu 	;) %!pmd r-0 		__free_pag
(pag
)tu-		oom(ts+)tut			Wec__he (SIGKILL,	ask);
 		rnt
+	;
 	}t 	pte3=opteihintm(pmd, _ddr	ss)tu 	;) %!pte r-0 		__free_pag
(pag
)tu-		oom(ts+)tut			Wec__he (SIGKILL,	ask);
 		rnt
+	;
 	}t 	;) %!pte_none(*pte))r-0thef -urN 2.3.42/fs/anta).c 2.3.42aa3/fs/anta).c
-* p2.3.42/fs/anta).c	Sun Jan 30 15:43:39 2000
+++ 2.3.42aa3/fs/anta).c	Wed Feb  9 03:48:28 2000
@@ -70,10 +70,19 @@
 	 200iummy[5];
 }oanta)s=stat3=o{e=Se=};f 
clk * he{fo	+
+Enlarid loaoo	much+rs noagh good idea sd c  hoaoo	larie caisotk	 bemay	ionera e+aoo	much+col
 p eds nh ap_phash1podevtihiny
k	 beslowd lodowh ap_psystem. */
+	 200iimit_percevt;e_} icaiso_ctl+=o{ 2, };
+ 200icaiso_ctl_min[]3=o{ 0, };
+ 200icaiso_ctl_max[]3=o{ 100, };
+
 lksize,kmem_caisoit(*y 2ta)_caisop;
 
 #def ne hintm anta)() \
-	_((lk * heanta)h*) kmem_caisoihintm( 2ta)_caisop, SLAB_	intEL))
r	 (pr	sh rek_icaiso_memory(), (lk * heanta)h*) kmem_caisoihintm( 2ta)_caisop, SLAB_	intEL))
 #def ne +	stroy_anta)(anta))(kmem_caisoi"ys_( 2ta)_caisop, (anta)))  
 	/*@@ -411,6 +420,16 @@
 	kmem_caisoish rek( 2ta)_caisopint 
 	in:
+	r0tur}
g tlksize,;
, ne  maxrpr	sh rek_icaiso_memory( max et{* 	uthe execeadi     ,_iimit;f+
+	    3=+(anta)s=stat.nr_wnw *d *lunk_si(lk * heanta))) >> PAGE_SHIFT;
,	limitctonum_*agepag
s *0icaiso_ctl.iimit_percevt / 100;fk	;) %s_bl >Nlimit)
r		prute_icaiso(anta)s=stat.nr_wnw *d >> 2);f }  
 lksize,;
, ne  max__ igon(lk * heanta)h*eanta))0thef -urN 2.3.42/fs/parti  PAs/h on .c 2.3.42aa3/fs/parti  PAs/h on .c
-* p2.3.42/fs/parti  PAs/h on .c	Sun Jan 30 15:43:39 2000
+++ 2.3.42aa3/fs/parti  PAs/h on .c	Wed Feb  9 03:48:26 2000
@@ -36,6 +36,11 @@
 
rdezey max_rd_);ad( max ;t 
rdezey max_initrd_);ad( max ;t 
c		I def ned CONFIG_BLK LIV_LVMh||sdef ned CONFIG_BLK LIV_LVM_MODULE
c		nclua)h<, nux/lvm.h> t max_( *;
t hdSHOT
_ptr)d(_h =  *,y 20)ne_		returJu the te st * heionopt, *ionopt,_		ch;f 
 lksize,;
00(*ison  part[])(st * heionopt, *hd, kd *__p+	e,yuthe execeadi firpe_sect,y 200firpe_ << 9)3=o{
@@ -87,6 +92,13 @@
 	-> T-s,erscuiFosispecialghand(d loheFo.* 	->/
 	switch1(hd->maj 9)3{
c		I def ned CONFIG_BLK LIV_LVMh||sdef ned CONFIG_BLK LIV_LVM_MODULE
c		ny
+ LVM_BLK MAdr):ur			*lat3=oetur			;) % ;
t hdSHOT
_ptrp!= 00
@) t				% ;
t hdSHOT
_ptr)d(_buf,  << 9);tk			rnt
+	rbuf;
kJu the  		ny
+ IDE9 MAdr):u 			unitc+= 2;
 		ny
+ IDE8 MAdr):uthef -urN 2.3.42/fs/supnc.c 2.3.42aa3/fs/supnc.c
-* p2.3.42/fs/supnc.c	Sun Jan 30 15:43:39 2000
+++ 2.3.42aa3/fs/supnc.c	Wed Feb  9 03:48:28 2000
@@ -1378,7 +1378,10 @@
 		b+	ecto+o_usce ((old root dev,1,y0);f 		;) %!IS ERR(b+	e))r-0 			* ret;("okaydr );
-			;nvalidSti_batencs(old root dev);fo			+
+special:cthe old oaceouhd channis god loao+b_v)			orsaeramopt, _b, ap_ppo 200si e-s,gc_in s,geohfreeeitsv)			orsprotectedh emory (even heedirty).o /er			oastroy_batencs(old root dev);f 			;) %bd	e)-{v 				bl+oac_put%bd	e, BLIV_FS);f 				bdput%bd	e);fthef -urN 2.3.42/	nclua)/asm-alpha/hardirq.h 2.3.42aa3/	nclua)/asm-alpha/hardirq.h
-* p2.3.42/	nclua)/asm-alpha/hardirq.h	Tue Feb  8 02:26:13 2000
+++ 2.3.42aa3/	nclua)/asm-alpha/hardirq.h	Wed Feb  9 03:48:27 2000
@@ -8,8 +8,11 @@
 		InNIT__ SMP__
 
rdezey 2t(__);
al_irq,ile (;
 #def ne );
al_irq,ile ((cpu) _(( max (cpu),(__);
al_irq,ile () t
rdezeyuthe execeadi __irq,attempt[];
+#def ne irq,attempt(cpu, irq) _(( max (cpu),(__irq,attempt[irq])
 July-A #def ne );
al_irq,ile ((cpu) _(cpu data[cpu].irq,ile () t#def ne irq,attempt(cpu, irq) (cpu data[cpu].irq,attempt[irq])
 Ju the  
 	/*thef -urN 2.3.42/	nclua)/asm-alpha/hw_irq.h 2.3.42aa3/	nclua)/asm-alpha/hw_irq.h
-* p2.3.42/	nclua)/asm-alpha/hw_irq.h	Fri Feb  4 04:09:23 2000
+++ 2.3.42aa3/	nclua)/asm-alpha/hw_irq.h	Wed Feb  9 03:48:27 2000
@@ -18,21 +18,22 @@
 	outb(0, DMA1_CLR MASK_REG);	\
 	outb(0, DMA2_CLR MASK_REG)  
-
rdezeyuthe execeadi _alpha_irq,masks[2];
-#def ne hipha_irq,mask _alpha_irq,masks[0]u-t 
rdezey max_common_a
+oirq(uthe execeadi irq);t 
rdezey max_isa_oaceou_r
+errupt(uthe execeadi vector,ylk * hepa_regs *0regs);t 
rdezey max_srm_oaceou_r
+errupt(uthe execeadi vector,ylk * hepa_regs *0regs);t 
-
rdezey max_hand(loirq( 200irq,y 200a
+,plk * hepa_regs *0regs);t+
rdezey max_hand(loirq( 200irq,ylk * hepa_regs *0regs);t 
 #def ne RTC_IRQ  * 8
c		I 0 	/ on Alphacwe+wa
+
to	ut co:
e ap_pRTCgasereq r 	WedSMPhissues */
+t !	V_NCONFIG_RTC
 #def ne TIMER_IRQ  0			o	/ req r s,ge-eepit
*/
 July-A #def ne TIMER_IRQ  RTC_IRQ		o	/ req r s,ge-eertc
*/
 Ju the
kJuly-Au#def ne TIMER_IRQ  RTC_IRQ		o	/ req r s,ge-eertc
*/
kJu the  
 	/*  * PROBE MASK s,ge-eebitse00si irqs-apat wuhconsid r 	Wedautoprobd l.
@@ -71,10 +72,11 @@
 	u the  
 
-
rdezeyh =  =st
rdsi lksize,;
, ne  max_alpha_+o_profito (uthe execeadi pc)tr-0 	;) %prof_batenc &&svNIize ->pid)r-0+		
rdezeyh =  =st
rdsi+
 		*cc-=
(uthe execeadi) &=st
rdsi 		*cc>>= prof_shift;0 			/*@@ -87,5 +89,10 @@
 		atomic inc((atomic he*)&prof_batenc[pc])tu 	}  } g tlksize,;
, ne  maxrhw_r	szed_irq(lk * hehw_i
+errupt_type *h,suthe exec 200i)r-}t+
rdezey max_no_a
  PA(an+
ipl,y max_*oac_id,ylk * hepa_regs *regs);t+
rdezey max_initaISAoirqs( max ;t+
rdezey max_initaRTC_irq( max ;t 
 Ju the thef -urN 2.3.42/	nclua)/asm-alpha/pghintm.h 2.3.42aa3/	nclua)/asm-alpha/pghintm.h
-* p2.3.42/	nclua)/asm-alpha/pghintm.h	Tue Feb  8 02:26:13 2000
+++ 2.3.42aa3/	nclua)/asm-alpha/pghintm.h	Wed Feb  9 03:48:26 2000
@@ -3,13 +3,27 @@
 
 		nclua)h<, nux/config.h>  
-/> Caisos areb't brain-dead	oh ap_pAlpha.-	/e-#def ne flush_caisoihin()			oo { }o=hito (0)t 	/ T-_picaiso+rs noagcoheFon+
==U}
ap_pdcaiso+arnalpha,rapu,gbefor_ tk Muutnd loself modifixechta)hwuhmust(_iway,euut3an amb(). tk MActuhinyfflush_caisoihin() s,ersalgohankie_passft's rechinesnf
+	 tk Mvmhintm() befor_pacBD
dd lopag
t	 (ls _b, oh ap_pAlpha wuhareonoagrscuiFoder 	>eohflush-t-_picaiso+befor_pdod loapat, butoap_psemanize>of flush_caisoihin() tk MutcuiFosius>eohflush-ihin_ ap_pcyisos ab, sohwuhmust(be+hyrre heheFo. It's* tio;
st
ad	vmhintm-apat shleldgbehchanged to	ut ca mor_pf negr ned caisotksrsflush-operSt ed (I suspecn-apat alsotoap_r archsrdo  b't neesnan acaisotksrsflush-=hito hand(d lopag
t	 (ls).oOTOH	vmhintm-rs noagh per	Wema c  crits = tksrspaU}
sooaftnc _in w_ cab	liv
ct=U}
it 	Wednow.o /er#def ne flush_caisoihin()			flush_icaiso_range(0, 0)
 #def ne flush_caisoimm(mm)			oo { }o=hito (0)t #def ne flush_caisoirange(mm,ylkart, evd)	oo { }o=hito (0)t #def ne flush_caisoipag
(vmh,	vmhddr)		oo { }o=hito (0)t #def ne flush_pag
_to_ram(pag
)			oo { }o=hito (0)t-#def ne flush_icaiso_range(lkart, evd)		oo { }o=hito (0)t 		InNIT__ SMP__
+#def ne flush_icaiso_range(lkart, evd)		amb()
kJuly-Au#def ne flush_icaiso_range(lkart, evd)		smp_amb()
k
rdezey max_smp_amb( max ;t+Ju the  
 	/*  * Ut ca few helpnc aps - eds ao+hid 	ap_pwgnyfbroken ASN thef -urN 2.3.42/	nclua)/asm-alpha/semaphor_.h 2.3.42aa3/	nclua)/asm-alpha/semaphor_.h
-* p2.3.42/	nclua)/asm-alpha/semaphor_.h	Tue Feb  8 02:25:56 2000
+++ 2.3.42aa3/	nclua)/asm-alpha/semaphor_.h	Wed Feb  9 03:48:26 2000
@@ -6,6 +6,7 @@
  **  * (C) Copyright 1996 L nus Torvalds*  * (C) Copyright 1996 Rih = d Hendersontks* (C) Copyright 2000 Andrsa Arcangeli
  */
 
 		nclua)h<asm/vNIize .h> @@ -265,5 +266,96 @@
 		: "m"(sem->ile (),p"r"(pv)
 		: "$24", "$28", " emory");
 }fkt 	/ RW sp+4);
+-ba *d semaphor_s, 2000 Andrsa Arcangelih<andrsa@suse.de>o /er
clk * herw_semaphor_et{* 	sp+4);
+_t );
+;
 	;
+
id, wr;
 	ginn_cueun_		ch_agginnterJ	I WAITQUEUE_DEBU_fo	eadi __magicturJu the t};
+
u#def ne __RWSEM_	{ITIALIZER(HOT
,
id, wr)		\et{							\et	SPIN_LOCK_UNLOCKED,				\et	(rd),p(wr),					\et	__WAIT_QUEUE_HEAD_	{ITIALIZER((HOT
).ginni	\et	__SEM_DEBU__	{IT(HOT
)				\et}
+
u#def ne __DECLARE_RWSEM_GENERIC(HOT
,
id, wr) \i+	lk * herw_semaphor_ HOT
 = __RWSEM_	{ITIALIZER(HOT
,
id, wr)
+
u#def ne DECLARE_RWSEM(HOT
) __DECLARE_RWSEM_GENERIC(HOT
,
0, 0)
u#def ne DECLARE_RWSEM_READ_LOCKED(HOT
) __DECLARE_RWSEM_GENERIC(HOT
,
1, 0)
u#def ne DECLARE_RWSEM_WRITE_LOCKED(HOT
) __DECLARE_RWSEM_GENERIC(HOT
,
0, 1)
+
u
rdezey 2, ne  maxrinitarwsem(lk * herw_semaphor_ * sem)et{* 	sp+4_);
+oinit(&sem->);
+);fk	sem->rdh=osem->wr3=oetur	initaginncueun_		ch(&sem->ginnintrJ	I WAITQUEUE_DEBU_fo	sem->__magic3=+(eadi)&sem->__magicturJu the t}
+
u#	InNIT_CHECK_MAGIC
u#def ne CHECK_MAGIC(x)urJu the tek
rdezey max_dowh utad_faitod(lk * herw_semaphor_ * ;t+
rdezey max_dowh te);
_faitod(lk * herw_semaphor_ * ;t+
u
rdezey 2, ne  maxrdowh utad(lk * herw_semaphor_ * sem)et{* 	CHECK_MAGIC(sem->__magic);f+
+	sp+4_);
+oirq(&sem->);
+);fk	;) %sem->wr)0,		dowh utad_faitod(lem);fk	sem->rd++;
+	sp+4_un);
+oirq(&sem->);
+);fk}t+
u
rdezey 2, ne  maxrdowh te);
(lk * herw_semaphor_ * sem)et{* 	CHECK_MAGIC(sem->__magic);f+
+	sp+4_);
+(&sem->);
+);fk	;) %sem->rdh||ssem->wr)0,		dowh te);
_faitod(lem);fk	sem->wr3=o1;ur	sp+4_un);
+(&sem->);
+);fk}t+
u#def ne up utad(lem)						\etoo {								\et	uthe execeadi flagst					\et								\et	CHECK_MAGIC((lem)->__magic);				\et								\et	sp+4_);
+oirqsave(&(lem)->);
+, flags);			\et	;) %!--(lem)->rdh&& ginncueun_a
  ve(&(lem)->ginnii	\et		wake_up(&(lem)->ginni;				\et	sp+4_un);
+oirqresaorn(&(lem)->);
+, flags);		\et}o=hito (0)t 
u#def ne up te);
(lem)					\etoo {							\et	uthe execeadi flagst				\et							\et	CHECK_MAGIC((lem)->__magic);			\et							\et	sp+4_);
+oirqsave(&(lem)->);
+, flags);		\et	(lem)->gr3=oet					\et	;) %ginncueun_a
  ve(&(lem)->ginnii		\et		wake_up(&(lem)->ginni;			\et	sp+4_un);
+oirqresaorn(&(lem)->);
+, flags);	\et}o=hito(0)t 
 Ju the thef -urN 2.3.42/	nclua)/asm-alpha/smp.h 2.3.42aa3/	nclua)/asm-alpha/smp.h
-* p2.3.42/	nclua)/asm-alpha/smp.h	Tue Feb  8 02:25:56 2000
+++ 2.3.42aa3/	nclua)/asm-alpha/smp.h	Wed Feb  9 03:48:27 2000
@@ -20,6 +20,7 @@
 	erNIT__ SMP__
 
 		nclua)h<, nux/thutads.h> t		nclua)h<asm/irq.h>
 
 lk * hecpu;
	W_alphar-0 	uthe execeadi loops_per_sec;f@@ -28,6 +29,8 @@
 	uthe execeadi *pte_caisotu 	uthe execeadi pgt	 (l_caisoisztu 	uthe execeadi ipi,ile (;
t	uthe execeadi irq,attempt[NR_IRQS];
t	uthe execeadi smp_);
al_irq,ile (;
 	uthe execeadi prof_multiplier;
 	uthe execeadi prof_ile (er;
 	 200irq ile (, bh_cle (;
@@ -42,7 +45,8 @@
 
 	/ Map,f
+	+cpu isnao+sscuevtihiceags = (cpu number.  T-s,ewie_po:
e
  * noagbe idempodevt =hen(cpus faitodnao+coq  on-, ne.  */
-
rdezey 2t(cpu number_map[NR_CPUS];
t
rdezey 2t(__cpu number_map[NR_CPUS];
t#def ne cpu number_map(cpu) ___cpu number_map[cpu]f 
 /> T-_prehanse map,f
+	+sscuevtihiceags = (cpu numbernao+cpu is.  */
 
rdezey 2t(__cpu eags = _map[NR_CPUS];
thef -urN 2.3.42/	nclua)/asm-alpha/types.h 2.3.42aa3/	nclua)/asm-alpha/types.h
-* p2.3.42/	nclua)/asm-alpha/types.h	Mon Jan 18 02:27:22 1999
+++ 2.3.42aa3/	nclua)/asm-alpha/types.h	Wed Feb  9 03:48:26 2000
@@ -71,6 +71,10 @@
 typeNIT_uthe execeadi u64;
 #def ne BITS_PER_LONG 64f 
c+
+Dma _ddr	ssos are 32-bitsewide.  */
 
utypeNIT_u32 dma_addr_dsi+
 Ju the  
 Ju the +
+__	intEL__ */
thef -urN 2.3.42/	nclua)/, nux/bl+oac.h 2.3.42aa3/	nclua)/, nux/bl+oac.h
-* p2.3.42/	nclua)/, nux/bl+oac.h	Tue Feb  8 02:28:51 2000
+++ 2.3.42aa3/	nclua)/, nux/bl+oac.h	Wed Feb  9 03:48:28 2000
@@ -34,6 +34,7 @@
 	lk * hebatenc_		ch * bh;
 	lk * hebatenc_		ch * bhtait;
 	lk * heutcuesa * n
rdsi+	;
+
elevaaor_ladevcy;f };t 
 typeNIT_lk * heutcuesa_cueuneutcuesa_cueun_(;
@@ -46,6 +47,13 @@
 typeNIT_ max_(utcuesa_fn_proc)_(utcuesa_cueun_( *);f typeNIT_utcuesa_cueun_( * (cueun_proc)_(kd *__p+	e);t 
ctypeNIT_lk * heelevaaor_s t{* 	;
+
utad_ladevcy;f 	;
+
te);
_)adevcy;f 	;
+
max_bomb_segmevts;e_} elevaaor_t; te st * heutcuesa_cueuner-0 	lk * heutcuesa		*svNIize _utcuesa;*@@ -78,6 +86,8 @@
 	 * t-s,ecueuneWednot.* 	->/
 	h = 			orusn_plug; f+
+	elevaaor_t elevaaor;f };t 
 lk * heble +	e_lk * he{f@@ -144,5 +154,9 @@
 +
+g ad-a		ch inppag
s..
*/
 #def ne MAX_READAHEAD	31
 #def ne MIN_READAHEAD	3t 
u#def ne ELEVATOR_READ_LATENCY (NR_REQUEST>>1)
u#def ne ELEVATOR_WRITE_LATENCY (NR_REQUEST<<5)
u#def ne ELEVATOR_MAX_BOMB_SEGMENTS 4t 
 Ju the thef -urN 2.3.42/	nclua)/, nux/fs.h 2.3.42aa3/	nclua)/, nux/fs.h
-* p2.3.42/	nclua)/, nux/fs.h	Tue Feb  8 02:28:51 2000
+++ 2.3.42aa3/	nclua)/, nux/fs.h	Wed Feb  9 03:48:28 2000
@@ -852,20 +852,17 @@
 }  
 
rdezey max_FASTCALL(_ mark_batenc_dirty(lk * hebatenc_		ch *bh,y 200flag) ;t+
rdezey max_FASTCALL(mark_batenc_dirty(lk * hebatenc_		ch *bh,y 200flag) ;t 
 #def ne htomic son,latenc_dirty(bh) test_and_*/n,bit(BH_Dirty,e&(bh)->b state)
 
-
rdezey 2, ne  maxrmark_batenc_dirty(lk * hebatenc_		ch * bh,y 200flag)e--0-	;) %!atomic son,latenc_dirty(bh))0-		_ mark_batenc_dirty(bh,yflag)tu-}f-
 
rdezey max_balance_dirty(kd *__);t 
rdezeyan+
ison  opt,_change(kd *__);t 
rdezeyan+
;nvalidSti_anta)s%sk * hesupnc_b);
+ * ;t 
rdezey max_invalidSti_anta)_pag
s(lk * heanta)h*);
-
rdezey max_vnvalidSti_batencs(kd *__);
+#def ne invalidSti_batencs(d *)	_ vnvalidSti_batencs((+	e),_0)
u#def ne oastroy_batencs(d *)	_ vnvalidSti_batencs((+	e),_1)
k
rdezey max__ vnvalidSti_batencs(kd *__p+	e,y 20);t 
rdezeyan+
floppy_is_wp( 20);t 
rdezey max_sync anta)s%kd *__);t 
rdezey max_te);
_anta)_now(lk * heanta)h*);
thef -urN 2.3.42/	nclua)/, nux/irq.h 2.3.42aa3/	nclua)/, nux/irq.h
-* p2.3.42/	nclua)/, nux/irq.h	Fri Feb  4 04:09:23 2000
+++ 2.3.42aa3/	nclua)/, nux/irq.h	Wed Feb  9 03:48:27 2000
@@ -11,6 +11,7 @@
 	def ne IRQ_REPLAY	8	/> IRQphasgbeen(replaynd butonoagh
+edpyet
*/
 #def ne IRQ_AUTODETECT	16	/> IRQprs bed loautta)tectedh*/
 #def ne IRQ_WAITING	32	/> IRQpnoagyet
seen(- 	Wedautoa)tect ed  /er#def ne IRQ_LEVEL	64	/> IRQplevel triggeredh*/
 
 	/*  * I
+errupt,controllnc oascripaor. T-s,ers _in w_ nees
thef -urN 2.3.42/	nclua)/, nux/lvm.h 2.3.42aa3/	nclua)/, nux/lvm.h
-* p2.3.42/	nclua)/, nux/lvm.h	Thu Jan  1 01:00:00 1970
+++ 2.3.42aa3/	nclua)/, nux/lvm.h	Wed Feb  9 03:48:26 2000
@@ -0,0 +1,827 @@
c+
tks* kernel/lvm.h
ks*tks* Copyright (C) 1997(- 2000  Hed z Mauelshag
n, Geema y
ks*tks* February-November
1997tks* May-July
1998tks* January-March,July,September,October,Dezember
1999tks* January 2000
+s*tks* lvmers freeesoftware; you cab	redilk ibute(nthand/Wedmodify
ks*(nthunder	ap_p+ermscsi e-e GNU GeneralpPublic Licent cas publish*dhby
ks*(e-e FreeeSoftware Fle dSt ed;peiap_r hanswar 2, Wed at your oftwar)
ks*(Dny )ader hanswar.
ks*(tks* lvmers dilk ibuted nh ap_phope-apat it-wie_pb_pw *ful,tks* butoWITHOUT ANY WARRANTY; ==U}ouageven t-_pimpliex_tarrantyeoftks* MERCHANTABILITY WedFITNESS FOR A PARTICULAR PURPOSE.  Seeiap_tks* GNU GeneralpPublic Licent cfWedmor_pdetaits.
ks*(tks* You shleldghav hreceit d,a copycsi e-e GNU GeneralpPublic Licent 
ks*(Deadi t=U}
GNU CC;
see ap_pfito COPYING.  Ifpnoa,_te);
oao t *(e-e FreeeSoftware Fle dSt ed, 59 Temp
eePlace(- Su);
 330,tks* Bosted, MA 02111-1307, USA. 
+s*tks*/fkt 	/tks* Changelog
+s*tks*    10/10/1997(- begitnd loofpn
w-lk * hure cV
Stiontks*    12/05/1998(- 	ncorpora ed lk * hures,f
+	+;
t v1.h ab, dele ed ;
t v1.htks*    07/06/1998(- a maxed LVM_KMALLOC_MAXsdef ne>byrudd lovmhintm/vfreetks*                 ;
st
ad	ofpkmhintm/kfreetks*    01/07/1998(- fixex_tradi LVM_MAX_SIZEtks*    07/07/1998(- 
rdenxed pn_( lk * hure byrios member
(fWedlksizstic)tks*    02/08/1998(- changescfWedofficialgc = /b);
+ maj 9 numberstks*    07/08/1998(- a maxed initamod   () ab, cleanupamod   () ao+b_plksizetks*    29/08/1998(- sepra ed cor_pand opt, lk * hure type def ni  PAstks*    01/09/1998(- merged kernelyan+egrSt ed hanswar (mike)tks*    20/01/1999(- adxed LVM_PE_DISK_OFFSET macrot	Weduse(nhtks*                 vg utad_t=U}_pv_and_lv(), pv_sct /pe(), pv_shlw_pn_(
rd()...tks*    18/02/1999(- adxed def ni  PAcsi eime opt,_( lk * hure for;fks*                 keepsereq plksmpseoh disk+	Wednonatomic te);
s
(fuhure)tks*    15/03/1999(- hyrre hed LV() ab, VG() macrotdef ni  PActo	ut cargumevttks*                 ;
st
ad	ofp << 9tks*    03/07/1999(- def ne fWedg
nhd.c HOT
 hand(d ltks*    23/07/1999(- implemevted lnapshlheparttks*    08/12/1999(- changed LVM_LV_SIZE_MAXsmacrotto	reflecn-vNIize  1TBNlimittks*    01/01/2000 - 
rdenxed lv_v2 cor_plk * hure byrginn_cueun member
+s*tks*/fkt t 		InNIT__LVM_H_INCLUDE
u#def ne _LVM_H_INCLUDE
u
u#def ne	_LVM_H_VERSION	"LVMh0.8 (1/1/2000)"fkt 	/tks* preproBD
doc def ni  PAstks*/
c+
+;) you like emergencypresetchta)hnh ap_po chann /er#def ne	LVM_TOTAL_RESETt 
u#def ne LVM_GET_INODE
u#def ne	LVM_HD_NAMEfkt 	/ lotscsi debugid loouapuag(see o channsource)
u#def ne DEBU__LVM_GET_INFO
u#def ne DEBU_
u#def ne DEBU__MAP
u#def ne DEBU__MAP_SIZEtk#def ne DEBU__IOCTLtk#def ne DEBU__READtk#def ne DEBU__GENDISKtk#def ne DEBU__VG_CREATE
u#def ne DEBU__LVM_BLK OPENtk#def ne DEBU__VFREttk#def ne DEBU__SNAPSHOTt */
c+
tks* evd si preproBD
doc def ni  PAstks*/
ct 		InNIT_LINUX_VERSION_CODE
u#  ;
clua)h<, nux/hanswar.h> t   	/ fWed2.0.x seriesn /er#  ;InNIT_	intEL_VERSIONer#    def ne 	intEL_VERSION(a,b,c)_(((a) << 16) +_((b) << 8) +_(c))
r#  u the
kJu the tek		nclua)h<, nux/kd *__.h> t		nclua)h<, nux/maj 9.h> t		nclua)h<, nux/iobat.h> t		T_LINUX_VERSION_CODE >= 	intEL_VERSION ( 2, 3 ,0)
u#  ;
clua)h<, nux/sp+4);
+.h> t	uly-Au#  ;
clua)h<asm/sp+4);
+.h> t	u the tek	/ leav ht-s,e	Wednowhuntil maj 9.hers wpda ed (mike)n /er#;InNIT	LVM_BLK MAdr)Au#  def ne	LVM_BLK MAdr)	58 t	u the t#;InNIT	LVM_CHAR MAdr)Au#  def ne	LVM_CHAR MAdr)	109
kJu the tek		f !def ned ( LVM_BLK MAdr)) ||s!def ned ( LVM_CHAR MAdr)) tk M#* calcBch inclua)/, nux/maj 9.he- LVM MAdr)hundef ned
kJu the tek t		T_LINUX_VERSION_CODE < 	intEL_VERSION ( 2, 1 ,0)
u#  ;InNIT	uan+8_ter#    def ne uan+8_t __u8
r#  u the
kJ  ;InNIT	uan+16_ter#    def ne uan+16_t __u16
r#  u the
kJ  ;InNIT	uan+32_ter#    def ne uan+32_t __u32
r#  u the
kJ  ;InNIT	uan+64_ter#    def ne uan+64_t __u64
r#  u the
kJu the tek	def ne LVM_STRUCT_VERSION	1  	/ lk * hure hanswar */
ct 		InNIT	mnhtk	def ne mnh(a,b)_(((a)<(b))?(a):(b)) t	u the t#;InNIT	maxtk	def ne max(a,b)_(((a)>(b))?(a):(b)) t	u the tek	/ setcap_poafault lk * hure hanswar */
c#;) % LVM_STRUCT_VERSIONr=ap1)Au#  def ne pv_t pv_v1_ter#  def ne )v_t lv_v2_ter#  def ne vg t vg v1_ter#  def ne pv_opt,_( pv_opt,_v1_ter#  def ne )v_opt,_( lv_opt,_v1_ter#  def ne vg opt,_( vg opt,_v1_ter#  def ne )v_exceftwar_t lv_v2_exceftwar_t
kJu the tek t+
tks* i/osprotocol
 hanswar
+s*tks* def ned heFoi	Wede-eeo channab, def ned sepera e+nh ap_tks* w *r+lab, LVM parts
+s*tks*/fk#def ne	LVM_DRIVER_IOP_VERSION	        6 tek	def ne LVM_NAME        ";
t"fkt 	/tks* VG/LV
indexd lomacrostks*/
c+
+c = acder  << 9 mapspdirecnlyrao+volume groups*/fk#def ne	VG_CHR(a) ( a) tek	/ b);
+ m<< 9 indexes into	a+volume group/eags = (volume indirecn PAct	 (ls*/fk#def ne	VG_BLK(a)	( vg lv_map[a].vg number)ek	def ne LV_BLK(a)	( vg lv_map[a].lv_number)ekt 	/tks* absoluteNlimit,e	WedVGs, PVs perdVG ab, LVs perdVGtks*/fk#def ne ABS_MAX_VG	99tk#def ne ABS_MAX_PV	256tk#def ne ABS_MAX_LV	256 	/ caw *d byr8ebit m<< 9 */
ct 	def ne MAX_VG  ABS_MAX_VGt 	def ne MAX_LV	ABS_MAX_LVfk#def ne	MAX_PV	ABS_MAX_PVek t		T_( MAX_VG > ABS_MAX_VG)Au#  hundef MAX_VGt 	   def ne MAX_VG ABS_MAX_VGt 	u the tek		f ( MAX_LV > ABS_MAX_LV)Au#  hundef MAX_LVfk#   def ne MAX_LV ABS_MAX_LVfk#u the tek t+
tks* VGDA:poafault opt, lpacls _b, offsets
+s*tks*   theFo's lpacloaftnc ap_psk * hures,for )ader 
rdenp eds.
+s*tks*   offset            wpat                                s_bltks*   ---------------   ----------------------------------  ------------tks*   0                 *ages = (volume lk * hure           ~500 byti
+s*tks*   1K                volume groupslk * hure              ~200 byti
+s*tks*   5K                req plksmpslk * hure                ~
+s*tks*   6K                HOT

 pecsi pages = (volumes        128 byti each
+s*tks*   6k +_r * 128byti _r eags = (volume sk * hures,        ~300 byti each
+s*tks*   + ms* 328byti _ bem pages = (
rdent hintm. sk * hs,   4 byti each
+s*tks*   Evd si opt, - _ befirpecpages = (
rdent               ryps = (4 megabyti
+s*   PEotot= (*
+s*   PEos_bltks*
+s*tks*/fkt 	/ DONT TOUCH THESE !!!s*/
c+
+ba * si PVslk * hure ih disk+parti  PAs*/fk#def ne	LVM_PV_DISK_BASE  	0L tek	/ s_bl resert d,for PVslk * hure oh disk+*/fk#def ne	LVM_PV_DISK_SIZE  	1024L tek	/ ba * si VG lk * hure ih disk+parti  PAs*/fk#def ne	LVM_VG_DISK_BASE  	LVM_PV_DISK_SIZE tek	/ s_bl resert d,for VG lk * hure */fk#def ne	LVM_VG_DISK_SIZE  	( 9s* 512L) tek	/ s_bl resert d,for req keepd lo /er#def ne	LVM_TIMESTAMP_DISK_BASE	% LVM_VG_DISK_BASE tk LVM_VG_DISK_SIZE)er#def ne	LVM_TIMESTAMP_DISK_SIZE	512L	+
+g sert d,for req keepd lo /erek	/ HOT
 
 pecsi pages = (volumes oh disk+*/fk#def ne	LVM_PV_NAMELISn_DISK_BASE % LVM_TIMESTAMP_DISK_BASE tk\ tk MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMLVM_TIMESTAMP_DISK_SIZE) tek	/ nowh	Wede-eeoyHOTs = lyr = cula ed partscsi e-e VGDA+*/fk#def ne	LVM_LV_DISK_OFFSET(a, b)_( (a)->lv_ar_disk.ba * +lunk_si % ;
_t)s* b)er#def ne	LVM_DISK_SIZE(pv) 	_( (pv)->pe_ar_disk.ba * +l\ tk MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM(pv)->pe_ar_disk.*nk_)
+#def ne	LVM_PE_DISK_OFFSET(pe, pv)	( p
 * pv->pe_s_bl +l\ t					oo% LVM_DISK_SIZE ( pv) / SECTOR_SIZE))
+#def ne	LVM_PE_ON_DISK_BASE(pv) \ tk M{ ;
+
utst;l\ tk MMMpv->pe_ar_disk.ba * =Mpv->lv_ar_disk.ba * +lpv->lv_ar_disk.s_bl;l\ tk MMM	f ( (
utst =Mpv->pe_ar_disk.ba * % SECTOR_SIZE)p!= 0)l\ tk MMMMMMpv->pe_ar_disk.ba * += (
SECTOR_SIZE - utst);l\ tk M}ek	/ ENDpoafault opt, lpacls _b, offsets,for PVss*/fkt t +
tks* LVM_PE_T_MAXshyrresponds ao:
+s*tks* 8KB PEos_bl cab	map,a ~512 MB eags = (volume atcap_pcopecsi 1MB  emory,
+s*tks* 128MB PEos_bl cab	map,a 8TB eags = (volume atcap_psOT
 copecsi  emory.
+s*tks* Dafault PEos_bl si 4 MB giv
s a maximum eags = (volume s_bl si 256 GB.
+s*tks* Maximum PEos_bl si 16GB giv
s a maximum eags = (volume s_bl si 1024 TB.
+s*tks* AFAIK,	ap_pactuhi kernelsNlimitht-s,eto	1 TB.
+s*tks* Shleldgbeha sufficient specnrum ;*)tks*/fkt 	/ T-s,ers ap_pw 	 (lss_bl si opt,_pn_(.le_num !!!s       v     v */fk#def ne	LVM_PE_T_MAX		% (o1 << (lunk_si % uan+16_t)s* 8))(- 2)t 
u#def ne	LVM_LV_SIZE_MAX(a)	( (ceadi lodi) LVM_PE_T_MAXs* (a)->pe_s_bl > (ceadi lodi) 2*1024*1024*1024 ? (ceadi lodi) 2*1024*1024*1024 : (ceadi lodi) LVM_PE_T_MAXs* (a)->pe_s_bl)
+#def ne	LVM_MIN_PE_SIZE		( 8Lc* 2)MMMMMMMMMMM	/ 8 KB ih sectors */fk#def ne	LVM_MAX_PE_SIZE		( 16Lc* 1024Lc* 1024Lc* 2)M	/ 16GB ih sectors */fk#def ne	LVM_DEFAULT_PE_SIZE	( 4096Lc* 2)MMMMMMMM	/ 4 MB ih sectors */fk#def ne	LVM_DEFAULT_STRIPE_SIZE	16Lccccccccccccccccc	/ 16 KB  */fk#def ne	LVM_MIN_STRIPE_SIZE	2Lcccccccccccccccccc	/ 1 KB ih sectors */fk#def ne	LVM_MAX_STRIPE_SIZE	( 512Lc* 2)MMMMMMMMM/* 512 KB ih sectors */fk#def ne	LVM_MAX_STRIPES		128		,*or/* max # si lk ipes */fk#def ne	LVM_MAX_SIZE  MMMMMMMMMM( 1024LUc* 1024c* 1024c* 2)M	/ 1TB[sectors] */fk#def ne	LVM_MAX_MIRRORSMMMM	2		+
+fuhure	ut c*/fk#def ne	LVM_MIN_READ_AHEAD	0	+
+m<<imum utad a		ch sectors */fk#def ne	LVM_MAX_READ_AHEAD	256	/* maximum utad a		ch sectors */fk#def ne	LVM_DEF_READ_AHEAD	((LVM_MAX_READ_AHEAD-LVM_MIN_READ_AHEAD)/2 +lLVM_MIN_READ_AHEAD)fk#def ne	LVM_MAX_LV_IO_TIMEOUT	60	+
+seconds I/O req oua
(fuhure	ut ) */fk#def ne	LVM_PARTITIONrrrrrrrrrrr0xfe	+
+LVM parti  PAsid */fk#def ne	LVM_NEW_PARTITIONrrrrrrr0x8e	+
+n
w-LVM parti  PAsid (10/09/1999) */fk#def ne	LVM_PE_SIZE_PV_SIZE_REL	5r/* max relSt ed PVsl_bl _b, PEos_bl */
ct 	def ne	LVM_SNAPSHOT_MAX_CHUNK	256	/* 256 KB */fk#def ne	LVM_SNAPSHOT_DEF_CHUNK	64	/> 64  KB */fk#def ne	LVM_SNAPSHOT_MIN_CHUNK	1		/ 1   KB */fkfk#def ne	UNDEF	-1t 	def ne FALSE	0Au#def ne TRUE	1 tek t+
tks* ioctlstks*/
c+
+volume groups*/fk#def ne	VG_CREATEccccccccccccccc_IOWM( 0xfe, 0x00, 1)
+#def ne	VG_REMOVEccccccccccccccc_IOWM( 0xfe, 0x01, 1)
+
u#def ne	VG_EXTENDpcccccccccccccc_IOWM( 0xfe, 0x03, 1)
+#def ne	VG_REDUCEccccccccccccccc_IOWM( 0xfe, 0x04, 1)
+
u#def ne	VG_STATUSccccccccccccccc_IOWRM( 0xfe, 0x05, 1)
+#def ne	VG_STATUS_GET_COUNT cccc_IOWRM( 0xfe, 0x06, 1)
+#def ne	VG_STATUS_GET_NAMELISncc_IOWRM( 0xfe, 0x07, 1)
+
u#def ne	VG_SET_EXTENDABLEccccccc_IOWM( 0xfe, 0x08, 1)
+
ut 	/ logs = (volume */fk#def ne	LV_CREATEccccccccccccccc_IOWM( 0xfe, 0x20, 1)
+#def ne	LV_REMOVEccccccccccccccc_IOWM( 0xfe, 0x21, 1)
+
u#def ne	LV_ACTIVATEccccccccccccc_IOM( 0xfe, 0x22)
+#def ne	LV_DEACTIVATEccccccccccc_IOM( 0xfe, 0x23)
+
u#def ne	LV_EXTENDpcccccccccccccc_IOWM( 0xfe, 0x24, 1)
+#def ne	LV_REDUCEccccccccccccccc_IOWM( 0xfe, 0x25, 1)
+
u#def ne	LV_STATUS_BYNAME        _IOWRM( 0xfe, 0x26, 1)
+#def ne	LV_STATUS_BY	{DEX       _IOWRM( 0xfe, 0x27, 1)
+
u#def ne LV_SET_ACCESS cccccccccc_IOWM( 0xfe, 0x28, 1)
+#def ne LV_SET_ALLOCATIONrrrrrrr_IOWM( 0xfe, 0x29, 1)
+#def ne LV_SET_STATUSccccccccccc_IOWM( 0xfe, 0x2a, 1)
+
u#def ne LE_REMAP ccccccccccccccc_IOWM( 0xfe, 0x2b, 1)
+
ut 	/ *ages = (volume */fk#def ne	PV_STATUSccccccccccccccc_IOWRM( 0xfe, 0x40, 1)
+#def ne	PV_CHANGEccccccccccccccc_IOWRM( 0xfe, 0x41, 1)
+#def ne	PV_FLUSH ccccccccccccccc_IOWM( 0xfe, 0x42, 1)
+
u	/ *ages = (
rdent */fk#def ne	PE_LOCK_UNLOCKcccccccccc_IOWM( 0xfe, 0x50, 1)
+
u	/ i/osprotocol hanswar */
c#def ne	LVM_GET_IOP_VERSIONccccc_IORM( 0xfe, 0x98, 1)
+
u	erNIT_LVM_TOTAL_RESETt +
+specialpresetcaps - edh	Wedetstd lopur t *s */fk#def ne	LVM_RESETccccccccccccccc_IOM( 0xfe, 0x99) t	u the tek	/ );
+ ap_plogs = (volume managann /er#def ne	LVM_LOCK_LVM ccccccccccc_IOM( 0xfe, 0x100)t 	/ ENDpioctlss*/fkt t +
tks* Status flagstks*/
c+
+volume groups*/fk#def ne	VG_ACTIVEcccccccccccc0x01r/* vg statuss*/fk#def ne	VG_EXPORTEDcccccccccc0x02r/*     "     */fk#def ne	VG_EXTENDABLEccccccc 0x04r/*     "     */fk
+#def ne	VG_READpccccccccccccc0x01r/* vg acBD
d */fk#def ne	VG_WRITEccccccccccccc0x02r/*     "     */fk
+	/ logs = (volume */fk#def ne	LV_ACTIVEcccccccccccc0x01r/* lv statuss*/fk#def ne	LV_SP	{DOWNcccccccccc0x02r/*     "     */fk
+#def ne	LV_READpccccccccccccc0x01r/* lv acBD
d */fk#def ne	LV_WRITEccccccccccccc0x02r/*     "     */fk#def ne	LV_SNAPSHOTcccccccccc0x04r/*     "     */fk#def ne	LV_SNAPSHOT_ORGcccccc0x08r/*     "     */fk
+#def ne	LV_BADBLOCK_ONrrrrrrr0x01r/* lv badb);
+ */
+
u#def ne	LV_STRICTcccccccccccc0x01r/* lv aintma  PAs*/fk#def ne	LV_CONTIGUOUScccccccc0x02r/*       "       */fk
+	/ *ages = (volume */fk#def ne	PV_ACTIVEcccccccccccc0x01r/* pv statuss*/fk#def ne	PV_ALLOCATABLEccccccc0x02r/* pv aintma 	 (ls*/fkt t +
tks* St * hure def ni  PAs cor_/disk+	Wintw
+s*tks* condi  PAalgconhanswar tak*s place(ar big u than architecturestks* in aps - eds * pv copy_*(), vg copy_*() _b, lv copy_*()
+s*tks*/fkt #def ne	NAME_LEN		128r/*  *b't change!!!s*/
c#def ne	UUID_LEN		16 r/*  *b't change!!!s*/
c
+	/ remap *ages = (sector/r+	ecpairs */fktypeNIT_lk * he{ tk Mlk * he
 pe_		ch hash; tk Mueadi  rsector_org; tk Mkd *__pr+	e_org; tk Mueadi  rsector_n
w; tk Mkd *__pr+	e_n
w; t} lv b);
+_exceftwar_t;
+
ut 	/ opt, lkored pnoinfWema  PAs*/fktypeNIT_lk * he{ tk Muan+16_t lv_num; tk Muan+16_t le_num; t} opt,_pn_(;
ut 	/ opt, lkored PV, VG,_LV _b, PEos_bl _b, offsetoinfWema  PAs*/fktypeNIT_lk * he{ tk Muan+32_t ba *; tk Muan+32_t s_bl; t} lvm opt,_data_t;
+
ut 	/tks* St * hure Pages = (Volume (PV) Vanswar 1tks*/fkt 	/ cor_p*/fktypeNIT_lk * he{ tk Muan+8_t          ;d[2];ccccccccccccccccc	/ Ioantifixnn /erk Muan+16_t s       vanswar;ccccccccccccccc	/ HM lvmehanswar */
cooo)vm opt,_data_tMMpv_ar_disk;
cooo)vm opt,_data_tMMvg ar_disk;
cooo)vm opt,_data_tMMpv_HOT

 pe ar_disk;
cooo)vm opt,_data_tMMlv_ar_disk;
cooo)vm opt,_data_tMMpe_ar_disk; tk Muan+8_t          pv_HOT
[NAME_LEN]; tk Muan+8_t          vg nOT
[NAME_LEN]; tk Muan+8_t          system_;d[NAME_LEN]; 	/ fWedvgex t_s/vgim t_s */
coookd *__p          pv_d *; tk Muan+32_t         pv_Humber; tk Muan+32_t         pv_status; tk Muan+32_t         pv_aintma 	 (l; tk Muan+32_t         pv_s_bl;		+
+HM  /erk Muan+32_t         lv cur; tk Muan+32_t         pe_s_bl; tk Muan+32_t         pe_tot= ; tk Muan+32_t         pe_aintma *d;
tk Muan+32_t         pe_st= e;ccccc	/ fWedfuhure	ut c*/fk   dpt,_pn_(        *pe;cccccccccc	/ HM */fk   lk * heanta)h    *anta);ccccccc	/ HM */fk} pv_v1_t;
ut 	/ opt, */fktypeNIT_lk * he{ tk Muan+8_t          ;d[2];ccccccccccccccccc	/ Ioantifixnn /erk Muan+16_t s       vanswar;ccccccccccccccc	/ HM lvmehanswar */
cooo)vm opt,_data_tMMpv_ar_disk;
cooo)vm opt,_data_tMMvg ar_disk;
cooo)vm opt,_data_tMMpv_HOT

 pe ar_disk;
cooo)vm opt,_data_tMMlv_ar_disk;
cooo)vm opt,_data_tMMpe_ar_disk; tk Muan+8_t          pv_HOT
[NAME_LEN]; tk Muan+8_t          vg nOT
[NAME_LEN]; tk Muan+8_t          system_;d[NAME_LEN]; 	/ fWedvgex t_s/vgim t_s */
cooouan+32_t         pv_maj 9; tk Muan+32_t         pv_Humber; tk Muan+32_t         pv_status; tk Muan+32_t         pv_aintma 	 (l; tk Muan+32_t         pv_s_bl;		+
+HM  /erk Muan+32_t         lv cur; tk Muan+32_t         pe_s_bl; tk Muan+32_t         pe_tot= ; tk Muan+32_t         pe_aintma *d;
tk Muan+32_t	,*oriummy1;
tk Muan+32_t	,*oriummy2;
tk Muan+32_t	,*oriummy3;fk} pv_opt,_v1_t;
+
ut 	/tks* St * hure Pages = (Volume (PV) Vanswar 2
(fuhure!)tks*/fkt typeNIT_lk * he{ tk Muan+8_t          ;d[2];ccccccccccccccccc	/ Ioantifixnn /erk Muan+16_t s       vanswar;ccccccccccccccc	/ HM lvmehanswar */
cooo)vm opt,_data_tMMpv_ar_disk;
cooo)vm opt,_data_tMMvg ar_disk;
cooo)vm opt,_data_tMMpv_uuid ar_disk;
cooo)vm opt,_data_tMMlv_ar_disk;
cooo)vm opt,_data_tMMpe_ar_disk; tk Muan+8_t          pv_HOT
[NAME_LEN]; tk Muan+8_t          vg nOT
[NAME_LEN]; tk Muan+8_t          system_;d[NAME_LEN]; 	/ fWedvgex t_s/vgim t_s */
coookd *__p          pv_d *; tk Muan+32_t         pv_Humber; tk Muan+32_t         pv_status; tk Muan+32_t         pv_aintma 	 (l; tk Muan+32_t         pv_s_bl;		+
+HM  /erk Muan+32_t         lv cur; tk Muan+32_t         pe_s_bl; tk Muan+32_t         pe_tot= ; tk Muan+32_t         pe_aintma *d;
tk Muan+32_t         pe_st= e;ccccc	/ fWedfuhure	ut c*/fk   dpt,_pn_(        *pe;cccccccccc	/ HM */fk   lk * heanta)h    *anta);ccccccc	/ HM */fkccc	/ deltarao+vanswar 1ylkarts heFoi /erk Muan+8_t          pv_uuid[UUID_LEN]; tk Muan+32_t         pv_areq ;ccccc	/ PVpacBD
d req p*/
cooouan+32_t         pv_creq ;ccccc	/ PVpcV
Stion req p*/
cooouan+32_t         pv_mreq ;ccccc	/ PVpmodificStion req p*/
c} pv_v2_t;
+
ut 	/tks* St * hures,for Logs = (Volume (LV)Aus*/fkt 	/ cor_pPEoinfWema  PAs*/fktypeNIT_lk * he{ tk Mkd *__p  d *; tk Muan+32_t pl;		+
+ao+b_pchanged if > 2TBp*/
cooouan+32_t utads; tk Muan+32_t te);
s;fk} pn_(;
ut typeNIT_lk * he{ tk Muan+8_t  lv_HOT
[NAME_LEN]; tk Mkd *__p  old d *; tk Mkd *__p  n
w_d *; tk Mueadi    old pe; tk Mueadi    n
w_pl; t} le_remap_utc_t;
+
ut t 	/tks* St * hure Logs = (Volume (LV) Vanswar 1tks*/fkt 	/ cor_p*/fktypeNIT_lk * he{ tk Muan+8_t        lv_HOT
[NAME_LEN]; tk Muan+8_t        vg nOT
[NAME_LEN]; tk Muan+32_t       lv acBD
d; tk Muan+32_t       lv status; tk Muan+32_t       lv_apen;		+
+HM  /erk Mkd *__p        lv_d *;		+
+HM  /erk Muan+32_t       lv_number;		+
+HM  /erk Muan+32_t       lv_mi cal copi
s;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_recohany;cccccccccc	/       "       c*/fk   uan+32_t       lv_sisod   ;		+
+      "       c*/fk   uan+32_t       lv_s_bl; tk Mpn_(          c*lv curize _pl;	+
+HM  /erk Muan+32_t       lv_curize _le;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_aintma *d_(l; tk Muan+32_t       lv st ipes; tk Muan+32_t       lv st ipes_bl; tk Muan+32_t       lv badb);
+;		+
+fWedfuhure	ut c*/fk   uan+32_t       lv_aintma war;fk   uan+32_t       lv_io_req oua;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_read_a		ch;ft} lv v1_t;
ut 	/ opt, */fktypeNIT_lk * he{ tk Muan+8_t        lv_HOT
[NAME_LEN]; tk Muan+8_t        vg nOT
[NAME_LEN]; tk Muan+32_t       lv acBD
d; tk Muan+32_t       lv status; tk Muan+32_t       lv_apen;		+
+HM  /erk Muan+32_t       lv_d *;		+
+HM  /erk Muan+32_t       lv_number;		+
+HM  /erk Muan+32_t       lv_mi cal copi
s;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_recohany;cccccccccc	/       "       c*/fk   uan+32_t       lv_sisod   ;		+
+      "       c*/fk   uan+32_t       lv_s_bl; t   uan+32_t       iummy;erk Muan+32_t       lv_curize _le;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_aintma *d_(l; tk Muan+32_t       lv st ipes; tk Muan+32_t       lv st ipes_bl; tk Muan+32_t       lv badb);
+;		+
+fWedfuhure	ut c*/fk   uan+32_t       lv_aintma war;fk   uan+32_t       lv_io_req oua;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_read_a		ch;	+
+HM, fWedfuhure	ut c*/fk} lv_opt,_v1_t;
ut t 	/tks* St * hure Logs = (Volume (LV) Vanswar 2tks*/fkt 	/ cor_p*/fktypeNIT_lk * helv_v2 { tk Muan+8_t        lv_HOT
[NAME_LEN]; tk Muan+8_t        vg nOT
[NAME_LEN]; tk Muan+32_t       lv acBD
d; tk Muan+32_t       lv status; tk Muan+32_t       lv_apen;		+
+HM  /erk Mkd *__p        lv_d *;		+
+HM  /erk Muan+32_t       lv_number;		+
+HM  /erk Muan+32_t       lv_mi cal copi
s;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_recohany;cccccccccc	/       "       c*/fk   uan+32_t       lv_sisod   ;		+
+      "       c*/fk   uan+32_t       lv_s_bl; tk Mpn_(          c*lv curize _pl;	+
+HM  /erk Muan+32_t       lv_curize _le;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_aintma *d_(l; tk Muan+32_t       lv st ipes; tk Muan+32_t       lv st ipes_bl; tk Muan+32_t       lv badb);
+;		+
+fWedfuhure	ut c*/fk   uan+32_t       lv_aintma war;fk   uan+32_t       lv_io_req oua;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_read_a		ch;ftccc	/ deltarao+vanswar 1ylkarts heFoi /erk Mlk * helv_v2  c*lv lnapshlh_org; tk Mlk * helv_v2  c*lv lnapshlh_pr *; tk Mlk * helv_v2  c*lv lnapshlh_n
rdsi+   lv b);
+_exceftwar_tc*lv b);
+_exceftwar; tk Muan+8_t __wnw *d2;fk   uan+32_t       lv_remap_ptr;fk   uan+32_t       lv_remap_end;erk Muan+32_t       lv_chunk_s_bl; tk Muan+32_t       lv lnapshlh_m<< 9; tk Mlk * hekiobats* lv_iobat; tk Mlk * hesemaphor_ lv lnapshlh_sem; tk Mlk * he
 pe_		ch * lv lnapshlh_hash_ 	 (l; tk Muthe execeadi lv lnapshlh_hash_mask;ft} lv v2_t;
ut 	/ opt, */fktypeNIT_lk * he{ tk Muan+8_t        lv_HOT
[NAME_LEN]; tk Muan+8_t        vg nOT
[NAME_LEN]; tk Muan+32_t       lv acBD
d; tk Muan+32_t       lv status; tk Muan+32_t       lv_apen;		+
+HM  /erk Muan+32_t       lv_d *;		+
+HM  /erk Muan+32_t       lv_number;		+
+HM  /erk Muan+32_t       lv_mi cal copi
s;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_recohany;cccccccccc	/       "       c*/fk   uan+32_t       lv_sisod   ;		+
+      "       c*/fk   uan+32_t       lv_s_bl; t   uan+32_t       iummy;erk Muan+32_t       lv_curize _le;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_aintma *d_(l; tk Muan+32_t       lv st ipes; tk Muan+32_t       lv st ipes_bl; tk Muan+32_t       lv badb);
+;		+
+fWedfuhure	ut c*/fk   uan+32_t       lv_aintma war;fk   uan+32_t       lv_io_req oua;		/ fWedfuhure	ut c*/fk   uan+32_t       lv_read_a		ch;	+
+HM, fWedfuhure	ut c*/fk} lv_opt,_v2_t;
+
ut 	/tks* St * hure(Volume Groups(VG) Vanswar 1tks*/fkt typeNIT_lk * he{ tk Muan+8_t        vg nOT
[NAME_LEN];ccccc	/ volume groupsHOT
 */fk   uan+32_t       vg number;ccccccccccccc	/ volume groupsHumbern*/fk   uan+32_t       vg acBD
d;ccccccccccccc	/ read/te);
o*/fk   uan+32_t       vg status;ccccccccccccc	/ a
  veeWednot  /erk Muan+32_t       lv_max;cccccccccccccccc	/ maximum eags = (volumes  /erk Muan+32_t       lv_cur;cccccccccccccccc	/ vNIize  eags = (volumes  /erk Muan+32_t       lv_apen;ccccccccccccccc	/ apen    lags = (volumes  /erk Muan+32_t       pv_max;cccccccc	/ maximum pages = (volumes  /erk Muan+32_t       pv_cur;	c	/ vNIize  pages = (volumes FU  /erk Muan+32_t       pv_a
 ;cccccccc	/ a
  veepages = (volumes  /erk Muan+32_t       iummy;ccccccccc	/ was obsolete max_pn_pnc_pvo*/fk   uan+32_t       vgda;		o	/ volume groupsoascripaor arrays FU  /erk Muan+32_t       pe_s_bl;ccccccc	/ *ages = (
rdent s_bl ih sectors */fkk Muan+32_t       pe_tot= ;cccccc	/ tot= (si pages = (
rdents */fkk Muan+32_t       pe_aintma *d;cc	/ aintma *d pages = (
rdents */fkk Muan+32_t       pvg tot= ;	 	/ *ages = (volume groups FU  /erk Mlk * heproc_dir_entry *proc; tk Mp*__p          *pv[ABS_MAX_PV+1]; 	/ *ages = (volume lk * h poi
+ers */
cooo)v_(          c*lv[ABS_MAX_LV+1]; 	/ lags = ((volume lk * h poi
+ers */
c} vg v1_t;fkt typeNIT_lk * he{ tk Muan+8_t        vg nOT
[NAME_LEN];ccccc	/ volume groupsHOT
 */fk   uan+32_t       vg number;ccccccccccccc	/ volume groupsHumbern*/fk   uan+32_t       vg acBD
d;ccccccccccccc	/ read/te);
o*/fk   uan+32_t       vg status;ccccccccccccc	/ a
  veeWednot  /erk Muan+32_t       lv_max;cccccccccccccccc	/ maximum eags = (volumes  /erk Muan+32_t       lv_cur;cccccccccccccccc	/ vNIize  eags = (volumes  /erk Muan+32_t       lv_apen;ccccccccccccccc	/ apen    lags = (volumes  /erk Muan+32_t       pv_max;cccccccc	/ maximum pages = (volumes  /erk Muan+32_t       pv_cur;	c	/ vNIize  pages = (volumes FU  /erk Muan+32_t       pv_a
 ;cccccccc	/ a
  veepages = (volumes  /erk Muan+32_t       iummy;fk   uan+32_t       vgda;		o	/ volume groupsoascripaor arrays FU  /erk Muan+32_t       pe_s_bl;ccccccc	/ *ages = (
rdent s_bl ih sectors */fkk Muan+32_t       pe_tot= ;cccccc	/ tot= (si pages = (
rdents */fkk Muan+32_t       pe_aintma *d;cc	/ aintma *d pages = (
rdents */fkk Muan+32_t       pvg tot= ;	 	/ *ages = (volume groups FU  /er} vg opt,_v1_t;
ut 	/tks* St * hure(Volume Groups(VG) Vanswar 2tks*/fkt typeNIT_lk * he{ tk Muan+8_t        vg nOT
[NAME_LEN];ccccc	/ volume groupsHOT
 */fk   uan+32_t       vg number;ccccccccccccc	/ volume groupsHumbern*/fk   uan+32_t       vg acBD
d;ccccccccccccc	/ read/te);
o*/fk   uan+32_t       vg status;ccccccccccccc	/ a
  veeWednot  /erk Muan+32_t       lv_max;cccccccccccccccc	/ maximum eags = (volumes  /erk Muan+32_t       lv_cur;cccccccccccccccc	/ vNIize  eags = (volumes  /erk Muan+32_t       lv_apen;ccccccccccccccc	/ apen    lags = (volumes  /erk Muan+32_t       pv_max;cccccccccccccccc	/ maximum pages = (volumes  /erk Muan+32_t       pv_cur;		c	/ vNIize  pages = (volumes FU  /erk Muan+32_t       pv_a
 ;cccccccccccccccc	/ fuhure: a
  veepages = (volumes  /erk Muan+32_t       max_pn_pnc_pv;ccccccccc	/ OBSOLETE maximum PE/PVo*/fk   uan+32_t       vgda;			o	/ volume groupsoascripaor arrays FU  /erk Muan+32_t       pe_s_bl;ccccccc ccccccc	/ *ages = (
rdent s_bl ih sectors */fkk Muan+32_t       pe_tot= ;cccccc ccccccc	/ tot= (si pages = (
rdents */fkk Muan+32_t       pe_aintma *d;cccccccccc	/ aintma *d pages = (
rdents */fkk Muan+32_t       pvg tot= ;		 	/ *ages = (volume groups FU  /erk Mlk * heproc_dir_entry *proc; tk Mp*__p          *pv[ABS_MAX_PV+1]; 	/ *ages = (volume lk * h poi
+ers */
cooo)v_(          c*lv[ABS_MAX_LV+1]; 	/ lags = ((volume lk * h poi
+ers */
cccc	/ deltarao+vanswar 1ylkarts heFoi /erk Muan+8_t        vg uuid[UUID_LEN];ccccc	/  volume groupsUUIDi /erk Meime t         vg areq ;cccccccccccccc	/ VG acBD
d req p*/
coooeime t         vg creq ;cccccccccccccc	/ VG cV
Stion req p*/
coooeime t         vg mreq ;cccccccccccccc	/ VG modificStion req p*/
c} vg v2_t;
+
ut 	/tks* Teq keepd lolk * hure oh disk+(0.7 f
Sture)tks*tks* Holds severalpreq lksmpsefWedlksrt/stop req pofpnontks* atomic VGDA+disk+i/osopera  PAstks*tks*/fkt typeNIT_lk * he{ tk Muan+32_t	seconds; 	/ seconds since ap_pepoch */fkk Muan+32_t	jiffi
s;c	/ microtteq rc*/fk} lvm_eime t;
+
u#def ne	TIMESTAMP_ID_SIZE	2t typeNIT_lk * he{ tk Muan+8_t    id[TIMESTAMP_ID_SIZE]; 	/ Ioantifixnn /erk Mlvm_eime t pv_vg lv_pe_io_begit;erk Mlvm_eime t pv_vg lv_pe_io_end;erk Mlvm_eime t pv_io_begit;erk Mlvm_eime t pv_io_end;erk Mlvm_eime t vg io_begit;erk Mlvm_eime t vg io_end;erk Mlvm_eime t lv_io_begit;erk Mlvm_eime t lv_io_end;erk Mlvm_eime t pe_io_begit;erk Mlvm_eime t pe_io_end;erk Mlvm_eime t pe_sct /io_begit;erk Mlvm_eime t pe_sct /io_end;erk Muan+8_t    iummy[LVM_TIMESTAMP_DISK_SIZE -  tk MMMMMMMMMMMMMMMMMMTIMESTAMP_ID_SIZE - tk MMMMMMMMMMMMMMMMMM12 *lunk_si(lvm_eime t)]; tk Mccc	/ ATTENTIONrr^^c*/fk} req lksmp opt,_(;
ut 	/ sOT
 oh disk+_b, ih cor_plo far */fktypeNIT_req lksmp opt,_(_req lksmp (;
ut 	/ aps - edhioantifixns,for req lksmpsa - eds */fktypeNIT_enum { PV_VG_LV_PE_IO_BEGIN, tk MMMMMMMMMMMMMPV_VG_LV_PE_IO_END, tk MMMMMMMMMMMMMPV_IO_BEGIN, tk MMMMMMMMMMMMMPV_IO_END, tk MMMMMMMMMMMMMVG_IO_BEGIN, tk MMMMMMMMMMMMMVG_IO_END, tk MMMMMMMMMMMMMLV_IO_BEGIN, tk MMMMMMMMMMMMMLV_IO_END, tk MMMMMMMMMMMMMPE_IO_BEGIN, tk MMMMMMMMMMMMMPE_IO_END, tk MMMMMMMMMMMMMPE_MOVE_IO_BEGIN, tk MMMMMMMMMMMMMPE_MOVE_IO_END} rs_fct_id_t;
+
ut 	/tks* Rtcuesa sk * hures,for ioctlstks*/
ct 	/ Rtcuesa sk * hure PV_STATUSc*/fktypeNIT_lk * he{ tk Mc =  pv_HOT
[NAME_LEN]; tk Mp*__p*pv;fk} pv_status_utc_t, pv_change_utc_t;
+
u	/ Rtcuesa sk * hure PV_FLUSH */fktypeNIT_lk * he{ tk Mc =  pv_HOT
[NAME_LEN]; t} pv_flush_utc_t;
+
ut 	/ Rtcuesa sk * hure PE_MOVE */fktypeNIT_lk * he{ tk Menum { LOCK_PE, UNLOCK_PE} );
+; tk Mlk * he{ tk MMMMkd *__plv_d *; tk MMMMkd *__ppv_d *; tk MMMMuan+32_t      pv_affset; tk M} data;fk} pn_);
+_utc_t;
+
ut 	/ Rtcuesa sk * hure LV_STATUS_BYNAME */fktypeNIT_lk * he{ tk Mc =  lv_HOT
[NAME_LEN]; tk M)v_( *lv;ft} lv status_byHOTe_utc_t, lv_rec_t;
+
u	/ Rtcuesa sk * hure LV_STATUS_BY	{DEX */fktypeNIT_lk * he{ tk Mueadi lv index; tk M)v_( *lv;ft} lv status_byindex_rec_t;
+
uJu the +
+		InNIT__LVM_H_INCLUDE */
thef -urN 2.3.42/	nclua)/, nux/maj 9.he2.3.42aa3/	nclua)/, nux/maj 9.h
-* p2.3.42/	nclua)/, nux/maj 9.h	Sun Jan 30 15:43:30 2000
+++ 2.3.42aa3/	nclua)/, nux/maj 9.h	Wed Feb  9 03:48:26 2000
@@ -92,8 +92,6 @@
 	def ne SCSI_DISK7 MAdr)	71
 
 
-	def ne LVM_BLK MAdr)	58	+
+Logs = (Volume Managann /e-
 	def ne COMPAQ_SMART2 MAdr)	72
 	def ne COMPAQ_SMART2 MAdr)1	73
 	def ne COMPAQ_SMART2 MAdr)2	74
thef -urN 2.3.42/	nclua)/, nux/mm.h 2.3.42aa3/	nclua)/, nux/mm.h
-* p2.3.42/	nclua)/, nux/mm.h	Fri Feb  4 04:07:30 2000
+++ 2.3.42aa3/	nclua)/, nux/mm.h	Wed Feb  9 03:48:28 2000
@@ -399,7 +399,6 @@
 		uthe exec;
+
* zones_s_bl,Muthe execeadi zone_lksrt_paddr);t 
rdezey max_mem_;nit( max);t 
rdezey max_shlw_mem( max);t-
rdezey max_oom(lk * hetat,_lk * he/ tsk);t 
rdezey max_si_meminfW%sk * hesgesnfWe/ val);t 
rdezey max_swap+4_reada		ch(swp_entry__);t 
@@ -462,7 +461,7 @@
 
 	def ne __GFP_DMA	0x20
 
-	def ne GFP_BUFFER	(__GFP_WAIT)
+#def ne GFP_BUFFER	(__GFP_HIGH | __GFP_WAIT)
 #def ne GFP_ATOMIC	(__GFP_HIGH)
 #def ne GFP_USER	(__GFP_WAIT | __GFP_IO)
 #def ne GFP_HIGHUSER	(GFP_USER | __GFP_HIGHMEM)
thef -urN 2.3.42/	nclua)/, nux/mmzone.h 2.3.42aa3/	nclua)/, nux/mmzone.h
-* p2.3.42/	nclua)/, nux/mmzone.h	Tue Feb  8 02:26:13 2000
+++ 2.3.42aa3/	nclua)/, nux/mmzone.h	Wed Feb  9 03:48:26 2000
@@ -29,7 +29,7 @@
 	uthe execeadi affset;  	uthe execeadi free_pag
s;
 	 200llw_on_ emory;t-	uthe execeadi pag
s_);w, pag
s_high;
t	uthe execeadi pag
s_min, pag
s_);w, pag
s_high;
 	lk * hepg
 pe_data *zone_pgdat;t 
 	+

thef -urN 2.3.42/	nclua)/, nux/rbtree.h 2.3.42aa3/	nclua)/, nux/rbtree.h
-* p2.3.42/	nclua)/, nux/rbtree.h	Thu Jan  1 01:00:00 1970
+++ 2.3.42aa3/	nclua)/, nux/rbtree.h	Wed Feb  9 03:48:29 2000
@@ -0,0 +1,128r@@
c+
tks Rtd Black Treestks (C) 1999  Andrea Arcangeli <andrea@suse.de> t   t  T-s,eprogramers freeesoftware; you cab	redilk ibute(nthand/Wedmodify
ks(nthunder	ap_p+ermscsi e-e GNU GeneralpPublic Licent cas publish*dhby
ks(e-e FreeeSoftware Fle dSt ed;peiap_r hanswar 2csi e-e Licent , Wetks (at your oftwar)(Dny )ader hanswar.
k t  T-s,eprogramers dilk ibuted nh ap_phope-apat it-wie_pb_pw *ful,tks butoWITHOUT ANY WARRANTY; ==U}ouageven t-_pimpliex_tarrantyeoftks MERCHANTABILITY WedFITNESS FOR A PARTICULAR PURPOSE.  Seeiap_tks GNU GeneralpPublic Licent cfWedmor_pdetaits.
ktks You shleldghav hreceit d,a copycsi e-e GNU GeneralpPublic Licent 
ks(Deadi t=U}
t-s,eprogram; if noa,_te);
oao(e-e FreeeSoftware
ks(Fle dSt ed, Inc., 59 Temp
eePlace, Su);
 330, Bosted, MA  02111-1307  USA
ktks , nux/inclua)/, nux/rbtree.h
k t  To	ut crbtrees you'e_phav hao(implemevt your oweyanserthand search cor_s.
+s T-s,ewie_pa max	utcto	ut c = lbacks _b, to	drop	dramma   = lyrperfWemanc_s.
+s I knowhit'sdnot ap_pcleaner way,s butonh C (not nh C++) ao+gettksrperfWemanc_s _b, genericity...tktksrSome examp
eesi anserthand search 	Wintws heFo. T-e search rs _ planhtksdnoemal search ohannab Wederedhtree. T-e anserth;
st
ad	musa be implemevted
ks(nvt two_lkeps:cas firpect-sdi ap_pcode	musa anserthap_pelemevt nhtksdWedercas a	red leaf nh ap_ptree,	ap_h ap_psup t_s library aps - edtksdrb_ansert_color() musa be  = led. Such 	ps - edhwie_pdoiap_tks not arivialpworktto	rebalance ap_prbtree if neBD
dary.
+
+-----------------------------------------------------------------------
+lksizey 2, ne lk * hepag
e/ rb_search_pag
_cache(lk * heanta)h*eanta), t						 uthe execeadi affset)
+{ t	rb_nta)_he/ n =eanta)->i_rb_pag
_cache.rb_nta);
t	lk * hepag
e/ pag
;
+
u	whito (r)
k	{ t		pag
e= rb_entry(d, lk * hepag
, rb_pag
_cache);
+
u		;) %offseto<epag
->affset)
+			n =en->rb_left;
+		uly- ;) %offseto>epag
->affset)
+			n =en->rb_right;
+		uly-
+			rehurn pag
;
+	} t	rehurn NULL;ft}
+
ulksizey 2, ne lk * hepag
e/ __rb_ansert_pag
_cache(lk * heanta)h*eanta), t						   uthe execeadi affset, t						   rb_nta)_he/ nta))
+{ t	rb_nta)_he// p =e&anta)->i_rb_pag
_cache.rb_nta);
t	rb_nta)_he/ paize  = NULL;ft	lk * hepag
e/ pag
;
+
u	whito (*p)
k	{ t		paize  = *p; t		pag
e= rb_entry(paize , lk * hepag
, rb_pag
_cache);
+
u		;) %offseto<epag
->affset)
+			p =e&(*p)->rb_left;
+		uly- ;) %offseto>epag
->affset)
+			p =e&(*p)->rb_right;
+		uly-
+			rehurn pag
;
+	} t
+	nta)->rb_paize  = paize ;
+	nta)->rb_color = RB_RED;
+	nta)->rb_left =enta)->rb_right = NULL;ft
+	*p =enta);ft
+	rehurn NULL;ft}
+
ulksizey 2, ne lk * hepag
e/ rb_ansert_pag
_cache(lk * heanta)h*eanta), t						 uthe execeadi affset, t						 rb_nta)_he/ nta))
+{ t	lk * hepag
e/ ret; t	;) %(ret =e__rb_ansert_pag
_cache(anta), affset, nta))))
+		goto	oua;
t	rb_ansert_color(nta), &anta)->i_rb_pag
_cache);
+	oua:
+	rehurn ret; t}
+-----------------------------------------------------------------------
+*/
ct 		InNIT	_LINUX_RBTREE_H
u#def ne	_LINUX_RBTREE_H
uek		nclua)h<, nux/kernel.h> t		nclua)h<, nux/stddef.h> tfktypeNIT_lk * herb_nta)_s
+{ t	lk * herb_nta)_se/ rb_paize ;
+	;
+
ub_color;
u#def ne	RB_RED		0Au#def ne	RB_BLACK	1 t	lk * herb_nta)_se/ rb_right;
+	lk * herb_nta)_se/ rb_left;
+}
+rb_nta)_h; tfktypeNIT_lk * herb_rolh_s
+{ t	lk * herb_nta)_se/ rb_nta);ft}
+rb_rolh_t;
+
u#def ne RB_ROOT	(rb_rolh_t) { NULL,M}ek#def ne	rb_entry(ptr, type, member)					\ t	((type *)((c =  *)(ptr)-(uthe execeadi)(&((type *)0)->member)))
+
u
rdezey max_rb_ansert_color(rb_nta)_he/,erb_rolh_he/);
+
rdezey max_rb_erase(rb_nta)_he/,erb_rolh_he/);
+
uJu the	+
+_LINUX_RBTREE_H */
thef -urN 2.3.42/	nclua)/, nux/sisod.h 2.3.42aa3/	nclua)/, nux/sisod.h
-* p2.3.42/	nclua)/, nux/sisod.h	Tue Feb  8 02:28:51 2000
+++ 2.3.42aa3/	nclua)/, nux/sisod.h	Wed Feb  9 03:48:28 2000
@@ -357,6 +357,9 @@
 MMM	u32 self_exec_id;t 	/ Protecn PAcsi fields aintma wa/deaintma  PAs*/f 	lk * hesemaphor_ exih_sem; t
u	/ oom hand(d l, left atcap_pevd since it'sdnot ce);s = (snfWe//
+	;
+
oom_kie__try;t };t 
 +
t@@ -427,6 +430,7 @@
 	/ s_gnalss*/	SP	{_LOCK_UNLOCKED, &anih_s_gnals, {{0}}, {{0}}, NULL,M&anih_tat,.s_gcueun, 0, 0, \
 	/ exec cts */	0,0, \
 	/ exih_sem */	__MUTEX_INITIALIZER(HOTe.exih_sem),	\ t	/ oom */	0, \
 }
 
 		InNIT_INIT_TASK_SIZE thef -urN 2.3.42/	nclua)/, nux/sysctl.h 2.3.42aa3/	nclua)/, nux/sysctl.h
-* p2.3.42/	nclua)/, nux/sysctl.h	Sun Jan 30 15:43:39 2000
+++ 2.3.42aa3/	nclua)/, nux/sysctl.h	Wed Feb  9 03:48:28 2000
@@ -500,7 +500,9 @@
 	FS_NRSUPER=9,	+
+;
+:vNIize  Humbernsi aintma *d super b);
+ss*/f 	FS_MAXSUPER=10,	+
+;
+:maximum Humbernsi super b);
+ssapat cab	behaintma *d */f 	FS_OVERFLOWUID=11,	+
+;
+: ohanfntw UIDi /e-	FS_OVERFLOWGID=12	+
+;
+: ohanfntw GIDi /er	FS_OVERFLOWGID=12,	+
+;
+: ohanfntw GIDi /er	FS_DCACHE_CTL=13,c	/ dentry cachegcontrolss*/fk	FS_ICACHE_CTL=14,c	/ anta)hcachegcontrolss*/f };t 
 +
 CTL_DEBU_sHOT
s:c*/
thef -urN 2.3.42/kernel/ksyms.c 2.3.42aa3/kernel/ksyms.c
-* p2.3.42/kernel/ksyms.c	Sun Jan 30 15:43:39 2000
+++ 2.3.42aa3/kernel/ksyms.c	Wed Feb  9 03:48:28 2000
@@ -71,6 +71,13 @@
 };t 	u the  
u	erNIT_CONFIG_BLK_DEV_LVM_MODULE tk Merdezey;
+
(*lvm_map_ptr)_( ie , kd *__p*,Muthe execeadi *, tk MMMMMMMMMMMMMMMMMMMMMMMMMMMMMuthe execeadi, ie ); tk Merdezey max_(*lvm_hd_HOT
_ptr)_( c = *, ie ); tk MEXPORT_SYMBOL(lvm_map_ptr); tk MEXPORT_SYMBOL(lvm_hd_HOT
_ptr); t	u the  
 		INIT_CONFIG_KMOD
MEXPORT_SYMBOL(rtcuesa_mod   ); @@ -151,11 +158,14 @@
 EXPORT_SYMBOL(d_aintm);t EXPORT_SYMBOL(d_lookup);t EXPORT_SYMBOL(d_path); tEXPORT_SYMBOL(mark_buffer dirty);t EXPORT_SYMBOL(__mark_buffer dirty);t EXPORT_SYMBOL(__mark_anta) dirty);t EXPORT_SYMBOL(free_kioham);t EXPORT_SYMBOL(brw_kioham);t EXPORT_SYMBOL(aintm_kioham);ttEXPORT_SYMBOL(expand_kiobat);ttEXPORT_SYMBOL(unmap_kiobat);t EXPORT_SYMBOL(get_empty_filp);t EXPORT_SYMBOL(anih_priva *_file);t EXPORT_SYMBOL(filp_apen); @@ -163,7 +173,7 @@
 EXPORT_SYMBOL(put_filp);t EXPORT_SYMBOL(files_);
+);t EXPORT_SYMBOL(check opt,_change);t-EXPORT_SYMBOL(anvalida e_buffers);ttEXPORT_SYMBOL(__anvalida e_buffers);t EXPORT_SYMBOL(anvalida e_anta)s);t EXPORT_SYMBOL(anvalida e_anta)_pag
s);t EXPORT_SYMBOL(k *nca e_anta)_pag
s);tthef -urN 2.3.42/kernel/ptrace.c 2.3.42aa3/kernel/ptrace.c
-* p2.3.42/kernel/ptrace.c	Sun Nov 21 03:20:20 1999
+++ 2.3.42aa3/kernel/ptrace.c	Wed Feb  9 03:48:28 2000
@@ -26,6 +26,7 @@
 	uthe execeadi mapnr;
 	uthe execeadi maddr; 
 	lk * hepag
e/pag
;
+	;
+
fault;t 
 repeaa:
 	pgdir = pgd_affset(vma->vm_mm, addr);t@@ -64,8 +65,12 @@
 
 fault_an_pag
:
 	+
 -1:	ouacsi  emory. 0 - unmapped pagei /e-	;) %hand(e_mm_fault(tsk, vma, addr,_te);
) > 0)t 	fault = hand(e_mm_fault(tsk, vma, addr,_te);
); t	;) %fault > 0)t 		goto	repeaa; t	;) %fault < 0)t 		+
+ahegouacsi  emory rs be_h ariggeredhby ap_pcNIize  tat,.s*/fk		force_s_g(SIGKILL,McNIize );t 	rehurn 0;t 
 bad_pgd:tthef -urN 2.3.42/kernel/sisod.c 2.3.42aa3/kernel/sisod.c
-* p2.3.42/kernel/sisod.c	Sun Jan 30 15:43:39 2000
+++ 2.3.42aa3/kernel/sisod.c	Wed Feb  9 03:48:29 2000
@@ -141,7 +141,7 @@
 	u the  
 	+
+..hand a slight advantageiao(e-e cNIize  MMi /e-	;) %p->mmr=apt-s,_mm) t	;) %p->mmr=apt-s,_mm ||s!p->mm)t 		weight += 1;t 	weight += p->prioe);y;t 
@@ -173,7 +173,7 @@
 s*/f lksizey 2, ne ;
+
preemftwar_goodness(lk * hetat,_lk * he/ pr *, lk * hetat,_lk * he/ p, ie  cpu)t {e-	rehurn goodness(p, cpu, pr *->mm) - goodness(pr *, cpu, pr *->mm);
+	rehurn goodness(p, cpu, pr *->a
  ve_mm) - goodness(pr *, cpu, pr *->a
  ve_mm);
 }
 
 +
t@@ -199,30 +199,17 @@
 		goto	su t_ntw;t 
 	+

-	s* Thegonly heurisizes - we	ut cap_ptsk->avg slice value
-	s* to	detecn 'frtcue
+
utsisod   rs'.
-	s*
-	s* If boU}
t-e woken-upeprocD
d _b, t-e pr ferredhCPU rs
-	s* rs _ frtcue
+
utsisod   r,	ap_h skip	ap_pasynchronous
-	s* wakeup,	ap_pfrtcue
+
utsisod   rhwie_plikelyr hot caprs
-	s* tat, duridi it'sdnerd sisod   ():
-	s*/e-	;) %p->policyr=apSCHED_OTHER) {e-		tsk = cpu_curi(besa_cpu);t-		;) %p->avg slice +ptsk->avg slice <hcacheflush_req )t-			goto	oua_nt_target; -	}
- -	+

 	s* We knowhapat t-e pr ferredhCPU has a	cache-aff ne cNIize 
 	s* procD
d, lets try to	f nd a n
w-id(ehCPU 	Wede-eewoken-up
 	s* procD
d:
 	s*/e-		Wed(i = 0; i <hsmp num_cpus; i++) { t		Wed(i = smp num_cpus - 1; i >= 0; i--) {  		cpu = cpu_lags = _map(i);
+		;) %cpu == besa_cpu) t			cont nue;t 		tsk = cpu_curi(cpu);t 		+

-		s* We ut cap_pfirpecavail	 (lsid(ehCPU. T-s,ecV
Stestk		s* We ut cap_plapecavail	 (lsid(ehCPU. T-s,ecV
Stest 		s* a prioe);y 
 pecbetwe_h id(ehCPUd, butot-s,ers nott 		s* a pro (lm.t 		s*/
@@ -232,26 +219,32 @@
 
 	+

 	s* NohCPU rs id(e, butomaybe
t-s,eprocD
d has enough prioe);y
-	s* to	preemft it'sdpr ferredhCPU. (t-s,ers a shlrtcut):
+	s* to	preemft it'sdpr ferredhCPU.
 	s*/e 	tsk = cpu_curi(besa_cpu);t 	;) %preemftwar_goodness(tsk, p,	besa_cpu) > 0)t 		goto	su t_ntw;t 
 	+

-	s* We shleldgget heFoirarelyr- Wednh ap_phighhCPU contantiedtk	s* We wie_pget heFoioftanr- Wednh ap_phighhCPU contantiedt 	s* case. NohCPU rs id(e _b, t-s,eprocD
d s,eeiap_r lowprio Wet-	s* t-e pr ferredhCPU rsphighprio. Maybe
some oap_r CPU can/musat-	s* be	preemfted:
+	s* t-e pr ferredhCPU rsphighprio. Try to	preemt
some oap_r CPU
+	s* only ;) it'sdRT Wedn) it'sd);
ra
  vee_b, t-e pr ferred
+	s* cpu w*b't utsisod    shlrtly.
 	s*/e-		Wed(i = 0; i <hsmp num_cpus; i++) { -		cpu = cpu_lags = _map(i);
-		tsk = cpu_curi(cpu);t-		;) %preemftwar_goodness(tsk, p,	cpu) > 0)t-			goto	su t_ntw;tt	;) %(p->avg slice <hcacheflush_req  && cpu_curi(besa_cpu)->avg slice >hcacheflush_req ) ||
+	s   p->policyr!apSCHED_OTHER)
k	{ t			Wed(i = smp num_cpus - 1; i >= 0; i--) { t			cpu = cpu_lags = _map(i);
+			;) %cpu == besa_cpu) t				cont nue;tt			tsk = cpu_curi(cpu);t+			;) %preemftwar_goodness(tsk, p,	cpu) > 0)tt				goto	su t_ntw;tt		}
 	}
 
-oua_nt_target:
 	sp+4_un);
+_irqutstore(& *ncueun_);
+, flags);t 	rehurn;t 		tthef -urN 2.3.42/kernel/sysctl.c 2.3.42aa3/kernel/sysctl.c
-* p2.3.42/kernel/sysctl.c	Sun Jan 30 15:43:40 2000
+++ 2.3.42aa3/kernel/sysctl.c	Wed Feb  9 03:48:28 2000
@@ -47,6 +47,9 @@
 lksizey 2tomaxolduid = 65535;
 lksizey 2tomantlduid = 0;t 
+erdezey;
+
dcache_ctl[],
dcache_ctl_min[],
dcache_ctl_max[];
+erdezey;
+
icache_ctl[],
icache_ctl_min[],
icache_ctl_max[];
+
 		INIT_CONFIG_KMOD
Merdezeyc =  modpro e_path[];
 	u the @@ -306,6 +309,12 @@
 	{FS_OVERFLOWGID, "ohanfntwgid", &fs_ohanfntwgid,lunk_si(ie ), 0644, NULL,
 	s&proc_doi
+vec_minmax, &sysctl_i
+vec, NULL,
 	s&mantlduid, &maxolduid}, t	{FS_DCACHE_CTL, "dcache_ctl", &dcache_ctl, 1*unk_si(ie ), 0644, NULL,
+	s&proc_doi
+vec_minmax, &sysctl_i
+vec, NULL,
+	s&dcache_ctl_min,s&dcache_ctl_max}, t	{FS_ICACHE_CTL, "icache_ctl", &icache_ctl, 1*unk_si(ie ), 0644, NULL,
+	s&proc_doi
+vec_minmax, &sysctl_i
+vec, NULL,
+	s&icache_ctl_min,s&icache_ctl_max},  	{0}f };t 
thef -urN 2.3.42/kernel/teq r.c 2.3.42aa3/kernel/teq r.c
-* p2.3.42/kernel/teq r.c	Tue Dec 14 15:48:51 1999
+++ 2.3.42aa3/kernel/teq r.c	Wed Feb  9 03:48:29 2000
@@ -101,17 +101,19 @@
 	(lk * heteq r_vec *)&tv1,s&tv2,s&tv3,s&tv4,s&tv5f };t 
ulksizeylk * heteq r_
 pec**  *n_teq r_
 pe_ *nnidi;
+
 	def ne NOOF_TVECS (unk_si(+vecs) / unk_si(+vecs[0]))t 
 lksizeyuthe execeadi teq r_jiffi
s = 0;t 
 lksizey 2, ne  max_ansert_teq r(lk * heteq r_
 pec*teq r,t-				lk * heteq r_
 pec**vec, ;
+
idx)tt				lk * heteq r_
 pec**vec)t {e-	;) %(teq r->nerd = vec[idx]))t-		vec[idx]->prev = teq r;t-	vec[idx] = teq r;t-	teq r->prev = (lk * heteq r_
 pec*)&vec[idx];tt	;) %(teq r->nerd = *vec))tt		(*vec)->prev = teq r;t+	*vec = teq r;t+	teq r->prev = (lk * heteq r_
 pec*)vec;
 }
 
 lksizey 2, ne  max_andeze= _add_teq r(lk * heteq r_
 pec*teq r)
@@ -121,31 +123,36 @@
 	s*/e 	uthe execeadi expir
s = teq r->expir
s;
 	uthe execeadi idx = expir
s - teq r_jiffi
s;
+	lk * heteq r_
 pec** vec;
 e-	;) %idx < TVR_SIZE) { t	;) % *n_teq r_
 pe_ *nnidi)tt		vec =  *n_teq r_
 pe_ *nnidi;
+	uly- ;) %idx < TVR_SIZE) {  		;
+
i = expir
s & TVR_MASK;t-		;nsert_teq r(teq r, tv1.vec, ;);t+		vec = tv1.vec +pi;
 	} uly- ;) %idx < 1 << (TVR_BITS +pTVN_BITS)) {  		;
+
i = (expir
s >> TVR_BITS) & TVN_MASK;t-		;nsert_teq r(teq r, tv2.vec, ;);t+		vec = tv2.vec +pi;
 	} uly- ;) %idx < 1 << (TVR_BITS +p2 *lTVN_BITS)) {  		;
+
i = (expir
s >> (TVR_BITS +pTVN_BITS)) & TVN_MASK;t-		;nsert_teq r(teq r, tv3.vec, ;);t+		vec = tv3.vec +pi;
 	} uly- ;) %idx < 1 << (TVR_BITS +p3 *lTVN_BITS)) {  		;
+
i = (expir
s >> (TVR_BITS +p2 *lTVN_BITS)) & TVN_MASK;t-		;nsert_teq r(teq r, tv4.vec, ;);t+		vec = tv4.vec +pi;
 	} uly- ;) %(he execeadi) idx < 0) {  			/ van happen ;) you add a teq rct=U}
expir
s == jiffi
s,t 		s* Wedyou setoa teq rcao+go affdnh ap_ppastt 		s*/
-		;nsert_teq r(teq r, tv1.vec, tv1.index);t+		vec = tv1.vec +ptv1.index;
 	} uly- ;) %idx <= 0xffffffffUL) {  		;
+
i = (expir
s >> (TVR_BITS +p3 *lTVN_BITS)) & TVN_MASK;t-		;nsert_teq r(teq r, tv5.vec, ;);t+		vec = tv5.vec +pi;
 	} uly- {  			/ Cab Wnly get heFoion architecturesct=U}
64-bit jiffi
ss*/e 		teq r->nerd = teq r->prev = teq r;t+		rehurn;t 	}
+	;
sert_teq r(teq r, ham);t }
 
 lp+4);
+_heteq r
 pe_);
+ apSP	{_LOCK_UNLOCKED;t@@ -226,13 +233,14 @@
 {
 	sp+4_);
+_irq(&teq r
 pe_);
+);t 	whito ((eadi)(jiffi
ss- teq r_jiffi
s) >= 0) { -		lk * heteq r_
 pec*teq r;t+		lk * heteq r_
 pec*teq r, *lcueund = NULL;f 		;) %!tv1.index) {  			;
+
n =e1;t 			do {  				cascaa)_heq rs(+vecs[n]);t 			} whito (+vecs[n]->index == 1 && ++n < NOOF_TVECS);t 		}t+		r*n_teq r_
 pe_ *nnidi =e&cueund;t 		whito ((teq rc= tv1.vec[tv1.index])) {  			 max_(*fn)(uthe execeadi) = teq r->	ps - ed;t 			uthe execeadi data = teq r->data;f@@ -242,8 +250,15 @@
 			fn(data);t 			sp+4_);
+_irq(&teq r
 pe_);
+);t 		}t+		r*n_teq r_
 pe_ *nnidi =eNULL;f 		++teq r_jiffi
s; e 		tv1.index = (tv1.index + 1) & TVR_MASK;t+		whito (cueund)tt		{ t			teq rc= cueund;tt			cueund = cueund->nerd;t+			;ndeze= _add_teq r(teq r);tt		}			
 	}
 	sp+4_un);
+_irq(&teq r
 pe_);
+);t }
thef -urN 2.3.42/lib/Makefile 2.3.42aa3/lib/Makefile
-* p2.3.42/lib/Makefile	Mon Jan 18 02:27:00 1999
+++ 2.3.42aa3/lib/Makefile	Wed Feb  9 03:48:29 2000
@@ -7,6 +7,6 @@
 	
 
 L_TARGET := lib.a
-L_OBJSccc:= errno.o ctype.o_lkridi.o_vspridtf.o
+L_OBJSccc:= errno.o ctype.o_lkridi.o_vspridtf.oprbtree.o
 
 	nclua)h$(TOPDIR)/Rules.make
thef -urN 2.3.42/lib/rbtree.c 2.3.42aa3/lib/rbtree.c
-* p2.3.42/lib/rbtree.c	Thu Jan  1 01:00:00 1970
+++ 2.3.42aa3/lib/rbtree.c	Wed Feb  9 03:48:29 2000
@@ -0,0 +1,293r@@
c+
tks Rtd Black Treestks (C) 1999  Andrea Arcangeli <andrea@suse.de> t   t  T-s,eprogramers freeesoftware; you cab	redilk ibute(nthand/Wedmodify
ks(nthunder	ap_p+ermscsi e-e GNU GeneralpPublic Licent cas publish*dhby
ks(e-e FreeeSoftware Fle dSt ed;peiap_r hanswar 2csi e-e Licent , Wetks (at your oftwar)(Dny )ader hanswar.
k t  T-s,eprogramers dilk ibuted nh ap_phope-apat it-wie_pb_pw *ful,tks butoWITHOUT ANY WARRANTY; ==U}ouageven t-_pimpliex_tarrantyeoftks MERCHANTABILITY WedFITNESS FOR A PARTICULAR PURPOSE.  Seeiap_tks GNU GeneralpPublic Licent cfWedmor_pdetaits.
ktks You shleldghav hreceit d,a copycsi e-e GNU GeneralpPublic Licent 
ks(Deadi t=U}
t-s,eprogram; if noa,_te);
oao(e-e FreeeSoftware
ks(Fle dSt ed, Inc., 59 Temp
eePlace, Su);
 330, Bosted, MA  02111-1307  USA
ktks , nux/lib/rbtree.c
+*/
ct 		nclua)h<, nux/rbtree.h>
+
ulksizey max___rb_rota e_left(rb_nta)_he/ nta),erb_rolh_he/ rolh)
+{ t	rb_nta)_he/ right = nta)->rb_right;ft
+	;) %(nta)->rb_right = right->rb_left))tt		right->rb_left->rb_paize  = nta);
t	right->rb_left =enta);ft
+	;) %(right->rb_paize  = nta)->rb_paize ))
k	{ t		;) %nta)h== nta)->rb_paize ->rb_left)
+			nta)->rb_paize ->rb_left = right;
+		uly-
+			nta)->rb_paize ->rb_right = right;
+	} t	uly-
+		rolh->rb_nta)h= right;
+	nta)->rb_paize  = right;
+}
+
ulksizey max___rb_rota e_right(rb_nta)_he/ nta),erb_rolh_he/ rolh)
+{ t	rb_nta)_he/ left =enta)->rb_left;
+
+	;) %(nta)->rb_left =eleft->rb_right))tt		left->rb_right->rb_paize  = nta);
t	left->rb_right =enta);ft
+	;) %(left->rb_paize  = nta)->rb_paize ))
k	{ t		;) %nta)h== nta)->rb_paize ->rb_right)
+			nta)->rb_paize ->rb_right = left;
+		uly-
+			nta)->rb_paize ->rb_left = left;
+	} t	uly-
+		rolh->rb_nta)h= left;
+	nta)->rb_paize  = left;
+}
+
+ max_rb_ansert_color(rb_nta)_he/ nta),erb_rolh_he/ rolh)
+{ t	rb_nta)_he/ paize , * gpaize ;
+
u	whito ((paize  = nta)->rb_paize ) && paize ->rb_color == RB_RED)
k	{ t		gpaize  = paize ->rb_paize ;
+
u		;) %paize  == gpaize ->rb_left)
+		{ t			{ t				regilker rb_nta)_he/ ps l)h= gpaize ->rb_right;t+				;) %ps l)h&& ps l)->rb_color == RB_RED)
k				{ t					ps l)->rb_color = RB_BLACK;t+					paize ->rb_color = RB_BLACK;t+					gpaize ->rb_color = RB_RED;
+					nta)h= gpaize ;
+					cont nue;tt				}t+			} t
+			;) %paize ->rb_right == nta))
+			{ t				regilker rb_nta)_he/ tmp;tt				__rb_rota e_left(paize , rolh);tt				tmp = paize ;
+				paize  = nta);
t				nta)h= tmp;tt			} t
+			paize ->rb_color = RB_BLACK;t+			gpaize ->rb_color = RB_RED;
+			__rb_rota e_right(gpaize , rolh);tt		} uly- { t			{ t				regilker rb_nta)_he/ ps l)h= gpaize ->rb_left;
+				;) %ps l)h&& ps l)->rb_color == RB_RED)
k				{ t					ps l)->rb_color = RB_BLACK;t+					paize ->rb_color = RB_BLACK;t+					gpaize ->rb_color = RB_RED;
+					nta)h= gpaize ;
+					cont nue;tt				}t+			} t
+			;) %paize ->rb_left == nta))
+			{ t				regilker rb_nta)_he/ tmp;tt				__rb_rota e_right(paize , rolh);tt				tmp = paize ;
+				paize  = nta);
t				nta)h= tmp;tt			} t
+			paize ->rb_color = RB_BLACK;t+			gpaize ->rb_color = RB_RED;
+			__rb_rota e_left(gpaize , rolh);tt		}
+	} t
+	rolh->rb_nta)->rb_color = RB_BLACK;t+}
+
ulksizey max___rb_erase_color(rb_nta)_he/ nta),erb_nta)_he/ paize ,
+			MMMMMrb_rolh_he/ rolh)
+{ t	rb_nta)_he/ oap_r;
+
u	whito ((!nta)h|| nta)->rb_color == RB_BLACK) && nta)h!= rolh->rb_nta))
k	{ t		;) %paize ->rb_left == nta))
+		{ t			oap_r = paize ->rb_right;t+			;) %oap_r->rb_color == RB_RED)
k			{ t				oap_r->rb_color = RB_BLACK;t+				paize ->rb_color = RB_RED;
+				__rb_rota e_left(paize , rolh);tt				oap_r = paize ->rb_right;t+			}t+			;) %(!oap_r->rb_left ||
+			MMMMMoap_r->rb_left->rb_color == RB_BLACK)
+			MMMM&& (!oap_r->rb_right ||
+				oap_r->rb_right->rb_color == RB_BLACK))
k			{ t				oap_r->rb_color = RB_RED;
+				nta)h= paize ;
+				paize  = nta)->rb_paize ;
+			}t+			uly-
+			{
+				;) %!oap_r->rb_right ||
+				MMMMoap_r->rb_right->rb_color == RB_BLACK)
k				{ t					regilker rb_nta)_he/ o_left;
+					;) %(o_left = oap_r->rb_left))
k						o_left->rb_color = RB_BLACK;t+					oap_r->rb_color = RB_RED;
+					__rb_rota e_right(oap_r, rolh);tt					oap_r = paize ->rb_right;t+				}t+				oap_r->rb_color = paize ->rb_color;t+				paize ->rb_color = RB_BLACK;t+				;) %oap_r->rb_right)
+					oap_r->rb_right->rb_color = RB_BLACK;t+				__rb_rota e_left(paize , rolh);tt				nta)h= rolh->rb_nta);tt				break;
+			}t+		}
+		uly-
+		{ t			oap_r = paize ->rb_left;
+			;) %oap_r->rb_color == RB_RED)
k			{ t				oap_r->rb_color = RB_BLACK;t+				paize ->rb_color = RB_RED;
+				__rb_rota e_right(paize , rolh);tt				oap_r = paize ->rb_left;
+			}t+			;) %(!oap_r->rb_left ||
+			MMMMMoap_r->rb_left->rb_color == RB_BLACK)
+			MMMM&& (!oap_r->rb_right ||
+				oap_r->rb_right->rb_color == RB_BLACK))
k			{ t				oap_r->rb_color = RB_RED;
+				nta)h= paize ;
+				paize  = nta)->rb_paize ;
+			}t+			uly-
+			{
+				;) %!oap_r->rb_left ||
+				MMMMoap_r->rb_left->rb_color == RB_BLACK)
+				{ t					regilker rb_nta)_he/ o_right;t+					;) %(o_right = oap_r->rb_right))
k						o_right->rb_color = RB_BLACK;t+					oap_r->rb_color = RB_RED;
+					__rb_rota e_left(oap_r, rolh);tt					oap_r = paize ->rb_left;
+				}t+				oap_r->rb_color = paize ->rb_color;t+				paize ->rb_color = RB_BLACK;t+				;) %oap_r->rb_left)
+					oap_r->rb_left->rb_color = RB_BLACK;t+				__rb_rota e_right(paize , rolh);tt				nta)h= rolh->rb_nta);tt				break;
+			}t+		}
+	}
+	;) %nta))
+		nta)->rb_color = RB_BLACK;t+}
+
u max_rb_erase(rb_nta)_he/ nta),erb_rolh_he/ rolh)
+{ t	rb_nta)_he/ chitd,e/ paize ;
+	;
+
color;t+
+	;) %!nta)->rb_left)
+		chitd = nta)->rb_right;ft	uly- ;) %!nta)->rb_right)
+		chitd = nta)->rb_left;
+	uly-
+	{ t		rb_nta)_he/ otd = nta),e/ left;
+
u		nta)h= nta)->rb_right;ft		whito ((eeft =enta)->rb_left))
+			nta) = left;
+		chitd = nta)->rb_right;ft		paize  = nta)->rb_paize ;
+		color = nta)->rb_color;
+
u		;) %chitd) t			chitd->rb_paize  = paize ;
+		;) %paize )
+		{ t			;) %paize ->rb_left == nta))
+				paize ->rb_left = chitd;t+			uly-
+				paize ->rb_right = chitd;t+		}
+		uly-
+			rolh->rb_nta)h= chitd;t+ t		;) %nta)->rb_paize  == otd)
+			paize  = nta);
t		nta)->rb_paize  = otd->rb_paize ;
+		nta)->rb_color = otd->rb_color;t+		nta)->rb_right = otd->rb_right;ft		nta)->rb_left =eotd->rb_left;
+
u		;) %otd->rb_paize )
+		{ t			;) %otd->rb_paize ->rb_left == otd)
+				otd->rb_paize ->rb_left = nta);
t			uly-
+				otd->rb_paize ->rb_right =enta);ft		} uly-
+			rolh->rb_nta)h= nta);ft
+		otd->rb_left->rb_paize  = nta);
t		;) %otd->rb_right)
+			otd->rb_right->rb_paize  = nta);
t		goto	color;t+	} t
+	paize  = nta)->rb_paize ;
+	color = nta)->rb_color;
+
u	;) %chitd) t		chitd->rb_paize  = paize ;
+	;) %paize )
+	{ t		;) %paize ->rb_left == nta))
+			paize ->rb_left = chitd;t+		uly-
+			paize ->rb_right = chitd;t+	} t	uly-
+		rolh->rb_nta)h= chitd;t+ t	color:
u	;) %color == RB_BLACK)
+		__rb_erase_color(chitd,epaize , rolh);tt}
thef -urN 2.3.42/mm/ emory.c 2.3.42aa3/mm/ emory.c
-* p2.3.42/mm/ emory.c	Thu Jan 13 05:17:21 2000
+++ 2.3.42aa3/mm/ emory.c	Wed Feb  9 03:48:28 2000
@@ -70,16 +70,6 @@
 mem_map_he/ mem_map =eNULL;f 
 +
t- / oom() pridts a mD
dago (sohapat t-e us_r knows why t-e procD
d died),t- / _b, gives t-e procD
d an untrapp	 (lsSIGKILL.t- //
- max_oom(lk * hetat,_lk * he/ tat,)
-{ -	pridtk("\nOuacsi  emory fWed%s.\n", tat,->comm);
-	force_s_g(SIGKILL,Mtat,);
-}
- -+

 s* Note:
t-s,edoesb't freeeap_pactual pag
seap_mselves. T-at
 s* has be_h hand(ed earlixnnwp_h unmappidi alleap_p emory regions.
 s*/fthef -urN 2.3.42/mm/pag
_aintm.c 2.3.42aa3/mm/pag
_aintm.c
-* p2.3.42/mm/pag
_aintm.c	Sun Jan 30 15:43:40 2000
+++ 2.3.42aa3/mm/pag
_aintm.c	Wed Feb  9 03:48:29 2000
@@ -29,7 +29,9 @@
 LIST_HEAD(lru_cache);
 
 lksizeyc =  *zone_HOT
s[MAX_NR_ZONES] = { "DMA", "Noemal", "HighMem" };t-lksizey 2tozone_balance_ra  P[MAX_NR_ZONES] = { 128, 128, 128 };t+lksizey 2tozone_balance_ra  P[MAX_NR_ZONES] = { 128, 128, 128, };t+lksizey 2tozone_balance_min[MAX_NR_ZONES] = { 10 , 10, 10, };t+lksizey 2tozone_balance_max[MAX_NR_ZONES] = { 255 , 255, 255, };t 
 +
t s* Free_pag
() adds t-e pageiao(e-e freee
 pes. T-s,es,eoftwmized fort@@ -196,9 +198,6 @@
 	rehurn NULL;f }
 
-	def ne ZONE_BALANCED(zone) \
-	(((zone)->free_pag
s > (zone)->pag
s_);w)M&& (!(zone)->llw_on_ emory))t-
 lksizey 2, ne uthe execeadi classfree(zone_he/zone)
 {
 	uthe execeadi free = 0;t@@ -215,21 +214,6 @@
 lksizey 2, ne ;
+
zone_balance_memory (zone_he/zone, ;
+
gfp_mask)
 {
 	;
+
freed;t-	uthe execeadi free = classfree(zone);
-e-	;) %free >=
zone->pag
s_);w)M{t-		;) %!zone->llw_on_ emory)t-			rehurn 1;t-		+

-		s* Simple hylkeresis: exih 'ntw memory mta)' ;)
-		s* t-e upp_r lwmit has be_h reaisod:
-		s*/t-		;) %free >=
zone->pag
s_high)M{t-			zone->llw_on_ emory = 0;t-			rehurn 1;t-		} -	} uly-
-		zone->llw_on_ emory = 1;
 
 	+

 	s* In t-_patomic aintma  PAscase we	Wnly 'kick'iap_t@@ -243,43 +227,6 @@
 	rehurn 1;f }
 
-	;) 0 -+

-s* We are stie_pbalancidi  emory rn a globalpway:t- //
-lksizey 2, ne ;
+
balance_memory (zone_he/zone, ;
+
gfp_mask)
-{ -	uthe execeadi free = nr_free_pag
s();
-	lksizey 2tollw_on_ emory = 0;t-	;
+
freed;t-e-	;) %free >=
freepag
s.);w)M{t-		;) %!llw_on_ emory)t-			rehurn 1;t-		+

-		s* Simple hylkeresis: exih 'ntw memory mta)' ;)
-		s* t-e upp_r lwmit has be_h reaisod:
-		s*/t-		;) %free >=
freepag
s.high)M{t-			llw_on_ emory = 0;t-			rehurn 1;t-		} -	} uly-
-		llw_on_ emory = 1;
- -	+

-	s* In t-_patomic aintma  PAscase we	Wnly 'kick'iap_t-	s* lksie machine, butodo not ary to	free pag
st-	s* ourselves.
-	s*/e-	freedh= try__o_free_pag
s(gfp_mask, zone);
-e-	;) %!freedh&& !(gfp_mask & __GFP_HIGH))t-		rehurn 0;t-	rehurn 1;t-} -	u the -
 +
t s* T-s,es,et-_p'heart'csi e-e zoned buddy aintma or:
 s*/
@@ -310,11 +257,31 @@
 		 / aprap_r U}ought.t 		s*/
 		;) %!(cNIize ->flags & PF_MEMALLOC))t-			+

-			 / aastpath
-			 //t-			;) %!ZONE_BALANCED(z))t-				goto	balance;
+		{ t			;) %classfree(z) > z->pag
s_high)
+			{
+				;) %z->llw_on_ emory)t+					z->llw_on_ emory = 0;t+			}t+			uly-
+			{
+				erdezeywait_cueun_		ch_hekswapd_wait;ft
+				;) %z->llw_on_ emory)t+					goto	balance;
+
+				;) %classfree(z) <= z->pag
s_);w)
+				{ t					wake_up_;ndezruftw (l(&kswapd_wait);
+
+					;) %classfree(z) <= z->pag
s_min)t+					{ t						z->llw_on_ emory = 1;tt						goto	balance;
+					}t+				}
+			}t+		}
 		+

 		 / T-s,es,eab Wftwmiza  PAs	Wede-ee'highernsederczone
 		 / s,eempty'scase - it-van happen even rn well-behav d
@@ -378,7 +345,7 @@
 	zone_he/zone;
 	 200i;
 e-	sum = nr_lru_pag
s;
+	sum = nr_lru_pag
s - atomic_read(&pag
_cache_s_bl);t 		Wed(i = 0; i <hNUMNODES; i++)
 			Wed(zone =eNODE_DATA(i)->nta)_zones;czone <= NODE_DATA(i)->nta)_zones+ZONE_NORMAL;czone++)
 			sum +=
zone->free_pag
s;
@@ -590,7 +557,11 @@
 		zone->offseto= affset;  		cumula  vee+=
s_bl;  		mask = %cumula  vee/ozone_balance_ra  P[j]);t-		;) %mask < 1) mask = 1;
t		;) %mask < zone_balance_min[j])
+			mask = zone_balance_min[j];
+		uly- ;) %mask >ozone_balance_max[j])
+			mask = zone_balance_max[j];
+		zone->pag
s_min = mask;
 		zone->pag
s_);w = mask*2;
 		zone->pag
s_highh= mask*3;
 		zone->llw_on_ emory = 0;tthef -urN 2.3.42/mm/slab.c 2.3.42aa3/mm/slab.c
-* p2.3.42/mm/slab.c	Sun Jan 30 15:43:30 2000
+++ 2.3.42aa3/mm/slab.c	Wed Feb  9 03:48:29 2000
@@ -1864,11 +1864,10 @@
 	} whito (--svan && searchph!= c);
+_searchp);
 
 	c);
+_searchp = searchp;t-	up(&cache_chain_sem);
 
 	;) %!besa_cachep) {  			/ vleldb't f nd anyt-sdi ao	reap //t-		rehurn;t+		goto	oua;
 	}
 
 	sp+4_);
+_irq(&besa_cachep->c_lp+4);
+); @@ -1902,6 +1901,8 @@
 	}
 dma_fail:
 	sp+4_un);
+_irq(&besa_cachep->c_lp+4);
+); +oua:
+	up(&cache_chain_sem);
 	rehurn;t }t 
thef -urN 2.3.42/mm/vmsvan.c 2.3.42aa3/mm/vmsvan.c
-* p2.3.42/mm/vmsvan.c	Sun Jan 30 15:43:40 2000
+++ 2.3.42aa3/mm/vmsvan.c	Wed Feb  9 03:48:28 2000
@@ -325,6 +325,7 @@
 	lk * hetat,_lk * he/ p;
 	 200vlendez;
 	 200__ret =e0;
+	;
+
asse e = 0;t 
 	);
+_kernel();
 		/ 
@@ -344,12 +345,9 @@
 	vlendez = nr_threadse/o(prioe);y+1);t 	;) %vlendez < 1)  		clendez = 1;t-	;) %vlendez > nr_threads)t-		vlendez = nr_threads;t 
 		Wed(; vlendez >= 0; vlendez--) { -		;
+
asse e = 0;t-		;
+
max_cnt =e0;
+		uthe execeadi max_cnt =e0;
 		lk * hemm_lk * he/besa = NULL;f 		;
+
pid = 0;t 	seleca:
@@ -362,7 +360,7 @@
 	 		;) %mm->rss <= 0)  				cont nue;t 				/ Rtfresh_swap_cnt? //t-			;) %asse e) t			;) %asse e == 1)  				mm->swap_cnth= mm->rss;t 			;) %mm->swap_cnth> max_cnt) {  				max_cnt =emm->swap_cnt;
@@ -371,6 +369,8 @@
 			}
 		}
 		read_un);
+(&tat,
 pe_);
+);t+		;) %asse e == 1) t			asse e = 2;f 		;) %!besa) {  			;) %!asse e) {  				asse e = 1;
@@ -451,7 +451,7 @@
 	rehurn prioe);y >= 0;t }
 
-lksizeylk * hetat,_lk * he/kswapd_procD
d;t+DECLARE_WAIT_QUEUE_HEAD(kswapd_wait);
 
 +
t s* T-e background pageouagdaemod, lkart d,as a kernel thread
@@ -471,7 +471,6 @@
 {
 	sk * hetat,_lk * he/tsk = cNIize ;
 e-	kswapd_procD
dh= tsk;
 	tsk->sD
d PAs=e1;t 	tsk->pgrps=e1;t 	lk cpy(tt,->comm, "kswapd"); @@ -510,7 +509,7 @@
 			r*n_tat,_cueun(&tq opt,);t 		} whito (!tt,->need_utsisod);t 		tsk->sksie = TASK_INTERRUPTIBLE;t-		sisod   _teq oua(HZ);t+		;ndezruftw (l_sleep_on(&kswapd_wait);
 	}
 }t 
@@ -533,7 +532,6 @@
 {
 	;
+
uetval = 1;
 
-	wake_up_procD
d(kswapd_procD
d);t 	;) %gfp_mask & __GFP_WAIT) {  		cNIize ->flags |= PF_MEMALLOC;
 		retval = do_try__o_free_pag
s(gfp_mask, zone);
