## Automatically generated incremental diff
## From:   linux-2.5.68-bk11
## To:     linux-2.5.68-bk12
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $

diff -urN linux-2.5.68-bk11/Makefile linux-2.5.68-bk12/Makefile
--- linux-2.5.68-bk11/Makefile	2003-05-04 04:39:37.000000000 -0700
+++ linux-2.5.68-bk12/Makefile	2003-05-04 04:39:51.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 68
-EXTRAVERSION = -bk11
+EXTRAVERSION = -bk12
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
diff -urN linux-2.5.68-bk11/arch/alpha/oprofile/Makefile linux-2.5.68-bk12/arch/alpha/oprofile/Makefile
--- linux-2.5.68-bk11/arch/alpha/oprofile/Makefile	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk12/arch/alpha/oprofile/Makefile	2003-05-04 04:39:52.000000000 -0700
@@ -5,7 +5,8 @@
 DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
 		oprof.o cpu_buffer.o buffer_sync.o \
 		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o )
+		oprofilefs.o oprofile_stats.o \
+		timer_int.o )
 
 oprofile-y				:= $(DRIVER_OBJS) common.o
 oprofile-$(CONFIG_ALPHA_GENERIC)	+= op_model_ev4.o \
diff -urN linux-2.5.68-bk11/arch/alpha/oprofile/common.c linux-2.5.68-bk12/arch/alpha/oprofile/common.c
--- linux-2.5.68-bk11/arch/alpha/oprofile/common.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk12/arch/alpha/oprofile/common.c	2003-05-04 04:39:52.000000000 -0700
@@ -175,7 +175,7 @@
 	}
 
 	if (!lmodel)
-		return ENODEV;
+		return -ENODEV;
 	model = lmodel;
 
 	oprof_axp_ops.cpu_type = lmodel->cpu_type;
diff -urN linux-2.5.68-bk11/arch/i386/Makefile linux-2.5.68-bk12/arch/i386/Makefile
--- linux-2.5.68-bk11/arch/i386/Makefile	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/Makefile	2003-05-04 04:40:10.000000000 -0700
@@ -114,6 +114,15 @@
 install fdimage fdimage144 fdimage288: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
 
+prepare: include/asm-$(ARCH)/asm_offsets.h
+CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
+
+arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
+				   include/config/MARKER
+
+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
+	$(call filechk,gen-asm-offsets)
+
 archclean:
 	$(Q)$(MAKE) $(clean)=arch/i386/boot
 
diff -urN linux-2.5.68-bk11/arch/i386/kernel/Makefile linux-2.5.68-bk12/arch/i386/kernel/Makefile
--- linux-2.5.68-bk11/arch/i386/kernel/Makefile	2003-04-19 19:48:53.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/kernel/Makefile	2003-05-04 04:40:10.000000000 -0700
@@ -27,9 +27,29 @@
 obj-$(CONFIG_X86_NUMAQ)		+= numaq.o
 obj-$(CONFIG_EDD)             	+= edd.o
 obj-$(CONFIG_MODULES)		+= module.o
-obj-y				+= sysenter.o
+obj-y				+= sysenter.o vsyscall.o
 obj-$(CONFIG_ACPI_SRAT) 	+= srat.o
 
 EXTRA_AFLAGS   := -traditional
 
 obj-$(CONFIG_SCx200)		+= scx200.o
+
+# vsyscall.o contains the vsyscall DSO images as __initdata.
+# We must build both images before we can assemble it.
+$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
+extra-y += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
+
+# The DSO images are built using a special linker script.
+$(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \
+$(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o
+	$(CC) -nostdlib -shared -s -Wl,-soname=linux-vsyscall.so.1 \
+	      -o $@ -Wl,-T,$^
+
+# We also create a special relocatable object that should mirror the symbol
+# table and layout of the linked DSO.  With ld -R we can then refer to
+# these symbols in the kernel code rather than hand-coded addresses.
+extra-y += vsyscall-syms.o
+$(obj)/built-in.o: $(obj)/vsyscall-syms.o
+$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
+$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds $(obj)/vsyscall-sysenter.o
+	$(CC) -nostdlib -r -o $@ -Wl,-T,$^
diff -urN linux-2.5.68-bk11/arch/i386/kernel/asm-offsets.c linux-2.5.68-bk12/arch/i386/kernel/asm-offsets.c
--- linux-2.5.68-bk11/arch/i386/kernel/asm-offsets.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.68-bk12/arch/i386/kernel/asm-offsets.c	2003-05-04 04:40:10.000000000 -0700
@@ -0,0 +1,31 @@
+/*
+ * Generate definitions needed by assembly language modules.
+ * This code generates raw asm output which is post-processed
+ * to extract and format the required data.
+ */
+
+#include <linux/signal.h>
+#include <asm/ucontext.h>
+#include "sigframe.h"
+
+#define DEFINE(sym, val) \
+        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+
+#define BLANK() asm volatile("\n->" : : )
+
+void foo(void)
+{
+	DEFINE(SIGCONTEXT_eax, offsetof (struct sigcontext, eax));
+	DEFINE(SIGCONTEXT_ebx, offsetof (struct sigcontext, ebx));
+	DEFINE(SIGCONTEXT_ecx, offsetof (struct sigcontext, ecx));
+	DEFINE(SIGCONTEXT_edx, offsetof (struct sigcontext, edx));
+	DEFINE(SIGCONTEXT_esi, offsetof (struct sigcontext, esi));
+	DEFINE(SIGCONTEXT_edi, offsetof (struct sigcontext, edi));
+	DEFINE(SIGCONTEXT_ebp, offsetof (struct sigcontext, ebp));
+	DEFINE(SIGCONTEXT_esp, offsetof (struct sigcontext, esp));
+	DEFINE(SIGCONTEXT_eip, offsetof (struct sigcontext, eip));
+	BLANK();
+
+	DEFINE(RT_SIGFRAME_sigcontext,
+	       offsetof (struct rt_sigframe, uc.uc_mcontext));
+}
diff -urN linux-2.5.68-bk11/arch/i386/kernel/entry.S linux-2.5.68-bk12/arch/i386/kernel/entry.S
--- linux-2.5.68-bk11/arch/i386/kernel/entry.S	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/kernel/entry.S	2003-05-04 04:40:10.000000000 -0700
@@ -230,8 +230,8 @@
 	jmp need_resched
 #endif
 
-/* Points to after the "sysenter" instruction in the vsyscall page */
-#define SYSENTER_RETURN 0xffffe010
+/* SYSENTER_RETURN points to after the "sysenter" instruction in
+   the vsyscall page.  See vsyscall-sysentry.S, which defines the symbol.  */
 
 	# sysenter call handler stub
 ENTRY(sysenter_entry)
diff -urN linux-2.5.68-bk11/arch/i386/kernel/sigframe.h linux-2.5.68-bk12/arch/i386/kernel/sigframe.h
--- linux-2.5.68-bk11/arch/i386/kernel/sigframe.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.68-bk12/arch/i386/kernel/sigframe.h	2003-05-04 04:40:10.000000000 -0700
@@ -0,0 +1,21 @@
+struct sigframe
+{
+	char *pretcode;
+	int sig;
+	struct sigcontext sc;
+	struct _fpstate fpstate;
+	unsigned long extramask[_NSIG_WORDS-1];
+	char retcode[8];
+};
+
+struct rt_sigframe
+{
+	char *pretcode;
+	int sig;
+	struct siginfo *pinfo;
+	void *puc;
+	struct siginfo info;
+	struct ucontext uc;
+	struct _fpstate fpstate;
+	char retcode[8];
+};
diff -urN linux-2.5.68-bk11/arch/i386/kernel/signal.c linux-2.5.68-bk12/arch/i386/kernel/signal.c
--- linux-2.5.68-bk11/arch/i386/kernel/signal.c	2003-04-19 19:49:25.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/kernel/signal.c	2003-05-04 04:40:10.000000000 -0700
@@ -19,9 +19,11 @@
 #include <linux/stddef.h>
 #include <linux/personality.h>
 #include <linux/suspend.h>
+#include <linux/elf.h>
 #include <asm/ucontext.h>
 #include <asm/uaccess.h>
 #include <asm/i387.h>
+#include "sigframe.h"
 
 #define DEBUG_SIG 0
 
@@ -125,28 +127,6 @@
  * Do a signal return; undo the signal stack.
  */
 
-struct sigframe
-{
-	char *pretcode;
-	int sig;
-	struct sigcontext sc;
-	struct _fpstate fpstate;
-	unsigned long extramask[_NSIG_WORDS-1];
-	char retcode[8];
-};
-
-struct rt_sigframe
-{
-	char *pretcode;
-	int sig;
-	struct siginfo *pinfo;
-	void *puc;
-	struct siginfo info;
-	struct ucontext uc;
-	struct _fpstate fpstate;
-	char retcode[8];
-};
-
 static int
 restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax)
 {
@@ -347,6 +327,10 @@
 	return (void __user *)((esp - frame_size) & -8ul);
 }
 
+/* These symbols are defined with the addresses in the vsyscall page.
+   See vsyscall-sigreturn.S.  */
+extern void __kernel_sigreturn, __kernel_rt_sigreturn;
+
 static void setup_frame(int sig, struct k_sigaction *ka,
 			sigset_t *set, struct pt_regs * regs)
 {
@@ -379,7 +363,7 @@
 	if (err)
 		goto give_sigsegv;
 
-	restorer = (void *) (fix_to_virt(FIX_VSYSCALL) + 32);
+	restorer = &__kernel_sigreturn;
 	if (ka->sa.sa_flags & SA_RESTORER)
 		restorer = ka->sa.sa_restorer;
 
@@ -462,7 +446,7 @@
 		goto give_sigsegv;
 
 	/* Set up to return from userspace.  */
-	restorer = (void *) (fix_to_virt(FIX_VSYSCALL) + 64);
+	restorer = &__kernel_rt_sigreturn;
 	if (ka->sa.sa_flags & SA_RESTORER)
 		restorer = ka->sa.sa_restorer;
 	err |= __put_user(restorer, &frame->pretcode);
diff -urN linux-2.5.68-bk11/arch/i386/kernel/sysenter.c linux-2.5.68-bk12/arch/i386/kernel/sysenter.c
--- linux-2.5.68-bk11/arch/i386/kernel/sysenter.c	2003-04-19 19:51:16.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/kernel/sysenter.c	2003-05-04 04:40:10.000000000 -0700
@@ -51,151 +51,30 @@
 	put_cpu();	
 }
 
+/*
+ * These symbols are defined by vsyscall.o to mark the bounds
+ * of the ELF DSO images included therein.
+ */
+extern const char vsyscall_int80_start, vsyscall_int80_end;
+extern const char vsyscall_sysenter_start, vsyscall_sysenter_end;
+
 static int __init sysenter_setup(void)
 {
-	static const char __initdata int80[] = {
-		0xcd, 0x80,		/* int $0x80 */
-		0xc3			/* ret */
-	};
-	/* Unwind information for the int80 code.  Keep track of
-	   where the return address is stored.  */
-	static const char __initdata int80_eh_frame[] = {
-	/* First the Common Information Entry (CIE):  */
-		0x14, 0x00, 0x00, 0x00,	/* Length of the CIE */
-		0x00, 0x00, 0x00, 0x00,	/* CIE Identifier Tag */
-		0x01,			/* CIE Version */
-		'z', 'R', 0x00,		/* CIE Augmentation */
-		0x01,			/* CIE Code Alignment Factor */
-		0x7c,			/* CIE Data Alignment Factor */
-		0x08,			/* CIE RA Column */
-		0x01,			/* Augmentation size */
-		0x1b,			/* FDE Encoding (pcrel sdata4) */
-		0x0c,			/* DW_CFA_def_cfa */
-		0x04,
-		0x04,
-		0x88,			/* DW_CFA_offset, column 0x8 */
-		0x01,
-		0x00,			/* padding */
-		0x00,
-	/* Now the FDE which contains the instructions for the frame.  */
-		0x0a, 0x00, 0x00, 0x00,	/* FDE Length */
-		0x1c, 0x00, 0x00, 0x00,	/* FDE CIE offset */
-	/* The PC-relative offset to the beginning of the code this
-	   FDE covers.  The computation below assumes that the offset
-	   can be represented in one byte.  Change if this is not true
-	   anymore.  The offset from the beginning of the .eh_frame
-	   is represented by EH_FRAME_OFFSET.  The word with the offset
-	   starts at byte 0x20 of the .eh_frame.  */
-		0x100 - (EH_FRAME_OFFSET + 0x20),
-		0xff, 0xff, 0xff,	/* FDE initial location */
-		3,			/* FDE address range */
-		0x00			/* Augmentation size */
-	/* The code does not change the stack pointer.  We need not
-	   record any operations.  */
-	};
-	static const char __initdata sysent[] = {
-		0x51,			/* push %ecx */
-		0x52,			/* push %edx */
-		0x55,			/* push %ebp */
-	/* 3: backjump target */
-		0x89, 0xe5,		/* movl %esp,%ebp */
-		0x0f, 0x34,		/* sysenter */
-
-	/* 7: align return point with nop's to make disassembly easier */
-		0x90, 0x90, 0x90, 0x90,
-		0x90, 0x90, 0x90,
-
-	/* 14: System call restart point is here! (SYSENTER_RETURN - 2) */
-		0xeb, 0xf3,		/* jmp to "movl %esp,%ebp" */
-	/* 16: System call normal return point is here! (SYSENTER_RETURN in entry.S) */
-		0x5d,			/* pop %ebp */
-		0x5a,			/* pop %edx */
-		0x59,			/* pop %ecx */
-		0xc3			/* ret */
-	};
-	/* Unwind information for the sysenter code.  Keep track of
-	   where the return address is stored.  */
-	static const char __initdata sysent_eh_frame[] = {
-	/* First the Common Information Entry (CIE):  */
-		0x14, 0x00, 0x00, 0x00,	/* Length of the CIE */
-		0x00, 0x00, 0x00, 0x00,	/* CIE Identifier Tag */
-		0x01,			/* CIE Version */
-		'z', 'R', 0x00,		/* CIE Augmentation */
-		0x01,			/* CIE Code Alignment Factor */
-		0x7c,			/* CIE Data Alignment Factor */
-		0x08,			/* CIE RA Column */
-		0x01,			/* Augmentation size */
-		0x1b,			/* FDE Encoding (pcrel sdata4) */
-		0x0c,			/* DW_CFA_def_cfa */
-		0x04,
-		0x04,
-		0x88,			/* DW_CFA_offset, column 0x8 */
-		0x01,
-		0x00,			/* padding */
-		0x00,
-	/* Now the FDE which contains the instructions for the frame.  */
-		0x22, 0x00, 0x00, 0x00,	/* FDE Length */
-		0x1c, 0x00, 0x00, 0x00,	/* FDE CIE offset */
-	/* The PC-relative offset to the beginning of the code this
-	   FDE covers.  The computation below assumes that the offset
-	   can be represented in one byte.  Change if this is not true
-	   anymore.  The offset from the beginning of the .eh_frame
-	   is represented by EH_FRAME_OFFSET.  The word with the offset
-	   starts at byte 0x20 of the .eh_frame.  */
-		0x100 - (EH_FRAME_OFFSET + 0x20),
-		0xff, 0xff, 0xff,	/* FDE initial location */
-		0x14, 0x00, 0x00, 0x00,	/* FDE address range */
-		0x00,			/* Augmentation size */
-	/* What follows are the instructions for the table generation.
-	   We have to record all changes of the stack pointer and
-	   callee-saved registers.  */
-		0x41,			/* DW_CFA_advance_loc+1, push %ecx */
-		0x0e,			/* DW_CFA_def_cfa_offset */
-		0x08,			/* RA at offset 8 now */
-		0x41,			/* DW_CFA_advance_loc+1, push %edx */
-		0x0e,			/* DW_CFA_def_cfa_offset */
-		0x0c,			/* RA at offset 12 now */
-		0x41,			/* DW_CFA_advance_loc+1, push %ebp */
-		0x0e,			/* DW_CFA_def_cfa_offset */
-		0x10,			/* RA at offset 16 now */
-		0x85, 0x04,		/* DW_CFA_offset %ebp -16 */
-	/* Finally the epilogue.  */
-		0x4e,			/* DW_CFA_advance_loc+14, pop %ebx */
-		0x0e,			/* DW_CFA_def_cfa_offset */
-		0x12,			/* RA at offset 12 now */
-		0xc5,			/* DW_CFA_restore %ebp */
-		0x41,			/* DW_CFA_advance_loc+1, pop %edx */
-		0x0e,			/* DW_CFA_def_cfa_offset */
-		0x08,			/* RA at offset 8 now */
-		0x41,			/* DW_CFA_advance_loc+1, pop %ecx */
-		0x0e,			/* DW_CFA_def_cfa_offset */
-		0x04			/* RA at offset 4 now */
-	};
-	static const char __initdata sigreturn[] = {
-	/* 32: sigreturn point */
-		0x58,				/* popl %eax */
-		0xb8, __NR_sigreturn, 0, 0, 0,	/* movl $__NR_sigreturn, %eax */
-		0xcd, 0x80,			/* int $0x80 */
-	};
-	static const char __initdata rt_sigreturn[] = {
-	/* 64: rt_sigreturn point */
-		0xb8, __NR_rt_sigreturn, 0, 0, 0,	/* movl $__NR_rt_sigreturn, %eax */
-		0xcd, 0x80,			/* int $0x80 */
-	};
 	unsigned long page = get_zeroed_page(GFP_ATOMIC);
 
 	__set_fixmap(FIX_VSYSCALL, __pa(page), PAGE_READONLY);
-	memcpy((void *) page, int80, sizeof(int80));
-	memcpy((void *)(page + 32), sigreturn, sizeof(sigreturn));
-	memcpy((void *)(page + 64), rt_sigreturn, sizeof(rt_sigreturn));
-	memcpy((void *)(page + EH_FRAME_OFFSET), int80_eh_frame,
-	       sizeof(int80_eh_frame));
-	if (!boot_cpu_has(X86_FEATURE_SEP))
+
+	if (!boot_cpu_has(X86_FEATURE_SEP)) {
+		memcpy((void *) page,
+		       &vsyscall_int80_start,
+		       &vsyscall_int80_end - &vsyscall_int80_start);
 		return 0;
+	}
+
+	memcpy((void *) page,
+	       &vsyscall_sysenter_start,
+	       &vsyscall_sysenter_end - &vsyscall_sysenter_start);
 
-	memcpy((void *) page, sysent, sizeof(sysent));
-	memcpy((void *)(page + EH_FRAME_OFFSET), sysent_eh_frame,
-	       sizeof(sysent_eh_frame));
 	on_each_cpu(enable_sep_cpu, NULL, 1, 1);
 	return 0;
 }
diff -urN linux-2.5.68-bk11/arch/i386/kernel/vsyscall-int80.S linux-2.5.68-bk12/arch/i386/kernel/vsyscall-int80.S
--- linux-2.5.68-bk11/arch/i386/kernel/vsyscall-int80.S	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.68-bk12/arch/i386/kernel/vsyscall-int80.S	2003-05-04 04:40:10.000000000 -0700
@@ -0,0 +1,48 @@
+/*
+ * Code for the vsyscall page.  This version uses the old int $0x80 method.
+ */
+
+	.text
+	.globl __kernel_vsyscall
+	.type __kernel_vsyscall,@function
+__kernel_vsyscall:
+.LSTART_vsyscall:
+	int $0x80
+	ret
+.LEND_vsyscall:
+	.size __kernel_vsyscall,.-.LSTART_vsyscall
+	.previous
+
+	.section .eh_frame,"a",@progbits
+.LSTARTFRAMEDLSI:
+	.long .LENDCIEDLSI-.LSTARTCIEDLSI
+.LSTARTCIEDLSI:
+	.long 0			/* CIE ID */
+	.byte 1			/* Version number */
+	.string "zR"		/* NUL-terminated augmentation string */
+	.uleb128 1		/* Code alignment factor */
+	.sleb128 -4		/* Data alignment factor */
+	.byte 8			/* Return address register column */
+	.uleb128 1		/* Augmentation value length */
+	.byte 0x1b		/* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
+	.byte 0x0c		/* DW_CFA_def_cfa */
+	.uleb128 4
+	.uleb128 4
+	.byte 0x88		/* DW_CFA_offset, column 0x8 */
+	.uleb128 1
+	.align 4
+.LENDCIEDLSI:
+	.long .LENDFDEDLSI-.LSTARTFDEDLSI /* Length FDE */
+.LSTARTFDEDLSI:
+	.long .LSTARTFDEDLSI-.LSTARTFRAMEDLSI /* CIE pointer */
+	.long .LSTART_vsyscall-.	/* PC-relative start address */
+	.long .LEND_vsyscall-.LSTART_vsyscall
+	.uleb128 0
+	.align 4
+.LENDFDEDLSI:
+	.previous
+
+/*
+ * Get the common code for the sigreturn entry points.
+ */
+#include "vsyscall-sigreturn.S"
diff -urN linux-2.5.68-bk11/arch/i386/kernel/vsyscall-sigreturn.S linux-2.5.68-bk12/arch/i386/kernel/vsyscall-sigreturn.S
--- linux-2.5.68-bk11/arch/i386/kernel/vsyscall-sigreturn.S	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.68-bk12/arch/i386/kernel/vsyscall-sigreturn.S	2003-05-04 04:40:10.000000000 -0700
@@ -0,0 +1,142 @@
+/*
+ * Common code for the sigreturn entry points on the vsyscall page.
+ * So far this code is the same for both int80 and sysenter versions.
+ * This file is #include'd by vsyscall-*.S to define them after the
+ * vsyscall entry point.  The addresses we get for these entry points
+ * by doing ".balign 32" must match in both versions of the page.
+ */
+
+#include <asm/unistd.h>
+#include <asm/asm_offsets.h>
+
+
+/* XXX
+   Should these be named "_sigtramp" or something?
+*/
+
+	.text
+	.balign 32
+	.globl __kernel_sigreturn
+	.type __kernel_sigreturn,@function
+__kernel_sigreturn:
+.LSTART_sigreturn:
+	popl %eax		/* XXX does this mean it needs unwind info? */
+	movl $__NR_sigreturn, %eax
+	int $0x80
+.LEND_sigreturn:
+	.size __kernel_sigreturn,.-.LSTART_sigreturn
+
+	.balign 32
+	.globl __kernel_rt_sigreturn
+	.type __kernel_rt_sigreturn,@function
+__kernel_rt_sigreturn:
+.LSTART_rt_sigreturn:
+	movl $__NR_rt_sigreturn, %eax
+	int $0x80
+.LEND_rt_sigreturn:
+	.size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn
+	.previous
+
+	.section .eh_frame,"a",@progbits
+.LSTARTFRAMEDLSI1:
+	.long .LENDCIEDLSI1-.LSTARTCIEDLSI1
+.LSTARTCIEDLSI1:
+	.long 0			/* CIE ID */
+	.byte 1			/* Version number */
+	.string "zR"		/* NUL-terminated augmentation string */
+	.uleb128 1		/* Code alignment factor */
+	.sleb128 -4		/* Data alignment factor */
+	.byte 8			/* Return address register column */
+	.uleb128 1		/* Augmentation value length */
+	.byte 0x1b		/* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
+	.byte 0			/* DW_CFA_nop */
+	.align 4
+.LENDCIEDLSI1:
+	.long .LENDFDEDLSI1-.LSTARTFDEDLSI1 /* Length FDE */
+.LSTARTFDEDLSI1:
+	.long .LSTARTFDEDLSI1-.LSTARTFRAMEDLSI1 /* CIE pointer */
+	/* HACK: The dwarf2 unwind routines will subtract 1 from the
+	   return address to get an address in the middle of the
+	   presumed call instruction.  Since we didn't get here via
+	   a call, we need to include the nop before the real start
+	   to make up for it.  */
+	.long .LSTART_sigreturn-1-.	/* PC-relative start address */
+	.long .LEND_sigreturn-.LSTART_sigreturn+1
+	.uleb128 0			/* Augmentation */
+	/* What follows are the instructions for the table generation.
+	   We record the locations of each register saved.  This is
+	   complicated by the fact that the "CFA" is always assumed to
+	   be the value of the stack pointer in the caller.  This means
+	   that we must define the CFA of this body of code to be the
+	   saved value of the stack pointer in the sigcontext.  Which
+	   also means that there is no fixed relation to the other 
+	   saved registers, which means that we must use DW_CFA_expression
+	   to compute their addresses.  It also means that when we 
+	   adjust the stack with the popl, we have to do it all over again.  */
+
+#define do_cfa_expr(offset)						\
+	.byte 0x0f;			/* DW_CFA_def_cfa_expression */	\
+	.uleb128 1f-0f;			/*   length */			\
+0:	.byte 0x74;			/*     DW_OP_breg4 */		\
+	.sleb128 offset;		/*      offset */		\
+	.byte 0x06;			/*     DW_OP_deref */		\
+1:
+
+#define do_expr(regno, offset)						\
+	.byte 0x10;			/* DW_CFA_expression */		\
+	.uleb128 regno;			/*   regno */			\
+	.uleb128 1f-0f;			/*   length */			\
+0:	.byte 0x74;			/*     DW_OP_breg4 */		\
+	.sleb128 offset;		/*       offset */		\
+1:
+
+	do_cfa_expr(SIGCONTEXT_esp+4)
+	do_expr(0, SIGCONTEXT_eax+4)
+	do_expr(1, SIGCONTEXT_ecx+4)
+	do_expr(2, SIGCONTEXT_edx+4)
+	do_expr(3, SIGCONTEXT_ebx+4)
+	do_expr(5, SIGCONTEXT_ebp+4)
+	do_expr(6, SIGCONTEXT_esi+4)
+	do_expr(7, SIGCONTEXT_edi+4)
+	do_expr(8, SIGCONTEXT_eip+4)
+
+	.byte 0x42	/* DW_CFA_advance_loc 2 -- nop; popl eax. */
+
+	do_cfa_expr(SIGCONTEXT_esp)
+	do_expr(0, SIGCONTEXT_eax)
+	do_expr(1, SIGCONTEXT_ecx)
+	do_expr(2, SIGCONTEXT_edx)
+	do_expr(3, SIGCONTEXT_ebx)
+	do_expr(5, SIGCONTEXT_ebp)
+	do_expr(6, SIGCONTEXT_esi)
+	do_expr(7, SIGCONTEXT_edi)
+	do_expr(8, SIGCONTEXT_eip)
+
+	.align 4
+.LENDFDEDLSI1:
+
+	.long .LENDFDEDLSI2-.LSTARTFDEDLSI2 /* Length FDE */
+.LSTARTFDEDLSI2:
+	.long .LSTARTFDEDLSI2-.LSTARTFRAMEDLSI1 /* CIE pointer */
+	/* HACK: See above wrt unwind library assumptions.  */
+	.long .LSTART_rt_sigreturn-1-.	/* PC-relative start address */
+	.long .LEND_rt_sigreturn-.LSTART_rt_sigreturn+1
+	.uleb128 0			/* Augmentation */
+	/* What follows are the instructions for the table generation.
+	   We record the locations of each register saved.  This is
+	   slightly less complicated than the above, since we don't
+	   modify the stack pointer in the process.  */
+
+	do_cfa_expr(RT_SIGFRAME_sigcontext-4 + SIGCONTEXT_esp)
+	do_expr(0, RT_SIGFRAME_sigcontext-4 + SIGCONTEXT_eax)
+	do_expr(1, RT_SIGFRAME_sigcontext-4 + SIGCONTEXT_ecx)
+	do_expr(2, RT_SIGFRAME_sigcontext-4 + SIGCONTEXT_edx)
+	do_expr(3, RT_SIGFRAME_sigcontext-4 + SIGCONTEXT_ebx)
+	do_expr(5, RT_SIGFRAME_sigcontext-4 + SIGCONTEXT_ebp)
+	do_expr(6, RT_SIGFRAME_sigcontext-4 + SIGCONTEXT_esi)
+	do_expr(7, RT_SIGFRAME_sigcontext-4 + SIGCONTEXT_edi)
+	do_expr(8, RT_SIGFRAME_sigcontext-4 + SIGCONTEXT_eip)
+
+	.align 4
+.LENDFDEDLSI2:
+	.previous
diff -urN linux-2.5.68-bk11/arch/i386/kernel/vsyscall-sysenter.S linux-2.5.68-bk12/arch/i386/kernel/vsyscall-sysenter.S
--- linux-2.5.68-bk11/arch/i386/kernel/vsyscall-sysenter.S	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.68-bk12/arch/i386/kernel/vsyscall-sysenter.S	2003-05-04 04:40:10.000000000 -0700
@@ -0,0 +1,99 @@
+/*
+ * Code for the vsyscall page.  This version uses the sysenter instruction.
+ */
+
+	.text
+	.globl __kernel_vsyscall
+	.type __kernel_vsyscall,@function
+__kernel_vsyscall:
+.LSTART_vsyscall:
+	push %ecx
+.Lpush_ecx:
+	push %edx
+.Lpush_edx:
+	push %ebp
+.Lenter_kernel:
+	movl %esp,%ebp
+	sysenter
+
+	/* 7: align return point with nop's to make disassembly easier */
+	.space 7,0x90
+
+	/* 14: System call restart point is here! (SYSENTER_RETURN - 2) */
+	jmp .Lenter_kernel
+	/* 16: System call normal return point is here! */
+	.globl SYSENTER_RETURN	/* Symbol used by entry.S.  */
+SYSENTER_RETURN:
+	pop %ebp
+.Lpop_ebp:
+	pop %edx
+.Lpop_edx:
+	pop %ecx
+.Lpop_ecx:
+	ret
+.LEND_vsyscall:
+	.size __kernel_vsyscall,.-.LSTART_vsyscall
+	.previous
+
+	.section .eh_frame,"a",@progbits
+.LSTARTFRAMEDLSI:
+	.long .LENDCIEDLSI-.LSTARTCIEDLSI
+.LSTARTCIEDLSI:
+	.long 0			/* CIE ID */
+	.byte 1			/* Version number */
+	.string "zR"		/* NUL-terminated augmentation string */
+	.uleb128 1		/* Code alignment factor */
+	.sleb128 -4		/* Data alignment factor */
+	.byte 8			/* Return address register column */
+	.uleb128 1		/* Augmentation value length */
+	.byte 0x1b		/* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
+	.byte 0x0c		/* DW_CFA_def_cfa */
+	.uleb128 4
+	.uleb128 4
+	.byte 0x88		/* DW_CFA_offset, column 0x8 */
+	.uleb128 1
+	.align 4
+.LENDCIEDLSI:
+	.long .LENDFDEDLSI-.LSTARTFDEDLSI /* Length FDE */
+.LSTARTFDEDLSI:
+	.long .LSTARTFDEDLSI-.LSTARTFRAMEDLSI /* CIE pointer */
+	.long .LSTART_vsyscall-.	/* PC-relative start address */
+	.long .LEND_vsyscall-.LSTART_vsyscall
+	.uleb128 0
+	/* What follows are the instructions for the table generation.
+	   We have to record all changes of the stack pointer.  */
+	.byte 0x04		/* DW_CFA_advance_loc4 */
+	.long .Lpush_ecx-.LSTART_vsyscall
+	.byte 0x0e		/* DW_CFA_def_cfa_offset */
+	.byte 0x08		/* RA at offset 8 now */
+	.byte 0x04		/* DW_CFA_advance_loc4 */
+	.long .Lpush_edx-.Lpush_ecx
+	.byte 0x0e		/* DW_CFA_def_cfa_offset */
+	.byte 0x0c		/* RA at offset 12 now */
+	.byte 0x04		/* DW_CFA_advance_loc4 */
+	.long .Lenter_kernel-.Lpush_edx
+	.byte 0x0e		/* DW_CFA_def_cfa_offset */
+	.byte 0x10		/* RA at offset 16 now */
+	.byte 0x85, 0x04	/* DW_CFA_offset %ebp -16 */
+	/* Finally the epilogue.  */
+	.byte 0x04		/* DW_CFA_advance_loc4 */
+	.long .Lpop_ebp-.Lenter_kernel
+	.byte 0x0e		/* DW_CFA_def_cfa_offset */
+	.byte 0x12		/* RA at offset 12 now */
+	.byte 0xc5		/* DW_CFA_restore %ebp */
+	.byte 0x04		/* DW_CFA_advance_loc4 */
+	.long .Lpop_edx-.Lpop_ebp
+	.byte 0x0e		/* DW_CFA_def_cfa_offset */
+	.byte 0x08		/* RA at offset 8 now */
+	.byte 0x04		/* DW_CFA_advance_loc4 */
+	.long .Lpop_ecx-.Lpop_edx
+	.byte 0x0e		/* DW_CFA_def_cfa_offset */
+	.byte 0x04		/* RA at offset 4 now */
+	.align 4
+.LENDFDEDLSI:
+	.previous
+
+/*
+ * Get the common code for the sigreturn entry points.
+ */
+#include "vsyscall-sigreturn.S"
diff -urN linux-2.5.68-bk11/arch/i386/kernel/vsyscall.S linux-2.5.68-bk12/arch/i386/kernel/vsyscall.S
--- linux-2.5.68-bk11/arch/i386/kernel/vsyscall.S	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.68-bk12/arch/i386/kernel/vsyscall.S	2003-05-04 04:40:10.000000000 -0700
@@ -0,0 +1,15 @@
+#include <linux/init.h>
+
+__INITDATA
+
+	.globl vsyscall_int80_start, vsyscall_int80_end
+vsyscall_int80_start:
+	.incbin "arch/i386/kernel/vsyscall-int80.so"
+vsyscall_int80_end:
+
+	.globl vsyscall_sysenter_start, vsyscall_sysenter_end
+vsyscall_sysenter_start:
+	.incbin "arch/i386/kernel/vsyscall-sysenter.so"
+vsyscall_sysenter_end:
+
+__FINIT
diff -urN linux-2.5.68-bk11/arch/i386/kernel/vsyscall.lds linux-2.5.68-bk12/arch/i386/kernel/vsyscall.lds
--- linux-2.5.68-bk11/arch/i386/kernel/vsyscall.lds	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.68-bk12/arch/i386/kernel/vsyscall.lds	2003-05-04 04:40:10.000000000 -0700
@@ -0,0 +1,67 @@
+/*
+ * Linker script for vsyscall DSO.  The vsyscall page is an ELF shared
+ * object prelinked to its virtual address, and with only one read-only
+ * segment (that fits in one page).  This script controls its layout.
+ */
+
+/* This must match <asm/fixmap.h>.  */
+VSYSCALL_BASE = 0xffffe000;
+
+SECTIONS
+{
+  . = VSYSCALL_BASE + SIZEOF_HEADERS;
+
+  .hash           : { *(.hash) }		:text
+  .dynsym         : { *(.dynsym) }
+  .dynstr         : { *(.dynstr) }
+  .gnu.version    : { *(.gnu.version) }
+  .gnu.version_d  : { *(.gnu.version_d) }
+  .gnu.version_r  : { *(.gnu.version_r) }
+
+  /* This linker script is used both with -r and with -shared.
+     For the layouts to match, we need to skip more than enough
+     space for the dynamic symbol table et al.  If this amount
+     is insufficient, ld -shared will barf.  Just increase it here.  */
+  . = VSYSCALL_BASE + 0x400;
+
+  .text           : { *(.text) }		:text =0x90909090
+
+  .eh_frame_hdr   : { *(.eh_frame_hdr) }	:text :eh_frame_hdr
+  .eh_frame       : { KEEP (*(.eh_frame)) }	:text
+  .dynamic        : { *(.dynamic) }		:text :dynamic
+  .useless        : {
+  	*(.got.plt) *(.got)
+	*(.data .data.* .gnu.linkonce.d.*)
+	*(.dynbss)
+	*(.bss .bss.* .gnu.linkonce.b.*)
+  }						:text
+}
+
+/*
+ * We must supply the ELF program headers explicitly to get just one
+ * PT_LOAD segment, and set the flags explicitly to make segments read-only.
+ */
+PHDRS
+{
+  text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
+  dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
+  eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */
+}
+
+/*
+ * This controls what symbols we export from the DSO.
+ */
+VERSION
+{
+  LINUX_2.5 {
+    global:
+    	__kernel_vsyscall;
+    	__kernel_sigreturn;
+    	__kernel_rt_sigreturn;
+
+    local: *;
+  };
+}
+
+/* The ELF entry point can be used to set the AT_SYSINFO value.  */
+ENTRY(__kernel_vsyscall);
diff -urN linux-2.5.68-bk11/arch/i386/mm/init.c linux-2.5.68-bk12/arch/i386/mm/init.c
--- linux-2.5.68-bk11/arch/i386/mm/init.c	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/mm/init.c	2003-05-04 04:40:10.000000000 -0700
@@ -505,36 +505,20 @@
 #endif
 }
 
-#include <linux/slab.h>
-
-kmem_cache_t *pmd_cache;
-kmem_cache_t *pgd_cache;
-
-void pmd_ctor(void *, kmem_cache_t *, unsigned long);
-void pgd_ctor(void *, kmem_cache_t *, unsigned long);
+#if CONFIG_X86_PAE
+struct kmem_cache_s *pae_pgd_cachep;
 
 void __init pgtable_cache_init(void)
 {
-	if (PTRS_PER_PMD > 1) {
-		pmd_cache = kmem_cache_create("pae_pmd",
-						PTRS_PER_PMD*sizeof(pmd_t),
-						0,
-						SLAB_HWCACHE_ALIGN | SLAB_MUST_HWCACHE_ALIGN,
-						pmd_ctor,
-						NULL);
-
-		if (!pmd_cache)
-			panic("pgtable_cache_init(): cannot create pmd cache");
-	}
-
         /*
          * PAE pgds must be 16-byte aligned:
          */
-        pgd_cache = kmem_cache_create("pgd", PTRS_PER_PGD*sizeof(pgd_t), 0,
-                SLAB_HWCACHE_ALIGN | SLAB_MUST_HWCACHE_ALIGN, pgd_ctor, NULL);
-        if (!pgd_cache)
-                panic("pgtable_cache_init(): Cannot create pgd cache");
+        pae_pgd_cachep = kmem_cache_create("pae_pgd", 32, 0,
+                SLAB_HWCACHE_ALIGN | SLAB_MUST_HWCACHE_ALIGN, NULL, NULL);
+        if (!pae_pgd_cachep)
+                panic("init_pae(): Cannot alloc pae_pgd SLAB cache");
 }
+#endif
 
 /*
  * This function cannot be __init, since exceptions don't work in that
diff -urN linux-2.5.68-bk11/arch/i386/mm/pgtable.c linux-2.5.68-bk12/arch/i386/mm/pgtable.c
--- linux-2.5.68-bk11/arch/i386/mm/pgtable.c	2003-05-04 04:39:38.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/mm/pgtable.c	2003-05-04 04:40:10.000000000 -0700
@@ -151,60 +151,61 @@
 	return pte;
 }
 
-extern kmem_cache_t *pmd_cache;
-extern kmem_cache_t *pgd_cache;
+#if CONFIG_X86_PAE
 
-void pmd_ctor(void *__pmd, kmem_cache_t *pmd_cache, unsigned long flags)
+pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	clear_page(__pmd);
+	int i;
+	pgd_t *pgd = kmem_cache_alloc(pae_pgd_cachep, GFP_KERNEL);
+
+	if (pgd) {
+		for (i = 0; i < USER_PTRS_PER_PGD; i++) {
+			unsigned long pmd = __get_free_page(GFP_KERNEL);
+			if (!pmd)
+				goto out_oom;
+			clear_page(pmd);
+			set_pgd(pgd + i, __pgd(1 + __pa(pmd)));
+		}
+		memcpy(pgd + USER_PTRS_PER_PGD,
+			swapper_pg_dir + USER_PTRS_PER_PGD,
+			(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
+	}
+	return pgd;
+out_oom:
+	for (i--; i >= 0; i--)
+		free_page((unsigned long)__va(pgd_val(pgd[i])-1));
+	kmem_cache_free(pae_pgd_cachep, pgd);
+	return NULL;
 }
 
-void pgd_ctor(void *__pgd, kmem_cache_t *pgd_cache, unsigned long flags)
+void pgd_free(pgd_t *pgd)
 {
-	pgd_t *pgd = __pgd;
+	int i;
 
-	if (PTRS_PER_PMD == 1)
-		memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
-	memcpy(pgd + USER_PTRS_PER_PGD,
-		swapper_pg_dir + USER_PTRS_PER_PGD,
-		(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
+	for (i = 0; i < USER_PTRS_PER_PGD; i++)
+		free_page((unsigned long)__va(pgd_val(pgd[i])-1));
+	kmem_cache_free(pae_pgd_cachep, pgd);
 }
 
+#else
+
 pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	int i;
-	pgd_t *pgd = kmem_cache_alloc(pgd_cache, SLAB_KERNEL);
+	pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL);
 
-	if (PTRS_PER_PMD == 1)
-		return pgd;
-	else if (!pgd)
-		return NULL;
-
-	for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
-		pmd_t *pmd = kmem_cache_alloc(pmd_cache, SLAB_KERNEL);
-		if (!pmd)
-			goto out_oom;
-		set_pgd(pgd + i, __pgd(1 + __pa((unsigned long long)((unsigned long)pmd))));
+	if (pgd) {
+		memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
+		memcpy(pgd + USER_PTRS_PER_PGD,
+			swapper_pg_dir + USER_PTRS_PER_PGD,
+			(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
 	}
 	return pgd;
-
-out_oom:
-	for (i--; i >= 0; --i)
-		kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
-	kmem_cache_free(pgd_cache, (void *)pgd);
-	return NULL;
 }
 
 void pgd_free(pgd_t *pgd)
 {
-	int i;
+	free_page((unsigned long)pgd);
+}
 
-	if (PTRS_PER_PMD > 1) {
-		for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
-			kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
-			set_pgd(pgd + i, __pgd(0));
-		}
-	}
+#endif /* CONFIG_X86_PAE */
 
-	kmem_cache_free(pgd_cache, (void *)pgd);
-}
diff -urN linux-2.5.68-bk11/arch/i386/oprofile/Makefile linux-2.5.68-bk12/arch/i386/oprofile/Makefile
--- linux-2.5.68-bk11/arch/i386/oprofile/Makefile	2003-04-19 19:50:45.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/oprofile/Makefile	2003-05-04 04:40:10.000000000 -0700
@@ -3,8 +3,9 @@
 DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
 		oprof.o cpu_buffer.o buffer_sync.o \
 		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o )
+		oprofilefs.o oprofile_stats.o  \
+		timer_int.o )
 
-oprofile-y				:= $(DRIVER_OBJS) init.o timer_int.o
+oprofile-y				:= $(DRIVER_OBJS) init.o
 oprofile-$(CONFIG_X86_LOCAL_APIC) 	+= nmi_int.o op_model_athlon.o \
 					   op_model_ppro.o op_model_p4.o
diff -urN linux-2.5.68-bk11/arch/i386/oprofile/init.c linux-2.5.68-bk12/arch/i386/oprofile/init.c
--- linux-2.5.68-bk11/arch/i386/oprofile/init.c	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/oprofile/init.c	2003-05-04 04:40:10.000000000 -0700
@@ -11,22 +11,19 @@
 #include <linux/init.h>
  
 /* We support CPUs that have performance counters like the Pentium Pro
- * with NMI mode samples. Other x86 CPUs use a simple interrupt keyed
- * off the timer interrupt, which cannot profile interrupts-disabled
- * code unlike the NMI-based code.
+ * with the NMI mode driver.
  */
  
 extern int nmi_init(struct oprofile_operations ** ops);
 extern void nmi_exit(void);
-extern void timer_init(struct oprofile_operations ** ops);
 
 int __init oprofile_arch_init(struct oprofile_operations ** ops)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
-	if (!nmi_init(ops))
+	return nmi_init(ops);
+#else
+	return -ENODEV;
 #endif
-		timer_init(ops);
-	return 0;
 }
 
 
diff -urN linux-2.5.68-bk11/arch/i386/oprofile/nmi_int.c linux-2.5.68-bk12/arch/i386/oprofile/nmi_int.c
--- linux-2.5.68-bk11/arch/i386/oprofile/nmi_int.c	2003-04-19 19:51:08.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/oprofile/nmi_int.c	2003-05-04 04:40:10.000000000 -0700
@@ -314,13 +314,13 @@
 	__u8 family = current_cpu_data.x86;
  
 	if (!cpu_has_apic)
-		return 0;
+		return -ENODEV;
  
 	switch (vendor) {
 		case X86_VENDOR_AMD:
 			/* Needs to be at least an Athlon (or hammer in 32bit mode) */
 			if (family < 6)
-				return 0;
+				return -ENODEV;
 			model = &op_athlon_spec;
 			nmi_ops.cpu_type = "i386/athlon";
 			break;
@@ -331,30 +331,30 @@
 				/* Pentium IV */
 				case 0xf:
 					if (!p4_init())
-						return 0;
+						return -ENODEV;
 					break;
 
 				/* A P6-class processor */
 				case 6:
 					if (!ppro_init())
-						return 0;
+						return -ENODEV;
 					break;
 
 				default:
-					return 0;
+					return -ENODEV;
 			}
 			break;
 #endif /* !CONFIG_X86_64 */
 
 		default:
-			return 0;
+			return -ENODEV;
 	}
 
 	init_driverfs();
 	using_nmi = 1;
 	*ops = &nmi_ops;
 	printk(KERN_INFO "oprofile: using NMI interrupt.\n");
-	return 1;
+	return 0;
 }
 
 
diff -urN linux-2.5.68-bk11/arch/i386/oprofile/timer_int.c linux-2.5.68-bk12/arch/i386/oprofile/timer_int.c
--- linux-2.5.68-bk11/arch/i386/oprofile/timer_int.c	2003-04-19 19:49:09.000000000 -0700
+++ linux-2.5.68-bk12/arch/i386/oprofile/timer_int.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,58 +0,0 @@
-/**
- * @file timer_int.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <levon@movementarian.org>
- */
-
-#include <linux/kernel.h>
-#include <linux/notifier.h>
-#include <linux/smp.h>
-#include <linux/irq.h>
-#include <linux/oprofile.h>
-#include <asm/ptrace.h>
- 
-#include "op_counter.h"
- 
-static int timer_notify(struct notifier_block * self, unsigned long val, void * data)
-{
-	struct pt_regs * regs = (struct pt_regs *)data;
-	int cpu = smp_processor_id();
-	unsigned long eip = instruction_pointer(regs);
- 
-	oprofile_add_sample(eip, !user_mode(regs), 0, cpu);
-	return 0;
-}
- 
- 
-static struct notifier_block timer_notifier = {
-	.notifier_call	= timer_notify,
-};
- 
-
-static int timer_start(void)
-{
-	return register_profile_notifier(&timer_notifier);
-}
-
-
-static void timer_stop(void)
-{
-	unregister_profile_notifier(&timer_notifier);
-}
-
-
-static struct oprofile_operations timer_ops = {
-	.start	= timer_start,
-	.stop	= timer_stop,
-	.cpu_type = "timer"
-};
-
- 
-void __init timer_init(struct oprofile_operations ** ops)
-{
-	*ops = &timer_ops;
-	printk(KERN_INFO "oprofile: using timer interrupt.\n");
-}
diff -urN linux-2.5.68-bk11/arch/parisc/oprofile/Makefile linux-2.5.68-bk12/arch/parisc/oprofile/Makefile
--- linux-2.5.68-bk11/arch/parisc/oprofile/Makefile	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk12/arch/parisc/oprofile/Makefile	2003-05-04 04:40:12.000000000 -0700
@@ -3,6 +3,7 @@
 DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
 		oprof.o cpu_buffer.o buffer_sync.o \
 		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o )
+		oprofilefs.o oprofile_stats.o \
+		timer_int.o )
 
-oprofile-y				:= $(DRIVER_OBJS) init.o timer_int.o
+oprofile-y				:= $(DRIVER_OBJS) init.o
diff -urN linux-2.5.68-bk11/arch/parisc/oprofile/init.c linux-2.5.68-bk12/arch/parisc/oprofile/init.c
--- linux-2.5.68-bk11/arch/parisc/oprofile/init.c	2003-04-19 19:49:31.000000000 -0700
+++ linux-2.5.68-bk12/arch/parisc/oprofile/init.c	2003-05-04 04:40:12.000000000 -0700
@@ -15,8 +15,7 @@
 
 int __init oprofile_arch_init(struct oprofile_operations ** ops)
 {
-	timer_init(ops);
-	return 0;
+	return -ENODEV;
 }
 
 
diff -urN linux-2.5.68-bk11/arch/parisc/oprofile/timer_int.c linux-2.5.68-bk12/arch/parisc/oprofile/timer_int.c
--- linux-2.5.68-bk11/arch/parisc/oprofile/timer_int.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk12/arch/parisc/oprofile/timer_int.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,58 +0,0 @@
-/**
- * @file timer_int.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <levon@movementarian.org>
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/notifier.h>
-#include <linux/smp.h>
-#include <linux/irq.h>
-#include <linux/oprofile.h>
-#include <asm/ptrace.h>
- 
-static int timer_notify(struct notifier_block * self, unsigned long val, void * data)
-{
-	struct pt_regs * regs = (struct pt_regs *)data;
-	int cpu = smp_processor_id();
-	unsigned long pc = regs->iaoq[0];
-	int is_kernel = !user_mode(regs);
- 
-	oprofile_add_sample(pc, is_kernel, 0, cpu);
-	return 0;
-}
- 
- 
-static struct notifier_block timer_notifier = {
-	.notifier_call	= timer_notify,
-};
- 
-
-static int timer_start(void)
-{
-	return register_profile_notifier(&timer_notifier);
-}
-
-
-static void timer_stop(void)
-{
-	unregister_profile_notifier(&timer_notifier);
-}
-
-
-static struct oprofile_operations timer_ops = {
-	.start	= timer_start,
-	.stop	= timer_stop,
-	.cpu_type = "timer"
-};
-
- 
-void __init timer_init(struct oprofile_operations ** ops)
-{
-	*ops = &timer_ops;
-	printk(KERN_INFO "oprofile: using timer interrupt.\n");
-}
diff -urN linux-2.5.68-bk11/arch/ppc64/oprofile/Makefile linux-2.5.68-bk12/arch/ppc64/oprofile/Makefile
--- linux-2.5.68-bk11/arch/ppc64/oprofile/Makefile	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/arch/ppc64/oprofile/Makefile	2003-05-04 04:40:12.000000000 -0700
@@ -3,6 +3,7 @@
 DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
 		oprof.o cpu_buffer.o buffer_sync.o \
 		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o )
+		oprofilefs.o oprofile_stats.o \
+		timer_int.o )
 
-oprofile-y := $(DRIVER_OBJS) init.o timer_int.o
+oprofile-y := $(DRIVER_OBJS) init.o
diff -urN linux-2.5.68-bk11/arch/ppc64/oprofile/init.c linux-2.5.68-bk12/arch/ppc64/oprofile/init.c
--- linux-2.5.68-bk11/arch/ppc64/oprofile/init.c	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk12/arch/ppc64/oprofile/init.c	2003-05-04 04:40:12.000000000 -0700
@@ -15,8 +15,7 @@
 
 int __init oprofile_arch_init(struct oprofile_operations ** ops)
 {
-	timer_init(ops);
-	return 0;
+	return -ENODEV;
 }
 
 
diff -urN linux-2.5.68-bk11/arch/ppc64/oprofile/timer_int.c linux-2.5.68-bk12/arch/ppc64/oprofile/timer_int.c
--- linux-2.5.68-bk11/arch/ppc64/oprofile/timer_int.c	2003-04-19 19:51:21.000000000 -0700
+++ linux-2.5.68-bk12/arch/ppc64/oprofile/timer_int.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,59 +0,0 @@
-/**
- * @file timer_int.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <levon@movementarian.org>
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/notifier.h>
-#include <linux/smp.h>
-#include <linux/irq.h>
-#include <linux/oprofile.h>
-#include <linux/profile.h>
-#include <asm/ptrace.h>
- 
-static int timer_notify(struct notifier_block * self, unsigned long val, void * data)
-{
-	struct pt_regs * regs = (struct pt_regs *)data;
-	int cpu = smp_processor_id();
-	unsigned long pc = instruction_pointer(regs);
-	int is_kernel = !user_mode(regs);
- 
-	oprofile_add_sample(pc, is_kernel, 0, cpu);
-	return 0;
-}
- 
- 
-static struct notifier_block timer_notifier = {
-	.notifier_call	= timer_notify,
-};
- 
-
-static int timer_start(void)
-{
-	return register_profile_notifier(&timer_notifier);
-}
-
-
-static void timer_stop(void)
-{
-	unregister_profile_notifier(&timer_notifier);
-}
-
-
-static struct oprofile_operations timer_ops = {
-	.start	= timer_start,
-	.stop	= timer_stop,
-	.cpu_type = "timer"
-};
-
- 
-void __init timer_init(struct oprofile_operations ** ops)
-{
-	*ops = &timer_ops;
-	printk(KERN_INFO "oprofile: using timer interrupt.\n");
-}
diff -urN linux-2.5.68-bk11/arch/sparc/kernel/head.S linux-2.5.68-bk12/arch/sparc/kernel/head.S
--- linux-2.5.68-bk11/arch/sparc/kernel/head.S	2003-05-04 04:39:39.000000000 -0700
+++ linux-2.5.68-bk12/arch/sparc/kernel/head.S	2003-05-04 04:40:13.000000000 -0700
@@ -25,6 +25,7 @@
 #include <asm/winmacro.h>
 #include <asm/thread_info.h>	/* TI_UWINMASK */
 #include <asm/errno.h>
+#include <asm/pgtsrmmu.h>	/* SRMMU_PGDIR_SHIFT */
 
 	.data
 /* 
@@ -623,12 +624,8 @@
 		/* Ok, pull in the PTD. */
 		lda	[%o1] ASI_M_BYPASS, %o2		! This is the 0x0 16MB pgd
 
-		/* Calculate to KERNBASE entry.
-		 *
-		 * XXX Should not use empirical constant, but Gas gets an  XXX
-		 * XXX upset stomach with the bitshift I would have to use XXX
-		 */
-		add	%o1, 0x3c0, %o3		
+		/* Calculate to KERNBASE entry. */
+		add	%o1, KERNBASE >> (SRMMU_PGDIR_SHIFT - 2), %o3		
 
 		/* Poke the entry into the calculated address. */
 		sta	%o2, [%o3] ASI_M_BYPASS
@@ -672,7 +669,7 @@
 		sll	%g1, 0x8, %g1			! make phys addr for l1 tbl
 
 		lda	[%g1] ASI_M_BYPASS, %g2		! get level1 entry for 0x0
-		add	%g1, 0x3c0, %g3			! XXX AWAY WITH EMPIRICALS
+		add	%g1, KERNBASE >> (SRMMU_PGDIR_SHIFT - 2), %g3
 		sta	%g2, [%g3] ASI_M_BYPASS		! place at KERNBASE entry
 		b	go_to_highmem
 		 nop					! wheee....
diff -urN linux-2.5.68-bk11/arch/sparc64/defconfig linux-2.5.68-bk12/arch/sparc64/defconfig
--- linux-2.5.68-bk11/arch/sparc64/defconfig	2003-05-04 04:39:39.000000000 -0700
+++ linux-2.5.68-bk12/arch/sparc64/defconfig	2003-05-04 04:40:13.000000000 -0700
@@ -619,6 +619,12 @@
 CONFIG_R8169=m
 CONFIG_SK98LIN=m
 CONFIG_TIGON3=m
+
+#
+# Ethernet (10000 Mbit)
+#
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
 CONFIG_FDDI=y
 # CONFIG_DEFXX is not set
 CONFIG_SKFP=m
@@ -756,7 +762,7 @@
 CONFIG_EXT3_FS=m
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
-CONFIG_JBD=y
+CONFIG_JBD=m
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
 # CONFIG_REISERFS_FS is not set
@@ -1047,13 +1053,29 @@
 # USB Network adaptors
 #
 CONFIG_USB_CATC=m
-CONFIG_USB_CDCETHER=m
 CONFIG_USB_KAWETH=m
 CONFIG_USB_PEGASUS=m
 CONFIG_USB_RTL8150=m
 CONFIG_USB_USBNET=m
 
 #
+# USB Host-to-Host Cables
+#
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_GENESYS=y
+CONFIG_USB_NET1080=y
+CONFIG_USB_PL2301=y
+
+#
+# Intelligent USB Devices/Gadgets
+#
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZAURUS=y
+CONFIG_USB_CDCETHER=y
+
+#
 # USB port drivers
 #
 CONFIG_USB_USS720=m
@@ -1123,6 +1145,7 @@
 # Bluetooth device drivers
 #
 CONFIG_BT_HCIUSB=m
+CONFIG_BT_USB_SCO=y
 CONFIG_BT_USB_ZERO_PACKET=y
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
diff -urN linux-2.5.68-bk11/arch/sparc64/kernel/ioctl32.c linux-2.5.68-bk12/arch/sparc64/kernel/ioctl32.c
--- linux-2.5.68-bk11/arch/sparc64/kernel/ioctl32.c	2003-05-04 04:39:39.000000000 -0700
+++ linux-2.5.68-bk12/arch/sparc64/kernel/ioctl32.c	2003-05-04 04:40:13.000000000 -0700
@@ -115,7 +115,6 @@
 #define EXT2_IOC32_GETVERSION             _IOR('v', 1, int)
 #define EXT2_IOC32_SETVERSION             _IOW('v', 2, int)
 
-extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
 
 static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
diff -urN linux-2.5.68-bk11/arch/sparc64/oprofile/Makefile linux-2.5.68-bk12/arch/sparc64/oprofile/Makefile
--- linux-2.5.68-bk11/arch/sparc64/oprofile/Makefile	2003-04-19 19:51:17.000000000 -0700
+++ linux-2.5.68-bk12/arch/sparc64/oprofile/Makefile	2003-05-04 04:40:13.000000000 -0700
@@ -3,6 +3,7 @@
 DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
 		oprof.o cpu_buffer.o buffer_sync.o \
 		event_buffer.o oprofile_files.o \
-		oprofilefs.o oprofile_stats.o )
+		oprofilefs.o oprofile_stats.o \
+		timer_int.o )
 
-oprofile-y				:= $(DRIVER_OBJS) init.o timer_int.o
+oprofile-y				:= $(DRIVER_OBJS) init.o
diff -urN linux-2.5.68-bk11/arch/sparc64/oprofile/init.c linux-2.5.68-bk12/arch/sparc64/oprofile/init.c
--- linux-2.5.68-bk11/arch/sparc64/oprofile/init.c	2003-04-19 19:50:02.000000000 -0700
+++ linux-2.5.68-bk12/arch/sparc64/oprofile/init.c	2003-05-04 04:40:13.000000000 -0700
@@ -15,8 +15,7 @@
 
 int __init oprofile_arch_init(struct oprofile_operations ** ops)
 {
-	timer_init(ops);
-	return 0;
+	return -ENODEV;
 }
 
 
diff -urN linux-2.5.68-bk11/arch/sparc64/oprofile/timer_int.c linux-2.5.68-bk12/arch/sparc64/oprofile/timer_int.c
--- linux-2.5.68-bk11/arch/sparc64/oprofile/timer_int.c	2003-04-19 19:50:29.000000000 -0700
+++ linux-2.5.68-bk12/arch/sparc64/oprofile/timer_int.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,59 +0,0 @@
-/**
- * @file timer_int.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <levon@movementarian.org>
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/notifier.h>
-#include <linux/smp.h>
-#include <linux/irq.h>
-#include <linux/oprofile.h>
-#include <linux/profile.h>
-#include <asm/ptrace.h>
- 
-static int timer_notify(struct notifier_block * self, unsigned long val, void * data)
-{
-	struct pt_regs * regs = (struct pt_regs *)data;
-	int cpu = smp_processor_id();
-	unsigned long pc = instruction_pointer(regs);
-	int is_kernel = !user_mode(regs);
- 
-	oprofile_add_sample(pc, is_kernel, 0, cpu);
-	return 0;
-}
- 
- 
-static struct notifier_block timer_notifier = {
-	.notifier_call	= timer_notify,
-};
- 
-
-static int timer_start(void)
-{
-	return register_profile_notifier(&timer_notifier);
-}
-
-
-static void timer_stop(void)
-{
-	unregister_profile_notifier(&timer_notifier);
-}
-
-
-static struct oprofile_operations timer_ops = {
-	.start	= timer_start,
-	.stop	= timer_stop,
-	.cpu_type = "timer"
-};
-
- 
-void __init timer_init(struct oprofile_operations ** ops)
-{
-	*ops = &timer_ops;
-	printk(KERN_INFO "oprofile: using timer interrupt.\n");
-}
diff -urN linux-2.5.68-bk11/arch/x86_64/oprofile/Makefile linux-2.5.68-bk12/arch/x86_64/oprofile/Makefile
--- linux-2.5.68-bk11/arch/x86_64/oprofile/Makefile	2003-04-19 19:48:55.000000000 -0700
+++ linux-2.5.68-bk12/arch/x86_64/oprofile/Makefile	2003-05-04 04:40:14.000000000 -0700
@@ -9,9 +9,10 @@
 DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
 	oprof.o cpu_buffer.o buffer_sync.o \
 	event_buffer.o oprofile_files.o \
-	oprofilefs.o oprofile_stats.o )
+	oprofilefs.o oprofile_stats.o \
+	timer_int.o )
  
-oprofile-objs := $(DRIVER_OBJS) init.o timer_int.o
+oprofile-objs := $(DRIVER_OBJS) init.o
 
 oprofile-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o
  
@@ -23,11 +24,9 @@
 	@ln -sf ../../i386/oprofile/op_model_athlon.c $(obj)/op_model_athlon.c
 $(obj)/init.c: ${INCL}
 	@ln -sf ../../i386/oprofile/init.c $(obj)/init.c
-$(obj)/timer_int.c: ${INCL}
-	@ln -sf ../../i386/oprofile/timer_int.c $(obj)/timer_int.c
 $(obj)/op_counter.h: 
 	@ln -sf ../../i386/oprofile/op_counter.h $(obj)/op_counter.h
 $(obj)/op_x86_model.h:
 	@ln -sf ../../i386/oprofile/op_x86_model.h $(obj)/op_x86_model.h	
-clean-files += op_x86_model.h op_counter.h timer_int.c init.c \
+clean-files += op_x86_model.h op_counter.h init.c \
 	       op_model_athlon.c nmi_int.c
diff -urN linux-2.5.68-bk11/drivers/char/drm/r128_drm.h linux-2.5.68-bk12/drivers/char/drm/r128_drm.h
--- linux-2.5.68-bk11/drivers/char/drm/r128_drm.h	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk12/drivers/char/drm/r128_drm.h	2003-05-04 04:40:25.000000000 -0700
@@ -162,7 +162,7 @@
 	unsigned int last_dispatch;
 
 	drm_tex_region_t tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS+1];
-	int tex_age[R128_NR_TEX_HEAPS];
+	unsigned int tex_age[R128_NR_TEX_HEAPS];
 	int ctx_owner;
 } drm_r128_sarea_t;
 
diff -urN linux-2.5.68-bk11/drivers/char/drm/radeon_drm.h linux-2.5.68-bk12/drivers/char/drm/radeon_drm.h
--- linux-2.5.68-bk11/drivers/char/drm/radeon_drm.h	2003-05-04 04:39:41.000000000 -0700
+++ linux-2.5.68-bk12/drivers/char/drm/radeon_drm.h	2003-05-04 04:40:25.000000000 -0700
@@ -323,12 +323,6 @@
 
 
 typedef struct {
-	unsigned char next, prev;
-	unsigned char in_use;
-	int age;
-} drm_radeon_tex_region_t;
-
-typedef struct {
 	/* The channel for communication of state information to the
 	 * kernel on firing a vertex buffer with either of the
 	 * obsoleted vertex/index ioctls.
@@ -350,8 +344,8 @@
 	unsigned int last_dispatch;
 	unsigned int last_clear;
 
-	drm_radeon_tex_region_t tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS+1];
-	int tex_age[RADEON_NR_TEX_HEAPS];
+	drm_tex_region_t tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS+1];
+	unsigned int tex_age[RADEON_NR_TEX_HEAPS];
 	int ctx_owner;
         int pfState;                /* number of 3d windows (0,1,2ormore) */
         int pfCurrentPage;	    /* which buffer is being displayed? */
diff -urN linux-2.5.68-bk11/drivers/char/drm/radeon_drv.h linux-2.5.68-bk12/drivers/char/drm/radeon_drv.h
--- linux-2.5.68-bk11/drivers/char/drm/radeon_drv.h	2003-05-04 04:39:41.000000000 -0700
+++ linux-2.5.68-bk12/drivers/char/drm/radeon_drv.h	2003-05-04 04:40:25.000000000 -0700
@@ -581,6 +581,7 @@
 #define RADEON_TXFORMAT_ARGB4444	5
 #define RADEON_TXFORMAT_ARGB8888	6
 #define RADEON_TXFORMAT_RGBA8888	7
+#define RADEON_TXFORMAT_Y8		8
 #define RADEON_TXFORMAT_VYUY422         10
 #define RADEON_TXFORMAT_YVYU422         11
 #define RADEON_TXFORMAT_DXT1            12
diff -urN linux-2.5.68-bk11/drivers/net/pppoe.c linux-2.5.68-bk12/drivers/net/pppoe.c
--- linux-2.5.68-bk11/drivers/net/pppoe.c	2003-05-04 04:39:43.000000000 -0700
+++ linux-2.5.68-bk12/drivers/net/pppoe.c	2003-05-04 04:40:58.000000000 -0700
@@ -494,16 +494,21 @@
 	struct sock *sk;
 	struct pppox_opt *po;
 
-	sk = pppox_sk_alloc(sock, PX_PROTO_OE, GFP_KERNEL, 1, NULL);
+	sk = sk_alloc(PF_PPPOX, GFP_KERNEL, 1, NULL);
 	if (!sk)
 		goto out;
 
+	sock_init_data(sock, sk);
+	sk_set_owner(sk, THIS_MODULE);
 	sock->state = SS_UNCONNECTED;
 	sock->ops   = &pppoe_ops;
 
 	sk->backlog_rcv = pppoe_rcv_core;
 	sk->state = PPPOX_NONE;
 	sk->type = SOCK_STREAM;
+	sk->family   = PF_PPPOX;
+	sk->protocol = PX_PROTO_OE;
+	sk->destruct = pppoe_sk_free;
 
 	po = pppox_sk(sk) = kmalloc(sizeof(*po), GFP_KERNEL);
 	if (!po)
@@ -1062,10 +1067,12 @@
 };
 #endif /* CONFIG_PROC_FS */
 
-/* ->release and ->ioctl are set at pppox_create */
+/* ->ioctl are set at pppox_create */
 
 struct proto_ops pppoe_ops = {
     .family		= AF_PPPOX,
+    .owner		= THIS_MODULE,
+    .release		= pppoe_release,
     .bind		= sock_no_bind,
     .connect		= pppoe_connect,
     .socketpair		= sock_no_socketpair,
@@ -1084,8 +1091,6 @@
 struct pppox_proto pppoe_proto = {
     .create	= pppoe_create,
     .ioctl	= pppoe_ioctl,
-    .release	= pppoe_release,
-    .sk_free	= pppoe_sk_free,
     .owner	= THIS_MODULE,
 };
 
diff -urN linux-2.5.68-bk11/drivers/net/pppox.c linux-2.5.68-bk12/drivers/net/pppox.c
--- linux-2.5.68-bk11/drivers/net/pppox.c	2003-05-04 04:39:43.000000000 -0700
+++ linux-2.5.68-bk12/drivers/net/pppox.c	2003-05-04 04:40:58.000000000 -0700
@@ -64,45 +64,9 @@
 	}
 }
 
-static int pppox_release(struct socket *sock)
-{
-	struct sock *sk = sock->sk;
-	int rc = pppox_protos[sk->protocol]->release(sock);
-
-	module_put(pppox_protos[sk->protocol]->owner);
-	return rc;
-}
-
-static void pppox_sk_free(struct sock *sk)
-{
-	pppox_protos[sk->protocol]->sk_free(sk);
-	module_put(pppox_protos[sk->protocol]->owner);
-}
-
-struct sock *pppox_sk_alloc(struct socket *sock, int protocol, int priority,
-			    int zero_it, kmem_cache_t *slab)
-{
-	struct sock *sk = NULL;
-
-	if (!try_module_get(pppox_protos[protocol]->owner))
-		goto out;
-
-	sk = sk_alloc(PF_PPPOX, priority, zero_it, slab);
-	if (sk) {
-		sock_init_data(sock, sk);
-		sk->family   = PF_PPPOX;
-		sk->protocol = protocol;
-		sk->destruct = pppox_sk_free;
-	} else
-		module_put(pppox_protos[protocol]->owner);
-out:
-	return sk;
-}
-
 EXPORT_SYMBOL(register_pppox_proto);
 EXPORT_SYMBOL(unregister_pppox_proto);
 EXPORT_SYMBOL(pppox_unbind_sock);
-EXPORT_SYMBOL(pppox_sk_alloc);
 
 static int pppox_ioctl(struct socket* sock, unsigned int cmd, 
 		       unsigned long arg)
@@ -156,12 +120,10 @@
 	rc = pppox_protos[protocol]->create(sock);
 	if (!rc) {
 		/* We get to set the ioctl handler. */
-		/* And the release handler, for module refcounting */
 		/* For everything else, pppox is just a shell. */
 		sock->ops->ioctl = pppox_ioctl;
-		sock->ops->release = pppox_release;
-	} else
-		module_put(pppox_protos[protocol]->owner);
+	}
+	module_put(pppox_protos[protocol]->owner);
 out:
 	return rc;
 }
diff -urN linux-2.5.68-bk11/drivers/oprofile/buffer_sync.c linux-2.5.68-bk12/drivers/oprofile/buffer_sync.c
--- linux-2.5.68-bk11/drivers/oprofile/buffer_sync.c	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/drivers/oprofile/buffer_sync.c	2003-05-04 04:41:05.000000000 -0700
@@ -58,8 +58,8 @@
  * must concern ourselves with. First, when a task is about to
  * exit (exit_mmap()), we should process the buffer to deal with
  * any samples in the CPU buffer, before we lose the ->mmap information
- * we need. Second, a task may unmap (part of) an executable mmap,
- * so we want to process samples before that happens too
+ * we need. It is vital to get this case correct, otherwise we can
+ * end up trying to access a freed task_struct.
  */
 static int mm_notify(struct notifier_block * self, unsigned long val, void * data)
 {
@@ -67,6 +67,29 @@
 	return 0;
 }
 
+
+/* Second, a task may unmap (part of) an executable mmap,
+ * so we want to process samples before that happens too. This is merely
+ * a QOI issue not a correctness one.
+ */
+static int munmap_notify(struct notifier_block * self, unsigned long val, void * data)
+{
+	/* Note that we cannot sync the buffers directly, because we might end up
+	 * taking the the mmap_sem that we hold now inside of event_buffer_read()
+	 * on a page fault, whilst holding buffer_sem - deadlock.
+	 *
+	 * This would mean a threaded reader of the event buffer, but we should
+	 * prevent it anyway.
+	 *
+	 * Delaying the work in a context that doesn't hold the mmap_sem means
+	 * that we won't lose samples from other mappings that current() may
+	 * have. Note that either way, we lose any pending samples for what is
+	 * being unmapped.
+	 */
+	schedule_work(&sync_wq);
+	return 0;
+}
+
  
 /* We need to be told about new modules so we don't attribute to a previously
  * loaded module, or drop the samples on the floor.
@@ -92,7 +115,7 @@
 };
 
 static struct notifier_block exec_unmap_nb = {
-	.notifier_call	= mm_notify,
+	.notifier_call	= munmap_notify,
 };
 
 static struct notifier_block exit_mmap_nb = {
@@ -147,6 +170,8 @@
 	profile_event_unregister(EXIT_MMAP, &exit_mmap_nb);
 	profile_event_unregister(EXEC_UNMAP, &exec_unmap_nb);
 	del_timer_sync(&sync_timer);
+	/* timer might have queued work, make sure it's completed. */
+	flush_scheduled_work();
 }
 
  
@@ -296,6 +321,8 @@
 		add_sample_entry(s->eip, s->event);
 	} else if (mm) {
 		add_us_sample(mm, s);
+	} else {
+		atomic_inc(&oprofile_stats.sample_lost_no_mm);
 	}
 }
  
@@ -310,26 +337,23 @@
 /* Take the task's mmap_sem to protect ourselves from
  * races when we do lookup_dcookie().
  */
-static struct mm_struct * take_task_mm(struct task_struct * task)
+static struct mm_struct * take_tasks_mm(struct task_struct * task)
 {
-	struct mm_struct * mm = task->mm;
- 
-	/* if task->mm !NULL, mm_count must be at least 1. It cannot
-	 * drop to 0 without the task exiting, which will have to sleep
-	 * on buffer_sem first. So we do not need to mark mm_count
-	 * ourselves.
+	struct mm_struct * mm;
+       
+	/* Subtle. We don't need to keep a reference to this task's mm,
+	 * because, for the mm to be freed on another CPU, that would have
+	 * to go through the task exit notifier, which ends up sleeping
+	 * on the buffer_sem we hold, so we end up with mutual exclusion
+	 * anyway.
 	 */
+	task_lock(task);
+	mm = task->mm;
+	task_unlock(task);
+ 
 	if (mm) {
-		/* More ugliness. If a task took its mmap
-		 * sem then came to sleep on buffer_sem we
-		 * will deadlock waiting for it. So we can
-		 * but try. This will lose samples :/
-		 */
-		if (!down_read_trylock(&mm->mmap_sem)) {
-			/* FIXME: this underestimates samples lost */
-			atomic_inc(&oprofile_stats.sample_lost_mmap_sem);
-			mm = NULL;
-		}
+		/* needed to walk the task's VMAs */
+		down_read(&mm->mmap_sem);
 	}
  
 	return mm;
@@ -399,7 +423,7 @@
 				new = (struct task_struct *)s->event;
 
 				release_mm(mm);
-				mm = take_task_mm(new);
+				mm = take_tasks_mm(new);
 
 				cookie = get_exec_dcookie(mm);
 				add_user_ctx_switch(new->pid, cookie);
@@ -460,4 +484,3 @@
 	schedule_work(&sync_wq);
 	/* timer is re-added by the scheduled task */
 }
-
diff -urN linux-2.5.68-bk11/drivers/oprofile/event_buffer.c linux-2.5.68-bk12/drivers/oprofile/event_buffer.c
--- linux-2.5.68-bk11/drivers/oprofile/event_buffer.c	2003-04-19 19:48:48.000000000 -0700
+++ linux-2.5.68-bk12/drivers/oprofile/event_buffer.c	2003-05-04 04:41:05.000000000 -0700
@@ -151,11 +151,15 @@
 	if (count != max || *offset)
 		return -EINVAL;
 
-	/* wait for the event buffer to fill up with some data */
 	wait_event_interruptible(buffer_wait, atomic_read(&buffer_ready));
+
 	if (signal_pending(current))
 		return -EINTR;
 
+	/* can't currently happen */
+	if (!atomic_read(&buffer_ready))
+		return -EAGAIN;
+
 	down(&buffer_sem);
 
 	atomic_set(&buffer_ready, 0);
diff -urN linux-2.5.68-bk11/drivers/oprofile/oprof.c linux-2.5.68-bk12/drivers/oprofile/oprof.c
--- linux-2.5.68-bk11/drivers/oprofile/oprof.c	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/drivers/oprofile/oprof.c	2003-05-04 04:41:05.000000000 -0700
@@ -28,6 +28,8 @@
 {
 	int err;
  
+	down(&start_sem);
+
 	if ((err = alloc_cpu_buffers()))
 		goto out;
 
@@ -45,7 +47,6 @@
 	if ((err = sync_start()))
 		goto out3;
 
-	down(&start_sem);
 	is_setup = 1;
 	up(&start_sem);
 	return 0;
@@ -58,6 +59,7 @@
 out1:
 	free_cpu_buffers();
 out:
+	up(&start_sem);
 	return err;
 }
 
@@ -106,27 +108,34 @@
 
 void oprofile_shutdown(void)
 {
+	down(&start_sem);
 	sync_stop();
 	if (oprofile_ops->shutdown)
 		oprofile_ops->shutdown(); 
-	/* down() is also necessary to synchronise all pending events
-	 * before freeing */
-	down(&buffer_sem);
 	is_setup = 0;
-	up(&buffer_sem);
 	free_event_buffer();
 	free_cpu_buffers();
+	up(&start_sem);
 }
 
- 
+
+extern void timer_init(struct oprofile_operations ** ops);
+
+
 static int __init oprofile_init(void)
 {
 	int err;
 
 	/* Architecture must fill in the interrupt ops and the
-	 * logical CPU type.
+	 * logical CPU type, or we can fall back to the timer
+	 * interrupt profiler.
 	 */
 	err = oprofile_arch_init(&oprofile_ops);
+	if (err == -ENODEV) {
+		timer_init(&oprofile_ops);
+		err = 0;
+	}
+
 	if (err)
 		goto out;
 
diff -urN linux-2.5.68-bk11/drivers/oprofile/oprofile_stats.c linux-2.5.68-bk12/drivers/oprofile/oprofile_stats.c
--- linux-2.5.68-bk11/drivers/oprofile/oprofile_stats.c	2003-04-19 19:50:09.000000000 -0700
+++ linux-2.5.68-bk12/drivers/oprofile/oprofile_stats.c	2003-05-04 04:41:05.000000000 -0700
@@ -31,7 +31,7 @@
 		cpu_buf->sample_lost_task_exit = 0;
 	}
  
-	atomic_set(&oprofile_stats.sample_lost_mmap_sem, 0);
+	atomic_set(&oprofile_stats.sample_lost_no_mm, 0);
 	atomic_set(&oprofile_stats.event_lost_overflow, 0);
 }
 
@@ -68,8 +68,8 @@
 			&cpu_buf->sample_lost_task_exit);
 	}
  
-	oprofilefs_create_ro_atomic(sb, dir, "sample_lost_mmap_sem",
-		&oprofile_stats.sample_lost_mmap_sem);
+	oprofilefs_create_ro_atomic(sb, dir, "sample_lost_no_mm",
+		&oprofile_stats.sample_lost_no_mm);
 	oprofilefs_create_ro_atomic(sb, dir, "event_lost_overflow",
 		&oprofile_stats.event_lost_overflow);
 }
diff -urN linux-2.5.68-bk11/drivers/oprofile/oprofile_stats.h linux-2.5.68-bk12/drivers/oprofile/oprofile_stats.h
--- linux-2.5.68-bk11/drivers/oprofile/oprofile_stats.h	2003-04-19 19:51:21.000000000 -0700
+++ linux-2.5.68-bk12/drivers/oprofile/oprofile_stats.h	2003-05-04 04:41:05.000000000 -0700
@@ -13,7 +13,7 @@
 #include <asm/atomic.h>
  
 struct oprofile_stat_struct {
-	atomic_t sample_lost_mmap_sem;
+	atomic_t sample_lost_no_mm;
 	atomic_t event_lost_overflow;
 };
 
diff -urN linux-2.5.68-bk11/drivers/oprofile/timer_int.c linux-2.5.68-bk12/drivers/oprofile/timer_int.c
--- linux-2.5.68-bk11/drivers/oprofile/timer_int.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.68-bk12/drivers/oprofile/timer_int.c	2003-05-04 04:41:05.000000000 -0700
@@ -0,0 +1,56 @@
+/**
+ * @file timer_int.c
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon <levon@movementarian.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/notifier.h>
+#include <linux/smp.h>
+#include <linux/irq.h>
+#include <linux/oprofile.h>
+#include <asm/ptrace.h>
+ 
+static int timer_notify(struct notifier_block * self, unsigned long val, void * data)
+{
+	struct pt_regs * regs = (struct pt_regs *)data;
+	int cpu = smp_processor_id();
+	unsigned long eip = instruction_pointer(regs);
+ 
+	oprofile_add_sample(eip, !user_mode(regs), 0, cpu);
+	return 0;
+}
+ 
+ 
+static struct notifier_block timer_notifier = {
+	.notifier_call	= timer_notify,
+};
+ 
+
+static int timer_start(void)
+{
+	return register_profile_notifier(&timer_notifier);
+}
+
+
+static void timer_stop(void)
+{
+	unregister_profile_notifier(&timer_notifier);
+}
+
+
+static struct oprofile_operations timer_ops = {
+	.start	= timer_start,
+	.stop	= timer_stop,
+	.cpu_type = "timer"
+};
+
+ 
+void __init timer_init(struct oprofile_operations ** ops)
+{
+	*ops = &timer_ops;
+	printk(KERN_INFO "oprofile: using timer interrupt.\n");
+}
diff -urN linux-2.5.68-bk11/drivers/pci/pci.ids linux-2.5.68-bk12/drivers/pci/pci.ids
--- linux-2.5.68-bk11/drivers/pci/pci.ids	2003-05-04 04:39:44.000000000 -0700
+++ linux-2.5.68-bk12/drivers/pci/pci.ids	2003-05-04 04:41:05.000000000 -0700
@@ -4815,7 +4815,10 @@
 13be  Miroku Jyoho Service Co. Ltd
 13bf  Sharewave Inc
 13c0  Microgate Corporation
-	0010  SyncLink WAN Adapter
+	0010  SyncLink Adapter v1
+	0020  SyncLink SCC Adapter
+	0030  SyncLink Multiport Adapter
+	0210  SyncLink Adapter v2
 13c1  3ware Inc
 	1000  3ware ATA-RAID
 	1001  3ware 7000-series ATA-RAID
@@ -5456,7 +5459,9 @@
 14f9  AG COMMUNICATIONS
 14fa  WANDEL & GOCHERMANN
 14fb  TRANSAS MARINE (UK) Ltd
-14fc  QUADRICS Supercomputers World
+14fc  Quadrics Ltd
+	0000  QsNet Elan3 Network Adapter
+	0001  QsNetII Elan4 Network Adapter
 14fd  JAPAN Computer Industry Inc
 14fe  ARCHTEK TELECOM Corp
 14ff  TWINHEAD INTERNATIONAL Corp
diff -urN linux-2.5.68-bk11/drivers/video/aty/Makefile linux-2.5.68-bk12/drivers/video/aty/Makefile
--- linux-2.5.68-bk11/drivers/video/aty/Makefile	2003-04-19 19:48:57.000000000 -0700
+++ linux-2.5.68-bk12/drivers/video/aty/Makefile	2003-05-04 04:41:46.000000000 -0700
@@ -4,5 +4,4 @@
 atyfb-y				:= atyfb_base.o mach64_accel.o
 atyfb-$(CONFIG_FB_ATY_GX)	+= mach64_gx.o
 atyfb-$(CONFIG_FB_ATY_CT)	+= mach64_ct.o mach64_cursor.o
-atyfb-$(CONFIG_FB_ATY_XL_INIT)	+= xlinit.o
 atyfb-objs			:= $(atyfb-y)
diff -urN linux-2.5.68-bk11/drivers/video/aty/atyfb.h linux-2.5.68-bk12/drivers/video/aty/atyfb.h
--- linux-2.5.68-bk11/drivers/video/aty/atyfb.h	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk12/drivers/video/aty/atyfb.h	2003-05-04 04:41:46.000000000 -0700
@@ -36,17 +36,13 @@
 	u8 pll_ref_div;
 	u8 pll_gen_cntl;
 	u8 mclk_fb_div;
-	u8 mclk_fb_mult;	/* 2 ro 4 */
-	u8 sclk_fb_div;
 	u8 pll_vclk_cntl;
 	u8 vclk_post_div;
 	u8 vclk_fb_div;
 	u8 pll_ext_cntl;
-	u8 spll_cntl2;
 	u32 dsp_config;		/* Mach64 GTB DSP */
 	u32 dsp_on_off;		/* Mach64 GTB DSP */
 	u8 mclk_post_div_real;
-	u8 xclk_post_div_real;
 	u8 vclk_post_div_real;
 };
 
@@ -79,7 +75,6 @@
 	u32 ref_clk_per;
 	u32 pll_per;
 	u32 mclk_per;
-	u32 xclk_per;
 	u8 bus_type;
 	u8 ram_type;
 	u8 mem_refresh_rate;
@@ -123,7 +118,7 @@
 #define M64F_EXTRA_BRIGHT	0x00020000
 #define M64F_LT_SLEEP		0x00040000
 #define M64F_XL_DLL		0x00080000
-#define M64F_MFB_TIMES_4	0x00100000
+
 
     /*
      *  Register access
@@ -156,33 +151,6 @@
 #endif
 }
 
-static inline u16 aty_ld_le16(int regindex, const struct atyfb_par *par)
-{
-	/* Hack for bloc 1, should be cleanly optimized by compiler */
-	if (regindex >= 0x400)
-		regindex -= 0x800;
-
-#if defined(__mc68000__)
-	return le16_to_cpu(*((volatile u16 *)(par->ati_regbase + regindex)));
-#else
-	return readw(par->ati_regbase + regindex);
-#endif
-}
-
-static inline void aty_st_le16(int regindex, u16 val,
-				const struct atyfb_par *par)
-{
-	/* Hack for bloc 1, should be cleanly optimized by compiler */
-	if (regindex >= 0x400)
-		regindex -= 0x800;
-
-#if defined(__mc68000__)
-	*((volatile u16 *)(par->ati_regbase + regindex)) = cpu_to_le16(val);
-#else
-	writew(val, par->ati_regbase + regindex);
-#endif
-}
-
 static inline u8 aty_ld_8(int regindex, const struct atyfb_par *par)
 {
 	/* Hack for bloc 1, should be cleanly optimized by compiler */
@@ -221,19 +189,6 @@
 }
 
 
-/* 
- * CT Family only.
- */
-static inline void aty_st_pll(int offset, u8 val,
-				const struct atyfb_par *par)
-{
-	/* write addr byte */
-	aty_st_8(CLOCK_CNTL + 1, (offset << 2) | PLL_WR_EN, par);
-	/* write the register value */
-	aty_st_8(CLOCK_CNTL + 2, val, par);
-	aty_st_8(CLOCK_CNTL + 1, (offset << 2) & ~PLL_WR_EN, par); 
-}
-
     /*
      *  DAC operations
      */
diff -urN linux-2.5.68-bk11/drivers/video/aty/atyfb_base.c linux-2.5.68-bk12/drivers/video/aty/atyfb_base.c
--- linux-2.5.68-bk11/drivers/video/aty/atyfb_base.c	2003-05-04 04:39:45.000000000 -0700
+++ linux-2.5.68-bk12/drivers/video/aty/atyfb_base.c	2003-05-04 04:41:46.000000000 -0700
@@ -88,6 +88,7 @@
 #include <asm/backlight.h>
 #endif
 
+
 /*
  * Debug flags.
  */
@@ -98,9 +99,11 @@
 /*  - must be aligned to a PAGE boundary           */
 #define GUI_RESERVE	(1 * PAGE_SIZE)
 
+
 /* FIXME: remove the FAIL definition */
 #define FAIL(x) do { printk(x "\n"); return -EINVAL; } while (0)
 
+
     /*
      *  The Hardware parameters for each card
      */
@@ -145,9 +148,9 @@
 static int atyfb_blank(int blank, struct fb_info *info);
 static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
 		       u_long arg, struct fb_info *info);
-extern void atyfb_fillrect(struct fb_info *info,const struct fb_fillrect *rect);
-extern void atyfb_copyarea(struct fb_info *info,const struct fb_copyarea *area);
-extern void atyfb_imageblit(struct fb_info *info,const struct fb_image *image);
+extern void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
+extern void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
+extern void atyfb_imageblit(struct fb_info *info, const struct fb_image *image);
 #ifdef __sparc__
 static int atyfb_mmap(struct fb_info *info, struct file *file,
 		      struct vm_area_struct *vma);
@@ -159,9 +162,6 @@
      */
 
 static int aty_init(struct fb_info *info, const char *name);
-#ifdef CONFIG_FB_ATY_XL_INIT
-extern int atyfb_xl_init(struct fb_info *info);
-#endif
 #ifdef CONFIG_ATARI
 static int store_video_par(char *videopar, unsigned char m64_num);
 #endif
@@ -214,7 +214,6 @@
 static u32 default_vram __initdata = 0;
 static int default_pll __initdata = 0;
 static int default_mclk __initdata = 0;
-static int default_xclk __initdata = 0;
 
 #ifndef MODULE
 static char *mode_option __initdata = NULL;
@@ -255,8 +254,7 @@
 static char m64n_gtc_pp[] __initdata = "3D RAGE PRO (PQFP, PCI)";
 static char m64n_gtc_ppl[] __initdata =
     "3D RAGE PRO (PQFP, PCI, limited 3D)";
-static char m64n_xl_33[] __initdata = "3D RAGE (XL PCI-33MHz)";
-static char m64n_xl_66[] __initdata = "3D RAGE (XL PCI-66MHz)";
+static char m64n_xl[] __initdata = "3D RAGE (XL)";
 static char m64n_ltp_a[] __initdata = "3D RAGE LT PRO (AGP)";
 static char m64n_ltp_p[] __initdata = "3D RAGE LT PRO (PCI)";
 static char m64n_mob_p[] __initdata = "3D RAGE Mobility (PCI)";
@@ -267,62 +265,129 @@
 	u16 pci_id, chip_type;
 	u8 rev_mask, rev_val;
 	const char *name;
-	int pll, mclk, xclk;
+	int pll, mclk;
 	u32 features;
 } aty_chips[] __initdata = {
 #ifdef CONFIG_FB_ATY_GX
 	/* Mach64 GX */
-	{ 0x4758, 0x00d7, 0x00, 0x00, m64n_gx, 135, 50, 50, M64F_GX },
-	{ 0x4358, 0x0057, 0x00, 0x00, m64n_cx, 135, 50, 50, M64F_GX },
-#endif /* CONFIG_FB_ATY_GX */
-
+	{
+	0x4758, 0x00d7, 0x00, 0x00, m64n_gx, 135, 50, M64F_GX}, {
+	0x4358, 0x0057, 0x00, 0x00, m64n_cx, 135, 50, M64F_GX},
+#endif				/* CONFIG_FB_ATY_GX */
 #ifdef CONFIG_FB_ATY_CT
-	/* Mach64 CT */
-	{ 0x4354, 0x4354, 0x00, 0x00, m64n_ct, 135, 60, 60, M64F_CT | M64F_INTEGRATED | M64F_CT_BUS | M64F_MAGIC_FIFO },
-	{ 0x4554, 0x4554, 0x00, 0x00, m64n_et, 135, 60, 60, M64F_CT | M64F_INTEGRATED | M64F_CT_BUS | M64F_MAGIC_FIFO },
-
-	/* Mach64 VT */
-	{ 0x5654, 0x5654, 0xc7, 0x00, m64n_vta3, 170, 67, 67, M64F_VT | M64F_INTEGRATED | M64F_VT_BUS | M64F_MAGIC_FIFO | M64F_FIFO_24 },
-	{ 0x5654, 0x5654, 0xc7, 0x40, m64n_vta4, 200, 67, 67, M64F_VT | M64F_INTEGRATED | M64F_VT_BUS | M64F_MAGIC_FIFO | M64F_FIFO_24 | M64F_MAGIC_POSTDIV },
-	{ 0x5654, 0x5654, 0x00, 0x00, m64n_vtb, 200, 67, 67, M64F_VT | M64F_INTEGRATED | M64F_VT_BUS | M64F_GTB_DSP | M64F_FIFO_24 }, 
-	{ 0x5655, 0x5655, 0x00, 0x00, m64n_vtb, 200, 67, 67, M64F_VT | M64F_INTEGRATED | M64F_VT_BUS | M64F_GTB_DSP | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL },
-	{ 0x5656, 0x5656, 0x00, 0x00, m64n_vt4, 230, 83, 83, M64F_VT | M64F_INTEGRATED | M64F_GTB_DSP },
-
-	/* Mach64 GT (3D RAGE) */
-	{ 0x4754, 0x4754, 0x07, 0x00, m64n_gt, 135, 63, 63, M64F_GT | M64F_INTEGRATED | M64F_MAGIC_FIFO | M64F_FIFO_24 | M64F_EXTRA_BRIGHT }, 
-	{ 0x4754, 0x4754, 0x07, 0x01, m64n_gt, 170, 67, 67, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-	{ 0x4754, 0x4754, 0x07, 0x02, m64n_gt, 200, 67, 67, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-	{ 0x4755, 0x4755, 0x00, 0x00, m64n_gtb, 200, 67, 67, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-	{ 0x4756, 0x4756, 0x00, 0x00, m64n_iic_p, 230, 83, 83, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-	{ 0x4757, 0x4757, 0x00, 0x00, m64n_iic_a, 230, 83, 83, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-	{ 0x475a, 0x475a, 0x00, 0x00, m64n_iic_a, 230, 83, 83, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-
-	/* Mach64 LT */
-	{ 0x4c54, 0x4c54, 0x00, 0x00, m64n_lt, 135, 63, 63, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP },
-	{ 0x4c47, 0x4c47, 0x00, 0x00, m64n_ltg, 230, 63, 63, M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_LT_SLEEP | M64F_G3_PB_1024x768 },
-
-	/* Mach64 GTC (3D RAGE PRO) */
-	{ 0x4742, 0x4742, 0x00, 0x00, m64n_gtc_ba, 230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-	{ 0x4744, 0x4744, 0x00, 0x00, m64n_gtc_ba1, 230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-	{ 0x4749, 0x4749, 0x00, 0x00, m64n_gtc_bp, 230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_MAGIC_VRAM_SIZE },
-	{ 0x4750, 0x4750, 0x00, 0x00, m64n_gtc_pp, 230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-	{ 0x4751, 0x4751, 0x00, 0x00, m64n_gtc_ppl, 230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT },
-
-	/* 3D RAGE XL PCI-66/BGA */
-	{ 0x474f, 0x474f, 0x00, 0x00, m64n_xl_66, 230, 83, 63, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_XL_DLL | M64F_MFB_TIMES_4 },
-	/* 3D RAGE XL PCI-33/BGA */
-	{ 0x4752, 0x4752, 0x00, 0x00, m64n_xl_33, 230, 83, 63, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_XL_DLL | M64F_MFB_TIMES_4 },
-
-	/* Mach64 LT PRO */
-	{ 0x4c42, 0x4c42, 0x00, 0x00, m64n_ltp_a, 230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP },
-	{ 0x4c44, 0x4c44, 0x00, 0x00, m64n_ltp_p, 230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP },
-	{ 0x4c49, 0x4c49, 0x00, 0x00, m64n_ltp_p, 230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_EXTRA_BRIGHT | M64F_G3_PB_1_1 | M64F_G3_PB_1024x768 },
-	{ 0x4c50, 0x4c50, 0x00, 0x00, m64n_ltp_p, 230, 100, 100, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP },
-
-	/* 3D RAGE Mobility */
-	{ 0x4c4d, 0x4c4d, 0x00, 0x00, m64n_mob_p, 230, 50, 50, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_MOBIL_BUS },
-	{ 0x4c4e, 0x4c4e, 0x00, 0x00, m64n_mob_a, 230, 50, 50, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_MOBIL_BUS },
-#endif /* CONFIG_FB_ATY_CT */
+	    /* Mach64 CT */
+	{
+	0x4354, 0x4354, 0x00, 0x00, m64n_ct, 135, 60,
+		    M64F_CT | M64F_INTEGRATED | M64F_CT_BUS |
+		    M64F_MAGIC_FIFO}, {
+	0x4554, 0x4554, 0x00, 0x00, m64n_et, 135, 60,
+		    M64F_CT | M64F_INTEGRATED | M64F_CT_BUS |
+		    M64F_MAGIC_FIFO},
+	    /* Mach64 VT */
+	{
+	0x5654, 0x5654, 0xc7, 0x00, m64n_vta3, 170, 67,
+		    M64F_VT | M64F_INTEGRATED | M64F_VT_BUS |
+		    M64F_MAGIC_FIFO | M64F_FIFO_24}, {
+	0x5654, 0x5654, 0xc7, 0x40, m64n_vta4, 200, 67,
+		    M64F_VT | M64F_INTEGRATED | M64F_VT_BUS |
+		    M64F_MAGIC_FIFO | M64F_FIFO_24 | M64F_MAGIC_POSTDIV}, {
+	0x5654, 0x5654, 0x00, 0x00, m64n_vtb, 200, 67,
+		    M64F_VT | M64F_INTEGRATED | M64F_VT_BUS |
+		    M64F_GTB_DSP | M64F_FIFO_24}, {
+	0x5655, 0x5655, 0x00, 0x00, m64n_vtb, 200, 67,
+		    M64F_VT | M64F_INTEGRATED | M64F_VT_BUS |
+		    M64F_GTB_DSP | M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL}, {
+	0x5656, 0x5656, 0x00, 0x00, m64n_vt4, 230, 83,
+		    M64F_VT | M64F_INTEGRATED | M64F_GTB_DSP},
+	    /* Mach64 GT (3D RAGE) */
+	{
+	0x4754, 0x4754, 0x07, 0x00, m64n_gt, 135, 63,
+		    M64F_GT | M64F_INTEGRATED | M64F_MAGIC_FIFO |
+		    M64F_FIFO_24 | M64F_EXTRA_BRIGHT}, {
+	0x4754, 0x4754, 0x07, 0x01, m64n_gt, 170, 67,
+		    M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP |
+		    M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT}, {
+	0x4754, 0x4754, 0x07, 0x02, m64n_gt, 200, 67,
+		    M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP |
+		    M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT}, {
+	0x4755, 0x4755, 0x00, 0x00, m64n_gtb, 200, 67,
+		    M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP |
+		    M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT}, {
+	0x4756, 0x4756, 0x00, 0x00, m64n_iic_p, 230, 83,
+		    M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP |
+		    M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT}, {
+	0x4757, 0x4757, 0x00, 0x00, m64n_iic_a, 230, 83,
+		    M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP |
+		    M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT}, {
+	0x475a, 0x475a, 0x00, 0x00, m64n_iic_a, 230, 83,
+		    M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP |
+		    M64F_FIFO_24 | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT},
+	    /* Mach64 LT */
+	{
+	0x4c54, 0x4c54, 0x00, 0x00, m64n_lt, 135, 63,
+		    M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP}, {
+	0x4c47, 0x4c47, 0x00, 0x00, m64n_ltg, 230, 63,
+		    M64F_GT | M64F_INTEGRATED | M64F_GTB_DSP |
+		    M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT |
+		    M64F_LT_SLEEP | M64F_G3_PB_1024x768},
+	    /* Mach64 GTC (3D RAGE PRO) */
+	{
+	0x4742, 0x4742, 0x00, 0x00, m64n_gtc_ba, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT}, {
+	0x4744, 0x4744, 0x00, 0x00, m64n_gtc_ba1, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT}, {
+	0x4749, 0x4749, 0x00, 0x00, m64n_gtc_bp, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT | M64F_MAGIC_VRAM_SIZE}, {
+	0x4750, 0x4750, 0x00, 0x00, m64n_gtc_pp, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT}, {
+	0x4751, 0x4751, 0x00, 0x00, m64n_gtc_ppl, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT},
+	    /* 3D RAGE XL */
+	{
+	0x4752, 0x4752, 0x00, 0x00, m64n_xl, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL |
+		    M64F_EXTRA_BRIGHT | M64F_XL_DLL},
+	    /* Mach64 LT PRO */
+	{
+	0x4c42, 0x4c42, 0x00, 0x00, m64n_ltp_a, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP}, {
+	0x4c44, 0x4c44, 0x00, 0x00, m64n_ltp_p, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP}, {
+	0x4c49, 0x4c49, 0x00, 0x00, m64n_ltp_p, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP | M64F_EXTRA_BRIGHT |
+		    M64F_G3_PB_1_1 | M64F_G3_PB_1024x768}, {
+	0x4c50, 0x4c50, 0x00, 0x00, m64n_ltp_p, 230, 100,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP},
+	    /* 3D RAGE Mobility */
+	{
+	0x4c4d, 0x4c4d, 0x00, 0x00, m64n_mob_p, 230, 50,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP | M64F_MOBIL_BUS}, {
+	0x4c4e, 0x4c4e, 0x00, 0x00, m64n_mob_a, 230, 50,
+		    M64F_GT | M64F_INTEGRATED | M64F_RESET_3D |
+		    M64F_GTB_DSP | M64F_MOBIL_BUS},
+#endif				/* CONFIG_FB_ATY_CT */
 };
 
 static char ram_dram[] __initdata = "DRAM";
@@ -938,10 +1003,7 @@
 	u32 ref_clk_per;
 	u8 pll_ref_div;
 	u8 mclk_fb_div;
-	u8 sclk_fb_div;
 	u8 mclk_post_div;	/* 1,2,3,4,8 */
-	u8 mclk_fb_mult;	/* 2 or 4 */
-	u8 xclk_post_div;	/* 1,2,3,4,8 */
 	u8 vclk_fb_div;
 	u8 vclk_post_div;	/* 1,2,3,4,6,8,12 */
 	u32 dsp_xclks_per_row;	/* 0-16383 */
@@ -989,17 +1051,14 @@
 			clk.ref_clk_per = par->ref_clk_per;
 			clk.pll_ref_div = pll->ct.pll_ref_div;
 			clk.mclk_fb_div = pll->ct.mclk_fb_div;
-			clk.sclk_fb_div = pll->ct.sclk_fb_div;
 			clk.mclk_post_div = pll->ct.mclk_post_div_real;
-			clk.mclk_fb_mult = pll->ct.mclk_fb_mult;
-			clk.xclk_post_div = pll->ct.xclk_post_div_real;
 			clk.vclk_fb_div = pll->ct.vclk_fb_div;
 			clk.vclk_post_div = pll->ct.vclk_post_div_real;
 			clk.dsp_xclks_per_row = dsp_config & 0x3fff;
 			clk.dsp_loop_latency = (dsp_config >> 16) & 0xf;
 			clk.dsp_precision = (dsp_config >> 20) & 7;
-			clk.dsp_off = dsp_on_off & 0x7ff;
-			clk.dsp_on = (dsp_on_off >> 16) & 0x7ff;
+			clk.dsp_on = dsp_on_off & 0x7ff;
+			clk.dsp_off = (dsp_on_off >> 16) & 0x7ff;
 			if (copy_to_user
 			    ((struct atyclk *) arg, &clk, sizeof(clk)))
 				return -EFAULT;
@@ -1016,18 +1075,19 @@
 			par->ref_clk_per = clk.ref_clk_per;
 			pll->ct.pll_ref_div = clk.pll_ref_div;
 			pll->ct.mclk_fb_div = clk.mclk_fb_div;
-			pll->ct.sclk_fb_div = clk.sclk_fb_div;
 			pll->ct.mclk_post_div_real = clk.mclk_post_div;
-			pll->ct.mclk_fb_mult = clk.mclk_fb_mult;
-			pll->ct.xclk_post_div_real = clk.xclk_post_div;
 			pll->ct.vclk_fb_div = clk.vclk_fb_div;
 			pll->ct.vclk_post_div_real = clk.vclk_post_div;
-			pll->ct.dsp_config = (clk.dsp_xclks_per_row & 0x3fff) |
-					     ((clk.dsp_loop_latency & 0xf)<<16)|
-					     ((clk.dsp_precision & 7)<<20);
+			pll->ct.dsp_config =
+			    (clk.
+			     dsp_xclks_per_row & 0x3fff) | ((clk.
+							     dsp_loop_latency
+							     & 0xf) << 16)
 			    | ((clk.dsp_precision & 7) << 20);
-			pll->ct.dsp_on_off = (clk.dsp_off & 0x7ff) |
-					     ((clk.dsp_on & 0x7ff)<<16);
+			pll->ct.dsp_on_off =
+			    (clk.
+			     dsp_on & 0x7ff) | ((clk.
+						 dsp_off & 0x7ff) << 16);
 			aty_calc_pll_ct(info, &pll->ct);
 			aty_set_pll_ct(info, pll);
 		} else
@@ -1192,6 +1252,8 @@
 }
 #endif				/* __sparc__ */
 
+
+
 #ifdef CONFIG_PMAC_PBOOK
 
 static struct fb_info *first_display = NULL;
@@ -1432,32 +1494,7 @@
 };
 #endif				/* CONFIG_PMAC_BACKLIGHT */
 
-static void __init aty_calc_mem_refresh(struct atyfb_par *par, u16 id, int xclk)
-{
-	const int ragepro_tbl[] = {
-		44, 50, 55, 66, 75, 80, 100
-	};
-	const int ragexl_tbl[] = {
-		50, 66, 75, 83, 90, 95, 100, 105,
-		110, 115, 120, 125, 133, 143, 166
-	};
-	const int *refresh_tbl;
-	int i, size;
-
-	if (IS_XL(id)) {
-		refresh_tbl = ragexl_tbl;
-		size = sizeof(ragexl_tbl)/sizeof(int);
-	} else {
-		refresh_tbl = ragepro_tbl;
-		size = sizeof(ragepro_tbl)/sizeof(int);
-	}
 
-	for (i=0; i < size; i++) {
-		if (xclk < refresh_tbl[i])
-		break;
-	}
-	par->mem_refresh_rate = i;
-}
 
     /*
      *  Initialisation
@@ -1469,14 +1506,15 @@
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
 	const char *chipname = NULL, *ramname = NULL, *xtal;
-	int pll, mclk, xclk, gtb_memsize, j;
+	int j, pll, mclk, gtb_memsize;
 	struct fb_var_screeninfo var;
-	u8 pll_ref_div, rev;
 	u32 chip_id, i;
+	u16 type;
+	u8 rev;
 #if defined(CONFIG_PPC)
 	int sense;
 #endif
-	u16 type;
+	u8 pll_ref_div;
 
 	par->aty_cmap_regs =
 	    (struct aty_cmap_regs *) (par->ati_regbase + 0xc0);
@@ -1490,7 +1528,6 @@
 			chipname = aty_chips[j].name;
 			pll = aty_chips[j].pll;
 			mclk = aty_chips[j].mclk;
-			xclk = aty_chips[j].xclk;
 			par->features = aty_chips[j].features;
 			goto found;
 		}
@@ -1567,38 +1604,17 @@
 #endif				/* CONFIG_FB_ATY_GX */
 #ifdef CONFIG_FB_ATY_CT
 	if (M64_HAS(INTEGRATED)) {
+		par->bus_type = PCI;
+		par->ram_type = (aty_ld_le32(CONFIG_STAT0, par) & 0x07);
+		ramname = aty_ct_ram[par->ram_type];
+		par->dac_ops = &aty_dac_ct;
+		par->pll_ops = &aty_pll_ct;
 		/* for many chips, the mclk is 67 MHz for SDRAM, 63 MHz otherwise */
 		if (mclk == 67 && par->ram_type < SDRAM)
 			mclk = 63;
 	}
 #endif				/* CONFIG_FB_ATY_CT */
 
-	if (default_pll)
-		pll = default_pll;
-	if (default_mclk)
-		mclk = default_mclk;
-	if (default_xclk)
-		xclk = default_xclk;
-
-	aty_calc_mem_refresh(par, type, xclk);
-	par->pll_per = 1000000/pll;
-	par->mclk_per = 1000000/mclk;
-	par->xclk_per = 1000000/xclk;
-
-#ifdef CONFIG_FB_ATY_CT
-	if (M64_HAS(INTEGRATED)) {
-		par->dac_ops = &aty_dac_ct;
-		par->pll_ops = &aty_pll_ct;
-		par->bus_type = PCI;
-#ifdef CONFIG_FB_ATY_XL_INIT
-		if (IS_XL(type))
-			atyfb_xl_init(info);
-#endif
-		par->ram_type = (aty_ld_le32(CONFIG_STAT0, par) & 0x07);
-		ramname = aty_ct_ram[par->ram_type];
-	}
-#endif /* CONFIG_FB_ATY_CT */
-
 	par->ref_clk_per = 1000000000000ULL / 14318180;
 	xtal = "14.31818";
 	if (M64_HAS(GTB_DSP)
@@ -1708,10 +1724,35 @@
 		info->fix.accel = FB_ACCEL_ATI_MACH64GT;
 	}
 
-	printk("%d%c %s, %s MHz XTAL, %d MHz PLL, %d Mhz MCLK, %d MHz XCLK\n",
-	       info->fix.smem_len == 0x80000 ? 512 : (info->fix.smem_len >> 20),
-	       info->fix.smem_len == 0x80000 ? 'K' : 'M', ramname, xtal, pll,
-	       mclk, xclk);
+	if (default_pll)
+		pll = default_pll;
+	if (default_mclk)
+		mclk = default_mclk;
+
+	printk("%d%c %s, %s MHz XTAL, %d MHz PLL, %d Mhz MCLK\n",
+	       info->fix.smem_len ==
+	       0x80000 ? 512 : (info->fix.smem_len >> 20),
+	       info->fix.smem_len == 0x80000 ? 'K' : 'M', ramname,
+	       xtal, pll, mclk);
+
+	if (mclk < 44)
+		par->mem_refresh_rate = 0;	/* 000 = 10 Mhz - 43 Mhz */
+	else if (mclk < 50)
+		par->mem_refresh_rate = 1;	/* 001 = 44 Mhz - 49 Mhz */
+	else if (mclk < 55)
+		par->mem_refresh_rate = 2;	/* 010 = 50 Mhz - 54 Mhz */
+	else if (mclk < 66)
+		par->mem_refresh_rate = 3;	/* 011 = 55 Mhz - 65 Mhz */
+	else if (mclk < 75)
+		par->mem_refresh_rate = 4;	/* 100 = 66 Mhz - 74 Mhz */
+	else if (mclk < 80)
+		par->mem_refresh_rate = 5;	/* 101 = 75 Mhz - 79 Mhz */
+	else if (mclk < 100)
+		par->mem_refresh_rate = 6;	/* 110 = 80 Mhz - 100 Mhz */
+	else
+		par->mem_refresh_rate = 7;	/* 111 = 100 Mhz and above */
+	par->pll_per = 1000000 / pll;
+	par->mclk_per = 1000000 / mclk;
 
 #ifdef DEBUG
 	if (M64_HAS(INTEGRATED)) {
@@ -2037,7 +2078,7 @@
 				j++;
 			}
 
-			if (!IS_XL(pdev->device)) {
+			if (pdev->device != XL_CHIP_ID) {
 				/*
 				 * Fix PROMs idea of MEM_CNTL settings...
 				 */
@@ -2163,7 +2204,7 @@
 				 *
 				 * where R is XTALIN (= 14318 or 29498 kHz).
 				 */
-				if (IS_XL(pdev->device))
+				if (pdev->device == XL_CHIP_ID)
 					R = 29498;
 				else
 					R = 14318;
@@ -2277,25 +2318,15 @@
 			return -ENOMEM;
 		}
 		memset(info, 0, sizeof(struct fb_info));
-
-		default_par = kmalloc(sizeof(struct atyfb_par), GFP_ATOMIC);
-		if (!default_par) {
-			printk
-			    ("atyfb_init: can't alloc atyfb_par\n");
-			kfree(info);
-			return -ENXIO;
-		}
-		memset(default_par, 0, sizeof(struct atyfb_par));
-
-		info->fix = atyfb_fix;
+		info->fix = atyfb_fix;		
 
 		/*
 		 *  Map the video memory (physical address given) to somewhere in the
 		 *  kernel address space.
 		 */
-		info->screen_base = ioremap(phys_vmembase[m64_num],
+		info->screen_base = (unsigned long)ioremap(phys_vmembase[m64_num],
 					 		   phys_size[m64_num]);	
-		info->fix.smem_start = (unsigned long)info->screen_base;	/* Fake! */
+		info->fix.smem_start = info->screen_base;	/* Fake! */
 		default_par->ati_regbase = (unsigned long)ioremap(phys_guiregbase[m64_num],
 							  0x10000) + 0xFC00ul;
 		info->fix.mmio_start = default_par->ati_regbase; /* Fake! */
@@ -2342,13 +2373,14 @@
 		} else if (!strncmp(this_opt, "noaccel", 7)) {
 			noaccel = 1;
 		} else if (!strncmp(this_opt, "vram:", 5))
-			default_vram = simple_strtoul(this_opt + 5, NULL, 0);
+			default_vram =
+			    simple_strtoul(this_opt + 5, NULL, 0);
 		else if (!strncmp(this_opt, "pll:", 4))
-			default_pll = simple_strtoul(this_opt + 4, NULL, 0);
+			default_pll =
+			    simple_strtoul(this_opt + 4, NULL, 0);
 		else if (!strncmp(this_opt, "mclk:", 5))
-			default_mclk = simple_strtoul(this_opt + 5, NULL, 0); 
-		else if (!strncmp(this_opt, "xclk:", 5))
-			default_xclk = simple_strtoul(this_opt+5, NULL, 0);
+			default_mclk =
+			    simple_strtoul(this_opt + 5, NULL, 0);
 #ifdef CONFIG_PPC
 		else if (!strncmp(this_opt, "vmode:", 6)) {
 			unsigned int vmode =
diff -urN linux-2.5.68-bk11/drivers/video/aty/mach64_ct.c linux-2.5.68-bk12/drivers/video/aty/mach64_ct.c
--- linux-2.5.68-bk11/drivers/video/aty/mach64_ct.c	2003-04-19 19:48:46.000000000 -0700
+++ linux-2.5.68-bk12/drivers/video/aty/mach64_ct.c	2003-05-04 04:41:46.000000000 -0700
@@ -4,47 +4,58 @@
  */
 
 #include <linux/fb.h>
-#include <linux/delay.h>
+
 #include <asm/io.h>
+
 #include <video/mach64.h>
 #include "atyfb.h"
 
-#undef DEBUG
 
+/* FIXME: remove the FAIL definition */
+#define FAIL(x) do { printk(x "\n"); return -EINVAL; } while (0)
+
+static void aty_st_pll(int offset, u8 val, const struct atyfb_par *par);
 static int aty_valid_pll_ct(const struct fb_info *info, u32 vclk_per,
 			    struct pll_ct *pll);
-static int aty_dsp_gt(const struct fb_info *info, u32 bpp,
+static int aty_dsp_gt(const struct fb_info *info, u8 bpp,
 		      struct pll_ct *pll);
 static int aty_var_to_pll_ct(const struct fb_info *info, u32 vclk_per,
 			     u8 bpp, union aty_pll *pll);
 static u32 aty_pll_ct_to_var(const struct fb_info *info,
 			     const union aty_pll *pll);
 
+
+
+static void aty_st_pll(int offset, u8 val, const struct atyfb_par *par)
+{
+	/* write addr byte */
+	aty_st_8(CLOCK_CNTL + 1, (offset << 2) | PLL_WR_EN, par);
+	/* write the register value */
+	aty_st_8(CLOCK_CNTL + 2, val, par);
+	aty_st_8(CLOCK_CNTL + 1, (offset << 2) & ~PLL_WR_EN, par);
+}
+
+
 /* ------------------------------------------------------------------------- */
 
     /*
      *  PLL programming (Mach64 CT family)
      */
 
-static int aty_dsp_gt(const struct fb_info *info, u32 bpp,
+static int aty_dsp_gt(const struct fb_info *info, u8 bpp,
 		      struct pll_ct *pll)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
-	u32 dsp_xclks_per_row, dsp_loop_latency, dsp_precision, dsp_off, dsp_on;
-	u32 xclks_per_row, fifo_off, fifo_on, y, fifo_size;
-	u32 memcntl, n, t_pfc, t_rp, t_ras, t_rcd, t_crd, t_rcc, t_lat;
-
-#ifdef DEBUG
-	printk(__FUNCTION__ ": mclk_fb_mult=%d\n", pll->mclk_fb_mult);
-#endif
-	
-	/* (64*xclk/vclk/bpp)<<11 = xclocks_per_row<<11 */
-	xclks_per_row = ((u32)pll->mclk_fb_mult * (u32)pll->mclk_fb_div *
-			 (u32)pll->vclk_post_div_real * 64) << 11;
-	xclks_per_row /=
-		(2 * (u32)pll->vclk_fb_div * (u32)pll->xclk_post_div_real * bpp);	
+	u32 dsp_xclks_per_row, dsp_loop_latency, dsp_precision, dsp_off,
+	    dsp_on;
+	u32 xclks_per_row, fifo_off, fifo_on, y, fifo_size, page_size;
+
+	/* xclocks_per_row<<11 */
+	xclks_per_row =
+	    (pll->mclk_fb_div * pll->vclk_post_div_real * 64 << 11) /
+	    (pll->vclk_fb_div * pll->mclk_post_div_real * bpp);
 	if (xclks_per_row < (1 << 11))
-		printk("Dotclock too high\n");
+		FAIL("Dotclock to high");
 	if (M64_HAS(FIFO_24)) {
 		fifo_size = 24;
 		dsp_loop_latency = 0;
@@ -59,53 +70,36 @@
 		dsp_precision++;
 	}
 	dsp_precision -= 5;
-
 	/* fifo_off<<6 */
-	fifo_off = ((xclks_per_row * (fifo_size - 1)) >> 5); // + (3 << 6);
+	fifo_off = ((xclks_per_row * (fifo_size - 1)) >> 5) + (3 << 6);
 
 	if (info->fix.smem_len > 1 * 1024 * 1024) {
-		switch (par->ram_type) {
-		case WRAM:
-			/* >1 MB SDRAM */
-			dsp_loop_latency += 9;
-			n = 4;
-			break;
-		case SDRAM:	
-		case SGRAM:
+		if (par->ram_type >= SDRAM) {
 			/* >1 MB SDRAM */
 			dsp_loop_latency += 8;
-			n = 2;
-			break;
-		default:
+			page_size = 8;
+		} else {
 			/* >1 MB DRAM */
 			dsp_loop_latency += 6;
-			n = 3;
-			break;
+			page_size = 9;
 		}
 	} else {
 		if (par->ram_type >= SDRAM) {
 			/* <2 MB SDRAM */
 			dsp_loop_latency += 9;
-			n = 2;
+			page_size = 10;
 		} else {
 			/* <2 MB DRAM */
 			dsp_loop_latency += 8;
-			n = 3;
+			page_size = 10;
 		}
 	}
-
-	memcntl = aty_ld_le32(MEM_CNTL, par);
-	t_rcd = ((memcntl >> 10) & 0x03) + 1;
-	t_crd = ((memcntl >> 12) & 0x01);
-	t_rp  = ((memcntl >>  8) & 0x03) + 1;
-	t_ras = ((memcntl >> 16) & 0x07) + 1;
-	t_lat =  (memcntl >>  4) & 0x03;
-
-	t_pfc = t_rp + t_rcd + t_crd;
-	t_rcc = max(t_rp + t_ras, t_pfc + n);
-
 	/* fifo_on<<6 */
-	fifo_on = (2 * t_rcc + t_pfc + n - 1) << 6;
+	if (xclks_per_row >= (page_size << 11))
+		fifo_on =
+		    ((2 * page_size + 1) << 6) + (xclks_per_row >> 5);
+	else
+		fifo_on = (3 * page_size + 2) << 6;
 
 	dsp_xclks_per_row = xclks_per_row >> dsp_precision;
 	dsp_on = fifo_on >> dsp_precision;
@@ -113,7 +107,7 @@
 
 	pll->dsp_config = (dsp_xclks_per_row & 0x3fff) |
 	    ((dsp_loop_latency & 0xf) << 16) | ((dsp_precision & 7) << 20);
-	pll->dsp_on_off = (dsp_off & 0x7ff) | ((dsp_on & 0x7ff) << 16);
+	pll->dsp_on_off = (dsp_on & 0x7ff) | ((dsp_off & 0x7ff) << 16);
 	return 0;
 }
 
@@ -121,21 +115,15 @@
 			    struct pll_ct *pll)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
-#ifdef DEBUG
-	int pllmclk, pllsclk;
-#endif
 	u32 q, x;		/* x is a workaround for sparc64-linux-gcc */
 	x = x;			/* x is a workaround for sparc64-linux-gcc */
 
 	pll->pll_ref_div = par->pll_per * 2 * 255 / par->ref_clk_per;
 
-	/* FIXME: use the VTB/GTB /3 post divider if it's better suited.
-	 *        Actually 8*q
-         */
-	q = par->ref_clk_per * pll->pll_ref_div * 4 / par->mclk_per;
-
+	/* FIXME: use the VTB/GTB /3 post divider if it's better suited */
+	q = par->ref_clk_per * pll->pll_ref_div * 4 / par->mclk_per;	/* actually 8*q */
 	if (q < 16 * 8 || q > 255 * 8)
-		printk(KERN_DEBUG "atyfb: mclk out of range");
+		FAIL("mclk out of range");
 	else if (q < 32 * 8)
 		pll->mclk_post_div_real = 8;
 	else if (q < 64 * 8)
@@ -145,44 +133,11 @@
 	else
 		pll->mclk_post_div_real = 1;
 	pll->mclk_fb_div = q * pll->mclk_post_div_real / 8;
-	pll->sclk_fb_div = q*pll->mclk_post_div_real/8;
-	
-#ifdef DEBUG
-	pllsclk = (1000000 * 2 * pll->sclk_fb_div) /
-			(par->ref_clk_per * pll->pll_ref_div);
-	printk(__FUNCTION__ ": pllsclk=%d MHz, mclk=%d MHz\n",
-		pllsclk, pllsclk / pll->mclk_post_div_real);
-#endif
-
-	pll->mclk_fb_mult = M64_HAS(MFB_TIMES_4) ? 4 : 2;
-
-	/* actually 8*q */
-	q = par->ref_clk_per * pll->pll_ref_div * 8 /
-		(pll->mclk_fb_mult * par->xclk_per);
-
-	if (q < 16*8 || q > 255*8)
-		printk(KERN_DEBUG "mclk out of range");
-	else if (q < 32*8)
-		pll->xclk_post_div_real = 8;
-	else if (q < 64*8)
-		pll->xclk_post_div_real = 4;
-	else if (q < 128*8)
-		pll->xclk_post_div_real = 2;
-	else
-		pll->xclk_post_div_real = 1;
-	pll->mclk_fb_div = q*pll->xclk_post_div_real/8;
-
-#ifdef DEBUG
-	pllmclk = (1000000 * pll->mclk_fb_mult * pll->mclk_fb_div) /
-			(par->ref_clk_per * pll->pll_ref_div);
-	printk(__FUNCTION__ ": pllmclk=%d MHz, xclk=%d MHz\n",
-			pllmclk, pllmclk / pll->xclk_post_div_real);
-#endif
 
 	/* FIXME: use the VTB/GTB /{3,6,12} post dividers if they're better suited */
 	q = par->ref_clk_per * pll->pll_ref_div * 4 / vclk_per;	/* actually 8*q */
 	if (q < 16 * 8 || q > 255 * 8)
-		printk(KERN_DEBUG "vclk out of range");
+		FAIL("vclk out of range");
 	else if (q < 32 * 8)
 		pll->vclk_post_div_real = 8;
 	else if (q < 64 * 8)
@@ -198,14 +153,13 @@
 void aty_calc_pll_ct(const struct fb_info *info, struct pll_ct *pll)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
-	u8 xpostdiv = 0;
 	u8 mpostdiv = 0;
 	u8 vpostdiv = 0;
 
 	if (M64_HAS(SDRAM_MAGIC_PLL) && (par->ram_type >= SDRAM))
-		pll->pll_gen_cntl = 0x64;	/* mclk = sclk */
+		pll->pll_gen_cntl = 0x04;
 	else
-		pll->pll_gen_cntl = 0xe4;	/* mclk = sclk */
+		pll->pll_gen_cntl = 0x84;
 
 	switch (pll->mclk_post_div_real) {
 	case 1:
@@ -214,6 +168,9 @@
 	case 2:
 		mpostdiv = 1;
 		break;
+	case 3:
+		mpostdiv = 4;
+		break;
 	case 4:
 		mpostdiv = 2;
 		break;
@@ -221,33 +178,12 @@
 		mpostdiv = 3;
 		break;
 	}
-	pll->spll_cntl2 = mpostdiv << 4; /* sclk == pllsclk / mpostdiv */	
-
-	switch (pll->xclk_post_div_real) {
-		case 1:
-			xpostdiv = 0;
-			break;
-		case 2:
-			xpostdiv = 1;
-			break;
-		case 3:
-			xpostdiv = 4;
-			break;
-		case 4:
-			xpostdiv = 2;
-			break;
-		case 8:
-			xpostdiv = 3;
-			break;
-	}
+	pll->pll_gen_cntl |= mpostdiv << 4;	/* mclk */
 
 	if (M64_HAS(MAGIC_POSTDIV))
 		pll->pll_ext_cntl = 0;
 	else
-		pll->pll_ext_cntl = mpostdiv;	/* xclk == pllmclk / xpostdiv */
-
-	if (pll->mclk_fb_mult == 4)
-		pll->pll_ext_cntl |= 0x08;
+		pll->pll_ext_cntl = mpostdiv;	/* xclk == mclk */
 
 	switch (pll->vclk_post_div_real) {
 	case 2:
@@ -305,53 +241,25 @@
 		    const union aty_pll *pll)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
-#ifdef DEBUG
-	printk(__FUNCTION__ ": about to program:\n"
-		"refdiv=%d, extcntl=0x%02x, mfbdiv=%d\n"
-		"spllcntl2=0x%02x, sfbdiv=%d, gencntl=0x%02x\n"
-		"vclkcntl=0x%02x, vpostdiv=0x%02x, vfbdiv=%d\n"
-		"clocksel=%d\n",
-		pll->ct.pll_ref_div, pll->ct.pll_ext_cntl,
-		pll->ct.mclk_fb_div, pll->ct.spll_cntl2,
-		pll->ct.sclk_fb_div, pll->ct.pll_gen_cntl,
-		pll->ct.pll_vclk_cntl, pll->ct.vclk_post_div,
-		pll->ct.vclk_fb_div, aty_ld_le32(CLOCK_CNTL, info) & 0x03);
-#endif
-	aty_st_pll(PLL_REF_DIV, pll->ct.pll_ref_div, par);
-
-	aty_st_pll(PLL_EXT_CNTL, pll->ct.pll_ext_cntl, par);
-	aty_st_pll(MCLK_FB_DIV, pll->ct.mclk_fb_div, par); // for XCLK
-
-	aty_st_pll(SPLL_CNTL2, pll->ct.spll_cntl2, par);
-	aty_st_pll(SCLK_FB_DIV, pll->ct.sclk_fb_div, par); // for MCLK
 
+	aty_st_pll(PLL_REF_DIV, pll->ct.pll_ref_div, par);
 	aty_st_pll(PLL_GEN_CNTL, pll->ct.pll_gen_cntl, par);
-	
-	aty_st_pll(EXT_VPLL_CNTL, 0, par);
+	aty_st_pll(MCLK_FB_DIV, pll->ct.mclk_fb_div, par);
 	aty_st_pll(PLL_VCLK_CNTL, pll->ct.pll_vclk_cntl, par);
 	aty_st_pll(VCLK_POST_DIV, pll->ct.vclk_post_div, par);
 	aty_st_pll(VCLK0_FB_DIV, pll->ct.vclk_fb_div, par);
+	aty_st_pll(PLL_EXT_CNTL, pll->ct.pll_ext_cntl, par);
 
 	if (M64_HAS(GTB_DSP)) {
-		u8 dll_cntl;
-
 		if (M64_HAS(XL_DLL))
-			dll_cntl = 0x80;
+			aty_st_pll(DLL_CNTL, 0x80, par);
 		else if (par->ram_type >= SDRAM)
-			dll_cntl = 0xa6;
+			aty_st_pll(DLL_CNTL, 0xa6, par);
 		else
-			dll_cntl = 0xa0;
-		aty_st_pll(DLL_CNTL, dll_cntl, par);
+			aty_st_pll(DLL_CNTL, 0xa0, par);
 		aty_st_pll(VFC_CNTL, 0x1b, par);
 		aty_st_le32(DSP_CONFIG, pll->ct.dsp_config, par);
 		aty_st_le32(DSP_ON_OFF, pll->ct.dsp_on_off, par);
-
-		mdelay(10);
-		aty_st_pll(DLL_CNTL, dll_cntl, par);
-		mdelay(10);
-		aty_st_pll(DLL_CNTL, dll_cntl | 0x40, par);
-		mdelay(10);
-		aty_st_pll(DLL_CNTL, dll_cntl & ~0x40, par);
 	}
 }
 
diff -urN linux-2.5.68-bk11/drivers/video/aty/mach64_cursor.c linux-2.5.68-bk12/drivers/video/aty/mach64_cursor.c
--- linux-2.5.68-bk11/drivers/video/aty/mach64_cursor.c	2003-04-19 19:51:10.000000000 -0700
+++ linux-2.5.68-bk12/drivers/video/aty/mach64_cursor.c	2003-05-04 04:41:46.000000000 -0700
@@ -135,10 +135,6 @@
 			yoff = 0;
 		}
 
-		/* In doublescan mode, the cursor location also needs to be
-		   doubled. */
-                if (par->crtc.gen_cntl & CRTC_DBL_SCAN_EN)
-			y<<=1;
 		wait_for_fifo(4, par);
 		aty_st_le32(CUR_OFFSET, (info->fix.smem_len >> 3) + (yoff << 1),
 			    par);
@@ -168,7 +164,7 @@
 
 #ifdef __sparc__
 	if (par->mmaped)
-		return;
+		return 0;
 #endif
 
 	aty_set_cursor(info);
@@ -192,7 +188,7 @@
 	info->fix.smem_len -= PAGE_SIZE;
 
 #ifdef __sparc__
-	addr = info->screen_base - 0x800000 + info->fix.smem_len;
+	addr = (unsigned long) info->screen_base - 0x800000 + info->fix.smem_len;
 	cursor->ram = (u8 *) addr;
 #else
 #ifdef __BIG_ENDIAN
diff -urN linux-2.5.68-bk11/drivers/video/aty/mach64_gx.c linux-2.5.68-bk12/drivers/video/aty/mach64_gx.c
--- linux-2.5.68-bk11/drivers/video/aty/mach64_gx.c	2003-05-04 04:39:45.000000000 -0700
+++ linux-2.5.68-bk12/drivers/video/aty/mach64_gx.c	2003-05-04 04:41:46.000000000 -0700
@@ -1,9 +1,11 @@
+
 /*
  *  ATI Mach64 GX Support
  */
 
 #include <linux/delay.h>
 #include <linux/fb.h>
+#include <linux/sched.h>
 
 #include <asm/io.h>
 
@@ -337,8 +339,8 @@
      *  ATI 18818 / ICS 2595 Clock Chip
      */
 
-static int aty_var_to_pll_18818(const struct fb_info *info, u32 vclk_per,
-				u8 bpp, union aty_pll *pll)
+static int aty_var_to_pll_18818(const struct fb_info *info,
+				u32 vclk_per, u8 bpp, union aty_pll *pll)
 {
 	u32 MHz100;		/* in 0.01 MHz */
 	u32 program_bits;
@@ -493,7 +495,7 @@
      *  STG 1703 Clock Chip
      */
 
-static int aty_var_to_pll_1703(const struct fb_info *info, u32 vclk_per,
+static int aty_var_to_pll_1703(const struct fb_info *info,
 			       u32 vclk_per, u8 bpp, union aty_pll *pll)
 {
 	u32 mhz100;		/* in 0.01 MHz */
@@ -609,7 +611,7 @@
      *  Chrontel 8398 Clock Chip
      */
 
-static int aty_var_to_pll_8398(const struct fb_info *info, u32 vclk_per,
+static int aty_var_to_pll_8398(const struct fb_info *info,
 			       u32 vclk_per, u8 bpp, union aty_pll *pll)
 {
 	u32 tempA, tempB, fOut, longMHz100, diff, preDiff;
diff -urN linux-2.5.68-bk11/drivers/video/cfbimgblt.c linux-2.5.68-bk12/drivers/video/cfbimgblt.c
--- linux-2.5.68-bk11/drivers/video/cfbimgblt.c	2003-04-19 19:49:54.000000000 -0700
+++ linux-2.5.68-bk12/drivers/video/cfbimgblt.c	2003-05-04 04:41:46.000000000 -0700
@@ -73,8 +73,11 @@
 	0x00000000, 0xffffffff
 };
 
+#define FB_WRITEL fb_writel
+#define FB_READL  fb_readl
+
 #if defined (__BIG_ENDIAN)
-#define LEFT_POS(bpp)          (BITS_PER_LONG - bpp)
+#define LEFT_POS(bpp)          (32 - bpp)
 #define SHIFT_HIGH(val, bits)  ((val) >> (bits))
 #define SHIFT_LOW(val, bits)   ((val) << (bits))
 #else
@@ -83,47 +86,27 @@
 #define SHIFT_LOW(val, bits)   ((val) >> (bits))
 #endif
 
-#if BITS_PER_LONG == 32
-#define FB_WRITEL	fb_writel
-#define FB_READL	fb_readl
-#define INIT_FASTPATH	{}
-#define FASTPATH	fb_writel((end_mask & eorx)^bgx, dst++)
-#else
-#define FB_WRITEL	fb_writeq
-#define FB_READL	fb_readq
-#define INIT_FASTPATH	unsigned long val = 0, bpl = 0
-#define FASTPATH {					\
-	val |= SHIFT_HIGH((end_mask & eorx)^bgx, bpl);	\
-	bpl += 32;					\
-	bpl &= BITS_PER_LONG - 1;			\
-	if (!bpl) {					\
-		FB_WRITEL(val, dst++);			\
-		val = 0;				\
-	}						\
-}
-#endif
-
 static inline void color_imageblit(const struct fb_image *image, 
 				   struct fb_info *p, u8 *dst1, 
-				   unsigned long start_index,
-				   unsigned long pitch_index)
+				   u32 start_index,
+				   u32 pitch_index)
 {
 	/* Draw the penguin */
-	unsigned long *dst, *dst2, color = 0, val, shift;
+	u32 *dst, *dst2, color = 0, val, shift;
 	int i, n, bpp = p->var.bits_per_pixel;
-	unsigned long null_bits = BITS_PER_LONG - bpp;
+	u32 null_bits = 32 - bpp;
 	u32 *palette = (u32 *) p->pseudo_palette;
-	u8 *src = (u8 *) image->data;
+	const u8 *src = image->data;
 
-	dst2 = (unsigned long *) dst1;
+	dst2 = (u32 *) dst1;
 	for (i = image->height; i--; ) {
-		dst = (unsigned long *) dst1;
 		n = image->width;
-		shift = val = 0;
+		dst = (u32 *) dst1;
+		shift = 0;
+		val = 0;
 		
 		if (start_index) {
-			unsigned long start_mask = ~(SHIFT_HIGH(~0UL,
-								start_index));
+			u32 start_mask = ~(SHIFT_HIGH(~(u32)0, start_index));
 			val = FB_READL(dst) & start_mask;
 			shift = start_index;
 		}
@@ -139,14 +122,14 @@
 				FB_WRITEL(val, dst++);
 	
 				val = (shift == null_bits) ? 0 : 
-					SHIFT_LOW(color,BITS_PER_LONG - shift);
+					SHIFT_LOW(color, 32 - shift);
 			}
 			shift += bpp;
-			shift &= (BITS_PER_LONG - 1);
+			shift &= (32 - 1);
 			src++;
 		}
 		if (shift) {
-			unsigned long  end_mask = SHIFT_HIGH(~0UL, shift);
+			u32 end_mask = SHIFT_HIGH(~(u32)0, shift);
 
 			FB_WRITEL((FB_READL(dst) & end_mask) | val, dst);
 		}
@@ -154,41 +137,39 @@
 		if (pitch_index) {
 			dst2 += p->fix.line_length;
 			dst1 = (char *) dst2;
-			(unsigned long) dst1 &= ~(sizeof(unsigned long) - 1);
+			(unsigned long) dst1 &= ~(sizeof(u32) - 1);
 
 			start_index += pitch_index;
-			start_index &= BITS_PER_LONG - 1;
+			start_index &= 32 - 1;
 		}
 	}
 }
 
-static inline void slow_imageblit(const struct fb_image *image, 
-				  struct fb_info *p, u8 *dst1, 
-				  unsigned long fgcolor,
-				  unsigned long bgcolor, 
-				  unsigned long start_index,
-				  unsigned long pitch_index)
+static inline void slow_imageblit(const struct fb_image *image, struct fb_info *p, 
+				  u8 *dst1, u32 fgcolor,
+				  u32 bgcolor, 
+				  u32 start_index,
+				  u32 pitch_index)
 {
-	unsigned long shift, color = 0, bpp = p->var.bits_per_pixel;
-	unsigned long *dst, *dst2, val, pitch = p->fix.line_length;
-	unsigned long null_bits = BITS_PER_LONG - bpp;
-	unsigned long spitch = (image->width+7)/8;
-	const char *src = image->data, *s;
-	unsigned long i, j, l;
+	u32 shift, color = 0, bpp = p->var.bits_per_pixel;
+	u32 *dst, *dst2, val, pitch = p->fix.line_length;
+	u32 null_bits = 32 - bpp;
+	u32 spitch = (image->width+7)/8;
+	const u8 *src = image->data, *s;
+	u32 i, j, l;
 	
-	dst2 = (unsigned long *) dst1;
+	dst2 = (u32 *) dst1;
 
 	for (i = image->height; i--; ) {
-		dst = (unsigned long *) dst1;
-		j = image->width;
 		shift = val = 0;
-		s = src;
 		l = 8;
+		j = image->width;
+		dst = (u32 *) dst1;
+		s = src;
 
 		/* write leading bits */
 		if (start_index) {
-			unsigned long start_mask = ~(SHIFT_HIGH(~0UL,
-								start_index));
+			u32 start_mask = ~(SHIFT_HIGH(~(u32)0, start_index));
 			val = FB_READL(dst) & start_mask;
 			shift = start_index;
 		}
@@ -203,16 +184,16 @@
 			if (shift >= null_bits) {
 				FB_WRITEL(val, dst++);
 				val = (shift == null_bits) ? 0 :
-					 SHIFT_LOW(color,BITS_PER_LONG - shift);
+					 SHIFT_LOW(color,32 - shift);
 			}
 			shift += bpp;
-			shift &= (BITS_PER_LONG - 1);
+			shift &= (32 - 1);
 			if (!l) { l = 8; s++; };
 		}
 
 		/* write trailing bits */
  		if (shift) {
-			unsigned long end_mask = SHIFT_HIGH(~0UL, shift);
+			u32 end_mask = SHIFT_HIGH(~(u32)0, shift);
 
 			FB_WRITEL((FB_READL(dst) & end_mask) | val, dst);
 		}
@@ -222,10 +203,10 @@
 		if (pitch_index) {
 			dst2 += pitch;
 			dst1 = (char *) dst2;
-			(unsigned long) dst1 &= ~(sizeof(unsigned long) - 1);
+			(unsigned long) dst1 &= ~(sizeof(u32) - 1);
 
 			start_index += pitch_index;
-			start_index &= BITS_PER_LONG - 1;
+			start_index &= 32 - 1;
 		}
 		
 	}
@@ -239,15 +220,15 @@
  *           fix->line_legth is divisible by 4;
  *           beginning and end of a scanline is dword aligned
  */
-static inline void fast_imageblit(const struct fb_image *image, 
-				  struct fb_info *p, u8 *dst1, 
-				  u32 fgcolor, u32 bgcolor) 
+static inline void fast_imageblit(const struct fb_image *image, struct fb_info *p, 
+				  u8 *dst1, u32 fgcolor, 
+				  u32 bgcolor) 
 {
 	u32 fgx = fgcolor, bgx = bgcolor, bpp = p->var.bits_per_pixel;
-	u32 ppw = BITS_PER_LONG/bpp, spitch = (image->width + 7)/8;
+	u32 ppw = 32/bpp, spitch = (image->width + 7)/8;
 	u32 bit_mask, end_mask, eorx, shift;
 	const char *s = image->data, *src;
-	unsigned long *dst;
+	u32 *dst;
 	u32 *tab = NULL;
 	int i, j, k;
 		
@@ -275,14 +256,12 @@
 	k = image->width/ppw;
 
 	for (i = image->height; i--; ) {
-		INIT_FASTPATH;
-
-		dst = (unsigned long *) dst1, shift = 8; src = s;
-	
+		dst = (u32 *) dst1, shift = 8; src = s;
+		
 		for (j = k; j--; ) {
 			shift -= ppw;
 			end_mask = tab[(*src >> shift) & bit_mask];
-			FASTPATH;
+			FB_WRITEL((end_mask & eorx)^bgx, dst++);
 			if (!shift) { shift = 8; src++; }		
 		}
 		dst1 += p->fix.line_length;
@@ -292,8 +271,8 @@
 	
 void cfb_imageblit(struct fb_info *p, const struct fb_image *image)
 {
-	unsigned long fgcolor, bgcolor, start_index, bitstart, pitch_index = 0;
-	unsigned long bpl = sizeof(unsigned long), bpp = p->var.bits_per_pixel;
+	u32 fgcolor, bgcolor, start_index, bitstart, pitch_index = 0;
+	u32 bpl = sizeof(u32), bpp = p->var.bits_per_pixel;
 	u32 width = image->width, height = image->height; 
 	u32 dx = image->dx, dy = image->dy;
 	int x2, y2, vxres, vyres;
@@ -319,7 +298,7 @@
 	height = y2 - dy;
 
 	bitstart = (dy * p->fix.line_length * 8) + (dx * bpp);
-	start_index = bitstart & (BITS_PER_LONG - 1);
+	start_index = bitstart & (32 - 1);
 	pitch_index = (p->fix.line_length & (bpl - 1)) * 8;
 
 	bitstart /= 8;
@@ -339,14 +318,14 @@
 			bgcolor = image->bg_color;
 		}	
 		
-		if (BITS_PER_LONG % bpp == 0 && !start_index && !pitch_index && 
-		    ((width & (BITS_PER_LONG/bpp-1)) == 0) &&
+		if (32 % bpp == 0 && !start_index && !pitch_index && 
+		    ((width & (32/bpp-1)) == 0) &&
 		    bpp >= 8 && bpp <= 32) 			
 			fast_imageblit(image, p, dst1, fgcolor, bgcolor);
 		else 
 			slow_imageblit(image, p, dst1, fgcolor, bgcolor,
 					start_index, pitch_index);
-	} else if (image->depth <= bpp) 
+	} else if (image->depth == bpp) 
 		color_imageblit(image, p, dst1, start_index, pitch_index);
 }
 
diff -urN linux-2.5.68-bk11/fs/binfmt_elf.c linux-2.5.68-bk12/fs/binfmt_elf.c
--- linux-2.5.68-bk11/fs/binfmt_elf.c	2003-04-19 19:49:23.000000000 -0700
+++ linux-2.5.68-bk12/fs/binfmt_elf.c	2003-05-04 04:41:47.000000000 -0700
@@ -1260,6 +1260,9 @@
 	elf_core_copy_regs(&prstatus->pr_reg, regs);
 	
 	segs = current->mm->map_count;
+#ifdef ELF_CORE_EXTRA_PHDRS
+	segs += ELF_CORE_EXTRA_PHDRS;
+#endif
 
 	/* Set up header */
 	fill_elf_header(elf, segs+1);	/* including notes section */
@@ -1340,6 +1343,10 @@
 		DUMP_WRITE(&phdr, sizeof(phdr));
 	}
 
+#ifdef ELF_CORE_WRITE_EXTRA_PHDRS
+	ELF_CORE_WRITE_EXTRA_PHDRS;
+#endif
+
  	/* write out the notes section */
 	for (i = 0; i < numnote; i++)
 		if (!writenote(notes + i, file))
@@ -1385,6 +1392,10 @@
 		}
 	}
 
+#ifdef ELF_CORE_WRITE_EXTRA_DATA
+	ELF_CORE_WRITE_EXTRA_DATA;
+#endif
+
 	if ((off_t) file->f_pos != offset) {
 		/* Sanity check */
 		printk("elf_core_dump: file->f_pos (%ld) != offset (%ld)\n",
diff -urN linux-2.5.68-bk11/fs/xfs/Makefile linux-2.5.68-bk12/fs/xfs/Makefile
--- linux-2.5.68-bk11/fs/xfs/Makefile	2003-04-19 19:50:29.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/Makefile	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
 #
 # Further, this software is distributed without any warranty that it is
 # free of the rightful claim of any third person regarding infringement
-# or the like.	Any license provided herein, whether implied or
+# or the like.  Any license provided herein, whether implied or
 # otherwise, applies only to this software file.  Patent licenses, if
 # any, provided herein do not apply to combinations of this program with
 # other software, or any other product whatsoever.
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_aops.c linux-2.5.68-bk12/fs/xfs/linux/xfs_aops.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_aops.c	2003-04-19 19:50:47.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_aops.c	2003-05-04 04:41:49.000000000 -0700
@@ -30,7 +30,27 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_trans.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_error.h"
+#include "xfs_rw.h"
 #include <linux/mpage.h>
 
 STATIC void convert_page(struct inode *, struct page *,
@@ -50,8 +70,6 @@
 		pagebuf_ioerror(pb, -EIO);
 	if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) {
 		pagebuf_iodone(pb, 1, 1);
-		pb->pb_flags &= ~_PBF_LOCKABLE;
-		pagebuf_rele(pb);
 	}
 	end_buffer_async_write(bh, uptodate);
 }
@@ -61,28 +79,21 @@
  * to written extents.
  */
 STATIC void
-xfs_unwritten_conv(
-	xfs_buf_t		*bp)
+linvfs_unwritten_conv(
+	xfs_buf_t	*bp)
 {
-	bhv_desc_t		*bdp = XFS_BUF_FSPRIVATE(bp, bhv_desc_t *);
-	xfs_mount_t		*mp;
-	xfs_inode_t		*ip;
+	vnode_t		*vp = XFS_BUF_FSPRIVATE(bp, vnode_t *);
+	int		error;
 
-	ip = XFS_BHVTOI(bdp);
-	mp = ip->i_mount;
+	if (atomic_read(&bp->pb_hold) < 1) 
+		BUG();
 
-	if (XFS_TEST_ERROR(XFS_BUF_GETERROR(bp), mp,
-			   XFS_ERRTAG_STRATCMPL_IOERR,
-			   XFS_RANDOM_STRATCMPL_IOERR)) {
-		xfs_ioerror_alert(__FUNCTION__, mp, bp, XFS_BUF_ADDR(bp));
-	}
-
-	XFS_IOMAP_WRITE_UNWRITTEN(mp, &ip->i_iocore,
-				  XFS_BUF_OFFSET(bp), XFS_BUF_SIZE(bp));
+	VOP_BMAP(vp, XFS_BUF_OFFSET(bp), XFS_BUF_SIZE(bp),
+			BMAP_UNWRITTEN, NULL, NULL, error);
 	XFS_BUF_SET_FSPRIVATE(bp, NULL);
 	XFS_BUF_CLR_IODONE_FUNC(bp);
 	XFS_BUF_UNDATAIO(bp);
-	xfs_biodone(bp);
+	pagebuf_iodone(bp, 0, 0);
 }
 
 STATIC int
@@ -96,20 +107,20 @@
 	vnode_t			*vp = LINVFS_GET_VP(inode);
 	int			error, nmaps = 1;
 
-	if (((flags & (PBF_DIRECT|PBF_SYNC)) == PBF_DIRECT) &&
+	if (((flags & (BMAP_DIRECT|BMAP_SYNC)) == BMAP_DIRECT) &&
 	    (offset >= inode->i_size))
 		count = max_t(ssize_t, count, XFS_WRITE_IO_LOG);
 retry:
 	VOP_BMAP(vp, offset, count, flags, pbmapp, &nmaps, error);
-	if (error == EAGAIN)
+	if ((error == EAGAIN) || (error == EIO))
 		return -error;
-	if (unlikely((flags & (PBF_WRITE|PBF_DIRECT)) ==
-					(PBF_WRITE|PBF_DIRECT) && nmaps &&
+	if (unlikely((flags & (BMAP_WRITE|BMAP_DIRECT)) ==
+					(BMAP_WRITE|BMAP_DIRECT) && nmaps &&
 					(pbmapp->pbm_flags & PBMF_DELAY))) {
-		flags = PBF_FILE_ALLOCATE;
+		flags = BMAP_ALLOCATE;
 		goto retry;
 	}
-	if (flags & (PBF_WRITE|PBF_FILE_ALLOCATE)) {
+	if (flags & (BMAP_WRITE|BMAP_ALLOCATE)) {
 		VMODIFY(vp);
 	}
 	return -error;
@@ -371,7 +382,7 @@
 	offset += p_offset;
 
 	pb = pagebuf_lookup(mp->pbm_target,
-			    mp->pbm_offset, mp->pbm_bsize, _PBF_LOCKABLE);
+			    mp->pbm_offset, mp->pbm_bsize, 0);
 	if (!pb)
 		return -ENOMEM;
 
@@ -390,7 +401,6 @@
 		tmp = match_offset_to_mapping(start_page, mp, p_offset);
 		if (!tmp)
 			break;
-		BUG_ON(!(tmp->pbm_flags & PBMF_UNWRITTEN));
 		map_buffer_at_offset(start_page, bh, p_offset, block_bits, mp);
 		set_buffer_unwritten_io(bh);
 		bh->b_private = pb;
@@ -398,6 +408,12 @@
 		nblocks++;
 	} while ((bh = bh->b_this_page) != head);
 
+	if (unlikely(nblocks == 0)) {
+		printk("XFS: bad unwritten extent map: bh=0x%p, mp=0x%p\n",
+			curr, mp);
+		BUG();
+	}
+
 	atomic_add(nblocks, &pb->pb_io_remaining);
 
 	/* If we reached the end of the page, map forwards in any
@@ -436,15 +452,14 @@
 	size <<= block_bits;	/* convert fsb's to byte range */
 
 	XFS_BUF_DATAIO(pb);
+	XFS_BUF_ASYNC(pb);
 	XFS_BUF_SET_SIZE(pb, size);
 	XFS_BUF_SET_OFFSET(pb, offset);
-	XFS_BUF_SET_FSPRIVATE(pb, LINVFS_GET_VP(inode)->v_fbhv);
-	XFS_BUF_SET_IODONE_FUNC(pb, xfs_unwritten_conv);
+	XFS_BUF_SET_FSPRIVATE(pb, LINVFS_GET_VP(inode));
+	XFS_BUF_SET_IODONE_FUNC(pb, linvfs_unwritten_conv);
 
 	if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) {
 		pagebuf_iodone(pb, 1, 1);
-		pb->pb_flags &= ~_PBF_LOCKABLE;
-		pagebuf_rele(pb);
 	}
 
 	return 0;
@@ -546,6 +561,7 @@
 		} else {
 			set_buffer_dirty(bh);
 			unlock_buffer(bh);
+			mark_buffer_dirty(bh);
 		}
 	} while (i++, (bh = bh->b_this_page) != head);
 
@@ -583,7 +599,7 @@
 /*
  * Calling this without startio set means we are being asked to make a dirty
  * page ready for freeing it's buffers.  When called with startio set then
- * we are coming from writepage. 
+ * we are coming from writepage.
  *
  * When called with startio set it is important that we write the WHOLE
  * page if possible.
@@ -611,7 +627,7 @@
 	unsigned long		p_offset = 0, end_index;
 	loff_t			offset, end_offset;
 	int			len, err, i, cnt = 0, uptodate = 1;
-	int			flags = startio ? 0 : PBF_TRYLOCK;
+	int			flags = startio ? 0 : BMAP_TRYLOCK;
 	int			page_dirty = 1;
 
 
@@ -649,7 +665,7 @@
 		if (buffer_unwritten(bh)) {
 			if (!mp) {
 				err = map_blocks(inode, offset, len, &map,
-						PBF_FILE_UNWRITTEN);
+						BMAP_READ|BMAP_IGNSTATE);
 				if (err) {
 					goto error;
 				}
@@ -671,6 +687,7 @@
 				} else {
 					set_buffer_dirty(bh);
 					unlock_buffer(bh);
+					mark_buffer_dirty(bh);
 				}
 				page_dirty = 0;
 			}
@@ -681,7 +698,7 @@
 		} else if (buffer_delay(bh)) {
 			if (!mp) {
 				err = map_blocks(inode, offset, len, &map,
-					PBF_FILE_ALLOCATE | flags);
+					BMAP_ALLOCATE | flags);
 				if (err) {
 					goto error;
 				}
@@ -696,6 +713,7 @@
 				} else {
 					set_buffer_dirty(bh);
 					unlock_buffer(bh);
+					mark_buffer_dirty(bh);
 				}
 				page_dirty = 0;
 			}
@@ -714,8 +732,8 @@
 					size = probe_unmapped_cluster(
 							inode, page, bh, head);
 					err = map_blocks(inode, offset,
-							size, &map,
-							PBF_WRITE | PBF_DIRECT);
+						size, &map,
+						BMAP_WRITE | BMAP_MMAP);
 					if (err) {
 						goto error;
 					}
@@ -731,6 +749,7 @@
 					} else {
 						set_buffer_dirty(bh);
 						unlock_buffer(bh);
+						mark_buffer_dirty(bh);
 					}
 					page_dirty = 0;
 				}
@@ -754,13 +773,11 @@
 	if (uptodate)
 		SetPageUptodate(page);
 
-	if (startio) {
+	if (startio)
 		submit_page(page, bh_arr, cnt);
-	}
 
-	if (mp) {
+	if (mp)
 		cluster_write(inode, page->index + 1, mp, startio, unmapped);
-	}
 
 	return page_dirty;
 
@@ -791,7 +808,7 @@
 	struct buffer_head	*bh_result,
 	int			create,
 	int			direct,
-	page_buf_flags_t	flags)
+	bmapi_flags_t		flags)
 {
 	vnode_t			*vp = LINVFS_GET_VP(inode);
 	page_buf_bmap_t		pbmap;
@@ -811,7 +828,7 @@
 		size = 1 << inode->i_blkbits;
 
 	VOP_BMAP(vp, offset, size,
-		create ? flags : PBF_READ, &pbmap, &retpbbm, error);
+		create ? flags : BMAP_READ, &pbmap, &retpbbm, error);
 	if (error)
 		return -error;
 
@@ -881,7 +898,7 @@
 	int			create)
 {
 	return linvfs_get_block_core(inode, iblock, 0, bh_result,
-					create, 0, PBF_WRITE);
+					create, 0, BMAP_WRITE);
 }
 
 STATIC int
@@ -892,7 +909,7 @@
 	int			create)
 {
 	return linvfs_get_block_core(inode, iblock, 0, bh_result,
-					create, 0, PBF_SYNC|PBF_WRITE);
+					create, 0, BMAP_SYNC|BMAP_WRITE);
 }
 
 STATIC int
@@ -904,7 +921,7 @@
 	int			create)
 {
 	return linvfs_get_block_core(inode, iblock, max_blocks, bh_result,
-					create, 1, PBF_WRITE|PBF_DIRECT);
+					create, 1, BMAP_WRITE|BMAP_DIRECT);
 }
 
 STATIC int
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_behavior.c linux-2.5.68-bk12/fs/xfs/linux/xfs_behavior.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_behavior.c	2003-04-19 19:51:12.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_behavior.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  *
  */
-#include <xfs.h>
+#include "xfs.h"
 
 /*
  * Source file used to associate/disassociate behaviors with virtualized
@@ -94,7 +94,7 @@
 		prev->bd_next = bdp;
 	}
 
-        return 0;
+	return 0;
 }
 
 /*
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_behavior.h linux-2.5.68-bk12/fs/xfs/linux/xfs_behavior.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_behavior.h	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_behavior.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -36,8 +36,8 @@
  * Header file used to associate behaviors with virtualized objects.
  *
  * A virtualized object is an internal, virtualized representation of
- * OS entities such as persistent files, processes, or sockets.	 Examples
- * of virtualized objects include vnodes, vprocs, and vsockets.	 Often
+ * OS entities such as persistent files, processes, or sockets.  Examples
+ * of virtualized objects include vnodes, vprocs, and vsockets.  Often
  * a virtualized object is referred to simply as an "object."
  *
  * A behavior is essentially an implementation layer associated with
@@ -91,7 +91,7 @@
  *     active object
  *
  */
- 
+
 struct bhv_head_lock;
 
 /*
@@ -179,10 +179,10 @@
 	if ((bhp)->bh_first == (bdp)) {			\
 		/*					\
 		* Remove from front of chain.		\
-		 * Atomic wrt oip's.			\
+		* Atomic wrt oip's.			\
 		*/					\
 	       (bhp)->bh_first = (bdp)->bd_next;	\
-	 } else {					\
+	} else {					\
 	       /* remove from non-front of chain */	\
 	       bhv_remove_not_first(bhp, bdp);		\
 	}						\
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_cred.h linux-2.5.68-bk12/fs/xfs/linux/xfs_cred.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_cred.h	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_cred.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -47,4 +47,4 @@
 	return (cr == sys_cred) ? 1 : capable(cid);
 }
 
-#endif	/* __XFS_CRED_H__ */
+#endif  /* __XFS_CRED_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_file.c linux-2.5.68-bk12/fs/xfs/linux/xfs_file.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_file.c	2003-04-19 19:49:51.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_file.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,28 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_trans.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_error.h"
+#include "xfs_rw.h"
+
 #include <linux/dcache.h>
 #include <linux/mman.h> /* for PROT_WRITE */
 
@@ -209,7 +230,7 @@
  * We need to build a uio, cred, ...
  */
 
-#define nextdp(dp)	((struct xfs_dirent *)((char *)(dp) + (dp)->d_reclen))
+#define nextdp(dp)      ((struct xfs_dirent *)((char *)(dp) + (dp)->d_reclen))
 
 STATIC int
 linvfs_readdir(
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_fs_subr.c linux-2.5.68-bk12/fs/xfs/linux/xfs_fs_subr.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_fs_subr.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_fs_subr.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
 /*
  * Stub for no-op vnode operations that return error status.
@@ -122,4 +122,3 @@
 
 	return 0;
 }
-
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_fs_subr.h linux-2.5.68-bk12/fs/xfs/linux/xfs_fs_subr.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_fs_subr.h	2003-04-19 19:50:07.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_fs_subr.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,7 +29,7 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_SUBR_H__
+#ifndef	__XFS_SUBR_H__
 #define __XFS_SUBR_H__
 
 /*
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_globals.c linux-2.5.68-bk12/fs/xfs/linux/xfs_globals.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_globals.c	2003-04-19 19:50:03.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_globals.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -35,7 +35,9 @@
  * somewhere else in IRIX.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_bit.h"
 
 /*
  * System memory size - used to scale certain data structures in XFS.
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_globals.h linux-2.5.68-bk12/fs/xfs/linux/xfs_globals.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_globals.h	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_globals.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -37,7 +37,7 @@
  * somewhere else in IRIX.
  */
 
-extern uint64_t xfs_panic_mask;		/* set to cause more panics */
+extern uint64_t	xfs_panic_mask;		/* set to cause more panics */
 extern unsigned long xfs_physmem;
 extern struct cred *sys_cred;
 
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_ioctl.c linux-2.5.68-bk12/fs/xfs/linux/xfs_ioctl.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_ioctl.c	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_ioctl.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,9 +30,43 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-#include <xfs_fsops.h>
-#include <xfs_dfrag.h>
+#include "xfs.h"
+
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_utils.h"
+#include "xfs_dfrag.h"
+#include "xfs_fsops.h"
+
 #include <linux/dcache.h>
 #include <linux/mount.h>
 #include <linux/namei.h>
@@ -168,7 +202,7 @@
 STATIC int
 xfs_vget_fsop_handlereq(
 	xfs_mount_t		*mp,
-	struct inode		*parinode,	/* parent inode pointer	   */
+	struct inode		*parinode,	/* parent inode pointer    */
 	int			cap,		/* capability level for op */
 	unsigned long		arg,		/* userspace data pointer  */
 	unsigned long		size,		/* size of expected struct */
@@ -362,10 +396,10 @@
 	aiov.iov_base	= hreq.ohandle;
 
 	auio.uio_iov	= &aiov;
-	auio.uio_iovcnt = 1;
+	auio.uio_iovcnt	= 1;
 	auio.uio_fmode	= FINVIS;
-	auio.uio_offset = 0;
-	auio.uio_segflg = UIO_USERSPACE;
+	auio.uio_offset	= 0;
+	auio.uio_segflg	= UIO_USERSPACE;
 	auio.uio_resid	= olen;
 
 	VOP_READLINK(vp, &auio, NULL, error);
@@ -578,7 +612,7 @@
 	case XFS_IOC_FREESP64:
 	case XFS_IOC_RESVSP64:
 	case XFS_IOC_UNRESVSP64:
-		/* 
+		/*
 		 * Only allow the sys admin to reserve space unless
 		 * unwritten extents are enabled.
 		 */
@@ -986,7 +1020,7 @@
 			return -XFS_ERROR(EFAULT);
 		return 0;
 	}
-	
+
 	default:
 		return -ENOTTY;
 
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_iomap.c linux-2.5.68-bk12/fs/xfs/linux/xfs_iomap.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_iomap.c	2003-04-19 19:49:51.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_iomap.c	2003-05-04 04:41:49.000000000 -0700
@@ -30,7 +30,43 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_trans_space.h"
+#include "xfs_utils.h"
 
 #define XFS_WRITEIO_ALIGN(mp,off)	(((off) >> mp->m_writeio_log) \
 						<< mp->m_writeio_log)
@@ -97,7 +133,7 @@
 {
 	xfs_mount_t	*mp = io->io_mount;
 	xfs_fileoff_t	offset_fsb, end_fsb;
-	int		error;
+	int		error = 0;
 	int		lockmode = 0;
 	xfs_bmbt_irec_t	imap;
 	int		nimaps = 1;
@@ -107,32 +143,31 @@
 		return XFS_ERROR(EIO);
 
 	switch (flags &
-		(PBF_READ|PBF_WRITE|PBF_FILE_ALLOCATE|PBF_FILE_UNWRITTEN)) {
-	case PBF_READ:
+		(BMAP_READ|BMAP_WRITE|BMAP_ALLOCATE|BMAP_UNWRITTEN)) {
+	case BMAP_READ:
 		lockmode = XFS_LCK_MAP_SHARED(mp, io);
 		bmap_flags = XFS_BMAPI_ENTIRE;
+		if (flags & BMAP_IGNSTATE)
+			bmap_flags |= XFS_BMAPI_IGSTATE;
 		break;
 	case PBF_WRITE:
 		lockmode = XFS_ILOCK_EXCL|XFS_EXTSIZE_WR;
 		bmap_flags = 0;
 		XFS_ILOCK(mp, io, lockmode);
 		break;
-	case PBF_FILE_ALLOCATE:
+	case BMAP_ALLOCATE:
 		lockmode = XFS_ILOCK_SHARED|XFS_EXTSIZE_RD;
 		bmap_flags = XFS_BMAPI_ENTIRE;
 		/* Attempt non-blocking lock */
-		if (flags & PBF_TRYLOCK) {
+		if (flags & BMAP_TRYLOCK) {
 			if (!XFS_ILOCK_NOWAIT(mp, io, lockmode))
 				return XFS_ERROR(EAGAIN);
 		} else {
 			XFS_ILOCK(mp, io, lockmode);
 		}
 		break;
-	case PBF_FILE_UNWRITTEN:
-		lockmode = XFS_ILOCK_EXCL|XFS_EXTSIZE_WR;
-		bmap_flags = XFS_BMAPI_ENTIRE|XFS_BMAPI_IGSTATE;
-		XFS_ILOCK(mp, io, lockmode);
-		break;
+	case BMAP_UNWRITTEN:
+		goto phase2;
 	default:
 		BUG();
 	}
@@ -148,13 +183,14 @@
 	if (error)
 		goto out;
 
-	switch (flags & (PBF_WRITE|PBF_FILE_ALLOCATE)) {
-	case PBF_WRITE:
+phase2:
+	switch (flags & (BMAP_WRITE|BMAP_ALLOCATE|BMAP_UNWRITTEN)) {
+	case BMAP_WRITE:
 		/* If we found an extent, return it */
 		if (nimaps && (imap.br_startblock != HOLESTARTBLOCK))
 			break;
 
-		if (flags & PBF_DIRECT) {
+		if (flags & (BMAP_DIRECT|BMAP_MMAP)) {
 			error = XFS_IOMAP_WRITE_DIRECT(mp, io, offset,
 					count, flags, &imap, &nimaps, nimaps);
 		} else {
@@ -162,7 +198,7 @@
 					flags, &imap, &nimaps);
 		}
 		break;
-	case PBF_FILE_ALLOCATE:
+	case BMAP_ALLOCATE:
 		/* If we found an extent, return it */
 		XFS_IUNLOCK(mp, io, lockmode);
 		lockmode = 0;
@@ -172,12 +208,17 @@
 
 		error = XFS_IOMAP_WRITE_ALLOCATE(mp, io, &imap, &nimaps);
 		break;
+	case BMAP_UNWRITTEN:
+		lockmode = 0;
+		error = XFS_IOMAP_WRITE_UNWRITTEN(mp, io, offset, count);
+		nimaps = 0;
+		break;
 	}
 
 	if (nimaps) {
 		*npbmaps = _xfs_imap_to_bmap(io, offset, &imap,
 						pbmapp, nimaps, *npbmaps);
-	} else {
+	} else if (npbmaps) {
 		*npbmaps = 0;
 	}
 
@@ -203,13 +244,13 @@
 			xfs_ilock(ip, XFS_ILOCK_EXCL);
 			*fsynced = 1;
 		} else {
-			*ioflags |= PBF_SYNC;
+			*ioflags |= BMAP_SYNC;
 			*fsynced = 2;
 		}
 		return 0;
 	case 1:
 		*fsynced = 2;
-		*ioflags |= PBF_SYNC;
+		*ioflags |= BMAP_SYNC;
 		return 0;
 	case 2:
 		xfs_iunlock(ip, XFS_ILOCK_EXCL);
@@ -228,7 +269,7 @@
 	xfs_inode_t	*ip,
 	loff_t		offset,
 	size_t		count,
-	int		ioflag,
+	int		flags,
 	xfs_bmbt_irec_t *ret_imap,
 	int		*nmaps,
 	int		found)
@@ -265,7 +306,7 @@
 	maps = min(XFS_WRITE_IMAPS, *nmaps);
 	nimaps = maps;
 
-	isize = ip->i_d.di_size; 
+	isize = ip->i_d.di_size;
 	aeof = (offset + count) > isize;
 
 	if (io->io_new_size > isize)
@@ -342,7 +383,7 @@
 	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
 	xfs_trans_ihold(tp, ip);
 
-	if (offset < ip->i_d.di_size || rt)
+	if (!(flags & BMAP_MMAP) && (offset < ip->i_d.di_size || rt))
 		bmapi_flag |= XFS_BMAPI_PREALLOC;
 
 	/*
@@ -441,7 +482,7 @@
 	 * We don't bother with this for sync writes, because we need
 	 * to minimize the amount we write for good performance.
 	 */
-	if (!(ioflag & PBF_SYNC) && ((offset + count) > ip->i_d.di_size)) {
+	if (!(ioflag & BMAP_SYNC) && ((offset + count) > ip->i_d.di_size)) {
 		xfs_off_t	aligned_offset;
 		unsigned int	iosize;
 		xfs_fileoff_t	ioalign;
@@ -628,7 +669,7 @@
 		for (i = 0; i < nimaps; i++) {
 			if ((map->br_startoff >= imap[i].br_startoff) &&
 			    (map->br_startoff < (imap[i].br_startoff +
-					         imap[i].br_blockcount))) {
+						 imap[i].br_blockcount))) {
 				*map = imap[i];
 				*retmap = 1;
 				XFS_STATS_INC(xfsstats.xs_xstrat_quick);
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_iops.c linux-2.5.68-bk12/fs/xfs/linux/xfs_iops.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_iops.c	2003-04-19 19:49:09.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_iops.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,42 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_utils.h"
+
 #include <linux/xattr.h>
 
 
@@ -478,7 +513,7 @@
 
 	VOP_SETATTR(vp, &vattr, flags, NULL, error);
 	if (error)
-		return(-error); /* Positive error up from XFS */
+		return(-error);	/* Positive error up from XFS */
 	if (ia_valid & ATTR_SIZE) {
 		error = vmtruncate(inode, attr->ia_size);
 	}
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_iops.h linux-2.5.68-bk12/fs/xfs/linux/xfs_iops.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_iops.h	2003-04-19 19:49:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_iops.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_linux.h linux-2.5.68-bk12/fs/xfs/linux/xfs_linux.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_linux.h	2003-04-19 19:48:48.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_linux.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -45,12 +45,15 @@
 #include <linux/pagemap.h>
 #include <linux/vfs.h>
 #include <linux/seq_file.h>
+#include <linux/init.h>
+#include <linux/proc_fs.h>
 
 #include <asm/page.h>
 #include <asm/div64.h>
 #include <asm/param.h>
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
+#include <asm/unaligned.h>
 
 #include <linux/xfs_behavior.h>
 #include <linux/xfs_vfs.h>
@@ -98,41 +101,41 @@
 #define dpoff(DD)	((DD) & (NDPP-1))
 
 #define NBBY		8		/* number of bits per byte */
-#define NBPC		PAGE_SIZE	/* Number of bytes per click */
-#define BPCSHIFT	PAGE_SHIFT	/* LOG2(NBPC) if exact */
+#define	NBPC		PAGE_SIZE	/* Number of bytes per click */
+#define	BPCSHIFT	PAGE_SHIFT	/* LOG2(NBPC) if exact */
 
 /*
  * Size of block device i/o is parameterized here.
  * Currently the system supports page-sized i/o.
  */
-#define BLKDEV_IOSHIFT		BPCSHIFT
-#define BLKDEV_IOSIZE		(1<<BLKDEV_IOSHIFT)
+#define	BLKDEV_IOSHIFT		BPCSHIFT
+#define	BLKDEV_IOSIZE		(1<<BLKDEV_IOSHIFT)
 /* number of BB's per block device block */
-#define BLKDEV_BB		BTOBB(BLKDEV_IOSIZE)
+#define	BLKDEV_BB		BTOBB(BLKDEV_IOSIZE)
 
 /* bytes to clicks */
-#define btoc(x)		(((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
-#define btoct(x)	((__psunsigned_t)(x)>>BPCSHIFT)
-#define btoc64(x)	(((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT)
-#define btoct64(x)	((__uint64_t)(x)>>BPCSHIFT)
-#define io_btoc(x)	(((__psunsigned_t)(x)+(IO_NBPC-1))>>IO_BPCSHIFT)
-#define io_btoct(x)	((__psunsigned_t)(x)>>IO_BPCSHIFT)
+#define	btoc(x)		(((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
+#define	btoct(x)	((__psunsigned_t)(x)>>BPCSHIFT)
+#define	btoc64(x)	(((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT)
+#define	btoct64(x)	((__uint64_t)(x)>>BPCSHIFT)
+#define	io_btoc(x)	(((__psunsigned_t)(x)+(IO_NBPC-1))>>IO_BPCSHIFT)
+#define	io_btoct(x)	((__psunsigned_t)(x)>>IO_BPCSHIFT)
 
 /* off_t bytes to clicks */
-#define offtoc(x)	(((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT)
-#define offtoct(x)	((xfs_off_t)(x)>>BPCSHIFT)
+#define offtoc(x)       (((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT)
+#define offtoct(x)      ((xfs_off_t)(x)>>BPCSHIFT)
 
 /* clicks to off_t bytes */
-#define ctooff(x)	((xfs_off_t)(x)<<BPCSHIFT)
+#define	ctooff(x)	((xfs_off_t)(x)<<BPCSHIFT)
 
 /* clicks to bytes */
-#define ctob(x)		((__psunsigned_t)(x)<<BPCSHIFT)
-#define btoct(x)	((__psunsigned_t)(x)>>BPCSHIFT)
-#define ctob64(x)	((__uint64_t)(x)<<BPCSHIFT)
-#define io_ctob(x)	((__psunsigned_t)(x)<<IO_BPCSHIFT)
+#define	ctob(x)		((__psunsigned_t)(x)<<BPCSHIFT)
+#define btoct(x)        ((__psunsigned_t)(x)>>BPCSHIFT)
+#define	ctob64(x)	((__uint64_t)(x)<<BPCSHIFT)
+#define	io_ctob(x)	((__psunsigned_t)(x)<<IO_BPCSHIFT)
 
 /* bytes to clicks */
-#define btoc(x)		(((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
+#define btoc(x)         (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
 
 #ifndef CELL_CAPABLE
 #define FSC_NOTIFY_NAME_CHANGED(vp)
@@ -143,7 +146,7 @@
 #endif
 
 /* Note: EWRONGFS never visible outside the kernel */
-#define EWRONGFS	EINVAL		/* Mount with wrong filesystem type */
+#define	EWRONGFS	EINVAL		/* Mount with wrong filesystem type */
 
 /*
  * XXX EFSCORRUPTED needs a real value in errno.h. asm-i386/errno.h won't
@@ -156,14 +159,14 @@
  *	3/ EUCLEAN ["Structure needs cleaning"]
  *	4/ Convert EFSCORRUPTED to EIO [just prior to return into userspace]
  */
-#define EFSCORRUPTED	990		/* Filesystem is corrupted */
+#define EFSCORRUPTED    990		/* Filesystem is corrupted */
 
 #define SYNCHRONIZE()	barrier()
 #define __return_address __builtin_return_address(0)
 
 /*
  * IRIX (BSD) quotactl makes use of separate commands for user/group,
- * whereas on Linux the syscall encodes this information into the cmd 
+ * whereas on Linux the syscall encodes this information into the cmd
  * field (see the QCMD macro in quota.h).  These macros help keep the
  * code portable - they are not visible from the syscall interface.
  */
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_lrw.c linux-2.5.68-bk12/fs/xfs/linux/xfs_lrw.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_lrw.c	2003-04-19 19:48:46.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_lrw.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -34,7 +34,44 @@
  *
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_inode_item.h"
+#include "xfs_buf_item.h"
+#include "xfs_utils.h"
+
 #include <linux/capability.h>
 
 
@@ -50,7 +87,7 @@
  */
 STATIC int
 xfs_iozero(
-	struct inode		*ip,	/* inode 			*/
+	struct inode		*ip,	/* inode			*/
 	loff_t			pos,	/* offset in file		*/
 	size_t			count,	/* size of data to zero		*/
 	loff_t			end_size)	/* max file size to set */
@@ -280,7 +317,7 @@
 	int		zero_len;
 	int		isize_fsb_offset;
 	int		error = 0;
-	xfs_bmbt_irec_t imap;
+	xfs_bmbt_irec_t	imap;
 	loff_t		loff;
 	size_t		lsize;
 
@@ -334,7 +371,7 @@
 
 /*
  * Zero any on disk space between the current EOF and the new,
- * larger EOF.	This handles the normal case of zeroing the remainder
+ * larger EOF.  This handles the normal case of zeroing the remainder
  * of the last block in the file and the unusual case of zeroing blocks
  * out beyond the size of the file.  This second case only happens
  * with fixed size extents and when the system crashes before the inode
@@ -362,7 +399,7 @@
 	xfs_mount_t	*mp;
 	int		nimaps;
 	int		error = 0;
-	xfs_bmbt_irec_t imap;
+	xfs_bmbt_irec_t	imap;
 	loff_t		loff;
 	size_t		lsize;
 
@@ -384,10 +421,10 @@
 
 	/*
 	 * Calculate the range between the new size and the old
-	 * where blocks needing to be zeroed may exist.	 To get the
+	 * where blocks needing to be zeroed may exist.  To get the
 	 * block where the last byte in the file currently resides,
 	 * we need to subtract one from the size and truncate back
-	 * to a block boundary.	 We subtract 1 in case the size is
+	 * to a block boundary.  We subtract 1 in case the size is
 	 * exactly on a block boundary.
 	 */
 	last_fsb = isize ? XFS_B_TO_FSBT(mp, isize - 1) : (xfs_fileoff_t)-1;
@@ -435,7 +472,7 @@
 
 		/*
 		 * There are blocks in the range requested.
-		 * Zero them a single write at a time.	We actually
+		 * Zero them a single write at a time.  We actually
 		 * don't zero the entire range returned if it is
 		 * too big and simply loop around to get the rest.
 		 * That is not the most efficient thing to do, but it
@@ -709,7 +746,7 @@
 			 * the fact that buffered writes lock out direct I/O
 			 * writes - the direct I/O write could have extended
 			 * the size nontransactionally, then finished before
-			 * we started.	xfs_write_file will think that the file
+			 * we started.  xfs_write_file will think that the file
 			 * didn't grow but the update isn't safe unless the
 			 * size change is logged.
 			 *
@@ -857,33 +894,6 @@
 	pagebuf_delwri_flush(target, PBDF_WAIT, NULL);
 }
 
-
-/* Push all fs state out to disk
- */
-
-void
-XFS_log_write_unmount_ro(bhv_desc_t	*bdp)
-{
-	xfs_mount_t	*mp;
-	int pincount = 0;
-	int count = 0;
-	int error;
-
-	mp = XFS_BHVTOM(bdp);
-	pagebuf_delwri_flush(mp->m_ddev_targp, PBDF_WAIT, &pincount);
-	xfs_finish_reclaim_all(mp);
-
-	do {
-		VFS_SYNC(XFS_MTOVFS(mp), SYNC_ATTR|SYNC_WAIT, NULL, error);
-		pagebuf_delwri_flush(mp->m_ddev_targp, PBDF_WAIT, &pincount);
-		if (pincount == 0) {delay(50); count++;}
-	}  while (count < 2);
-
-	/* Ok now write out an unmount record */
-	xfs_log_unmount_write(mp);
-	xfs_unmountfs_writesb(mp);
-}
-
 /*
  * If the underlying (log or data) device is readonly, there are some
  * operations that cannot proceed.
@@ -903,4 +913,3 @@
 
 	return 0;
 }
-
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_lrw.h linux-2.5.68-bk12/fs/xfs/linux/xfs_lrw.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_lrw.h	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_lrw.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -45,7 +45,7 @@
 /*
  * Maximum count of bmaps used by read and write paths.
  */
-#define XFS_MAX_RW_NBMAPS	4
+#define	XFS_MAX_RW_NBMAPS	4
 
 extern int xfs_bmap(struct bhv_desc *, xfs_off_t, ssize_t, int,
 			struct page_buf_bmap_s *, int *);
@@ -76,8 +76,6 @@
 
 extern int xfs_dev_is_read_only(struct xfs_mount *, char *);
 
-extern void XFS_log_write_unmount_ro(struct bhv_desc *);
-
 #define XFS_FSB_TO_DB_IO(io,fsb) \
 		(((io)->io_flags & XFS_IOCORE_RT) ? \
 		 XFS_FSB_TO_BB((io)->io_mount, (fsb)) : \
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_stats.c linux-2.5.68-bk12/fs/xfs/linux/xfs_stats.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_stats.c	2003-04-19 19:51:08.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_stats.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
 #include <linux/proc_fs.h>
 
 struct xfsstats xfsstats;
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_stats.h linux-2.5.68-bk12/fs/xfs/linux/xfs_stats.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_stats.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_stats.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_super.c linux-2.5.68-bk12/fs/xfs/linux/xfs_super.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_super.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_super.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,34 +30,53 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_clnt.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_utils.h"
+#include "xfs_version.h"
+
 #include <linux/blkdev.h>
 #include <linux/namei.h>
 #include <linux/init.h>
 #include <linux/mount.h>
-#include "xfs_version.h"
 
 STATIC struct quotactl_ops linvfs_qops;
 STATIC struct super_operations linvfs_sops;
 STATIC struct export_operations linvfs_export_ops;
 STATIC kmem_cache_t * linvfs_inode_cachep;
 
-#define MNTOPT_LOGBUFS	"logbufs"	/* number of XFS log buffers */
-#define MNTOPT_LOGBSIZE	"logbsize"	/* size of XFS log buffers */
-#define MNTOPT_LOGDEV	"logdev"	/* log device */
-#define MNTOPT_RTDEV	"rtdev"		/* realtime I/O device */
-#define MNTOPT_BIOSIZE	"biosize"	/* log2 of preferred buffered io size */
-#define MNTOPT_WSYNC	"wsync"		/* safe-mode nfs compatible mount */
-#define MNTOPT_INO64	"ino64"		/* force inodes into 64-bit range */
-#define MNTOPT_NOALIGN	"noalign"	/* turn off stripe alignment */
-#define MNTOPT_SUNIT	"sunit"		/* data volume stripe unit */
-#define MNTOPT_SWIDTH	"swidth"	/* data volume stripe width */
-#define MNTOPT_NOUUID	"nouuid"	/* ignore filesystem UUID */
-#define MNTOPT_MTPT	"mtpt"		/* filesystem mount point */
-#define MNTOPT_NORECOVERY   "norecovery"   /* don't run XFS recovery */
-#define MNTOPT_NOLOGFLUSH   "nologflush"   /* don't hard flush on log writes */
-#define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */
-
 STATIC struct xfs_mount_args *
 args_allocate(
 	struct super_block	*sb)
@@ -78,221 +97,6 @@
 	return args;
 }
 
-int
-xfs_parseargs(
-	struct bhv_desc		*bhv,
-	char			*options,
-	struct xfs_mount_args	*args,
-	int			update)
-{
-	struct vfs		*vfsp = bhvtovfs(bhv);
-	char			*this_char, *value, *eov;
-	int			dsunit, dswidth, vol_dsunit, vol_dswidth;
-	int			iosize;
-
-	if (!options)
-		return 0;
-
-	iosize = dsunit = dswidth = vol_dsunit = vol_dswidth = 0;
-
-	while ((this_char = strsep(&options, ",")) != NULL) {
-		if (!*this_char)
-			continue;
-		if ((value = strchr(this_char, '=')) != NULL)
-			*value++ = 0;
-
-		if (!strcmp(this_char, MNTOPT_LOGBUFS)) {
-			if (!value || !*value) {
-				printk("XFS: %s option requires an argument\n",
-					MNTOPT_LOGBUFS);
-				return -EINVAL;
-			}
-			args->logbufs = simple_strtoul(value, &eov, 10);
-		} else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) {
-			int	last, in_kilobytes = 0;
-
-			if (!value || !*value) {
-				printk("XFS: %s option requires an argument\n",
-					MNTOPT_LOGBSIZE);
-				return -EINVAL;
-			}
-			last = strlen(value) - 1;
-			if (value[last] == 'K' || value[last] == 'k') {
-				in_kilobytes = 1;
-				value[last] = '\0';
-			}
-			args->logbufsize = simple_strtoul(value, &eov, 10);
-			if (in_kilobytes)
-				args->logbufsize <<= 10;
-		} else if (!strcmp(this_char, MNTOPT_LOGDEV)) {
-			if (!value || !*value) {
-				printk("XFS: %s option requires an argument\n",
-					MNTOPT_LOGDEV);
-				return -EINVAL;
-			}
-			strncpy(args->logname, value, MAXNAMELEN);
-		} else if (!strcmp(this_char, MNTOPT_MTPT)) {
-			if (!value || !*value) {
-				printk("XFS: %s option requires an argument\n",
-					MNTOPT_MTPT);
-				return -EINVAL;
-			}
-			strncpy(args->mtpt, value, MAXNAMELEN);
-		} else if (!strcmp(this_char, MNTOPT_RTDEV)) {
-			if (!value || !*value) {
-				printk("XFS: %s option requires an argument\n",
-					MNTOPT_RTDEV);
-				return -EINVAL;
-			}
-			strncpy(args->rtname, value, MAXNAMELEN);
-		} else if (!strcmp(this_char, MNTOPT_BIOSIZE)) {
-			if (!value || !*value) {
-				printk("XFS: %s option requires an argument\n",
-					MNTOPT_BIOSIZE); 
-				return -EINVAL;
-			}
-			iosize = simple_strtoul(value, &eov, 10);
-			args->flags |= XFSMNT_IOSIZE;
-			args->iosizelog = (uint8_t) iosize;
-		} else if (!strcmp(this_char, MNTOPT_WSYNC)) {
-			args->flags |= XFSMNT_WSYNC;
-		} else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) {
-			args->flags |= XFSMNT_OSYNCISOSYNC;
-		} else if (!strcmp(this_char, MNTOPT_NORECOVERY)) {
-			args->flags |= XFSMNT_NORECOVERY;
-		} else if (!strcmp(this_char, MNTOPT_INO64)) {
-			args->flags |= XFSMNT_INO64;
-#ifndef XFS_BIG_FILESYSTEMS
-			printk("XFS: %s option not allowed on this system\n",
-				MNTOPT_INO64);
-			return -EINVAL;
-#endif
-		} else if (!strcmp(this_char, MNTOPT_NOALIGN)) {
-			args->flags |= XFSMNT_NOALIGN;
-		} else if (!strcmp(this_char, MNTOPT_SUNIT)) {
-			if (!value || !*value) {
-				printk("XFS: %s option requires an argument\n",
-					MNTOPT_SUNIT);
-				return -EINVAL;
-			}
-			dsunit = simple_strtoul(value, &eov, 10);
-		} else if (!strcmp(this_char, MNTOPT_SWIDTH)) {
-			if (!value || !*value) {
-				printk("XFS: %s option requires an argument\n",
-					MNTOPT_SWIDTH);
-				return -EINVAL;
-			}
-			dswidth = simple_strtoul(value, &eov, 10);
-		} else if (!strcmp(this_char, MNTOPT_NOUUID)) {
-			args->flags |= XFSMNT_NOUUID;
-		} else if (!strcmp(this_char, MNTOPT_NOLOGFLUSH)) {
-			args->flags |= XFSMNT_NOLOGFLUSH;
-		} else if (!strcmp(this_char, "osyncisdsync")) {
-			/* no-op, this is now the default */
-printk("XFS: osyncisdsync is now the default, option is deprecated.\n");
-		} else if (!strcmp(this_char, "irixsgid")) {
-printk("XFS: irixsgid is now a sysctl(2) variable, option is deprecated.\n");
-		} else {
-			printk("XFS: unknown mount option [%s].\n", this_char);
-			return -EINVAL;
-		}
-	}
-
-	if (args->flags & XFSMNT_NORECOVERY) {
-		if ((vfsp->vfs_flag & VFS_RDONLY) == 0) {
-			printk("XFS: no-recovery mounts must be read-only.\n");
-			return -EINVAL;
-		}
-	}
-
-	if ((args->flags & XFSMNT_NOALIGN) && (dsunit || dswidth)) {
-		printk(
-	"XFS: sunit and swidth options incompatible with the noalign option\n");
-		return -EINVAL;
-	}
-
-	if ((dsunit && !dswidth) || (!dsunit && dswidth)) {
-		printk("XFS: sunit and swidth must be specified together\n");
-		return -EINVAL;
-	}
-
-	if (dsunit && (dswidth % dsunit != 0)) {
-		printk(
-	"XFS: stripe width (%d) must be a multiple of the stripe unit (%d)\n",
-			dswidth, dsunit);
-		return -EINVAL;
-	}
-
-	if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) {
-		if (dsunit) {
-			args->sunit = dsunit;
-			args->flags |= XFSMNT_RETERR;
-		} else {
-			args->sunit = vol_dsunit;
-		}
-		dswidth ? (args->swidth = dswidth) :
-			  (args->swidth = vol_dswidth);
-	} else {
-		args->sunit = args->swidth = 0;
-	}
-
-	return 0;
-}
-
-int
-xfs_showargs(
-	struct bhv_desc		*bhv,
-	struct seq_file		*m)
-{
-	static struct proc_xfs_info {
-		int	flag;
-		char	*str;
-	} xfs_info[] = {
-		/* the few simple ones we can get from the mount struct */
-		{ XFS_MOUNT_NOALIGN,		"," MNTOPT_NOALIGN },
-		{ XFS_MOUNT_NORECOVERY,		"," MNTOPT_NORECOVERY },
-		{ XFS_MOUNT_OSYNCISOSYNC,	"," MNTOPT_OSYNCISOSYNC },
-		{ XFS_MOUNT_NOUUID,		"," MNTOPT_NOUUID },
-		{ 0, NULL }
-	};
-	struct proc_xfs_info	*xfs_infop;
-	struct xfs_mount	*mp = XFS_BHVTOM(bhv);
-	char			b[BDEVNAME_SIZE];
-
-	for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
-		if (mp->m_flags & xfs_infop->flag)
-			seq_puts(m, xfs_infop->str);
-	}
-
-	if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE)
-		seq_printf(m, "," MNTOPT_BIOSIZE "=%d", mp->m_writeio_log);
-
-	if (mp->m_logbufs > 0)
-		seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs);
-
-	if (mp->m_logbsize > 0)
-		seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize);
-
-	if (mp->m_ddev_targp->pbr_dev != mp->m_logdev_targp->pbr_dev)
-		seq_printf(m, "," MNTOPT_LOGDEV "=%s",
-				bdevname(mp->m_logdev_targp->pbr_bdev, b));
-
-	if (mp->m_rtdev_targp &&
-	    mp->m_ddev_targp->pbr_dev != mp->m_rtdev_targp->pbr_dev)
-		seq_printf(m, "," MNTOPT_RTDEV "=%s",
-				bdevname(mp->m_rtdev_targp->pbr_bdev, b));
-
-	if (mp->m_dalign > 0)
-		seq_printf(m, "," MNTOPT_SUNIT "=%d",
-				(int)XFS_FSB_TO_BB(mp, mp->m_dalign));
-
-	if (mp->m_swidth > 0)
-		seq_printf(m, "," MNTOPT_SWIDTH "=%d",
-				(int)XFS_FSB_TO_BB(mp, mp->m_swidth));
-
-	return 0;
-}
-
 STATIC __inline__ void
 xfs_set_inodeops(
 	struct inode		*inode)
@@ -330,7 +134,7 @@
 	inode->i_mode	= (ip->i_d.di_mode & MODEMASK) | VTTOIF(vp->v_type);
 	inode->i_nlink	= ip->i_d.di_nlink;
 	inode->i_uid	= ip->i_d.di_uid;
-	inode->i_gid 	= ip->i_d.di_gid;
+	inode->i_gid	= ip->i_d.di_gid;
 	if (((1 << vp->v_type) & ((1<<VBLK) | (1<<VCHR))) == 0) {
 		inode->i_rdev = NODEV;
 	} else {
@@ -616,7 +420,6 @@
 	char			*options)
 {
 	vfs_t			*vfsp = LINVFS_GET_VFS(sb);
-	xfs_mount_t		*mp = XFS_VFSTOM(vfsp);
 	struct xfs_mount_args	*args = args_allocate(sb);
 	int			error;
 
@@ -624,24 +427,7 @@
 	if (error)
 		goto out;
 
-	if (args->flags & XFSMNT_NOATIME)
-		mp->m_flags |= XFS_MOUNT_NOATIME;
-	else
-		mp->m_flags &= ~XFS_MOUNT_NOATIME;
-
-	set_posix_acl_flag(sb);
-	linvfs_write_super(sb);
-
-	if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
-		goto out;
-
-	if (*flags & MS_RDONLY) {
-		sb->s_flags |= MS_RDONLY;
-		XFS_log_write_unmount_ro(&mp->m_bhv);
-		vfsp->vfs_flag |= VFS_RDONLY;
-	} else {
-		vfsp->vfs_flag &= ~VFS_RDONLY;
-	}
+	VFS_MNTUPDATE(vfsp, flags, args, error);
 
 out:
 	kmem_free(args, sizeof(*args));
@@ -941,7 +727,7 @@
 	int			error;
 	struct sysinfo		si;
 	static char		message[] __initdata =
-		KERN_INFO "SGI XFS " XFS_VERSION_STRING " with " 
+		KERN_INFO "SGI XFS " XFS_VERSION_STRING " with "
 		XFS_BUILD_OPTIONS " enabled\n";
 
 	printk(message);
@@ -959,6 +745,7 @@
 
 	vn_init();
 	xfs_init();
+	uuid_init();
 	vfs_initdmapi();
 	vfs_initquota();
 
@@ -991,7 +778,7 @@
 module_init(init_xfs_fs);
 module_exit(exit_xfs_fs);
 
-MODULE_AUTHOR("SGI <sgi.com>");
+MODULE_AUTHOR("Silicon Graphics, Inc.");
 MODULE_DESCRIPTION(
 	"SGI XFS " XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled");
 MODULE_LICENSE("GPL");
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_super.h linux-2.5.68-bk12/fs/xfs/linux/xfs_super.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_super.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_super.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -92,8 +92,6 @@
 struct pb_target;
 struct block_device;
 
-extern int  xfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int);
-extern int  xfs_showargs(bhv_desc_t *, struct seq_file *);
 extern void xfs_initialize_vnode(bhv_desc_t *, vnode_t *, bhv_desc_t *, int);
 
 extern int  xfs_blkdev_get(struct xfs_mount *, const char *,
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_sysctl.c linux-2.5.68-bk12/fs/xfs/linux/xfs_sysctl.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_sysctl.c	2003-04-19 19:51:23.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_sysctl.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,8 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_rw.h"
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
 
@@ -100,7 +101,7 @@
 };
 
 STATIC ctl_table xfs_root_table[] = {
-	{CTL_FS, "fs",	NULL, 0, 0555, xfs_dir_table},
+	{CTL_FS, "fs",  NULL, 0, 0555, xfs_dir_table},
 	{0}
 };
 
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_sysctl.h linux-2.5.68-bk12/fs/xfs/linux/xfs_sysctl.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_sysctl.h	2003-04-19 19:48:47.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_sysctl.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_vfs.c linux-2.5.68-bk12/fs/xfs/linux/xfs_vfs.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_vfs.c	2003-04-19 19:48:48.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_vfs.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,22 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_macros.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_clnt.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_imap.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_quota.h"
 
 int
 vfs_mount(
@@ -89,6 +104,21 @@
 }
 
 int
+vfs_mntupdate(
+	struct bhv_desc		*bdp,
+	int			*fl,
+	struct xfs_mount_args	*args)
+{
+	struct bhv_desc		*next = bdp;
+
+	ASSERT(next);
+	while (! (bhvtovfsops(next))->vfs_mntupdate)
+		next = BHV_NEXT(next);
+	return ((*bhvtovfsops(next)->vfs_mntupdate)(next, fl, args));
+}
+
+
+int
 vfs_root(
 	struct bhv_desc		*bdp,
 	struct vnode		**vpp)
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_vfs.h linux-2.5.68-bk12/fs/xfs/linux/xfs_vfs.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_vfs.h	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_vfs.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -93,6 +93,8 @@
 				struct xfs_mount_args *, int);
 typedef	int	(*vfs_showargs_t)(bhv_desc_t *, struct seq_file *);
 typedef int	(*vfs_unmount_t)(bhv_desc_t *, int, struct cred *);
+typedef int	(*vfs_mntupdate_t)(bhv_desc_t *, int *,
+				struct xfs_mount_args *);
 typedef int	(*vfs_root_t)(bhv_desc_t *, struct vnode **);
 typedef int	(*vfs_statvfs_t)(bhv_desc_t *, struct statfs *, struct vnode *);
 typedef int	(*vfs_sync_t)(bhv_desc_t *, int, struct cred *);
@@ -109,6 +111,7 @@
 	vfs_parseargs_t		vfs_parseargs;	/* parse mount options */
 	vfs_showargs_t		vfs_showargs;	/* unparse mount options */
 	vfs_unmount_t		vfs_unmount;	/* unmount file system */
+	vfs_mntupdate_t		vfs_mntupdate;	/* update file system options */
 	vfs_root_t		vfs_root;	/* get root vnode */
 	vfs_statvfs_t		vfs_statvfs;	/* file system statistics */
 	vfs_sync_t		vfs_sync;	/* flush files */
@@ -126,7 +129,8 @@
 #define VFS_MOUNT(v, ma,cr, rv)		((rv) = vfs_mount(VHEAD(v), ma,cr))
 #define VFS_PARSEARGS(v, o,ma,f, rv)	((rv) = vfs_parseargs(VHEAD(v), o,ma,f))
 #define VFS_SHOWARGS(v, m, rv)		((rv) = vfs_showargs(VHEAD(v), m))
-#define VFS_UNMOUNT(v, f,cr, rv)	((rv) = vfs_unmount(VHEAD(v), f,cr))
+#define VFS_UNMOUNT(v, f, cr, rv)	((rv) = vfs_unmount(VHEAD(v), f,cr))
+#define VFS_MNTUPDATE(v, fl, args, rv)	((rv) = vfs_mntupdate(VHEAD(v), fl, args))
 #define VFS_ROOT(v, vpp, rv)		((rv) = vfs_root(VHEAD(v), vpp))
 #define VFS_STATVFS(v, sp,vp, rv)	((rv) = vfs_statvfs(VHEAD(v), sp,vp))
 #define VFS_SYNC(v, flag,cr, rv)	((rv) = vfs_sync(VHEAD(v), flag,cr))
@@ -143,6 +147,7 @@
 #define PVFS_PARSEARGS(b, o,ma,f, rv)	((rv) = vfs_parseargs(b, o,ma,f))
 #define PVFS_SHOWARGS(b, m, rv)		((rv) = vfs_showargs(b, m))
 #define PVFS_UNMOUNT(b, f,cr, rv)	((rv) = vfs_unmount(b, f,cr))
+#define PVFS_MNTUPDATE(b, fl, args, rv)	((rv) = vfs_mntupdate(b, fl, args))
 #define PVFS_ROOT(b, vpp, rv)		((rv) = vfs_root(b, vpp))
 #define PVFS_STATVFS(b, sp,vp, rv)	((rv) = vfs_statvfs(b, sp,vp))
 #define PVFS_SYNC(b, flag,cr, rv)	((rv) = vfs_sync(b, flag,cr))
@@ -156,6 +161,7 @@
 extern int vfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int);
 extern int vfs_showargs(bhv_desc_t *, struct seq_file *);
 extern int vfs_unmount(bhv_desc_t *, int, struct cred *);
+extern int vfs_mntupdate(bhv_desc_t *, int *, struct xfs_mount_args *);
 extern int vfs_root(bhv_desc_t *, struct vnode **);
 extern int vfs_statvfs(bhv_desc_t *, struct statfs *, struct vnode *);
 extern int vfs_sync(bhv_desc_t *, int, struct cred *);
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_vnode.c linux-2.5.68-bk12/fs/xfs/linux/xfs_vnode.c
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_vnode.c	2003-04-19 19:49:09.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_vnode.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
 
 uint64_t vn_generation;		/* vnode generation number */
@@ -40,8 +40,8 @@
  * Dedicated vnode inactive/reclaim sync semaphores.
  * Prime number of hash buckets since address is used as the key.
  */
-#define NVSYNC			37
-#define vptosync(v)		(&vsync[((unsigned long)v) % NVSYNC])
+#define NVSYNC                  37
+#define vptosync(v)             (&vsync[((unsigned long)v) % NVSYNC])
 sv_t vsync[NVSYNC];
 
 /*
diff -urN linux-2.5.68-bk11/fs/xfs/linux/xfs_vnode.h linux-2.5.68-bk12/fs/xfs/linux/xfs_vnode.h
--- linux-2.5.68-bk11/fs/xfs/linux/xfs_vnode.h	2003-04-19 19:51:19.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/linux/xfs_vnode.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -118,11 +118,11 @@
  * Conversion between vnode types/modes and encoded type/mode as
  * seen by stat(2) and mknod(2).
  */
-extern enum vtype	iftovt_tab[];
-extern ushort		vttoif_tab[];
-#define IFTOVT(M)	(iftovt_tab[((M) & S_IFMT) >> 12])
-#define VTTOIF(T)	(vttoif_tab[(int)(T)])
-#define MAKEIMODE(T, M) (VTTOIF(T) | ((M) & ~S_IFMT))
+extern enum vtype       iftovt_tab[];
+extern ushort           vttoif_tab[];
+#define IFTOVT(M)       (iftovt_tab[((M) & S_IFMT) >> 12])
+#define VTTOIF(T)       (vttoif_tab[(int)(T)])
+#define MAKEIMODE(T, M)	(VTTOIF(T) | ((M) & ~S_IFMT))
 
 /*
  * Vnode flags.
@@ -142,8 +142,8 @@
  * VN_INACTIVE_NOCACHE implies that the file system behavior
  * has disassociated its state and bhv_desc_t from the vnode.
  */
-#define VN_INACTIVE_CACHE	0
-#define VN_INACTIVE_NOCACHE	1
+#define	VN_INACTIVE_CACHE	0
+#define	VN_INACTIVE_NOCACHE	1
 
 /*
  * Values for the cmd code given to VOP_VNODE_CHANGE.
@@ -203,10 +203,10 @@
 typedef int	(*vop_reclaim_t)(bhv_desc_t *);
 typedef int	(*vop_attr_get_t)(bhv_desc_t *, char *, char *, int *, int,
 				struct cred *);
-typedef int	(*vop_attr_set_t)(bhv_desc_t *, char *, char *, int, int,
+typedef	int	(*vop_attr_set_t)(bhv_desc_t *, char *, char *, int, int,
 				struct cred *);
-typedef int	(*vop_attr_remove_t)(bhv_desc_t *, char *, int, struct cred *);
-typedef int	(*vop_attr_list_t)(bhv_desc_t *, char *, int, int,
+typedef	int	(*vop_attr_remove_t)(bhv_desc_t *, char *, int, struct cred *);
+typedef	int	(*vop_attr_list_t)(bhv_desc_t *, char *, int, int,
 				struct attrlist_cursor_kern *, struct cred *);
 typedef void	(*vop_link_removed_t)(bhv_desc_t *, vnode_t *, int);
 typedef void	(*vop_vnode_change_t)(bhv_desc_t *, vchange_t, __psint_t);
@@ -218,7 +218,7 @@
 
 
 typedef struct vnodeops {
-	bhv_position_t	vn_position;	/* position within behavior chain */
+	bhv_position_t  vn_position;    /* position within behavior chain */
 	vop_open_t		vop_open;
 	vop_read_t		vop_read;
 	vop_write_t		vop_write;
@@ -274,31 +274,31 @@
 	rv = _VOP_(vop_open, vp)((vp)->v_fbhv, cr)
 #define VOP_GETATTR(vp, vap, f, cr, rv)					\
 	rv = _VOP_(vop_getattr, vp)((vp)->v_fbhv, vap, f, cr)
-#define VOP_SETATTR(vp, vap, f, cr, rv)					\
+#define	VOP_SETATTR(vp, vap, f, cr, rv)					\
 	rv = _VOP_(vop_setattr, vp)((vp)->v_fbhv, vap, f, cr)
-#define VOP_ACCESS(vp, mode, cr, rv)					\
+#define	VOP_ACCESS(vp, mode, cr, rv)					\
 	rv = _VOP_(vop_access, vp)((vp)->v_fbhv, mode, cr)
-#define VOP_LOOKUP(vp,d,vpp,f,rdir,cr,rv)				\
+#define	VOP_LOOKUP(vp,d,vpp,f,rdir,cr,rv)				\
 	rv = _VOP_(vop_lookup, vp)((vp)->v_fbhv,d,vpp,f,rdir,cr)
 #define VOP_CREATE(dvp,d,vap,vpp,cr,rv)					\
 	rv = _VOP_(vop_create, dvp)((dvp)->v_fbhv,d,vap,vpp,cr)
 #define VOP_REMOVE(dvp,d,cr,rv)						\
 	rv = _VOP_(vop_remove, dvp)((dvp)->v_fbhv,d,cr)
-#define VOP_LINK(tdvp,fvp,d,cr,rv)					\
+#define	VOP_LINK(tdvp,fvp,d,cr,rv)					\
 	rv = _VOP_(vop_link, tdvp)((tdvp)->v_fbhv,fvp,d,cr)
-#define VOP_RENAME(fvp,fnm,tdvp,tnm,cr,rv)				\
+#define	VOP_RENAME(fvp,fnm,tdvp,tnm,cr,rv)				\
 	rv = _VOP_(vop_rename, fvp)((fvp)->v_fbhv,fnm,tdvp,tnm,cr)
-#define VOP_MKDIR(dp,d,vap,vpp,cr,rv)					\
+#define	VOP_MKDIR(dp,d,vap,vpp,cr,rv)					\
 	rv = _VOP_(vop_mkdir, dp)((dp)->v_fbhv,d,vap,vpp,cr)
 #define	VOP_RMDIR(dp,d,cr,rv)	 					\
 	rv = _VOP_(vop_rmdir, dp)((dp)->v_fbhv,d,cr)
-#define VOP_READDIR(vp,uiop,cr,eofp,rv)					\
+#define	VOP_READDIR(vp,uiop,cr,eofp,rv)					\
 	rv = _VOP_(vop_readdir, vp)((vp)->v_fbhv,uiop,cr,eofp)
-#define VOP_SYMLINK(dvp,d,vap,tnm,vpp,cr,rv)				\
+#define	VOP_SYMLINK(dvp,d,vap,tnm,vpp,cr,rv)				\
 	rv = _VOP_(vop_symlink, dvp) ((dvp)->v_fbhv,d,vap,tnm,vpp,cr)
-#define VOP_READLINK(vp,uiop,cr,rv)					\
+#define	VOP_READLINK(vp,uiop,cr,rv)					\
 	rv = _VOP_(vop_readlink, vp)((vp)->v_fbhv,uiop,cr)
-#define VOP_FSYNC(vp,f,cr,b,e,rv)					\
+#define	VOP_FSYNC(vp,f,cr,b,e,rv)					\
 	rv = _VOP_(vop_fsync, vp)((vp)->v_fbhv,f,cr,b,e)
 #define VOP_INACTIVE(vp, cr, rv)					\
 	rv = _VOP_(vop_inactive, vp)((vp)->v_fbhv, cr)
@@ -318,11 +318,11 @@
 	rv = _VOP_(vop_reclaim, vp)((vp)->v_fbhv)
 #define VOP_ATTR_GET(vp, name, val, vallenp, fl, cred, rv)		\
 	rv = _VOP_(vop_attr_get, vp)((vp)->v_fbhv,name,val,vallenp,fl,cred)
-#define VOP_ATTR_SET(vp, name, val, vallen, fl, cred, rv)		\
+#define	VOP_ATTR_SET(vp, name, val, vallen, fl, cred, rv)		\
 	rv = _VOP_(vop_attr_set, vp)((vp)->v_fbhv,name,val,vallen,fl,cred)
-#define VOP_ATTR_REMOVE(vp, name, flags, cred, rv)			\
+#define	VOP_ATTR_REMOVE(vp, name, flags, cred, rv)			\
 	rv = _VOP_(vop_attr_remove, vp)((vp)->v_fbhv,name,flags,cred)
-#define VOP_ATTR_LIST(vp, buf, buflen, fl, cursor, cred, rv)		\
+#define	VOP_ATTR_LIST(vp, buf, buflen, fl, cursor, cred, rv)		\
 	rv = _VOP_(vop_attr_list, vp)((vp)->v_fbhv,buf,buflen,fl,cursor,cred)
 #define VOP_LINK_REMOVED(vp, dvp, linkzero)				\
 	(void)_VOP_(vop_link_removed, vp)((vp)->v_fbhv, dvp, linkzero)
@@ -569,12 +569,12 @@
 /*
  * Flags to VOP_SETATTR/VOP_GETATTR.
  */
-#define ATTR_UTIME	0x01	/* non-default utime(2) request */
-#define ATTR_EXEC	0x02	/* invocation from exec(2) */
-#define ATTR_COMM	0x04	/* yield common vp attributes */
-#define ATTR_DMI	0x08	/* invocation from a DMI function */
-#define ATTR_LAZY	0x80	/* set/get attributes lazily */
-#define ATTR_NONBLOCK	0x100	/* return EAGAIN if operation would block */
+#define	ATTR_UTIME	0x01	/* non-default utime(2) request */
+#define	ATTR_EXEC	0x02	/* invocation from exec(2) */
+#define	ATTR_COMM	0x04	/* yield common vp attributes */
+#define	ATTR_DMI	0x08	/* invocation from a DMI function */
+#define	ATTR_LAZY	0x80	/* set/get attributes lazily */
+#define	ATTR_NONBLOCK	0x100	/* return EAGAIN if operation would block */
 #define ATTR_NOLOCK	0x200	/* Don't grab any conflicting locks */
 #define ATTR_NOSIZETOK	0x400	/* Don't get the DVN_SIZE_READ token */
 
@@ -588,33 +588,33 @@
 
 #if (defined(CONFIG_XFS_VNODE_TRACING))
 
-#define VNODE_TRACE_SIZE	16		/* number of trace entries */
+#define	VNODE_TRACE_SIZE	16		/* number of trace entries */
 
 /*
  * Tracing entries.
  */
-#define VNODE_KTRACE_ENTRY	1
-#define VNODE_KTRACE_EXIT	2
-#define VNODE_KTRACE_HOLD	3
-#define VNODE_KTRACE_REF	4
-#define VNODE_KTRACE_RELE	5
+#define	VNODE_KTRACE_ENTRY	1
+#define	VNODE_KTRACE_EXIT	2
+#define	VNODE_KTRACE_HOLD	3
+#define	VNODE_KTRACE_REF	4
+#define	VNODE_KTRACE_RELE	5
 
 extern void vn_trace_entry(struct vnode *, char *, inst_t *);
 extern void vn_trace_exit(struct vnode *, char *, inst_t *);
 extern void vn_trace_hold(struct vnode *, char *, int, inst_t *);
 extern void vn_trace_ref(struct vnode *, char *, int, inst_t *);
 extern void vn_trace_rele(struct vnode *, char *, int, inst_t *);
-#define VN_TRACE(vp)		\
+#define	VN_TRACE(vp)		\
 	vn_trace_ref(vp, __FILE__, __LINE__, (inst_t *)__return_address)
 
 #else	/* ! (defined(CONFIG_XFS_VNODE_TRACING)) */
 
-#define vn_trace_entry(a,b,c)
-#define vn_trace_exit(a,b,c)
-#define vn_trace_hold(a,b,c,d)
-#define vn_trace_ref(a,b,c,d)
-#define vn_trace_rele(a,b,c,d)
-#define VN_TRACE(vp)
+#define	vn_trace_entry(a,b,c)
+#define	vn_trace_exit(a,b,c)
+#define	vn_trace_hold(a,b,c,d)
+#define	vn_trace_ref(a,b,c,d)
+#define	vn_trace_rele(a,b,c,d)
+#define	VN_TRACE(vp)
 
 #endif	/* ! (defined(CONFIG_XFS_VNODE_TRACING)) */
 
diff -urN linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf.c linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf.c
--- linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -40,7 +40,7 @@
  *	cached pages for I/O.
  *
  *
- *	Written by Steve Lord, Jim Mostek, Russell Cattelan
+ *      Written by Steve Lord, Jim Mostek, Russell Cattelan
  *		    and Rajagopal Ananthanarayanan ("ananth") at SGI.
  *
  */
@@ -80,7 +80,7 @@
 struct pagebuf_trace_buf	pb_trace;
 EXPORT_SYMBOL(pb_trace);
 EXPORT_SYMBOL(pb_trace_func);
-#define CIRC_INC(i)	(((i) + 1) & (PB_TRACE_BUFSIZE - 1))
+#define CIRC_INC(i)     (((i) + 1) & (PB_TRACE_BUFSIZE - 1))
 
 void
 pb_trace_func(
@@ -129,7 +129,7 @@
  * /proc/sys/vm/pagebuf
  */
 
-unsigned long pagebuf_min[P_PARAM] = {	HZ/2,	1*HZ, 0, 0 };
+unsigned long pagebuf_min[P_PARAM] = {  HZ/2,   1*HZ, 0, 0 };
 unsigned long pagebuf_max[P_PARAM] = { HZ*30, HZ*300, 1, 1 };
 
 pagebuf_param_t pb_params = {{ HZ, 15 * HZ, 0, 0 }};
@@ -194,13 +194,13 @@
 
 STATIC void *pagebuf_mapout_locked(page_buf_t *);
 
-STATIC	spinlock_t		as_lock = SPIN_LOCK_UNLOCKED;
+STATIC  spinlock_t              as_lock = SPIN_LOCK_UNLOCKED;
 typedef struct a_list {
 	void	*vm_addr;
 	struct a_list	*next;
 } a_list_t;
-STATIC	a_list_t	*as_free_head;
-STATIC	int		as_list_len;
+STATIC  a_list_t	*as_free_head;
+STATIC  int		as_list_len;
 
 
 /*
@@ -251,7 +251,7 @@
  *
  *	Buffers associated with inodes for which buffer locking
  *	is not enabled are not protected by semaphores, and are
- *	assumed to be exclusively owned by the caller.	There is
+ *	assumed to be exclusively owned by the caller.  There is
  *	spinlock in the buffer, for use by the caller when concurrent
  *	access is possible.
  */
@@ -549,7 +549,7 @@
 		/* A single page buffer is always mappable */
 		if (page_count == 1) {
 			pb->pb_addr = (caddr_t)
-			    	page_address(pb->pb_pages[0]) + pb->pb_offset;
+				page_address(pb->pb_pages[0]) + pb->pb_offset;
 			pb->pb_flags |= PBF_MAPPED;
 		} else if (flags & PBF_MAPPED) {
 			if (as_list_len > 64)
@@ -701,8 +701,8 @@
  *
  *	pagebuf_find returns a buffer matching the specified range of
  *	data for the specified target, if any of the relevant blocks
- *	are in memory.	The buffer may have unallocated holes, if
- *	some, but not all, of the blocks are in memory.	 Even where
+ *	are in memory.  The buffer may have unallocated holes, if
+ *	some, but not all, of the blocks are in memory.  Even where
  *	pages are present in the buffer, not all of every page may be
  *	valid.
  */
@@ -728,7 +728,7 @@
  */
 page_buf_t *
 pagebuf_get(				/* allocate a buffer		*/
-	pb_target_t		*target,/* target for buffer 		*/
+	pb_target_t		*target,/* target for buffer		*/
 	loff_t			ioff,	/* starting offset of range	*/
 	size_t			isize,	/* length of range		*/
 	page_buf_flags_t	flags)	/* PBF_TRYLOCK			*/
@@ -846,7 +846,7 @@
 	void			*addr)
 {
 	if (((unsigned long)addr < VMALLOC_START) ||
-            ((unsigned long)addr >= VMALLOC_END)) {
+	    ((unsigned long)addr >= VMALLOC_END)) {
 		return virt_to_page(addr);
 	} else {
 		return vmalloc_to_page(addr);
@@ -1049,7 +1049,7 @@
  *	pagebuf_pin
  *
  *	pagebuf_pin locks all of the memory represented by a buffer in
- *	memory.	 Multiple calls to pagebuf_pin and pagebuf_unpin, for
+ *	memory.  Multiple calls to pagebuf_pin and pagebuf_unpin, for
  *	the same or different buffers affecting a given page, will
  *	properly count the number of outstanding "pin" requests.  The
  *	buffer may be released after the pagebuf_pin and a different
@@ -1095,7 +1095,7 @@
  *	pagebuf_wait_unpin
  *
  *	pagebuf_wait_unpin waits until all of the memory associated
- *	with the buffer is not longer locked in memory.	 It returns
+ *	with the buffer is not longer locked in memory.  It returns
  *	immediately if none of the affected pages are locked.
  */
 static inline void
@@ -1575,6 +1575,13 @@
 	spin_unlock(&pbd_delwrite_lock);
 }
 
+STATIC void
+pagebuf_runall_queues(
+	struct workqueue_struct	*queue)
+{
+	flush_workqueue(queue);
+}
+
 /* Defines for pagebuf daemon */
 DECLARE_WAIT_QUEUE_HEAD(pbd_waitq);
 STATIC int force_flush;
@@ -1680,10 +1687,13 @@
 	page_buf_t		*pb;
 	struct list_head	*curr, *next, tmp;
 	int			pincount = 0;
+	int			flush_cnt = 0;
 
 	spin_lock(&pbd_delwrite_lock);
 	INIT_LIST_HEAD(&tmp);
 
+	pagebuf_runall_queues(pagebuf_dataio_workqueue);
+
 	list_for_each_safe(curr, next, &pbd_delwrite_queue) {
 		pb = list_entry(curr, page_buf_t, pb_list);
 
@@ -1725,6 +1735,10 @@
 		pb->pb_flags |= PBF_WRITE;
 
 		__pagebuf_iorequest(pb);
+		if (++flush_cnt > 32) {
+			pagebuf_run_queues(NULL);
+			flush_cnt = 0;
+		}
 
 		spin_lock(&pbd_delwrite_lock);
 	}
@@ -1776,7 +1790,7 @@
 
 /*
  * pagebuf_daemon_stop
- * 
+ *
  * Note: do not mark as __exit, it is called from pagebuf_terminate.
  */
 STATIC void
@@ -1845,7 +1859,7 @@
 };
 
 STATIC ctl_table pagebuf_root_table[] = {
-	{CTL_VM, "vm",	NULL, 0, 0555, pagebuf_dir_table},
+	{CTL_VM, "vm",  NULL, 0, 0555, pagebuf_dir_table},
 	{0}
 };
 
@@ -1881,7 +1895,7 @@
 
 	return len;
 }
-#endif	/* CONFIG_PROC_FS */
+#endif  /* CONFIG_PROC_FS */
 
 STATIC void
 pagebuf_shaker(void)
@@ -1935,8 +1949,8 @@
 
 
 /*
- *	pagebuf_terminate. 
- * 
+ *	pagebuf_terminate.
+ *
  *	Note: do not mark as __exit, this is also called from the __init code.
  */
 void
@@ -1948,7 +1962,7 @@
 	kmem_shake_deregister(pagebuf_shaker);
 
 	unregister_sysctl_table(pagebuf_table_header);
-#ifdef	CONFIG_PROC_FS
+#ifdef  CONFIG_PROC_FS
 	remove_proc_entry("fs/pagebuf/stat", NULL);
 	remove_proc_entry("fs/pagebuf", NULL);
 #endif
diff -urN linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf.h linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf.h
--- linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf.h	2003-04-19 19:49:59.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -83,17 +83,31 @@
 					/* but uninitialized file data	*/
 } bmap_flags_t;
 
+typedef enum {
+	/* base extent manipulation calls */
+	BMAP_READ = (1 << 0),		/* read extents */
+	BMAP_WRITE = (1 << 1),		/* create extents */
+	BMAP_ALLOCATE = (1 << 2),	/* delayed allocate to real extents */
+	BMAP_UNWRITTEN  = (1 << 3),	/* unwritten extents to real extents */
+	/* modifiers */
+	BMAP_IGNSTATE = (1 << 4),	/* ignore unwritten state on read */
+	BMAP_DIRECT = (1 << 5),		/* direct instead of buffered write */
+	BMAP_MMAP = (1 << 6),		/* allocate for mmap write */
+	BMAP_SYNC = (1 << 7),		/* sync write */
+	BMAP_TRYLOCK = (1 << 8),	/* non-blocking request */
+} bmapi_flags_t;
+
 typedef enum page_buf_flags_e {		/* pb_flags values */
 	PBF_READ = (1 << 0),	/* buffer intended for reading from device */
 	PBF_WRITE = (1 << 1),	/* buffer intended for writing to device   */
-	PBF_MAPPED = (1 << 2),	/* buffer mapped (pb_addr valid)	   */
-	PBF_PARTIAL = (1 << 3), /* buffer partially read		   */
-	PBF_ASYNC = (1 << 4),	/* initiator will not wait for completion  */
-	PBF_NONE = (1 << 5),	/* buffer not read at all		   */
-	PBF_DELWRI = (1 << 6),	/* buffer has dirty pages		   */
-	PBF_FREED = (1 << 7),	/* buffer has been freed and is invalid	   */
-	PBF_SYNC = (1 << 8),	/* force updates to disk		   */
-	PBF_MAPPABLE = (1 << 9),/* use directly-addressable pages	   */
+	PBF_MAPPED = (1 << 2),  /* buffer mapped (pb_addr valid)           */
+	PBF_PARTIAL = (1 << 3), /* buffer partially read                   */
+	PBF_ASYNC = (1 << 4),   /* initiator will not wait for completion  */
+	PBF_NONE = (1 << 5),    /* buffer not read at all                  */
+	PBF_DELWRI = (1 << 6),  /* buffer has dirty pages                  */
+	PBF_FREED = (1 << 7),   /* buffer has been freed and is invalid    */
+	PBF_SYNC = (1 << 8),    /* force updates to disk                   */
+	PBF_MAPPABLE = (1 << 9),/* use directly-addressable pages          */
 	PBF_STALE = (1 << 10),	/* buffer has been staled, do not find it  */
 	PBF_FS_MANAGED = (1 << 11), /* filesystem controls freeing memory  */
 	PBF_FS_DATAIOD = (1 << 12), /* schedule IO completion on fs datad  */
@@ -101,20 +115,18 @@
 	/* flags used only as arguments to access routines */
 	PBF_LOCK = (1 << 13),	/* lock requested			   */
 	PBF_TRYLOCK = (1 << 14), /* lock requested, but do not wait	   */
-	PBF_FILE_ALLOCATE = (1 << 15), /* allocate all file space	   */
-	PBF_DONT_BLOCK = (1 << 16), /* do not block in current thread	   */
-	PBF_DIRECT = (1 << 17),	/* direct I/O desired			   */
-	PBF_FILE_UNWRITTEN = (1 << 18), /* convert unwritten extent space  */
+	PBF_DONT_BLOCK = (1 << 15), /* do not block in current thread	   */
 
 	/* flags used only internally */
-	_PBF_LOCKABLE = (1 << 19), /* page_buf_t may be locked		   */
-	_PBF_ALL_PAGES_MAPPED = (1 << 21), /* all pages in range mapped	   */
-	_PBF_ADDR_ALLOCATED = (1 << 22), /* pb_addr space was allocated	   */
-	_PBF_MEM_ALLOCATED = (1 << 23), /* pb_mem+underlying pages alloc'd */
-
-	PBF_FORCEIO = (1 << 24),
-	PBF_FLUSH = (1 << 25),	/* flush disk write cache		   */
-	PBF_READ_AHEAD = (1 << 26),
+	_PBF_LOCKABLE = (1 << 16), /* page_buf_t may be locked		   */
+	_PBF_PRIVATE_BH = (1 << 17), /* do not use public buffer heads	   */
+	_PBF_ALL_PAGES_MAPPED = (1 << 18), /* all pages in range mapped	   */
+	_PBF_ADDR_ALLOCATED = (1 << 19), /* pb_addr space was allocated	   */
+	_PBF_MEM_ALLOCATED = (1 << 20), /* pb_mem+underlying pages alloc'd */
+
+	PBF_FORCEIO = (1 << 21),
+	PBF_FLUSH = (1 << 22),	/* flush disk write cache		   */
+	PBF_READ_AHEAD = (1 << 23),
 
 } page_buf_flags_t;
 
@@ -170,10 +182,10 @@
  * This buffer structure is used by the page cache buffer management routines
  * to refer to an assembly of pages forming a logical buffer.  The actual
  * I/O is performed with buffer_head or bio structures, as required by drivers,
- * for drivers which do not understand this structure.	The buffer structure is
+ * for drivers which do not understand this structure.  The buffer structure is
  * used on temporary basis only, and discarded when released.
  *
- * The real data storage is recorded in the page cache.	 Metadata is
+ * The real data storage is recorded in the page cache.  Metadata is
  * hashed to the inode for the block device on which the file system resides.
  * File data is hashed to the inode for the file.  Pages which are only
  * partially filled with data have bits set in their block_map entry
@@ -200,7 +212,7 @@
 	struct pb_target	*pb_target;	/* logical object */
 	atomic_t		pb_hold;	/* reference count */
 	page_buf_daddr_t	pb_bn;		/* block number for I/O */
-	loff_t			pb_file_offset; /* offset in file */
+	loff_t			pb_file_offset;	/* offset in file */
 	size_t			pb_buffer_length; /* size of buffer in bytes */
 	size_t			pb_count_desired; /* desired transfer size */
 	void			*pb_addr;	/* virtual address of buffer */
@@ -241,10 +253,10 @@
 
 extern page_buf_t *pagebuf_get(		/* allocate a buffer		*/
 		struct pb_target *,	/* inode for buffer		*/
-		loff_t,			/* starting offset of range	*/
-		size_t,			/* length of range		*/
+		loff_t,			/* starting offset of range     */
+		size_t,			/* length of range              */
 		page_buf_flags_t);	/* PBF_LOCK, PBF_READ,		*/
-					/* PBF_ASYNC			*/	
+					/* PBF_ASYNC			*/
 
 extern page_buf_t *pagebuf_lookup(
 		struct pb_target *,
@@ -253,7 +265,7 @@
 		page_buf_flags_t);	/* PBF_READ, PBF_WRITE,		*/
 					/* PBF_FORCEIO, _PBF_LOCKABLE	*/
 
-extern page_buf_t *pagebuf_get_empty(	/* allocate pagebuf struct with */
+extern page_buf_t *pagebuf_get_empty(	/* allocate pagebuf struct with	*/
 					/*  no memory or disk address	*/
 		struct pb_target *);	/* mount point "fake" inode	*/
 
@@ -273,8 +285,8 @@
 
 extern void pagebuf_readahead(		/* read ahead into cache	*/
 		struct pb_target  *,	/* target for buffer (or NULL)	*/
-		loff_t,			/* starting offset of range	*/
-		size_t,			/* length of range		*/
+		loff_t,			/* starting offset of range     */
+		size_t,			/* length of range              */
 		page_buf_flags_t);	/* additional read flags	*/
 
 /* Writing and Releasing Buffers */
@@ -292,10 +304,10 @@
 		page_buf_t *);		/* buffer to lock		*/
 
 extern int pagebuf_lock_value(		/* return count on lock		*/
-		page_buf_t *);		/* buffer to check		*/
+		page_buf_t *);          /* buffer to check              */
 
-extern int pagebuf_lock(		/* lock buffer			*/
-		page_buf_t *);		/* buffer to lock		*/
+extern int pagebuf_lock(		/* lock buffer                  */
+		page_buf_t *);          /* buffer to lock               */
 
 extern void pagebuf_unlock(		/* unlock buffer		*/
 		page_buf_t *);		/* buffer to unlock		*/
@@ -310,9 +322,9 @@
 		page_buf_t *,		/* buffer to mark		*/
 		int,			/* use data/log helper thread.	*/
 		int);			/* run completion locally, or in
-					 * a helper thread. 		*/
+					 * a helper thread.		*/
 
-extern void pagebuf_ioerror(		/* mark buffer in error (or not) */
+extern void pagebuf_ioerror(		/* mark buffer in error	(or not) */
 		page_buf_t *,		/* buffer to mark		*/
 		unsigned int);		/* error to store (0 if none)	*/
 
diff -urN linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf_internal.h linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf_internal.h
--- linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf_internal.h	2003-04-19 19:49:25.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf_internal.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -79,20 +79,20 @@
 };
 
 #define PB_TRACE_BUFSIZE	1024
-#define CIRC_INC(i)	(((i) + 1) & (PB_TRACE_BUFSIZE - 1))
+#define CIRC_INC(i)     (((i) + 1) & (PB_TRACE_BUFSIZE - 1))
 
 /*
  * Tunable pagebuf parameters
  */
 
-#define P_PARAM 4
+#define P_PARAM	4
 
 typedef union pagebuf_param {
 	struct {
-		ulong	flush_interval; /* interval between runs of the
-					 * delwri flush daemon.	 */
+		ulong	flush_interval;	/* interval between runs of the
+					 * delwri flush daemon.  */
 		ulong	age_buffer;	/* time for buffer to age before
-					 * we flush it.	 */
+					 * we flush it.  */
 		ulong	debug;		/* debug tracing on or off */
 		ulong	stats_clear;	/* clear the pagebuf stats */
 	} p_un;
@@ -129,7 +129,7 @@
 #define PB_STATS_INC(count)	( count ++ )
 
 #ifndef STATIC
-# define STATIC static
+# define STATIC	static
 #endif
 
 #endif /* __PAGE_BUF_PRIVATE_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf_locking.c linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf_locking.c
--- linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf_locking.c	2003-04-19 19:49:54.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf_locking.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -40,7 +40,7 @@
  *	cached pages for I/O.  The page_buf_locking module adds support for
  *	locking such page buffers.
  *
- *	Written by Steve Lord at SGI
+ *      Written by Steve Lord at SGI
  *
  */
 
diff -urN linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf_trace.h linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf_trace.h
--- linux-2.5.68-bk11/fs/xfs/pagebuf/page_buf_trace.h	2003-04-19 19:49:58.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/pagebuf/page_buf_trace.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -35,11 +35,11 @@
 
 #ifdef PB_DEFINE_TRACES
 #define PB_TRACE_START	typedef enum {
-#define PB_TRACE_REC(x) pb_trace_point_##x
+#define PB_TRACE_REC(x)	pb_trace_point_##x
 #define PB_TRACE_END	} pb_trace_var_t;
 #else
 #define PB_TRACE_START	static char	*event_names[] = {
-#define PB_TRACE_REC(x) #x
+#define PB_TRACE_REC(x)	#x
 #define PB_TRACE_END	};
 #endif
 
@@ -86,7 +86,7 @@
 extern void pb_trace_func(page_buf_t *, int, void *, void *);
 #ifdef PAGEBUF_TRACE
 # define PB_TRACE(pb, event, misc)		\
-	pb_trace_func(pb, event, (void *) misc, \
+	pb_trace_func(pb, event, (void *) misc,	\
 			(void *)__builtin_return_address(0))
 #else
 # define PB_TRACE(pb, event, misc)	do { } while (0)
diff -urN linux-2.5.68-bk11/fs/xfs/quota/xfs_dquot.c linux-2.5.68-bk12/fs/xfs/quota/xfs_dquot.c
--- linux-2.5.68-bk11/fs/xfs/quota/xfs_dquot.c	2003-04-19 19:49:25.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/quota/xfs_dquot.c	2003-05-04 04:41:49.000000000 -0700
@@ -30,7 +30,43 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_trans_space.h"
+#include "xfs_trans_priv.h"
+
 #include "xfs_qm.h"
 
 
diff -urN linux-2.5.68-bk11/fs/xfs/quota/xfs_dquot_item.c linux-2.5.68-bk12/fs/xfs/quota/xfs_dquot_item.c
--- linux-2.5.68-bk11/fs/xfs/quota/xfs_dquot_item.c	2003-04-19 19:48:52.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/quota/xfs_dquot_item.c	2003-05-04 04:41:49.000000000 -0700
@@ -30,7 +30,42 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_trans_priv.h"
+
 #include "xfs_qm.h"
 
 
diff -urN linux-2.5.68-bk11/fs/xfs/quota/xfs_qm.c linux-2.5.68-bk12/fs/xfs/quota/xfs_qm.c
--- linux-2.5.68-bk11/fs/xfs/quota/xfs_qm.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/quota/xfs_qm.c	2003-05-04 04:41:49.000000000 -0700
@@ -30,7 +30,44 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_clnt.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_trans_space.h"
+#include "xfs_utils.h"
+
 #include "xfs_qm.h"
 
 /*
diff -urN linux-2.5.68-bk11/fs/xfs/quota/xfs_qm_bhv.c linux-2.5.68-bk12/fs/xfs/quota/xfs_qm_bhv.c
--- linux-2.5.68-bk11/fs/xfs/quota/xfs_qm_bhv.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/quota/xfs_qm_bhv.c	2003-05-04 04:41:49.000000000 -0700
@@ -30,8 +30,41 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-#include <linux/init.h>
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_clnt.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+
 #include "xfs_qm.h"
 
 #define MNTOPT_QUOTA	"quota"		/* disk quotas (user) */
diff -urN linux-2.5.68-bk11/fs/xfs/quota/xfs_qm_stats.c linux-2.5.68-bk12/fs/xfs/quota/xfs_qm_stats.c
--- linux-2.5.68-bk11/fs/xfs/quota/xfs_qm_stats.c	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/quota/xfs_qm_stats.c	2003-05-04 04:41:49.000000000 -0700
@@ -30,8 +30,40 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-#include <linux/proc_fs.h>
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+
 #include "xfs_qm.h"
 
 struct xqmstats xqmstats;
diff -urN linux-2.5.68-bk11/fs/xfs/quota/xfs_qm_syscalls.c linux-2.5.68-bk12/fs/xfs/quota/xfs_qm_syscalls.c
--- linux-2.5.68-bk11/fs/xfs/quota/xfs_qm_syscalls.c	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/quota/xfs_qm_syscalls.c	2003-05-04 04:41:49.000000000 -0700
@@ -30,7 +30,41 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_utils.h"
+
 #include "xfs_qm.h"
 
 #ifdef DEBUG
@@ -69,11 +103,11 @@
 	xfs_caddr_t	addr)
 {
 	xfs_mount_t	*mp;
-	int 		error;
+	int		error;
 	struct vfs	*vfsp;
 
 	vfsp = bhvtovfs(bdp);
-        mp = XFS_VFSTOM(vfsp);
+	mp = XFS_VFSTOM(vfsp);
 
 	if (addr == NULL && cmd != Q_SYNC)
 		return XFS_ERROR(EINVAL);
@@ -84,7 +118,7 @@
 	 * The following commands are valid even when quotaoff.
 	 */
 	switch (cmd) {
-	      	/* 
+		/*
 		 * truncate quota files. quota must be off.
 		 */
 	      case Q_XQUOTARM:
@@ -92,7 +126,7 @@
 			return XFS_ERROR(EINVAL);
 		if (vfsp->vfs_flag & VFS_RDONLY)
 			return XFS_ERROR(EROFS);
-		return (xfs_qm_scall_trunc_qfiles(mp, 
+		return (xfs_qm_scall_trunc_qfiles(mp,
 			       xfs_qm_import_qtype_flags(*(uint *)addr)));
 		/*
 		 * Get quota status information.
@@ -116,7 +150,7 @@
 		if (vfsp->vfs_flag & VFS_RDONLY)
 			return XFS_ERROR(EROFS);
 		break;
-		
+
 	      default:
 		break;
 	}
@@ -133,11 +167,11 @@
 					    B_FALSE);
 		break;
 
-		/* 
-		 * Defaults to XFS_GETUQUOTA. 
+		/*
+		 * Defaults to XFS_GETUQUOTA.
 		 */
 	      case Q_XGETQUOTA:
-		error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_USER, 
+		error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_USER,
 					(fs_disk_quota_t *)addr);
 		break;
 		/*
@@ -157,9 +191,9 @@
 					     (fs_disk_quota_t *)addr);
 		break;
 
-	      		
+
 	      case Q_XGETGQUOTA:
-		error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_GROUP, 
+		error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_GROUP,
 					(fs_disk_quota_t *)addr);
 		break;
 
diff -urN linux-2.5.68-bk11/fs/xfs/quota/xfs_trans_dquot.c linux-2.5.68-bk12/fs/xfs/quota/xfs_trans_dquot.c
--- linux-2.5.68-bk11/fs/xfs/quota/xfs_trans_dquot.c	2003-04-19 19:48:53.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/quota/xfs_trans_dquot.c	2003-05-04 04:41:49.000000000 -0700
@@ -30,7 +30,42 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_trans_priv.h"
+
 #include "xfs_qm.h"
 
 STATIC void	xfs_trans_alloc_dqinfo(xfs_trans_t *);
diff -urN linux-2.5.68-bk11/fs/xfs/support/debug.c linux-2.5.68-bk12/fs/xfs/support/debug.c
--- linux-2.5.68-bk11/fs/xfs/support/debug.c	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/debug.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -38,7 +38,7 @@
 
 int			doass = 1;
 static char		message[256];	/* keep it off the stack */
-static spinlock_t 	xfs_err_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t	xfs_err_lock = SPIN_LOCK_UNLOCKED;
 
 /* Translate from CE_FOO to KERN_FOO, err_level(CE_FOO) == KERN_FOO */
 #define XFS_MAX_ERR_LEVEL	7
diff -urN linux-2.5.68-bk11/fs/xfs/support/debug.h linux-2.5.68-bk12/fs/xfs/support/debug.h
--- linux-2.5.68-bk11/fs/xfs/support/debug.h	2003-04-19 19:51:22.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/debug.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,17 +29,17 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_SUPPORT_DEBUG_H__
-#define __XFS_SUPPORT_DEBUG_H__
+#ifndef	__XFS_SUPPORT_DEBUG_H__
+#define	__XFS_SUPPORT_DEBUG_H__
 
 #include <stdarg.h>
 
-#define CE_DEBUG	7		/* debug	*/
-#define CE_CONT		6		/* continuation */
-#define CE_NOTE		5		/* notice	*/
-#define CE_WARN		4		/* warning	*/
-#define CE_ALERT	1		/* alert	*/
-#define CE_PANIC	0		/* panic	*/
+#define CE_DEBUG        7               /* debug        */
+#define CE_CONT         6               /* continuation */
+#define CE_NOTE         5               /* notice       */
+#define CE_WARN         4               /* warning      */
+#define CE_ALERT        1               /* alert        */
+#define CE_PANIC        0               /* panic        */
 
 extern void icmn_err(int, char *, va_list);
 extern void cmn_err(int, char *, ...);
@@ -49,7 +49,7 @@
 #  define ASSERT(EX)	((void)0) /* avoid "constant in conditional" babble */
 # else
 #  define ASSERT(EX) ((!doass||(EX))?((void)0):assfail(#EX, __FILE__, __LINE__))
-# endif /* lint */
+# endif	/* lint */
 #else
 # define ASSERT(x)	((void)0)
 #endif
@@ -62,6 +62,6 @@
 #endif
 
 #define ASSERT_ALWAYS(EX)  ((EX)?((void)0):assfail(#EX, __FILE__, __LINE__))
-#define debug_stop_all_cpus(param)	/* param is "cpumask_t *" */
+#define	debug_stop_all_cpus(param)	/* param is "cpumask_t *" */
 
-#endif	/* __XFS_SUPPORT_DEBUG_H__ */
+#endif  /* __XFS_SUPPORT_DEBUG_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/support/kmem.c linux-2.5.68-bk12/fs/xfs/support/kmem.c
--- linux-2.5.68-bk11/fs/xfs/support/kmem.c	2003-04-19 19:49:30.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/kmem.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -162,7 +162,7 @@
 kmem_free(void *ptr, size_t size)
 {
 	if (((unsigned long)ptr < VMALLOC_START) ||
-            ((unsigned long)ptr >= VMALLOC_END)) {
+	    ((unsigned long)ptr >= VMALLOC_END)) {
 		kfree(ptr);
 	} else {
 		vfree(ptr);
diff -urN linux-2.5.68-bk11/fs/xfs/support/kmem.h linux-2.5.68-bk12/fs/xfs/support/kmem.h
--- linux-2.5.68-bk11/fs/xfs/support/kmem.h	2003-04-19 19:51:23.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/kmem.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -47,12 +47,12 @@
 extern kmem_zone_t  *kmem_zone_init(int, char *);
 extern void	    *kmem_zone_zalloc(kmem_zone_t *, int);
 extern void	    *kmem_zone_alloc(kmem_zone_t *, int);
-extern void	    kmem_zone_free(kmem_zone_t *, void *);
+extern void         kmem_zone_free(kmem_zone_t *, void *);
 
 extern void	    *kmem_alloc(size_t, int);
 extern void	    *kmem_realloc(void *, size_t, size_t, int);
 extern void	    *kmem_zalloc(size_t, int);
-extern void	    kmem_free(void *, size_t);
+extern void         kmem_free(void *, size_t);
 
 typedef void	    (*kmem_shake_func_t)(void);
 
diff -urN linux-2.5.68-bk11/fs/xfs/support/ktrace.c linux-2.5.68-bk12/fs/xfs/support/ktrace.c
--- linux-2.5.68-bk11/fs/xfs/support/ktrace.c	2003-04-19 19:49:12.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/ktrace.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -31,6 +31,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/types.h>
 #include <linux/slab.h>
 
 #include <xfs_types.h>
@@ -43,7 +44,7 @@
 
 static kmem_zone_t *ktrace_hdr_zone;
 static kmem_zone_t *ktrace_ent_zone;
-static int	    ktrace_zentries;
+static int          ktrace_zentries;
 
 void
 ktrace_init(int zentries)
@@ -76,8 +77,8 @@
 ktrace_t *
 ktrace_alloc(int nentries, int sleep)
 {
-	ktrace_t	*ktp;
-	ktrace_entry_t	*ktep;
+	ktrace_t        *ktp;
+	ktrace_entry_t  *ktep;
 
 	ktp = (ktrace_t*)kmem_zone_alloc(ktrace_hdr_zone, sleep);
 
@@ -116,9 +117,9 @@
 
 	spinlock_init(&(ktp->kt_lock), "kt_lock");
 
-	ktp->kt_entries	 = ktep;
+	ktp->kt_entries  = ktep;
 	ktp->kt_nentries = nentries;
-	ktp->kt_index	 = 0;
+	ktp->kt_index    = 0;
 	ktp->kt_rollover = 0;
 
 	return ktp;
@@ -134,7 +135,7 @@
 void
 ktrace_free(ktrace_t *ktp)
 {
-	int	entries_size;
+	int     entries_size;
 
 	if (ktp == (ktrace_t *)NULL)
 		return;
@@ -162,27 +163,27 @@
  */
 void
 ktrace_enter(
-	ktrace_t	*ktp,
-	void		*val0,
-	void		*val1,
-	void		*val2,
-	void		*val3,
-	void		*val4,
-	void		*val5,
-	void		*val6,
-	void		*val7,
-	void		*val8,
-	void		*val9,
-	void		*val10,
-	void		*val11,
-	void		*val12,
-	void		*val13,
-	void		*val14,
-	void		*val15)
+	ktrace_t        *ktp,
+	void            *val0,
+	void            *val1,
+	void            *val2,
+	void            *val3,
+	void            *val4,
+	void            *val5,
+	void            *val6,
+	void            *val7,
+	void            *val8,
+	void            *val9,
+	void            *val10,
+	void            *val11,
+	void            *val12,
+	void            *val13,
+	void            *val14,
+	void            *val15)
 {
 	static lock_t   wrap_lock = SPIN_LOCK_UNLOCKED;
-	int		index;
-	ktrace_entry_t	*ktep;
+	int             index;
+	ktrace_entry_t  *ktep;
 
 	ASSERT(ktp != NULL);
 
@@ -225,7 +226,7 @@
  */
 int
 ktrace_nentries(
-	ktrace_t	*ktp)
+	ktrace_t        *ktp)
 {
 	if (ktp == NULL) {
 		return 0;
@@ -246,15 +247,15 @@
  *
  * The caller must pass in a pointer to a ktrace_snap
  * structure in which we will keep some state used to
- * iterate through the buffer.	This state must not touched
+ * iterate through the buffer.  This state must not touched
  * by any code outside of this module.
  */
 ktrace_entry_t *
-ktrace_first(ktrace_t	*ktp, ktrace_snap_t	*ktsp)
+ktrace_first(ktrace_t   *ktp, ktrace_snap_t     *ktsp)
 {
-	ktrace_entry_t	*ktep;
-	int		index;
-	int		nentries;
+	ktrace_entry_t  *ktep;
+	int             index;
+	int             nentries;
 
 	if (ktp->kt_rollover)
 		index = ktp->kt_index;
@@ -288,11 +289,11 @@
  */
 ktrace_entry_t *
 ktrace_next(
-	ktrace_t	*ktp,
-	ktrace_snap_t	*ktsp)
+	ktrace_t        *ktp,
+	ktrace_snap_t   *ktsp)
 {
-	int		index;
-	ktrace_entry_t	*ktep;
+	int             index;
+	ktrace_entry_t  *ktep;
 
 	index = ktsp->ks_index;
 	if (index == ktsp->ks_start) {
@@ -325,14 +326,14 @@
 
 ktrace_entry_t *
 ktrace_skip(
-	ktrace_t	*ktp,
-	int		count,
-	ktrace_snap_t	*ktsp)
+	ktrace_t        *ktp,
+	int             count,
+	ktrace_snap_t   *ktsp)
 {
-	int		index;
-	int		new_index;
-	ktrace_entry_t	*ktep;
-	int		nentries = ktrace_nentries(ktp);
+	int             index;
+	int             new_index;
+	ktrace_entry_t  *ktep;
+	int             nentries = ktrace_nentries(ktp);
 
 	index = ktsp->ks_index;
 	new_index = index + count;
diff -urN linux-2.5.68-bk11/fs/xfs/support/ktrace.h linux-2.5.68-bk12/fs/xfs/support/ktrace.h
--- linux-2.5.68-bk11/fs/xfs/support/ktrace.h	2003-04-19 19:49:34.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/ktrace.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -90,15 +90,15 @@
 	void		*,
 	void		*);
 
-extern ktrace_entry_t	*ktrace_first(ktrace_t *, ktrace_snap_t *);
-extern int		ktrace_nentries(ktrace_t *);
-extern ktrace_entry_t	*ktrace_next(ktrace_t *, ktrace_snap_t *);
-extern ktrace_entry_t	*ktrace_skip(ktrace_t *, int, ktrace_snap_t *);
+extern ktrace_entry_t   *ktrace_first(ktrace_t *, ktrace_snap_t *);
+extern int              ktrace_nentries(ktrace_t *);
+extern ktrace_entry_t   *ktrace_next(ktrace_t *, ktrace_snap_t *);
+extern ktrace_entry_t   *ktrace_skip(ktrace_t *, int, ktrace_snap_t *);
 
 #else
 
-#define ktrace_free(ktp)
-#define ktrace_enter(ktp,v0,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15)
+#define	ktrace_free(ktp)
+#define	ktrace_enter(ktp,v0,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15)
 
 #endif
 
diff -urN linux-2.5.68-bk11/fs/xfs/support/move.c linux-2.5.68-bk12/fs/xfs/support/move.c
--- linux-2.5.68-bk11/fs/xfs/support/move.c	2003-04-19 19:49:54.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/move.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -41,7 +41,7 @@
 /*
  * Move "n" bytes at byte address "cp"; "rw" indicates the direction
  * of the move, and the I/O parameters are provided in "uio", which is
- * update to reflect the data which was moved.	Returns 0 on success or
+ * update to reflect the data which was moved.  Returns 0 on success or
  * a non-zero errno on failure.
  */
 int
diff -urN linux-2.5.68-bk11/fs/xfs/support/move.h linux-2.5.68-bk12/fs/xfs/support/move.h
--- linux-2.5.68-bk11/fs/xfs/support/move.h	2003-04-19 19:49:27.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/move.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -39,12 +39,12 @@
 typedef struct iovec iovec_t;
 
 typedef struct uio {
-	iovec_t		*uio_iov;	/* pointer to array of iovecs */
-	int		uio_iovcnt;	/* number of iovecs */
-	int		uio_fmode;	/* file mode flags */
-	xfs_off_t	uio_offset;	/* file offset */
-	short		uio_segflg;	/* address space (kernel or user) */
-	ssize_t		uio_resid;	/* residual count */
+	iovec_t         *uio_iov;       /* pointer to array of iovecs */
+	int             uio_iovcnt;     /* number of iovecs */
+	int             uio_fmode;      /* file mode flags */
+	xfs_off_t       uio_offset;     /* file offset */
+	short           uio_segflg;     /* address space (kernel or user) */
+	ssize_t         uio_resid;      /* residual count */
 } uio_t;
 
 /*
@@ -56,11 +56,11 @@
  * Segment flag values.
  */
 typedef enum uio_seg {
-	UIO_USERSPACE,		/* uio_iov describes user space */
-	UIO_SYSSPACE,		/* uio_iov describes system space */
+	UIO_USERSPACE,          /* uio_iov describes user space */
+	UIO_SYSSPACE,           /* uio_iov describes system space */
 } uio_seg_t;
 
 
 extern int	uiomove (void *, size_t, uio_rw_t, uio_t *);
 
-#endif	/* __XFS_SUPPORT_MOVE_H__ */
+#endif  /* __XFS_SUPPORT_MOVE_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/support/mrlock.c linux-2.5.68-bk12/fs/xfs/support/mrlock.c
--- linux-2.5.68-bk11/fs/xfs/support/mrlock.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/mrlock.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -251,7 +251,7 @@
 	else if (type == MR_UPDATE)
 		return (mrp->mr_count < 0); /* Write lock */
 	else if (type == (MR_UPDATE | MR_ACCESS))
-		return (mrp->mr_count); /* Any type of lock held */
+		return (mrp->mr_count);	/* Any type of lock held */
 	else /* Any waiters */
 		return (mrp->mr_reads_waiting | mrp->mr_writes_waiting);
 }
diff -urN linux-2.5.68-bk11/fs/xfs/support/mrlock.h linux-2.5.68-bk12/fs/xfs/support/mrlock.h
--- linux-2.5.68-bk11/fs/xfs/support/mrlock.h	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/mrlock.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -67,17 +67,17 @@
 
 extern void	mraccessf(mrlock_t *, int);
 extern void	mrupdatef(mrlock_t *, int);
-extern void	mrlock(mrlock_t *, int, int);
-extern void	mrunlock(mrlock_t *);
-extern void	mraccunlock(mrlock_t *);
-extern int	mrtryupdate(mrlock_t *);
-extern int	mrtryaccess(mrlock_t *);
+extern void     mrlock(mrlock_t *, int, int);
+extern void     mrunlock(mrlock_t *);
+extern void     mraccunlock(mrlock_t *);
+extern int      mrtryupdate(mrlock_t *);
+extern int      mrtryaccess(mrlock_t *);
 extern int	mrtrypromote(mrlock_t *);
-extern void	mrdemote(mrlock_t *);
+extern void     mrdemote(mrlock_t *);
 
 extern int	ismrlocked(mrlock_t *, int);
-extern void	mrlock_init(mrlock_t *, int type, char *name, long sequence);
-extern void	mrfree(mrlock_t *);
+extern void     mrlock_init(mrlock_t *, int type, char *name, long sequence);
+extern void     mrfree(mrlock_t *);
 
 #define mrinit(mrp, name)	mrlock_init(mrp, MRLOCK_BARRIER, name, -1)
 #define mraccess(mrp)		mraccessf(mrp, 0) /* grab for READ/ACCESS */
diff -urN linux-2.5.68-bk11/fs/xfs/support/mutex.h linux-2.5.68-bk12/fs/xfs/support/mutex.h
--- linux-2.5.68-bk11/fs/xfs/support/mutex.h	2003-04-19 19:48:48.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/mutex.h	2003-05-04 04:41:49.000000000 -0700
@@ -12,7 +12,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
diff -urN linux-2.5.68-bk11/fs/xfs/support/qsort.c linux-2.5.68-bk12/fs/xfs/support/qsort.c
--- linux-2.5.68-bk11/fs/xfs/support/qsort.c	2003-04-19 19:51:08.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/qsort.c	2003-05-04 04:41:49.000000000 -0700
@@ -9,7 +9,7 @@
 
    The GNU C Library 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
@@ -55,12 +55,12 @@
    upper bound for log (total_elements):
    bits per byte (CHAR_BIT) * sizeof(size_t).  */
 #define STACK_SIZE	(8 * sizeof(unsigned long int))
-#define PUSH(low, high) ((void) ((top->lo = (low)), (top->hi = (high)), ++top))
-#define POP(low, high)	((void) (--top, (low = top->lo), (high = top->hi)))
-#define STACK_NOT_EMPTY (stack < top)
+#define PUSH(low, high)	((void) ((top->lo = (low)), (top->hi = (high)), ++top))
+#define	POP(low, high)	((void) (--top, (low = top->lo), (high = top->hi)))
+#define	STACK_NOT_EMPTY	(stack < top)
 
 
-/* Order size using quicksort.	This implementation incorporates
+/* Order size using quicksort.  This implementation incorporates
    four optimizations discussed in Sedgewick:
 
    1. Non-recursive, using an explicit stack of pointer that store the
diff -urN linux-2.5.68-bk11/fs/xfs/support/qsort.h linux-2.5.68-bk12/fs/xfs/support/qsort.h
--- linux-2.5.68-bk11/fs/xfs/support/qsort.h	2003-04-19 19:50:32.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/qsort.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
diff -urN linux-2.5.68-bk11/fs/xfs/support/sema.h linux-2.5.68-bk12/fs/xfs/support/sema.h
--- linux-2.5.68-bk11/fs/xfs/support/sema.h	2003-04-19 19:51:21.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/sema.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
diff -urN linux-2.5.68-bk11/fs/xfs/support/spin.h linux-2.5.68-bk12/fs/xfs/support/spin.h
--- linux-2.5.68-bk11/fs/xfs/support/spin.h	2003-04-19 19:49:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/spin.h	2003-05-04 04:41:49.000000000 -0700
@@ -12,7 +12,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -46,7 +46,7 @@
 typedef spinlock_t lock_t;
 
 #define spinlock_init(lock, name)	spin_lock_init(lock)
-#define spinlock_destroy(lock)
+#define	spinlock_destroy(lock)
 
 static inline unsigned long mutex_spinlock(lock_t *lock)
 {
diff -urN linux-2.5.68-bk11/fs/xfs/support/sv.h linux-2.5.68-bk12/fs/xfs/support/sv.h
--- linux-2.5.68-bk11/fs/xfs/support/sv.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/sv.h	2003-05-04 04:41:49.000000000 -0700
@@ -12,7 +12,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -51,7 +51,7 @@
 #define SV_LIFO		0x2		/* sv_t is LIFO type */
 #define SV_PRIO		0x4		/* sv_t is PRIO type */
 #define SV_KEYED	0x6		/* sv_t is KEYED type */
-#define SV_DEFAULT	SV_FIFO
+#define SV_DEFAULT      SV_FIFO
 
 
 static inline void _sv_wait(sv_t *sv, spinlock_t *lock, int state,
@@ -76,7 +76,7 @@
 	/*NOTHING*/
 #define sv_wait(sv, pri, lock, s) \
 	_sv_wait(sv, lock, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT)
-#define sv_wait_sig(sv, pri, lock, s)	\
+#define sv_wait_sig(sv, pri, lock, s)   \
 	_sv_wait(sv, lock, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT)
 #define sv_timedwait(sv, pri, lock, s, svf, ts, rts) \
 	_sv_wait(sv, lock, TASK_UNINTERRUPTIBLE, timespec_to_jiffies(ts))
diff -urN linux-2.5.68-bk11/fs/xfs/support/time.h linux-2.5.68-bk12/fs/xfs/support/time.h
--- linux-2.5.68-bk11/fs/xfs/support/time.h	2003-04-19 19:51:16.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/time.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
diff -urN linux-2.5.68-bk11/fs/xfs/support/uuid.c linux-2.5.68-bk12/fs/xfs/support/uuid.c
--- linux-2.5.68-bk11/fs/xfs/support/uuid.c	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/uuid.c	2003-05-04 04:41:49.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -31,58 +31,22 @@
  */
 
 #include <linux/types.h>
-#include <linux/random.h>
-#include <linux/time.h>
-
-#ifdef __sparc__
-#include <asm/idprom.h>
-#else
-#include <linux/netdevice.h>
-#endif
-
 #include <xfs_types.h>
 #include <xfs_arch.h>
 #include "time.h"
-#include "move.h"
 #include "uuid.h"
+#include "kmem.h"
+#include "debug.h"
+#include "mutex.h"
+
+static mutex_t	uuid_monitor;
+static int	uuid_table_size;
+static uuid_t	*uuid_table;
 
-#ifndef CONFIG_NET
-#define dev_get_by_name(x)	(NULL)
-#define dev_put(x)		do { } while (0)
-#endif
-
-/* NODE_SIZE is the number of bytes used for the node identifier portion. */
-#define NODE_SIZE	6
-
-/*
- * Total size must be 128 bits.	 N.B. definition of uuid_t in uuid.h!
- */
-typedef struct {
-	u_int32_t	uu_timelow;	/* time "low" */
-	u_int16_t	uu_timemid;	/* time "mid" */
-	u_int16_t	uu_timehi;	/* time "hi" and version */
-	u_int16_t	uu_clockseq;	/* "reserved" and clock sequence */
-	u_int16_t	uu_node[NODE_SIZE / 2]; /* ethernet hardware address */
-} uu_t;
-
-/*
- * The Time Base Correction is the amount to add on to a UNIX-based
- * time value (i.e. seconds since 1 Jan. 1970) to convert it to the
- * time base for UUIDs (15 Oct. 1582).
- */
-#define UUID_TBC	0x01B21DD2138140LL
-
-static	short		uuid_eaddr[NODE_SIZE / 2];	/* ethernet address */
-static	__int64_t	uuid_time;	/* last time basis used */
-static	u_int16_t	uuid_clockseq;	/* boot-time randomizer */
-DECLARE_MUTEX(uuid_lock);
-
-/*
- * uuid_init - called from out of init_tbl[]
- */
 void
 uuid_init(void)
 {
+	mutex_init(&uuid_monitor, MUTEX_DEFAULT, "uuid_monitor");
 }
 
 /*
@@ -94,7 +58,7 @@
 void
 uuid_getnodeuniq(uuid_t *uuid, int fsid [2])
 {
-	char	*uu=(char*)uuid;
+	char	*uu = (char *)uuid;
 
 	/* on IRIX, this function assumes big-endian fields within
 	 * the uuid, so we use INT_GET to get the same result on
@@ -119,24 +83,24 @@
 	char	*cp = (char *)uuid;
 
 	if (uuid == NULL)
-		return B_TRUE;
+		return 0;
 	/* implied check of version number here... */
 	for (i = 0; i < sizeof *uuid; i++)
-		if (*cp++) return B_FALSE;	/* not nil */
-	return B_TRUE;	/* is nil */
+		if (*cp++) return 0;	/* not nil */
+	return 1;	/* is nil */
 }
 
 int
 uuid_equal(uuid_t *uuid1, uuid_t *uuid2)
 {
-	return memcmp(uuid1, uuid2, sizeof(uuid_t)) ? B_FALSE : B_TRUE;
+	return memcmp(uuid1, uuid2, sizeof(uuid_t)) ? 0 : 1;
 }
 
 /*
  * Given a 128-bit uuid, return a 64-bit value by adding the top and bottom
- * 64-bit words.  NOTE: This function can not be changed EVER.	Although
+ * 64-bit words.  NOTE: This function can not be changed EVER.  Although
  * brain-dead, some applications depend on this 64-bit value remaining
- * persistent.	Specifically, DMI vendors store the value as a persistent
+ * persistent.  Specifically, DMI vendors store the value as a persistent
  * filehandle.
  */
 __uint64_t
@@ -145,94 +109,50 @@
 	__uint64_t	*sp = (__uint64_t *)uuid;
 
 	return sp[0] + sp[1];
-}	/* uuid_hash64 */
-
-static void
-get_eaddr(char *junk)
-{
-#ifdef __sparc__
-	memcpy(uuid_eaddr, idprom->id_ethaddr, 6);
-#else
-	struct net_device *dev;
-
-	dev = dev_get_by_name("eth0");
-	if (!dev || !dev->addr_len) {
-		get_random_bytes(uuid_eaddr, sizeof(uuid_eaddr));
-	} else {
-		memcpy(uuid_eaddr, dev->dev_addr,
-			dev->addr_len<sizeof(uuid_eaddr)?
-			dev->addr_len:sizeof(uuid_eaddr));
-		dev_put(dev);
-	}
-#endif
 }
 
-/*
- * uuid_create - kernel version, does the actual work
- */
-void
-uuid_create(uuid_t *uuid)
+int
+uuid_table_insert(uuid_t *uuid)
 {
-	int		i;
-	uu_t		*uu = (uu_t *)uuid;
-	static int	uuid_have_eaddr = 0;	/* ethernet addr inited? */
-	static int	uuid_is_init = 0;	/* time/clockseq inited? */
-
-	down(&uuid_lock);
-	if (!uuid_is_init) {
-		timespec_t	ts;
-
-		nanotime(&ts);
-		/*
-		 * The clock sequence must be initialized randomly.
-		 */
-		uuid_clockseq = ((unsigned long)jiffies & 0xfff) | 0x8000;
-		/*
-		 * Initialize the uuid time, it's in 100 nanosecond
-		 * units since a time base in 1582.
-		 */
-		uuid_time = ts.tv_sec * 10000000LL +
-			    ts.tv_nsec / 100LL +
-			    UUID_TBC;
-		uuid_is_init = 1;
+	int	i, hole;
+
+	mutex_lock(&uuid_monitor, PVFS);
+	for (i = 0, hole = -1; i < uuid_table_size; i++) {
+		if (uuid_is_nil(&uuid_table[i])) {
+			hole = i;
+			continue;
+		}
+		if (uuid_equal(uuid, &uuid_table[i])) {
+			mutex_unlock(&uuid_monitor);
+			return 0;
+		}
 	}
-	if (!uuid_have_eaddr) {
-		uuid_have_eaddr = 1;
-		get_eaddr((char *)uuid_eaddr);
+	if (hole < 0) {
+		uuid_table = kmem_realloc(uuid_table,
+			(uuid_table_size + 1) * sizeof(*uuid_table),
+			uuid_table_size  * sizeof(*uuid_table),
+			KM_SLEEP);
+		hole = uuid_table_size++;
 	}
-	uuid_time++;
-	uu->uu_timelow = (u_int32_t)(uuid_time & 0x00000000ffffffffLL);
-	uu->uu_timemid = (u_int16_t)((uuid_time >> 32) & 0x0000ffff);
-	uu->uu_timehi = (u_int16_t)((uuid_time >> 48) & 0x00000fff) | 0x1000;
-	up(&uuid_lock);
-	uu->uu_clockseq = uuid_clockseq;
-	for (i = 0; i < (NODE_SIZE / 2); i++)
-		uu->uu_node [i] = uuid_eaddr [i];
+	uuid_table[hole] = *uuid;
+	mutex_unlock(&uuid_monitor);
+	return 1;
 }
 
-int
-uuid_compare(uuid_t *uuid1, uuid_t *uuid2)
+void
+uuid_table_remove(uuid_t *uuid)
 {
 	int	i;
-	char	*cp1 = (char *) uuid1;
-	char	*cp2 = (char *) uuid2;
 
-	if (uuid1 == NULL) {
-		if (uuid2 == NULL) {
-			return 0;	/* equal because both are nil */
-		} else	{
-			return -1;	/* uuid1 nil, so precedes uuid2 */
-		}
-	} else if (uuid2 == NULL) {
-		return 1;
-	}
-
-	/* implied check of version number here... */
-	for (i = 0; i < sizeof(uuid_t); i++) {
-		if (*cp1 < *cp2)
-			return -1;
-		if (*cp1++ > *cp2++)
-			return 1;
+	mutex_lock(&uuid_monitor, PVFS);
+	for (i = 0; i < uuid_table_size; i++) {
+		if (uuid_is_nil(&uuid_table[i]))
+			continue;
+		if (!uuid_equal(uuid, &uuid_table[i]))
+			continue;
+		uuid_create_nil(&uuid_table[i]);
+		break;
 	}
-	return 0;	/* they're equal */
+	ASSERT(i < uuid_table_size);
+	mutex_unlock(&uuid_monitor);
 }
diff -urN linux-2.5.68-bk11/fs/xfs/support/uuid.h linux-2.5.68-bk12/fs/xfs/support/uuid.h
--- linux-2.5.68-bk11/fs/xfs/support/uuid.h	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/support/uuid.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -36,10 +36,13 @@
 	unsigned char	__u_bits[16];
 } uuid_t;
 
+void uuid_init(void);
 void uuid_create_nil(uuid_t *uuid);
 int uuid_is_nil(uuid_t *uuid);
 int uuid_equal(uuid_t *uuid1, uuid_t *uuid2);
 void uuid_getnodeuniq(uuid_t *uuid, int fsid [2]);
 __uint64_t uuid_hash64(uuid_t *uuid);
+int uuid_table_insert(uuid_t *uuid);
+void uuid_table_remove(uuid_t *uuid);
 
 #endif	/* __XFS_SUPPORT_UUID_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs.h linux-2.5.68-bk12/fs/xfs/xfs.h
--- linux-2.5.68-bk11/fs/xfs/xfs.h	2003-04-19 19:48:55.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -32,10 +32,10 @@
 #ifndef __XFS_H__
 #define __XFS_H__
 
-#include <linux/config.h>
 #include <linux/types.h>
-
+#include <linux/config.h>
 #include <xfs_types.h>
+
 #include <xfs_arch.h>
 
 #include <support/kmem.h>
@@ -53,56 +53,7 @@
 
 #include <linux/xfs_linux.h>
 
-#include <xfs_fs.h>
+#include <xfs_fs.h> 
 #include <xfs_buf.h>
-#include <xfs_macros.h>
-#include <xfs_inum.h>
-#include <xfs_log.h>
-#include <xfs_clnt.h>
-#include <xfs_trans.h>
-#include <xfs_sb.h>
-#include <xfs_ag.h>
-#include <xfs_dir.h>
-#include <xfs_dir2.h>
-#include <xfs_imap.h>
-#include <xfs_alloc.h>
-#include <xfs_dmapi.h>
-#include <xfs_quota.h>
-#include <xfs_mount.h>
-#include <xfs_alloc_btree.h>
-#include <xfs_bmap_btree.h>
-#include <xfs_ialloc_btree.h>
-#include <xfs_btree.h>
-#include <xfs_ialloc.h>
-#include <xfs_attr_sf.h>
-#include <xfs_dir_sf.h>
-#include <xfs_dir2_sf.h>
-#include <xfs_dinode.h>
-#include <xfs_inode.h>
-#include <xfs_bmap.h>
-#include <xfs_bit.h>
-#include <xfs_rtalloc.h>
-#include <xfs_error.h>
-#include <xfs_itable.h>
-#include <xfs_rw.h>
-#include <xfs_da_btree.h>
-#include <xfs_dir_leaf.h>
-#include <xfs_dir2_data.h>
-#include <xfs_dir2_leaf.h>
-#include <xfs_dir2_block.h>
-#include <xfs_dir2_node.h>
-#include <xfs_dir2_trace.h>
-#include <xfs_acl.h>
-#include <xfs_cap.h>
-#include <xfs_mac.h>
-#include <xfs_attr.h>
-#include <xfs_attr_leaf.h>
-#include <xfs_inode_item.h>
-#include <xfs_buf_item.h>
-#include <xfs_extfree_item.h>
-#include <xfs_log_priv.h>
-#include <xfs_trans_priv.h>
-#include <xfs_trans_space.h>
-#include <xfs_utils.h>
 
 #endif	/* __XFS_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_acl.c linux-2.5.68-bk12/fs/xfs/xfs_acl.c
--- linux-2.5.68-bk11/fs/xfs/xfs_acl.c	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_acl.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,11 +30,28 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_inum.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_acl.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+
 #include <linux/posix_acl_xattr.h>
 
 STATIC int	xfs_acl_setmode(vnode_t *, xfs_acl_t *, int *);
-STATIC void	xfs_acl_filter_mode(mode_t, xfs_acl_t *);
+STATIC void     xfs_acl_filter_mode(mode_t, xfs_acl_t *);
 STATIC void	xfs_acl_get_endian(xfs_acl_t *);
 STATIC int	xfs_acl_access(uid_t, gid_t, xfs_acl_t *, mode_t, cred_t *);
 STATIC int	xfs_acl_invalid(xfs_acl_t *);
@@ -146,7 +163,7 @@
 	const void	*va,
 	const void	*vb)
 {
-	xfs_acl_entry_t *a = (xfs_acl_entry_t *)va,
+	xfs_acl_entry_t	*a = (xfs_acl_entry_t *)va,
 			*b = (xfs_acl_entry_t *)vb;
 
 	if (a->ae_tag == b->ae_tag)
@@ -233,7 +250,7 @@
 			goto out;
 		}
 		if (kind == _ACL_TYPE_ACCESS) {
-			vattr_t va;
+			vattr_t	va;
 
 			va.va_mask = XFS_AT_MODE;
 			VOP_GETATTR(vp, &va, 0, sys_cred, error);
@@ -317,7 +334,7 @@
 	} else {
 		xfs_acl_vremove(vp, _ACL_TYPE_ACCESS);
 	}
-		
+
 
 out:
 	VN_RELE(vp);
@@ -437,7 +454,7 @@
 		return EACCES;
 	if ((mode & ACL_EXECUTE) &&
 	    (!capable_cred(cr, CAP_DAC_OVERRIDE) ||
-             !xfs_acl_find_any_exec(fap))) {
+	     !xfs_acl_find_any_exec(fap))) {
 		return EACCES;
 	}
 
@@ -446,9 +463,9 @@
 
 /*
  * Note: cr is only used here for the capability check if the ACL test fails.
- *	 It is not used to find out the credentials uid or groups etc, as was
- *	 done in IRIX. It is assumed that the uid and groups for the current
- *	 thread are taken from "current" instead of the cr parameter.
+ *       It is not used to find out the credentials uid or groups etc, as was
+ *       done in IRIX. It is assumed that the uid and groups for the current
+ *       thread are taken from "current" instead of the cr parameter.
  */
 STATIC int
 xfs_acl_access(
@@ -458,7 +475,7 @@
 	mode_t		md,
 	cred_t		*cr)
 {
-	xfs_acl_entry_t matched;
+	xfs_acl_entry_t	matched;
 	int		i, allows;
 	int		maskallows = -1;	/* true, but not 1, either */
 	int		seen_userobj = 0;
@@ -557,7 +574,7 @@
 xfs_acl_invalid(
 	xfs_acl_t	*aclp)
 {
-	xfs_acl_entry_t *entry, *e;
+	xfs_acl_entry_t	*entry, *e;
 	int		user = 0, group = 0, other = 0, mask = 0;
 	int		mask_required = 0;
 	int		i, j;
@@ -616,7 +633,7 @@
 xfs_acl_get_endian(
 	xfs_acl_t	*aclp)
 {
-	xfs_acl_entry_t *ace, *end;
+	xfs_acl_entry_t	*ace, *end;
 
 	INT_SET(aclp->acl_cnt, ARCH_CONVERT, aclp->acl_cnt);
 	end = &aclp->acl_entry[0]+aclp->acl_cnt;
@@ -659,7 +676,7 @@
 	int		kind,
 	int		*error)
 {
-	xfs_acl_entry_t *ace, *newace, *end;
+	xfs_acl_entry_t	*ace, *newace, *end;
 	xfs_acl_t	*newacl;
 	int		len;
 
@@ -759,7 +776,7 @@
 	xfs_acl_setmode(vp, cacl, &basicperms);
 
 	/*
-	 * Set the Default and Access ACL on the file.	The mode is already
+	 * Set the Default and Access ACL on the file.  The mode is already
 	 * set on the file, so we don't need to worry about that.
 	 *
 	 * If the new file is a directory, its default ACL is a copy of
@@ -787,8 +804,8 @@
 	int		*basicperms)
 {
 	vattr_t		va;
-	xfs_acl_entry_t *ap;
-	xfs_acl_entry_t *gap = NULL;
+	xfs_acl_entry_t	*ap;
+	xfs_acl_entry_t	*gap = NULL;
 	int		i, error, nomask = 1;
 
 	*basicperms = 1;
@@ -858,16 +875,16 @@
  * most accurately reflects what the special ACL entries should permit/deny.
  *
  * CAVEAT: If someone sets the SGI_ACL_FILE attribute directly,
- *	   the existing mode bits will override whatever is in the
- *	   ACL. Similarly, if there is a pre-existing ACL that was
- *	   never in sync with its mode (owing to a bug in 6.5 and
- *	   before), it will now magically (or mystically) be
- *	   synchronized.  This could cause slight astonishment, but
- *	   it is better than inconsistent permissions.
+ *         the existing mode bits will override whatever is in the
+ *         ACL. Similarly, if there is a pre-existing ACL that was
+ *         never in sync with its mode (owing to a bug in 6.5 and
+ *         before), it will now magically (or mystically) be
+ *         synchronized.  This could cause slight astonishment, but
+ *         it is better than inconsistent permissions.
  *
  * The supplied ACL is a template that may contain any combination
- * of special entries.	These are treated as place holders when we fill
- * out the ACL.	 This routine does not add or remove special entries, it
+ * of special entries.  These are treated as place holders when we fill
+ * out the ACL.  This routine does not add or remove special entries, it
  * simply unites each special entry with its associated set of permissions.
  */
 STATIC void
@@ -876,8 +893,8 @@
 	xfs_acl_t	*acl)
 {
 	int		i, nomask = 1;
-	xfs_acl_entry_t *ap;
-	xfs_acl_entry_t *gap = NULL;
+	xfs_acl_entry_t	*ap;
+	xfs_acl_entry_t	*gap = NULL;
 
 	/*
 	 * Set ACL entries. POSIX1003.1eD16 requires that the MASK
@@ -920,8 +937,8 @@
 	xfs_acl_t	*acl)
 {
 	int		i, nomask = 1;
-	xfs_acl_entry_t *ap;
-	xfs_acl_entry_t *gap = NULL;
+	xfs_acl_entry_t	*ap;
+	xfs_acl_entry_t	*gap = NULL;
 
 	/*
 	 * Set ACL entries. POSIX1003.1eD16 requires that the MASK
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_acl.h linux-2.5.68-bk12/fs/xfs/xfs_acl.h
--- linux-2.5.68-bk11/fs/xfs/xfs_acl.h	2003-04-19 19:49:11.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_acl.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -51,12 +51,12 @@
 
 typedef struct xfs_acl {
 	__int32_t	acl_cnt;
-	xfs_acl_entry_t acl_entry[XFS_ACL_MAX_ENTRIES];
+	xfs_acl_entry_t	acl_entry[XFS_ACL_MAX_ENTRIES];
 } xfs_acl_t;
 
 /* On-disk XFS extended attribute names */
 #define SGI_ACL_FILE	"SGI_ACL_FILE"
-#define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT"
+#define SGI_ACL_DEFAULT	"SGI_ACL_DEFAULT"
 #define SGI_ACL_FILE_SIZE	(sizeof(SGI_ACL_FILE)-1)
 #define SGI_ACL_DEFAULT_SIZE	(sizeof(SGI_ACL_DEFAULT)-1)
 
@@ -84,7 +84,7 @@
 
 #define _ACL_TYPE_ACCESS	1
 #define _ACL_TYPE_DEFAULT	2
-#define _ACL_PERM_INVALID(perm) ((perm) & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE))
+#define _ACL_PERM_INVALID(perm)	((perm) & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE))
 
 #define _ACL_DECL(a)		xfs_acl_t *(a) = NULL
 #define _ACL_ALLOC(a)		((a) = kmem_zone_alloc(xfs_acl_zone, KM_SLEEP))
@@ -93,7 +93,7 @@
 #define _ACL_ZONE_DESTROY(z)	(kmem_cache_destroy(z))
 #define _ACL_INHERIT(c,v,d)	(xfs_acl_inherit(c,v,d))
 #define _ACL_GET_ACCESS(pv,pa)	(xfs_acl_vtoacl(pv,pa,NULL) == 0)
-#define _ACL_GET_DEFAULT(pv,pd) (xfs_acl_vtoacl(pv,NULL,pd) == 0)
+#define _ACL_GET_DEFAULT(pv,pd)	(xfs_acl_vtoacl(pv,NULL,pd) == 0)
 #define _ACL_ACCESS_EXISTS	xfs_acl_vhasacl_access
 #define _ACL_DEFAULT_EXISTS	xfs_acl_vhasacl_default
 #define _ACL_XFS_IACCESS(i,m,c) (XFS_IFORK_Q(i) ? xfs_acl_iaccess(i,m,c) : -1)
@@ -109,7 +109,7 @@
 #define _ACL_ZONE_DESTROY(z)	((void)0)
 #define _ACL_INHERIT(c,v,d)	(0)
 #define _ACL_GET_ACCESS(pv,pa)	(0)
-#define _ACL_GET_DEFAULT(pv,pd) (0)
+#define _ACL_GET_DEFAULT(pv,pd)	(0)
 #define _ACL_ACCESS_EXISTS	(NULL)
 #define _ACL_DEFAULT_EXISTS	(NULL)
 #define _ACL_XFS_IACCESS(i,m,c) (-1)
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_ag.h linux-2.5.68-bk12/fs/xfs/xfs_ag.h
--- linux-2.5.68-bk11/fs/xfs/xfs_ag.h	2003-04-19 19:50:30.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_ag.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_AG_H__
-#define __XFS_AG_H__
+#define	__XFS_AG_H__
 
 /*
  * Allocation group header
@@ -42,19 +42,19 @@
 struct xfs_mount;
 struct xfs_trans;
 
-#define XFS_AGF_MAGIC	0x58414746	/* 'XAGF' */
-#define XFS_AGI_MAGIC	0x58414749	/* 'XAGI' */
-#define XFS_AGF_VERSION 1
-#define XFS_AGI_VERSION 1
+#define	XFS_AGF_MAGIC	0x58414746	/* 'XAGF' */
+#define	XFS_AGI_MAGIC	0x58414749	/* 'XAGI' */
+#define	XFS_AGF_VERSION	1
+#define	XFS_AGI_VERSION	1
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGF_GOOD_VERSION)
 int xfs_agf_good_version(unsigned v);
-#define XFS_AGF_GOOD_VERSION(v) xfs_agf_good_version(v)
+#define	XFS_AGF_GOOD_VERSION(v)	xfs_agf_good_version(v)
 #else
 #define XFS_AGF_GOOD_VERSION(v)		((v) == XFS_AGF_VERSION)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGI_GOOD_VERSION)
 int xfs_agi_good_version(unsigned v);
-#define XFS_AGI_GOOD_VERSION(v) xfs_agi_good_version(v)
+#define	XFS_AGI_GOOD_VERSION(v)	xfs_agi_good_version(v)
 #else
 #define XFS_AGI_GOOD_VERSION(v)		((v) == XFS_AGI_VERSION)
 #endif
@@ -63,7 +63,7 @@
  * Btree number 0 is bno, 1 is cnt.  This value gives the size of the
  * arrays below.
  */
-#define XFS_BTNUM_AGF	((int)XFS_BTNUM_CNTi + 1)
+#define	XFS_BTNUM_AGF	((int)XFS_BTNUM_CNTi + 1)
 
 /*
  * The second word of agf_levels in the first a.g. overlaps the EFS
@@ -77,7 +77,7 @@
 	 * Common allocation group header information
 	 */
 	__uint32_t	agf_magicnum;	/* magic number == XFS_AGF_MAGIC */
-	__uint32_t	agf_versionnum; /* header version == XFS_AGF_VERSION */
+	__uint32_t	agf_versionnum;	/* header version == XFS_AGF_VERSION */
 	xfs_agnumber_t	agf_seqno;	/* sequence # starting from 0 */
 	xfs_agblock_t	agf_length;	/* size in blocks of a.g. */
 	/*
@@ -94,25 +94,25 @@
 	xfs_extlen_t	agf_longest;	/* longest free space */
 } xfs_agf_t;
 
-#define XFS_AGF_MAGICNUM	0x00000001
-#define XFS_AGF_VERSIONNUM	0x00000002
-#define XFS_AGF_SEQNO		0x00000004
-#define XFS_AGF_LENGTH		0x00000008
-#define XFS_AGF_ROOTS		0x00000010
-#define XFS_AGF_LEVELS		0x00000020
-#define XFS_AGF_FLFIRST		0x00000040
-#define XFS_AGF_FLLAST		0x00000080
-#define XFS_AGF_FLCOUNT		0x00000100
-#define XFS_AGF_FREEBLKS	0x00000200
-#define XFS_AGF_LONGEST		0x00000400
-#define XFS_AGF_NUM_BITS	11
-#define XFS_AGF_ALL_BITS	((1 << XFS_AGF_NUM_BITS) - 1)
+#define	XFS_AGF_MAGICNUM	0x00000001
+#define	XFS_AGF_VERSIONNUM	0x00000002
+#define	XFS_AGF_SEQNO		0x00000004
+#define	XFS_AGF_LENGTH		0x00000008
+#define	XFS_AGF_ROOTS		0x00000010
+#define	XFS_AGF_LEVELS		0x00000020
+#define	XFS_AGF_FLFIRST		0x00000040
+#define	XFS_AGF_FLLAST		0x00000080
+#define	XFS_AGF_FLCOUNT		0x00000100
+#define	XFS_AGF_FREEBLKS	0x00000200
+#define	XFS_AGF_LONGEST		0x00000400
+#define	XFS_AGF_NUM_BITS	11
+#define	XFS_AGF_ALL_BITS	((1 << XFS_AGF_NUM_BITS) - 1)
 
 /* disk block (xfs_daddr_t) in the AG */
 #define XFS_AGF_DADDR(mp)	((xfs_daddr_t)(1 << (mp)->m_sectbb_log))
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGF_BLOCK)
 xfs_agblock_t xfs_agf_block(struct xfs_mount *mp);
-#define XFS_AGF_BLOCK(mp)	xfs_agf_block(mp)
+#define	XFS_AGF_BLOCK(mp)	xfs_agf_block(mp)
 #else
 #define XFS_AGF_BLOCK(mp)	XFS_HDR_BLOCK(mp, XFS_AGF_DADDR(mp))
 #endif
@@ -120,7 +120,7 @@
 /*
  * Size of the unlinked inode hash table in the agi.
  */
-#define XFS_AGI_UNLINKED_BUCKETS	64
+#define	XFS_AGI_UNLINKED_BUCKETS	64
 
 typedef struct xfs_agi
 {
@@ -128,7 +128,7 @@
 	 * Common allocation group header information
 	 */
 	__uint32_t	agi_magicnum;	/* magic number == XFS_AGI_MAGIC */
-	__uint32_t	agi_versionnum; /* header version == XFS_AGI_VERSION */
+	__uint32_t	agi_versionnum;	/* header version == XFS_AGI_VERSION */
 	xfs_agnumber_t	agi_seqno;	/* sequence # starting from 0 */
 	xfs_agblock_t	agi_length;	/* size in blocks of a.g. */
 	/*
@@ -149,25 +149,25 @@
 	xfs_agino_t	agi_unlinked[XFS_AGI_UNLINKED_BUCKETS];
 } xfs_agi_t;
 
-#define XFS_AGI_MAGICNUM	0x00000001
-#define XFS_AGI_VERSIONNUM	0x00000002
-#define XFS_AGI_SEQNO		0x00000004
-#define XFS_AGI_LENGTH		0x00000008
-#define XFS_AGI_COUNT		0x00000010
-#define XFS_AGI_ROOT		0x00000020
-#define XFS_AGI_LEVEL		0x00000040
-#define XFS_AGI_FREECOUNT	0x00000080
-#define XFS_AGI_NEWINO		0x00000100
-#define XFS_AGI_DIRINO		0x00000200
-#define XFS_AGI_UNLINKED	0x00000400
-#define XFS_AGI_NUM_BITS	11
-#define XFS_AGI_ALL_BITS	((1 << XFS_AGI_NUM_BITS) - 1)
+#define	XFS_AGI_MAGICNUM	0x00000001
+#define	XFS_AGI_VERSIONNUM	0x00000002
+#define	XFS_AGI_SEQNO		0x00000004
+#define	XFS_AGI_LENGTH		0x00000008
+#define	XFS_AGI_COUNT		0x00000010
+#define	XFS_AGI_ROOT		0x00000020
+#define	XFS_AGI_LEVEL		0x00000040
+#define	XFS_AGI_FREECOUNT	0x00000080
+#define	XFS_AGI_NEWINO		0x00000100
+#define	XFS_AGI_DIRINO		0x00000200
+#define	XFS_AGI_UNLINKED	0x00000400
+#define	XFS_AGI_NUM_BITS	11
+#define	XFS_AGI_ALL_BITS	((1 << XFS_AGI_NUM_BITS) - 1)
 
 /* disk block (xfs_daddr_t) in the AG */
 #define XFS_AGI_DADDR(mp)	((xfs_daddr_t)(2 << (mp)->m_sectbb_log))
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGI_BLOCK)
 xfs_agblock_t xfs_agi_block(struct xfs_mount *mp);
-#define XFS_AGI_BLOCK(mp)	xfs_agi_block(mp)
+#define	XFS_AGI_BLOCK(mp)	xfs_agi_block(mp)
 #else
 #define XFS_AGI_BLOCK(mp)	XFS_HDR_BLOCK(mp, XFS_AGI_DADDR(mp))
 #endif
@@ -179,7 +179,7 @@
 #define XFS_AGFL_DADDR(mp)	((xfs_daddr_t)(3 << (mp)->m_sectbb_log))
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGFL_BLOCK)
 xfs_agblock_t xfs_agfl_block(struct xfs_mount *mp);
-#define XFS_AGFL_BLOCK(mp)	xfs_agfl_block(mp)
+#define	XFS_AGFL_BLOCK(mp)	xfs_agfl_block(mp)
 #else
 #define XFS_AGFL_BLOCK(mp)	XFS_HDR_BLOCK(mp, XFS_AGFL_DADDR(mp))
 #endif
@@ -223,7 +223,7 @@
 	__uint32_t	pagf_flcount;	/* count of blocks in freelist */
 	xfs_extlen_t	pagf_freeblks;	/* total free blocks */
 	xfs_extlen_t	pagf_longest;	/* longest free space */
-	xfs_agino_t	pagi_freecount; /* number of free inodes */
+	xfs_agino_t	pagi_freecount;	/* number of free inodes */
 #ifdef __KERNEL__
 	lock_t		pagb_lock;	/* lock for pagb_list */
 #endif
@@ -231,19 +231,19 @@
 	xfs_perag_busy_t *pagb_list;	/* unstable blocks */
 } xfs_perag_t;
 
-#define XFS_AG_MIN_BYTES	(1LL << 24)	/* 16 MB */
-#define XFS_AG_BEST_BYTES	(1LL << 30)	/*  1 GB */
-#define XFS_AG_MAX_BYTES	(1LL << 32)	/*  4 GB */
+#define	XFS_AG_MIN_BYTES	(1LL << 24)	/* 16 MB */
+#define	XFS_AG_BEST_BYTES	(1LL << 30)	/*  1 GB */
+#define	XFS_AG_MAX_BYTES	(1LL << 32)	/*  4 GB */
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_MIN_BLOCKS)
 xfs_extlen_t xfs_ag_min_blocks(int bl);
-#define XFS_AG_MIN_BLOCKS(bl)		xfs_ag_min_blocks(bl)
+#define	XFS_AG_MIN_BLOCKS(bl)		xfs_ag_min_blocks(bl)
 #else
-#define XFS_AG_MIN_BLOCKS(bl)	((xfs_extlen_t)(XFS_AG_MIN_BYTES >> bl))
+#define	XFS_AG_MIN_BLOCKS(bl)	((xfs_extlen_t)(XFS_AG_MIN_BYTES >> bl))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_BEST_BLOCKS)
 xfs_extlen_t xfs_ag_best_blocks(int bl, xfs_drfsbno_t blks);
-#define XFS_AG_BEST_BLOCKS(bl,blks)	xfs_ag_best_blocks(bl,blks)
+#define	XFS_AG_BEST_BLOCKS(bl,blks)	xfs_ag_best_blocks(bl,blks)
 #else
 /*--#define XFS_AG_BEST_BLOCKS(bl) ((xfs_extlen_t)(XFS_AG_BEST_BYTES >> bl))*/
 /*
@@ -257,41 +257,41 @@
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_MAX_BLOCKS)
 xfs_extlen_t xfs_ag_max_blocks(int bl);
-#define XFS_AG_MAX_BLOCKS(bl)		xfs_ag_max_blocks(bl)
+#define	XFS_AG_MAX_BLOCKS(bl)		xfs_ag_max_blocks(bl)
 #else
-#define XFS_AG_MAX_BLOCKS(bl)	((xfs_extlen_t)(XFS_AG_MAX_BYTES >> bl))
+#define	XFS_AG_MAX_BLOCKS(bl)	((xfs_extlen_t)(XFS_AG_MAX_BYTES >> bl))
 #endif
 
-#define XFS_MAX_AGNUMBER	((xfs_agnumber_t)(NULLAGNUMBER - 1))
+#define	XFS_MAX_AGNUMBER	((xfs_agnumber_t)(NULLAGNUMBER - 1))
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_MAXLEVELS)
 int xfs_ag_maxlevels(struct xfs_mount *mp);
-#define XFS_AG_MAXLEVELS(mp)		xfs_ag_maxlevels(mp)
+#define	XFS_AG_MAXLEVELS(mp)		xfs_ag_maxlevels(mp)
 #else
-#define XFS_AG_MAXLEVELS(mp)	((mp)->m_ag_maxlevels)
+#define	XFS_AG_MAXLEVELS(mp)	((mp)->m_ag_maxlevels)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MIN_FREELIST)
 int xfs_min_freelist(xfs_agf_t *a, struct xfs_mount *mp);
-#define XFS_MIN_FREELIST(a,mp)		xfs_min_freelist(a,mp)
+#define	XFS_MIN_FREELIST(a,mp)		xfs_min_freelist(a,mp)
 #else
-#define XFS_MIN_FREELIST(a,mp)	\
+#define	XFS_MIN_FREELIST(a,mp)	\
 	XFS_MIN_FREELIST_RAW(	\
 		INT_GET((a)->agf_levels[XFS_BTNUM_BNOi], ARCH_CONVERT), \
 		INT_GET((a)->agf_levels[XFS_BTNUM_CNTi], ARCH_CONVERT), mp)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MIN_FREELIST_PAG)
 int xfs_min_freelist_pag(xfs_perag_t *pag, struct xfs_mount *mp);
-#define XFS_MIN_FREELIST_PAG(pag,mp)	xfs_min_freelist_pag(pag,mp)
+#define	XFS_MIN_FREELIST_PAG(pag,mp)	xfs_min_freelist_pag(pag,mp)
 #else
-#define XFS_MIN_FREELIST_PAG(pag,mp)	\
+#define	XFS_MIN_FREELIST_PAG(pag,mp)	\
 	XFS_MIN_FREELIST_RAW((uint_t)(pag)->pagf_levels[XFS_BTNUM_BNOi], \
 			     (uint_t)(pag)->pagf_levels[XFS_BTNUM_CNTi], mp)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MIN_FREELIST_RAW)
 int xfs_min_freelist_raw(int bl, int cl, struct xfs_mount *mp);
-#define XFS_MIN_FREELIST_RAW(bl,cl,mp)	xfs_min_freelist_raw(bl,cl,mp)
+#define	XFS_MIN_FREELIST_RAW(bl,cl,mp)	xfs_min_freelist_raw(bl,cl,mp)
 #else
-#define XFS_MIN_FREELIST_RAW(bl,cl,mp)	\
+#define	XFS_MIN_FREELIST_RAW(bl,cl,mp)	\
 	(MIN(bl + 1, XFS_AG_MAXLEVELS(mp)) + \
 	 MIN(cl + 1, XFS_AG_MAXLEVELS(mp)))
 #endif
@@ -301,30 +301,30 @@
 			     xfs_agblock_t agbno);
 #define XFS_AGB_TO_FSB(mp,agno,agbno)	xfs_agb_to_fsb(mp,agno,agbno)
 #else
-#define XFS_AGB_TO_FSB(mp,agno,agbno) \
+#define	XFS_AGB_TO_FSB(mp,agno,agbno) \
 	(((xfs_fsblock_t)(agno) << (mp)->m_sb.sb_agblklog) | (agbno))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_AGNO)
 xfs_agnumber_t xfs_fsb_to_agno(struct xfs_mount *mp, xfs_fsblock_t fsbno);
-#define XFS_FSB_TO_AGNO(mp,fsbno)	xfs_fsb_to_agno(mp,fsbno)
+#define	XFS_FSB_TO_AGNO(mp,fsbno)	xfs_fsb_to_agno(mp,fsbno)
 #else
-#define XFS_FSB_TO_AGNO(mp,fsbno) \
+#define	XFS_FSB_TO_AGNO(mp,fsbno) \
 	((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_AGBNO)
 xfs_agblock_t xfs_fsb_to_agbno(struct xfs_mount *mp, xfs_fsblock_t fsbno);
-#define XFS_FSB_TO_AGBNO(mp,fsbno)	xfs_fsb_to_agbno(mp,fsbno)
+#define	XFS_FSB_TO_AGBNO(mp,fsbno)	xfs_fsb_to_agbno(mp,fsbno)
 #else
-#define XFS_FSB_TO_AGBNO(mp,fsbno) \
+#define	XFS_FSB_TO_AGBNO(mp,fsbno) \
 	((xfs_agblock_t)((fsbno) & XFS_MASK32LO((mp)->m_sb.sb_agblklog)))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGB_TO_DADDR)
 xfs_daddr_t xfs_agb_to_daddr(struct xfs_mount *mp, xfs_agnumber_t agno,
 				xfs_agblock_t agbno);
-#define XFS_AGB_TO_DADDR(mp,agno,agbno) xfs_agb_to_daddr(mp,agno,agbno)
+#define	XFS_AGB_TO_DADDR(mp,agno,agbno)	xfs_agb_to_daddr(mp,agno,agbno)
 #else
-#define XFS_AGB_TO_DADDR(mp,agno,agbno) \
+#define	XFS_AGB_TO_DADDR(mp,agno,agbno) \
 	((xfs_daddr_t)(XFS_FSB_TO_BB(mp, \
 		(xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno))))
 #endif
@@ -336,28 +336,28 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_DADDR)
 xfs_daddr_t xfs_ag_daddr(struct xfs_mount *mp, xfs_agnumber_t agno,
 				xfs_daddr_t d);
-#define XFS_AG_DADDR(mp,agno,d)		xfs_ag_daddr(mp,agno,d)
+#define	XFS_AG_DADDR(mp,agno,d)		xfs_ag_daddr(mp,agno,d)
 #else
-#define XFS_AG_DADDR(mp,agno,d) (XFS_AGB_TO_DADDR(mp, agno, 0) + (d))
+#define	XFS_AG_DADDR(mp,agno,d)	(XFS_AGB_TO_DADDR(mp, agno, 0) + (d))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_AGF)
 xfs_agf_t *xfs_buf_to_agf(struct xfs_buf *bp);
-#define XFS_BUF_TO_AGF(bp)		xfs_buf_to_agf(bp)
+#define	XFS_BUF_TO_AGF(bp)		xfs_buf_to_agf(bp)
 #else
-#define XFS_BUF_TO_AGF(bp)	((xfs_agf_t *)XFS_BUF_PTR(bp))
+#define	XFS_BUF_TO_AGF(bp)	((xfs_agf_t *)XFS_BUF_PTR(bp))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_AGI)
 xfs_agi_t *xfs_buf_to_agi(struct xfs_buf *bp);
-#define XFS_BUF_TO_AGI(bp)		xfs_buf_to_agi(bp)
+#define	XFS_BUF_TO_AGI(bp)		xfs_buf_to_agi(bp)
 #else
-#define XFS_BUF_TO_AGI(bp)	((xfs_agi_t *)XFS_BUF_PTR(bp))
+#define	XFS_BUF_TO_AGI(bp)	((xfs_agi_t *)XFS_BUF_PTR(bp))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_AGFL)
 xfs_agfl_t *xfs_buf_to_agfl(struct xfs_buf *bp);
-#define XFS_BUF_TO_AGFL(bp)		xfs_buf_to_agfl(bp)
+#define	XFS_BUF_TO_AGFL(bp)		xfs_buf_to_agfl(bp)
 #else
-#define XFS_BUF_TO_AGFL(bp)	((xfs_agfl_t *)XFS_BUF_PTR(bp))
+#define	XFS_BUF_TO_AGFL(bp)	((xfs_agfl_t *)XFS_BUF_PTR(bp))
 #endif
 
 /*
@@ -366,9 +366,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_CHECK_DADDR)
 void xfs_ag_check_daddr(struct xfs_mount *mp, xfs_daddr_t d, xfs_extlen_t len);
-#define XFS_AG_CHECK_DADDR(mp,d,len)	xfs_ag_check_daddr(mp,d,len)
+#define	XFS_AG_CHECK_DADDR(mp,d,len)	xfs_ag_check_daddr(mp,d,len)
 #else
-#define XFS_AG_CHECK_DADDR(mp,d,len)	\
+#define	XFS_AG_CHECK_DADDR(mp,d,len)	\
 	((len) == 1 ? \
 	    ASSERT((d) == XFS_SB_DADDR || \
 		   XFS_DADDR_TO_AGBNO(mp, d) != XFS_SB_DADDR) : \
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_alloc.c linux-2.5.68-bk12/fs/xfs/xfs_alloc.c
--- linux-2.5.68-bk11/fs/xfs/xfs_alloc.c	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_alloc.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -33,7 +33,26 @@
 /*
  * Free space allocation for XFS.
  */
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_alloc.h"
+#include "xfs_bit.h"
+#include "xfs_error.h"
+
 
 #if defined(DEBUG)
 /*
@@ -44,8 +63,8 @@
 
 #define XFS_ABSDIFF(a,b)	(((a) <= (b)) ? ((b) - (a)) : ((a) - (b)))
 
-#define XFSA_FIXUP_BNO_OK	1
-#define XFSA_FIXUP_CNT_OK	2
+#define	XFSA_FIXUP_BNO_OK	1
+#define	XFSA_FIXUP_CNT_OK	2
 
 int
 xfs_alloc_search_busy(xfs_trans_t *tp,
@@ -54,27 +73,27 @@
 		    xfs_extlen_t len);
 
 #if defined(XFS_ALLOC_TRACE)
-#define TRACE_ALLOC(s,a)	\
+#define	TRACE_ALLOC(s,a)	\
 	xfs_alloc_trace_alloc(fname, s, a, __LINE__)
-#define TRACE_FREE(s,a,b,x,f)	\
+#define	TRACE_FREE(s,a,b,x,f)	\
 	xfs_alloc_trace_free(fname, s, mp, a, b, x, f, __LINE__)
-#define TRACE_MODAGF(s,a,f)	\
+#define	TRACE_MODAGF(s,a,f)	\
 	xfs_alloc_trace_modagf(fname, s, mp, a, f, __LINE__)
-#define TRACE_BUSY(fname,s,ag,agb,l,sl,tp)	\
+#define	TRACE_BUSY(fname,s,ag,agb,l,sl,tp)	\
 	xfs_alloc_trace_busy(fname, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSY, __LINE__)
-#define TRACE_UNBUSY(fname,s,ag,sl,tp)	\
+#define	TRACE_UNBUSY(fname,s,ag,sl,tp)	\
 	xfs_alloc_trace_busy(fname, s, mp, ag, -1, -1, sl, tp, XFS_ALLOC_KTRACE_UNBUSY, __LINE__)
-#define TRACE_BUSYSEARCH(fname,s,ag,agb,l,sl,tp)	\
+#define	TRACE_BUSYSEARCH(fname,s,ag,agb,l,sl,tp)	\
 	xfs_alloc_trace_busy(fname, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSYSEARCH, __LINE__)
 
 
 #else
-#define TRACE_ALLOC(s,a)
-#define TRACE_FREE(s,a,b,x,f)
-#define TRACE_MODAGF(s,a,f)
-#define TRACE_BUSY(s,a,ag,agb,l,sl,tp)
-#define TRACE_UNBUSY(fname,s,ag,sl,tp)
-#define TRACE_BUSYSEARCH(fname,s,ag,agb,l,sl,tp)
+#define	TRACE_ALLOC(s,a)
+#define	TRACE_FREE(s,a,b,x,f)
+#define	TRACE_MODAGF(s,a,f)
+#define	TRACE_BUSY(s,a,ag,agb,l,sl,tp)
+#define	TRACE_UNBUSY(fname,s,ag,sl,tp)
+#define	TRACE_BUSYSEARCH(fname,s,ag,agb,l,sl,tp)
 #endif	/* XFS_ALLOC_TRACE */
 
 /*
@@ -189,7 +208,7 @@
  */
 STATIC void
 xfs_alloc_fix_len(
-	xfs_alloc_arg_t *args)		/* allocation argument structure */
+	xfs_alloc_arg_t	*args)		/* allocation argument structure */
 {
 	xfs_extlen_t	k;
 	xfs_extlen_t	rlen;
@@ -223,7 +242,7 @@
  */
 STATIC int
 xfs_alloc_fix_minleft(
-	xfs_alloc_arg_t *args)		/* allocation argument structure */
+	xfs_alloc_arg_t	*args)		/* allocation argument structure */
 {
 	xfs_agf_t	*agf;		/* a.g. freelist header */
 	int		diff;		/* free space difference */
@@ -252,8 +271,8 @@
  */
 STATIC int				/* error code */
 xfs_alloc_fixup_trees(
-	xfs_btree_cur_t *cnt_cur,	/* cursor for by-size btree */
-	xfs_btree_cur_t *bno_cur,	/* cursor for by-block btree */
+	xfs_btree_cur_t	*cnt_cur,	/* cursor for by-size btree */
+	xfs_btree_cur_t	*bno_cur,	/* cursor for by-block btree */
 	xfs_agblock_t	fbno,		/* starting block of free extent */
 	xfs_extlen_t	flen,		/* length of free extent */
 	xfs_agblock_t	rbno,		/* starting block of returned extent */
@@ -423,7 +442,7 @@
 xfs_alloc_trace_alloc(
 	char		*name,		/* function tag string */
 	char		*str,		/* additional string */
-	xfs_alloc_arg_t *args,		/* allocation argument structure */
+	xfs_alloc_arg_t	*args,		/* allocation argument structure */
 	int		line)		/* source line number */
 {
 	ktrace_enter(xfs_alloc_trace_buf,
@@ -551,7 +570,7 @@
  */
 STATIC int			/* error */
 xfs_alloc_ag_vextent(
-	xfs_alloc_arg_t *args)	/* argument structure for allocation */
+	xfs_alloc_arg_t	*args)	/* argument structure for allocation */
 {
 	int		error=0;
 #ifdef XFS_ALLOC_TRACE
@@ -631,10 +650,10 @@
  */
 STATIC int			/* error */
 xfs_alloc_ag_vextent_exact(
-	xfs_alloc_arg_t *args)	/* allocation argument structure */
+	xfs_alloc_arg_t	*args)	/* allocation argument structure */
 {
-	xfs_btree_cur_t *bno_cur;/* by block-number btree cursor */
-	xfs_btree_cur_t *cnt_cur;/* by count btree cursor */
+	xfs_btree_cur_t	*bno_cur;/* by block-number btree cursor */
+	xfs_btree_cur_t	*cnt_cur;/* by count btree cursor */
 	xfs_agblock_t	end;	/* end of allocated extent */
 	int		error;
 	xfs_agblock_t	fbno;	/* start block of found extent */
@@ -644,8 +663,8 @@
 	static char	fname[] = "xfs_alloc_ag_vextent_exact";
 #endif
 	int		i;	/* success/failure of operation */
-	xfs_agblock_t	maxend; /* end of maximal extent */
-	xfs_agblock_t	minend; /* end of minimal extent */
+	xfs_agblock_t	maxend;	/* end of maximal extent */
+	xfs_agblock_t	minend;	/* end of minimal extent */
 	xfs_extlen_t	rlen;	/* length of returned extent */
 
 	ASSERT(args->alignment == 1);
@@ -738,11 +757,11 @@
  */
 STATIC int				/* error */
 xfs_alloc_ag_vextent_near(
-	xfs_alloc_arg_t *args)		/* allocation argument structure */
+	xfs_alloc_arg_t	*args)		/* allocation argument structure */
 {
-	xfs_btree_cur_t *bno_cur_gt;	/* cursor for bno btree, right side */
-	xfs_btree_cur_t *bno_cur_lt;	/* cursor for bno btree, left side */
-	xfs_btree_cur_t *cnt_cur;	/* cursor for count btree */
+	xfs_btree_cur_t	*bno_cur_gt;	/* cursor for bno btree, right side */
+	xfs_btree_cur_t	*bno_cur_lt;	/* cursor for bno btree, left side */
+	xfs_btree_cur_t	*cnt_cur;	/* cursor for count btree */
 #ifdef XFS_ALLOC_TRACE
 	static char	fname[] = "xfs_alloc_ag_vextent_near";
 #endif
@@ -1277,10 +1296,10 @@
  */
 STATIC int				/* error */
 xfs_alloc_ag_vextent_size(
-	xfs_alloc_arg_t *args)		/* allocation argument structure */
+	xfs_alloc_arg_t	*args)		/* allocation argument structure */
 {
-	xfs_btree_cur_t *bno_cur;	/* cursor for bno btree */
-	xfs_btree_cur_t *cnt_cur;	/* cursor for cnt btree */
+	xfs_btree_cur_t	*bno_cur;	/* cursor for bno btree */
+	xfs_btree_cur_t	*cnt_cur;	/* cursor for cnt btree */
 	int		error;		/* error result */
 	xfs_agblock_t	fbno;		/* start of found freespace */
 	xfs_extlen_t	flen;		/* length of found freespace */
@@ -1433,10 +1452,10 @@
  */
 STATIC int			/* error */
 xfs_alloc_ag_vextent_small(
-	xfs_alloc_arg_t *args,	/* allocation argument structure */
-	xfs_btree_cur_t *ccur,	/* by-size cursor */
-	xfs_agblock_t	*fbnop, /* result block number */
-	xfs_extlen_t	*flenp, /* result length */
+	xfs_alloc_arg_t	*args,	/* allocation argument structure */
+	xfs_btree_cur_t	*ccur,	/* by-size cursor */
+	xfs_agblock_t	*fbnop,	/* result block number */
+	xfs_extlen_t	*flenp,	/* result length */
 	int		*stat)	/* status: 0-freelist, 1-normal/none */
 {
 	int		error;
@@ -1526,8 +1545,8 @@
 	xfs_extlen_t	len,	/* length of extent */
 	int		isfl)	/* set if is freelist blocks - no sb acctg */
 {
-	xfs_btree_cur_t *bno_cur;	/* cursor for by-block btree */
-	xfs_btree_cur_t *cnt_cur;	/* cursor for by-size btree */
+	xfs_btree_cur_t	*bno_cur;	/* cursor for by-block btree */
+	xfs_btree_cur_t	*cnt_cur;	/* cursor for by-size btree */
 	int		error;		/* error return value */
 #ifdef XFS_ALLOC_TRACE
 	static char	fname[] = "xfs_free_ag_extent";
@@ -1775,7 +1794,7 @@
 	 * used in xfs_bmap_finish, we can't allow block to be available
 	 * for reallocation and non-transaction writing (user data)
 	 * until we know that the transaction that moved it to the free
-	 * list is permanently on disk.	 We track the blocks by declaring
+	 * list is permanently on disk.  We track the blocks by declaring
 	 * these blocks as "busy"; the busy list is maintained on a per-ag
 	 * basis and each transaction records which entries should be removed
 	 * when the iclog commits to disk.  If a busy block is allocated,
@@ -1826,7 +1845,7 @@
  */
 STATIC int			/* error */
 xfs_alloc_fix_freelist(
-	xfs_alloc_arg_t *args,	/* allocation argument structure */
+	xfs_alloc_arg_t	*args,	/* allocation argument structure */
 	int		flags)	/* XFS_ALLOC_FLAG_... */
 {
 	xfs_buf_t	*agbp;	/* agf buffer pointer */
@@ -1839,7 +1858,7 @@
 	xfs_mount_t	*mp;	/* file system mount point structure */
 	xfs_extlen_t	need;	/* total blocks needed in freelist */
 	xfs_perag_t	*pag;	/* per-ag information structure */
-	xfs_alloc_arg_t targs;	/* local allocation arguments */
+	xfs_alloc_arg_t	targs;	/* local allocation arguments */
 	xfs_trans_t	*tp;	/* transaction pointer */
 
 	mp = args->mp;
@@ -1959,8 +1978,8 @@
 		if ((error = xfs_alloc_ag_vextent(&targs)))
 			return error;
 		/*
-		 * Stop if we run out.	Won't happen if callers are obeying
-		 * the restrictions correctly.	Can happen for free calls
+		 * Stop if we run out.  Won't happen if callers are obeying
+		 * the restrictions correctly.  Can happen for free calls
 		 * on a completely full ag.
 		 */
 		if (targs.agbno == NULLAGBLOCK)
@@ -2035,7 +2054,7 @@
 	 * As blocks are freed, they are added to the per-ag busy list
 	 * and remain there until the freeing transaction is committed to
 	 * disk.  Now that we have allocated blocks, this list must be
-	 * searched to see if a block is being reused.	If one is, then
+	 * searched to see if a block is being reused.  If one is, then
 	 * the freeing transaction must be pushed to disk NOW by forcing
 	 * to disk all iclogs up that transaction's LSN.
 	 */
@@ -2050,7 +2069,7 @@
 xfs_alloc_log_agf(
 	xfs_trans_t	*tp,	/* transaction pointer */
 	xfs_buf_t	*bp,	/* buffer for a.g. freelist header */
-	int		fields) /* mask of fields to be logged (XFS_AGF_...) */
+	int		fields)	/* mask of fields to be logged (XFS_AGF_...) */
 {
 	int	first;		/* first byte offset */
 	int	last;		/* last byte offset */
@@ -2227,9 +2246,9 @@
  */
 int				/* error */
 xfs_alloc_vextent(
-	xfs_alloc_arg_t *args)	/* allocation argument structure */
+	xfs_alloc_arg_t	*args)	/* allocation argument structure */
 {
-	xfs_agblock_t	agsize; /* allocation group size */
+	xfs_agblock_t	agsize;	/* allocation group size */
 	int		error;
 	int		flags;	/* XFS_ALLOC_FLAG_... locking flags */
 #ifdef XFS_ALLOC_TRACE
@@ -2238,7 +2257,7 @@
 	xfs_extlen_t	minleft;/* minimum left value, temp copy */
 	xfs_mount_t	*mp;	/* mount structure pointer */
 	xfs_agnumber_t	sagno;	/* starting allocation group number */
-	xfs_alloctype_t type;	/* input allocation type */
+	xfs_alloctype_t	type;	/* input allocation type */
 	int		bump_rotor = 0;
 	int		no_min = 0;
 
@@ -2433,7 +2452,7 @@
 #ifdef DEBUG
 	xfs_agf_t	*agf;	/* a.g. freespace header */
 #endif
-	xfs_alloc_arg_t args;	/* allocation argument structure */
+	xfs_alloc_arg_t	args;	/* allocation argument structure */
 	int		error;
 
 	ASSERT(len != 0);
@@ -2464,7 +2483,7 @@
 /*
  * AG Busy list management
  * The busy list contains block ranges that have been freed but whose
- * transacations have not yet hit disk.	 If any block listed in a busy
+ * transacations have not yet hit disk.  If any block listed in a busy
  * list is reused, the transaction that freed it must be forced to disk
  * before continuing to use the block.
  *
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_alloc.h linux-2.5.68-bk12/fs/xfs/xfs_alloc.h
--- linux-2.5.68-bk11/fs/xfs/xfs_alloc.h	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_alloc.h	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_ALLOC_H__
-#define __XFS_ALLOC_H__
+#define	__XFS_ALLOC_H__
 
 struct xfs_buf;
 struct xfs_mount;
@@ -38,7 +38,7 @@
 struct xfs_trans;
 
 /*
- * Freespace allocation types.	Argument to xfs_alloc_[v]extent.
+ * Freespace allocation types.  Argument to xfs_alloc_[v]extent.
  */
 typedef enum xfs_alloctype
 {
@@ -54,7 +54,7 @@
 /*
  * Flags for xfs_alloc_fix_freelist.
  */
-#define XFS_ALLOC_FLAG_TRYLOCK	0x00000001  /* use trylock for buffer locking */
+#define	XFS_ALLOC_FLAG_TRYLOCK	0x00000001  /* use trylock for buffer locking */
 
 /*
  * Argument structure for xfs_alloc routines.
@@ -78,8 +78,8 @@
 	xfs_extlen_t	alignment;	/* align answer to multiple of this */
 	xfs_extlen_t	minalignslop;	/* slop for minlen+alignment calcs */
 	xfs_extlen_t	len;		/* output: actual size of extent */
-	xfs_alloctype_t type;		/* allocation type XFS_ALLOCTYPE_... */
-	xfs_alloctype_t otype;		/* original allocation type */
+	xfs_alloctype_t	type;		/* allocation type XFS_ALLOCTYPE_... */
+	xfs_alloctype_t	otype;		/* original allocation type */
 	char		wasdel;		/* set if allocation was prev delayed */
 	char		wasfromfl;	/* set if allocation is from freelist */
 	char		isfl;		/* set if is freelist blocks - !actg */
@@ -98,21 +98,21 @@
 /*
  * Types for alloc tracing.
  */
-#define XFS_ALLOC_KTRACE_ALLOC	1
-#define XFS_ALLOC_KTRACE_FREE	2
-#define XFS_ALLOC_KTRACE_MODAGF 3
-#define XFS_ALLOC_KTRACE_BUSY	4
-#define XFS_ALLOC_KTRACE_UNBUSY 5
-#define XFS_ALLOC_KTRACE_BUSYSEARCH	6
+#define	XFS_ALLOC_KTRACE_ALLOC	1
+#define	XFS_ALLOC_KTRACE_FREE	2
+#define	XFS_ALLOC_KTRACE_MODAGF	3
+#define	XFS_ALLOC_KTRACE_BUSY	4
+#define	XFS_ALLOC_KTRACE_UNBUSY	5
+#define	XFS_ALLOC_KTRACE_BUSYSEARCH	6
 
 
 /*
  * Allocation tracing buffer size.
  */
-#define XFS_ALLOC_TRACE_SIZE	4096
+#define	XFS_ALLOC_TRACE_SIZE	4096
 
 #ifdef	XFS_ALL_TRACE
-#define XFS_ALLOC_TRACE
+#define	XFS_ALLOC_TRACE
 #endif
 
 #if !defined(DEBUG)
@@ -138,7 +138,7 @@
 xfs_alloc_get_freelist(
 	struct xfs_trans *tp,	/* transaction pointer */
 	struct xfs_buf	*agbp,	/* buffer containing the agf structure */
-	xfs_agblock_t	*bnop); /* block address retrieved from freelist */
+	xfs_agblock_t	*bnop);	/* block address retrieved from freelist */
 
 /*
  * Log the given fields from the agf structure.
@@ -157,7 +157,7 @@
 	struct xfs_mount *mp,	/* file system mount structure */
 	struct xfs_trans *tp,	/* transaction pointer */
 	xfs_agnumber_t	agno,	/* allocation group number */
-	int		flags); /* XFS_ALLOC_FLAGS_... */
+	int		flags);	/* XFS_ALLOC_FLAGS_... */
 
 /*
  * Put the block on the freelist for the allocation group.
@@ -185,7 +185,7 @@
  */
 int				/* error */
 xfs_alloc_vextent(
-	xfs_alloc_arg_t *args); /* allocation argument structure */
+	xfs_alloc_arg_t	*args);	/* allocation argument structure */
 
 /*
  * Free an extent.
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_alloc_btree.c linux-2.5.68-bk12/fs/xfs/xfs_alloc_btree.c
--- linux-2.5.68-bk11/fs/xfs/xfs_alloc_btree.c	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_alloc_btree.c	2003-05-04 04:41:49.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -34,7 +34,24 @@
  * Free space allocation for XFS.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_alloc.h"
+#include "xfs_error.h"
 
 /*
  * Prototypes for internal functions.
@@ -68,7 +85,7 @@
 	int			*stat)	/* fail/done/go-on */
 {
 	xfs_agf_t		*agf;	/* allocation group freelist header */
-	xfs_alloc_block_t	*block; /* btree block record/key lives in */
+	xfs_alloc_block_t	*block;	/* btree block record/key lives in */
 	xfs_agblock_t		bno;	/* btree block number */
 	xfs_buf_t		*bp;	/* buffer for block */
 	int			error;	/* error return value */
@@ -85,7 +102,7 @@
 	int			ptr;	/* index in btree block for this rec */
 	xfs_agblock_t		rbno;	/* right block's block number */
 	xfs_buf_t		*rbp;	/* right block's buffer pointer */
-	xfs_alloc_block_t	*right; /* right btree block */
+	xfs_alloc_block_t	*right;	/* right btree block */
 	xfs_alloc_key_t		*rkp;	/* right block key pointer */
 	xfs_alloc_ptr_t		*rpp;	/* right block address pointer */
 	int			rrecs=0;	/* number of records in right block */
@@ -141,7 +158,7 @@
 		}
 	}
 	/*
-	 * It's a leaf.	 Excise the record being deleted, by sliding the
+	 * It's a leaf.  Excise the record being deleted, by sliding the
 	 * entries past it down one.  Log the changed areas of the block.
 	 */
 	else {
@@ -455,7 +472,7 @@
 	}
 	/*
 	 * Otherwise, we can't fix the imbalance.
-	 * Just return.	 This is probably a logic error, but it's not fatal.
+	 * Just return.  This is probably a logic error, but it's not fatal.
 	 */
 	else {
 		if (level > 0 && (error = xfs_alloc_decrement(cur, level, &i)))
@@ -489,7 +506,7 @@
 				   INT_GET(left->bb_numrecs, ARCH_CONVERT) + INT_GET(right->bb_numrecs, ARCH_CONVERT));
 	} else {
 		/*
-		 * It's a leaf.	 Move records.
+		 * It's a leaf.  Move records.
 		 */
 		lrp = XFS_ALLOC_REC_ADDR(left, INT_GET(left->bb_numrecs, ARCH_CONVERT) + 1, cur);
 		rrp = XFS_ALLOC_REC_ADDR(right, 1, cur);
@@ -589,11 +606,11 @@
 	int			level,	/* level to insert record at */
 	xfs_agblock_t		*bnop,	/* i/o: block number inserted */
 	xfs_alloc_rec_t		*recp,	/* i/o: record data inserted */
-	xfs_btree_cur_t		**curp, /* output: new cursor replacing cur */
+	xfs_btree_cur_t		**curp,	/* output: new cursor replacing cur */
 	int			*stat)	/* output: success/failure */
 {
 	xfs_agf_t		*agf;	/* allocation group freelist header */
-	xfs_alloc_block_t	*block; /* btree block record/key lives in */
+	xfs_alloc_block_t	*block;	/* btree block record/key lives in */
 	xfs_buf_t		*bp;	/* buffer for block */
 	int			error;	/* error return value */
 	int			i;	/* loop index */
@@ -820,7 +837,7 @@
 xfs_alloc_log_block(
 	xfs_trans_t		*tp,	/* transaction pointer */
 	xfs_buf_t		*bp,	/* buffer containing btree block */
-	int			fields) /* mask of fields: XFS_BB_... */
+	int			fields)	/* mask of fields: XFS_BB_... */
 {
 	int			first;	/* first byte offset logged */
 	int			last;	/* last byte offset logged */
@@ -844,10 +861,10 @@
 xfs_alloc_log_keys(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	xfs_buf_t		*bp,	/* buffer containing btree block */
-	int			kfirst, /* index of first key to log */
+	int			kfirst,	/* index of first key to log */
 	int			klast)	/* index of last key to log */
 {
-	xfs_alloc_block_t	*block; /* btree block to log from */
+	xfs_alloc_block_t	*block;	/* btree block to log from */
 	int			first;	/* first byte offset logged */
 	xfs_alloc_key_t		*kp;	/* key pointer in btree block */
 	int			last;	/* last byte offset logged */
@@ -866,10 +883,10 @@
 xfs_alloc_log_ptrs(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	xfs_buf_t		*bp,	/* buffer containing btree block */
-	int			pfirst, /* index of first pointer to log */
+	int			pfirst,	/* index of first pointer to log */
 	int			plast)	/* index of last pointer to log */
 {
-	xfs_alloc_block_t	*block; /* btree block to log from */
+	xfs_alloc_block_t	*block;	/* btree block to log from */
 	int			first;	/* first byte offset logged */
 	int			last;	/* last byte offset logged */
 	xfs_alloc_ptr_t		*pp;	/* block-pointer pointer in btree blk */
@@ -888,10 +905,10 @@
 xfs_alloc_log_recs(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	xfs_buf_t		*bp,	/* buffer containing btree block */
-	int			rfirst, /* index of first record to log */
+	int			rfirst,	/* index of first record to log */
 	int			rlast)	/* index of last record to log */
 {
-	xfs_alloc_block_t	*block; /* btree block to log from */
+	xfs_alloc_block_t	*block;	/* btree block to log from */
 	int			first;	/* first byte offset logged */
 	int			last;	/* last byte offset logged */
 	xfs_alloc_rec_t		*rp;	/* record pointer for btree block */
@@ -902,7 +919,7 @@
 #ifdef DEBUG
 	{
 		xfs_agf_t	*agf;
-		xfs_alloc_rec_t *p;
+		xfs_alloc_rec_t	*p;
 
 		agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp);
 		for (p = &rp[rfirst - 1]; p <= &rp[rlast - 1]; p++)
@@ -997,8 +1014,8 @@
 		 */
 		else {
 			int		high;	/* high entry number */
-			xfs_alloc_key_t *kkbase=NULL;/* base of keys in block */
-			xfs_alloc_rec_t *krbase=NULL;/* base of records in block */
+			xfs_alloc_key_t	*kkbase=NULL;/* base of keys in block */
+			xfs_alloc_rec_t	*krbase=NULL;/* base of records in block */
 			int		low;	/* low entry number */
 
 			/*
@@ -1038,13 +1055,13 @@
 				 * Get startblock & blockcount.
 				 */
 				if (level > 0) {
-					xfs_alloc_key_t *kkp;
+					xfs_alloc_key_t	*kkp;
 
 					kkp = kkbase + keyno - 1;
 					startblock = INT_GET(kkp->ar_startblock, ARCH_CONVERT);
 					blockcount = INT_GET(kkp->ar_blockcount, ARCH_CONVERT);
 				} else {
-					xfs_alloc_rec_t *krp;
+					xfs_alloc_rec_t	*krp;
 
 					krp = krbase + keyno - 1;
 					startblock = INT_GET(krp->ar_startblock, ARCH_CONVERT);
@@ -1151,7 +1168,7 @@
 	xfs_alloc_block_t	*left;	/* left neighbor btree block */
 	int			nrec;	/* new number of left block entries */
 	xfs_buf_t		*rbp;	/* buffer for right (current) block */
-	xfs_alloc_block_t	*right; /* right (current) btree block */
+	xfs_alloc_block_t	*right;	/* right (current) btree block */
 	xfs_alloc_key_t		*rkp=NULL;	/* key pointer for right block */
 	xfs_alloc_ptr_t		*rpp=NULL;	/* address pointer for right block */
 	xfs_alloc_rec_t		*rrp=NULL;	/* record pointer for right block */
@@ -1202,8 +1219,8 @@
 	 * If non-leaf, copy a key and a ptr to the left block.
 	 */
 	if (level > 0) {
-		xfs_alloc_key_t *lkp;	/* key pointer for left block */
-		xfs_alloc_ptr_t *lpp;	/* address pointer for left block */
+		xfs_alloc_key_t	*lkp;	/* key pointer for left block */
+		xfs_alloc_ptr_t	*lpp;	/* address pointer for left block */
 
 		lkp = XFS_ALLOC_KEY_ADDR(left, nrec, cur);
 		rkp = XFS_ALLOC_KEY_ADDR(right, 1, cur);
@@ -1223,7 +1240,7 @@
 	 * If leaf, copy a record to the left block.
 	 */
 	else {
-		xfs_alloc_rec_t *lrp;	/* record pointer for left block */
+		xfs_alloc_rec_t	*lrp;	/* record pointer for left block */
 
 		lrp = XFS_ALLOC_REC_ADDR(left, nrec, cur);
 		rrp = XFS_ALLOC_REC_ADDR(right, 1, cur);
@@ -1292,7 +1309,7 @@
 	int			nptr;	/* new value for key index, 1 or 2 */
 	xfs_agblock_t		rbno;	/* right block number */
 	xfs_buf_t		*rbp;	/* right btree buffer */
-	xfs_alloc_block_t	*right; /* right btree block */
+	xfs_alloc_block_t	*right;	/* right btree block */
 
 	mp = cur->bc_mp;
 
@@ -1395,7 +1412,7 @@
 			kp[0] = *XFS_ALLOC_KEY_ADDR(left, 1, cur); /* INT_: structure copy */
 			kp[1] = *XFS_ALLOC_KEY_ADDR(right, 1, cur);/* INT_: structure copy */
 		} else {
-			xfs_alloc_rec_t *rp;	/* btree record pointer */
+			xfs_alloc_rec_t	*rp;	/* btree record pointer */
 
 			rp = XFS_ALLOC_REC_ADDR(left, 1, cur);
 			kp[0].ar_startblock = rp->ar_startblock; /* INT_: direct copy */
@@ -1443,7 +1460,7 @@
 	xfs_buf_t		*lbp;	/* buffer for left (current) block */
 	xfs_alloc_block_t	*left;	/* left (current) btree block */
 	xfs_buf_t		*rbp;	/* buffer for right neighbor block */
-	xfs_alloc_block_t	*right; /* right neighbor btree block */
+	xfs_alloc_block_t	*right;	/* right neighbor btree block */
 	xfs_alloc_key_t		*rkp;	/* key pointer for right block */
 	xfs_btree_cur_t		*tcur;	/* temporary cursor */
 
@@ -1493,9 +1510,9 @@
 	 * copy the last left block entry to the hole.
 	 */
 	if (level > 0) {
-		xfs_alloc_key_t *lkp;	/* key pointer for left block */
-		xfs_alloc_ptr_t *lpp;	/* address pointer for left block */
-		xfs_alloc_ptr_t *rpp;	/* address pointer for right block */
+		xfs_alloc_key_t	*lkp;	/* key pointer for left block */
+		xfs_alloc_ptr_t	*lpp;	/* address pointer for left block */
+		xfs_alloc_ptr_t	*rpp;	/* address pointer for right block */
 
 		lkp = XFS_ALLOC_KEY_ADDR(left, INT_GET(left->bb_numrecs, ARCH_CONVERT), cur);
 		lpp = XFS_ALLOC_PTR_ADDR(left, INT_GET(left->bb_numrecs, ARCH_CONVERT), cur);
@@ -1519,8 +1536,8 @@
 		xfs_alloc_log_ptrs(cur, rbp, 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) + 1);
 		xfs_btree_check_key(cur->bc_btnum, rkp, rkp + 1);
 	} else {
-		xfs_alloc_rec_t *lrp;	/* record pointer for left block */
-		xfs_alloc_rec_t *rrp;	/* record pointer for right block */
+		xfs_alloc_rec_t	*lrp;	/* record pointer for left block */
+		xfs_alloc_rec_t	*rrp;	/* record pointer for right block */
 
 		lrp = XFS_ALLOC_REC_ADDR(left, INT_GET(left->bb_numrecs, ARCH_CONVERT), cur);
 		rrp = XFS_ALLOC_REC_ADDR(right, 1, cur);
@@ -1568,7 +1585,7 @@
 	int			level,	/* level to split */
 	xfs_agblock_t		*bnop,	/* output: block number allocated */
 	xfs_alloc_key_t		*keyp,	/* output: first key of new block */
-	xfs_btree_cur_t		**curp, /* output: new cursor */
+	xfs_btree_cur_t		**curp,	/* output: new cursor */
 	int			*stat)	/* success/failure */
 {
 	int			error;	/* error return value */
@@ -1578,7 +1595,7 @@
 	xfs_alloc_block_t	*left;	/* left (current) btree block */
 	xfs_agblock_t		rbno;	/* right (new) block number */
 	xfs_buf_t		*rbp;	/* buffer for right block */
-	xfs_alloc_block_t	*right; /* right (new) btree block */
+	xfs_alloc_block_t	*right;	/* right (new) btree block */
 
 	/*
 	 * Allocate the new block from the freelist.
@@ -1625,10 +1642,10 @@
 	 * For non-leaf blocks, copy keys and addresses over to the new block.
 	 */
 	if (level > 0) {
-		xfs_alloc_key_t *lkp;	/* left btree key pointer */
-		xfs_alloc_ptr_t *lpp;	/* left btree address pointer */
-		xfs_alloc_key_t *rkp;	/* right btree key pointer */
-		xfs_alloc_ptr_t *rpp;	/* right btree address pointer */
+		xfs_alloc_key_t	*lkp;	/* left btree key pointer */
+		xfs_alloc_ptr_t	*lpp;	/* left btree address pointer */
+		xfs_alloc_key_t	*rkp;	/* right btree key pointer */
+		xfs_alloc_ptr_t	*rpp;	/* right btree address pointer */
 
 		lkp = XFS_ALLOC_KEY_ADDR(left, i, cur);
 		lpp = XFS_ALLOC_PTR_ADDR(left, i, cur);
@@ -1650,8 +1667,8 @@
 	 * For leaf blocks, copy records over to the new block.
 	 */
 	else {
-		xfs_alloc_rec_t *lrp;	/* left btree record pointer */
-		xfs_alloc_rec_t *rrp;	/* right btree record pointer */
+		xfs_alloc_rec_t	*lrp;	/* left btree record pointer */
+		xfs_alloc_rec_t	*rrp;	/* right btree record pointer */
 
 		lrp = XFS_ALLOC_REC_ADDR(left, i, cur);
 		rrp = XFS_ALLOC_REC_ADDR(right, 1, cur);
@@ -1730,7 +1747,7 @@
 	 * at the first entry in the block.
 	 */
 	for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) {
-		xfs_alloc_block_t	*block; /* btree block */
+		xfs_alloc_block_t	*block;	/* btree block */
 		xfs_buf_t		*bp;	/* buffer for block */
 #ifdef DEBUG
 		int			error;	/* error return value */
@@ -1765,7 +1782,7 @@
 	int			level,	/* level in btree, 0 is leaf */
 	int			*stat)	/* success/failure */
 {
-	xfs_alloc_block_t	*block; /* btree block */
+	xfs_alloc_block_t	*block;	/* btree block */
 	int			error;	/* error return value */
 	int			lev;	/* btree level */
 
@@ -1846,7 +1863,7 @@
  */
 int					/* error */
 xfs_alloc_delete(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	int		*stat)		/* success/failure */
 {
 	int		error;		/* error return value */
@@ -1885,7 +1902,7 @@
 	xfs_extlen_t		*len,	/* output: length of extent */
 	int			*stat)	/* output: success/failure */
 {
-	xfs_alloc_block_t	*block; /* btree block */
+	xfs_alloc_block_t	*block;	/* btree block */
 #ifdef DEBUG
 	int			error;	/* error return value */
 #endif
@@ -1928,7 +1945,7 @@
 	int			level,	/* level in btree, 0 is leaf */
 	int			*stat)	/* success/failure */
 {
-	xfs_alloc_block_t	*block; /* btree block */
+	xfs_alloc_block_t	*block;	/* btree block */
 	xfs_buf_t		*bp;	/* tree block buffer */
 	int			error;	/* error return value */
 	int			lev;	/* btree level */
@@ -2015,16 +2032,16 @@
  */
 int					/* error */
 xfs_alloc_insert(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	int		*stat)		/* success/failure */
 {
 	int		error;		/* error return value */
 	int		i;		/* result value, 0 for failure */
 	int		level;		/* current level number in btree */
 	xfs_agblock_t	nbno;		/* new block number (split result) */
-	xfs_btree_cur_t *ncur;		/* new cursor (split result) */
-	xfs_alloc_rec_t nrec;		/* record being inserted this level */
-	xfs_btree_cur_t *pcur;		/* previous level's cursor */
+	xfs_btree_cur_t	*ncur;		/* new cursor (split result) */
+	xfs_alloc_rec_t	nrec;		/* record being inserted this level */
+	xfs_btree_cur_t	*pcur;		/* previous level's cursor */
 
 	level = 0;
 	nbno = NULLAGBLOCK;
@@ -2074,7 +2091,7 @@
  */
 int					/* error */
 xfs_alloc_lookup_eq(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	xfs_agblock_t	bno,		/* starting block of extent */
 	xfs_extlen_t	len,		/* length of extent */
 	int		*stat)		/* success/failure */
@@ -2090,7 +2107,7 @@
  */
 int					/* error */
 xfs_alloc_lookup_ge(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	xfs_agblock_t	bno,		/* starting block of extent */
 	xfs_extlen_t	len,		/* length of extent */
 	int		*stat)		/* success/failure */
@@ -2106,7 +2123,7 @@
  */
 int					/* error */
 xfs_alloc_lookup_le(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	xfs_agblock_t	bno,		/* starting block of extent */
 	xfs_extlen_t	len,		/* length of extent */
 	int		*stat)		/* success/failure */
@@ -2126,7 +2143,7 @@
 	xfs_agblock_t		bno,	/* starting block of extent */
 	xfs_extlen_t		len)	/* length of extent */
 {
-	xfs_alloc_block_t	*block; /* btree block to update */
+	xfs_alloc_block_t	*block;	/* btree block to update */
 	int			error;	/* error return value */
 	int			ptr;	/* current record number (updating) */
 
@@ -2176,7 +2193,7 @@
 	 * Updating first record in leaf. Pass new key value up to our parent.
 	 */
 	if (ptr == 1) {
-		xfs_alloc_key_t key;	/* key containing [bno, len] */
+		xfs_alloc_key_t	key;	/* key containing [bno, len] */
 
 		INT_SET(key.ar_startblock, ARCH_CONVERT, bno);
 		INT_SET(key.ar_blockcount, ARCH_CONVERT, len);
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_alloc_btree.h linux-2.5.68-bk12/fs/xfs/xfs_alloc_btree.h
--- linux-2.5.68-bk11/fs/xfs/xfs_alloc_btree.h	2003-04-19 19:51:12.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_alloc_btree.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_ALLOC_BTREE_H__
-#define __XFS_ALLOC_BTREE_H__
+#define	__XFS_ALLOC_BTREE_H__
 
 /*
  * Freespace on-disk structures
@@ -46,8 +46,8 @@
  * by blockcount and blockno.  All blocks look the same to make the code
  * simpler; if we have time later, we'll make the optimizations.
  */
-#define XFS_ABTB_MAGIC	0x41425442	/* 'ABTB' for bno tree */
-#define XFS_ABTC_MAGIC	0x41425443	/* 'ABTC' for cnt tree */
+#define	XFS_ABTB_MAGIC	0x41425442	/* 'ABTB' for bno tree */
+#define	XFS_ABTC_MAGIC	0x41425443	/* 'ABTC' for cnt tree */
 
 /*
  * Data record/key structure
@@ -60,13 +60,13 @@
 
 typedef xfs_agblock_t xfs_alloc_ptr_t;	/* btree pointer type */
 					/* btree block header type */
-typedef struct xfs_btree_sblock xfs_alloc_block_t;
+typedef	struct xfs_btree_sblock xfs_alloc_block_t;
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_ALLOC_BLOCK)
 xfs_alloc_block_t *xfs_buf_to_alloc_block(struct xfs_buf *bp);
-#define XFS_BUF_TO_ALLOC_BLOCK(bp)	xfs_buf_to_alloc_block(bp)
+#define	XFS_BUF_TO_ALLOC_BLOCK(bp)	xfs_buf_to_alloc_block(bp)
 #else
-#define XFS_BUF_TO_ALLOC_BLOCK(bp) ((xfs_alloc_block_t *)(XFS_BUF_PTR(bp)))
+#define	XFS_BUF_TO_ALLOC_BLOCK(bp) ((xfs_alloc_block_t *)(XFS_BUF_PTR(bp)))
 #endif
 
 /*
@@ -75,23 +75,23 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_BLOCK_SIZE)
 int xfs_alloc_block_size(int lev, struct xfs_btree_cur *cur);
-#define XFS_ALLOC_BLOCK_SIZE(lev,cur)	xfs_alloc_block_size(lev,cur)
+#define	XFS_ALLOC_BLOCK_SIZE(lev,cur)	xfs_alloc_block_size(lev,cur)
 #else
-#define XFS_ALLOC_BLOCK_SIZE(lev,cur)	(1 << (cur)->bc_blocklog)
+#define	XFS_ALLOC_BLOCK_SIZE(lev,cur)	(1 << (cur)->bc_blocklog)
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_BLOCK_MAXRECS)
 int xfs_alloc_block_maxrecs(int lev, struct xfs_btree_cur *cur);
-#define XFS_ALLOC_BLOCK_MAXRECS(lev,cur)	xfs_alloc_block_maxrecs(lev,cur)
+#define	XFS_ALLOC_BLOCK_MAXRECS(lev,cur)	xfs_alloc_block_maxrecs(lev,cur)
 #else
-#define XFS_ALLOC_BLOCK_MAXRECS(lev,cur)	\
+#define	XFS_ALLOC_BLOCK_MAXRECS(lev,cur)	\
 	((cur)->bc_mp->m_alloc_mxr[lev != 0])
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_BLOCK_MINRECS)
 int xfs_alloc_block_minrecs(int lev, struct xfs_btree_cur *cur);
-#define XFS_ALLOC_BLOCK_MINRECS(lev,cur)	xfs_alloc_block_minrecs(lev,cur)
+#define	XFS_ALLOC_BLOCK_MINRECS(lev,cur)	xfs_alloc_block_minrecs(lev,cur)
 #else
-#define XFS_ALLOC_BLOCK_MINRECS(lev,cur)	\
+#define	XFS_ALLOC_BLOCK_MINRECS(lev,cur)	\
 	((cur)->bc_mp->m_alloc_mnr[lev != 0])
 #endif
 
@@ -115,15 +115,15 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BNO_BLOCK)
 xfs_agblock_t xfs_bno_block(struct xfs_mount *mp);
-#define XFS_BNO_BLOCK(mp)	xfs_bno_block(mp)
+#define	XFS_BNO_BLOCK(mp)	xfs_bno_block(mp)
 #else
-#define XFS_BNO_BLOCK(mp)	((xfs_agblock_t)(XFS_AGFL_BLOCK(mp) + 1))
+#define	XFS_BNO_BLOCK(mp)	((xfs_agblock_t)(XFS_AGFL_BLOCK(mp) + 1))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CNT_BLOCK)
 xfs_agblock_t xfs_cnt_block(struct xfs_mount *mp);
-#define XFS_CNT_BLOCK(mp)	xfs_cnt_block(mp)
+#define	XFS_CNT_BLOCK(mp)	xfs_cnt_block(mp)
 #else
-#define XFS_CNT_BLOCK(mp)	((xfs_agblock_t)(XFS_BNO_BLOCK(mp) + 1))
+#define	XFS_CNT_BLOCK(mp)	((xfs_agblock_t)(XFS_BNO_BLOCK(mp) + 1))
 #endif
 
 /*
@@ -132,9 +132,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_REC_ADDR)
 xfs_alloc_rec_t *xfs_alloc_rec_addr(xfs_alloc_block_t *bb, int i,
 				    struct xfs_btree_cur *cur);
-#define XFS_ALLOC_REC_ADDR(bb,i,cur)	xfs_alloc_rec_addr(bb,i,cur)
+#define	XFS_ALLOC_REC_ADDR(bb,i,cur)	xfs_alloc_rec_addr(bb,i,cur)
 #else
-#define XFS_ALLOC_REC_ADDR(bb,i,cur)	\
+#define	XFS_ALLOC_REC_ADDR(bb,i,cur)	\
 	XFS_BTREE_REC_ADDR(XFS_ALLOC_BLOCK_SIZE(0,cur), xfs_alloc, bb, i, \
 		XFS_ALLOC_BLOCK_MAXRECS(0, cur))
 #endif
@@ -142,9 +142,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_KEY_ADDR)
 xfs_alloc_key_t *xfs_alloc_key_addr(xfs_alloc_block_t *bb, int i,
 				    struct xfs_btree_cur *cur);
-#define XFS_ALLOC_KEY_ADDR(bb,i,cur)	xfs_alloc_key_addr(bb,i,cur)
+#define	XFS_ALLOC_KEY_ADDR(bb,i,cur)	xfs_alloc_key_addr(bb,i,cur)
 #else
-#define XFS_ALLOC_KEY_ADDR(bb,i,cur)	\
+#define	XFS_ALLOC_KEY_ADDR(bb,i,cur)	\
 	XFS_BTREE_KEY_ADDR(XFS_ALLOC_BLOCK_SIZE(1,cur), xfs_alloc, bb, i, \
 		XFS_ALLOC_BLOCK_MAXRECS(1, cur))
 #endif
@@ -152,9 +152,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ALLOC_PTR_ADDR)
 xfs_alloc_ptr_t *xfs_alloc_ptr_addr(xfs_alloc_block_t *bb, int i,
 				    struct xfs_btree_cur *cur);
-#define XFS_ALLOC_PTR_ADDR(bb,i,cur)	xfs_alloc_ptr_addr(bb,i,cur)
+#define	XFS_ALLOC_PTR_ADDR(bb,i,cur)	xfs_alloc_ptr_addr(bb,i,cur)
 #else
-#define XFS_ALLOC_PTR_ADDR(bb,i,cur)	\
+#define	XFS_ALLOC_PTR_ADDR(bb,i,cur)	\
 	XFS_BTREE_PTR_ADDR(XFS_ALLOC_BLOCK_SIZE(1,cur), xfs_alloc, bb, i, \
 		XFS_ALLOC_BLOCK_MAXRECS(1, cur))
 #endif
@@ -171,7 +171,7 @@
 xfs_alloc_decrement(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	int			level,	/* level in btree, 0 is leaf */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Delete the record pointed to by cur.
@@ -181,7 +181,7 @@
 int					/* error */
 xfs_alloc_delete(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Get the data from the pointed-to record.
@@ -191,7 +191,7 @@
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	xfs_agblock_t		*bno,	/* output: starting block of extent */
 	xfs_extlen_t		*len,	/* output: length of extent */
-	int			*stat); /* output: success/failure */
+	int			*stat);	/* output: success/failure */
 
 /*
  * Increment cursor by one record at the level.
@@ -201,7 +201,7 @@
 xfs_alloc_increment(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	int			level,	/* level in btree, 0 is leaf */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Insert the current record at the point referenced by cur.
@@ -210,7 +210,7 @@
 int					/* error */
 xfs_alloc_insert(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Lookup the record equal to [bno, len] in the btree given by cur.
@@ -220,7 +220,7 @@
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	xfs_agblock_t		bno,	/* starting block of extent */
 	xfs_extlen_t		len,	/* length of extent */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Lookup the first record greater than or equal to [bno, len]
@@ -231,7 +231,7 @@
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	xfs_agblock_t		bno,	/* starting block of extent */
 	xfs_extlen_t		len,	/* length of extent */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Lookup the first record less than or equal to [bno, len]
@@ -242,7 +242,7 @@
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	xfs_agblock_t		bno,	/* starting block of extent */
 	xfs_extlen_t		len,	/* length of extent */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Update the record referred to by cur, to the value given by [bno, len].
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_arch.h linux-2.5.68-bk12/fs/xfs/xfs_arch.h
--- linux-2.5.68-bk11/fs/xfs/xfs_arch.h	2003-04-19 19:50:44.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_arch.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_attr.c linux-2.5.68-bk12/fs/xfs/xfs_attr.c
--- linux-2.5.68-bk11/fs/xfs/xfs_attr.c	2003-04-19 19:49:59.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_attr.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,39 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_attr.h"
+#include "xfs_attr_leaf.h"
+#include "xfs_error.h"
+#include "xfs_bit.h"
+#include "xfs_quota.h"
+#include "xfs_rw.h"
+#include "xfs_trans_space.h"
 
 /*
  * xfs_attr.c
@@ -71,7 +103,7 @@
 STATIC int xfs_attr_rmtval_remove(xfs_da_args_t *args);
 
 #define ATTR_RMTVALUE_MAPSIZE	1	/* # of map entries at once */
-#define ATTR_RMTVALUE_TRANSBLKS 8	/* max # of blks in a transaction */
+#define ATTR_RMTVALUE_TRANSBLKS	8	/* max # of blks in a transaction */
 
 #if defined(DEBUG)
 ktrace_t *xfs_attr_trace_buf;
@@ -88,9 +120,9 @@
 xfs_attr_get(bhv_desc_t *bdp, char *name, char *value, int *valuelenp,
 	     int flags, struct cred *cred)
 {
-	xfs_da_args_t	args;
-	int		error;
-	int		namelen;
+	xfs_da_args_t   args;
+	int             error;
+	int             namelen;
 	xfs_inode_t	*ip = XFS_BHVTOI(bdp);
 
 	if (!name)
@@ -170,8 +202,8 @@
 	int		local, size;
 	uint		nblks;
 	xfs_mount_t	*mp;
-	int		rsvd = (flags & ATTR_ROOT) != 0;
-	int		namelen;
+	int             rsvd = (flags & ATTR_ROOT) != 0;
+	int             namelen;
 
 	ASSERT(MAXNAMELEN-1 <= 0xff); /* length is stored in uint8 */
 	namelen = strlen(name);
@@ -423,13 +455,13 @@
 int								/* error */
 xfs_attr_remove(bhv_desc_t *bdp, char *name, int flags, struct cred *cred)
 {
-	xfs_da_args_t	    args;
-	xfs_inode_t	    *dp;
-	xfs_fsblock_t	    firstblock;
-	xfs_bmap_free_t	    flist;
-	int		    error;
-	xfs_mount_t	    *mp;
-	int		    namelen;
+	xfs_da_args_t       args;
+	xfs_inode_t         *dp;
+	xfs_fsblock_t       firstblock;
+	xfs_bmap_free_t     flist;
+	int                 error;
+	xfs_mount_t         *mp;
+	int                 namelen;
 
 	ASSERT(MAXNAMELEN-1<=0xff); /* length is stored in uint8 */
 	namelen = strlen(name);
@@ -575,7 +607,7 @@
 
 /*
  * Generate a list of extended attribute names and optionally
- * also value lengths.	Positive return value follows the XFS
+ * also value lengths.  Positive return value follows the XFS
  * convention of being an error, zero or negative return code
  * is the length of the buffer returned (negated), indicating
  * success.
@@ -617,7 +649,7 @@
 	context.resynch = 1;
 	context.flags = flags;
 	if (!(flags & ATTR_KERNAMELS)) {
-		context.bufsize = (bufsize & ~(sizeof(int)-1));	 /* align */
+		context.bufsize = (bufsize & ~(sizeof(int)-1));  /* align */
 		context.firstu = context.bufsize;
 		context.alist = (attrlist_t *)buffer;
 		context.alist->al_count = 0;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_attr.h linux-2.5.68-bk12/fs/xfs/xfs_attr.h
--- linux-2.5.68-bk11/fs/xfs/xfs_attr.h	2003-04-19 19:48:55.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_attr.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_ATTR_H__
-#define __XFS_ATTR_H__
+#define	__XFS_ATTR_H__
 
 /*
  * xfs_attr.h
@@ -46,7 +46,7 @@
  */
 
 #ifdef XFS_ALL_TRACE
-#define XFS_ATTR_TRACE
+#define	XFS_ATTR_TRACE
 #endif
 
 #if !defined(DEBUG)
@@ -68,15 +68,15 @@
 
 /*
  * The maximum size (into the kernel or returned from the kernel) of an
- * attribute value or the buffer used for an attr_list() call.	Larger
+ * attribute value or the buffer used for an attr_list() call.  Larger
  * sizes will result in an ERANGE return code.
  */
-#define ATTR_MAX_VALUELEN	(64*1024)	/* max length of a value */
+#define	ATTR_MAX_VALUELEN	(64*1024)	/* max length of a value */
 
 /*
  * Define how lists of attribute names are returned to the user from
  * the attr_list() call.  A large, 32bit aligned, buffer is passed in
- * along with its size.	 We put an array of offsets at the top that each
+ * along with its size.  We put an array of offsets at the top that each
  * reference an attrlist_ent_t and pack the attrlist_ent_t's at the bottom.
  */
 typedef struct attrlist {
@@ -98,7 +98,7 @@
  * Given a pointer to the (char*) buffer containing the attr_list() result,
  * and an index, return a pointer to the indicated attribute in the buffer.
  */
-#define ATTR_ENTRY(buffer, index)		\
+#define	ATTR_ENTRY(buffer, index)		\
 	((attrlist_ent_t *)			\
 	 &((char *)buffer)[ ((attrlist_t *)(buffer))->al_offset[index] ])
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_attr_fetch.c linux-2.5.68-bk12/fs/xfs/xfs_attr_fetch.c
--- linux-2.5.68-bk11/fs/xfs/xfs_attr_fetch.c	2003-04-19 19:50:07.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_attr_fetch.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,36 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_itable.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_alloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_attr.h"
+#include "xfs_attr_leaf.h"
 
 int
 xfs_attr_fetch(xfs_inode_t *ip, char *name, char *value, int valuelen)
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_attr_leaf.c linux-2.5.68-bk12/fs/xfs/xfs_attr_leaf.c
--- linux-2.5.68-bk11/fs/xfs/xfs_attr_leaf.c	2003-04-19 19:49:26.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_attr_leaf.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -35,7 +35,36 @@
  * GROT: figure out how to recover gracefully when bmap returns ENOSPC.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_attr.h"
+#include "xfs_attr_leaf.h"
+#include "xfs_error.h"
+#include "xfs_bit.h"
 
 /*
  * xfs_attr_leaf.c
@@ -865,7 +894,7 @@
 
 	/*
 	 * After compaction, the block is guaranteed to have only one
-	 * free region, in freemap[0].	If it is not big enough, give up.
+	 * free region, in freemap[0].  If it is not big enough, give up.
 	 */
 	if (INT_GET(hdr->freemap[0].size, ARCH_CONVERT)
 				< (entsize + sizeof(xfs_attr_leaf_entry_t)))
@@ -1068,7 +1097,7 @@
  *
  * This code adjusts the args->index/blkno and args->index2/blkno2 fields
  * to match what it is doing in splitting the attribute leaf block.  Those
- * values are used in "atomic rename" operations on attributes.	 Note that
+ * values are used in "atomic rename" operations on attributes.  Note that
  * the "new" and "old" values can end up in different blocks.
  */
 STATIC void
@@ -1285,7 +1314,7 @@
 	entry = &leaf1->entries[0];
 	for (count = index = 0; count < max; entry++, index++, count++) {
 
-#define XFS_ATTR_ABS(A) (((A) < 0) ? -(A) : (A))
+#define XFS_ATTR_ABS(A)	(((A) < 0) ? -(A) : (A))
 		/*
 		 * The new entry is in the first block, account for it.
 		 */
@@ -1708,7 +1737,7 @@
 		memset(tmpbuffer, 0, state->blocksize);
 		tmp_leaf = (xfs_attr_leafblock_t *)tmpbuffer;
 		tmp_hdr = &tmp_leaf->hdr;
-		tmp_hdr->info = save_hdr->info; /* struct copy */
+		tmp_hdr->info = save_hdr->info;	/* struct copy */
 		INT_ZERO(tmp_hdr->count, ARCH_CONVERT);
 		INT_SET(tmp_hdr->firstused, ARCH_CONVERT, state->blocksize);
 		if (INT_ISZERO(tmp_hdr->firstused, ARCH_CONVERT)) {
@@ -2004,7 +2033,7 @@
 #ifdef GROT
 		/*
 		 * Code to drop INCOMPLETE entries.  Difficult to use as we
-		 * may also need to change the insertion index.	 Code turned
+		 * may also need to change the insertion index.  Code turned
 		 * off for 6.2, should be revisited later.
 		 */
 		if (entry_s->flags & XFS_ATTR_INCOMPLETE) { /* skip partials? */
@@ -2291,9 +2320,9 @@
 	return(retval);
 }
 
-#define ATTR_ENTBASESIZE		/* minimum bytes used by an attr */ \
+#define	ATTR_ENTBASESIZE		/* minimum bytes used by an attr */ \
 	(((struct attrlist_ent *) 0)->a_name - (char *) 0)
-#define ATTR_ENTSIZE(namelen)		/* actual bytes used by an attr */ \
+#define	ATTR_ENTSIZE(namelen)		/* actual bytes used by an attr */ \
 	((ATTR_ENTBASESIZE + (namelen) + 1 + sizeof(u_int32_t)-1) \
 	 & ~(sizeof(u_int32_t)-1))
 
@@ -2957,7 +2986,7 @@
 	 * Reserve space in the log for th next transaction.
 	 * This also pushes items in the "AIL", the list of logged items,
 	 * out to disk if they are taking up space at the tail of the log
-	 * that we want to use.	 This requires that either nothing be locked
+	 * that we want to use.  This requires that either nothing be locked
 	 * across this call, or that anything that is locked be logged in
 	 * the prior and the next transactions.
 	 */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_attr_leaf.h linux-2.5.68-bk12/fs/xfs/xfs_attr_leaf.h
--- linux-2.5.68-bk11/fs/xfs/xfs_attr_leaf.h	2003-04-19 19:48:46.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_attr_leaf.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_ATTR_LEAF_H__
-#define __XFS_ATTR_LEAF_H__
+#define	__XFS_ATTR_LEAF_H__
 
 /*
  * Attribute storage layout, internal structure, access macros, etc.
@@ -38,7 +38,7 @@
  * Attribute lists are structured around Btrees where all the data
  * elements are in the leaf nodes.  Attribute names are hashed into an int,
  * then that int is used as the index into the Btree.  Since the hashval
- * of an attribute name may not be unique, we may have duplicate keys.	The
+ * of an attribute name may not be unique, we may have duplicate keys.  The
  * internal links in the Btree are logical block offsets into the file.
  */
 
@@ -58,7 +58,7 @@
 /*
  * This is the structure of the leaf nodes in the Btree.
  *
- * Struct leaf_entry's are packed from the top.	 Name/values grow from the
+ * Struct leaf_entry's are packed from the top.  Name/values grow from the
  * bottom but are not packed.  The freemap contains run-length-encoded entries
  * for the free bytes after the leaf_entry's, but only the N largest such,
  * smaller runs are dropped.  When the freemap doesn't show enough space
@@ -76,10 +76,10 @@
  * the leaf_entry.  The namespaces are independent only because we also look
  * at the root/user bit when we are looking for a matching attribute name.
  *
- * We also store a "incomplete" bit in the leaf_entry.	It shows that an
+ * We also store a "incomplete" bit in the leaf_entry.  It shows that an
  * attribute is in the middle of being created and should not be shown to
  * the user if we crash during the time that the bit is set.  We clear the
- * bit when we have finished setting up the attribute.	We do this because
+ * bit when we have finished setting up the attribute.  We do this because
  * we cannot create some large attributes inside a single transaction, and we
  * need some indication that we weren't finished if we crash in the middle.
  */
@@ -127,9 +127,9 @@
  * NOTE: the INCOMPLETE bit must not collide with the flags bits specified
  * on the system call, they are "or"ed together for various operations.
  */
-#define XFS_ATTR_LOCAL_BIT	0	/* attr is stored locally */
-#define XFS_ATTR_ROOT_BIT	1	/* limit access to attr to userid 0 */
-#define XFS_ATTR_INCOMPLETE_BIT 7	/* attr in middle of create/delete */
+#define	XFS_ATTR_LOCAL_BIT	0	/* attr is stored locally */
+#define	XFS_ATTR_ROOT_BIT	1	/* limit access to attr to userid 0 */
+#define	XFS_ATTR_INCOMPLETE_BIT	7	/* attr in middle of create/delete */
 #define XFS_ATTR_LOCAL		(1 << XFS_ATTR_LOCAL_BIT)
 #define XFS_ATTR_ROOT		(1 << XFS_ATTR_ROOT_BIT)
 #define XFS_ATTR_INCOMPLETE	(1 << XFS_ATTR_INCOMPLETE_BIT)
@@ -138,7 +138,7 @@
  * Alignment for namelist and valuelist entries (since they are mixed
  * there can be only one alignment value)
  */
-#define XFS_ATTR_LEAF_NAME_ALIGN	((uint)sizeof(xfs_dablk_t))
+#define	XFS_ATTR_LEAF_NAME_ALIGN	((uint)sizeof(xfs_dablk_t))
 
 /*
  * Cast typed pointers for "local" and "remote" name/value structs.
@@ -211,11 +211,11 @@
 typedef struct xfs_attr_list_context {
 	struct xfs_inode		*dp;	/* inode */
 	struct attrlist_cursor_kern	*cursor;/* position in list */
-	struct attrlist			*alist; /* output buffer */
+	struct attrlist			*alist;	/* output buffer */
 	int				count;	/* num used entries */
-	int				dupcnt; /* count dup hashvals seen */
+	int				dupcnt;	/* count dup hashvals seen */
 	int				bufsize;/* total buffer size */
-	int				firstu; /* first used byte in buffer */
+	int				firstu;	/* first used byte in buffer */
 	int				flags;	/* from VOP call */
 	int				resynch;/* T/F: resynch with cursor */
 } xfs_attr_list_context_t;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_attr_sf.h linux-2.5.68-bk12/fs/xfs/xfs_attr_sf.h
--- linux-2.5.68-bk11/fs/xfs/xfs_attr_sf.h	2003-04-19 19:48:57.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_attr_sf.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_ATTR_SF_H__
-#define __XFS_ATTR_SF_H__
+#define	__XFS_ATTR_SF_H__
 
 /*
  * Attribute storage when stored inside the inode.
@@ -105,7 +105,7 @@
 #endif
 
 #ifdef XFS_ALL_TRACE
-#define XFS_ATTR_TRACE
+#define	XFS_ATTR_TRACE
 #endif
 
 #if !defined(DEBUG)
@@ -120,15 +120,15 @@
 struct xfs_da_node_entry;
 struct xfs_attr_leafblock;
 
-#define XFS_ATTR_TRACE_SIZE	4096	/* size of global trace buffer */
+#define	XFS_ATTR_TRACE_SIZE	4096	/* size of global trace buffer */
 
 /*
  * Trace record types.
  */
-#define XFS_ATTR_KTRACE_L_C	1	/* context */
-#define XFS_ATTR_KTRACE_L_CN	2	/* context, node */
-#define XFS_ATTR_KTRACE_L_CB	3	/* context, btree */
-#define XFS_ATTR_KTRACE_L_CL	4	/* context, leaf */
+#define	XFS_ATTR_KTRACE_L_C	1	/* context */
+#define	XFS_ATTR_KTRACE_L_CN	2	/* context, node */
+#define	XFS_ATTR_KTRACE_L_CB	3	/* context, btree */
+#define	XFS_ATTR_KTRACE_L_CL	4	/* context, leaf */
 
 #if defined(XFS_ATTR_TRACE)
 
@@ -148,10 +148,10 @@
 			     __psunsigned_t a12, __psunsigned_t a13,
 			     __psunsigned_t a14, __psunsigned_t a15);
 #else
-#define xfs_attr_trace_l_c(w,c)
-#define xfs_attr_trace_l_cn(w,c,n)
-#define xfs_attr_trace_l_cb(w,c,b)
-#define xfs_attr_trace_l_cl(w,c,l)
+#define	xfs_attr_trace_l_c(w,c)
+#define	xfs_attr_trace_l_cn(w,c,n)
+#define	xfs_attr_trace_l_cb(w,c,b)
+#define	xfs_attr_trace_l_cl(w,c,l)
 #endif /* XFS_ATTR_TRACE */
 
 #endif	/* __XFS_ATTR_SF_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_bit.c linux-2.5.68-bk12/fs/xfs/xfs_bit.c
--- linux-2.5.68-bk11/fs/xfs/xfs_bit.c	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_bit.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -34,7 +34,12 @@
  * XFS bit manipulation routines, used in non-realtime code.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_bit.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_buf_item.h"
+
 
 #ifndef HAVE_ARCH_HIGHBIT
 /*
@@ -231,7 +236,7 @@
  * start_bit.  Size is the size of the bitmap in words.
  */
 int
-xfs_contig_bits(uint *map, uint size, uint start_bit)
+xfs_contig_bits(uint *map, uint	size, uint start_bit)
 {
 #if BITS_PER_LONG == 32
 	return find_next_zero_bit((unsigned long *)map,
@@ -263,7 +268,7 @@
 
 /*
  * This takes the bit number to start looking from and
- * returns the next set bit from there.	 It returns -1
+ * returns the next set bit from there.  It returns -1
  * if there are no more bits set or the start bit is
  * beyond the end of the bitmap.
  *
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_bit.h linux-2.5.68-bk12/fs/xfs/xfs_bit.h
--- linux-2.5.68-bk11/fs/xfs/xfs_bit.h	2003-04-19 19:51:07.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_bit.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_BIT_H__
-#define __XFS_BIT_H__
+#define	__XFS_BIT_H__
 
 /*
  * XFS bit manipulation routines.
@@ -41,27 +41,27 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK32HI)
 __uint32_t xfs_mask32hi(int n);
-#define XFS_MASK32HI(n)		xfs_mask32hi(n)
+#define	XFS_MASK32HI(n)		xfs_mask32hi(n)
 #else
-#define XFS_MASK32HI(n)		((__uint32_t)-1 << (32 - (n)))
+#define	XFS_MASK32HI(n)		((__uint32_t)-1 << (32 - (n)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK64HI)
 __uint64_t xfs_mask64hi(int n);
-#define XFS_MASK64HI(n)		xfs_mask64hi(n)
+#define	XFS_MASK64HI(n)		xfs_mask64hi(n)
 #else
-#define XFS_MASK64HI(n)		((__uint64_t)-1 << (64 - (n)))
+#define	XFS_MASK64HI(n)		((__uint64_t)-1 << (64 - (n)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK32LO)
 __uint32_t xfs_mask32lo(int n);
-#define XFS_MASK32LO(n)		xfs_mask32lo(n)
+#define	XFS_MASK32LO(n)		xfs_mask32lo(n)
 #else
-#define XFS_MASK32LO(n)		(((__uint32_t)1 << (n)) - 1)
+#define	XFS_MASK32LO(n)		(((__uint32_t)1 << (n)) - 1)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK64LO)
 __uint64_t xfs_mask64lo(int n);
-#define XFS_MASK64LO(n)		xfs_mask64lo(n)
+#define	XFS_MASK64LO(n)		xfs_mask64lo(n)
 #else
-#define XFS_MASK64LO(n)		(((__uint64_t)1 << (n)) - 1)
+#define	XFS_MASK64LO(n)		(((__uint64_t)1 << (n)) - 1)
 #endif
 
 /* Get high bit set out of 32-bit argument, -1 if none set */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_bmap.c linux-2.5.68-bk12/fs/xfs/xfs_bmap.c
--- linux-2.5.68-bk11/fs/xfs/xfs_bmap.c	2003-04-19 19:51:08.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_bmap.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,44 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_dmapi.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_itable.h"
+#include "xfs_extfree_item.h"
+#include "xfs_alloc.h"
+#include "xfs_bmap.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_bit.h"
+#include "xfs_rw.h"
+#include "xfs_quota.h"
+#include "xfs_trans_space.h"
+#include "xfs_buf_item.h"
 
 #ifdef DEBUG
 ktrace_t	*xfs_bmap_trace_buf;
@@ -78,10 +115,10 @@
 xfs_bmap_add_extent(
 	xfs_inode_t		*ip,	/* incore inode pointer */
 	xfs_extnum_t		idx,	/* extent number to update/insert */
-	xfs_btree_cur_t		**curp, /* if *curp is null, not a btree */
+	xfs_btree_cur_t		**curp,	/* if *curp is null, not a btree */
 	xfs_bmbt_irec_t		*new,	/* new data to put in extent list */
-	xfs_fsblock_t		*first, /* pointer to firstblock variable */
-	xfs_bmap_free_t		*flist, /* list of extents to be freed */
+	xfs_fsblock_t		*first,	/* pointer to firstblock variable */
+	xfs_bmap_free_t		*flist,	/* list of extents to be freed */
 	int			*logflagsp, /* inode logging flags */
 	int			whichfork, /* data or attr fork */
 	int			rsvd);	/* OK to allocate reserved blocks */
@@ -94,11 +131,11 @@
 xfs_bmap_add_extent_delay_real(
 	xfs_inode_t		*ip,	/* incore inode pointer */
 	xfs_extnum_t		idx,	/* extent number to update/insert */
-	xfs_btree_cur_t		**curp, /* if *curp is null, not a btree */
+	xfs_btree_cur_t		**curp,	/* if *curp is null, not a btree */
 	xfs_bmbt_irec_t		*new,	/* new data to put in extent list */
 	xfs_filblks_t		*dnew,	/* new delayed-alloc indirect blocks */
-	xfs_fsblock_t		*first, /* pointer to firstblock variable */
-	xfs_bmap_free_t		*flist, /* list of extents to be freed */
+	xfs_fsblock_t		*first,	/* pointer to firstblock variable */
+	xfs_bmap_free_t		*flist,	/* list of extents to be freed */
 	int			*logflagsp, /* inode logging flags */
 	int			rsvd);	/* OK to allocate reserved blocks */
 
@@ -136,7 +173,7 @@
 xfs_bmap_add_extent_unwritten_real(
 	xfs_inode_t		*ip,	/* incore inode pointer */
 	xfs_extnum_t		idx,	/* extent number to update/insert */
-	xfs_btree_cur_t		**curp, /* if *curp is null, not a btree */
+	xfs_btree_cur_t		**curp,	/* if *curp is null, not a btree */
 	xfs_bmbt_irec_t		*new,	/* new data to put in extent list */
 	int			*logflagsp); /* inode logging flags */
 
@@ -171,7 +208,7 @@
 	xfs_inode_t		*ip,		/* incore inode pointer */
 	int			whichfork);	/* data or attr fork */
 #else
-#define xfs_bmap_check_extents(ip,w)
+#define	xfs_bmap_check_extents(ip,w)
 #endif
 
 /*
@@ -183,7 +220,7 @@
 	xfs_inode_t		*ip,	/* incore inode pointer */
 	xfs_trans_t		*tp,	/* current trans pointer */
 	xfs_extnum_t		idx,	/* extent number to update/insert */
-	xfs_bmap_free_t		*flist, /* list of extents to be freed */
+	xfs_bmap_free_t		*flist,	/* list of extents to be freed */
 	xfs_btree_cur_t		*cur,	/* if null, not a btree */
 	xfs_bmbt_irec_t		*new,	/* new data to put in extent list */
 	int			*logflagsp,/* inode logging flags */
@@ -196,9 +233,9 @@
  */
 STATIC void
 xfs_bmap_del_free(
-	xfs_bmap_free_t		*flist, /* free item list header */
+	xfs_bmap_free_t		*flist,	/* free item list header */
 	xfs_bmap_free_item_t	*prev,	/* previous item on list, if any */
-	xfs_bmap_free_item_t	*free); /* list item to be freed */
+	xfs_bmap_free_item_t	*free);	/* list item to be freed */
 
 /*
  * Remove count entries from the extents array for inode "ip", starting
@@ -236,13 +273,13 @@
 	xfs_inode_t	*ip,		/* incore inode pointer */
 	xfs_extnum_t	idx,		/* starting index of new items */
 	xfs_extnum_t	count,		/* number of inserted items */
-	xfs_bmbt_irec_t *new,		/* items to insert */
+	xfs_bmbt_irec_t	*new,		/* items to insert */
 	int		whichfork);	/* data or attr fork */
 
 /*
  * Convert a local file to an extents file.
  * This code is sort of bogus, since the file data needs to get
- * logged so it won't be lost.	The bmap-level manipulations are ok, though.
+ * logged so it won't be lost.  The bmap-level manipulations are ok, though.
  */
 STATIC int				/* error */
 xfs_bmap_local_to_extents(
@@ -267,8 +304,8 @@
 	int		whichfork,	/* data or attr fork */
 	int		*eofp,		/* out: end of file found */
 	xfs_extnum_t	*lastxp,	/* out: last extent index */
-	xfs_bmbt_irec_t *gotp,		/* out: extent entry found */
-	xfs_bmbt_irec_t *prevp);	/* out: previous extent entry found */
+	xfs_bmbt_irec_t	*gotp,		/* out: extent entry found */
+	xfs_bmbt_irec_t	*prevp);	/* out: previous extent entry found */
 
 #ifdef XFS_BMAP_TRACE
 /*
@@ -309,8 +346,8 @@
 	xfs_inode_t	*ip,		/* incore inode pointer */
 	xfs_extnum_t	idx,		/* index of entry(entries) inserted */
 	xfs_extnum_t	cnt,		/* count of entries inserted, 1 or 2 */
-	xfs_bmbt_irec_t *r1,		/* inserted record 1 */
-	xfs_bmbt_irec_t *r2,		/* inserted record 2 or null */
+	xfs_bmbt_irec_t	*r1,		/* inserted record 1 */
+	xfs_bmbt_irec_t	*r2,		/* inserted record 2 or null */
 	int		whichfork);	/* data or attr fork */
 
 /*
@@ -336,10 +373,10 @@
 	int		whichfork);	/* data or attr fork */
 
 #else
-#define xfs_bmap_trace_delete(f,d,ip,i,c,w)
-#define xfs_bmap_trace_insert(f,d,ip,i,c,r1,r2,w)
-#define xfs_bmap_trace_post_update(f,d,ip,i,w)
-#define xfs_bmap_trace_pre_update(f,d,ip,i,w)
+#define	xfs_bmap_trace_delete(f,d,ip,i,c,w)
+#define	xfs_bmap_trace_insert(f,d,ip,i,c,r1,r2,w)
+#define	xfs_bmap_trace_post_update(f,d,ip,i,w)
+#define	xfs_bmap_trace_pre_update(f,d,ip,i,w)
 #endif	/* XFS_BMAP_TRACE */
 
 /*
@@ -365,7 +402,7 @@
 	int			nmap,
 	int			ret_nmap);
 #else
-#define xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap)
+#define	xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap)
 #endif /* DEBUG */
 
 #if defined(DEBUG) && defined(XFS_RW_TRACE)
@@ -377,15 +414,15 @@
 	int			flags,
 	inst_t			*ra);
 #else
-#define xfs_bunmap_trace(ip, bno, len, flags, ra)
+#define	xfs_bunmap_trace(ip, bno, len, flags, ra)
 #endif	/* DEBUG && XFS_RW_TRACE */
 
 STATIC int
 xfs_bmap_count_tree(
-	xfs_mount_t	*mp,
-	xfs_trans_t	*tp,
-	xfs_fsblock_t	blockno,
-	int		levelin,
+	xfs_mount_t     *mp,
+	xfs_trans_t     *tp,
+	xfs_fsblock_t   blockno,
+	int             levelin,
 	int		*count);
 
 STATIC int
@@ -509,10 +546,10 @@
 xfs_bmap_add_extent(
 	xfs_inode_t		*ip,	/* incore inode pointer */
 	xfs_extnum_t		idx,	/* extent number to update/insert */
-	xfs_btree_cur_t		**curp, /* if *curp is null, not a btree */
+	xfs_btree_cur_t		**curp,	/* if *curp is null, not a btree */
 	xfs_bmbt_irec_t		*new,	/* new data to put in extent list */
-	xfs_fsblock_t		*first, /* pointer to firstblock variable */
-	xfs_bmap_free_t		*flist, /* list of extents to be freed */
+	xfs_fsblock_t		*first,	/* pointer to firstblock variable */
+	xfs_bmap_free_t		*flist,	/* list of extents to be freed */
 	int			*logflagsp, /* inode logging flags */
 	int			whichfork, /* data or attr fork */
 	int			rsvd)	/* OK to use reserved data blocks */
@@ -574,7 +611,7 @@
 				&logflags, whichfork)))
 			goto done;
 	} else {
-		xfs_bmbt_irec_t prev;	/* old extent at offset idx */
+		xfs_bmbt_irec_t	prev;	/* old extent at offset idx */
 
 		/*
 		 * Get the record referred to by idx.
@@ -678,11 +715,11 @@
 xfs_bmap_add_extent_delay_real(
 	xfs_inode_t		*ip,	/* incore inode pointer */
 	xfs_extnum_t		idx,	/* extent number to update/insert */
-	xfs_btree_cur_t		**curp, /* if *curp is null, not a btree */
+	xfs_btree_cur_t		**curp,	/* if *curp is null, not a btree */
 	xfs_bmbt_irec_t		*new,	/* new data to put in extent list */
 	xfs_filblks_t		*dnew,	/* new delayed-alloc indirect blocks */
-	xfs_fsblock_t		*first, /* pointer to firstblock variable */
-	xfs_bmap_free_t		*flist, /* list of extents to be freed */
+	xfs_fsblock_t		*first,	/* pointer to firstblock variable */
+	xfs_bmap_free_t		*flist,	/* list of extents to be freed */
 	int			*logflagsp, /* inode logging flags */
 	int			rsvd)	/* OK to use reserved data block allocation */
 {
@@ -698,7 +735,7 @@
 	xfs_fileoff_t		new_endoff;	/* end offset of new entry */
 	xfs_bmbt_irec_t		r[3];	/* neighbor extent entries */
 					/* left is 0, right is 1, prev is 2 */
-	int			rval=0; /* return value (logging flags) */
+	int			rval=0;	/* return value (logging flags) */
 	int			state = 0;/* state bits, accessed thru macros */
 	xfs_filblks_t		temp;	/* value for dnew calculations */
 	xfs_filblks_t		temp2;	/* value for dnew calculations */
@@ -710,18 +747,18 @@
 		LEFT_VALID,	RIGHT_VALID
 	};
 
-#define LEFT		r[0]
-#define RIGHT		r[1]
-#define PREV		r[2]
-#define MASK(b)		(1 << (b))
-#define MASK2(a,b)	(MASK(a) | MASK(b))
-#define MASK3(a,b,c)	(MASK2(a,b) | MASK(c))
-#define MASK4(a,b,c,d)	(MASK3(a,b,c) | MASK(d))
-#define STATE_SET(b,v)	((v) ? (state |= MASK(b)) : (state &= ~MASK(b)))
-#define STATE_TEST(b)	(state & MASK(b))
-#define STATE_SET_TEST(b,v)	((v) ? ((state |= MASK(b)), 1) : \
+#define	LEFT		r[0]
+#define	RIGHT		r[1]
+#define	PREV		r[2]
+#define	MASK(b)		(1 << (b))
+#define	MASK2(a,b)	(MASK(a) | MASK(b))
+#define	MASK3(a,b,c)	(MASK2(a,b) | MASK(c))
+#define	MASK4(a,b,c,d)	(MASK3(a,b,c) | MASK(d))
+#define	STATE_SET(b,v)	((v) ? (state |= MASK(b)) : (state &= ~MASK(b)))
+#define	STATE_TEST(b)	(state & MASK(b))
+#define	STATE_SET_TEST(b,v)	((v) ? ((state |= MASK(b)), 1) : \
 				       ((state &= ~MASK(b)), 0))
-#define SWITCH_STATE		\
+#define	SWITCH_STATE		\
 	(state & MASK4(LEFT_FILLING, RIGHT_FILLING, LEFT_CONTIG, RIGHT_CONTIG))
 
 	/*
@@ -1218,7 +1255,7 @@
 xfs_bmap_add_extent_unwritten_real(
 	xfs_inode_t		*ip,	/* incore inode pointer */
 	xfs_extnum_t		idx,	/* extent number to update/insert */
-	xfs_btree_cur_t		**curp, /* if *curp is null, not a btree */
+	xfs_btree_cur_t		**curp,	/* if *curp is null, not a btree */
 	xfs_bmbt_irec_t		*new,	/* new data to put in extent list */
 	int			*logflagsp) /* inode logging flags */
 {
@@ -1231,11 +1268,11 @@
 #endif
 	int			i;	/* temp state */
 	xfs_fileoff_t		new_endoff;	/* end offset of new entry */
-	xfs_exntst_t		newext; /* new extent state */
-	xfs_exntst_t		oldext; /* old extent state */
+	xfs_exntst_t		newext;	/* new extent state */
+	xfs_exntst_t		oldext;	/* old extent state */
 	xfs_bmbt_irec_t		r[3];	/* neighbor extent entries */
 					/* left is 0, right is 1, prev is 2 */
-	int			rval=0; /* return value (logging flags) */
+	int			rval=0;	/* return value (logging flags) */
 	int			state = 0;/* state bits, accessed thru macros */
 	enum {				/* bit number definitions for state */
 		LEFT_CONTIG,	RIGHT_CONTIG,
@@ -1244,18 +1281,18 @@
 		LEFT_VALID,	RIGHT_VALID
 	};
 
-#define LEFT		r[0]
-#define RIGHT		r[1]
-#define PREV		r[2]
-#define MASK(b)		(1 << (b))
-#define MASK2(a,b)	(MASK(a) | MASK(b))
-#define MASK3(a,b,c)	(MASK2(a,b) | MASK(c))
-#define MASK4(a,b,c,d)	(MASK3(a,b,c) | MASK(d))
-#define STATE_SET(b,v)	((v) ? (state |= MASK(b)) : (state &= ~MASK(b)))
-#define STATE_TEST(b)	(state & MASK(b))
-#define STATE_SET_TEST(b,v)	((v) ? ((state |= MASK(b)), 1) : \
+#define	LEFT		r[0]
+#define	RIGHT		r[1]
+#define	PREV		r[2]
+#define	MASK(b)		(1 << (b))
+#define	MASK2(a,b)	(MASK(a) | MASK(b))
+#define	MASK3(a,b,c)	(MASK2(a,b) | MASK(c))
+#define	MASK4(a,b,c,d)	(MASK3(a,b,c) | MASK(d))
+#define	STATE_SET(b,v)	((v) ? (state |= MASK(b)) : (state &= ~MASK(b)))
+#define	STATE_TEST(b)	(state & MASK(b))
+#define	STATE_SET_TEST(b,v)	((v) ? ((state |= MASK(b)), 1) : \
 				       ((state &= ~MASK(b)), 0))
-#define SWITCH_STATE		\
+#define	SWITCH_STATE		\
 	(state & MASK4(LEFT_FILLING, RIGHT_FILLING, LEFT_CONTIG, RIGHT_CONTIG))
 
 	/*
@@ -1748,7 +1785,7 @@
 	xfs_filblks_t		newlen=0;	/* new indirect size */
 	xfs_filblks_t		oldlen=0;	/* old indirect size */
 	xfs_bmbt_irec_t		right;	/* right neighbor extent entry */
-	int			state;	/* state bits, accessed thru macros */
+	int			state;  /* state bits, accessed thru macros */
 	xfs_filblks_t		temp;	/* temp for indirect calculations */
 	enum {				/* bit number definitions for state */
 		LEFT_CONTIG,	RIGHT_CONTIG,
@@ -1756,13 +1793,13 @@
 		LEFT_VALID,	RIGHT_VALID
 	};
 
-#define MASK(b)			(1 << (b))
-#define MASK2(a,b)		(MASK(a) | MASK(b))
-#define STATE_SET(b,v)		((v) ? (state |= MASK(b)) : (state &= ~MASK(b)))
-#define STATE_TEST(b)		(state & MASK(b))
-#define STATE_SET_TEST(b,v)	((v) ? ((state |= MASK(b)), 1) : \
+#define	MASK(b)			(1 << (b))
+#define	MASK2(a,b)		(MASK(a) | MASK(b))
+#define	STATE_SET(b,v)		((v) ? (state |= MASK(b)) : (state &= ~MASK(b)))
+#define	STATE_TEST(b)		(state & MASK(b))
+#define	STATE_SET_TEST(b,v)	((v) ? ((state |= MASK(b)), 1) : \
 				       ((state &= ~MASK(b)), 0))
-#define SWITCH_STATE		(state & MASK2(LEFT_CONTIG, RIGHT_CONTIG))
+#define	SWITCH_STATE		(state & MASK2(LEFT_CONTIG, RIGHT_CONTIG))
 
 	base = ip->i_df.if_u1.if_extents;
 	ep = &base[idx];
@@ -1925,13 +1962,13 @@
 		LEFT_VALID,	RIGHT_VALID
 	};
 
-#define MASK(b)			(1 << (b))
-#define MASK2(a,b)		(MASK(a) | MASK(b))
-#define STATE_SET(b,v)		((v) ? (state |= MASK(b)) : (state &= ~MASK(b)))
-#define STATE_TEST(b)		(state & MASK(b))
-#define STATE_SET_TEST(b,v)	((v) ? ((state |= MASK(b)), 1) : \
+#define	MASK(b)			(1 << (b))
+#define	MASK2(a,b)		(MASK(a) | MASK(b))
+#define	STATE_SET(b,v)		((v) ? (state |= MASK(b)) : (state &= ~MASK(b)))
+#define	STATE_TEST(b)		(state & MASK(b))
+#define	STATE_SET_TEST(b,v)	((v) ? ((state |= MASK(b)), 1) : \
 				       ((state &= ~MASK(b)), 0))
-#define SWITCH_STATE		(state & MASK2(LEFT_CONTIG, RIGHT_CONTIG))
+#define	SWITCH_STATE		(state & MASK2(LEFT_CONTIG, RIGHT_CONTIG))
 
 	ifp = XFS_IFORK_PTR(ip, whichfork);
 	ASSERT(idx <= ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t));
@@ -2122,7 +2159,7 @@
 	xfs_bmalloca_t	*ap)		/* bmap alloc argument struct */
 {
 	xfs_fsblock_t	adjust;		/* adjustment to block numbers */
-	xfs_alloctype_t atype=0;	/* type for allocation routines */
+	xfs_alloctype_t	atype=0;	/* type for allocation routines */
 	int		error;		/* error return value */
 	xfs_agnumber_t	fb_agno;	/* ag number of ap->firstblock */
 	xfs_mount_t	*mp;		/* mount point structure */
@@ -2133,7 +2170,7 @@
 	xfs_extlen_t	ralen=0;	/* realtime allocation length */
 #endif
 
-#define ISLEGAL(x,y)	\
+#define	ISLEGAL(x,y)	\
 	(rt ? \
 		(x) < mp->m_sb.sb_rblocks : \
 		XFS_FSB_TO_AGNO(mp, x) == XFS_FSB_TO_AGNO(mp, y) && \
@@ -2170,7 +2207,7 @@
 		orig_end = orig_off + orig_alen;
 		/*
 		 * If the file offset is unaligned vs. the extent size
-		 * we need to align it.	 This will be possible unless
+		 * we need to align it.  This will be possible unless
 		 * the file was previously written with a kernel that didn't
 		 * perform this alignment.
 		 */
@@ -2480,7 +2517,7 @@
 	 */
 	else {
 		xfs_agnumber_t	ag;
-		xfs_alloc_arg_t args;
+		xfs_alloc_arg_t	args;
 		xfs_extlen_t	blen;
 		xfs_extlen_t	delta;
 		int		isaligned;
@@ -2768,16 +2805,16 @@
 	xfs_inode_t		*ip,	/* incore inode pointer */
 	xfs_trans_t		*tp,	/* current transaction pointer */
 	xfs_extnum_t		idx,	/* extent number to update/delete */
-	xfs_bmap_free_t		*flist, /* list of extents to be freed */
+	xfs_bmap_free_t		*flist,	/* list of extents to be freed */
 	xfs_btree_cur_t		*cur,	/* if null, not a btree */
 	xfs_bmbt_irec_t		*del,	/* data to remove from extent list */
 	int			*logflagsp, /* inode logging flags */
 	int			whichfork, /* data or attr fork */
 	int			rsvd)	/* OK to allocate reserved blocks */
 {
-	xfs_filblks_t		da_new; /* new delay-alloc indirect blocks */
-	xfs_filblks_t		da_old; /* old delay-alloc indirect blocks */
-	xfs_fsblock_t		del_endblock=0; /* first block past del */
+	xfs_filblks_t		da_new;	/* new delay-alloc indirect blocks */
+	xfs_filblks_t		da_old;	/* old delay-alloc indirect blocks */
+	xfs_fsblock_t		del_endblock=0;	/* first block past del */
 	xfs_fileoff_t		del_endoff;	/* first offset past del */
 	int			delay;	/* current block is delayed allocated */
 	int			do_fx;	/* free extent at end of routine */
@@ -2796,7 +2833,7 @@
 	xfs_bmbt_irec_t		new;	/* new record to be inserted */
 	/* REFERENCED */
 	xfs_extnum_t		nextents;	/* number of extents in list */
-	uint			qfield; /* quota field to update */
+	uint			qfield;	/* quota field to update */
 	xfs_filblks_t		temp;	/* for indirect length calculations */
 	xfs_filblks_t		temp2;	/* for indirect length calculations */
 
@@ -2823,7 +2860,7 @@
 	if (!delay) {
 		flags = XFS_ILOG_CORE;
 		/*
-		 * Realtime allocation.	 Free it and record di_nblocks update.
+		 * Realtime allocation.  Free it and record di_nblocks update.
 		 */
 		if (whichfork == XFS_DATA_FORK &&
 		    (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) {
@@ -3092,7 +3129,7 @@
  */
 STATIC void
 xfs_bmap_del_free(
-	xfs_bmap_free_t		*flist, /* free item list header */
+	xfs_bmap_free_t		*flist,	/* free item list header */
 	xfs_bmap_free_item_t	*prev,	/* previous item on list, if any */
 	xfs_bmap_free_item_t	*free)	/* list item to be freed */
 {
@@ -3273,7 +3310,7 @@
 	xfs_inode_t	*ip,		/* incore inode pointer */
 	xfs_extnum_t	idx,		/* starting index of new items */
 	xfs_extnum_t	count,		/* number of inserted items */
-	xfs_bmbt_irec_t *new,		/* items to insert */
+	xfs_bmbt_irec_t	*new,		/* items to insert */
 	int		whichfork)	/* data or attr fork */
 {
 	xfs_bmbt_rec_t	*base;		/* extent list base */
@@ -3325,7 +3362,7 @@
 	flags = 0;
 	error = 0;
 	if (ifp->if_bytes) {
-		xfs_alloc_arg_t args;	/* allocation arguments */
+		xfs_alloc_arg_t	args;	/* allocation arguments */
 		xfs_buf_t	*bp;	/* buffer for extent list block */
 		xfs_bmbt_rec_t	*ep;	/* extent list pointer */
 
@@ -3388,11 +3425,11 @@
 	xfs_fileoff_t	bno,		/* block number searched for */
 	int		*eofp,		/* out: end of file found */
 	xfs_extnum_t	*lastxp,	/* out: last extent index */
-	xfs_bmbt_irec_t *gotp,		/* out: extent entry found */
-	xfs_bmbt_irec_t *prevp)		/* out: previous extent entry found */
+	xfs_bmbt_irec_t	*gotp,		/* out: extent entry found */
+	xfs_bmbt_irec_t	*prevp)		/* out: previous extent entry found */
 {
 	xfs_bmbt_rec_t	*ep;		/* extent list entry pointer */
-	xfs_bmbt_irec_t got;		/* extent list entry, decoded */
+	xfs_bmbt_irec_t	got;		/* extent list entry, decoded */
 	int		high;		/* high index of binary search */
 	int		low;		/* low index of binary search */
 
@@ -3480,20 +3517,20 @@
  * Else, *lastxp will be set to the index of the found
  * entry; *gotp will contain the entry.
  */
-STATIC xfs_bmbt_rec_t *			/* pointer to found extent entry */
+STATIC xfs_bmbt_rec_t *                 /* pointer to found extent entry */
 xfs_bmap_search_extents(
-	xfs_inode_t	*ip,		/* incore inode pointer */
-	xfs_fileoff_t	bno,		/* block number searched for */
-	int		whichfork,	/* data or attr fork */
-	int		*eofp,		/* out: end of file found */
-	xfs_extnum_t	*lastxp,	/* out: last extent index */
-	xfs_bmbt_irec_t *gotp,		/* out: extent entry found */
-	xfs_bmbt_irec_t *prevp)		/* out: previous extent entry found */
+	xfs_inode_t     *ip,            /* incore inode pointer */
+	xfs_fileoff_t   bno,            /* block number searched for */
+	int             whichfork,      /* data or attr fork */
+	int             *eofp,          /* out: end of file found */
+	xfs_extnum_t    *lastxp,        /* out: last extent index */
+	xfs_bmbt_irec_t *gotp,          /* out: extent entry found */
+	xfs_bmbt_irec_t *prevp)         /* out: previous extent entry found */
 {
 	xfs_ifork_t	*ifp;		/* inode fork pointer */
-	xfs_bmbt_rec_t	*base;		/* base of extent list */
-	xfs_extnum_t	lastx;		/* last extent index used */
-	xfs_extnum_t	nextents;	/* extent list size */
+	xfs_bmbt_rec_t  *base;          /* base of extent list */
+	xfs_extnum_t    lastx;          /* last extent index used */
+	xfs_extnum_t    nextents;       /* extent list size */
 
 	XFS_STATS_INC(xfsstats.xs_look_exlist);
 	ifp = XFS_IFORK_PTR(ip, whichfork);
@@ -3599,8 +3636,8 @@
 	xfs_inode_t	*ip,		/* incore inode pointer */
 	xfs_extnum_t	idx,		/* index of entry(entries) inserted */
 	xfs_extnum_t	cnt,		/* count of entries inserted, 1 or 2 */
-	xfs_bmbt_irec_t *r1,		/* inserted record 1 */
-	xfs_bmbt_irec_t *r2,		/* inserted record 2 or null */
+	xfs_bmbt_irec_t	*r1,		/* inserted record 1 */
+	xfs_bmbt_irec_t	*r2,		/* inserted record 2 or null */
 	int		whichfork)	/* data or attr fork */
 {
 	xfs_bmbt_rec_t	tr1;		/* compressed record 1 */
@@ -3895,7 +3932,7 @@
 
 /*
  * Compute and fill in the value of the maximum depth of a bmap btree
- * in this filesystem.	Done once, during mount.
+ * in this filesystem.  Done once, during mount.
  */
 void
 xfs_bmap_compute_maxlevels(
@@ -3936,7 +3973,7 @@
 /*
  * Routine to be called at transaction's end by xfs_bmapi, xfs_bunmapi
  * caller.  Frees all the extents that need freeing, which must be done
- * last due to locking considerations.	We never free any extents in
+ * last due to locking considerations.  We never free any extents in
  * the first transaction.  This is to allow the caller to make the first
  * transaction a synchronous one so that the pointers to the data being
  * broken in this transaction will be permanent before the data is actually
@@ -4026,7 +4063,7 @@
  */
 void
 xfs_bmap_cancel(
-	xfs_bmap_free_t		*flist) /* list of bmap_free_items */
+	xfs_bmap_free_t		*flist)	/* list of bmap_free_items */
 {
 	xfs_bmap_free_item_t	*free;	/* free list item */
 	xfs_bmap_free_item_t	*next;
@@ -4051,7 +4088,7 @@
 	xfs_bmbt_rec_t	*base;			/* base of extent array */
 	xfs_bmbt_rec_t	*ep;			/* pointer to an extent entry */
 	xfs_fileoff_t	end_fsb;		/* last block of file within size */
-	xfs_bmbt_irec_t ext;			/* extent list entry, decoded */
+	xfs_bmbt_irec_t	ext;			/* extent list entry, decoded */
 	xfs_ifork_t	*ifp;			/* inode fork pointer */
 	xfs_fileoff_t	lastaddr;		/* last block number seen */
 	xfs_extnum_t	nextents;		/* number of extent entries */
@@ -4173,10 +4210,10 @@
 	int		eof;			/* hit end of file */
 	xfs_bmbt_rec_t	*ep;			/* pointer to last extent */
 	int		error;			/* error return value */
-	xfs_bmbt_irec_t got;			/* current extent value */
+	xfs_bmbt_irec_t	got;			/* current extent value */
 	xfs_ifork_t	*ifp;			/* inode fork pointer */
 	xfs_extnum_t	lastx;			/* last extent used */
-	xfs_bmbt_irec_t prev;			/* previous extent value */
+	xfs_bmbt_irec_t	prev;			/* previous extent value */
 
 	if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE &&
 	    XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS &&
@@ -4260,7 +4297,7 @@
 	xfs_bmbt_rec_t	*ep;		/* ptr to fork's extent */
 	xfs_ifork_t	*ifp;		/* inode fork pointer */
 	int		rval;		/* return value */
-	xfs_bmbt_irec_t s;		/* internal version of extent */
+	xfs_bmbt_irec_t	s;		/* internal version of extent */
 
 #ifndef DEBUG
 	if (whichfork == XFS_DATA_FORK)
@@ -4292,7 +4329,7 @@
 	xfs_inode_t		*ip,	/* incore inode */
 	int			whichfork) /* data or attr fork */
 {
-	xfs_bmbt_block_t	*block; /* current btree block */
+	xfs_bmbt_block_t	*block;	/* current btree block */
 	xfs_fsblock_t		bno;	/* block # of "block" */
 	xfs_buf_t		*bp;	/* buffer for "block" */
 	int			error;	/* error return value */
@@ -4442,7 +4479,7 @@
 	xfs_bmbt_rec_t	*ep;		/* current entry in extent list */
 	xfs_extnum_t	idx;		/* extent list entry number */
 	xfs_ifork_t	*ifp;		/* inode fork pointer */
-	xfs_bmbt_irec_t s;		/* extent list record */
+	xfs_bmbt_irec_t	s;		/* extent list record */
 
 	ifp = XFS_IFORK_PTR(ip, whichfork);
 	ASSERT(cnt == ifp->if_bytes / (uint)sizeof(*base));
@@ -4523,23 +4560,23 @@
 	xfs_fsblock_t	*firstblock,	/* first allocated block
 					   controls a.g. for allocs */
 	xfs_extlen_t	total,		/* total blocks needed */
-	xfs_bmbt_irec_t *mval,		/* output: map values */
+	xfs_bmbt_irec_t	*mval,		/* output: map values */
 	int		*nmap,		/* i/o: mval size/count */
-	xfs_bmap_free_t *flist)		/* i/o: list extents to free */
+	xfs_bmap_free_t	*flist)		/* i/o: list extents to free */
 {
 	xfs_fsblock_t	abno;		/* allocated block number */
 	xfs_extlen_t	alen;		/* allocated extent length */
 	xfs_fileoff_t	aoff;		/* allocated file offset */
 	xfs_bmalloca_t	bma;		/* args for xfs_bmap_alloc */
 	char		contig;		/* allocation must be one extent */
-	xfs_btree_cur_t *cur;		/* bmap btree cursor */
+	xfs_btree_cur_t	*cur;		/* bmap btree cursor */
 	char		delay;		/* this request is for delayed alloc */
 	xfs_fileoff_t	end;		/* end of mapped file region */
 	int		eof;		/* we've hit the end of extent list */
 	xfs_bmbt_rec_t	*ep;		/* extent list entry pointer */
 	int		error;		/* error return */
 	char		exact;		/* don't do all of wasdelayed extent */
-	xfs_bmbt_irec_t got;		/* current extent list record */
+	xfs_bmbt_irec_t	got;		/* current extent list record */
 	xfs_ifork_t	*ifp;		/* inode fork pointer */
 	xfs_extlen_t	indlen;		/* indirect blocks length */
 	char		inhole;		/* current location is hole in file */
@@ -4552,7 +4589,7 @@
 	int		nallocs;	/* number of extents alloc\'d */
 	xfs_extnum_t	nextents;	/* number of extents in file */
 	xfs_fileoff_t	obno;		/* old block number (offset) */
-	xfs_bmbt_irec_t prev;		/* previous extent list record */
+	xfs_bmbt_irec_t	prev;		/* previous extent list record */
 	char		stateless;	/* ignore state flag set */
 	int		tmp_logflags;	/* temp flags holder */
 	char		trim;		/* output trimmed to match range */
@@ -4565,7 +4602,7 @@
 	xfs_fileoff_t	orig_bno;	/* original block number value */
 	int		orig_flags;	/* original flags arg value */
 	xfs_filblks_t	orig_len;	/* original value of len arg */
-	xfs_bmbt_irec_t *orig_mval;	/* original value of mval */
+	xfs_bmbt_irec_t	*orig_mval;	/* original value of mval */
 	int		orig_nmap;	/* original value of *nmap */
 
 	orig_bno = bno;
@@ -5064,10 +5101,10 @@
 {
 	int		eof;		/* we've hit the end of extent list */
 	int		error;		/* error return */
-	xfs_bmbt_irec_t got;		/* current extent list record */
+	xfs_bmbt_irec_t	got;		/* current extent list record */
 	xfs_ifork_t	*ifp;		/* inode fork pointer */
 	xfs_extnum_t	lastx;		/* last useful extent number */
-	xfs_bmbt_irec_t prev;		/* previous extent list record */
+	xfs_bmbt_irec_t	prev;		/* previous extent list record */
 
 	ifp = XFS_IFORK_PTR(ip, whichfork);
 	if (unlikely(
@@ -5103,7 +5140,7 @@
 /*
  * Unmap (remove) blocks from a file.
  * If nexts is nonzero then the number of extents to remove is limited to
- * that value.	If not all extents in the block range can be removed then
+ * that value.  If not all extents in the block range can be removed then
  * *done is set.
  */
 int						/* error */
@@ -5529,7 +5566,7 @@
 			    ip->i_d.di_aformat != XFS_DINODE_FMT_LOCAL)
 				return XFS_ERROR(EINVAL);
 		} else if (unlikely(
-		           ip->i_d.di_aformat != 0 &&
+			   ip->i_d.di_aformat != 0 &&
 			   ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS)) {
 			XFS_ERROR_REPORT("xfs_getbmap", XFS_ERRLEVEL_LOW,
 					 ip->i_mount);
@@ -5627,7 +5664,7 @@
 				 */
 				goto unlock_and_return;
 			} else {
-				out.bmv_block = 
+				out.bmv_block =
 				    (map[i].br_startblock == HOLESTARTBLOCK) ?
 					-1 :
 					XFS_FSB_TO_DB(ip, map[i].br_startblock);
@@ -5681,15 +5718,15 @@
 int					/* error */
 xfs_bmap_isaeof(
 	xfs_inode_t	*ip,		/* incore inode pointer */
-	xfs_fileoff_t	off,		/* file offset in fsblocks */
-	int		whichfork,	/* data or attribute fork */
+	xfs_fileoff_t   off,		/* file offset in fsblocks */
+	int             whichfork,	/* data or attribute fork */
 	char		*aeof)		/* return value */
 {
 	int		error;		/* error return value */
 	xfs_ifork_t	*ifp;		/* inode fork pointer */
 	xfs_bmbt_rec_t	*lastrec;	/* extent list entry pointer */
 	xfs_extnum_t	nextents;	/* size of extent list */
-	xfs_bmbt_irec_t s;		/* expanded extent list entry */
+	xfs_bmbt_irec_t	s;		/* expanded extent list entry */
 
 	ASSERT(whichfork == XFS_DATA_FORK);
 	ifp = XFS_IFORK_PTR(ip, whichfork);
@@ -5782,7 +5819,7 @@
 STATIC
 xfs_buf_t *
 xfs_bmap_get_bp(
-	xfs_btree_cur_t		*cur,
+	xfs_btree_cur_t         *cur,
 	xfs_fsblock_t		bno)
 {
 	int i;
@@ -5802,7 +5839,7 @@
 		bp = NULL;
 
 	if (!bp) { /* Chase down all the log items to see if the bp is there */
-		xfs_log_item_chunk_t	*licp;
+		xfs_log_item_chunk_t    *licp;
 		xfs_trans_t		*tp;
 
 		tp = cur->bc_tp;
@@ -5843,7 +5880,7 @@
 
 void
 xfs_check_block(
-	xfs_bmbt_block_t	*block,
+	xfs_bmbt_block_t        *block,
 	xfs_mount_t		*mp,
 	int			root,
 	short			sz)
@@ -5910,7 +5947,7 @@
 	xfs_inode_t		*ip,		/* incore inode pointer */
 	int			whichfork)	/* data or attr fork */
 {
-	xfs_bmbt_block_t	*block; /* current btree block */
+	xfs_bmbt_block_t	*block;	/* current btree block */
 	xfs_fsblock_t		bno;	/* block # of "block" */
 	xfs_buf_t		*bp;	/* buffer for "block" */
 	int			error;	/* error return value */
@@ -6072,7 +6109,7 @@
 	int			whichfork,	/* data or attr fork */
 	int			*count)		/* out: count of blocks */
 {
-	xfs_bmbt_block_t	*block; /* current btree block */
+	xfs_bmbt_block_t	*block;	/* current btree block */
 	xfs_fsblock_t		bno;	/* block # of "block" */
 	xfs_ifork_t		*ifp;	/* fork structure */
 	int			level;	/* btree level, for checking */
@@ -6118,21 +6155,21 @@
  * Recursively walks each level of a btree
  * to count total fsblocks is use.
  */
-int					/* error */
+int                                     /* error */
 xfs_bmap_count_tree(
-	xfs_mount_t	*mp,		/* file system mount point */
-	xfs_trans_t	*tp,		/* transaction pointer */
-	xfs_fsblock_t	blockno,	/* file system block number */
-	int		levelin,	/* level in btree */
+	xfs_mount_t     *mp,            /* file system mount point */
+	xfs_trans_t     *tp,            /* transaction pointer */
+	xfs_fsblock_t   blockno,	/* file system block number */
+	int             levelin,	/* level in btree */
 	int		*count)		/* Count of blocks */
 {
 	int			error;
 	xfs_buf_t		*bp, *nbp;
 	int			level = levelin;
-	xfs_bmbt_ptr_t		*pp;
-	xfs_fsblock_t		bno = blockno;
+	xfs_bmbt_ptr_t          *pp;
+	xfs_fsblock_t           bno = blockno;
 	xfs_fsblock_t		nextbno;
-	xfs_bmbt_block_t	*block, *nextblock;
+	xfs_bmbt_block_t        *block, *nextblock;
 	int			numrecs;
 	xfs_bmbt_rec_t		*frp;
 
@@ -6208,4 +6245,3 @@
 		*count += xfs_bmbt_disk_get_blockcount(frp);
 	return 0;
 }
-
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_bmap.h linux-2.5.68-bk12/fs/xfs/xfs_bmap.h
--- linux-2.5.68-bk11/fs/xfs/xfs_bmap.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_bmap.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_BMAP_H__
-#define __XFS_BMAP_H__
+#define	__XFS_BMAP_H__
 
 struct getbmap;
 struct xfs_bmbt_irec;
@@ -52,19 +52,19 @@
 /*
  * Header for free extent list.
  */
-typedef struct xfs_bmap_free
+typedef	struct xfs_bmap_free
 {
 	xfs_bmap_free_item_t	*xbf_first;	/* list of to-be-free extents */
 	int			xbf_count;	/* count of items on list */
 	int			xbf_low;	/* kludge: alloc in low mode */
 } xfs_bmap_free_t;
 
-#define XFS_BMAP_MAX_NMAP	4
+#define	XFS_BMAP_MAX_NMAP	4
 
 /*
  * Flags for xfs_bmapi
  */
-#define XFS_BMAPI_WRITE		0x001	/* write operation: allocate space */
+#define	XFS_BMAPI_WRITE		0x001	/* write operation: allocate space */
 #define XFS_BMAPI_DELAY		0x002	/* delayed write operation */
 #define XFS_BMAPI_ENTIRE	0x004	/* return entire extent, not trimmed */
 #define XFS_BMAPI_METADATA	0x008	/* mapping metadata not user data */
@@ -72,37 +72,37 @@
 #define XFS_BMAPI_ATTRFORK	0x020	/* use attribute fork not data */
 #define XFS_BMAPI_ASYNC		0x040	/* bunmapi xactions can be async */
 #define XFS_BMAPI_RSVBLOCKS	0x080	/* OK to alloc. reserved data blocks */
-#define XFS_BMAPI_PREALLOC	0x100	/* preallocation op: unwritten space */
-#define XFS_BMAPI_IGSTATE	0x200	/* Ignore state - */
+#define	XFS_BMAPI_PREALLOC	0x100	/* preallocation op: unwritten space */
+#define	XFS_BMAPI_IGSTATE	0x200	/* Ignore state - */
 					/* combine contig. space */
-#define XFS_BMAPI_CONTIG	0x400	/* must allocate only one extent */
+#define	XFS_BMAPI_CONTIG	0x400	/* must allocate only one extent */
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAPI_AFLAG)
 int xfs_bmapi_aflag(int w);
-#define XFS_BMAPI_AFLAG(w)	xfs_bmapi_aflag(w)
+#define	XFS_BMAPI_AFLAG(w)	xfs_bmapi_aflag(w)
 #else
-#define XFS_BMAPI_AFLAG(w)	((w) == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0)
+#define	XFS_BMAPI_AFLAG(w)	((w) == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0)
 #endif
 
 /*
  * Special values for xfs_bmbt_irec_t br_startblock field.
  */
-#define DELAYSTARTBLOCK		((xfs_fsblock_t)-1LL)
-#define HOLESTARTBLOCK		((xfs_fsblock_t)-2LL)
+#define	DELAYSTARTBLOCK		((xfs_fsblock_t)-1LL)
+#define	HOLESTARTBLOCK		((xfs_fsblock_t)-2LL)
 
 /*
  * Trace operations for bmap extent tracing
  */
-#define XFS_BMAP_KTRACE_DELETE	1
-#define XFS_BMAP_KTRACE_INSERT	2
-#define XFS_BMAP_KTRACE_PRE_UP	3
-#define XFS_BMAP_KTRACE_POST_UP 4
+#define	XFS_BMAP_KTRACE_DELETE	1
+#define	XFS_BMAP_KTRACE_INSERT	2
+#define	XFS_BMAP_KTRACE_PRE_UP	3
+#define	XFS_BMAP_KTRACE_POST_UP	4
 
-#define XFS_BMAP_TRACE_SIZE	4096	/* size of global trace buffer */
-#define XFS_BMAP_KTRACE_SIZE	32	/* size of per-inode trace buffer */
+#define	XFS_BMAP_TRACE_SIZE	4096	/* size of global trace buffer */
+#define	XFS_BMAP_KTRACE_SIZE	32	/* size of per-inode trace buffer */
 
 #if defined(XFS_ALL_TRACE)
-#define XFS_BMAP_TRACE
+#define	XFS_BMAP_TRACE
 #endif
 
 #if !defined(DEBUG)
@@ -112,9 +112,9 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAP_INIT)
 void xfs_bmap_init(xfs_bmap_free_t *flp, xfs_fsblock_t *fbp);
-#define XFS_BMAP_INIT(flp,fbp)	xfs_bmap_init(flp,fbp)
+#define	XFS_BMAP_INIT(flp,fbp)	xfs_bmap_init(flp,fbp)
 #else
-#define XFS_BMAP_INIT(flp,fbp)	\
+#define	XFS_BMAP_INIT(flp,fbp)	\
 	((flp)->xbf_first = NULL, (flp)->xbf_count = 0, \
 	 (flp)->xbf_low = 0, *(fbp) = NULLFSBLOCK)
 #endif
@@ -128,17 +128,17 @@
 	xfs_fileoff_t		off;	/* offset in file filling in */
 	struct xfs_trans	*tp;	/* transaction pointer */
 	struct xfs_inode	*ip;	/* incore inode pointer */
-	struct xfs_bmbt_irec	*prevp; /* extent before the new one */
+	struct xfs_bmbt_irec	*prevp;	/* extent before the new one */
 	struct xfs_bmbt_irec	*gotp;	/* extent after, or delayed */
 	xfs_extlen_t		alen;	/* i/o length asked/allocated */
 	xfs_extlen_t		total;	/* total blocks needed for xaction */
-	xfs_extlen_t		minlen; /* mininum allocation size (blocks) */
+	xfs_extlen_t		minlen;	/* mininum allocation size (blocks) */
 	xfs_extlen_t		minleft; /* amount must be left after alloc */
 	char			eof;	/* set if allocating past last extent */
-	char			wasdel; /* replacing a delayed allocation */
+	char			wasdel;	/* replacing a delayed allocation */
 	char			userdata;/* set if is user data */
 	char			low;	/* low on space, using seq'l ags */
-	char			aeof;	/* allocated space at eof */
+	char			aeof;   /* allocated space at eof */
 } xfs_bmalloca_t;
 
 #ifdef __KERNEL__
@@ -179,7 +179,7 @@
 
 /*
  * Compute and fill in the value of the maximum depth of a bmap btree
- * in this filesystem.	Done once, during mount.
+ * in this filesystem.  Done once, during mount.
  */
 void
 xfs_bmap_compute_maxlevels(
@@ -271,7 +271,7 @@
 	xfs_extnum_t		cnt,		/* count of entries in list */
 	int			whichfork);	/* data or attr fork */
 #else
-#define xfs_bmap_trace_exlist(f,ip,c,w)
+#define	xfs_bmap_trace_exlist(f,ip,c,w)
 #endif
 
 /*
@@ -319,7 +319,7 @@
 /*
  * Unmap (remove) blocks from a file.
  * If nexts is nonzero then the number of extents to remove is limited to
- * that value.	If not all extents in the block range can be removed then
+ * that value.  If not all extents in the block range can be removed then
  * *done is set.
  */
 int						/* error */
@@ -364,10 +364,10 @@
  */
 int
 xfs_bmap_eof(
-	struct xfs_inode	*ip,
-	xfs_fileoff_t		endoff,
-	int			whichfork,
-	int			*eof);
+	struct xfs_inode        *ip,
+	xfs_fileoff_t           endoff,
+	int                     whichfork,
+	int                     *eof);
 
 /*
  * Count fsblocks of the given fork.
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_bmap_btree.c linux-2.5.68-bk12/fs/xfs/xfs_bmap_btree.c
--- linux-2.5.68-bk11/fs/xfs/xfs_bmap_btree.c	2003-04-19 19:49:52.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_bmap_btree.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,36 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_itable.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_alloc.h"
+#include "xfs_bit.h"
+#include "xfs_bmap.h"
+#include "xfs_error.h"
+#include "xfs_quota.h"
 
 #ifdef DEBUG
 ktrace_t	*xfs_bmbt_trace_buf;
@@ -59,7 +88,7 @@
 STATIC void
 xfs_bmbt_trace_enter(
 	char		*func,
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	char		*s,
 	int		type,
 	int		line,
@@ -100,7 +129,7 @@
 STATIC void
 xfs_bmbt_trace_argbi(
 	char		*func,
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	xfs_buf_t	*b,
 	int		i,
 	int		line)
@@ -117,7 +146,7 @@
 STATIC void
 xfs_bmbt_trace_argbii(
 	char		*func,
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	xfs_buf_t	*b,
 	int		i0,
 	int		i1,
@@ -155,7 +184,7 @@
 STATIC void
 xfs_bmbt_trace_argi(
 	char		*func,
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	int		i,
 	int		line)
 {
@@ -243,7 +272,7 @@
 STATIC void
 xfs_bmbt_trace_cursor(
 	char		*func,
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	char		*s,
 	int		line)
 {
@@ -260,21 +289,21 @@
 		(cur->bc_ptrs[2] << 16) | cur->bc_ptrs[3]);
 }
 
-#define XFS_BMBT_TRACE_ARGBI(c,b,i)	\
+#define	XFS_BMBT_TRACE_ARGBI(c,b,i)	\
 	xfs_bmbt_trace_argbi(fname, c, b, i, __LINE__)
-#define XFS_BMBT_TRACE_ARGBII(c,b,i,j)	\
+#define	XFS_BMBT_TRACE_ARGBII(c,b,i,j)	\
 	xfs_bmbt_trace_argbii(fname, c, b, i, j, __LINE__)
-#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j)	\
+#define	XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j)	\
 	xfs_bmbt_trace_argfffi(fname, c, o, b, i, j, __LINE__)
-#define XFS_BMBT_TRACE_ARGI(c,i)	\
+#define	XFS_BMBT_TRACE_ARGI(c,i)	\
 	xfs_bmbt_trace_argi(fname, c, i, __LINE__)
-#define XFS_BMBT_TRACE_ARGIFK(c,i,f,k)	\
+#define	XFS_BMBT_TRACE_ARGIFK(c,i,f,k)	\
 	xfs_bmbt_trace_argifk(fname, c, i, f, k, __LINE__)
-#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r)	\
+#define	XFS_BMBT_TRACE_ARGIFR(c,i,f,r)	\
 	xfs_bmbt_trace_argifr(fname, c, i, f, r, __LINE__)
-#define XFS_BMBT_TRACE_ARGIK(c,i,k)	\
+#define	XFS_BMBT_TRACE_ARGIK(c,i,k)	\
 	xfs_bmbt_trace_argik(fname, c, i, k, __LINE__)
-#define XFS_BMBT_TRACE_CURSOR(c,s)	\
+#define	XFS_BMBT_TRACE_CURSOR(c,s)	\
 	xfs_bmbt_trace_cursor(fname, c, s, __LINE__)
 static char	ARGS[] = "args";
 static char	ENTRY[] = "entry";
@@ -282,14 +311,14 @@
 #undef EXIT
 static char	EXIT[] = "exit";
 #else
-#define XFS_BMBT_TRACE_ARGBI(c,b,i)
-#define XFS_BMBT_TRACE_ARGBII(c,b,i,j)
-#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j)
-#define XFS_BMBT_TRACE_ARGI(c,i)
-#define XFS_BMBT_TRACE_ARGIFK(c,i,f,k)
-#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r)
-#define XFS_BMBT_TRACE_ARGIK(c,i,k)
-#define XFS_BMBT_TRACE_CURSOR(c,s)
+#define	XFS_BMBT_TRACE_ARGBI(c,b,i)
+#define	XFS_BMBT_TRACE_ARGBII(c,b,i,j)
+#define	XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j)
+#define	XFS_BMBT_TRACE_ARGI(c,i)
+#define	XFS_BMBT_TRACE_ARGIFK(c,i,f,k)
+#define	XFS_BMBT_TRACE_ARGIFR(c,i,f,r)
+#define	XFS_BMBT_TRACE_ARGIK(c,i,k)
+#define	XFS_BMBT_TRACE_CURSOR(c,s)
 #endif	/* XFS_BMBT_TRACE */
 
 
@@ -1002,7 +1031,7 @@
  */
 STATIC void
 xfs_bmbt_log_keys(
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	xfs_buf_t	*bp,
 	int		kfirst,
 	int		klast)
@@ -1041,7 +1070,7 @@
  */
 STATIC void
 xfs_bmbt_log_ptrs(
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	xfs_buf_t	*bp,
 	int		pfirst,
 	int		plast)
@@ -1818,7 +1847,7 @@
  */
 int					/* error */
 xfs_bmbt_delete(
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	int		*stat)		/* success/failure */
 {
 	int		error;		/* error return value */
@@ -2048,7 +2077,7 @@
 
 xfs_exntst_t
 xfs_bmbt_disk_get_state(
-	xfs_bmbt_rec_t	*r)
+	xfs_bmbt_rec_t  *r)
 {
 	int	ext_flag;
 
@@ -2148,7 +2177,7 @@
  */
 int					/* error */
 xfs_bmbt_insert(
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	int		*stat)		/* success/failure */
 {
 	int		error;		/* error return value */
@@ -2158,9 +2187,9 @@
 	int		i;
 	int		level;
 	xfs_fsblock_t	nbno;
-	xfs_btree_cur_t *ncur;
+	xfs_btree_cur_t	*ncur;
 	xfs_bmbt_rec_t	nrec;
-	xfs_btree_cur_t *pcur;
+	xfs_btree_cur_t	*pcur;
 
 	XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
 	level = 0;
@@ -2274,7 +2303,7 @@
 
 int					/* error */
 xfs_bmbt_lookup_eq(
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	xfs_fileoff_t	off,
 	xfs_fsblock_t	bno,
 	xfs_filblks_t	len,
@@ -2288,7 +2317,7 @@
 
 int					/* error */
 xfs_bmbt_lookup_ge(
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	xfs_fileoff_t	off,
 	xfs_fsblock_t	bno,
 	xfs_filblks_t	len,
@@ -2302,7 +2331,7 @@
 
 int					/* error */
 xfs_bmbt_lookup_le(
-	xfs_btree_cur_t *cur,
+	xfs_btree_cur_t	*cur,
 	xfs_fileoff_t	off,
 	xfs_fsblock_t	bno,
 	xfs_filblks_t	len,
@@ -2434,7 +2463,7 @@
 void
 xfs_bmbt_set_all(
 	xfs_bmbt_rec_t	*r,
-	xfs_bmbt_irec_t *s)
+	xfs_bmbt_irec_t	*s)
 {
 	int	extent_flag;
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_btree.c linux-2.5.68-bk12/fs/xfs/xfs_btree.c
--- linux-2.5.68-bk11/fs/xfs/xfs_btree.c	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_btree.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -34,7 +34,31 @@
  * This file contains common code for the space manager's btree implementations.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bit.h"
+#include "xfs_error.h"
 
 /*
  * Cursor allocation zone.
@@ -71,7 +95,7 @@
 STATIC int				/* number of records fitting in block */
 xfs_btree_maxrecs(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	xfs_btree_block_t	*block) /* generic btree block pointer */
+	xfs_btree_block_t	*block)	/* generic btree block pointer */
 {
 	switch (cur->bc_btnum) {
 	case XFS_BTNUM_BNO:
@@ -98,7 +122,7 @@
 void
 xfs_btree_check_block(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	xfs_btree_block_t	*block, /* generic btree block pointer */
+	xfs_btree_block_t	*block,	/* generic btree block pointer */
 	int			level,	/* level of the btree block */
 	xfs_buf_t		*bp)	/* buffer containing block, if any */
 {
@@ -121,8 +145,8 @@
 {
 	switch (btnum) {
 	case XFS_BTNUM_BNO: {
-		xfs_alloc_key_t *k1;
-		xfs_alloc_key_t *k2;
+		xfs_alloc_key_t	*k1;
+		xfs_alloc_key_t	*k2;
 
 		k1 = ak1;
 		k2 = ak2;
@@ -130,8 +154,8 @@
 		break;
 	    }
 	case XFS_BTNUM_CNT: {
-		xfs_alloc_key_t *k1;
-		xfs_alloc_key_t *k2;
+		xfs_alloc_key_t	*k1;
+		xfs_alloc_key_t	*k2;
 
 		k1 = ak1;
 		k2 = ak2;
@@ -150,8 +174,8 @@
 		break;
 	    }
 	case XFS_BTNUM_INO: {
-		xfs_inobt_key_t *k1;
-		xfs_inobt_key_t *k2;
+		xfs_inobt_key_t	*k1;
+		xfs_inobt_key_t	*k2;
 
 		k1 = ak1;
 		k2 = ak2;
@@ -171,7 +195,7 @@
 int					/* error (0 or EFSCORRUPTED) */
 xfs_btree_check_lblock(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	xfs_btree_lblock_t	*block, /* btree long form block pointer */
+	xfs_btree_lblock_t	*block,	/* btree long form block pointer */
 	int			level,	/* level of the btree block */
 	xfs_buf_t		*bp)	/* buffer for block, if any */
 {
@@ -206,7 +230,7 @@
  */
 int					/* error (0 or EFSCORRUPTED) */
 xfs_btree_check_lptr(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	xfs_dfsbno_t	ptr,		/* btree block disk address */
 	int		level)		/* btree block level */
 {
@@ -232,8 +256,8 @@
 {
 	switch (btnum) {
 	case XFS_BTNUM_BNO: {
-		xfs_alloc_rec_t *r1;
-		xfs_alloc_rec_t *r2;
+		xfs_alloc_rec_t	*r1;
+		xfs_alloc_rec_t	*r2;
 
 		r1 = ar1;
 		r2 = ar2;
@@ -242,8 +266,8 @@
 		break;
 	    }
 	case XFS_BTNUM_CNT: {
-		xfs_alloc_rec_t *r1;
-		xfs_alloc_rec_t *r2;
+		xfs_alloc_rec_t	*r1;
+		xfs_alloc_rec_t	*r2;
 
 		r1 = ar1;
 		r2 = ar2;
@@ -264,8 +288,8 @@
 		break;
 	    }
 	case XFS_BTNUM_INO: {
-		xfs_inobt_rec_t *r1;
-		xfs_inobt_rec_t *r2;
+		xfs_inobt_rec_t	*r1;
+		xfs_inobt_rec_t	*r2;
 
 		r1 = ar1;
 		r2 = ar2;
@@ -286,13 +310,13 @@
 int					/* error (0 or EFSCORRUPTED) */
 xfs_btree_check_sblock(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	xfs_btree_sblock_t	*block, /* btree short form block pointer */
+	xfs_btree_sblock_t	*block,	/* btree short form block pointer */
 	int			level,	/* level of the btree block */
 	xfs_buf_t		*bp)	/* buffer containing block */
 {
 	xfs_buf_t		*agbp;	/* buffer for ag. freespace struct */
 	xfs_agf_t		*agf;	/* ag. freespace structure */
-	xfs_agblock_t		agflen; /* native ag. freespace length */
+	xfs_agblock_t		agflen;	/* native ag. freespace length */
 	int			sblock_ok; /* block passes checks */
 
 	agbp = cur->bc_private.a.agbp;
@@ -326,7 +350,7 @@
  */
 int					/* error (0 or EFSCORRUPTED) */
 xfs_btree_check_sptr(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	xfs_agblock_t	ptr,		/* btree block disk address */
 	int		level)		/* btree block level */
 {
@@ -347,7 +371,7 @@
  */
 void
 xfs_btree_del_cursor(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	int		error)		/* del because of error */
 {
 	int		i;		/* btree level */
@@ -386,14 +410,14 @@
  */
 int					/* error */
 xfs_btree_dup_cursor(
-	xfs_btree_cur_t *cur,		/* input cursor */
-	xfs_btree_cur_t **ncur)		/* output cursor */
+	xfs_btree_cur_t	*cur,		/* input cursor */
+	xfs_btree_cur_t	**ncur)		/* output cursor */
 {
 	xfs_buf_t	*bp;		/* btree block's buffer pointer */
 	int		error;		/* error return value */
 	int		i;		/* level number of btree block */
 	xfs_mount_t	*mp;		/* mount structure for filesystem */
-	xfs_btree_cur_t *new;		/* new cursor value */
+	xfs_btree_cur_t	*new;		/* new cursor value */
 	xfs_trans_t	*tp;		/* transaction pointer, can be NULL */
 
 	tp = cur->bc_tp;
@@ -449,7 +473,7 @@
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	int			level)	/* level to change */
 {
-	xfs_btree_block_t	*block; /* generic btree block pointer */
+	xfs_btree_block_t	*block;	/* generic btree block pointer */
 	xfs_buf_t		*bp;	/* buffer containing block */
 
 	/*
@@ -479,7 +503,7 @@
 	int			level,	/* level in btree */
 	xfs_buf_t		**bpp)	/* buffer containing the block */
 {
-	xfs_btree_block_t	*block; /* return value */
+	xfs_btree_block_t	*block;	/* return value */
 	xfs_buf_t		*bp;	/* return buffer */
 	xfs_ifork_t		*ifp;	/* inode fork pointer */
 	int			whichfork; /* data or attr fork */
@@ -561,7 +585,7 @@
 {
 	xfs_agf_t	*agf;		/* (A) allocation group freespace */
 	xfs_agi_t	*agi;		/* (I) allocation group inodespace */
-	xfs_btree_cur_t *cur;		/* return value */
+	xfs_btree_cur_t	*cur;		/* return value */
 	xfs_ifork_t	*ifp;		/* (I) inode fork pointer */
 	int		nlevels=0;	/* number of levels in the btree */
 
@@ -643,7 +667,7 @@
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	int			level)	/* level to check */
 {
-	xfs_btree_block_t	*block; /* generic btree block pointer */
+	xfs_btree_block_t	*block;	/* generic btree block pointer */
 	xfs_buf_t		*bp;	/* buffer containing block */
 
 	block = xfs_btree_get_block(cur, level, &bp);
@@ -656,14 +680,14 @@
 
 /*
  * Change the cursor to point to the last record in the current block
- * at the given level.	Other levels are unaffected.
+ * at the given level.  Other levels are unaffected.
  */
 int					/* success=1, failure=0 */
 xfs_btree_lastrec(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	int			level)	/* level to change */
 {
-	xfs_btree_block_t	*block; /* generic btree block pointer */
+	xfs_btree_block_t	*block;	/* generic btree block pointer */
 	xfs_buf_t		*bp;	/* buffer containing block */
 
 	/*
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_btree.h linux-2.5.68-bk12/fs/xfs/xfs_btree.h
--- linux-2.5.68-bk11/fs/xfs/xfs_btree.h	2003-04-19 19:48:53.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_btree.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_BTREE_H__
-#define __XFS_BTREE_H__
+#define	__XFS_BTREE_H__
 
 struct xfs_buf;
 struct xfs_bmap_free;
@@ -41,14 +41,14 @@
 /*
  * This nonsense is to make -wlint happy.
  */
-#define XFS_LOOKUP_EQ	((xfs_lookup_t)XFS_LOOKUP_EQi)
-#define XFS_LOOKUP_LE	((xfs_lookup_t)XFS_LOOKUP_LEi)
-#define XFS_LOOKUP_GE	((xfs_lookup_t)XFS_LOOKUP_GEi)
-
-#define XFS_BTNUM_BNO	((xfs_btnum_t)XFS_BTNUM_BNOi)
-#define XFS_BTNUM_CNT	((xfs_btnum_t)XFS_BTNUM_CNTi)
-#define XFS_BTNUM_BMAP	((xfs_btnum_t)XFS_BTNUM_BMAPi)
-#define XFS_BTNUM_INO	((xfs_btnum_t)XFS_BTNUM_INOi)
+#define	XFS_LOOKUP_EQ	((xfs_lookup_t)XFS_LOOKUP_EQi)
+#define	XFS_LOOKUP_LE	((xfs_lookup_t)XFS_LOOKUP_LEi)
+#define	XFS_LOOKUP_GE	((xfs_lookup_t)XFS_LOOKUP_GEi)
+
+#define	XFS_BTNUM_BNO	((xfs_btnum_t)XFS_BTNUM_BNOi)
+#define	XFS_BTNUM_CNT	((xfs_btnum_t)XFS_BTNUM_CNTi)
+#define	XFS_BTNUM_BMAP	((xfs_btnum_t)XFS_BTNUM_BMAPi)
+#define	XFS_BTNUM_INO	((xfs_btnum_t)XFS_BTNUM_INOi)
 
 /*
  * Short form header: space allocation btrees.
@@ -86,7 +86,7 @@
 
 typedef struct xfs_btree_block
 {
-	xfs_btree_hdr_t bb_h;		/* header */
+	xfs_btree_hdr_t	bb_h;		/* header */
 	union		{
 		struct	{
 			xfs_agblock_t	bb_leftsib;
@@ -102,28 +102,28 @@
 /*
  * For logging record fields.
  */
-#define XFS_BB_MAGIC		0x01
-#define XFS_BB_LEVEL		0x02
-#define XFS_BB_NUMRECS		0x04
-#define XFS_BB_LEFTSIB		0x08
-#define XFS_BB_RIGHTSIB		0x10
-#define XFS_BB_NUM_BITS		5
-#define XFS_BB_ALL_BITS		((1 << XFS_BB_NUM_BITS) - 1)
+#define	XFS_BB_MAGIC		0x01
+#define	XFS_BB_LEVEL		0x02
+#define	XFS_BB_NUMRECS		0x04
+#define	XFS_BB_LEFTSIB		0x08
+#define	XFS_BB_RIGHTSIB		0x10
+#define	XFS_BB_NUM_BITS		5
+#define	XFS_BB_ALL_BITS		((1 << XFS_BB_NUM_BITS) - 1)
 
 /*
  * Boolean to select which form of xfs_btree_block_t.bb_u to use.
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BTREE_LONG_PTRS)
 int xfs_btree_long_ptrs(xfs_btnum_t btnum);
-#define XFS_BTREE_LONG_PTRS(btnum)	((btnum) == XFS_BTNUM_BMAP)
+#define	XFS_BTREE_LONG_PTRS(btnum)	((btnum) == XFS_BTNUM_BMAP)
 #else
-#define XFS_BTREE_LONG_PTRS(btnum)	((btnum) == XFS_BTNUM_BMAP)
+#define	XFS_BTREE_LONG_PTRS(btnum)	((btnum) == XFS_BTNUM_BMAP)
 #endif
 
 /*
  * Magic numbers for btree blocks.
  */
-extern const __uint32_t xfs_magics[];
+extern const __uint32_t	xfs_magics[];
 
 /*
  * Maximum and minimum records in a btree block.
@@ -131,12 +131,12 @@
  * The divisor below is equivalent to lf ? (e1) : (e2) but that produces
  * compiler warnings.
  */
-#define XFS_BTREE_BLOCK_MAXRECS(bsz,t,lf)	\
+#define	XFS_BTREE_BLOCK_MAXRECS(bsz,t,lf)	\
 	((int)(((bsz) - (uint)sizeof(t ## _block_t)) / \
 	 (((lf) * (uint)sizeof(t ## _rec_t)) + \
 	  ((1 - (lf)) * \
 	   ((uint)sizeof(t ## _key_t) + (uint)sizeof(t ## _ptr_t))))))
-#define XFS_BTREE_BLOCK_MINRECS(bsz,t,lf)	\
+#define	XFS_BTREE_BLOCK_MINRECS(bsz,t,lf)	\
 	(XFS_BTREE_BLOCK_MAXRECS(bsz,t,lf) / 2)
 
 /*
@@ -144,17 +144,17 @@
  * Given block size, type prefix, block pointer, and index of requested entry
  * (first entry numbered 1).
  */
-#define XFS_BTREE_REC_ADDR(bsz,t,bb,i,mxr)	\
+#define	XFS_BTREE_REC_ADDR(bsz,t,bb,i,mxr)	\
 	((t ## _rec_t *)((char *)(bb) + sizeof(t ## _block_t) + \
 	 ((i) - 1) * sizeof(t ## _rec_t)))
-#define XFS_BTREE_KEY_ADDR(bsz,t,bb,i,mxr)	\
+#define	XFS_BTREE_KEY_ADDR(bsz,t,bb,i,mxr)	\
 	((t ## _key_t *)((char *)(bb) + sizeof(t ## _block_t) + \
 	 ((i) - 1) * sizeof(t ## _key_t)))
-#define XFS_BTREE_PTR_ADDR(bsz,t,bb,i,mxr)	\
+#define	XFS_BTREE_PTR_ADDR(bsz,t,bb,i,mxr)	\
 	((t ## _ptr_t *)((char *)(bb) + sizeof(t ## _block_t) + \
 	 (mxr) * sizeof(t ## _key_t) + ((i) - 1) * sizeof(t ## _ptr_t)))
 
-#define XFS_BTREE_MAXLEVELS	8	/* max of all btrees */
+#define	XFS_BTREE_MAXLEVELS	8	/* max of all btrees */
 
 /*
  * Btree cursor structure.
@@ -162,8 +162,8 @@
  */
 typedef struct xfs_btree_cur
 {
-	struct xfs_trans	*bc_tp; /* transaction we're in, if any */
-	struct xfs_mount	*bc_mp; /* file system mount struct */
+	struct xfs_trans	*bc_tp;	/* transaction we're in, if any */
+	struct xfs_mount	*bc_mp;	/* file system mount struct */
 	union {
 		xfs_alloc_rec_t		a;
 		xfs_bmbt_irec_t		b;
@@ -172,8 +172,8 @@
 	struct xfs_buf	*bc_bufs[XFS_BTREE_MAXLEVELS];	/* buf ptr per level */
 	int		bc_ptrs[XFS_BTREE_MAXLEVELS];	/* key/record # */
 	__uint8_t	bc_ra[XFS_BTREE_MAXLEVELS];	/* readahead bits */
-#define XFS_BTCUR_LEFTRA	1	/* left sibling has been read-ahead */
-#define XFS_BTCUR_RIGHTRA	2	/* right sibling has been read-ahead */
+#define	XFS_BTCUR_LEFTRA	1	/* left sibling has been read-ahead */
+#define	XFS_BTCUR_RIGHTRA	2	/* right sibling has been read-ahead */
 	__uint8_t	bc_nlevels;	/* number of levels in the tree */
 	__uint8_t	bc_blocklog;	/* log2(blocksize) of btree blocks */
 	xfs_btnum_t	bc_btnum;	/* identifies which btree type */
@@ -190,7 +190,7 @@
 			short		forksize;	/* fork's inode space */
 			char		whichfork;	/* data or attr fork */
 			char		flags;		/* flags */
-#define XFS_BTCUR_BPRV_WASDEL	1			/* was delayed */
+#define	XFS_BTCUR_BPRV_WASDEL	1			/* was delayed */
 		} b;
 		struct {			/* needed for INO */
 			struct xfs_buf	*agbp;	/* agi buffer pointer */
@@ -199,29 +199,29 @@
 	}		bc_private;	/* per-btree type data */
 } xfs_btree_cur_t;
 
-#define XFS_BTREE_NOERROR	0
-#define XFS_BTREE_ERROR		1
+#define	XFS_BTREE_NOERROR	0
+#define	XFS_BTREE_ERROR		1
 
 /*
  * Convert from buffer to btree block header.
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_BLOCK)
 xfs_btree_block_t *xfs_buf_to_block(struct xfs_buf *bp);
-#define XFS_BUF_TO_BLOCK(bp)	xfs_buf_to_block(bp)
+#define	XFS_BUF_TO_BLOCK(bp)	xfs_buf_to_block(bp)
 #else
-#define XFS_BUF_TO_BLOCK(bp)	((xfs_btree_block_t *)(XFS_BUF_PTR(bp)))
+#define	XFS_BUF_TO_BLOCK(bp)	((xfs_btree_block_t *)(XFS_BUF_PTR(bp)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_LBLOCK)
 xfs_btree_lblock_t *xfs_buf_to_lblock(struct xfs_buf *bp);
-#define XFS_BUF_TO_LBLOCK(bp)	xfs_buf_to_lblock(bp)
+#define	XFS_BUF_TO_LBLOCK(bp)	xfs_buf_to_lblock(bp)
 #else
-#define XFS_BUF_TO_LBLOCK(bp)	((xfs_btree_lblock_t *)(XFS_BUF_PTR(bp)))
+#define	XFS_BUF_TO_LBLOCK(bp)	((xfs_btree_lblock_t *)(XFS_BUF_PTR(bp)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_SBLOCK)
 xfs_btree_sblock_t *xfs_buf_to_sblock(struct xfs_buf *bp);
-#define XFS_BUF_TO_SBLOCK(bp)	xfs_buf_to_sblock(bp)
+#define	XFS_BUF_TO_SBLOCK(bp)	xfs_buf_to_sblock(bp)
 #else
-#define XFS_BUF_TO_SBLOCK(bp)	((xfs_btree_sblock_t *)(XFS_BUF_PTR(bp)))
+#define	XFS_BUF_TO_SBLOCK(bp)	((xfs_btree_sblock_t *)(XFS_BUF_PTR(bp)))
 #endif
 
 #ifdef __KERNEL__
@@ -233,7 +233,7 @@
 void
 xfs_btree_check_block(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	xfs_btree_block_t	*block, /* generic btree block pointer */
+	xfs_btree_block_t	*block,	/* generic btree block pointer */
 	int			level,	/* level of the btree block */
 	struct xfs_buf		*bp);	/* buffer containing block, if any */
 
@@ -255,9 +255,9 @@
 	void			*ar1,	/* pointer to left (lower) record */
 	void			*ar2);	/* pointer to right (higher) record */
 #else
-#define xfs_btree_check_block(a,b,c,d)
-#define xfs_btree_check_key(a,b,c)
-#define xfs_btree_check_rec(a,b,c)
+#define	xfs_btree_check_block(a,b,c,d)
+#define	xfs_btree_check_key(a,b,c)
+#define	xfs_btree_check_rec(a,b,c)
 #endif	/* DEBUG */
 
 /*
@@ -266,7 +266,7 @@
 int					/* error (0 or EFSCORRUPTED) */
 xfs_btree_check_lblock(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	xfs_btree_lblock_t	*block, /* btree long form block pointer */
+	xfs_btree_lblock_t	*block,	/* btree long form block pointer */
 	int			level,	/* level of the btree block */
 	struct xfs_buf		*bp);	/* buffer containing block, if any */
 
@@ -277,7 +277,7 @@
 xfs_btree_check_lptr(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	xfs_dfsbno_t		ptr,	/* btree block disk address */
-	int			level); /* btree block level */
+	int			level);	/* btree block level */
 
 /*
  * Checking routine: check that short form block header is ok.
@@ -285,7 +285,7 @@
 int					/* error (0 or EFSCORRUPTED) */
 xfs_btree_check_sblock(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	xfs_btree_sblock_t	*block, /* btree short form block pointer */
+	xfs_btree_sblock_t	*block,	/* btree short form block pointer */
 	int			level,	/* level of the btree block */
 	struct xfs_buf		*bp);	/* buffer containing block */
 
@@ -296,7 +296,7 @@
 xfs_btree_check_sptr(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	xfs_agblock_t		ptr,	/* btree block disk address */
-	int			level); /* btree block level */
+	int			level);	/* btree block level */
 
 /*
  * Delete the btree cursor.
@@ -304,7 +304,7 @@
 void
 xfs_btree_del_cursor(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	int			error); /* del because of error */
+	int			error);	/* del because of error */
 
 /*
  * Duplicate the btree cursor.
@@ -317,12 +317,12 @@
 
 /*
  * Change the cursor to point to the first record in the current block
- * at the given level.	Other levels are unaffected.
+ * at the given level.  Other levels are unaffected.
  */
 int					/* success=1, failure=0 */
 xfs_btree_firstrec(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	int			level); /* level to change */
+	int			level);	/* level to change */
 
 /*
  * Retrieve the block pointer from the cursor at the given level.
@@ -332,7 +332,7 @@
 xfs_btree_get_block(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	int			level,	/* level in btree */
-	struct xfs_buf		**bpp); /* buffer containing the block */
+	struct xfs_buf		**bpp);	/* buffer containing the block */
 
 /*
  * Get a buffer for the block, return it with no data read.
@@ -377,16 +377,16 @@
 int					/* 1=is last block, 0=not last block */
 xfs_btree_islastblock(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	int			level); /* level to check */
+	int			level);	/* level to check */
 
 /*
  * Change the cursor to point to the last record in the current block
- * at the given level.	Other levels are unaffected.
+ * at the given level.  Other levels are unaffected.
  */
 int					/* success=1, failure=0 */
 xfs_btree_lastrec(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
-	int			level); /* level to change */
+	int			level);	/* level to change */
 
 /*
  * Compute first and last byte offsets for the fields given.
@@ -394,11 +394,11 @@
  */
 void
 xfs_btree_offsets(
-	__int64_t		fields, /* bitmask of fields */
+	__int64_t		fields,	/* bitmask of fields */
 	const short		*offsets,/* table of field offsets */
 	int			nbits,	/* number of bits to inspect */
-	int			*first, /* output: first byte offset */
-	int			*last); /* output: last byte offset */
+	int			*first,	/* output: first byte offset */
+	int			*last);	/* output: last byte offset */
 
 /*
  * Get a buffer for the block, return it read in.
@@ -435,7 +435,7 @@
 xfs_btree_reada_bufl(
 	struct xfs_mount	*mp,	/* file system mount point */
 	xfs_fsblock_t		fsbno,	/* file system block number */
-	xfs_extlen_t		count); /* count of filesystem blocks */
+	xfs_extlen_t		count);	/* count of filesystem blocks */
 
 /*
  * Read-ahead the block, don't wait for it, don't return a buffer.
@@ -446,7 +446,7 @@
 	struct xfs_mount	*mp,	/* file system mount point */
 	xfs_agnumber_t		agno,	/* allocation group number */
 	xfs_agblock_t		agbno,	/* allocation group block number */
-	xfs_extlen_t		count); /* count of filesystem blocks */
+	xfs_extlen_t		count);	/* count of filesystem blocks */
 
 /*
  * Read-ahead btree blocks, at the given level.
@@ -489,76 +489,76 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_EXTLEN_MIN)
 xfs_extlen_t xfs_extlen_min(xfs_extlen_t a, xfs_extlen_t b);
-#define XFS_EXTLEN_MIN(a,b)	xfs_extlen_min(a,b)
+#define	XFS_EXTLEN_MIN(a,b)	xfs_extlen_min(a,b)
 #else
-#define XFS_EXTLEN_MIN(a,b)	\
+#define	XFS_EXTLEN_MIN(a,b)	\
 	((xfs_extlen_t)(a) < (xfs_extlen_t)(b) ? \
 	 (xfs_extlen_t)(a) : (xfs_extlen_t)(b))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_EXTLEN_MAX)
 xfs_extlen_t xfs_extlen_max(xfs_extlen_t a, xfs_extlen_t b);
-#define XFS_EXTLEN_MAX(a,b)	xfs_extlen_max(a,b)
+#define	XFS_EXTLEN_MAX(a,b)	xfs_extlen_max(a,b)
 #else
-#define XFS_EXTLEN_MAX(a,b)	\
+#define	XFS_EXTLEN_MAX(a,b)	\
 	((xfs_extlen_t)(a) > (xfs_extlen_t)(b) ? \
 	 (xfs_extlen_t)(a) : (xfs_extlen_t)(b))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGBLOCK_MIN)
 xfs_agblock_t xfs_agblock_min(xfs_agblock_t a, xfs_agblock_t b);
-#define XFS_AGBLOCK_MIN(a,b)	xfs_agblock_min(a,b)
+#define	XFS_AGBLOCK_MIN(a,b)	xfs_agblock_min(a,b)
 #else
-#define XFS_AGBLOCK_MIN(a,b)	\
+#define	XFS_AGBLOCK_MIN(a,b)	\
 	((xfs_agblock_t)(a) < (xfs_agblock_t)(b) ? \
 	 (xfs_agblock_t)(a) : (xfs_agblock_t)(b))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGBLOCK_MAX)
 xfs_agblock_t xfs_agblock_max(xfs_agblock_t a, xfs_agblock_t b);
-#define XFS_AGBLOCK_MAX(a,b)	xfs_agblock_max(a,b)
+#define	XFS_AGBLOCK_MAX(a,b)	xfs_agblock_max(a,b)
 #else
-#define XFS_AGBLOCK_MAX(a,b)	\
+#define	XFS_AGBLOCK_MAX(a,b)	\
 	((xfs_agblock_t)(a) > (xfs_agblock_t)(b) ? \
 	 (xfs_agblock_t)(a) : (xfs_agblock_t)(b))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILEOFF_MIN)
 xfs_fileoff_t xfs_fileoff_min(xfs_fileoff_t a, xfs_fileoff_t b);
-#define XFS_FILEOFF_MIN(a,b)	xfs_fileoff_min(a,b)
+#define	XFS_FILEOFF_MIN(a,b)	xfs_fileoff_min(a,b)
 #else
-#define XFS_FILEOFF_MIN(a,b)	\
+#define	XFS_FILEOFF_MIN(a,b)	\
 	((xfs_fileoff_t)(a) < (xfs_fileoff_t)(b) ? \
 	 (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILEOFF_MAX)
 xfs_fileoff_t xfs_fileoff_max(xfs_fileoff_t a, xfs_fileoff_t b);
-#define XFS_FILEOFF_MAX(a,b)	xfs_fileoff_max(a,b)
+#define	XFS_FILEOFF_MAX(a,b)	xfs_fileoff_max(a,b)
 #else
-#define XFS_FILEOFF_MAX(a,b)	\
+#define	XFS_FILEOFF_MAX(a,b)	\
 	((xfs_fileoff_t)(a) > (xfs_fileoff_t)(b) ? \
 	 (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILBLKS_MIN)
 xfs_filblks_t xfs_filblks_min(xfs_filblks_t a, xfs_filblks_t b);
-#define XFS_FILBLKS_MIN(a,b)	xfs_filblks_min(a,b)
+#define	XFS_FILBLKS_MIN(a,b)	xfs_filblks_min(a,b)
 #else
-#define XFS_FILBLKS_MIN(a,b)	\
+#define	XFS_FILBLKS_MIN(a,b)	\
 	((xfs_filblks_t)(a) < (xfs_filblks_t)(b) ? \
 	 (xfs_filblks_t)(a) : (xfs_filblks_t)(b))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILBLKS_MAX)
 xfs_filblks_t xfs_filblks_max(xfs_filblks_t a, xfs_filblks_t b);
-#define XFS_FILBLKS_MAX(a,b)	xfs_filblks_max(a,b)
+#define	XFS_FILBLKS_MAX(a,b)	xfs_filblks_max(a,b)
 #else
-#define XFS_FILBLKS_MAX(a,b)	\
+#define	XFS_FILBLKS_MAX(a,b)	\
 	((xfs_filblks_t)(a) > (xfs_filblks_t)(b) ? \
 	 (xfs_filblks_t)(a) : (xfs_filblks_t)(b))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_SANITY_CHECK)
 int xfs_fsb_sanity_check(struct xfs_mount *mp, xfs_fsblock_t fsb);
-#define XFS_FSB_SANITY_CHECK(mp,fsb)	xfs_fsb_sanity_check(mp,fsb)
+#define	XFS_FSB_SANITY_CHECK(mp,fsb)	xfs_fsb_sanity_check(mp,fsb)
 #else
-#define XFS_FSB_SANITY_CHECK(mp,fsb)	\
+#define	XFS_FSB_SANITY_CHECK(mp,fsb)	\
 	(XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \
 	 XFS_FSB_TO_AGBNO(mp, fsb) < mp->m_sb.sb_agblocks)
 #endif
@@ -566,7 +566,7 @@
 /*
  * Macros to set EFSCORRUPTED & return/branch.
  */
-#define XFS_WANT_CORRUPTED_GOTO(x,l)	\
+#define	XFS_WANT_CORRUPTED_GOTO(x,l)	\
 	{ \
 		int fs_is_ok = (x); \
 		ASSERT(fs_is_ok); \
@@ -578,7 +578,7 @@
 		} \
 	}
 
-#define XFS_WANT_CORRUPTED_RETURN(x)	\
+#define	XFS_WANT_CORRUPTED_RETURN(x)	\
 	{ \
 		int fs_is_ok = (x); \
 		ASSERT(fs_is_ok); \
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_buf_item.c linux-2.5.68-bk12/fs/xfs/xfs_buf_item.c
--- linux-2.5.68-bk11/fs/xfs/xfs_buf_item.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_buf_item.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -37,17 +37,32 @@
  * transaction routines.
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_buf_item.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_trans_priv.h"
+#include "xfs_rw.h"
+#include "xfs_bit.h"
+#include "xfs_error.h"
 
-#define ROUNDUPNBWORD(x)	(((x) + (NBWORD - 1)) & ~(NBWORD - 1))
+
+#define	ROUNDUPNBWORD(x)	(((x) + (NBWORD - 1)) & ~(NBWORD - 1))
 
 kmem_zone_t	*xfs_buf_item_zone;
 
 #ifdef XFS_TRANS_DEBUG
 /*
  * This function uses an alternate strategy for tracking the bytes
- * that the user requests to be logged.	 This can then be used
+ * that the user requests to be logged.  This can then be used
  * in conjunction with the bli_orig array in the buf log item to
  * catch bugs in our callers' code.
  *
@@ -86,7 +101,7 @@
 
 /*
  * This function is called when we flush something into a buffer without
- * logging it.	This happens for things like inodes which are logged
+ * logging it.  This happens for things like inodes which are logged
  * separately from the buffer.
  */
 void
@@ -189,7 +204,7 @@
 	while (last_bit != -1) {
 		/*
 		 * This takes the bit number to start looking from and
-		 * returns the next set bit from there.	 It returns -1
+		 * returns the next set bit from there.  It returns -1
 		 * if there are no more bits set or the start bit is
 		 * beyond the end of the bitmap.
 		 */
@@ -222,7 +237,7 @@
 
 /*
  * This is called to fill in the vector of log iovecs for the
- * given log buf item.	It fills the first entry with a buf log
+ * given log buf item.  It fills the first entry with a buf log
  * format structure, and the rest point to contiguous chunks
  * within the buffer.
  */
@@ -233,7 +248,7 @@
 {
 	uint		base_size;
 	uint		nvecs;
-	xfs_log_iovec_t *vecp;
+	xfs_log_iovec_t	*vecp;
 	xfs_buf_t	*bp;
 	int		first_bit;
 	int		last_bit;
@@ -286,7 +301,7 @@
 	for (;;) {
 		/*
 		 * This takes the bit number to start looking from and
-		 * returns the next set bit from there.	 It returns -1
+		 * returns the next set bit from there.  It returns -1
 		 * if there are no more bits set or the start bit is
 		 * beyond the end of the bitmap.
 		 */
@@ -348,7 +363,7 @@
 
 /*
  * This is called to pin the buffer associated with the buf log
- * item in memory so it cannot be written out.	Simply call bpin()
+ * item in memory so it cannot be written out.  Simply call bpin()
  * on the buffer to do this.
  */
 void
@@ -605,7 +620,7 @@
  * buf log item in the on disk log resides now that the last log
  * write of it completed at the given lsn.
  * We always re-log all the dirty data in a buffer, so usually the
- * latest copy in the on disk log is the only one that matters.	 For
+ * latest copy in the on disk log is the only one that matters.  For
  * those cases we simply return the given lsn.
  *
  * The one exception to this is for buffers full of newly allocated
@@ -653,7 +668,7 @@
 /*
  * This is called to asynchronously write the buffer associated with this
  * buf log item out to disk. The buffer will already have been locked by
- * a successful call to xfs_buf_item_trylock().	 If the buffer still has
+ * a successful call to xfs_buf_item_trylock().  If the buffer still has
  * B_DELWRI set, then get it going out to disk with a call to bawrite().
  * If not, then just release the buffer.
  */
@@ -723,7 +738,7 @@
 
 	/*
 	 * Check to see if there is already a buf log item for
-	 * this buffer.	 If there is, it is guaranteed to be
+	 * this buffer.  If there is, it is guaranteed to be
 	 * the first.  If we do already have one, there is
 	 * nothing to do here so return.
 	 */
@@ -740,7 +755,7 @@
 	/*
 	 * chunks is the number of XFS_BLI_CHUNK size pieces
 	 * the buffer can be divided into. Make sure not to
-	 * truncate any pieces.	 map_size is the size of the
+	 * truncate any pieces.  map_size is the size of the
 	 * bitmap needed to describe the chunks of the buffer.
 	 */
 	chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLI_CHUNK - 1)) >> XFS_BLI_SHIFT);
@@ -838,7 +853,7 @@
 	/*
 	 * First set any bits in the first word of our range.
 	 * If it starts at bit 0 of the word, it will be
-	 * set below rather than here.	That is what the variable
+	 * set below rather than here.  That is what the variable
 	 * bit tells us. The variable bits_set tracks the number
 	 * of bits that have been set so far.  End_bit is the number
 	 * of the last bit to be set in this word plus one.
@@ -928,7 +943,7 @@
  * to be called when the buffer's I/O completes.  If it is not set
  * already, set the buffer's b_iodone() routine to be
  * xfs_buf_iodone_callbacks() and link the log item into the list of
- * items rooted at b_fsprivate.	 Items are always added as the second
+ * items rooted at b_fsprivate.  Items are always added as the second
  * entry in the list if there is a first, because the buf item code
  * assumes that the buf log item is first.
  */
@@ -981,7 +996,7 @@
 
 /*
  * This is the iodone() function for buffers which have had callbacks
- * attached to them by xfs_buf_attach_iodone().	 It should remove each
+ * attached to them by xfs_buf_attach_iodone().  It should remove each
  * log item from the buffer's list and call the callback of each in turn.
  * When done, the buffer's fsprivate field is set to NULL and the buffer
  * is unlocked with a call to iodone().
@@ -1201,5 +1216,3 @@
 		     (void *)((unsigned long)bip->bli_item.li_flags));
 }
 #endif /* XFS_BLI_TRACE */
-
-
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_buf_item.h linux-2.5.68-bk12/fs/xfs/xfs_buf_item.h
--- linux-2.5.68-bk11/fs/xfs/xfs_buf_item.h	2003-04-19 19:50:30.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_buf_item.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,14 +29,14 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_BUF_ITEM_H__
-#define __XFS_BUF_ITEM_H__
+#ifndef	__XFS_BUF_ITEM_H__
+#define	__XFS_BUF_ITEM_H__
 
 /*
  * This is the structure used to lay out a buf log item in the
- * log.	 The data map describes which 128 byte chunks of the buffer
+ * log.  The data map describes which 128 byte chunks of the buffer
  * have been logged.  This structure works only on buffers that
- * reside up to the first TB in the filesystem.	 These buffers are
+ * reside up to the first TB in the filesystem.  These buffers are
  * generated only by pre-6.2 systems and are known as XFS_LI_6_1_BUF.
  */
 typedef struct xfs_buf_log_format_v1 {
@@ -69,33 +69,33 @@
  * This flag indicates that the buffer contains on disk inodes
  * and requires special recovery handling.
  */
-#define XFS_BLI_INODE_BUF	0x1
+#define	XFS_BLI_INODE_BUF	0x1
 /*
  * This flag indicates that the buffer should not be replayed
  * during recovery because its blocks are being freed.
  */
-#define XFS_BLI_CANCEL		0x2
+#define	XFS_BLI_CANCEL		0x2
 /*
  * This flag indicates that the buffer contains on disk
  * user or group dquots and may require special recovery handling.
  */
-#define XFS_BLI_UDQUOT_BUF	0x4
+#define	XFS_BLI_UDQUOT_BUF	0x4
 /* #define XFS_BLI_PDQUOT_BUF	0x8 */
-#define XFS_BLI_GDQUOT_BUF	0x10
+#define	XFS_BLI_GDQUOT_BUF	0x10
 
-#define XFS_BLI_CHUNK		128
-#define XFS_BLI_SHIFT		7
-#define BIT_TO_WORD_SHIFT	5
-#define NBWORD			(NBBY * sizeof(unsigned int))
+#define	XFS_BLI_CHUNK		128
+#define	XFS_BLI_SHIFT		7
+#define	BIT_TO_WORD_SHIFT	5
+#define	NBWORD			(NBBY * sizeof(unsigned int))
 
 /*
  * buf log item flags
  */
-#define XFS_BLI_HOLD		0x01
-#define XFS_BLI_DIRTY		0x02
-#define XFS_BLI_STALE		0x04
-#define XFS_BLI_LOGGED		0x08
-#define XFS_BLI_INODE_ALLOC_BUF 0x10
+#define	XFS_BLI_HOLD		0x01
+#define	XFS_BLI_DIRTY		0x02
+#define	XFS_BLI_STALE		0x04
+#define	XFS_BLI_LOGGED		0x08
+#define	XFS_BLI_INODE_ALLOC_BUF	0x10
 
 
 #ifdef __KERNEL__
@@ -136,11 +136,11 @@
 	struct xfs_buf_cancel	*bc_next;
 } xfs_buf_cancel_t;
 
-#define XFS_BLI_TRACE_SIZE	32
+#define	XFS_BLI_TRACE_SIZE	32
 
 
 #if defined(XFS_ALL_TRACE)
-#define XFS_BLI_TRACE
+#define	XFS_BLI_TRACE
 #endif
 
 #if !defined(DEBUG)
@@ -150,7 +150,7 @@
 #if defined(XFS_BLI_TRACE)
 void	xfs_buf_item_trace(char *, xfs_buf_log_item_t *);
 #else
-#define xfs_buf_item_trace(id, bip)
+#define	xfs_buf_item_trace(id, bip)
 #endif
 
 void	xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *);
@@ -170,7 +170,7 @@
 	uint	first,
 	uint	last);
 #else
-#define xfs_buf_item_flush_log_debug(bp, first, last)
+#define	xfs_buf_item_flush_log_debug(bp, first, last)
 #endif
 
 #endif	/* __KERNEL__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_cap.c linux-2.5.68-bk12/fs/xfs/xfs_cap.c
--- linux-2.5.68-bk11/fs/xfs/xfs_cap.c	2003-04-19 19:49:13.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_cap.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
 STATIC int xfs_cap_allow_set(vnode_t *);
 
@@ -96,7 +96,7 @@
 	ASSERT(sizeof(xattr_cap->c_effective) == sizeof(src->cap_effective));
 
 	xattr_cap->c_version	= cpu_to_le32(POSIX_CAP_XATTR_VERSION);
-	xattr_cap->c_abiversion = cpu_to_le32(_LINUX_CAPABILITY_VERSION);
+	xattr_cap->c_abiversion	= cpu_to_le32(_LINUX_CAPABILITY_VERSION);
 	xattr_cap->c_effective	= src->cap_effective;
 	xattr_cap->c_permitted	= src->cap_permitted;
 	xattr_cap->c_inheritable= src->cap_inheritable;
@@ -114,7 +114,7 @@
 	int		len = sizeof(xfs_cap_set_t);
 	int		flags = ATTR_ROOT;
 	xfs_cap_set_t	xfs_cap = { 0 };
-	posix_cap_xattr *xattr_cap = cap;
+	posix_cap_xattr	*xattr_cap = cap;
 
 	VN_HOLD(vp);
 	if ((error = _MAC_VACCESS(vp, NULL, VREAD)))
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_cap.h linux-2.5.68-bk12/fs/xfs/xfs_cap.h
--- linux-2.5.68-bk11/fs/xfs/xfs_cap.h	2003-04-19 19:50:02.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_cap.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -38,9 +38,9 @@
 typedef __uint64_t xfs_cap_value_t;
 
 typedef struct xfs_cap_set {
-	xfs_cap_value_t cap_effective;	/* use in capability checks */
-	xfs_cap_value_t cap_permitted;	/* combined with file attrs */
-	xfs_cap_value_t cap_inheritable;/* pass through exec */
+	xfs_cap_value_t	cap_effective;	/* use in capability checks */
+	xfs_cap_value_t	cap_permitted;	/* combined with file attrs */
+	xfs_cap_value_t	cap_inheritable;/* pass through exec */
 } xfs_cap_set_t;
 
 /* On-disk XFS extended attribute names */
@@ -81,4 +81,4 @@
 
 #endif	/* __KERNEL__ */
 
-#endif	/* __XFS_CAP_H__ */
+#endif  /* __XFS_CAP_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_clnt.h linux-2.5.68-bk12/fs/xfs/xfs_clnt.h
--- linux-2.5.68-bk11/fs/xfs/xfs_clnt.h	2003-04-19 19:50:07.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_clnt.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -45,7 +45,7 @@
  * system call), and the ABI issues that this implies.
  *
  * In Linux, we are passed a comma separated set of options;
- * ie. a NULL terminated string of characters.	Userspace mount
+ * ie. a NULL terminated string of characters.  Userspace mount
  * code does not have any knowledge of mount options expected by
  * each filesystem type and so each filesystem parses its mount
  * options in kernel space.
@@ -69,10 +69,10 @@
 /*
  * XFS mount option flags
  */
-#define XFSMNT_CHKLOG		0x00000001	/* check log */
-#define XFSMNT_WSYNC		0x00000002	/* safe mode nfs mount
+#define	XFSMNT_CHKLOG		0x00000001	/* check log */
+#define	XFSMNT_WSYNC		0x00000002	/* safe mode nfs mount
 						 * compatible */
-#define XFSMNT_INO64		0x00000004	/* move inode numbers up
+#define	XFSMNT_INO64		0x00000004	/* move inode numbers up
 						 * past 2^32 */
 #define XFSMNT_UQUOTA		0x00000008	/* user quota accounting */
 #define XFSMNT_PQUOTA		0x00000010	/* IRIX prj quota accounting */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_da_btree.c linux-2.5.68-bk12/fs/xfs/xfs_da_btree.c
--- linux-2.5.68-bk11/fs/xfs/xfs_da_btree.c	2003-04-19 19:50:35.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_da_btree.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,8 +30,41 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_attr.h"
+#include "xfs_attr_leaf.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_dir2_data.h"
+#include "xfs_dir2_leaf.h"
+#include "xfs_dir2_block.h"
+#include "xfs_dir2_node.h"
+#include "xfs_error.h"
+#include "xfs_bit.h"
 
 #if defined(XFSDEBUG) && defined(CONFIG_KDB)
 #undef xfs_buftrace
@@ -746,7 +779,7 @@
 }
 
 /*
- * We have only one entry in the root.	Copy the only remaining child of
+ * We have only one entry in the root.  Copy the only remaining child of
  * the old root to block 0 as the new root node.
  */
 STATIC int
@@ -1602,7 +1635,7 @@
 {
 	xfs_dahash_t hash;
 
-#define ROTL(x,y)	(((x) << (y)) | ((x) >> (32 - (y))))
+#define	ROTL(x,y)	(((x) << (y)) | ((x) >> (32 - (y))))
 #ifdef SLOWVERSION
 	/*
 	 * This is the old one-byte-at-a-time version.
@@ -1648,7 +1681,7 @@
 {
 	xfs_fileoff_t bno, b;
 	xfs_bmbt_irec_t map;
-	xfs_bmbt_irec_t *mapp;
+	xfs_bmbt_irec_t	*mapp;
 	xfs_inode_t *dp;
 	int nmap, error, w, count, c, got, i, mapi;
 	xfs_fsize_t size;
@@ -1696,7 +1729,7 @@
 	}
 	/*
 	 * If we didn't get it and the block might work if fragmented,
-	 * try without the CONTIG flag.	 Loop until we get it all.
+	 * try without the CONTIG flag.  Loop until we get it all.
 	 */
 	else if (nmap == 0 && count > 1) {
 		mapp = kmem_alloc(sizeof(*mapp) * count, KM_SLEEP);
@@ -1753,7 +1786,7 @@
 }
 
 /*
- * Ick.	 We need to always be able to remove a btree block, even
+ * Ick.  We need to always be able to remove a btree block, even
  * if there's no space reservation because the filesystem is full.
  * This is called if xfs_bunmapi on a btree block fails due to ENOSPC.
  * It swaps the target block with the last block in the file.  The
@@ -2032,7 +2065,7 @@
 STATIC int
 xfs_da_map_covers_blocks(
 	int		nmap,
-	xfs_bmbt_irec_t *mapp,
+	xfs_bmbt_irec_t	*mapp,
 	xfs_dablk_t	bno,
 	int		count)
 {
@@ -2071,8 +2104,8 @@
 	xfs_buf_t	**bplist;
 	int		error=0;
 	int		i;
-	xfs_bmbt_irec_t map;
-	xfs_bmbt_irec_t *mapp;
+	xfs_bmbt_irec_t	map;
+	xfs_bmbt_irec_t	*mapp;
 	xfs_daddr_t	mappedbno;
 	xfs_mount_t	*mp;
 	int		nbplist=0;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_da_btree.h linux-2.5.68-bk12/fs/xfs/xfs_da_btree.h
--- linux-2.5.68-bk11/fs/xfs/xfs_da_btree.h	2003-04-19 19:49:23.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_da_btree.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DA_BTREE_H__
-#define __XFS_DA_BTREE_H__
+#define	__XFS_DA_BTREE_H__
 
 struct xfs_buf;
 struct xfs_bmap_free;
@@ -52,10 +52,10 @@
 #define XFS_DA_NODE_MAGIC	0xfebe	/* magic number: non-leaf blocks */
 #define XFS_DIR_LEAF_MAGIC	0xfeeb	/* magic number: directory leaf blks */
 #define XFS_ATTR_LEAF_MAGIC	0xfbee	/* magic number: attribute leaf blks */
-#define XFS_DIR2_LEAF1_MAGIC	0xd2f1	/* magic number: v2 dirlf single blks */
-#define XFS_DIR2_LEAFN_MAGIC	0xd2ff	/* magic number: v2 dirlf multi blks */
+#define	XFS_DIR2_LEAF1_MAGIC	0xd2f1	/* magic number: v2 dirlf single blks */
+#define	XFS_DIR2_LEAFN_MAGIC	0xd2ff	/* magic number: v2 dirlf multi blks */
 
-#define XFS_DIRX_LEAF_MAGIC(mp) \
+#define	XFS_DIRX_LEAF_MAGIC(mp)	\
 	(XFS_DIR_IS_V1(mp) ? XFS_DIR_LEAF_MAGIC : XFS_DIR2_LEAFN_MAGIC)
 
 typedef struct xfs_da_blkinfo {
@@ -74,7 +74,7 @@
  * Since we have duplicate keys, use a binary search but always follow
  * all match in the block, not just the first match found.
  */
-#define XFS_DA_NODE_MAXDEPTH	5	/* max depth of Btree */
+#define	XFS_DA_NODE_MAXDEPTH	5	/* max depth of Btree */
 
 typedef struct xfs_da_intnode {
 	struct xfs_da_node_hdr {	/* constant-structure header block */
@@ -97,15 +97,15 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LBSIZE)
 int xfs_lbsize(struct xfs_mount *mp);
-#define XFS_LBSIZE(mp)			xfs_lbsize(mp)
+#define	XFS_LBSIZE(mp)			xfs_lbsize(mp)
 #else
-#define XFS_LBSIZE(mp)	((mp)->m_sb.sb_blocksize)
+#define	XFS_LBSIZE(mp)	((mp)->m_sb.sb_blocksize)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LBLOG)
 int xfs_lblog(struct xfs_mount *mp);
-#define XFS_LBLOG(mp)			xfs_lblog(mp)
+#define	XFS_LBLOG(mp)			xfs_lblog(mp)
 #else
-#define XFS_LBLOG(mp)	((mp)->m_sb.sb_blocklog)
+#define	XFS_LBLOG(mp)	((mp)->m_sb.sb_blocklog)
 #endif
 
 /*
@@ -118,41 +118,41 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_MAKE_BNOENTRY)
 __uint32_t xfs_da_make_bnoentry(struct xfs_mount *mp, xfs_dablk_t bno,
 				int entry);
-#define XFS_DA_MAKE_BNOENTRY(mp,bno,entry)	\
+#define	XFS_DA_MAKE_BNOENTRY(mp,bno,entry)	\
 	xfs_da_make_bnoentry(mp,bno,entry)
 #else
-#define XFS_DA_MAKE_BNOENTRY(mp,bno,entry) \
+#define	XFS_DA_MAKE_BNOENTRY(mp,bno,entry) \
 	(((bno) << (mp)->m_dircook_elog) | (entry))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_MAKE_COOKIE)
 xfs_off_t xfs_da_make_cookie(struct xfs_mount *mp, xfs_dablk_t bno, int entry,
 				xfs_dahash_t hash);
-#define XFS_DA_MAKE_COOKIE(mp,bno,entry,hash)	\
+#define	XFS_DA_MAKE_COOKIE(mp,bno,entry,hash)	\
 	xfs_da_make_cookie(mp,bno,entry,hash)
 #else
-#define XFS_DA_MAKE_COOKIE(mp,bno,entry,hash) \
+#define	XFS_DA_MAKE_COOKIE(mp,bno,entry,hash) \
 	(((xfs_off_t)XFS_DA_MAKE_BNOENTRY(mp, bno, entry) << 32) | (hash))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_COOKIE_HASH)
 xfs_dahash_t xfs_da_cookie_hash(struct xfs_mount *mp, xfs_off_t cookie);
-#define XFS_DA_COOKIE_HASH(mp,cookie)		xfs_da_cookie_hash(mp,cookie)
+#define	XFS_DA_COOKIE_HASH(mp,cookie)		xfs_da_cookie_hash(mp,cookie)
 #else
-#define XFS_DA_COOKIE_HASH(mp,cookie)	((xfs_dahash_t)(cookie))
+#define	XFS_DA_COOKIE_HASH(mp,cookie)	((xfs_dahash_t)(cookie))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_COOKIE_BNO)
 xfs_dablk_t xfs_da_cookie_bno(struct xfs_mount *mp, xfs_off_t cookie);
-#define XFS_DA_COOKIE_BNO(mp,cookie)		xfs_da_cookie_bno(mp,cookie)
+#define	XFS_DA_COOKIE_BNO(mp,cookie)		xfs_da_cookie_bno(mp,cookie)
 #else
-#define XFS_DA_COOKIE_BNO(mp,cookie) \
+#define	XFS_DA_COOKIE_BNO(mp,cookie) \
 	(((xfs_off_t)(cookie) >> 31) == -1LL ? \
 		(xfs_dablk_t)0 : \
 		(xfs_dablk_t)((xfs_off_t)(cookie) >> ((mp)->m_dircook_elog + 32)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_COOKIE_ENTRY)
 int xfs_da_cookie_entry(struct xfs_mount *mp, xfs_off_t cookie);
-#define XFS_DA_COOKIE_ENTRY(mp,cookie)		xfs_da_cookie_entry(mp,cookie)
+#define	XFS_DA_COOKIE_ENTRY(mp,cookie)		xfs_da_cookie_entry(mp,cookie)
 #else
-#define XFS_DA_COOKIE_ENTRY(mp,cookie) \
+#define	XFS_DA_COOKIE_ENTRY(mp,cookie) \
 	(((xfs_off_t)(cookie) >> 31) == -1LL ? \
 		(xfs_dablk_t)0 : \
 		(xfs_dablk_t)(((xfs_off_t)(cookie) >> 32) & \
@@ -217,7 +217,7 @@
 #endif
 	struct xfs_buf	*bps[1];	/* actually nbuf of these */
 } xfs_dabuf_t;
-#define XFS_DA_BUF_SIZE(n)	\
+#define	XFS_DA_BUF_SIZE(n)	\
 	(sizeof(xfs_dabuf_t) + sizeof(struct xfs_buf *) * ((n) - 1))
 
 #ifdef XFS_DABUF_DEBUG
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dfrag.c linux-2.5.68-bk12/fs/xfs/xfs_dfrag.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dfrag.c	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dfrag.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,25 +30,52 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-#include <xfs_dfrag.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_ag.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_ialloc.h"
+#include "xfs_itable.h"
+#include "xfs_dfrag.h"
+#include "xfs_error.h"
+#include "xfs_mac.h"
+#include "xfs_rw.h"
 
 /*
  * Syssgi interface for swapext
  */
 int
 xfs_swapext(
-	xfs_swapext_t	*sxp)
+	xfs_swapext_t   *sxp)
 {
 	xfs_swapext_t	sx;
-	xfs_inode_t	*ip=NULL, *tip=NULL, *ips[2];
-	xfs_trans_t	*tp;
-	xfs_mount_t	*mp;
+	xfs_inode_t     *ip=NULL, *tip=NULL, *ips[2];
+	xfs_trans_t     *tp;
+	xfs_mount_t     *mp;
 	xfs_bstat_t	*sbp;
 	struct file	*fp = NULL, *tfp = NULL;
 	vnode_t		*vp, *tvp;
-	bhv_desc_t	*bdp, *tbdp;
-	vn_bhv_head_t	*bhp, *tbhp;
+	bhv_desc_t      *bdp, *tbdp;
+	vn_bhv_head_t   *bhp, *tbhp;
 	uint		lock_flags=0;
 	int		ilf_fields, tilf_fields;
 	int		error = 0;
@@ -93,7 +120,7 @@
 	}
 
 	if (ip->i_ino == tip->i_ino) {
-		error =	 XFS_ERROR(EINVAL);
+		error =  XFS_ERROR(EINVAL);
 		goto error0;
 	}
 
@@ -102,7 +129,7 @@
 	sbp = &sx.sx_stat;
 
 	if (XFS_FORCED_SHUTDOWN(mp)) {
-		error =	 XFS_ERROR(EIO);
+		error =  XFS_ERROR(EIO);
 		goto error0;
 	}
 
@@ -222,7 +249,7 @@
 	if ((error = xfs_trans_reserve(tp, 0,
 				     XFS_ICHANGE_LOG_RES(mp), 0,
 				     0, 0))) {
-		xfs_iunlock(ip,	 XFS_IOLOCK_EXCL);
+		xfs_iunlock(ip,  XFS_IOLOCK_EXCL);
 		xfs_iunlock(tip, XFS_IOLOCK_EXCL);
 		xfs_trans_cancel(tp, 0);
 		return error;
@@ -236,7 +263,7 @@
 	     (ip->i_d.di_aformat != XFS_DINODE_FMT_LOCAL)) {
 		error = xfs_bmap_count_blocks(tp, ip, XFS_ATTR_FORK, &aforkblks);
 		if (error) {
-			xfs_iunlock(ip,	 lock_flags);
+			xfs_iunlock(ip,  lock_flags);
 			xfs_iunlock(tip, lock_flags);
 			xfs_trans_cancel(tp, 0);
 			return error;
@@ -247,7 +274,7 @@
 		error = xfs_bmap_count_blocks(tp, tip, XFS_ATTR_FORK,
 			&taforkblks);
 		if (error) {
-			xfs_iunlock(ip,	 lock_flags);
+			xfs_iunlock(ip,  lock_flags);
 			xfs_iunlock(tip, lock_flags);
 			xfs_trans_cancel(tp, 0);
 			return error;
@@ -261,7 +288,7 @@
 	tifp = &tip->i_df;
 	tempif = *ifp;	/* struct copy */
 	*ifp = *tifp;	/* struct copy */
-	*tifp = tempif; /* struct copy */
+	*tifp = tempif;	/* struct copy */
 
 	/*
 	 * Fix the on-disk inode values
@@ -347,7 +374,7 @@
 
  error0:
 	if (locked) {
-		xfs_iunlock(ip,	 lock_flags);
+		xfs_iunlock(ip,  lock_flags);
 		xfs_iunlock(tip, lock_flags);
 	}
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dfrag.h linux-2.5.68-bk12/fs/xfs/xfs_dfrag.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dfrag.h	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dfrag.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DFRAG_H__
-#define __XFS_DFRAG_H__
+#define	__XFS_DFRAG_H__
 
 /*
  * Structure passed to xfs_swapext
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dinode.h linux-2.5.68-bk12/fs/xfs/xfs_dinode.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dinode.h	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dinode.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,13 +30,13 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DINODE_H__
-#define __XFS_DINODE_H__
+#define	__XFS_DINODE_H__
 
 struct xfs_buf;
 struct xfs_mount;
 
-#define XFS_DINODE_VERSION_1	1
-#define XFS_DINODE_VERSION_2	2
+#define	XFS_DINODE_VERSION_1	1
+#define	XFS_DINODE_VERSION_2	2
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DINODE_GOOD_VERSION)
 int xfs_dinode_good_version(int v);
 #define XFS_DINODE_GOOD_VERSION(v)	xfs_dinode_good_version(v)
@@ -44,7 +44,7 @@
 #define XFS_DINODE_GOOD_VERSION(v)	(((v) == XFS_DINODE_VERSION_1) || \
 					 ((v) == XFS_DINODE_VERSION_2))
 #endif
-#define XFS_DINODE_MAGIC	0x494e	/* 'IN' */
+#define	XFS_DINODE_MAGIC	0x494e	/* 'IN' */
 
 /*
  * Disk inode structure.
@@ -73,9 +73,9 @@
 	__uint32_t	di_nlink;	/* number of links to file */
 	__uint16_t	di_projid;	/* owner's project id */
 	__uint8_t	di_pad[10];	/* unused, zeroed space */
-	xfs_timestamp_t di_atime;	/* time last accessed */
-	xfs_timestamp_t di_mtime;	/* time last modified */
-	xfs_timestamp_t di_ctime;	/* time created/inode modified */
+	xfs_timestamp_t	di_atime;	/* time last accessed */
+	xfs_timestamp_t	di_mtime;	/* time last modified */
+	xfs_timestamp_t	di_ctime;	/* time created/inode modified */
 	xfs_fsize_t	di_size;	/* number of bytes in file */
 	xfs_drfsbno_t	di_nblocks;	/* # of direct & btree blocks used */
 	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
@@ -111,7 +111,7 @@
 	union {
 		xfs_bmdr_block_t di_abmbt;	/* btree root block */
 		xfs_bmbt_rec_32_t di_abmx[1];	/* extent list */
-		xfs_attr_shortform_t di_attrsf; /* shortform attribute list */
+		xfs_attr_shortform_t di_attrsf;	/* shortform attribute list */
 	}		di_a;
 } xfs_dinode_t;
 
@@ -120,42 +120,42 @@
  * Since the pathconf interface is signed, we use 2^31 - 1 instead.
  * The old inode format had a 16 bit link count, so its maximum is USHRT_MAX.
  */
-#define XFS_MAXLINK		((1U << 31) - 1U)
-#define XFS_MAXLINK_1		65535U
+#define	XFS_MAXLINK		((1U << 31) - 1U)
+#define	XFS_MAXLINK_1		65535U
 
 /*
  * Bit names for logging disk inodes only
  */
-#define XFS_DI_MAGIC		0x0000001
-#define XFS_DI_MODE		0x0000002
-#define XFS_DI_VERSION		0x0000004
-#define XFS_DI_FORMAT		0x0000008
-#define XFS_DI_ONLINK		0x0000010
-#define XFS_DI_UID		0x0000020
-#define XFS_DI_GID		0x0000040
-#define XFS_DI_NLINK		0x0000080
-#define XFS_DI_PROJID		0x0000100
-#define XFS_DI_PAD		0x0000200
-#define XFS_DI_ATIME		0x0000400
-#define XFS_DI_MTIME		0x0000800
-#define XFS_DI_CTIME		0x0001000
-#define XFS_DI_SIZE		0x0002000
-#define XFS_DI_NBLOCKS		0x0004000
-#define XFS_DI_EXTSIZE		0x0008000
-#define XFS_DI_NEXTENTS		0x0010000
-#define XFS_DI_NAEXTENTS	0x0020000
-#define XFS_DI_FORKOFF		0x0040000
-#define XFS_DI_AFORMAT		0x0080000
-#define XFS_DI_DMEVMASK		0x0100000
-#define XFS_DI_DMSTATE		0x0200000
-#define XFS_DI_FLAGS		0x0400000
-#define XFS_DI_GEN		0x0800000
-#define XFS_DI_NEXT_UNLINKED	0x1000000
-#define XFS_DI_U		0x2000000
-#define XFS_DI_A		0x4000000
-#define XFS_DI_NUM_BITS		27
-#define XFS_DI_ALL_BITS		((1 << XFS_DI_NUM_BITS) - 1)
-#define XFS_DI_CORE_BITS	(XFS_DI_ALL_BITS & ~(XFS_DI_U|XFS_DI_A))
+#define	XFS_DI_MAGIC		0x0000001
+#define	XFS_DI_MODE		0x0000002
+#define	XFS_DI_VERSION		0x0000004
+#define	XFS_DI_FORMAT		0x0000008
+#define	XFS_DI_ONLINK		0x0000010
+#define	XFS_DI_UID		0x0000020
+#define	XFS_DI_GID		0x0000040
+#define	XFS_DI_NLINK		0x0000080
+#define	XFS_DI_PROJID		0x0000100
+#define	XFS_DI_PAD		0x0000200
+#define	XFS_DI_ATIME		0x0000400
+#define	XFS_DI_MTIME		0x0000800
+#define	XFS_DI_CTIME		0x0001000
+#define	XFS_DI_SIZE		0x0002000
+#define	XFS_DI_NBLOCKS		0x0004000
+#define	XFS_DI_EXTSIZE		0x0008000
+#define	XFS_DI_NEXTENTS		0x0010000
+#define	XFS_DI_NAEXTENTS	0x0020000
+#define	XFS_DI_FORKOFF		0x0040000
+#define	XFS_DI_AFORMAT		0x0080000
+#define	XFS_DI_DMEVMASK		0x0100000
+#define	XFS_DI_DMSTATE		0x0200000
+#define	XFS_DI_FLAGS		0x0400000
+#define	XFS_DI_GEN		0x0800000
+#define	XFS_DI_NEXT_UNLINKED	0x1000000
+#define	XFS_DI_U		0x2000000
+#define	XFS_DI_A		0x4000000
+#define	XFS_DI_NUM_BITS		27
+#define	XFS_DI_ALL_BITS		((1 << XFS_DI_NUM_BITS) - 1)
+#define	XFS_DI_CORE_BITS	(XFS_DI_ALL_BITS & ~(XFS_DI_U|XFS_DI_A))
 
 /*
  * Values for di_format
@@ -173,29 +173,29 @@
 /*
  * Inode minimum and maximum sizes.
  */
-#define XFS_DINODE_MIN_LOG	8
-#define XFS_DINODE_MAX_LOG	11
-#define XFS_DINODE_MIN_SIZE	(1 << XFS_DINODE_MIN_LOG)
-#define XFS_DINODE_MAX_SIZE	(1 << XFS_DINODE_MAX_LOG)
+#define	XFS_DINODE_MIN_LOG	8
+#define	XFS_DINODE_MAX_LOG	11
+#define	XFS_DINODE_MIN_SIZE	(1 << XFS_DINODE_MIN_LOG)
+#define	XFS_DINODE_MAX_SIZE	(1 << XFS_DINODE_MAX_LOG)
 
 /*
  * Inode size for given fs.
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LITINO)
 int xfs_litino(struct xfs_mount *mp);
-#define XFS_LITINO(mp)		xfs_litino(mp)
+#define	XFS_LITINO(mp)		xfs_litino(mp)
 #else
-#define XFS_LITINO(mp)	((mp)->m_litino)
+#define	XFS_LITINO(mp)	((mp)->m_litino)
 #endif
-#define XFS_BROOT_SIZE_ADJ	\
+#define	XFS_BROOT_SIZE_ADJ	\
 	(sizeof(xfs_bmbt_block_t) - sizeof(xfs_bmdr_block_t))
 
 /*
  * Fork identifiers.  Here so utilities can use them without including
  * xfs_inode.h.
  */
-#define XFS_DATA_FORK	0
-#define XFS_ATTR_FORK	1
+#define	XFS_DATA_FORK	0
+#define	XFS_ATTR_FORK	1
 
 /*
  * Inode data & attribute fork sizes, per inode.
@@ -203,30 +203,30 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_Q)
 int xfs_cfork_q_arch(xfs_dinode_core_t *dcp, xfs_arch_t arch);
 int xfs_cfork_q(xfs_dinode_core_t *dcp);
-#define XFS_CFORK_Q_ARCH(dcp,arch)	    xfs_cfork_q_arch(dcp,arch)
-#define XFS_CFORK_Q(dcp)		    xfs_cfork_q(dcp)
+#define	XFS_CFORK_Q_ARCH(dcp,arch)          xfs_cfork_q_arch(dcp,arch)
+#define	XFS_CFORK_Q(dcp)                    xfs_cfork_q(dcp)
 #else
-#define XFS_CFORK_Q_ARCH(dcp,arch)	    (!INT_ISZERO((dcp)->di_forkoff, arch))
-#define XFS_CFORK_Q(dcp)		    ((dcp)->di_forkoff != 0)
+#define	XFS_CFORK_Q_ARCH(dcp,arch)	    (!INT_ISZERO((dcp)->di_forkoff, arch))
+#define XFS_CFORK_Q(dcp)                    ((dcp)->di_forkoff != 0)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_BOFF)
 int xfs_cfork_boff_arch(xfs_dinode_core_t *dcp, xfs_arch_t arch);
 int xfs_cfork_boff(xfs_dinode_core_t *dcp);
-#define XFS_CFORK_BOFF_ARCH(dcp,arch)	    xfs_cfork_boff_arch(dcp,arch)
-#define XFS_CFORK_BOFF(dcp)		    xfs_cfork_boff(dcp)
+#define	XFS_CFORK_BOFF_ARCH(dcp,arch)	    xfs_cfork_boff_arch(dcp,arch)
+#define	XFS_CFORK_BOFF(dcp)	            xfs_cfork_boff(dcp)
 #else
-#define XFS_CFORK_BOFF_ARCH(dcp,arch)	    ((int)(INT_GET((dcp)->di_forkoff, arch) << 3))
-#define XFS_CFORK_BOFF(dcp)		    ((int)((dcp)->di_forkoff << 3))
+#define	XFS_CFORK_BOFF_ARCH(dcp,arch)	    ((int)(INT_GET((dcp)->di_forkoff, arch) << 3))
+#define XFS_CFORK_BOFF(dcp)                 ((int)((dcp)->di_forkoff << 3))
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_DSIZE)
 int xfs_cfork_dsize_arch(xfs_dinode_core_t *dcp, struct xfs_mount *mp, xfs_arch_t arch);
 int xfs_cfork_dsize(xfs_dinode_core_t *dcp, struct xfs_mount *mp);
-#define XFS_CFORK_DSIZE_ARCH(dcp,mp,arch)   xfs_cfork_dsize_arch(dcp,mp,arch)
-#define XFS_CFORK_DSIZE(dcp,mp)		    xfs_cfork_dsize(dcp,mp)
+#define	XFS_CFORK_DSIZE_ARCH(dcp,mp,arch)   xfs_cfork_dsize_arch(dcp,mp,arch)
+#define	XFS_CFORK_DSIZE(dcp,mp)             xfs_cfork_dsize(dcp,mp)
 #else
-#define XFS_CFORK_DSIZE_ARCH(dcp,mp,arch) \
+#define	XFS_CFORK_DSIZE_ARCH(dcp,mp,arch) \
 	(XFS_CFORK_Q_ARCH(dcp, arch) ? XFS_CFORK_BOFF_ARCH(dcp, arch) : XFS_LITINO(mp))
 #define XFS_CFORK_DSIZE(dcp,mp) \
 	(XFS_CFORK_Q(dcp) ? XFS_CFORK_BOFF(dcp) : XFS_LITINO(mp))
@@ -235,10 +235,10 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_ASIZE)
 int xfs_cfork_asize_arch(xfs_dinode_core_t *dcp, struct xfs_mount *mp, xfs_arch_t arch);
 int xfs_cfork_asize(xfs_dinode_core_t *dcp, struct xfs_mount *mp);
-#define XFS_CFORK_ASIZE_ARCH(dcp,mp,arch)   xfs_cfork_asize_arch(dcp,mp,arch)
-#define XFS_CFORK_ASIZE(dcp,mp)		    xfs_cfork_asize(dcp,mp)
+#define	XFS_CFORK_ASIZE_ARCH(dcp,mp,arch)   xfs_cfork_asize_arch(dcp,mp,arch)
+#define	XFS_CFORK_ASIZE(dcp,mp)             xfs_cfork_asize(dcp,mp)
 #else
-#define XFS_CFORK_ASIZE_ARCH(dcp,mp,arch) \
+#define	XFS_CFORK_ASIZE_ARCH(dcp,mp,arch) \
 	(XFS_CFORK_Q_ARCH(dcp, arch) ? XFS_LITINO(mp) - XFS_CFORK_BOFF_ARCH(dcp, arch) : 0)
 #define XFS_CFORK_ASIZE(dcp,mp) \
 	(XFS_CFORK_Q(dcp) ? XFS_LITINO(mp) - XFS_CFORK_BOFF(dcp) : 0)
@@ -247,10 +247,10 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_SIZE)
 int xfs_cfork_size_arch(xfs_dinode_core_t *dcp, struct xfs_mount *mp, int w, xfs_arch_t arch);
 int xfs_cfork_size(xfs_dinode_core_t *dcp, struct xfs_mount *mp, int w);
-#define XFS_CFORK_SIZE_ARCH(dcp,mp,w,arch)  xfs_cfork_size_arch(dcp,mp,w,arch)
-#define XFS_CFORK_SIZE(dcp,mp,w)	    xfs_cfork_size(dcp,mp,w)
+#define	XFS_CFORK_SIZE_ARCH(dcp,mp,w,arch)  xfs_cfork_size_arch(dcp,mp,w,arch)
+#define	XFS_CFORK_SIZE(dcp,mp,w)            xfs_cfork_size(dcp,mp,w)
 #else
-#define XFS_CFORK_SIZE_ARCH(dcp,mp,w,arch) \
+#define	XFS_CFORK_SIZE_ARCH(dcp,mp,w,arch) \
 	((w) == XFS_DATA_FORK ? \
 		XFS_CFORK_DSIZE_ARCH(dcp, mp, arch) : XFS_CFORK_ASIZE_ARCH(dcp, mp, arch))
 #define XFS_CFORK_SIZE(dcp,mp,w) \
@@ -262,31 +262,31 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_DSIZE)
 int xfs_dfork_dsize_arch(xfs_dinode_t *dip, struct xfs_mount *mp, xfs_arch_t arch);
 int xfs_dfork_dsize(xfs_dinode_t *dip, struct xfs_mount *mp);
-#define XFS_DFORK_DSIZE_ARCH(dip,mp,arch)   xfs_dfork_dsize_arch(dip,mp,arch)
-#define XFS_DFORK_DSIZE(dip,mp)		    xfs_dfork_dsize(dip,mp)
+#define	XFS_DFORK_DSIZE_ARCH(dip,mp,arch)   xfs_dfork_dsize_arch(dip,mp,arch)
+#define	XFS_DFORK_DSIZE(dip,mp)             xfs_dfork_dsize(dip,mp)
 #else
-#define XFS_DFORK_DSIZE_ARCH(dip,mp,arch)   XFS_CFORK_DSIZE_ARCH(&(dip)->di_core, mp, arch)
-#define XFS_DFORK_DSIZE(dip,mp)		    XFS_DFORK_DSIZE_ARCH(dip,mp,ARCH_NOCONVERT)
+#define	XFS_DFORK_DSIZE_ARCH(dip,mp,arch)   XFS_CFORK_DSIZE_ARCH(&(dip)->di_core, mp, arch)
+#define XFS_DFORK_DSIZE(dip,mp)             XFS_DFORK_DSIZE_ARCH(dip,mp,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_ASIZE)
 int xfs_dfork_asize_arch(xfs_dinode_t *dip, struct xfs_mount *mp, xfs_arch_t arch);
 int xfs_dfork_asize(xfs_dinode_t *dip, struct xfs_mount *mp);
-#define XFS_DFORK_ASIZE_ARCH(dip,mp,arch)   xfs_dfork_asize_arch(dip,mp,arch)
-#define XFS_DFORK_ASIZE(dip,mp)		    xfs_dfork_asize(dip,mp)
+#define	XFS_DFORK_ASIZE_ARCH(dip,mp,arch)   xfs_dfork_asize_arch(dip,mp,arch)
+#define	XFS_DFORK_ASIZE(dip,mp)             xfs_dfork_asize(dip,mp)
 #else
-#define XFS_DFORK_ASIZE_ARCH(dip,mp,arch)   XFS_CFORK_ASIZE_ARCH(&(dip)->di_core, mp, arch)
-#define XFS_DFORK_ASIZE(dip,mp)		    XFS_DFORK_ASIZE_ARCH(dip,mp,ARCH_NOCONVERT)
+#define	XFS_DFORK_ASIZE_ARCH(dip,mp,arch)   XFS_CFORK_ASIZE_ARCH(&(dip)->di_core, mp, arch)
+#define XFS_DFORK_ASIZE(dip,mp)             XFS_DFORK_ASIZE_ARCH(dip,mp,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_SIZE)
 int xfs_dfork_size_arch(xfs_dinode_t *dip, struct xfs_mount *mp, int w, xfs_arch_t arch);
 int xfs_dfork_size(xfs_dinode_t *dip, struct xfs_mount *mp, int w);
-#define XFS_DFORK_SIZE_ARCH(dip,mp,w,arch)  xfs_dfork_size_arch(dip,mp,w,arch)
-#define XFS_DFORK_SIZE(dip,mp,w)	    xfs_dfork_size(dip,mp,w)
+#define	XFS_DFORK_SIZE_ARCH(dip,mp,w,arch)  xfs_dfork_size_arch(dip,mp,w,arch)
+#define	XFS_DFORK_SIZE(dip,mp,w)            xfs_dfork_size(dip,mp,w)
 #else
-#define XFS_DFORK_SIZE_ARCH(dip,mp,w,arch)  XFS_CFORK_SIZE_ARCH(&(dip)->di_core, mp, w, arch)
-#define XFS_DFORK_SIZE(dip,mp,w)	    XFS_DFORK_SIZE_ARCH(dip,mp,w,ARCH_NOCONVERT)
+#define	XFS_DFORK_SIZE_ARCH(dip,mp,w,arch)  XFS_CFORK_SIZE_ARCH(&(dip)->di_core, mp, w, arch)
+#define XFS_DFORK_SIZE(dip,mp,w)            XFS_DFORK_SIZE_ARCH(dip,mp,w,ARCH_NOCONVERT)
 
 #endif
 
@@ -296,171 +296,171 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_Q)
 int xfs_dfork_q_arch(xfs_dinode_t *dip, xfs_arch_t arch);
 int xfs_dfork_q(xfs_dinode_t *dip);
-#define XFS_DFORK_Q_ARCH(dip,arch)	    xfs_dfork_q_arch(dip,arch)
-#define XFS_DFORK_Q(dip)		    xfs_dfork_q(dip)
+#define	XFS_DFORK_Q_ARCH(dip,arch)	    xfs_dfork_q_arch(dip,arch)
+#define	XFS_DFORK_Q(dip)	            xfs_dfork_q(dip)
 #else
-#define XFS_DFORK_Q_ARCH(dip,arch)	    XFS_CFORK_Q_ARCH(&(dip)->di_core, arch)
-#define XFS_DFORK_Q(dip)		    XFS_DFORK_Q_ARCH(dip,ARCH_NOCONVERT)
+#define	XFS_DFORK_Q_ARCH(dip,arch)	    XFS_CFORK_Q_ARCH(&(dip)->di_core, arch)
+#define XFS_DFORK_Q(dip)                    XFS_DFORK_Q_ARCH(dip,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_BOFF)
 int xfs_dfork_boff_arch(xfs_dinode_t *dip, xfs_arch_t arch);
 int xfs_dfork_boff(xfs_dinode_t *dip);
-#define XFS_DFORK_BOFF_ARCH(dip,arch)	    xfs_dfork_boff_arch(dip,arch)
-#define XFS_DFORK_BOFF(dip)		    xfs_dfork_boff(dip)
+#define	XFS_DFORK_BOFF_ARCH(dip,arch)	    xfs_dfork_boff_arch(dip,arch)
+#define	XFS_DFORK_BOFF(dip)	            xfs_dfork_boff(dip)
 #else
-#define XFS_DFORK_BOFF_ARCH(dip,arch)	    XFS_CFORK_BOFF_ARCH(&(dip)->di_core, arch)
-#define XFS_DFORK_BOFF(dip)		    XFS_DFORK_BOFF_ARCH(dip,ARCH_NOCONVERT)
+#define	XFS_DFORK_BOFF_ARCH(dip,arch)	    XFS_CFORK_BOFF_ARCH(&(dip)->di_core, arch)
+#define XFS_DFORK_BOFF(dip)                 XFS_DFORK_BOFF_ARCH(dip,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_DPTR)
 char *xfs_dfork_dptr_arch(xfs_dinode_t *dip, xfs_arch_t arch);
 char *xfs_dfork_dptr(xfs_dinode_t *dip);
-#define XFS_DFORK_DPTR_ARCH(dip,arch)	    xfs_dfork_dptr_arch(dip,arch)
-#define XFS_DFORK_DPTR(dip)		    xfs_dfork_dptr(dip)
+#define	XFS_DFORK_DPTR_ARCH(dip,arch)	    xfs_dfork_dptr_arch(dip,arch)
+#define	XFS_DFORK_DPTR(dip)	            xfs_dfork_dptr(dip)
 #else
-#define XFS_DFORK_DPTR_ARCH(dip,arch)	    ((dip)->di_u.di_c)
-#define XFS_DFORK_DPTR(dip)		    XFS_DFORK_DPTR_ARCH(dip,ARCH_NOCONVERT)
+#define	XFS_DFORK_DPTR_ARCH(dip,arch)	    ((dip)->di_u.di_c)
+#define XFS_DFORK_DPTR(dip)                 XFS_DFORK_DPTR_ARCH(dip,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_APTR)
 char *xfs_dfork_aptr_arch(xfs_dinode_t *dip, xfs_arch_t arch);
 char *xfs_dfork_aptr(xfs_dinode_t *dip);
-#define XFS_DFORK_APTR_ARCH(dip,arch)	    xfs_dfork_aptr_arch(dip,arch)
-#define XFS_DFORK_APTR(dip)		    xfs_dfork_aptr(dip)
+#define	XFS_DFORK_APTR_ARCH(dip,arch)       xfs_dfork_aptr_arch(dip,arch)
+#define	XFS_DFORK_APTR(dip)                 xfs_dfork_aptr(dip)
 #else
-#define XFS_DFORK_APTR_ARCH(dip,arch)	    ((dip)->di_u.di_c + XFS_DFORK_BOFF_ARCH(dip, arch))
-#define XFS_DFORK_APTR(dip)		    XFS_DFORK_APTR_ARCH(dip,ARCH_NOCONVERT)
+#define	XFS_DFORK_APTR_ARCH(dip,arch)	    ((dip)->di_u.di_c + XFS_DFORK_BOFF_ARCH(dip, arch))
+#define XFS_DFORK_APTR(dip)                 XFS_DFORK_APTR_ARCH(dip,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_PTR)
 char *xfs_dfork_ptr_arch(xfs_dinode_t *dip, int w, xfs_arch_t arch);
 char *xfs_dfork_ptr(xfs_dinode_t *dip, int w);
-#define XFS_DFORK_PTR_ARCH(dip,w,arch)	    xfs_dfork_ptr_arch(dip,w,arch)
-#define XFS_DFORK_PTR(dip,w)		    xfs_dfork_ptr(dip,w)
+#define	XFS_DFORK_PTR_ARCH(dip,w,arch)      xfs_dfork_ptr_arch(dip,w,arch)
+#define	XFS_DFORK_PTR(dip,w)                xfs_dfork_ptr(dip,w)
 #else
-#define XFS_DFORK_PTR_ARCH(dip,w,arch)	\
+#define	XFS_DFORK_PTR_ARCH(dip,w,arch)	\
 	((w) == XFS_DATA_FORK ? XFS_DFORK_DPTR_ARCH(dip, arch) : XFS_DFORK_APTR_ARCH(dip, arch))
-#define XFS_DFORK_PTR(dip,w)		    XFS_DFORK_PTR_ARCH(dip,w,ARCH_NOCONVERT)
+#define XFS_DFORK_PTR(dip,w)                XFS_DFORK_PTR_ARCH(dip,w,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_FORMAT)
 int xfs_cfork_format_arch(xfs_dinode_core_t *dcp, int w, xfs_arch_t arch);
 int xfs_cfork_format(xfs_dinode_core_t *dcp, int w);
-#define XFS_CFORK_FORMAT_ARCH(dcp,w,arch)   xfs_cfork_format_arch(dcp,w,arch)
-#define XFS_CFORK_FORMAT(dcp,w)		    xfs_cfork_format(dcp,w)
+#define	XFS_CFORK_FORMAT_ARCH(dcp,w,arch)   xfs_cfork_format_arch(dcp,w,arch)
+#define	XFS_CFORK_FORMAT(dcp,w)             xfs_cfork_format(dcp,w)
 #else
-#define XFS_CFORK_FORMAT_ARCH(dcp,w,arch) \
+#define	XFS_CFORK_FORMAT_ARCH(dcp,w,arch) \
 	((w) == XFS_DATA_FORK ? INT_GET((dcp)->di_format, arch) : INT_GET((dcp)->di_aformat, arch))
-#define XFS_CFORK_FORMAT(dcp,w)		    XFS_CFORK_FORMAT_ARCH(dcp,w,ARCH_NOCONVERT)
+#define XFS_CFORK_FORMAT(dcp,w)             XFS_CFORK_FORMAT_ARCH(dcp,w,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_FMT_SET)
 void xfs_cfork_fmt_set_arch(xfs_dinode_core_t *dcp, int w, int n, xfs_arch_t arch);
 void xfs_cfork_fmt_set(xfs_dinode_core_t *dcp, int w, int n);
-#define XFS_CFORK_FMT_SET_ARCH(dcp,w,n,arch) xfs_cfork_fmt_set_arch(dcp,w,n,arch)
-#define XFS_CFORK_FMT_SET(dcp,w,n)	     xfs_cfork_fmt_set(dcp,w,n)
+#define	XFS_CFORK_FMT_SET_ARCH(dcp,w,n,arch) xfs_cfork_fmt_set_arch(dcp,w,n,arch)
+#define	XFS_CFORK_FMT_SET(dcp,w,n)           xfs_cfork_fmt_set(dcp,w,n)
 #else
-#define XFS_CFORK_FMT_SET_ARCH(dcp,w,n,arch) \
+#define	XFS_CFORK_FMT_SET_ARCH(dcp,w,n,arch) \
 	((w) == XFS_DATA_FORK ? \
 		(INT_SET((dcp)->di_format, arch, (n))) : \
 		(INT_SET((dcp)->di_aformat, arch, (n))))
-#define XFS_CFORK_FMT_SET(dcp,w,n)	     XFS_CFORK_FMT_SET_ARCH(dcp,w,n,ARCH_NOCONVERT)
+#define XFS_CFORK_FMT_SET(dcp,w,n)           XFS_CFORK_FMT_SET_ARCH(dcp,w,n,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_NEXTENTS)
 int xfs_cfork_nextents_arch(xfs_dinode_core_t *dcp, int w, xfs_arch_t arch);
 int xfs_cfork_nextents(xfs_dinode_core_t *dcp, int w);
-#define XFS_CFORK_NEXTENTS_ARCH(dcp,w,arch)  xfs_cfork_nextents_arch(dcp,w,arch)
-#define XFS_CFORK_NEXTENTS(dcp,w)	     xfs_cfork_nextents(dcp,w)
+#define	XFS_CFORK_NEXTENTS_ARCH(dcp,w,arch)  xfs_cfork_nextents_arch(dcp,w,arch)
+#define	XFS_CFORK_NEXTENTS(dcp,w)            xfs_cfork_nextents(dcp,w)
 #else
-#define XFS_CFORK_NEXTENTS_ARCH(dcp,w,arch) \
+#define	XFS_CFORK_NEXTENTS_ARCH(dcp,w,arch) \
 	((w) == XFS_DATA_FORK ? INT_GET((dcp)->di_nextents, arch) : INT_GET((dcp)->di_anextents, arch))
-#define XFS_CFORK_NEXTENTS(dcp,w)	     XFS_CFORK_NEXTENTS_ARCH(dcp,w,ARCH_NOCONVERT)
+#define XFS_CFORK_NEXTENTS(dcp,w)            XFS_CFORK_NEXTENTS_ARCH(dcp,w,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_NEXT_SET)
 void xfs_cfork_next_set_arch(xfs_dinode_core_t *dcp, int w, int n, xfs_arch_t arch);
 void xfs_cfork_next_set(xfs_dinode_core_t *dcp, int w, int n);
-#define XFS_CFORK_NEXT_SET_ARCH(dcp,w,n,arch)	xfs_cfork_next_set_arch(dcp,w,n,arch)
-#define XFS_CFORK_NEXT_SET(dcp,w,n)		xfs_cfork_next_set(dcp,w,n)
+#define	XFS_CFORK_NEXT_SET_ARCH(dcp,w,n,arch)	xfs_cfork_next_set_arch(dcp,w,n,arch)
+#define	XFS_CFORK_NEXT_SET(dcp,w,n)	        xfs_cfork_next_set(dcp,w,n)
 #else
-#define XFS_CFORK_NEXT_SET_ARCH(dcp,w,n,arch) \
+#define	XFS_CFORK_NEXT_SET_ARCH(dcp,w,n,arch) \
 	((w) == XFS_DATA_FORK ? \
 		(INT_SET((dcp)->di_nextents, arch, (n))) : \
 		(INT_SET((dcp)->di_anextents, arch, (n))))
-#define XFS_CFORK_NEXT_SET(dcp,w,n)		XFS_CFORK_NEXT_SET_ARCH(dcp,w,n,ARCH_NOCONVERT)
+#define XFS_CFORK_NEXT_SET(dcp,w,n)             XFS_CFORK_NEXT_SET_ARCH(dcp,w,n,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_FORMAT)
 int xfs_dfork_format_arch(xfs_dinode_t *dip, int w, xfs_arch_t arch);
 int xfs_dfork_format(xfs_dinode_t *dip, int w);
-#define XFS_DFORK_FORMAT_ARCH(dip,w,arch)   xfs_dfork_format_arch(dip,w,arch)
-#define XFS_DFORK_FORMAT(dip,w)		    xfs_dfork_format(dip,w)
+#define	XFS_DFORK_FORMAT_ARCH(dip,w,arch)   xfs_dfork_format_arch(dip,w,arch)
+#define	XFS_DFORK_FORMAT(dip,w)             xfs_dfork_format(dip,w)
 #else
-#define XFS_DFORK_FORMAT_ARCH(dip,w,arch)   XFS_CFORK_FORMAT_ARCH(&(dip)->di_core, w, arch)
-#define XFS_DFORK_FORMAT(dip,w)		    XFS_DFORK_FORMAT_ARCH(dip,w,ARCH_NOCONVERT)
+#define	XFS_DFORK_FORMAT_ARCH(dip,w,arch)   XFS_CFORK_FORMAT_ARCH(&(dip)->di_core, w, arch)
+#define XFS_DFORK_FORMAT(dip,w)             XFS_DFORK_FORMAT_ARCH(dip,w,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_FMT_SET)
 void xfs_dfork_fmt_set_arch(xfs_dinode_t *dip, int w, int n, xfs_arch_t arch);
 void xfs_dfork_fmt_set(xfs_dinode_t *dip, int w, int n);
-#define XFS_DFORK_FMT_SET_ARCH(dip,w,n,arch)	xfs_dfork_fmt_set_arch(dip,w,n,arch)
-#define XFS_DFORK_FMT_SET(dip,w,n)		xfs_dfork_fmt_set(dip,w,n)
+#define	XFS_DFORK_FMT_SET_ARCH(dip,w,n,arch)    xfs_dfork_fmt_set_arch(dip,w,n,arch)
+#define	XFS_DFORK_FMT_SET(dip,w,n)              xfs_dfork_fmt_set(dip,w,n)
 #else
-#define XFS_DFORK_FMT_SET_ARCH(dip,w,n,arch)	XFS_CFORK_FMT_SET_ARCH(&(dip)->di_core, w, n, arch)
-#define XFS_DFORK_FMT_SET(dip,w,n)		XFS_DFORK_FMT_SET_ARCH(dip,w,n,ARCH_NOCONVERT)
+#define	XFS_DFORK_FMT_SET_ARCH(dip,w,n,arch)	XFS_CFORK_FMT_SET_ARCH(&(dip)->di_core, w, n, arch)
+#define XFS_DFORK_FMT_SET(dip,w,n)              XFS_DFORK_FMT_SET_ARCH(dip,w,n,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_NEXTENTS)
 int xfs_dfork_nextents_arch(xfs_dinode_t *dip, int w, xfs_arch_t arch);
 int xfs_dfork_nextents(xfs_dinode_t *dip, int w);
-#define XFS_DFORK_NEXTENTS_ARCH(dip,w,arch) xfs_dfork_nextents_arch(dip,w,arch)
-#define XFS_DFORK_NEXTENTS(dip,w)	    xfs_dfork_nextents(dip,w)
+#define	XFS_DFORK_NEXTENTS_ARCH(dip,w,arch) xfs_dfork_nextents_arch(dip,w,arch)
+#define	XFS_DFORK_NEXTENTS(dip,w)           xfs_dfork_nextents(dip,w)
 #else
-#define XFS_DFORK_NEXTENTS_ARCH(dip,w,arch) XFS_CFORK_NEXTENTS_ARCH(&(dip)->di_core, w, arch)
-#define XFS_DFORK_NEXTENTS(dip,w)	    XFS_DFORK_NEXTENTS_ARCH(dip,w,ARCH_NOCONVERT)
+#define	XFS_DFORK_NEXTENTS_ARCH(dip,w,arch) XFS_CFORK_NEXTENTS_ARCH(&(dip)->di_core, w, arch)
+#define XFS_DFORK_NEXTENTS(dip,w)           XFS_DFORK_NEXTENTS_ARCH(dip,w,ARCH_NOCONVERT)
 
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DFORK_NEXT_SET)
 void xfs_dfork_next_set_arch(xfs_dinode_t *dip, int w, int n, xfs_arch_t arch);
 void xfs_dfork_next_set(xfs_dinode_t *dip, int w, int n);
-#define XFS_DFORK_NEXT_SET_ARCH(dip,w,n,arch)	xfs_dfork_next_set_arch(dip,w,n,arch)
-#define XFS_DFORK_NEXT_SET(dip,w,n)		xfs_dfork_next_set(dip,w,n)
+#define	XFS_DFORK_NEXT_SET_ARCH(dip,w,n,arch)   xfs_dfork_next_set_arch(dip,w,n,arch)
+#define	XFS_DFORK_NEXT_SET(dip,w,n)             xfs_dfork_next_set(dip,w,n)
 #else
-#define XFS_DFORK_NEXT_SET_ARCH(dip,w,n,arch)	XFS_CFORK_NEXT_SET_ARCH(&(dip)->di_core, w, n, arch)
-#define XFS_DFORK_NEXT_SET(dip,w,n)		XFS_DFORK_NEXT_SET_ARCH(dip,w,n,ARCH_NOCONVERT)
+#define	XFS_DFORK_NEXT_SET_ARCH(dip,w,n,arch)	XFS_CFORK_NEXT_SET_ARCH(&(dip)->di_core, w, n, arch)
+#define XFS_DFORK_NEXT_SET(dip,w,n)             XFS_DFORK_NEXT_SET_ARCH(dip,w,n,ARCH_NOCONVERT)
 
 #endif
 
 /*
  * File types (mode field)
  */
-#define IFMT		0170000		/* type of file */
-#define IFIFO		0010000		/* named pipe (fifo) */
-#define IFCHR		0020000		/* character special */
-#define IFDIR		0040000		/* directory */
-#define IFBLK		0060000		/* block special */
-#define IFREG		0100000		/* regular */
-#define IFLNK		0120000		/* symbolic link */
-#define IFSOCK		0140000		/* socket */
-#define IFMNT		0160000		/* mount point */
+#define	IFMT		0170000		/* type of file */
+#define	IFIFO		0010000		/* named pipe (fifo) */
+#define	IFCHR		0020000		/* character special */
+#define	IFDIR		0040000		/* directory */
+#define	IFBLK		0060000		/* block special */
+#define	IFREG		0100000		/* regular */
+#define	IFLNK		0120000		/* symbolic link */
+#define	IFSOCK		0140000		/* socket */
+#define	IFMNT		0160000		/* mount point */
 
 /*
  * File execution and access modes.
  */
-#define ISUID		04000		/* set user id on execution */
-#define ISGID		02000		/* set group id on execution */
-#define ISVTX		01000		/* sticky directory */
-#define IREAD		0400		/* read, write, execute permissions */
-#define IWRITE		0200
-#define IEXEC		0100
+#define	ISUID		04000		/* set user id on execution */
+#define	ISGID		02000		/* set group id on execution */
+#define	ISVTX		01000		/* sticky directory */
+#define	IREAD		0400		/* read, write, execute permissions */
+#define	IWRITE		0200
+#define	IEXEC		0100
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_DINODE)
 xfs_dinode_t *xfs_buf_to_dinode(struct xfs_buf *bp);
-#define XFS_BUF_TO_DINODE(bp)	xfs_buf_to_dinode(bp)
+#define	XFS_BUF_TO_DINODE(bp)	xfs_buf_to_dinode(bp)
 #else
-#define XFS_BUF_TO_DINODE(bp)	((xfs_dinode_t *)(XFS_BUF_PTR(bp)))
+#define	XFS_BUF_TO_DINODE(bp)	((xfs_dinode_t *)(XFS_BUF_PTR(bp)))
 #endif
 
 /*
@@ -468,13 +468,13 @@
  * There should be a one-to-one correspondence between these flags and the
  * XFS_XFLAG_s.
  */
-#define XFS_DIFLAG_REALTIME_BIT 0	/* file's blocks come from rt area */
-#define XFS_DIFLAG_PREALLOC_BIT 1	/* file space has been preallocated */
-#define XFS_DIFLAG_NEWRTBM_BIT	2	/* for rtbitmap inode, new format */
-#define XFS_DIFLAG_REALTIME	(1 << XFS_DIFLAG_REALTIME_BIT)
+#define XFS_DIFLAG_REALTIME_BIT	0	/* file's blocks come from rt area */
+#define XFS_DIFLAG_PREALLOC_BIT	1	/* file space has been preallocated */
+#define	XFS_DIFLAG_NEWRTBM_BIT	2	/* for rtbitmap inode, new format */
+#define XFS_DIFLAG_REALTIME     (1 << XFS_DIFLAG_REALTIME_BIT)
 #define XFS_DIFLAG_PREALLOC	(1 << XFS_DIFLAG_PREALLOC_BIT)
-#define XFS_DIFLAG_NEWRTBM	(1 << XFS_DIFLAG_NEWRTBM_BIT)
-#define XFS_DIFLAG_ALL	\
+#define	XFS_DIFLAG_NEWRTBM	(1 << XFS_DIFLAG_NEWRTBM_BIT)
+#define XFS_DIFLAG_ALL  \
 	(XFS_DIFLAG_REALTIME|XFS_DIFLAG_PREALLOC|XFS_DIFLAG_NEWRTBM)
 
 #endif	/* __XFS_DINODE_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir.c linux-2.5.68-bk12/fs/xfs/xfs_dir.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dir.c	2003-04-19 19:48:55.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,8 +30,32 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_error.h"
 
 /*
  * xfs_dir.c
@@ -537,7 +561,7 @@
 	if (xfs_dir_ino_validate(mp, ino))
 		return 1;
 
-	count = sf->hdr.count;
+	count =	sf->hdr.count;
 	if ((count < 0) || ((count * 10) > XFS_LITINO(mp))) {
 		xfs_fs_cmn_err(CE_WARN, mp,
 			"Invalid shortform count: dp 0x%p", dp);
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir.h linux-2.5.68-bk12/fs/xfs/xfs_dir.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,13 +30,13 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DIR_H__
-#define __XFS_DIR_H__
+#define	__XFS_DIR_H__
 
 /*
  * Large directories are structured around Btrees where all the data
  * elements are in the leaf nodes.  Filenames are hashed into an int,
  * then that int is used as the index into the Btree.  Since the hashval
- * of a filename may not be unique, we may have duplicate keys.	 The
+ * of a filename may not be unique, we may have duplicate keys.  The
  * internal links in the Btree are logical block offsets into the file.
  *
  * Small directories use a different format and are packed as tightly
@@ -44,7 +44,7 @@
  */
 
 #ifdef XFS_ALL_TRACE
-#define XFS_DIR_TRACE
+#define	XFS_DIR_TRACE
 #endif
 
 #if !defined(DEBUG)
@@ -132,31 +132,31 @@
  */
 void	xfs_dir_startup(void);	/* called exactly once */
 
-#define XFS_DIR_MOUNT(mp)	\
+#define	XFS_DIR_MOUNT(mp)	\
 	((mp)->m_dirops.xd_mount(mp))
-#define XFS_DIR_ISEMPTY(mp,dp)	\
+#define	XFS_DIR_ISEMPTY(mp,dp)	\
 	((mp)->m_dirops.xd_isempty(dp))
-#define XFS_DIR_INIT(mp,tp,dp,pdp)	\
+#define	XFS_DIR_INIT(mp,tp,dp,pdp)	\
 	((mp)->m_dirops.xd_init(tp,dp,pdp))
-#define XFS_DIR_CREATENAME(mp,tp,dp,name,namelen,inum,first,flist,total) \
+#define	XFS_DIR_CREATENAME(mp,tp,dp,name,namelen,inum,first,flist,total) \
 	((mp)->m_dirops.xd_createname(tp,dp,name,namelen,inum,first,flist,\
 				      total))
-#define XFS_DIR_LOOKUP(mp,tp,dp,name,namelen,inum)	\
+#define	XFS_DIR_LOOKUP(mp,tp,dp,name,namelen,inum)	\
 	((mp)->m_dirops.xd_lookup(tp,dp,name,namelen,inum))
-#define XFS_DIR_REMOVENAME(mp,tp,dp,name,namelen,ino,first,flist,total) \
+#define	XFS_DIR_REMOVENAME(mp,tp,dp,name,namelen,ino,first,flist,total)	\
 	((mp)->m_dirops.xd_removename(tp,dp,name,namelen,ino,first,flist,total))
-#define XFS_DIR_GETDENTS(mp,tp,dp,uio,eofp)	\
+#define	XFS_DIR_GETDENTS(mp,tp,dp,uio,eofp)	\
 	((mp)->m_dirops.xd_getdents(tp,dp,uio,eofp))
-#define XFS_DIR_REPLACE(mp,tp,dp,name,namelen,inum,first,flist,total)	\
+#define	XFS_DIR_REPLACE(mp,tp,dp,name,namelen,inum,first,flist,total)	\
 	((mp)->m_dirops.xd_replace(tp,dp,name,namelen,inum,first,flist,total))
-#define XFS_DIR_CANENTER(mp,tp,dp,name,namelen) \
+#define	XFS_DIR_CANENTER(mp,tp,dp,name,namelen)	\
 	((mp)->m_dirops.xd_canenter(tp,dp,name,namelen))
-#define XFS_DIR_SHORTFORM_VALIDATE_ONDISK(mp,dip)	\
+#define	XFS_DIR_SHORTFORM_VALIDATE_ONDISK(mp,dip)	\
 	((mp)->m_dirops.xd_shortform_validate_ondisk(mp,dip))
-#define XFS_DIR_SHORTFORM_TO_SINGLE(mp,args)	\
+#define	XFS_DIR_SHORTFORM_TO_SINGLE(mp,args)	\
 	((mp)->m_dirops.xd_shortform_to_single(args))
 
-#define XFS_DIR_IS_V1(mp)	((mp)->m_dirversion == 1)
+#define	XFS_DIR_IS_V1(mp)	((mp)->m_dirversion == 1)
 extern xfs_dirops_t xfsv1_dirops;
 
 #endif	/* __XFS_DIR_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2.c linux-2.5.68-bk12/fs/xfs/xfs_dir2.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2.c	2003-04-19 19:51:23.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -35,7 +35,38 @@
  * Top-level and utility routines.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_dir2_data.h"
+#include "xfs_dir2_leaf.h"
+#include "xfs_dir2_block.h"
+#include "xfs_dir2_node.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dir2_trace.h"
+#include "xfs_error.h"
+#include "xfs_bit.h"
 
 /*
  * Declarations for interface routines.
@@ -282,7 +313,7 @@
 	int		namelen,	/* name length of entry to remove */
 	xfs_ino_t	ino,		/* inode number of entry to remove */
 	xfs_fsblock_t	*first,		/* bmap's firstblock */
-	xfs_bmap_free_t *flist,		/* bmap's freeblock list */
+	xfs_bmap_free_t	*flist,		/* bmap's freeblock list */
 	xfs_extlen_t	total)		/* bmap's total block count */
 {
 	xfs_da_args_t	args;		/* operation arguments */
@@ -385,7 +416,7 @@
 	int		namelen,	/* name length of entry to replace */
 	xfs_ino_t	inum,		/* new inode number */
 	xfs_fsblock_t	*first,		/* bmap's firstblock */
-	xfs_bmap_free_t *flist,		/* bmap's freeblock list */
+	xfs_bmap_free_t	*flist,		/* bmap's freeblock list */
 	xfs_extlen_t	total)		/* bmap's total block count */
 {
 	xfs_da_args_t	args;		/* operation arguments */
@@ -510,9 +541,9 @@
 	int		error;		/* error return value */
 	int		got;		/* blocks actually mapped */
 	int		i;		/* temp mapping index */
-	xfs_bmbt_irec_t map;		/* single structure for bmap */
+	xfs_bmbt_irec_t	map;		/* single structure for bmap */
 	int		mapi;		/* mapping index */
-	xfs_bmbt_irec_t *mapp;		/* bmap mapping structure(s) */
+	xfs_bmbt_irec_t	*mapp;		/* bmap mapping structure(s) */
 	xfs_mount_t	*mp;		/* filesystem mount point */
 	int		nmap;		/* number of bmap entries */
 	xfs_trans_t	*tp;		/* transaction pointer */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2.h linux-2.5.68-bk12/fs/xfs/xfs_dir2.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2.h	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DIR2_H__
-#define __XFS_DIR2_H__
+#define	__XFS_DIR2_H__
 
 struct uio;
 struct xfs_dabuf;
@@ -57,19 +57,19 @@
 /*
  * Byte offset in data block and shortform entry.
  */
-typedef __uint16_t	xfs_dir2_data_off_t;
-#define NULLDATAOFF	0xffffU
+typedef	__uint16_t	xfs_dir2_data_off_t;
+#define	NULLDATAOFF	0xffffU
 typedef uint		xfs_dir2_data_aoff_t;	/* argument form */
 
 /*
  * Directory block number (logical dirblk in file)
  */
-typedef __uint32_t	xfs_dir2_db_t;
+typedef	__uint32_t	xfs_dir2_db_t;
 
 /*
  * Byte offset in a directory.
  */
-typedef xfs_off_t		xfs_dir2_off_t;
+typedef	xfs_off_t		xfs_dir2_off_t;
 
 /*
  * For getdents, argument struct for put routines.
@@ -86,7 +86,7 @@
 	struct uio	*uio;		/* uio control structure */
 } xfs_dir2_put_args_t;
 
-#define XFS_DIR_IS_V2(mp)	((mp)->m_dirversion == 2)
+#define	XFS_DIR_IS_V2(mp)	((mp)->m_dirversion == 2)
 extern xfs_dirops_t	xfsv2_dirops;
 
 /*
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_block.c linux-2.5.68-bk12/fs/xfs/xfs_dir2_block.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_block.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_block.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -36,8 +36,32 @@
  * See xfs_dir2_block.h for the format.
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_dir2_data.h"
+#include "xfs_dir2_leaf.h"
+#include "xfs_dir2_block.h"
+#include "xfs_dir2_trace.h"
+#include "xfs_error.h"
 
 /*
  * Local function prototypes.
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_block.h linux-2.5.68-bk12/fs/xfs/xfs_dir2_block.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_block.h	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_block.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DIR2_BLOCK_H__
-#define __XFS_DIR2_BLOCK_H__
+#define	__XFS_DIR2_BLOCK_H__
 
 /*
  * xfs_dir2_block.h
@@ -54,7 +54,7 @@
  * xfs_dir2_block_tail_t structure
  */
 
-#define XFS_DIR2_BLOCK_MAGIC	0x58443242	/* XD2B: for one block dirs */
+#define	XFS_DIR2_BLOCK_MAGIC	0x58443242	/* XD2B: for one block dirs */
 
 typedef struct xfs_dir2_block_tail {
 	__uint32_t	count;			/* count of leaf entries */
@@ -77,9 +77,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BLOCK_TAIL_P)
 xfs_dir2_block_tail_t *
 xfs_dir2_block_tail_p(struct xfs_mount *mp, xfs_dir2_block_t *block);
-#define XFS_DIR2_BLOCK_TAIL_P(mp,block) xfs_dir2_block_tail_p(mp,block)
+#define	XFS_DIR2_BLOCK_TAIL_P(mp,block)	xfs_dir2_block_tail_p(mp,block)
 #else
-#define XFS_DIR2_BLOCK_TAIL_P(mp,block) \
+#define	XFS_DIR2_BLOCK_TAIL_P(mp,block)	\
 	(((xfs_dir2_block_tail_t *)((char *)(block) + (mp)->m_dirblksize)) - 1)
 #endif
 
@@ -89,10 +89,10 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BLOCK_LEAF_P)
 struct xfs_dir2_leaf_entry *xfs_dir2_block_leaf_p_arch(
 	xfs_dir2_block_tail_t *btp, xfs_arch_t arch);
-#define XFS_DIR2_BLOCK_LEAF_P_ARCH(btp,arch) \
+#define	XFS_DIR2_BLOCK_LEAF_P_ARCH(btp,arch) \
 	xfs_dir2_block_leaf_p_arch(btp,arch)
 #else
-#define XFS_DIR2_BLOCK_LEAF_P_ARCH(btp,arch)	\
+#define	XFS_DIR2_BLOCK_LEAF_P_ARCH(btp,arch)	\
 	(((struct xfs_dir2_leaf_entry *)(btp)) - INT_GET((btp)->count, arch))
 #endif
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_data.c linux-2.5.68-bk12/fs/xfs/xfs_dir2_data.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_data.c	2003-04-19 19:50:45.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_data.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -36,8 +36,30 @@
  * See xfs_dir2_data.h for data structures.
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_dir2_data.h"
+#include "xfs_dir2_leaf.h"
+#include "xfs_dir2_block.h"
+#include "xfs_error.h"
 
 #ifdef DEBUG
 /*
@@ -397,7 +419,7 @@
 	int			i;		/* bestfree index */
 	xfs_mount_t		*mp;		/* filesystem mount point */
 	xfs_trans_t		*tp;		/* transaction pointer */
-	int			t;		/* temp */
+	int                     t;              /* temp */
 
 	dp = args->dp;
 	mp = dp->i_mount;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_data.h linux-2.5.68-bk12/fs/xfs/xfs_dir2_data.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_data.h	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_data.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DIR2_DATA_H__
-#define __XFS_DIR2_DATA_H__
+#define	__XFS_DIR2_DATA_H__
 
 /*
  * Directory format 2, data block structures.
@@ -44,30 +44,30 @@
 /*
  * Constants.
  */
-#define XFS_DIR2_DATA_MAGIC	0x58443244	/* XD2D: for multiblock dirs */
-#define XFS_DIR2_DATA_ALIGN_LOG 3		/* i.e., 8 bytes */
-#define XFS_DIR2_DATA_ALIGN	(1 << XFS_DIR2_DATA_ALIGN_LOG)
-#define XFS_DIR2_DATA_FREE_TAG	0xffff
-#define XFS_DIR2_DATA_FD_COUNT	3
+#define	XFS_DIR2_DATA_MAGIC	0x58443244	/* XD2D: for multiblock dirs */
+#define	XFS_DIR2_DATA_ALIGN_LOG	3		/* i.e., 8 bytes */
+#define	XFS_DIR2_DATA_ALIGN	(1 << XFS_DIR2_DATA_ALIGN_LOG)
+#define	XFS_DIR2_DATA_FREE_TAG	0xffff
+#define	XFS_DIR2_DATA_FD_COUNT	3
 
 /*
  * Directory address space divided into sections,
  * spaces separated by 32gb.
  */
-#define XFS_DIR2_SPACE_SIZE	(1ULL << (32 + XFS_DIR2_DATA_ALIGN_LOG))
-#define XFS_DIR2_DATA_SPACE	0
-#define XFS_DIR2_DATA_OFFSET	(XFS_DIR2_DATA_SPACE * XFS_DIR2_SPACE_SIZE)
-#define XFS_DIR2_DATA_FIRSTDB(mp)	\
+#define	XFS_DIR2_SPACE_SIZE	(1ULL << (32 + XFS_DIR2_DATA_ALIGN_LOG))
+#define	XFS_DIR2_DATA_SPACE	0
+#define	XFS_DIR2_DATA_OFFSET	(XFS_DIR2_DATA_SPACE * XFS_DIR2_SPACE_SIZE)
+#define	XFS_DIR2_DATA_FIRSTDB(mp)	\
 	XFS_DIR2_BYTE_TO_DB(mp, XFS_DIR2_DATA_OFFSET)
 
 /*
  * Offsets of . and .. in data space (always block 0)
  */
-#define XFS_DIR2_DATA_DOT_OFFSET	\
+#define	XFS_DIR2_DATA_DOT_OFFSET	\
 	((xfs_dir2_data_aoff_t)sizeof(xfs_dir2_data_hdr_t))
-#define XFS_DIR2_DATA_DOTDOT_OFFSET	\
+#define	XFS_DIR2_DATA_DOTDOT_OFFSET	\
 	(XFS_DIR2_DATA_DOT_OFFSET + XFS_DIR2_DATA_ENTSIZE(1))
-#define XFS_DIR2_DATA_FIRST_OFFSET		\
+#define	XFS_DIR2_DATA_FIRST_OFFSET		\
 	(XFS_DIR2_DATA_DOTDOT_OFFSET + XFS_DIR2_DATA_ENTSIZE(2))
 
 /*
@@ -141,7 +141,7 @@
 int xfs_dir2_data_entsize(int n);
 #define XFS_DIR2_DATA_ENTSIZE(n)	xfs_dir2_data_entsize(n)
 #else
-#define XFS_DIR2_DATA_ENTSIZE(n)	\
+#define	XFS_DIR2_DATA_ENTSIZE(n)	\
 	((int)(roundup(offsetof(xfs_dir2_data_entry_t, name[0]) + (n) + \
 		 (uint)sizeof(xfs_dir2_data_off_t), XFS_DIR2_DATA_ALIGN)))
 #endif
@@ -151,9 +151,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATA_ENTRY_TAG_P)
 xfs_dir2_data_off_t *xfs_dir2_data_entry_tag_p(xfs_dir2_data_entry_t *dep);
-#define XFS_DIR2_DATA_ENTRY_TAG_P(dep)	xfs_dir2_data_entry_tag_p(dep)
+#define	XFS_DIR2_DATA_ENTRY_TAG_P(dep)	xfs_dir2_data_entry_tag_p(dep)
 #else
-#define XFS_DIR2_DATA_ENTRY_TAG_P(dep)	\
+#define	XFS_DIR2_DATA_ENTRY_TAG_P(dep)	\
 	((xfs_dir2_data_off_t *)\
 	 ((char *)(dep) + XFS_DIR2_DATA_ENTSIZE((dep)->namelen) - \
 	  (uint)sizeof(xfs_dir2_data_off_t)))
@@ -165,10 +165,10 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATA_UNUSED_TAG_P)
 xfs_dir2_data_off_t *xfs_dir2_data_unused_tag_p_arch(
 	xfs_dir2_data_unused_t *dup, xfs_arch_t arch);
-#define XFS_DIR2_DATA_UNUSED_TAG_P_ARCH(dup,arch) \
+#define	XFS_DIR2_DATA_UNUSED_TAG_P_ARCH(dup,arch) \
 	xfs_dir2_data_unused_tag_p_arch(dup,arch)
 #else
-#define XFS_DIR2_DATA_UNUSED_TAG_P_ARCH(dup,arch)	\
+#define	XFS_DIR2_DATA_UNUSED_TAG_P_ARCH(dup,arch)	\
 	((xfs_dir2_data_off_t *)\
 	 ((char *)(dup) + INT_GET((dup)->length, arch) \
 			- (uint)sizeof(xfs_dir2_data_off_t)))
@@ -182,7 +182,7 @@
 extern void
 	xfs_dir2_data_check(struct xfs_inode *dp, struct xfs_dabuf *bp);
 #else
-#define xfs_dir2_data_check(dp,bp)
+#define	xfs_dir2_data_check(dp,bp)
 #endif
 
 extern xfs_dir2_data_free_t *
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_leaf.c linux-2.5.68-bk12/fs/xfs/xfs_dir2_leaf.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_leaf.c	2003-04-19 19:49:25.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_leaf.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -38,7 +38,34 @@
  * XFS_DIR2_LEAF1 block containing the hash table and freespace map.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir2_data.h"
+#include "xfs_dir2_leaf.h"
+#include "xfs_dir2_block.h"
+#include "xfs_dir2_node.h"
+#include "xfs_dir2_trace.h"
+#include "xfs_error.h"
+#include "xfs_bit.h"
 
 /*
  * Local function declarations.
@@ -46,7 +73,7 @@
 #ifdef DEBUG
 static void xfs_dir2_leaf_check(xfs_inode_t *dp, xfs_dabuf_t *bp);
 #else
-#define xfs_dir2_leaf_check(dp, bp)
+#define	xfs_dir2_leaf_check(dp, bp)
 #endif
 static int xfs_dir2_leaf_lookup_int(xfs_da_args_t *args, xfs_dabuf_t **lbpp,
 				    int *indexp, xfs_dabuf_t **dbpp);
@@ -593,7 +620,7 @@
 	xfs_dabuf_t	*bp)		/* leaf buffer */
 {
 	int		from;		/* source leaf index */
-	xfs_dir2_leaf_t *leaf;		/* leaf structure */
+	xfs_dir2_leaf_t	*leaf;		/* leaf structure */
 	int		loglow;		/* first leaf entry to log */
 	int		to;		/* target leaf index */
 
@@ -649,7 +676,7 @@
 	int		highstale;	/* stale entry at/after index */
 	int		index;		/* insertion index */
 	int		keepstale;	/* source index of kept stale */
-	xfs_dir2_leaf_t *leaf;		/* leaf structure */
+	xfs_dir2_leaf_t	*leaf;		/* leaf structure */
 	int		lowstale;	/* stale entry before index */
 	int		newindex=0;	/* new insertion index */
 	int		to;		/* destination copy index */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_leaf.h linux-2.5.68-bk12/fs/xfs/xfs_dir2_leaf.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_leaf.h	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_leaf.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DIR2_LEAF_H__
-#define __XFS_DIR2_LEAF_H__
+#define	__XFS_DIR2_LEAF_H__
 
 /*
  * Directory version 2, leaf block structures.
@@ -51,9 +51,9 @@
  * Offset of the leaf/node space.  First block in this space
  * is the btree root.
  */
-#define XFS_DIR2_LEAF_SPACE	1
-#define XFS_DIR2_LEAF_OFFSET	(XFS_DIR2_LEAF_SPACE * XFS_DIR2_SPACE_SIZE)
-#define XFS_DIR2_LEAF_FIRSTDB(mp)	\
+#define	XFS_DIR2_LEAF_SPACE	1
+#define	XFS_DIR2_LEAF_OFFSET	(XFS_DIR2_LEAF_SPACE * XFS_DIR2_SPACE_SIZE)
+#define	XFS_DIR2_LEAF_FIRSTDB(mp)	\
 	XFS_DIR2_BYTE_TO_DB(mp, XFS_DIR2_LEAF_OFFSET)
 
 /*
@@ -63,9 +63,9 @@
 /*
  * Offset in data space of a data entry.
  */
-typedef __uint32_t	xfs_dir2_dataptr_t;
-#define XFS_DIR2_MAX_DATAPTR	((xfs_dir2_dataptr_t)0x7fffffff)
-#define XFS_DIR2_NULL_DATAPTR	((xfs_dir2_dataptr_t)0)
+typedef	__uint32_t	xfs_dir2_dataptr_t;
+#define	XFS_DIR2_MAX_DATAPTR	((xfs_dir2_dataptr_t)0x7fffffff)
+#define	XFS_DIR2_NULL_DATAPTR	((xfs_dir2_dataptr_t)0)
 
 /*
  * Structures.
@@ -116,10 +116,10 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_MAX_LEAF_ENTS)
 int
 xfs_dir2_max_leaf_ents(struct xfs_mount *mp);
-#define XFS_DIR2_MAX_LEAF_ENTS(mp)	\
+#define	XFS_DIR2_MAX_LEAF_ENTS(mp)	\
 	xfs_dir2_max_leaf_ents(mp)
 #else
-#define XFS_DIR2_MAX_LEAF_ENTS(mp)	\
+#define	XFS_DIR2_MAX_LEAF_ENTS(mp)	\
 	((int)(((mp)->m_dirblksize - (uint)sizeof(xfs_dir2_leaf_hdr_t)) / \
 	       (uint)sizeof(xfs_dir2_leaf_entry_t)))
 #endif
@@ -130,10 +130,10 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_LEAF_TAIL_P)
 xfs_dir2_leaf_tail_t *
 xfs_dir2_leaf_tail_p(struct xfs_mount *mp, xfs_dir2_leaf_t *lp);
-#define XFS_DIR2_LEAF_TAIL_P(mp,lp)	\
+#define	XFS_DIR2_LEAF_TAIL_P(mp,lp)	\
 	xfs_dir2_leaf_tail_p(mp, lp)
 #else
-#define XFS_DIR2_LEAF_TAIL_P(mp,lp)	\
+#define	XFS_DIR2_LEAF_TAIL_P(mp,lp)	\
 	((xfs_dir2_leaf_tail_t *)\
 	 ((char *)(lp) + (mp)->m_dirblksize - \
 	  (uint)sizeof(xfs_dir2_leaf_tail_t)))
@@ -145,9 +145,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_LEAF_BESTS_P)
 xfs_dir2_data_off_t *
 xfs_dir2_leaf_bests_p_arch(xfs_dir2_leaf_tail_t *ltp, xfs_arch_t arch);
-#define XFS_DIR2_LEAF_BESTS_P_ARCH(ltp,arch)	xfs_dir2_leaf_bests_p_arch(ltp,arch)
+#define	XFS_DIR2_LEAF_BESTS_P_ARCH(ltp,arch)	xfs_dir2_leaf_bests_p_arch(ltp,arch)
 #else
-#define XFS_DIR2_LEAF_BESTS_P_ARCH(ltp,arch)	\
+#define	XFS_DIR2_LEAF_BESTS_P_ARCH(ltp,arch)	\
 	((xfs_dir2_data_off_t *)(ltp) - INT_GET((ltp)->bestcount, arch))
 #endif
 
@@ -157,9 +157,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATAPTR_TO_BYTE)
 xfs_dir2_off_t
 xfs_dir2_dataptr_to_byte(struct xfs_mount *mp, xfs_dir2_dataptr_t dp);
-#define XFS_DIR2_DATAPTR_TO_BYTE(mp,dp) xfs_dir2_dataptr_to_byte(mp, dp)
+#define	XFS_DIR2_DATAPTR_TO_BYTE(mp,dp)	xfs_dir2_dataptr_to_byte(mp, dp)
 #else
-#define XFS_DIR2_DATAPTR_TO_BYTE(mp,dp) \
+#define	XFS_DIR2_DATAPTR_TO_BYTE(mp,dp)	\
 	((xfs_dir2_off_t)(dp) << XFS_DIR2_DATA_ALIGN_LOG)
 #endif
 
@@ -169,9 +169,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BYTE_TO_DATAPTR)
 xfs_dir2_dataptr_t
 xfs_dir2_byte_to_dataptr(struct xfs_mount *mp, xfs_dir2_off_t by);
-#define XFS_DIR2_BYTE_TO_DATAPTR(mp,by) xfs_dir2_byte_to_dataptr(mp,by)
+#define	XFS_DIR2_BYTE_TO_DATAPTR(mp,by)	xfs_dir2_byte_to_dataptr(mp,by)
 #else
-#define XFS_DIR2_BYTE_TO_DATAPTR(mp,by) \
+#define	XFS_DIR2_BYTE_TO_DATAPTR(mp,by)	\
 	((xfs_dir2_dataptr_t)((by) >> XFS_DIR2_DATA_ALIGN_LOG))
 #endif
 
@@ -181,9 +181,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATAPTR_TO_DB)
 xfs_dir2_db_t
 xfs_dir2_dataptr_to_db(struct xfs_mount *mp, xfs_dir2_dataptr_t dp);
-#define XFS_DIR2_DATAPTR_TO_DB(mp,dp)	xfs_dir2_dataptr_to_db(mp, dp)
+#define	XFS_DIR2_DATAPTR_TO_DB(mp,dp)	xfs_dir2_dataptr_to_db(mp, dp)
 #else
-#define XFS_DIR2_DATAPTR_TO_DB(mp,dp)	\
+#define	XFS_DIR2_DATAPTR_TO_DB(mp,dp)	\
 	XFS_DIR2_BYTE_TO_DB(mp, XFS_DIR2_DATAPTR_TO_BYTE(mp, dp))
 #endif
 
@@ -193,9 +193,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATAPTR_TO_OFF)
 xfs_dir2_data_aoff_t
 xfs_dir2_dataptr_to_off(struct xfs_mount *mp, xfs_dir2_dataptr_t dp);
-#define XFS_DIR2_DATAPTR_TO_OFF(mp,dp)	xfs_dir2_dataptr_to_off(mp, dp)
+#define	XFS_DIR2_DATAPTR_TO_OFF(mp,dp)	xfs_dir2_dataptr_to_off(mp, dp)
 #else
-#define XFS_DIR2_DATAPTR_TO_OFF(mp,dp)	\
+#define	XFS_DIR2_DATAPTR_TO_OFF(mp,dp)	\
 	XFS_DIR2_BYTE_TO_OFF(mp, XFS_DIR2_DATAPTR_TO_BYTE(mp, dp))
 #endif
 
@@ -206,10 +206,10 @@
 xfs_dir2_off_t
 xfs_dir2_db_off_to_byte(struct xfs_mount *mp, xfs_dir2_db_t db,
 			xfs_dir2_data_aoff_t o);
-#define XFS_DIR2_DB_OFF_TO_BYTE(mp,db,o)	\
+#define	XFS_DIR2_DB_OFF_TO_BYTE(mp,db,o)	\
 	xfs_dir2_db_off_to_byte(mp, db, o)
 #else
-#define XFS_DIR2_DB_OFF_TO_BYTE(mp,db,o)	\
+#define	XFS_DIR2_DB_OFF_TO_BYTE(mp,db,o)	\
 	(((xfs_dir2_off_t)(db) << \
 	 ((mp)->m_sb.sb_blocklog + (mp)->m_sb.sb_dirblklog)) + (o))
 #endif
@@ -219,9 +219,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BYTE_TO_DB)
 xfs_dir2_db_t xfs_dir2_byte_to_db(struct xfs_mount *mp, xfs_dir2_off_t by);
-#define XFS_DIR2_BYTE_TO_DB(mp,by)	xfs_dir2_byte_to_db(mp, by)
+#define	XFS_DIR2_BYTE_TO_DB(mp,by)	xfs_dir2_byte_to_db(mp, by)
 #else
-#define XFS_DIR2_BYTE_TO_DB(mp,by)	\
+#define	XFS_DIR2_BYTE_TO_DB(mp,by)	\
 	((xfs_dir2_db_t)((by) >> \
 			 ((mp)->m_sb.sb_blocklog + (mp)->m_sb.sb_dirblklog)))
 #endif
@@ -231,9 +231,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BYTE_TO_DA)
 xfs_dablk_t xfs_dir2_byte_to_da(struct xfs_mount *mp, xfs_dir2_off_t by);
-#define XFS_DIR2_BYTE_TO_DA(mp,by)	xfs_dir2_byte_to_da(mp, by)
+#define	XFS_DIR2_BYTE_TO_DA(mp,by)	xfs_dir2_byte_to_da(mp, by)
 #else
-#define XFS_DIR2_BYTE_TO_DA(mp,by)	\
+#define	XFS_DIR2_BYTE_TO_DA(mp,by)	\
 	XFS_DIR2_DB_TO_DA(mp, XFS_DIR2_BYTE_TO_DB(mp, by))
 #endif
 
@@ -243,9 +243,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_BYTE_TO_OFF)
 xfs_dir2_data_aoff_t
 xfs_dir2_byte_to_off(struct xfs_mount *mp, xfs_dir2_off_t by);
-#define XFS_DIR2_BYTE_TO_OFF(mp,by)	xfs_dir2_byte_to_off(mp, by)
+#define	XFS_DIR2_BYTE_TO_OFF(mp,by)	xfs_dir2_byte_to_off(mp, by)
 #else
-#define XFS_DIR2_BYTE_TO_OFF(mp,by)	\
+#define	XFS_DIR2_BYTE_TO_OFF(mp,by)	\
 	((xfs_dir2_data_aoff_t)((by) & \
 				((1 << ((mp)->m_sb.sb_blocklog + \
 					(mp)->m_sb.sb_dirblklog)) - 1)))
@@ -258,10 +258,10 @@
 xfs_dir2_dataptr_t
 xfs_dir2_db_off_to_dataptr(struct xfs_mount *mp, xfs_dir2_db_t db,
 			   xfs_dir2_data_aoff_t o);
-#define XFS_DIR2_DB_OFF_TO_DATAPTR(mp,db,o)	\
+#define	XFS_DIR2_DB_OFF_TO_DATAPTR(mp,db,o)	\
 	xfs_dir2_db_off_to_dataptr(mp, db, o)
 #else
-#define XFS_DIR2_DB_OFF_TO_DATAPTR(mp,db,o)	\
+#define	XFS_DIR2_DB_OFF_TO_DATAPTR(mp,db,o)	\
 	XFS_DIR2_BYTE_TO_DATAPTR(mp, XFS_DIR2_DB_OFF_TO_BYTE(mp, db, o))
 #endif
 
@@ -270,9 +270,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DB_TO_DA)
 xfs_dablk_t xfs_dir2_db_to_da(struct xfs_mount *mp, xfs_dir2_db_t db);
-#define XFS_DIR2_DB_TO_DA(mp,db)	xfs_dir2_db_to_da(mp, db)
+#define	XFS_DIR2_DB_TO_DA(mp,db)	xfs_dir2_db_to_da(mp, db)
 #else
-#define XFS_DIR2_DB_TO_DA(mp,db)	\
+#define	XFS_DIR2_DB_TO_DA(mp,db)	\
 	((xfs_dablk_t)((db) << (mp)->m_sb.sb_dirblklog))
 #endif
 
@@ -281,9 +281,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DA_TO_DB)
 xfs_dir2_db_t xfs_dir2_da_to_db(struct xfs_mount *mp, xfs_dablk_t da);
-#define XFS_DIR2_DA_TO_DB(mp,da)	xfs_dir2_da_to_db(mp, da)
+#define	XFS_DIR2_DA_TO_DB(mp,da)	xfs_dir2_da_to_db(mp, da)
 #else
-#define XFS_DIR2_DA_TO_DB(mp,da)	\
+#define	XFS_DIR2_DA_TO_DB(mp,da)	\
 	((xfs_dir2_db_t)((da) >> (mp)->m_sb.sb_dirblklog))
 #endif
 
@@ -294,7 +294,7 @@
 xfs_dir2_off_t xfs_dir2_da_to_byte(struct xfs_mount *mp, xfs_dablk_t da);
 #define XFS_DIR2_DA_TO_BYTE(mp,da)	xfs_dir2_da_to_byte(mp, da)
 #else
-#define XFS_DIR2_DA_TO_BYTE(mp,da)	\
+#define	XFS_DIR2_DA_TO_BYTE(mp,da)	\
 	XFS_DIR2_DB_OFF_TO_BYTE(mp, XFS_DIR2_DA_TO_DB(mp, da), 0)
 #endif
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_node.c linux-2.5.68-bk12/fs/xfs/xfs_dir2_node.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_node.c	2003-04-19 19:48:46.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_node.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -36,7 +36,32 @@
  * See data structures in xfs_dir2_node.h and xfs_da_btree.h.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir2_data.h"
+#include "xfs_dir2_leaf.h"
+#include "xfs_dir2_block.h"
+#include "xfs_dir2_node.h"
+#include "xfs_dir2_trace.h"
+#include "xfs_error.h"
 
 /*
  * Function declarations.
@@ -46,7 +71,7 @@
 #ifdef DEBUG
 static void xfs_dir2_leafn_check(xfs_inode_t *dp, xfs_dabuf_t *bp);
 #else
-#define xfs_dir2_leafn_check(dp, bp)
+#define	xfs_dir2_leafn_check(dp, bp)
 #endif
 static void xfs_dir2_leafn_moveents(xfs_da_args_t *args, xfs_dabuf_t *bp_s,
 				    int start_s, xfs_dabuf_t *bp_d, int start_d,
@@ -334,7 +359,7 @@
 	xfs_dabuf_t	*bp)			/* leaf buffer */
 {
 	int		i;			/* leaf index */
-	xfs_dir2_leaf_t *leaf;			/* leaf structure */
+	xfs_dir2_leaf_t	*leaf;			/* leaf structure */
 	xfs_mount_t	*mp;			/* filesystem mount point */
 	int		stale;			/* count of stale leaves */
 
@@ -363,7 +388,7 @@
 	xfs_dabuf_t	*bp,			/* leaf buffer */
 	int		*count)			/* count of entries in leaf */
 {
-	xfs_dir2_leaf_t *leaf;			/* leaf structure */
+	xfs_dir2_leaf_t	*leaf;			/* leaf structure */
 
 	leaf = bp->data;
 	ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC);
@@ -624,8 +649,8 @@
 	int		start_d,		/* destination leaf index */
 	int		count)			/* count of leaves to copy */
 {
-	xfs_dir2_leaf_t *leaf_d;		/* destination leaf structure */
-	xfs_dir2_leaf_t *leaf_s;		/* source leaf structure */
+	xfs_dir2_leaf_t	*leaf_d;		/* destination leaf structure */
+	xfs_dir2_leaf_t	*leaf_s;		/* source leaf structure */
 	int		stale;			/* count stale leaves copied */
 	xfs_trans_t	*tp;			/* transaction pointer */
 
@@ -702,8 +727,8 @@
 	xfs_dabuf_t	*leaf1_bp,		/* leaf1 buffer */
 	xfs_dabuf_t	*leaf2_bp)		/* leaf2 buffer */
 {
-	xfs_dir2_leaf_t *leaf1;			/* leaf1 structure */
-	xfs_dir2_leaf_t *leaf2;			/* leaf2 structure */
+	xfs_dir2_leaf_t	*leaf1;			/* leaf1 structure */
+	xfs_dir2_leaf_t	*leaf2;			/* leaf2 structure */
 
 	leaf1 = leaf1_bp->data;
 	leaf2 = leaf2_bp->data;
@@ -782,7 +807,7 @@
 	else
 		isleft = 1;
 	/*
-	 * Calculate moved entry count.	 Positive means left-to-right,
+	 * Calculate moved entry count.  Positive means left-to-right,
 	 * negative means right-to-left.  Then move the entries.
 	 */
 	count = INT_GET(leaf1->hdr.count, ARCH_CONVERT) - mid + (isleft == 0);
@@ -892,7 +917,7 @@
 		xfs_dabuf_t	*fbp;		/* freeblock buffer */
 		xfs_dir2_db_t	fdb;		/* freeblock block number */
 		int		findex;		/* index in freeblock entries */
-		xfs_dir2_free_t *free;		/* freeblock structure */
+		xfs_dir2_free_t	*free;		/* freeblock structure */
 		int		logfree;	/* need to log free entry */
 
 		/*
@@ -1368,7 +1393,7 @@
 	foundhole = 0;
 	/*
 	 * If we came in with a freespace block that means that lookup
-	 * found an entry with our hash value.	This is the freespace
+	 * found an entry with our hash value.  This is the freespace
 	 * block for that data entry.
 	 */
 	if (fblk) {
@@ -1424,7 +1449,7 @@
 	}
 	/*
 	 * While we haven't identified a data block, search the freeblock
-	 * data for a good data block.	If we find a null freeblock entry,
+	 * data for a good data block.  If we find a null freeblock entry,
 	 * indicating a hole in the data blocks, remember that.
 	 */
 	while (dbno == -1) {
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_node.h linux-2.5.68-bk12/fs/xfs/xfs_dir2_node.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_node.h	2003-04-19 19:51:12.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_node.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DIR2_NODE_H__
-#define __XFS_DIR2_NODE_H__
+#define	__XFS_DIR2_NODE_H__
 
 /*
  * Directory version 2, btree node format structures
@@ -51,17 +51,17 @@
 /*
  * Offset of the freespace index.
  */
-#define XFS_DIR2_FREE_SPACE	2
-#define XFS_DIR2_FREE_OFFSET	(XFS_DIR2_FREE_SPACE * XFS_DIR2_SPACE_SIZE)
-#define XFS_DIR2_FREE_FIRSTDB(mp)	\
+#define	XFS_DIR2_FREE_SPACE	2
+#define	XFS_DIR2_FREE_OFFSET	(XFS_DIR2_FREE_SPACE * XFS_DIR2_SPACE_SIZE)
+#define	XFS_DIR2_FREE_FIRSTDB(mp)	\
 	XFS_DIR2_BYTE_TO_DB(mp, XFS_DIR2_FREE_OFFSET)
 
-#define XFS_DIR2_FREE_MAGIC	0x58443246	/* XD2F */
+#define	XFS_DIR2_FREE_MAGIC	0x58443246	/* XD2F */
 
 /*
  * Structures.
  */
-typedef struct xfs_dir2_free_hdr {
+typedef	struct xfs_dir2_free_hdr {
 	__uint32_t		magic;		/* XFS_DIR2_FREE_MAGIC */
 	__int32_t		firstdb;	/* db of first entry */
 	__int32_t		nvalid;		/* count of valid entries */
@@ -73,7 +73,7 @@
 	xfs_dir2_data_off_t	bests[1];	/* best free counts */
 						/* unused entries are -1 */
 } xfs_dir2_free_t;
-#define XFS_DIR2_MAX_FREE_BESTS(mp)	\
+#define	XFS_DIR2_MAX_FREE_BESTS(mp)	\
 	(((mp)->m_dirblksize - (uint)sizeof(xfs_dir2_free_hdr_t)) / \
 	 (uint)sizeof(xfs_dir2_data_off_t))
 
@@ -87,9 +87,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DB_TO_FDB)
 xfs_dir2_db_t
 xfs_dir2_db_to_fdb(struct xfs_mount *mp, xfs_dir2_db_t db);
-#define XFS_DIR2_DB_TO_FDB(mp,db)	xfs_dir2_db_to_fdb(mp, db)
+#define	XFS_DIR2_DB_TO_FDB(mp,db)	xfs_dir2_db_to_fdb(mp, db)
 #else
-#define XFS_DIR2_DB_TO_FDB(mp,db)	\
+#define	XFS_DIR2_DB_TO_FDB(mp,db)	\
 	(XFS_DIR2_FREE_FIRSTDB(mp) + (db) / XFS_DIR2_MAX_FREE_BESTS(mp))
 #endif
 
@@ -99,9 +99,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DB_TO_FDINDEX)
 int
 xfs_dir2_db_to_fdindex(struct xfs_mount *mp, xfs_dir2_db_t db);
-#define XFS_DIR2_DB_TO_FDINDEX(mp,db)	xfs_dir2_db_to_fdindex(mp, db)
+#define	XFS_DIR2_DB_TO_FDINDEX(mp,db)	xfs_dir2_db_to_fdindex(mp, db)
 #else
-#define XFS_DIR2_DB_TO_FDINDEX(mp,db)	((db) % XFS_DIR2_MAX_FREE_BESTS(mp))
+#define	XFS_DIR2_DB_TO_FDINDEX(mp,db)	((db) % XFS_DIR2_MAX_FREE_BESTS(mp))
 #endif
 
 /*
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_sf.c linux-2.5.68-bk12/fs/xfs/xfs_dir2_sf.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_sf.c	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_sf.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -35,7 +35,32 @@
  * Shortform directory implementation for v2 directories.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_error.h"
+#include "xfs_dir2_data.h"
+#include "xfs_dir2_leaf.h"
+#include "xfs_dir2_block.h"
+#include "xfs_dir2_trace.h"
 
 /*
  * Prototypes for internal functions.
@@ -52,7 +77,7 @@
 #ifdef DEBUG
 static void xfs_dir2_sf_check(xfs_da_args_t *args);
 #else
-#define xfs_dir2_sf_check(args)
+#define	xfs_dir2_sf_check(args)
 #endif /* DEBUG */
 #if XFS_BIG_FILESYSTEMS
 static void xfs_dir2_sf_toino4(xfs_da_args_t *args);
@@ -165,7 +190,7 @@
 	char			*ptr;		/* current data pointer */
 	xfs_dir2_sf_entry_t	*sfep;		/* shortform entry */
 	xfs_dir2_sf_t		*sfp;		/* shortform structure */
-	xfs_ino_t		temp;
+	xfs_ino_t               temp;
 
 	xfs_dir2_trace_args_sb("block_to_sf", args, size, bp);
 	dp = args->dp;
@@ -477,7 +502,7 @@
 	}
 	/*
 	 * Get rid of the old directory, then allocate space for
-	 * the new one.	 We do this so xfs_idata_realloc won't copy
+	 * the new one.  We do this so xfs_idata_realloc won't copy
 	 * the data.
 	 */
 	xfs_idata_realloc(dp, -old_isize, XFS_DATA_FORK);
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_sf.h linux-2.5.68-bk12/fs/xfs/xfs_dir2_sf.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_sf.h	2003-04-19 19:48:53.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_sf.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DIR2_SF_H__
-#define __XFS_DIR2_SF_H__
+#define	__XFS_DIR2_SF_H__
 
 /*
  * Directory layout when stored internal to an inode.
@@ -50,18 +50,18 @@
 /*
  * Maximum size of a shortform directory.
  */
-#define XFS_DIR2_SF_MAX_SIZE	\
+#define	XFS_DIR2_SF_MAX_SIZE	\
 	(XFS_DINODE_MAX_SIZE - (uint)sizeof(xfs_dinode_core_t) - \
 	 (uint)sizeof(xfs_agino_t))
 
 /*
  * Inode number stored as 8 8-bit values.
  */
-typedef struct { __uint8_t i[8]; } xfs_dir2_ino8_t;
+typedef	struct { __uint8_t i[8]; } xfs_dir2_ino8_t;
 
-#define XFS_DIR2_SF_GET_INO8_ARCH(di,arch)	\
+#define	XFS_DIR2_SF_GET_INO8_ARCH(di,arch)	\
 	(xfs_ino_t)(DIRINO_GET_ARCH(&di,arch))
-#define XFS_DIR2_SF_GET_INO8(di)		\
+#define	XFS_DIR2_SF_GET_INO8(di)	        \
 	XFS_DIR2_SF_GET_INO8_ARCH(di,ARCH_NOCONVERT)
 
 /*
@@ -70,16 +70,16 @@
  * fit in 32 bits.
  */
 typedef struct { __uint8_t i[4]; } xfs_dir2_ino4_t;
-#define XFS_DIR2_SF_GET_INO4_ARCH(di,arch)	\
+#define	XFS_DIR2_SF_GET_INO4_ARCH(di,arch)	\
 	(xfs_ino_t)(DIRINO4_GET_ARCH(&di,arch))
-#define XFS_DIR2_SF_GET_INO4(di)		\
+#define	XFS_DIR2_SF_GET_INO4(di)	        \
 	XFS_DIR2_SF_GET_INO4_ARCH(di,ARCH_NOCONVERT)
 
 typedef union {
-	xfs_dir2_ino8_t i8;
-	xfs_dir2_ino4_t i4;
+	xfs_dir2_ino8_t	i8;
+	xfs_dir2_ino4_t	i4;
 } xfs_dir2_inou_t;
-#define XFS_DIR2_MAX_SHORT_INUM ((xfs_ino_t)0xffffffffULL)
+#define	XFS_DIR2_MAX_SHORT_INUM	((xfs_ino_t)0xffffffffULL)
 
 /*
  * Normalized offset (in a data block) of the entry, really xfs_dir2_data_off_t.
@@ -115,9 +115,9 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_HDR_SIZE)
 int xfs_dir2_sf_hdr_size(int i8count);
-#define XFS_DIR2_SF_HDR_SIZE(i8count)	xfs_dir2_sf_hdr_size(i8count)
+#define	XFS_DIR2_SF_HDR_SIZE(i8count)	xfs_dir2_sf_hdr_size(i8count)
 #else
-#define XFS_DIR2_SF_HDR_SIZE(i8count)	\
+#define	XFS_DIR2_SF_HDR_SIZE(i8count)	\
 	((uint)sizeof(xfs_dir2_sf_hdr_t) - \
 	 ((i8count) == 0) * \
 	 ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)))
@@ -125,20 +125,20 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_INUMBERP)
 xfs_dir2_inou_t *xfs_dir2_sf_inumberp(xfs_dir2_sf_entry_t *sfep);
-#define XFS_DIR2_SF_INUMBERP(sfep)	xfs_dir2_sf_inumberp(sfep)
+#define	XFS_DIR2_SF_INUMBERP(sfep)	xfs_dir2_sf_inumberp(sfep)
 #else
-#define XFS_DIR2_SF_INUMBERP(sfep)	\
+#define	XFS_DIR2_SF_INUMBERP(sfep)	\
 	((xfs_dir2_inou_t *)&(sfep)->name[(sfep)->namelen])
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_GET_INUMBER)
 xfs_intino_t xfs_dir2_sf_get_inumber_arch(xfs_dir2_sf_t *sfp, xfs_dir2_inou_t *from,
 					    xfs_arch_t arch);
-#define XFS_DIR2_SF_GET_INUMBER_ARCH(sfp, from, arch)	\
+#define	XFS_DIR2_SF_GET_INUMBER_ARCH(sfp, from, arch)	\
 	xfs_dir2_sf_get_inumber_arch(sfp, from, arch)
 
 #else
-#define XFS_DIR2_SF_GET_INUMBER_ARCH(sfp, from, arch)	\
+#define	XFS_DIR2_SF_GET_INUMBER_ARCH(sfp, from, arch)	\
 	((sfp)->hdr.i8count == 0 ? \
 		(xfs_intino_t)XFS_DIR2_SF_GET_INO4_ARCH(*(from), arch) : \
 		(xfs_intino_t)XFS_DIR2_SF_GET_INO8_ARCH(*(from), arch))
@@ -147,10 +147,10 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_PUT_INUMBER)
 void xfs_dir2_sf_put_inumber_arch(xfs_dir2_sf_t *sfp, xfs_ino_t *from,
 				     xfs_dir2_inou_t *to, xfs_arch_t arch);
-#define XFS_DIR2_SF_PUT_INUMBER_ARCH(sfp,from,to,arch)	\
+#define	XFS_DIR2_SF_PUT_INUMBER_ARCH(sfp,from,to,arch)	\
 	xfs_dir2_sf_put_inumber_arch(sfp,from,to,arch)
 #else
-#define XFS_DIR2_SF_PUT_INUMBER_ARCH(sfp,from,to,arch)	\
+#define	XFS_DIR2_SF_PUT_INUMBER_ARCH(sfp,from,to,arch)	\
 	if ((sfp)->hdr.i8count == 0) { \
 	    DIRINO4_COPY_ARCH(from,to,arch); \
 	} else { \
@@ -162,20 +162,20 @@
 xfs_dir2_data_aoff_t xfs_dir2_sf_get_offset_arch(xfs_dir2_sf_entry_t *sfep,
 						    xfs_arch_t arch);
 xfs_dir2_data_aoff_t xfs_dir2_sf_get_offset(xfs_dir2_sf_entry_t *sfep);
-#define XFS_DIR2_SF_GET_OFFSET_ARCH(sfep,arch)	\
+#define	XFS_DIR2_SF_GET_OFFSET_ARCH(sfep,arch)	\
 	xfs_dir2_sf_get_offset_arch(sfep,arch)
 #else
-#define XFS_DIR2_SF_GET_OFFSET_ARCH(sfep,arch)	\
+#define	XFS_DIR2_SF_GET_OFFSET_ARCH(sfep,arch)	\
 	INT_GET_UNALIGNED_16_ARCH(&(sfep)->offset.i,arch)
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_PUT_OFFSET)
 void xfs_dir2_sf_put_offset_arch(xfs_dir2_sf_entry_t *sfep,
 				    xfs_dir2_data_aoff_t off, xfs_arch_t arch);
-#define XFS_DIR2_SF_PUT_OFFSET_ARCH(sfep,off,arch) \
+#define	XFS_DIR2_SF_PUT_OFFSET_ARCH(sfep,off,arch) \
 	xfs_dir2_sf_put_offset_arch(sfep,off,arch)
 #else
-#define XFS_DIR2_SF_PUT_OFFSET_ARCH(sfep,off,arch)	\
+#define	XFS_DIR2_SF_PUT_OFFSET_ARCH(sfep,off,arch)	\
 	INT_SET_UNALIGNED_16_ARCH(&(sfep)->offset.i,off,arch)
 #endif
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_trace.c linux-2.5.68-bk12/fs/xfs/xfs_dir2_trace.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_trace.c	2003-04-19 19:50:37.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_trace.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -34,8 +34,20 @@
  * xfs_dir2_trace.c
  * Tracing for xfs v2 directories.
  */
-#include <xfs.h>
+#include "xfs.h"
 
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir2_trace.h"
 
 #ifdef DEBUG
 ktrace_t	*xfs_dir2_trace_buf;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir2_trace.h linux-2.5.68-bk12/fs/xfs/xfs_dir2_trace.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir2_trace.h	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir2_trace.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -48,17 +48,17 @@
 #undef XFS_DIR2_TRACE
 #endif	/* !DEBUG */
 
-#define XFS_DIR2_GTRACE_SIZE		4096	/* global buffer */
-#define XFS_DIR2_KTRACE_SIZE		32	/* per-inode buffer */
+#define	XFS_DIR2_GTRACE_SIZE		4096	/* global buffer */
+#define	XFS_DIR2_KTRACE_SIZE		32	/* per-inode buffer */
 
-#define XFS_DIR2_KTRACE_ARGS		1	/* args only */
-#define XFS_DIR2_KTRACE_ARGS_B		2	/* args + buffer */
-#define XFS_DIR2_KTRACE_ARGS_BB		3	/* args + 2 buffers */
-#define XFS_DIR2_KTRACE_ARGS_DB		4	/* args, db, buffer */
-#define XFS_DIR2_KTRACE_ARGS_I		5	/* args, inum */
-#define XFS_DIR2_KTRACE_ARGS_S		6	/* args, int */
-#define XFS_DIR2_KTRACE_ARGS_SB		7	/* args, int, buffer */
-#define XFS_DIR2_KTRACE_ARGS_BIBII	8	/* args, buf/int/buf/int/int */
+#define	XFS_DIR2_KTRACE_ARGS		1	/* args only */
+#define	XFS_DIR2_KTRACE_ARGS_B		2	/* args + buffer */
+#define	XFS_DIR2_KTRACE_ARGS_BB		3	/* args + 2 buffers */
+#define	XFS_DIR2_KTRACE_ARGS_DB		4	/* args, db, buffer */
+#define	XFS_DIR2_KTRACE_ARGS_I		5	/* args, inum */
+#define	XFS_DIR2_KTRACE_ARGS_S		6	/* args, int */
+#define	XFS_DIR2_KTRACE_ARGS_SB		7	/* args, int, buffer */
+#define	XFS_DIR2_KTRACE_ARGS_BIBII	8	/* args, buf/int/buf/int/int */
 
 #ifdef XFS_DIR2_TRACE
 
@@ -79,14 +79,14 @@
 
 #else	/* XFS_DIR2_TRACE */
 
-#define xfs_dir2_trace_args(where, args)
-#define xfs_dir2_trace_args_b(where, args, bp)
-#define xfs_dir2_trace_args_bb(where, args, lbp, dbp)
-#define xfs_dir2_trace_args_bibii(where, args, bs, ss, bd, sd, c)
-#define xfs_dir2_trace_args_db(where, args, db, bp)
-#define xfs_dir2_trace_args_i(where, args, i)
-#define xfs_dir2_trace_args_s(where, args, s)
-#define xfs_dir2_trace_args_sb(where, args, s, bp)
+#define	xfs_dir2_trace_args(where, args)
+#define	xfs_dir2_trace_args_b(where, args, bp)
+#define	xfs_dir2_trace_args_bb(where, args, lbp, dbp)
+#define	xfs_dir2_trace_args_bibii(where, args, bs, ss, bd, sd, c)
+#define	xfs_dir2_trace_args_db(where, args, db, bp)
+#define	xfs_dir2_trace_args_i(where, args, i)
+#define	xfs_dir2_trace_args_s(where, args, s)
+#define	xfs_dir2_trace_args_sb(where, args, s, bp)
 
 #endif	/* XFS_DIR2_TRACE */
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir_leaf.c linux-2.5.68-bk12/fs/xfs/xfs_dir_leaf.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dir_leaf.c	2003-04-19 19:50:45.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir_leaf.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -36,8 +36,33 @@
  * GROT: figure out how to recover gracefully when bmap returns ENOSPC.
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_error.h"
 
 /*
  * xfs_dir_leaf.c
@@ -461,7 +486,7 @@
 		    ((char *)sfe >= ((char *)sf + dp->i_df.if_bytes)) ||
 		    (sfe->namelen >= MAXNAMELEN))) {
 			xfs_dir_trace_g_du("sf: corrupted", dp, uio);
-			XFS_CORRUPTION_ERROR("xfs_dir_shortform_getdents", 
+			XFS_CORRUPTION_ERROR("xfs_dir_shortform_getdents",
 					     XFS_ERRLEVEL_LOW, mp, sfe);
 			kmem_free(sbuf, sbsize);
 			return XFS_ERROR(EFSCORRUPTED);
@@ -924,7 +949,7 @@
 		return(error);
 	/*
 	 * After compaction, the block is guaranteed to have only one
-	 * free region, in freemap[0].	If it is not big enough, give up.
+	 * free region, in freemap[0].  If it is not big enough, give up.
 	 */
 	if (INT_GET(hdr->freemap[0].size, ARCH_CONVERT) <
 	    (entsize + (uint)sizeof(xfs_dir_leaf_entry_t)))
@@ -1649,7 +1674,7 @@
 		memset(tmpbuffer, 0, state->blocksize);
 		tmp_leaf = (xfs_dir_leafblock_t *)tmpbuffer;
 		tmp_hdr = &tmp_leaf->hdr;
-		tmp_hdr->info = save_hdr->info; /* struct copy */
+		tmp_hdr->info = save_hdr->info;	/* struct copy */
 		INT_ZERO(tmp_hdr->count, ARCH_CONVERT);
 		INT_SET(tmp_hdr->firstused, ARCH_CONVERT, state->blocksize);
 		if (INT_ISZERO(tmp_hdr->firstused, ARCH_CONVERT))
@@ -1978,7 +2003,7 @@
 		    ((char *)namest < (char *)leaf) ||
 		    ((char *)namest >= (char *)leaf + XFS_LBSIZE(mp)) ||
 		    (entry->namelen >= MAXNAMELEN))) {
-			XFS_CORRUPTION_ERROR("xfs_dir_leaf_getdents_int(1)", 
+			XFS_CORRUPTION_ERROR("xfs_dir_leaf_getdents_int(1)",
 					     XFS_ERRLEVEL_LOW, mp, leaf);
 			xfs_dir_trace_g_du("leaf: corrupted", dp, uio);
 			return XFS_ERROR(EFSCORRUPTED);
@@ -2121,7 +2146,7 @@
 		 * of same hashval entries.   For this, lastoffset is set
 		 * to the first in the run of equal hashvals so we don't
 		 * include any entries unless we can include all entries
-		 * that share the same hashval.	 Hopefully the buffer
+		 * that share the same hashval.  Hopefully the buffer
 		 * provided is big enough to handle it (see pv763517).
 		 */
 #if (BITS_PER_LONG == 32)
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir_leaf.h linux-2.5.68-bk12/fs/xfs/xfs_dir_leaf.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir_leaf.h	2003-04-19 19:48:57.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir_leaf.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DIR_LEAF_H__
-#define __XFS_DIR_LEAF_H__
+#define	__XFS_DIR_LEAF_H__
 
 /*
  * Directory layout, internal structure, access macros, etc.
@@ -38,7 +38,7 @@
  * Large directories are structured around Btrees where all the data
  * elements are in the leaf nodes.  Filenames are hashed into an int,
  * then that int is used as the index into the Btree.  Since the hashval
- * of a filename may not be unique, we may have duplicate keys.	 The
+ * of a filename may not be unique, we may have duplicate keys.  The
  * internal links in the Btree are logical block offsets into the file.
  */
 
@@ -60,8 +60,8 @@
 /*
  * This is the structure of the leaf nodes in the Btree.
  *
- * Struct leaf_entry's are packed from the top.	 Names grow from the bottom
- * but are not packed.	The freemap contains run-length-encoded entries
+ * Struct leaf_entry's are packed from the top.  Names grow from the bottom
+ * but are not packed.  The freemap contains run-length-encoded entries
  * for the free bytes after the leaf_entry's, but only the N largest such,
  * smaller runs are dropped.  When the freemap doesn't show enough space
  * for an allocation, we compact the namelist area and try again.  If we
@@ -114,7 +114,7 @@
  * Length of name for which a 512-byte block filesystem
  * can get a double split.
  */
-#define XFS_DIR_LEAF_CAN_DOUBLE_SPLIT_LEN	\
+#define	XFS_DIR_LEAF_CAN_DOUBLE_SPLIT_LEN	\
 	(512 - (uint)sizeof(xfs_dir_leaf_hdr_t) - \
 	 (uint)sizeof(xfs_dir_leaf_entry_t) * 2 - \
 	 (uint)sizeof(xfs_dir_leaf_name_t) * 2 - (MAXNAMELEN - 2) + 1 + 1)
@@ -137,12 +137,12 @@
 	} s;
 } xfs_dircook_t;
 
-#define XFS_PUT_COOKIE(c,mp,bno,entry,hash)	\
+#define	XFS_PUT_COOKIE(c,mp,bno,entry,hash)	\
 	((c).s.be = XFS_DA_MAKE_BNOENTRY(mp, bno, entry), (c).s.h = (hash))
 
-#define XFS_GET_DIR_INO_ARCH(mp,di,arch) \
+#define	XFS_GET_DIR_INO_ARCH(mp,di,arch) \
     DIRINO_GET_ARCH(&(di),arch)
-#define XFS_GET_DIR_INO(mp,di) \
+#define	XFS_GET_DIR_INO(mp,di) \
     XFS_GET_DIR_INO_ARCH(mp,di,ARCH_NOCONVERT)
 
 typedef struct xfs_dir_put_args
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dir_sf.h linux-2.5.68-bk12/fs/xfs/xfs_dir_sf.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dir_sf.h	2003-04-19 19:50:07.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dir_sf.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_DIR_SF_H__
-#define __XFS_DIR_SF_H__
+#define	__XFS_DIR_SF_H__
 
 /*
  * Directory layout when stored internal to an inode.
@@ -65,7 +65,7 @@
 
 /*
  * We generate this then sort it, so that readdirs are returned in
- * hash-order.	Else seekdir won't work.
+ * hash-order.  Else seekdir won't work.
  */
 typedef struct xfs_dir_sf_sort {
 	__uint8_t	entno;		/* .=0, ..=1, else entry# + 2 */
@@ -79,20 +79,20 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_GET_DIRINO)
 void xfs_dir_sf_get_dirino_arch(xfs_dir_ino_t *from, xfs_ino_t *to, xfs_arch_t arch);
 void xfs_dir_sf_get_dirino(xfs_dir_ino_t *from, xfs_ino_t *to);
-#define XFS_DIR_SF_GET_DIRINO_ARCH(from,to,arch)    xfs_dir_sf_get_dirino_arch(from, to, arch)
-#define XFS_DIR_SF_GET_DIRINO(from,to)		    xfs_dir_sf_get_dirino(from, to)
+#define	XFS_DIR_SF_GET_DIRINO_ARCH(from,to,arch)    xfs_dir_sf_get_dirino_arch(from, to, arch)
+#define	XFS_DIR_SF_GET_DIRINO(from,to)		    xfs_dir_sf_get_dirino(from, to)
 #else
-#define XFS_DIR_SF_GET_DIRINO_ARCH(from,to,arch)    DIRINO_COPY_ARCH(from,to,arch)
-#define XFS_DIR_SF_GET_DIRINO(from,to)		    DIRINO_COPY_ARCH(from,to,ARCH_NOCONVERT)
+#define	XFS_DIR_SF_GET_DIRINO_ARCH(from,to,arch)    DIRINO_COPY_ARCH(from,to,arch)
+#define	XFS_DIR_SF_GET_DIRINO(from,to)	            DIRINO_COPY_ARCH(from,to,ARCH_NOCONVERT)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_PUT_DIRINO)
 void xfs_dir_sf_put_dirino_arch(xfs_ino_t *from, xfs_dir_ino_t *to, xfs_arch_t arch);
 void xfs_dir_sf_put_dirino(xfs_ino_t *from, xfs_dir_ino_t *to);
-#define XFS_DIR_SF_PUT_DIRINO_ARCH(from,to,arch)    xfs_dir_sf_put_dirino_arch(from, to, arch)
-#define XFS_DIR_SF_PUT_DIRINO(from,to)		    xfs_dir_sf_put_dirino(from, to)
+#define	XFS_DIR_SF_PUT_DIRINO_ARCH(from,to,arch)    xfs_dir_sf_put_dirino_arch(from, to, arch)
+#define	XFS_DIR_SF_PUT_DIRINO(from,to)		    xfs_dir_sf_put_dirino(from, to)
 #else
-#define XFS_DIR_SF_PUT_DIRINO_ARCH(from,to,arch)    DIRINO_COPY_ARCH(from,to,arch)
-#define XFS_DIR_SF_PUT_DIRINO(from,to)		    DIRINO_COPY_ARCH(from,to,ARCH_NOCONVERT)
+#define	XFS_DIR_SF_PUT_DIRINO_ARCH(from,to,arch)    DIRINO_COPY_ARCH(from,to,arch)
+#define	XFS_DIR_SF_PUT_DIRINO(from,to)	            DIRINO_COPY_ARCH(from,to,ARCH_NOCONVERT)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_ENTSIZE_BYNAME)
 int xfs_dir_sf_entsize_byname(int len);
@@ -127,7 +127,7 @@
 #endif
 
 #ifdef XFS_ALL_TRACE
-#define XFS_DIR_TRACE
+#define	XFS_DIR_TRACE
 #endif
 
 #if !defined(DEBUG)
@@ -144,17 +144,17 @@
 struct xfs_dir_leafblock;
 struct xfs_dir_leaf_entry;
 
-#define XFS_DIR_TRACE_SIZE	4096	/* size of global trace buffer */
+#define	XFS_DIR_TRACE_SIZE	4096	/* size of global trace buffer */
 
 /*
  * Trace record types.
  */
-#define XFS_DIR_KTRACE_G_DU	1	/* dp, uio */
-#define XFS_DIR_KTRACE_G_DUB	2	/* dp, uio, bno */
-#define XFS_DIR_KTRACE_G_DUN	3	/* dp, uio, node */
-#define XFS_DIR_KTRACE_G_DUL	4	/* dp, uio, leaf */
-#define XFS_DIR_KTRACE_G_DUE	5	/* dp, uio, leaf entry */
-#define XFS_DIR_KTRACE_G_DUC	6	/* dp, uio, cookie */
+#define	XFS_DIR_KTRACE_G_DU	1	/* dp, uio */
+#define	XFS_DIR_KTRACE_G_DUB	2	/* dp, uio, bno */
+#define	XFS_DIR_KTRACE_G_DUN	3	/* dp, uio, node */
+#define	XFS_DIR_KTRACE_G_DUL	4	/* dp, uio, leaf */
+#define	XFS_DIR_KTRACE_G_DUE	5	/* dp, uio, leaf entry */
+#define	XFS_DIR_KTRACE_G_DUC	6	/* dp, uio, cookie */
 
 #if defined(XFS_DIR_TRACE)
 
@@ -177,12 +177,12 @@
 			     __psunsigned_t a8, __psunsigned_t a9,
 			     __psunsigned_t a10, __psunsigned_t a11);
 #else
-#define xfs_dir_trace_g_du(w,d,u)
-#define xfs_dir_trace_g_dub(w,d,u,b)
-#define xfs_dir_trace_g_dun(w,d,u,n)
-#define xfs_dir_trace_g_dul(w,d,u,l)
-#define xfs_dir_trace_g_due(w,d,u,e)
-#define xfs_dir_trace_g_duc(w,d,u,c)
+#define	xfs_dir_trace_g_du(w,d,u)
+#define	xfs_dir_trace_g_dub(w,d,u,b)
+#define	xfs_dir_trace_g_dun(w,d,u,n)
+#define	xfs_dir_trace_g_dul(w,d,u,l)
+#define	xfs_dir_trace_g_due(w,d,u,e)
+#define	xfs_dir_trace_g_duc(w,d,u,c)
 #endif /* DEBUG */
 
 #endif	/* __XFS_DIR_SF_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dmapi.h linux-2.5.68-bk12/fs/xfs/xfs_dmapi.h
--- linux-2.5.68-bk11/fs/xfs/xfs_dmapi.h	2003-04-19 19:51:12.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dmapi.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -35,9 +35,9 @@
 /*	Values used to define the on-disk version of dm_attrname_t. All
  *	on-disk attribute names start with the 8-byte string "SGI_DMI_".
  *
- *	In the on-disk inode, DMAPI attribute names consist of the user-provided
- *	name with the DMATTR_PREFIXSTRING pre-pended.  This string must NEVER be
- *	changed.
+ *      In the on-disk inode, DMAPI attribute names consist of the user-provided
+ *      name with the DMATTR_PREFIXSTRING pre-pended.  This string must NEVER be
+ *      changed.
  */
 
 #define DMATTR_PREFIXLEN	8
@@ -80,13 +80,13 @@
 #define HAVE_DM_RIGHT_T
 
 /* Defines for determining if an event message should be sent. */
-#define DM_EVENT_ENABLED(vfsp, ip, event) ( \
+#define	DM_EVENT_ENABLED(vfsp, ip, event) ( \
 	unlikely ((vfsp)->vfs_flag & VFS_DMI) && \
 		( ((ip)->i_d.di_dmevmask & (1 << event)) || \
 		  ((ip)->i_mount->m_dmevmask & (1 << event)) ) \
 	)
 
-#define DM_EVENT_ENABLED_IO(vfsp, io, event) ( \
+#define	DM_EVENT_ENABLED_IO(vfsp, io, event) ( \
 	unlikely ((vfsp)->vfs_flag & VFS_DMI) && \
 		( ((io)->io_dmevmask & (1 << event)) || \
 		  ((io)->io_mount->m_dmevmask & (1 << event)) ) \
@@ -111,18 +111,18 @@
 	(1 << DM_EVENT_DESTROY)		)
 
 /* Events valid in dm_set_eventlist() when called with a file handle for
-   a regular file or a symlink.	 These events are persistent.
+   a regular file or a symlink.  These events are persistent.
 */
 
-#define DM_XFS_VALID_FILE_EVENTS	( \
+#define	DM_XFS_VALID_FILE_EVENTS	( \
 	(1 << DM_EVENT_ATTRIBUTE)	| \
 	(1 << DM_EVENT_DESTROY)		)
 
 /* Events valid in dm_set_eventlist() when called with a file handle for
-   a directory.	 These events are persistent.
+   a directory.  These events are persistent.
 */
 
-#define DM_XFS_VALID_DIRECTORY_EVENTS	( \
+#define	DM_XFS_VALID_DIRECTORY_EVENTS	( \
 	(1 << DM_EVENT_CREATE)		| \
 	(1 << DM_EVENT_POSTCREATE)	| \
 	(1 << DM_EVENT_REMOVE)		| \
@@ -137,7 +137,7 @@
 	(1 << DM_EVENT_DESTROY)		)
 
 /* Events supported by the XFS filesystem. */
-#define DM_XFS_SUPPORTED_EVENTS		( \
+#define	DM_XFS_SUPPORTED_EVENTS		( \
 	(1 << DM_EVENT_MOUNT)		| \
 	(1 << DM_EVENT_PREUNMOUNT)	| \
 	(1 << DM_EVENT_UNMOUNT)		| \
@@ -189,4 +189,4 @@
 extern int dmapi_init(void);
 extern void dmapi_uninit(void);
 
-#endif	/* __XFS_DMAPI_H__ */
+#endif  /* __XFS_DMAPI_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_dmops.c linux-2.5.68-bk12/fs/xfs/xfs_dmops.c
--- linux-2.5.68-bk11/fs/xfs/xfs_dmops.c	2003-04-19 19:51:11.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_dmops.c	2003-05-04 04:41:50.000000000 -0700
@@ -29,7 +29,20 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+
 
 #ifndef CONFIG_XFS_DMAPI
 xfs_dmops_t	xfs_dmcore_xfs = {
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_error.c linux-2.5.68-bk12/fs/xfs/xfs_error.c
--- linux-2.5.68-bk11/fs/xfs/xfs_error.c	2003-04-19 19:51:08.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_error.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,8 +30,26 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_sb.h"
+#include "xfs_trans.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_utils.h"
+#include "xfs_error.h"
 
 #ifdef DEBUG
 
@@ -63,7 +81,7 @@
 #if (defined(DEBUG) || defined(INDUCE_IO_ERROR))
 
 int	xfs_etest[XFS_NUM_INJECT_ERROR];
-int64_t xfs_etest_fsid[XFS_NUM_INJECT_ERROR];
+int64_t	xfs_etest_fsid[XFS_NUM_INJECT_ERROR];
 char *	xfs_etest_fsname[XFS_NUM_INJECT_ERROR];
 
 void
@@ -258,11 +276,11 @@
 		if (mp != NULL) {
 			xfs_cmn_err(XFS_PTAG_ERROR_REPORT,
 				    CE_ALERT, mp,
-		"XFS internal error %s at line %d of file %s.  Caller 0x%x\n",
+		"XFS internal error %s at line %d of file %s.  Caller 0x%p\n",
 				    tag, linenum, fname, ra);
 		} else {
 			cmn_err(CE_ALERT,
-		"XFS internal error %s at line %d of file %s.  Caller 0x%x\n",
+		"XFS internal error %s at line %d of file %s.  Caller 0x%p\n",
 				tag, linenum, fname, ra);
 		}
 
@@ -276,7 +294,7 @@
 	__uint8_t *uip = (__uint8_t*)p;
 	int	i;
 	char	sbuf[128], *s;
-	
+
 	s = sbuf;
 	*s = '\0';
 	for (i=0; i<length; i++, uip++) {
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_error.h linux-2.5.68-bk12/fs/xfs/xfs_error.h
--- linux-2.5.68-bk11/fs/xfs/xfs_error.h	2003-04-19 19:50:30.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_error.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,27 +29,27 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_ERROR_H__
-#define __XFS_ERROR_H__
+#ifndef	__XFS_ERROR_H__
+#define	__XFS_ERROR_H__
 
 #define prdev(fmt,dev,args...) \
 	printk("XFS: device 0x%x- " fmt "\n", (unsigned)dev, ## args)
 
 #define XFS_ERECOVER	1	/* Failure to recover log */
 #define XFS_ELOGSTAT	2	/* Failure to stat log in user space */
-#define XFS_ENOLOGSPACE 3	/* Reservation too large */
+#define XFS_ENOLOGSPACE	3	/* Reservation too large */
 #define XFS_ENOTSUP	4	/* Operation not supported */
-#define XFS_ENOLSN	5	/* Can't find the lsn you asked for */
+#define	XFS_ENOLSN	5	/* Can't find the lsn you asked for */
 #define XFS_ENOTFOUND	6
 #define XFS_ENOTXFS	7	/* Not XFS filesystem */
 
 #ifdef DEBUG
-#define XFS_ERROR_NTRAP 10
+#define	XFS_ERROR_NTRAP	10
 extern int	xfs_etrap[XFS_ERROR_NTRAP];
 extern int	xfs_error_trap(int);
-#define XFS_ERROR(e)	xfs_error_trap(e)
+#define	XFS_ERROR(e)	xfs_error_trap(e)
 #else
-#define XFS_ERROR(e)	(e)
+#define	XFS_ERROR(e)	(e)
 #endif
 
 struct xfs_mount;
@@ -98,15 +98,15 @@
 #define XFS_ERRTAG_IFLUSH_4				4
 #define XFS_ERRTAG_IFLUSH_5				5
 #define XFS_ERRTAG_IFLUSH_6				6
-#define XFS_ERRTAG_DA_READ_BUF				7
-#define XFS_ERRTAG_BTREE_CHECK_LBLOCK			8
-#define XFS_ERRTAG_BTREE_CHECK_SBLOCK			9
-#define XFS_ERRTAG_ALLOC_READ_AGF			10
-#define XFS_ERRTAG_IALLOC_READ_AGI			11
-#define XFS_ERRTAG_ITOBP_INOTOBP			12
-#define XFS_ERRTAG_IUNLINK				13
-#define XFS_ERRTAG_IUNLINK_REMOVE			14
-#define XFS_ERRTAG_DIR_INO_VALIDATE			15
+#define	XFS_ERRTAG_DA_READ_BUF				7
+#define	XFS_ERRTAG_BTREE_CHECK_LBLOCK			8
+#define	XFS_ERRTAG_BTREE_CHECK_SBLOCK			9
+#define	XFS_ERRTAG_ALLOC_READ_AGF			10
+#define	XFS_ERRTAG_IALLOC_READ_AGI			11
+#define	XFS_ERRTAG_ITOBP_INOTOBP			12
+#define	XFS_ERRTAG_IUNLINK				13
+#define	XFS_ERRTAG_IUNLINK_REMOVE			14
+#define	XFS_ERRTAG_DIR_INO_VALIDATE			15
 #define XFS_ERRTAG_BULKSTAT_READ_CHUNK			16
 #define XFS_ERRTAG_IODONE_IOERR				17
 #define XFS_ERRTAG_STRATREAD_IOERR			18
@@ -145,7 +145,7 @@
 extern int	xfs_error_test(int, int *, char *, int, char *, unsigned long);
 void xfs_error_test_init(void);
 
-#define XFS_NUM_INJECT_ERROR				10
+#define	XFS_NUM_INJECT_ERROR				10
 
 #ifdef __ANSI_CPP__
 #define XFS_TEST_ERROR(expr, mp, tag, rf)		\
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_extfree_item.c linux-2.5.68-bk12/fs/xfs/xfs_extfree_item.c
--- linux-2.5.68-bk11/fs/xfs/xfs_extfree_item.c	2003-04-19 19:50:37.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_extfree_item.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -35,7 +35,20 @@
  * and xfs_efd_log_item items.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_buf_item.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_trans_priv.h"
+#include "xfs_extfree_item.h"
 
 
 kmem_zone_t	*xfs_efi_zone;
@@ -213,7 +226,7 @@
 /*
  * The EFI is logged only once and cannot be moved in the log, so
  * simply return the lsn at which it's been logged.  The canceled
- * flag is not paid any attention here.	 Checking for that is delayed
+ * flag is not paid any attention here.  Checking for that is delayed
  * until the EFI is unpinned.
  */
 /*ARGSUSED*/
@@ -225,8 +238,8 @@
 
 /*
  * This is called when the transaction logging the EFI is aborted.
- * Free up the EFI and return.	No need to clean up the slot for
- * the item in the transaction.	 That was done by the unpin code
+ * Free up the EFI and return.  No need to clean up the slot for
+ * the item in the transaction.  That was done by the unpin code
  * which is called prior to this routine in the abort/fs-shutdown path.
  */
 STATIC void
@@ -247,7 +260,7 @@
 }
 
 /*
- * There isn't much you can do to push on an efi item.	It is simply
+ * There isn't much you can do to push on an efi item.  It is simply
  * stuck waiting for all of its corresponding efd items to be
  * committed to disk.
  */
@@ -327,7 +340,7 @@
 
 /*
  * This is called by the efd item code below to release references to
- * the given efi item.	Each efd calls this with the number of
+ * the given efi item.  Each efd calls this with the number of
  * extents that it has logged, and when the sum of these reaches
  * the total number of extents logged by this efi item we can free
  * the efi item.
@@ -546,7 +559,7 @@
  * The transaction of which this EFD is a part has been aborted.
  * Inform its companion EFI of this fact and then clean up after
  * ourselves.  No need to clean up the slot for the item in the
- * transaction.	 That was done by the unpin code which is called
+ * transaction.  That was done by the unpin code which is called
  * prior to this routine in the abort/fs-shutdown path.
  */
 STATIC void
@@ -575,7 +588,7 @@
 }
 
 /*
- * There isn't much you can do to push on an efd item.	It is simply
+ * There isn't much you can do to push on an efd item.  It is simply
  * stuck waiting for the log to be flushed to disk.
  */
 /*ARGSUSED*/
@@ -627,7 +640,7 @@
  */
 xfs_efd_log_item_t *
 xfs_efd_init(xfs_mount_t	*mp,
-	     xfs_efi_log_item_t *efip,
+	     xfs_efi_log_item_t	*efip,
 	     uint		nextents)
 
 {
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_extfree_item.h linux-2.5.68-bk12/fs/xfs/xfs_extfree_item.h
--- linux-2.5.68-bk11/fs/xfs/xfs_extfree_item.h	2003-04-19 19:49:30.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_extfree_item.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,8 +29,8 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_EXTFREE_ITEM_H__
-#define __XFS_EXTFREE_ITEM_H__
+#ifndef	__XFS_EXTFREE_ITEM_H__
+#define	__XFS_EXTFREE_ITEM_H__
 
 struct xfs_mount;
 struct kmem_zone;
@@ -42,7 +42,7 @@
 
 /*
  * This is the structure used to lay out an efi log item in the
- * log.	 The efi_extents field is a variable size array whose
+ * log.  The efi_extents field is a variable size array whose
  * size is given by efi_nextents.
  */
 typedef struct xfs_efi_log_format {
@@ -50,12 +50,12 @@
 	unsigned short		efi_size;	/* size of this item */
 	uint			efi_nextents;	/* # extents to free */
 	__uint64_t		efi_id;		/* efi identifier */
-	xfs_extent_t		efi_extents[1]; /* array of extents to free */
+	xfs_extent_t		efi_extents[1];	/* array of extents to free */
 } xfs_efi_log_format_t;
 
 /*
  * This is the structure used to lay out an efd log item in the
- * log.	 The efd_extents array is a variable size array whose
+ * log.  The efd_extents array is a variable size array whose
  * size is given by efd_nextents;
  */
 typedef struct xfs_efd_log_format {
@@ -63,7 +63,7 @@
 	unsigned short		efd_size;	/* size of this item */
 	uint			efd_nextents;	/* # of extents freed */
 	__uint64_t		efd_efi_id;	/* id of corresponding efi */
-	xfs_extent_t		efd_extents[1]; /* array of extents freed */
+	xfs_extent_t		efd_extents[1];	/* array of extents freed */
 } xfs_efd_log_format_t;
 
 
@@ -72,14 +72,14 @@
 /*
  * Max number of extents in fast allocation path.
  */
-#define XFS_EFI_MAX_FAST_EXTENTS	16
+#define	XFS_EFI_MAX_FAST_EXTENTS	16
 
 /*
  * Define EFI flags.
  */
-#define XFS_EFI_RECOVERED	0x1
-#define XFS_EFI_COMMITTED	0x2
-#define XFS_EFI_CANCELED	0x4
+#define	XFS_EFI_RECOVERED	0x1
+#define	XFS_EFI_COMMITTED	0x2
+#define	XFS_EFI_CANCELED	0x4
 
 /*
  * This is the "extent free intention" log item.  It is used
@@ -109,7 +109,7 @@
 /*
  * Max number of extents in fast allocation path.
  */
-#define XFS_EFD_MAX_FAST_EXTENTS	16
+#define	XFS_EFD_MAX_FAST_EXTENTS	16
 
 extern struct kmem_zone	*xfs_efi_zone;
 extern struct kmem_zone	*xfs_efd_zone;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_fsops.c linux-2.5.68-bk12/fs/xfs/xfs_fsops.c
--- linux-2.5.68-bk11/fs/xfs/xfs_fsops.c	2003-04-19 19:50:45.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_fsops.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,37 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_ag.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_error.h"
+#include "xfs_alloc.h"
+#include "xfs_ialloc.h"
+#include "xfs_fsops.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_trans_space.h"
+#include "xfs_rtalloc.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_inode_item.h"
 
 /*
  * File system operations
@@ -473,12 +503,12 @@
 
 int
 xfs_reserve_blocks(
-	xfs_mount_t		*mp,
-	__uint64_t		*inval,
-	xfs_fsop_resblks_t	*outval)
+	xfs_mount_t             *mp,
+	__uint64_t              *inval,
+	xfs_fsop_resblks_t      *outval)
 {
-	__uint64_t		lcounter, delta;
-	__uint64_t		request;
+	__uint64_t              lcounter, delta;
+	__uint64_t              request;
 	unsigned long s;
 
 	/* If inval is null, report current values and return */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_fsops.h linux-2.5.68-bk12/fs/xfs/xfs_fsops.h
--- linux-2.5.68-bk11/fs/xfs/xfs_fsops.h	2003-04-19 19:48:58.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_fsops.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_FSOPS_H__
-#define __XFS_FSOPS_H__
+#define	__XFS_FSOPS_H__
 
 int
 xfs_fs_geometry(
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_ialloc.c linux-2.5.68-bk12/fs/xfs/xfs_ialloc.c
--- linux-2.5.68-bk11/fs/xfs/xfs_ialloc.c	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_ialloc.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,8 +30,33 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_alloc.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
 
 /*
  * Log specified fields for the inode given by bp and off.
@@ -111,9 +136,9 @@
 	int		*alloc)
 {
 	xfs_agi_t	*agi;		/* allocation group header */
-	xfs_alloc_arg_t args;		/* allocation argument structure */
+	xfs_alloc_arg_t	args;		/* allocation argument structure */
 	int		blks_per_cluster;  /* fs blocks per inode cluster */
-	xfs_btree_cur_t *cur;		/* inode btree cursor */
+	xfs_btree_cur_t	*cur;		/* inode btree cursor */
 	xfs_daddr_t	d;		/* disk addr of buffer */
 	int		error;
 	xfs_buf_t	*fbuf;		/* new free inodes' buffer */
@@ -129,7 +154,7 @@
 	static xfs_timestamp_t ztime;	/* zero xfs timestamp */
 	int		isaligned;	/* inode allocation at stripe unit */
 					/* boundary */
-	xfs_dinode_core_t dic;		/* a dinode_core to copy to new */
+	xfs_dinode_core_t dic;          /* a dinode_core to copy to new */
 					/* inodes */
 
 	args.tp = tp;
@@ -202,7 +227,7 @@
 		else
 			args.alignment = 1;
 		if ((error = xfs_alloc_vextent(&args)))
-			 return error;
+			return error;
 	}
 
 	if (args.fsbno == NULLFSBLOCK) {
@@ -353,7 +378,7 @@
 
 /*
  * Select an allocation group to look for a free inode in, based on the parent
- * inode and then mode.	 Return the allocation group buffer.
+ * inode and then mode.  Return the allocation group buffer.
  */
 STATIC xfs_buf_t *			/* allocation group buffer */
 xfs_ialloc_ag_select(
@@ -479,10 +504,10 @@
  * The arguments IO_agbp and alloc_done are defined to work within
  * the constraint of one allocation per transaction.
  * xfs_dialloc() is designed to be called twice if it has to do an
- * allocation to make more free inodes.	 On the first call,
+ * allocation to make more free inodes.  On the first call,
  * IO_agbp should be set to NULL. If an inode is available,
  * i.e., xfs_dialloc() did not need to do an allocation, an inode
- * number is returned.	In this case, IO_agbp would be set to the
+ * number is returned.  In this case, IO_agbp would be set to the
  * current ag_buf and alloc_done set to false.
  * If an allocation needed to be done, xfs_dialloc would return
  * the current ag_buf in IO_agbp and set alloc_done to true.
@@ -493,7 +518,7 @@
  * guaranteed to have a free inode available.
  *
  * Once we successfully pick an inode its number is returned and the
- * on-disk data structures are updated.	 The inode itself is not read
+ * on-disk data structures are updated.  The inode itself is not read
  * in, since doing so would break ordering constraints with xfs_reclaim.
  */
 int
@@ -511,7 +536,7 @@
 	xfs_buf_t	*agbp;		/* allocation group header's buffer */
 	xfs_agnumber_t	agno;		/* allocation group number */
 	xfs_agi_t	*agi;		/* allocation group header structure */
-	xfs_btree_cur_t *cur;		/* inode allocation btree cursor */
+	xfs_btree_cur_t	*cur;		/* inode allocation btree cursor */
 	int		error;		/* error return value */
 	int		i;		/* result code */
 	int		ialloced;	/* inode allocation status */
@@ -523,10 +548,10 @@
 	int		offset;		/* index of inode in chunk */
 	xfs_agino_t	pagino;		/* parent's a.g. relative inode # */
 	xfs_agnumber_t	pagno;		/* parent's allocation group number */
-	xfs_inobt_rec_t rec;		/* inode allocation record */
+	xfs_inobt_rec_t	rec;		/* inode allocation record */
 	xfs_agnumber_t	tagno;		/* testing allocation group number */
-	xfs_btree_cur_t *tcur;		/* temp cursor */
-	xfs_inobt_rec_t trec;		/* temp inode allocation record */
+	xfs_btree_cur_t	*tcur;		/* temp cursor */
+	xfs_inobt_rec_t	trec;		/* temp inode allocation record */
 
 
 	if (*IO_agbp == NULL) {
@@ -930,12 +955,12 @@
 	xfs_agino_t	agino;	/* inode number relative to allocation group */
 	xfs_agnumber_t	agno;	/* allocation group number */
 	xfs_agi_t	*agi;	/* allocation group header */
-	xfs_btree_cur_t *cur;	/* inode btree cursor */
+	xfs_btree_cur_t	*cur;	/* inode btree cursor */
 	int		error;	/* error return value */
 	int		i;	/* result code */
 	xfs_mount_t	*mp;	/* mount structure for filesystem */
 	int		off;	/* offset of inode in inode chunk */
-	xfs_inobt_rec_t rec;	/* btree record */
+	xfs_inobt_rec_t	rec;	/* btree record */
 
 	mp = tp->t_mountp;
 
@@ -951,7 +976,7 @@
 		return XFS_ERROR(EINVAL);
 	}
 	agino = XFS_INO_TO_AGINO(mp, inode);
-	if (inode != XFS_AGINO_TO_INO(mp, agno, agino))	 {
+	if (inode != XFS_AGINO_TO_INO(mp, agno, agino))  {
 		cmn_err(CE_WARN,
 			"xfs_difree: inode != XFS_AGINO_TO_INO() (%d != %d) on %s.  Returning EINVAL.",
 			inode, XFS_AGINO_TO_INO(mp, agno, agino), mp->m_fsname);
@@ -974,7 +999,7 @@
 	up_read(&mp->m_peraglock);
 	if (error) {
 		cmn_err(CE_WARN,
-			"xfs_difree: xfs_ialloc_read_agi() returned an error %d on %s.	Returning error.",
+			"xfs_difree: xfs_ialloc_read_agi() returned an error %d on %s.  Returning error.",
 			error, mp->m_fsname);
 		return error;
 	}
@@ -1010,7 +1035,7 @@
 	 */
 	if ((error = xfs_inobt_lookup_le(cur, agino, 0, 0, &i))) {
 		cmn_err(CE_WARN,
-			"xfs_difree: xfs_inobt_lookup_le returned()  an error %d on %s.	 Returning error.",
+			"xfs_difree: xfs_inobt_lookup_le returned()  an error %d on %s.  Returning error.",
 			error, mp->m_fsname);
 		goto error0;
 	}
@@ -1036,7 +1061,7 @@
 	rec.ir_freecount++;
 	if ((error = xfs_inobt_update(cur, rec.ir_startino, rec.ir_freecount, rec.ir_free))) {
 		cmn_err(CE_WARN,
-			"xfs_difree: xfs_inobt_update()	 returned an error %d on %s.  Returning error.",
+			"xfs_difree: xfs_inobt_update()  returned an error %d on %s.  Returning error.",
 			error, mp->m_fsname);
 		goto error0;
 	}
@@ -1100,10 +1125,10 @@
 	__int32_t	chunk_cnt;	/* count of free inodes in chunk */
 	xfs_inofree_t	chunk_free;	/* mask of free inodes in chunk */
 	xfs_agblock_t	cluster_agbno;	/* first block in inode cluster */
-	xfs_btree_cur_t *cur;	/* inode btree cursor */
+	xfs_btree_cur_t	*cur;	/* inode btree cursor */
 	int		error;	/* error code */
 	int		i;	/* temp state */
-	int		offset; /* index of inode in its buffer */
+	int		offset;	/* index of inode in its buffer */
 	int		offset_agbno;	/* blks from chunk start to inode */
 
 	ASSERT(ino != NULLFSINO);
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_ialloc.h linux-2.5.68-bk12/fs/xfs/xfs_ialloc.h
--- linux-2.5.68-bk11/fs/xfs/xfs_ialloc.h	2003-04-19 19:48:53.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_ialloc.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_IALLOC_H__
-#define __XFS_IALLOC_H__
+#define	__XFS_IALLOC_H__
 
 struct xfs_buf;
 struct xfs_dinode;
@@ -42,15 +42,15 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_INODES)
 int xfs_ialloc_inodes(struct xfs_mount *mp);
-#define XFS_IALLOC_INODES(mp)	xfs_ialloc_inodes(mp)
+#define	XFS_IALLOC_INODES(mp)	xfs_ialloc_inodes(mp)
 #else
-#define XFS_IALLOC_INODES(mp)	((mp)->m_ialloc_inos)
+#define	XFS_IALLOC_INODES(mp)	((mp)->m_ialloc_inos)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_BLOCKS)
 xfs_extlen_t xfs_ialloc_blocks(struct xfs_mount *mp);
-#define XFS_IALLOC_BLOCKS(mp)	xfs_ialloc_blocks(mp)
+#define	XFS_IALLOC_BLOCKS(mp)	xfs_ialloc_blocks(mp)
 #else
-#define XFS_IALLOC_BLOCKS(mp)	((mp)->m_ialloc_blks)
+#define	XFS_IALLOC_BLOCKS(mp)	((mp)->m_ialloc_blks)
 #endif
 
 /*
@@ -60,18 +60,18 @@
  * around for xfs_dilocate().  We choose which one to use in
  * xfs_mount_int().
  */
-#define XFS_INODE_BIG_CLUSTER_SIZE	8192
-#define XFS_INODE_SMALL_CLUSTER_SIZE	4096
-#define XFS_INODE_CLUSTER_SIZE(mp)	(mp)->m_inode_cluster_size
+#define	XFS_INODE_BIG_CLUSTER_SIZE	8192
+#define	XFS_INODE_SMALL_CLUSTER_SIZE	4096
+#define	XFS_INODE_CLUSTER_SIZE(mp)	(mp)->m_inode_cluster_size
 
 /*
  * Make an inode pointer out of the buffer/offset.
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MAKE_IPTR)
 struct xfs_dinode *xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o);
-#define XFS_MAKE_IPTR(mp,b,o)		xfs_make_iptr(mp,b,o)
+#define	XFS_MAKE_IPTR(mp,b,o)		xfs_make_iptr(mp,b,o)
 #else
-#define XFS_MAKE_IPTR(mp,b,o) \
+#define	XFS_MAKE_IPTR(mp,b,o) \
 	((xfs_dinode_t *)(xfs_buf_offset(b, (o) << (mp)->m_sb.sb_inodelog)))
 #endif
 
@@ -80,9 +80,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IALLOC_FIND_FREE)
 int xfs_ialloc_find_free(xfs_inofree_t *fp);
-#define XFS_IALLOC_FIND_FREE(fp)	xfs_ialloc_find_free(fp)
+#define	XFS_IALLOC_FIND_FREE(fp)	xfs_ialloc_find_free(fp)
 #else
-#define XFS_IALLOC_FIND_FREE(fp)	xfs_lowbit64(*(fp))
+#define	XFS_IALLOC_FIND_FREE(fp)	xfs_lowbit64(*(fp))
 #endif
 
 
@@ -99,17 +99,17 @@
  *
  * To work within the constraint of one allocation per transaction,
  * xfs_dialloc() is designed to be called twice if it has to do an
- * allocation to make more free inodes.	 If an inode is
+ * allocation to make more free inodes.  If an inode is
  * available without an allocation, agbp would be set to the current
  * agbp and alloc_done set to false.
  * If an allocation needed to be done, agbp would be set to the
  * inode header of the allocation group and alloc_done set to true.
  * The caller should then commit the current transaction and allocate a new
- * transaction.	 xfs_dialloc() should then be called again with
+ * transaction.  xfs_dialloc() should then be called again with
  * the agbp value returned from the previous call.
  *
  * Once we successfully pick an inode its number is returned and the
- * on-disk data structures are updated.	 The inode itself is not read
+ * on-disk data structures are updated.  The inode itself is not read
  * in, since doing so would break ordering constraints with xfs_reclaim.
  *
  * *agbp should be set to NULL on the first call, *alloc_done set to FALSE.
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_ialloc_btree.c linux-2.5.68-bk12/fs/xfs/xfs_ialloc_btree.c
--- linux-2.5.68-bk11/fs/xfs/xfs_ialloc_btree.c	2003-04-19 19:49:09.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_ialloc_btree.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,13 +30,30 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
+
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_alloc.h"
+
 /*
  * Inode allocation management for XFS.
  */
 
-#include <xfs.h>
-
-
 /*
  * Prototypes for internal functions.
  */
@@ -70,10 +87,10 @@
 	int			*stat)	/* fail/done/go-on */
 {
 	xfs_buf_t		*agbp;	/* buffer for a.g. inode header */
-	xfs_agnumber_t		agfbno; /* agf block of freed btree block */
-	xfs_buf_t		*agfbp; /* bp of agf block of freed block */
+	xfs_agnumber_t		agfbno;	/* agf block of freed btree block */
+	xfs_buf_t		*agfbp;	/* bp of agf block of freed block */
 	xfs_agi_t		*agi;	/* allocation group inode header */
-	xfs_inobt_block_t	*block; /* btree block record/key lives in */
+	xfs_inobt_block_t	*block;	/* btree block record/key lives in */
 	xfs_agblock_t		bno;	/* btree block number */
 	xfs_buf_t		*bp;	/* buffer for block */
 	int			error;	/* error return value */
@@ -91,7 +108,7 @@
 	int			ptr;	/* index in btree block for this rec */
 	xfs_agblock_t		rbno;	/* right block's block number */
 	xfs_buf_t		*rbp;	/* right block's buffer pointer */
-	xfs_inobt_block_t	*right; /* right btree block */
+	xfs_inobt_block_t	*right;	/* right btree block */
 	xfs_inobt_key_t		*rkp;	/* right block key pointer */
 	xfs_inobt_rec_t		*rp;	/* pointer to btree records */
 	xfs_inobt_ptr_t		*rpp;	/* right block address pointer */
@@ -148,7 +165,7 @@
 		}
 	}
 	/*
-	 * It's a leaf.	 Excise the record being deleted, by sliding the
+	 * It's a leaf.  Excise the record being deleted, by sliding the
 	 * entries past it down one.  Log the changed areas of the block.
 	 */
 	else {
@@ -424,7 +441,7 @@
 	}
 	/*
 	 * Otherwise, we can't fix the imbalance.
-	 * Just return.	 This is probably a logic error, but it's not fatal.
+	 * Just return.  This is probably a logic error, but it's not fatal.
 	 */
 	else {
 		if (level > 0 && (error = xfs_inobt_decrement(cur, level, &i)))
@@ -458,7 +475,7 @@
 				   INT_GET(left->bb_numrecs, ARCH_CONVERT) + INT_GET(right->bb_numrecs, ARCH_CONVERT));
 	} else {
 		/*
-		 * It's a leaf.	 Move records.
+		 * It's a leaf.  Move records.
 		 */
 		lrp = XFS_INOBT_REC_ADDR(left, INT_GET(left->bb_numrecs, ARCH_CONVERT) + 1, cur);
 		rrp = XFS_INOBT_REC_ADDR(right, 1, cur);
@@ -560,10 +577,10 @@
 	int			level,	/* level to insert record at */
 	xfs_agblock_t		*bnop,	/* i/o: block number inserted */
 	xfs_inobt_rec_t		*recp,	/* i/o: record data inserted */
-	xfs_btree_cur_t		**curp, /* output: new cursor replacing cur */
+	xfs_btree_cur_t		**curp,	/* output: new cursor replacing cur */
 	int			*stat)	/* success/failure */
 {
-	xfs_inobt_block_t	*block; /* btree block record/key lives in */
+	xfs_inobt_block_t	*block;	/* btree block record/key lives in */
 	xfs_buf_t		*bp;	/* buffer for block */
 	int			error;	/* error return value */
 	int			i;	/* loop index */
@@ -764,7 +781,7 @@
 xfs_inobt_log_block(
 	xfs_trans_t		*tp,	/* transaction pointer */
 	xfs_buf_t		*bp,	/* buffer containing btree block */
-	int			fields) /* mask of fields: XFS_BB_... */
+	int			fields)	/* mask of fields: XFS_BB_... */
 {
 	int			first;	/* first byte offset logged */
 	int			last;	/* last byte offset logged */
@@ -788,10 +805,10 @@
 xfs_inobt_log_keys(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	xfs_buf_t		*bp,	/* buffer containing btree block */
-	int			kfirst, /* index of first key to log */
+	int			kfirst,	/* index of first key to log */
 	int			klast)	/* index of last key to log */
 {
-	xfs_inobt_block_t	*block; /* btree block to log from */
+	xfs_inobt_block_t	*block;	/* btree block to log from */
 	int			first;	/* first byte offset logged */
 	xfs_inobt_key_t		*kp;	/* key pointer in btree block */
 	int			last;	/* last byte offset logged */
@@ -810,10 +827,10 @@
 xfs_inobt_log_ptrs(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	xfs_buf_t		*bp,	/* buffer containing btree block */
-	int			pfirst, /* index of first pointer to log */
+	int			pfirst,	/* index of first pointer to log */
 	int			plast)	/* index of last pointer to log */
 {
-	xfs_inobt_block_t	*block; /* btree block to log from */
+	xfs_inobt_block_t	*block;	/* btree block to log from */
 	int			first;	/* first byte offset logged */
 	int			last;	/* last byte offset logged */
 	xfs_inobt_ptr_t		*pp;	/* block-pointer pointer in btree blk */
@@ -832,10 +849,10 @@
 xfs_inobt_log_recs(
 	xfs_btree_cur_t		*cur,	/* btree cursor */
 	xfs_buf_t		*bp,	/* buffer containing btree block */
-	int			rfirst, /* index of first record to log */
+	int			rfirst,	/* index of first record to log */
 	int			rlast)	/* index of last record to log */
 {
-	xfs_inobt_block_t	*block; /* btree block to log from */
+	xfs_inobt_block_t	*block;	/* btree block to log from */
 	int			first;	/* first byte offset logged */
 	int			last;	/* last byte offset logged */
 	xfs_inobt_rec_t		*rp;	/* record pointer for btree block */
@@ -927,8 +944,8 @@
 		 */
 		else {
 			int		high;	/* high entry number */
-			xfs_inobt_key_t *kkbase=NULL;/* base of keys in block */
-			xfs_inobt_rec_t *krbase=NULL;/* base of records in block */
+			xfs_inobt_key_t	*kkbase=NULL;/* base of keys in block */
+			xfs_inobt_rec_t	*krbase=NULL;/* base of records in block */
 			int		low;	/* low entry number */
 
 			/*
@@ -966,12 +983,12 @@
 				 * Get startino.
 				 */
 				if (level > 0) {
-					xfs_inobt_key_t *kkp;
+					xfs_inobt_key_t	*kkp;
 
 					kkp = kkbase + keyno - 1;
 					startino = INT_GET(kkp->ir_startino, ARCH_CONVERT);
 				} else {
-					xfs_inobt_rec_t *krp;
+					xfs_inobt_rec_t	*krp;
 
 					krp = krbase + keyno - 1;
 					startino = INT_GET(krp->ir_startino, ARCH_CONVERT);
@@ -1074,7 +1091,7 @@
 	xfs_inobt_rec_t		*lrp=NULL;	/* record pointer for left block */
 	int			nrec;	/* new number of left block entries */
 	xfs_buf_t		*rbp;	/* buffer for right (current) block */
-	xfs_inobt_block_t	*right; /* right (current) btree block */
+	xfs_inobt_block_t	*right;	/* right (current) btree block */
 	xfs_inobt_key_t		*rkp=NULL;	/* key pointer for right block */
 	xfs_inobt_ptr_t		*rpp=NULL;	/* address pointer for right block */
 	xfs_inobt_rec_t		*rrp=NULL;	/* record pointer for right block */
@@ -1204,7 +1221,7 @@
 {
 	xfs_agi_t		*agi;	/* a.g. inode header */
 	xfs_alloc_arg_t		args;	/* allocation argument structure */
-	xfs_inobt_block_t	*block; /* one half of the old root block */
+	xfs_inobt_block_t	*block;	/* one half of the old root block */
 	xfs_buf_t		*bp;	/* buffer containing block */
 	int			error;	/* error return value */
 	xfs_inobt_key_t		*kp;	/* btree key pointer */
@@ -1217,7 +1234,7 @@
 	xfs_inobt_ptr_t		*pp;	/* btree address pointer */
 	xfs_agblock_t		rbno;	/* right block number */
 	xfs_buf_t		*rbp;	/* right buffer pointer */
-	xfs_inobt_block_t	*right; /* right btree block */
+	xfs_inobt_block_t	*right;	/* right btree block */
 	xfs_inobt_rec_t		*rp;	/* btree record pointer */
 
 	ASSERT(cur->bc_nlevels < XFS_IN_MAXLEVELS(cur->bc_mp));
@@ -1360,7 +1377,7 @@
 	xfs_inobt_ptr_t		*lpp;	/* address pointer for left block */
 	xfs_inobt_rec_t		*lrp;	/* record pointer for left block */
 	xfs_buf_t		*rbp;	/* buffer for right neighbor block */
-	xfs_inobt_block_t	*right; /* right neighbor btree block */
+	xfs_inobt_block_t	*right;	/* right neighbor btree block */
 	xfs_inobt_key_t		*rkp;	/* key pointer for right block */
 	xfs_inobt_ptr_t		*rpp;	/* address pointer for right block */
 	xfs_inobt_rec_t		*rrp=NULL;	/* record pointer for right block */
@@ -1481,7 +1498,7 @@
 	int			level,	/* level to split */
 	xfs_agblock_t		*bnop,	/* output: block number allocated */
 	xfs_inobt_key_t		*keyp,	/* output: first key of new block */
-	xfs_btree_cur_t		**curp, /* output: new cursor */
+	xfs_btree_cur_t		**curp,	/* output: new cursor */
 	int			*stat)	/* success/failure */
 {
 	xfs_alloc_arg_t		args;	/* allocation argument structure */
@@ -1494,7 +1511,7 @@
 	xfs_inobt_ptr_t		*lpp;	/* left btree address pointer */
 	xfs_inobt_rec_t		*lrp;	/* left btree record pointer */
 	xfs_buf_t		*rbp;	/* buffer for right block */
-	xfs_inobt_block_t	*right; /* right (new) btree block */
+	xfs_inobt_block_t	*right;	/* right (new) btree block */
 	xfs_inobt_key_t		*rkp;	/* right btree key pointer */
 	xfs_inobt_ptr_t		*rpp;	/* right btree address pointer */
 	xfs_inobt_rec_t		*rrp;	/* right btree record pointer */
@@ -1649,7 +1666,7 @@
 	 */
 	for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) {
 		xfs_buf_t		*bp;	/* buffer for block */
-		xfs_inobt_block_t	*block; /* btree block */
+		xfs_inobt_block_t	*block;	/* btree block */
 #ifdef DEBUG
 		int			error;	/* error return value */
 #endif
@@ -1683,7 +1700,7 @@
 	int			level,	/* level in btree, 0 is leaf */
 	int			*stat)	/* success/failure */
 {
-	xfs_inobt_block_t	*block; /* btree block */
+	xfs_inobt_block_t	*block;	/* btree block */
 	int			error;
 	int			lev;	/* btree level */
 
@@ -1765,7 +1782,7 @@
  */
 int					/* error */
 xfs_inobt_delete(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	int		*stat)		/* success/failure */
 {
 	int		error;
@@ -1805,9 +1822,9 @@
 	__int32_t		*fcnt,	/* output: number of free inodes */
 	xfs_inofree_t		*free,	/* output: free inode mask */
 	int			*stat,	/* output: success/failure */
-	xfs_arch_t		arch)	/* input: architecture */
+	xfs_arch_t              arch)   /* input: architecture */
 {
-	xfs_inobt_block_t	*block; /* btree block */
+	xfs_inobt_block_t	*block;	/* btree block */
 	xfs_buf_t		*bp;	/* buffer containing btree block */
 #ifdef DEBUG
 	int			error;	/* error return value */
@@ -1857,7 +1874,7 @@
 	int			level,	/* level in btree, 0 is leaf */
 	int			*stat)	/* success/failure */
 {
-	xfs_inobt_block_t	*block; /* btree block */
+	xfs_inobt_block_t	*block;	/* btree block */
 	xfs_buf_t		*bp;	/* buffer containing btree block */
 	int			error;	/* error return value */
 	int			lev;	/* btree level */
@@ -1944,16 +1961,16 @@
  */
 int					/* error */
 xfs_inobt_insert(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	int		*stat)		/* success/failure */
 {
 	int		error;		/* error return value */
 	int		i;		/* result value, 0 for failure */
 	int		level;		/* current level number in btree */
 	xfs_agblock_t	nbno;		/* new block number (split result) */
-	xfs_btree_cur_t *ncur;		/* new cursor (split result) */
-	xfs_inobt_rec_t nrec;		/* record being inserted this level */
-	xfs_btree_cur_t *pcur;		/* previous level's cursor */
+	xfs_btree_cur_t	*ncur;		/* new cursor (split result) */
+	xfs_inobt_rec_t	nrec;		/* record being inserted this level */
+	xfs_btree_cur_t	*pcur;		/* previous level's cursor */
 
 	level = 0;
 	nbno = NULLAGBLOCK;
@@ -2004,7 +2021,7 @@
  */
 int					/* error */
 xfs_inobt_lookup_eq(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	xfs_agino_t	ino,		/* starting inode of chunk */
 	__int32_t	fcnt,		/* free inode count */
 	xfs_inofree_t	free,		/* free inode mask */
@@ -2022,7 +2039,7 @@
  */
 int					/* error */
 xfs_inobt_lookup_ge(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	xfs_agino_t	ino,		/* starting inode of chunk */
 	__int32_t	fcnt,		/* free inode count */
 	xfs_inofree_t	free,		/* free inode mask */
@@ -2040,7 +2057,7 @@
  */
 int					/* error */
 xfs_inobt_lookup_le(
-	xfs_btree_cur_t *cur,		/* btree cursor */
+	xfs_btree_cur_t	*cur,		/* btree cursor */
 	xfs_agino_t	ino,		/* starting inode of chunk */
 	__int32_t	fcnt,		/* free inode count */
 	xfs_inofree_t	free,		/* free inode mask */
@@ -2064,7 +2081,7 @@
 	__int32_t		fcnt,	/* free inode count */
 	xfs_inofree_t		free)	/* free inode mask */
 {
-	xfs_inobt_block_t	*block; /* btree block to update */
+	xfs_inobt_block_t	*block;	/* btree block to update */
 	xfs_buf_t		*bp;	/* buffer containing btree block */
 	int			error;	/* error return value */
 	int			ptr;	/* current record number (updating) */
@@ -2095,7 +2112,7 @@
 	 * Updating first record in leaf. Pass new key value up to our parent.
 	 */
 	if (ptr == 1) {
-		xfs_inobt_key_t key;	/* key containing [ino] */
+		xfs_inobt_key_t	key;	/* key containing [ino] */
 
 		INT_SET(key.ir_startino, ARCH_CONVERT, ino);
 		if ((error = xfs_inobt_updkey(cur, &key, 1)))
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_ialloc_btree.h linux-2.5.68-bk12/fs/xfs/xfs_ialloc_btree.h
--- linux-2.5.68-bk11/fs/xfs/xfs_ialloc_btree.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_ialloc_btree.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_IALLOC_BTREE_H__
-#define __XFS_IALLOC_BTREE_H__
+#define	__XFS_IALLOC_BTREE_H__
 
 /*
  * Inode map on-disk structures
@@ -44,18 +44,18 @@
 /*
  * There is a btree for the inode map per allocation group.
  */
-#define XFS_IBT_MAGIC	0x49414254	/* 'IABT' */
+#define	XFS_IBT_MAGIC	0x49414254	/* 'IABT' */
 
-typedef __uint64_t	xfs_inofree_t;
-#define XFS_INODES_PER_CHUNK	(NBBY * sizeof(xfs_inofree_t))
-#define XFS_INODES_PER_CHUNK_LOG	(XFS_NBBYLOG + 3)
-#define XFS_INOBT_ALL_FREE	((xfs_inofree_t)-1)
+typedef	__uint64_t	xfs_inofree_t;
+#define	XFS_INODES_PER_CHUNK	(NBBY * sizeof(xfs_inofree_t))
+#define	XFS_INODES_PER_CHUNK_LOG	(XFS_NBBYLOG + 3)
+#define	XFS_INOBT_ALL_FREE	((xfs_inofree_t)-1)
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_MASKN)
 xfs_inofree_t xfs_inobt_maskn(int i, int n);
-#define XFS_INOBT_MASKN(i,n)		xfs_inobt_maskn(i,n)
+#define	XFS_INOBT_MASKN(i,n)		xfs_inobt_maskn(i,n)
 #else
-#define XFS_INOBT_MASKN(i,n)	\
+#define	XFS_INOBT_MASKN(i,n)	\
 	((((n) >= XFS_INODES_PER_CHUNK ? \
 		(xfs_inofree_t)0 : ((xfs_inofree_t)1 << (n))) - 1) << (i))
 #endif
@@ -80,13 +80,13 @@
 
 typedef xfs_agblock_t xfs_inobt_ptr_t;	/* btree pointer type */
 					/* btree block header type */
-typedef struct xfs_btree_sblock xfs_inobt_block_t;
+typedef	struct xfs_btree_sblock xfs_inobt_block_t;
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_INOBT_BLOCK)
 xfs_inobt_block_t *xfs_buf_to_inobt_block(struct xfs_buf *bp);
-#define XFS_BUF_TO_INOBT_BLOCK(bp)	xfs_buf_to_inobt_block(bp)
+#define	XFS_BUF_TO_INOBT_BLOCK(bp)	xfs_buf_to_inobt_block(bp)
 #else
-#define XFS_BUF_TO_INOBT_BLOCK(bp) ((xfs_inobt_block_t *)(XFS_BUF_PTR(bp)))
+#define	XFS_BUF_TO_INOBT_BLOCK(bp) ((xfs_inobt_block_t *)(XFS_BUF_PTR(bp)))
 #endif
 
 /*
@@ -94,28 +94,28 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_MASK)
 xfs_inofree_t xfs_inobt_mask(int i);
-#define XFS_INOBT_MASK(i)		xfs_inobt_mask(i)
+#define	XFS_INOBT_MASK(i)		xfs_inobt_mask(i)
 #else
-#define XFS_INOBT_MASK(i)		((xfs_inofree_t)1 << (i))
+#define	XFS_INOBT_MASK(i)		((xfs_inofree_t)1 << (i))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_IS_FREE)
 int xfs_inobt_is_free(xfs_inobt_rec_t *rp, int i, xfs_arch_t arch);
-#define XFS_INOBT_IS_FREE(rp,i,arch)	xfs_inobt_is_free(rp,i,arch)
+#define	XFS_INOBT_IS_FREE(rp,i,arch)	xfs_inobt_is_free(rp,i,arch)
 #else
-#define XFS_INOBT_IS_FREE(rp,i,arch)	((INT_GET((rp)->ir_free, arch) \
+#define	XFS_INOBT_IS_FREE(rp,i,arch)	((INT_GET((rp)->ir_free, arch) \
 					 & XFS_INOBT_MASK(i)) != 0)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_SET_FREE)
 void xfs_inobt_set_free(xfs_inobt_rec_t *rp, int i, xfs_arch_t arch);
-#define XFS_INOBT_SET_FREE(rp,i,arch)	xfs_inobt_set_free(rp,i,arch)
+#define	XFS_INOBT_SET_FREE(rp,i,arch)	xfs_inobt_set_free(rp,i,arch)
 #else
-#define XFS_INOBT_SET_FREE(rp,i,arch)	(INT_MOD_EXPR((rp)->ir_free, arch, |= XFS_INOBT_MASK(i)))
+#define	XFS_INOBT_SET_FREE(rp,i,arch)	(INT_MOD_EXPR((rp)->ir_free, arch, |= XFS_INOBT_MASK(i)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_CLR_FREE)
 void xfs_inobt_clr_free(xfs_inobt_rec_t *rp, int i, xfs_arch_t arch);
-#define XFS_INOBT_CLR_FREE(rp,i,arch)	xfs_inobt_clr_free(rp,i,arch)
+#define	XFS_INOBT_CLR_FREE(rp,i,arch)	xfs_inobt_clr_free(rp,i,arch)
 #else
-#define XFS_INOBT_CLR_FREE(rp,i,arch)	(INT_MOD_EXPR((rp)->ir_free, arch, &= ~XFS_INOBT_MASK(i)))
+#define	XFS_INOBT_CLR_FREE(rp,i,arch)	(INT_MOD_EXPR((rp)->ir_free, arch, &= ~XFS_INOBT_MASK(i)))
 #endif
 
 /*
@@ -123,31 +123,31 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_BLOCK_SIZE)
 int xfs_inobt_block_size(int lev, struct xfs_btree_cur *cur);
-#define XFS_INOBT_BLOCK_SIZE(lev,cur)	xfs_inobt_block_size(lev,cur)
+#define	XFS_INOBT_BLOCK_SIZE(lev,cur)	xfs_inobt_block_size(lev,cur)
 #else
-#define XFS_INOBT_BLOCK_SIZE(lev,cur)	(1 << (cur)->bc_blocklog)
+#define	XFS_INOBT_BLOCK_SIZE(lev,cur)	(1 << (cur)->bc_blocklog)
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_BLOCK_MAXRECS)
 int xfs_inobt_block_maxrecs(int lev, struct xfs_btree_cur *cur);
-#define XFS_INOBT_BLOCK_MAXRECS(lev,cur)	xfs_inobt_block_maxrecs(lev,cur)
+#define	XFS_INOBT_BLOCK_MAXRECS(lev,cur)	xfs_inobt_block_maxrecs(lev,cur)
 #else
-#define XFS_INOBT_BLOCK_MAXRECS(lev,cur)	\
+#define	XFS_INOBT_BLOCK_MAXRECS(lev,cur)	\
 	((cur)->bc_mp->m_inobt_mxr[lev != 0])
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_BLOCK_MINRECS)
 int xfs_inobt_block_minrecs(int lev, struct xfs_btree_cur *cur);
-#define XFS_INOBT_BLOCK_MINRECS(lev,cur)	xfs_inobt_block_minrecs(lev,cur)
+#define	XFS_INOBT_BLOCK_MINRECS(lev,cur)	xfs_inobt_block_minrecs(lev,cur)
 #else
-#define XFS_INOBT_BLOCK_MINRECS(lev,cur)	\
+#define	XFS_INOBT_BLOCK_MINRECS(lev,cur)	\
 	((cur)->bc_mp->m_inobt_mnr[lev != 0])
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_IS_LAST_REC)
 int xfs_inobt_is_last_rec(struct xfs_btree_cur *cur);
-#define XFS_INOBT_IS_LAST_REC(cur)	xfs_inobt_is_last_rec(cur)
+#define	XFS_INOBT_IS_LAST_REC(cur)	xfs_inobt_is_last_rec(cur)
 #else
-#define XFS_INOBT_IS_LAST_REC(cur)	\
+#define	XFS_INOBT_IS_LAST_REC(cur)	\
 	((cur)->bc_ptrs[0] == \
 		INT_GET(XFS_BUF_TO_INOBT_BLOCK((cur)->bc_bufs[0])->bb_numrecs, ARCH_CONVERT))
 #endif
@@ -157,9 +157,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IN_MAXLEVELS)
 int xfs_in_maxlevels(struct xfs_mount *mp);
-#define XFS_IN_MAXLEVELS(mp)		xfs_in_maxlevels(mp)
+#define	XFS_IN_MAXLEVELS(mp)		xfs_in_maxlevels(mp)
 #else
-#define XFS_IN_MAXLEVELS(mp)		((mp)->m_in_maxlevels)
+#define	XFS_IN_MAXLEVELS(mp)		((mp)->m_in_maxlevels)
 #endif
 
 /*
@@ -167,15 +167,15 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IBT_BLOCK)
 xfs_agblock_t xfs_ibt_block(struct xfs_mount *mp);
-#define XFS_IBT_BLOCK(mp)		xfs_ibt_block(mp)
+#define	XFS_IBT_BLOCK(mp)		xfs_ibt_block(mp)
 #else
-#define XFS_IBT_BLOCK(mp)	((xfs_agblock_t)(XFS_CNT_BLOCK(mp) + 1))
+#define	XFS_IBT_BLOCK(mp)	((xfs_agblock_t)(XFS_CNT_BLOCK(mp) + 1))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_PREALLOC_BLOCKS)
 xfs_agblock_t xfs_prealloc_blocks(struct xfs_mount *mp);
-#define XFS_PREALLOC_BLOCKS(mp)		xfs_prealloc_blocks(mp)
+#define	XFS_PREALLOC_BLOCKS(mp)		xfs_prealloc_blocks(mp)
 #else
-#define XFS_PREALLOC_BLOCKS(mp) ((xfs_agblock_t)(XFS_IBT_BLOCK(mp) + 1))
+#define	XFS_PREALLOC_BLOCKS(mp)	((xfs_agblock_t)(XFS_IBT_BLOCK(mp) + 1))
 #endif
 
 /*
@@ -184,9 +184,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_REC_ADDR)
 xfs_inobt_rec_t *
 xfs_inobt_rec_addr(xfs_inobt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define XFS_INOBT_REC_ADDR(bb,i,cur)	xfs_inobt_rec_addr(bb,i,cur)
+#define	XFS_INOBT_REC_ADDR(bb,i,cur)	xfs_inobt_rec_addr(bb,i,cur)
 #else
-#define XFS_INOBT_REC_ADDR(bb,i,cur)	\
+#define	XFS_INOBT_REC_ADDR(bb,i,cur)	\
 	XFS_BTREE_REC_ADDR(XFS_INOBT_BLOCK_SIZE(0,cur), xfs_inobt, bb, i, \
 		XFS_INOBT_BLOCK_MAXRECS(0, cur))
 #endif
@@ -194,9 +194,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_KEY_ADDR)
 xfs_inobt_key_t *
 xfs_inobt_key_addr(xfs_inobt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define XFS_INOBT_KEY_ADDR(bb,i,cur)	xfs_inobt_key_addr(bb,i,cur)
+#define	XFS_INOBT_KEY_ADDR(bb,i,cur)	xfs_inobt_key_addr(bb,i,cur)
 #else
-#define XFS_INOBT_KEY_ADDR(bb,i,cur)	\
+#define	XFS_INOBT_KEY_ADDR(bb,i,cur)	\
 	XFS_BTREE_KEY_ADDR(XFS_INOBT_BLOCK_SIZE(1,cur), xfs_inobt, bb, i, \
 		XFS_INOBT_BLOCK_MAXRECS(1, cur))
 #endif
@@ -204,9 +204,9 @@
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INOBT_PTR_ADDR)
 xfs_inobt_ptr_t *
 xfs_inobt_ptr_addr(xfs_inobt_block_t *bb, int i, struct xfs_btree_cur *cur);
-#define XFS_INOBT_PTR_ADDR(bb,i,cur)	xfs_inobt_ptr_addr(bb,i,cur)
+#define	XFS_INOBT_PTR_ADDR(bb,i,cur)	xfs_inobt_ptr_addr(bb,i,cur)
 #else
-#define XFS_INOBT_PTR_ADDR(bb,i,cur)	\
+#define	XFS_INOBT_PTR_ADDR(bb,i,cur)	\
 	XFS_BTREE_PTR_ADDR(XFS_INOBT_BLOCK_SIZE(1,cur), xfs_inobt, bb, i, \
 		XFS_INOBT_BLOCK_MAXRECS(1, cur))
 #endif
@@ -234,7 +234,7 @@
 int					/* error */
 xfs_inobt_delete(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 #endif	/* _NOTYET_ */
 
 /*
@@ -257,7 +257,7 @@
 xfs_inobt_increment(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
 	int			level,	/* level in btree, 0 is leaf */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Insert the current record at the point referenced by cur.
@@ -266,7 +266,7 @@
 int					/* error */
 xfs_inobt_insert(
 	struct xfs_btree_cur	*cur,	/* btree cursor */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Lookup the record equal to ino in the btree given by cur.
@@ -277,7 +277,7 @@
 	xfs_agino_t		ino,	/* starting inode of chunk */
 	__int32_t		fcnt,	/* free inode count */
 	xfs_inofree_t		free,	/* free inode mask */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Lookup the first record greater than or equal to ino
@@ -289,7 +289,7 @@
 	xfs_agino_t		ino,	/* starting inode of chunk */
 	__int32_t		fcnt,	/* free inode count */
 	xfs_inofree_t		free,	/* free inode mask */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Lookup the first record less than or equal to ino
@@ -301,7 +301,7 @@
 	xfs_agino_t		ino,	/* starting inode of chunk */
 	__int32_t		fcnt,	/* free inode count */
 	xfs_inofree_t		free,	/* free inode mask */
-	int			*stat); /* success/failure */
+	int			*stat);	/* success/failure */
 
 /*
  * Update the record referred to by cur, to the value given
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_iget.c linux-2.5.68-bk12/fs/xfs/xfs_iget.c
--- linux-2.5.68-bk11/fs/xfs/xfs_iget.c	2003-04-19 19:51:12.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_iget.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,13 +30,37 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_quota.h"
+#include "xfs_utils.h"
 
 /*
  * Initialize the inode hash table for the newly mounted file system.
  *
  * mp -- this is the mount point structure for the file system being
- *	 initialized
+ *       initialized
  */
 void
 xfs_ihash_init(xfs_mount_t *mp)
@@ -66,7 +90,7 @@
  * Initialize the inode cluster hash table for the newly mounted file system.
  *
  * mp -- this is the mount point structure for the file system being
- *	 initialized
+ *       initialized
  */
 void
 xfs_chash_init(xfs_mount_t *mp)
@@ -111,11 +135,11 @@
 /*
  * Look up an inode by number in the given file system.
  * The inode is looked up in the hash table for the file system
- * represented by the mount point parameter mp.	 Each bucket of
+ * represented by the mount point parameter mp.  Each bucket of
  * the hash table is guarded by an individual semaphore.
  *
  * If the inode is found in the hash table, its corresponding vnode
- * is obtained with a call to vn_get().	 This call takes care of
+ * is obtained with a call to vn_get().  This call takes care of
  * coordination with the reclamation of the inode and vnode.  Note
  * that the vmap structure is filled in while holding the hash lock.
  * This gives us the state of the inode/vnode when we found it and
@@ -128,12 +152,12 @@
  * This flag parameter indicates how and if the inode's IO lock and inode lock
  * should be taken.
  *
- * mp -- the mount point structure for the current file system.	 It points
- *	 to the inode hash table.
- * tp -- a pointer to the current transaction if there is one.	This is
- *	 simply passed through to the xfs_iread() call.
+ * mp -- the mount point structure for the current file system.  It points
+ *       to the inode hash table.
+ * tp -- a pointer to the current transaction if there is one.  This is
+ *       simply passed through to the xfs_iread() call.
  * ino -- the number of the inode desired.  This is the unique identifier
- *	  within the file system for the inode being requested.
+ *        within the file system for the inode being requested.
  * lock_flags -- flags indicating how to lock the inode.  See the comment
  *		 for xfs_ilock() for a list of valid values.
  * bno -- the block number starting the buffer containing the inode,
@@ -158,7 +182,7 @@
 	/* REFERENCED */
 	int		newnode;
 	xfs_chash_t	*ch;
-	xfs_chashlist_t *chl, *chlnew;
+	xfs_chashlist_t	*chl, *chlnew;
 	SPLDECL(s);
 
 
@@ -456,7 +480,7 @@
 			error = 0;
 		}
 	} else
-		error = ENOMEM; /* If we got no inode we are out of memory */
+		error = ENOMEM;	/* If we got no inode we are out of memory */
 
 	return error;
 }
@@ -508,7 +532,7 @@
 			}
 			break;
 		}
-	}	
+	}
 	read_unlock(&ih->ih_lock);
 	return (NULL);
 }
@@ -518,14 +542,14 @@
  *
  * ip -- the inode being released
  * lock_flags -- this parameter indicates the inode's locks to be
- *	 to be released.  See the comment on xfs_iunlock() for a list
+ *       to be released.  See the comment on xfs_iunlock() for a list
  *	 of valid values.
  */
 void
 xfs_iput(xfs_inode_t	*ip,
 	 uint		lock_flags)
 {
-	vnode_t *vp = XFS_ITOV(ip);
+	vnode_t	*vp = XFS_ITOV(ip);
 
 	vn_trace_entry(vp, "xfs_iput", (inst_t *)__return_address);
 
@@ -577,7 +601,7 @@
 
 	/*
 	 * Here we do a spurious inode lock in order to coordinate with
-	 * xfs_sync().	This is because xfs_sync() references the inodes
+	 * xfs_sync().  This is because xfs_sync() references the inodes
 	 * in the mount list without taking references on the corresponding
 	 * vnodes.  We make that OK here by ensuring that we wait until
 	 * the inode is unlocked in xfs_sync() before we go ahead and
@@ -610,7 +634,7 @@
 /*
  * This routine removes an about-to-be-destroyed inode from
  * all of the lists in which it is located with the exception
- * of the behavior chain. 
+ * of the behavior chain.
  */
 void
 xfs_iextract(
@@ -702,7 +726,7 @@
 
 /*
  * This is a wrapper routine around the xfs_ilock() routine
- * used to centralize some grungy code.	 It is used in places
+ * used to centralize some grungy code.  It is used in places
  * that wish to lock the inode solely for reading the extents.
  * The reason these places can't just call xfs_ilock(SHARED)
  * is that the inode lock also guards to bringing in of the
@@ -750,7 +774,7 @@
 
 /*
  * The xfs inode contains 2 locks: a multi-reader lock called the
- * i_iolock and a multi-reader lock called the i_lock.	This routine
+ * i_iolock and a multi-reader lock called the i_lock.  This routine
  * allows either or both of the locks to be obtained.
  *
  * The 2 locks should always be ordered so that the IO lock is
@@ -758,7 +782,7 @@
  *
  * ip -- the inode being locked
  * lock_flags -- this parameter indicates the inode's locks
- *	 to be locked.	It can be:
+ *       to be locked.  It can be:
  *		XFS_IOLOCK_SHARED,
  *		XFS_IOLOCK_EXCL,
  *		XFS_ILOCK_SHARED,
@@ -800,14 +824,14 @@
 
 /*
  * This is just like xfs_ilock(), except that the caller
- * is guaranteed not to sleep.	It returns 1 if it gets
- * the requested locks and 0 otherwise.	 If the IO lock is
+ * is guaranteed not to sleep.  It returns 1 if it gets
+ * the requested locks and 0 otherwise.  If the IO lock is
  * obtained but the inode lock cannot be, then the IO lock
  * is dropped before returning.
  *
  * ip -- the inode being locked
  * lock_flags -- this parameter indicates the inode's locks to be
- *	 to be locked.	See the comment for xfs_ilock() for a list
+ *       to be locked.  See the comment for xfs_ilock() for a list
  *	 of valid values.
  *
  */
@@ -866,18 +890,18 @@
 
 /*
  * xfs_iunlock() is used to drop the inode locks acquired with
- * xfs_ilock() and xfs_ilock_nowait().	The caller must pass
+ * xfs_ilock() and xfs_ilock_nowait().  The caller must pass
  * in the flags given to xfs_ilock() or xfs_ilock_nowait() so
  * that we know which locks to drop.
  *
  * ip -- the inode being unlocked
  * lock_flags -- this parameter indicates the inode's locks to be
- *	 to be unlocked.  See the comment for xfs_ilock() for a list
+ *       to be unlocked.  See the comment for xfs_ilock() for a list
  *	 of valid values for this parameter.
  *
  */
 void
-xfs_iunlock(xfs_inode_t *ip,
+xfs_iunlock(xfs_inode_t	*ip,
 	    uint	lock_flags)
 {
 	/*
@@ -924,7 +948,7 @@
 }
 
 /*
- * give up write locks.	 the i/o lock cannot be held nested
+ * give up write locks.  the i/o lock cannot be held nested
  * if it is being demoted.
  */
 void
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_imap.h linux-2.5.68-bk12/fs/xfs/xfs_imap.h
--- linux-2.5.68-bk11/fs/xfs/xfs_imap.h	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_imap.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_IMAP_H__
-#define __XFS_IMAP_H__
+#define	__XFS_IMAP_H__
 
 /*
  * This is the structure passed to xfs_imap() to map
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_inode.c linux-2.5.68-bk12/fs/xfs/xfs_inode.c
--- linux-2.5.68-bk11/fs/xfs/xfs_inode.c	2003-04-19 19:51:12.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_inode.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,8 +30,41 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-#include <asm/unaligned.h>	/* for get_unaligned, put_unaligned */
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_imap.h"
+#include "xfs_alloc.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_buf_item.h"
+#include "xfs_rw.h"
+#include "xfs_error.h"
+#include "xfs_bit.h"
+#include "xfs_utils.h"
+#include "xfs_dir2_trace.h"
+#include "xfs_quota.h"
+#include "xfs_mac.h"
+#include "xfs_acl.h"
 
 
 kmem_zone_t *xfs_ifork_zone;
@@ -42,7 +75,7 @@
  * Used in xfs_itruncate().  This is the maximum number of extents
  * freed from a file in a single transaction.
  */
-#define XFS_ITRUNC_MAX_EXTENTS	2
+#define	XFS_ITRUNC_MAX_EXTENTS	2
 
 STATIC int xfs_iflush_int(xfs_inode_t *, xfs_buf_t *);
 STATIC int xfs_iformat_local(xfs_inode_t *, xfs_dinode_t *, int, int);
@@ -102,7 +135,7 @@
 					i * mp->m_sb.sb_inodesize);
 		if (INT_ISZERO(dip->di_next_unlinked, ARCH_CONVERT))  {
 			xfs_fs_cmn_err(CE_ALERT, mp,
-				"Detected a bogus zero next_unlinked field in incore inode buffer 0x%p.	 About to pop an ASSERT.",
+				"Detected a bogus zero next_unlinked field in incore inode buffer 0x%p.  About to pop an ASSERT.",
 				bp);
 			ASSERT(!INT_ISZERO(dip->di_next_unlinked, ARCH_CONVERT));
 		}
@@ -128,7 +161,7 @@
 
 	j = mp->m_inode_cluster_size >> mp->m_sb.sb_inodelog;
 
-	for (i = 0; i < j; i++)	 {
+	for (i = 0; i < j; i++)  {
 		dip = (xfs_dinode_t *) xfs_buf_offset(bp,
 						i * mp->m_sb.sb_inodesize);
 		if (INT_GET(dip->di_core.di_magic, ARCH_CONVERT) != XFS_DINODE_MAGIC) {
@@ -205,13 +238,13 @@
 	    XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) {
 		cmn_err(CE_WARN,
 	"xfs_inotobp: inode number (%d + %d) maps to a block outside the bounds "
-	"of the file system %s.	 Returning EINVAL.",
+	"of the file system %s.  Returning EINVAL.",
 			imap.im_blkno, imap.im_len,mp->m_fsname);
 		return XFS_ERROR(EINVAL);
 	}
 
 	/*
-	 * Read in the buffer.	If tp is NULL, xfs_trans_read_buf() will
+	 * Read in the buffer.  If tp is NULL, xfs_trans_read_buf() will
 	 * default to just a read_buf() call.
 	 */
 	error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap.im_blkno,
@@ -232,7 +265,7 @@
 		XFS_CORRUPTION_ERROR("xfs_inotobp", XFS_ERRLEVEL_LOW, mp, dip);
 		xfs_trans_brelse(tp, bp);
 		cmn_err(CE_WARN,
-	"xfs_inotobp: XFS_TEST_ERROR()	returned an "
+	"xfs_inotobp: XFS_TEST_ERROR()  returned an "
 	"error on %s.  Returning EFSCORRUPTED.",  mp->m_fsname);
 		return XFS_ERROR(EFSCORRUPTED);
 	}
@@ -263,10 +296,10 @@
  * to determine the size and location of the buffer to read from disk.
  * If the inode has already been mapped to its buffer and read in once,
  * then use the mapping information stored in the inode rather than
- * calling xfs_imap().	This allows us to avoid the overhead of looking
+ * calling xfs_imap().  This allows us to avoid the overhead of looking
  * at the inode btree for small block file systems (see xfs_dilocate()).
  * We can tell whether the inode has been mapped in before by comparing
- * its disk block address to 0.	 Only uninitialized inodes will have
+ * its disk block address to 0.  Only uninitialized inodes will have
  * 0 for the disk block address.
  */
 int
@@ -337,7 +370,7 @@
 	ASSERT(bno == 0 || bno == imap.im_blkno);
 
 	/*
-	 * Read in the buffer.	If tp is NULL, xfs_trans_read_buf() will
+	 * Read in the buffer.  If tp is NULL, xfs_trans_read_buf() will
 	 * default to just a read_buf() call.
 	 */
 	error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap.im_blkno,
@@ -403,8 +436,8 @@
 
 /*
  * Move inode type and inode format specific information from the
- * on-disk inode to the in-core inode.	For fifos, devs, and sockets
- * this means set if_rdev to the proper value.	For files, directories,
+ * on-disk inode to the in-core inode.  For fifos, devs, and sockets
+ * this means set if_rdev to the proper value.  For files, directories,
  * and symlinks this means to bring in the in-line data or extent
  * pointers.  For a file in B-tree format, only the root is immediately
  * brought in-core.  The rest will be in-lined in if_extents when it
@@ -418,7 +451,7 @@
 	xfs_attr_shortform_t	*atp;
 	int			size;
 	int			error;
-	xfs_fsize_t		di_size;
+	xfs_fsize_t             di_size;
 	ip->i_df.if_ext_max =
 		XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t);
 	error = 0;
@@ -618,14 +651,12 @@
 	xfs_dinode_t	*dip,
 	int		whichfork)
 {
+	xfs_bmbt_rec_t	*ep, *dp;
 	xfs_ifork_t	*ifp;
 	int		nex;
 	int		real_size;
 	int		size;
-#if ARCH_CONVERT != ARCH_NOCONVERT
 	int		i;
-#endif
-	xfs_bmbt_rec_t	*ep, *dp;
 
 	ifp = XFS_IFORK_PTR(ip, whichfork);
 	nex = XFS_DFORK_NEXTENTS_ARCH(dip, whichfork, ARCH_CONVERT);
@@ -752,72 +783,75 @@
  * xfs_xlate_dinode_core - translate an xfs_inode_core_t between ondisk
  * and native format
  *
- * buf	= on-disk representation
- * dip	= native representation
- * dir	= direction - +ve -> disk to native
- *		      -ve -> native to disk
+ * buf  = on-disk representation
+ * dip  = native representation
+ * dir  = direction - +ve -> disk to native
+ *                    -ve -> native to disk
  * arch = on-disk architecture
  */
-
 void
-xfs_xlate_dinode_core(xfs_caddr_t buf, xfs_dinode_core_t *dip,
-    int dir, xfs_arch_t arch)
-{
-    xfs_dinode_core_t	*buf_core;
-    xfs_dinode_core_t	*mem_core;
-
-    ASSERT(dir);
-
-    buf_core=(xfs_dinode_core_t*)buf;
-    mem_core=(xfs_dinode_core_t*)dip;
+xfs_xlate_dinode_core(
+	xfs_caddr_t		buf,
+	xfs_dinode_core_t	*dip,
+	int			dir,
+	xfs_arch_t		arch)
+{
+	xfs_dinode_core_t	*buf_core = (xfs_dinode_core_t *)buf;
+	xfs_dinode_core_t	*mem_core = (xfs_dinode_core_t *)dip;
+
+	ASSERT(dir);
+	if (arch == ARCH_NOCONVERT) {
+		if (dir > 0) {
+			memcpy((xfs_caddr_t)mem_core, (xfs_caddr_t)buf_core,
+				sizeof(xfs_dinode_core_t));
+		} else {
+			memcpy((xfs_caddr_t)buf_core, (xfs_caddr_t)mem_core,
+				sizeof(xfs_dinode_core_t));
+		}
+		return;
+	}
 
-    if (arch == ARCH_NOCONVERT) {
-	if (dir>0) {
-	    memcpy((xfs_caddr_t)mem_core, (xfs_caddr_t)buf_core, sizeof(xfs_dinode_core_t));
+	INT_XLATE(buf_core->di_magic, mem_core->di_magic, dir, arch);
+	INT_XLATE(buf_core->di_mode, mem_core->di_mode, dir, arch);
+	INT_XLATE(buf_core->di_version,	mem_core->di_version, dir, arch);
+	INT_XLATE(buf_core->di_format, mem_core->di_format, dir, arch);
+	INT_XLATE(buf_core->di_onlink, mem_core->di_onlink, dir, arch);
+	INT_XLATE(buf_core->di_uid, mem_core->di_uid, dir, arch);
+	INT_XLATE(buf_core->di_gid, mem_core->di_gid, dir, arch);
+	INT_XLATE(buf_core->di_nlink, mem_core->di_nlink, dir, arch);
+	INT_XLATE(buf_core->di_projid, mem_core->di_projid, dir, arch);
+
+	if (dir > 0) {
+		memcpy(mem_core->di_pad, buf_core->di_pad,
+			sizeof(buf_core->di_pad));
 	} else {
-	    memcpy((xfs_caddr_t)buf_core, (xfs_caddr_t)mem_core, sizeof(xfs_dinode_core_t));
+		memcpy(buf_core->di_pad, mem_core->di_pad,
+			sizeof(buf_core->di_pad));
 	}
-	return;
-    }
-
-    INT_XLATE(buf_core->di_magic,	mem_core->di_magic,	   dir, arch);
-    INT_XLATE(buf_core->di_mode,	mem_core->di_mode,	   dir, arch);
-    INT_XLATE(buf_core->di_version,	mem_core->di_version,	   dir, arch);
-    INT_XLATE(buf_core->di_format,	mem_core->di_format,	   dir, arch);
-    INT_XLATE(buf_core->di_onlink,	mem_core->di_onlink,	   dir, arch);
-    INT_XLATE(buf_core->di_uid,		mem_core->di_uid,	   dir, arch);
-    INT_XLATE(buf_core->di_gid,		mem_core->di_gid,	   dir, arch);
-    INT_XLATE(buf_core->di_nlink,	mem_core->di_nlink,	   dir, arch);
-    INT_XLATE(buf_core->di_projid,	mem_core->di_projid,	   dir, arch);
-
-    if (dir>0) {
-	memcpy(mem_core->di_pad, buf_core->di_pad, sizeof(buf_core->di_pad));
-    } else {
-	memcpy(buf_core->di_pad, mem_core->di_pad, sizeof(buf_core->di_pad));
-    }
-
-    INT_XLATE(buf_core->di_atime.t_sec, mem_core->di_atime.t_sec,  dir, arch);
-    INT_XLATE(buf_core->di_atime.t_nsec,mem_core->di_atime.t_nsec, dir, arch);
-
-    INT_XLATE(buf_core->di_mtime.t_sec, mem_core->di_mtime.t_sec,  dir, arch);
-    INT_XLATE(buf_core->di_mtime.t_nsec,mem_core->di_mtime.t_nsec, dir, arch);
-
-    INT_XLATE(buf_core->di_ctime.t_sec, mem_core->di_ctime.t_sec,  dir, arch);
-    INT_XLATE(buf_core->di_ctime.t_nsec,mem_core->di_ctime.t_nsec, dir, arch);
-
-    INT_XLATE(buf_core->di_size,	mem_core->di_size,	   dir, arch);
-    INT_XLATE(buf_core->di_nblocks,	mem_core->di_nblocks,	   dir, arch);
-    INT_XLATE(buf_core->di_extsize,	mem_core->di_extsize,	   dir, arch);
-
-    INT_XLATE(buf_core->di_nextents,	mem_core->di_nextents,	   dir, arch);
-    INT_XLATE(buf_core->di_anextents,	mem_core->di_anextents,	   dir, arch);
-    INT_XLATE(buf_core->di_forkoff,	mem_core->di_forkoff,	   dir, arch);
-    INT_XLATE(buf_core->di_aformat,	mem_core->di_aformat,	   dir, arch);
-    INT_XLATE(buf_core->di_dmevmask,	mem_core->di_dmevmask,	   dir, arch);
-    INT_XLATE(buf_core->di_dmstate,	mem_core->di_dmstate,	   dir, arch);
-    INT_XLATE(buf_core->di_flags,	mem_core->di_flags,	   dir, arch);
-    INT_XLATE(buf_core->di_gen,		mem_core->di_gen,	   dir, arch);
 
+	INT_XLATE(buf_core->di_atime.t_sec, mem_core->di_atime.t_sec,
+			dir, arch);
+	INT_XLATE(buf_core->di_atime.t_nsec, mem_core->di_atime.t_nsec,
+			dir, arch);
+	INT_XLATE(buf_core->di_mtime.t_sec, mem_core->di_mtime.t_sec,
+			dir, arch);
+	INT_XLATE(buf_core->di_mtime.t_nsec, mem_core->di_mtime.t_nsec,
+			dir, arch);
+	INT_XLATE(buf_core->di_ctime.t_sec, mem_core->di_ctime.t_sec,
+			dir, arch);
+	INT_XLATE(buf_core->di_ctime.t_nsec, mem_core->di_ctime.t_nsec,
+			dir, arch);
+	INT_XLATE(buf_core->di_size, mem_core->di_size, dir, arch);
+	INT_XLATE(buf_core->di_nblocks, mem_core->di_nblocks, dir, arch);
+	INT_XLATE(buf_core->di_extsize, mem_core->di_extsize, dir, arch);
+	INT_XLATE(buf_core->di_nextents, mem_core->di_nextents, dir, arch);
+	INT_XLATE(buf_core->di_anextents, mem_core->di_anextents, dir, arch);
+	INT_XLATE(buf_core->di_forkoff, mem_core->di_forkoff, dir, arch);
+	INT_XLATE(buf_core->di_aformat, mem_core->di_aformat, dir, arch);
+	INT_XLATE(buf_core->di_dmevmask, mem_core->di_dmevmask, dir, arch);
+	INT_XLATE(buf_core->di_dmstate, mem_core->di_dmstate, dir, arch);
+	INT_XLATE(buf_core->di_flags, mem_core->di_flags, dir, arch);
+	INT_XLATE(buf_core->di_gen, mem_core->di_gen, dir, arch);
 }
 
 /*
@@ -851,7 +885,7 @@
 	 * Get pointer's to the on-disk inode and the buffer containing it.
 	 * If the inode number refers to a block outside the file system
 	 * then xfs_itobp() will return NULL.  In this case we should
-	 * return NULL as well.	 Set i_blkno to 0 so that xfs_itobp() will
+	 * return NULL as well.  Set i_blkno to 0 so that xfs_itobp() will
 	 * know that this is a new incore inode.
 	 */
 	error = xfs_itobp(mp, tp, ip, &dip, &bp, bno);
@@ -936,7 +970,7 @@
 		ip->i_d.di_mode = 0;
 		/*
 		 * Initialize the per-fork minima and maxima for a new
-		 * inode here.	xfs_iformat will do it for old inodes.
+		 * inode here.  xfs_iformat will do it for old inodes.
 		 */
 		ip->i_df.if_ext_max =
 			XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t);
@@ -945,10 +979,10 @@
 	/*
 	 * The inode format changed when we moved the link count and
 	 * made it 32 bits long.  If this is an old format inode,
-	 * convert it in memory to look like a new one.	 If it gets
+	 * convert it in memory to look like a new one.  If it gets
 	 * flushed to disk we will convert back before flushing or
-	 * logging it.	We zero out the new projid field and the old link
-	 * count field.	 We'll handle clearing the pad field (the remains
+	 * logging it.  We zero out the new projid field and the old link
+	 * count field.  We'll handle clearing the pad field (the remains
 	 * of the old uuid field) when we actually convert the inode to
 	 * the new format. We don't change the version number so that we
 	 * can distinguish this from a real new format inode.
@@ -963,7 +997,7 @@
 
 	/*
 	 * Mark the buffer containing the inode as something to keep
-	 * around for a while.	This helps to keep recently accessed
+	 * around for a while.  This helps to keep recently accessed
 	 * meta-data in-core longer.
 	 */
 	 XFS_BUF_SET_REF(bp, XFS_INO_REF);
@@ -974,7 +1008,7 @@
 	 * in xfs_itobp() above.  If tp is NULL, this is just a normal
 	 * brelse().  If we're within a transaction, then xfs_trans_brelse()
 	 * will only release the buffer if it is not dirty within the
-	 * transaction.	 It will be OK to release the buffer in this case,
+	 * transaction.  It will be OK to release the buffer in this case,
 	 * because inodes on disk are never destroyed and we will be
 	 * locking the new in-core inode before putting it in the hash
 	 * table where other processes can find it.  Thus we don't have
@@ -1217,7 +1251,7 @@
 {
 	xfs_fileoff_t	map_first;
 	int		nimaps;
-	xfs_bmbt_irec_t imaps[2];
+	xfs_bmbt_irec_t	imaps[2];
 
 	if ((ip->i_d.di_mode & IFMT) != IFREG)
 		return;
@@ -1244,12 +1278,12 @@
 #endif	/* DEBUG */
 
 /*
- * Calculate the last possible buffered byte in a file.	 This must
+ * Calculate the last possible buffered byte in a file.  This must
  * include data that was buffered beyond the EOF by the write code.
  * This also needs to deal with overflowing the xfs_fsize_t type
  * which can happen for sizes near the limit.
  *
- * We also need to take into account any blocks beyond the EOF.	 It
+ * We also need to take into account any blocks beyond the EOF.  It
  * may be the case that they were buffered by a write which failed.
  * In that case the pages will still be in memory, but the inode size
  * will never have been updated.
@@ -1329,7 +1363,7 @@
 		     (void*)0);
 }
 #else
-#define xfs_itrunc_trace(tag, ip, flag, new_size, toss_start, toss_finish)
+#define	xfs_itrunc_trace(tag, ip, flag, new_size, toss_start, toss_finish)
 #endif
 
 /*
@@ -1345,10 +1379,10 @@
  * inode lock when we do so.
  *
  * The flags parameter can have either the value XFS_ITRUNC_DEFINITE
- * or XFS_ITRUNC_MAYBE.	 The XFS_ITRUNC_MAYBE value should be used
+ * or XFS_ITRUNC_MAYBE.  The XFS_ITRUNC_MAYBE value should be used
  * in the case that the caller is locking things out of order and
  * may not be able to call xfs_itruncate_finish() with the inode lock
- * held without dropping the I/O lock.	If the caller must drop the
+ * held without dropping the I/O lock.  If the caller must drop the
  * I/O lock before calling xfs_itruncate_finish(), then xfs_itruncate_start()
  * must be called again with all the same restrictions as the initial
  * call.
@@ -1438,11 +1472,11 @@
  * for it within the transaction.
  *
  * The fork parameter must be either xfs_attr_fork or xfs_data_fork,
- * and it indicates the fork which is to be truncated.	For the
+ * and it indicates the fork which is to be truncated.  For the
  * attribute fork we only support truncation to size 0.
  *
  * We use the sync parameter to indicate whether or not the first
- * transaction we perform might have to be synchronous.	 For the attr fork,
+ * transaction we perform might have to be synchronous.  For the attr fork,
  * it needs to be so if the unlink of the inode is not yet known to be
  * permanent in the log.  This keeps us from freeing and reusing the
  * blocks of the attribute fork before the unlink of the inode becomes
@@ -1480,7 +1514,7 @@
 	xfs_trans_t	*ntp;
 	int		done;
 	int		committed;
-	xfs_bmap_free_t free_list;
+	xfs_bmap_free_t	free_list;
 	int		error;
 
 	ASSERT(ismrlocked(&ip->i_iolock, MR_UPDATE) != 0);
@@ -1509,7 +1543,7 @@
 	 * The first thing we do is set the size to new_size permanently
 	 * on disk.  This way we don't have to worry about anyone ever
 	 * being able to look at the data being freed even in the face
-	 * of a crash.	What we're getting around here is the case where
+	 * of a crash.  What we're getting around here is the case where
 	 * we free a block, it is allocated to another file, it is written
 	 * to, and then we crash.  If the new data gets written to the
 	 * file but the log buffers containing the free and reallocation
@@ -1552,7 +1586,7 @@
 	 *
 	 * For the attribute fork we allow the caller to tell us whether
 	 * the unlink of the inode that led to this call is yet permanent
-	 * in the on disk log.	If it is not and we will be freeing extents
+	 * in the on disk log.  If it is not and we will be freeing extents
 	 * in this inode then we make the first transaction synchronous
 	 * to make sure that the unlink is permanent by the time we free
 	 * the blocks.
@@ -1577,7 +1611,7 @@
 	 * the end of the file (in a crash where the space is allocated
 	 * but the inode size is not yet updated), simply remove any
 	 * blocks which show up between the new EOF and the maximum
-	 * possible file size.	If the first block to be removed is
+	 * possible file size.  If the first block to be removed is
 	 * beyond the maximum file size (ie it is the same as last_block),
 	 * then there is nothing to do.
 	 */
@@ -1593,7 +1627,7 @@
 		/*
 		 * Free up up to XFS_ITRUNC_MAX_EXTENTS.  xfs_bunmapi()
 		 * will tell us whether it freed the entire range or
-		 * not.	 If this is a synchronous mount (wsync),
+		 * not.  If this is a synchronous mount (wsync),
 		 * then we can tell bunmapi to keep all the
 		 * transactions asynchronous since the unlink
 		 * transaction that made this inode inactive has
@@ -1650,7 +1684,7 @@
 				 * level code, because it always knows that
 				 * the inode is locked and held in the
 				 * transaction that returns to it whether
-				 * errors occur or not.	 We don't mark the
+				 * errors occur or not.  We don't mark the
 				 * inode dirty so that this transaction can
 				 * be easily aborted if possible.
 				 */
@@ -1845,7 +1879,7 @@
 	if (INT_GET(agi->agi_unlinked[bucket_index], ARCH_CONVERT) != NULLAGINO) {
 		/*
 		 * There is already another inode in the bucket we need
-		 * to add ourselves to.	 Add us at the front of the list.
+		 * to add ourselves to.  Add us at the front of the list.
 		 * Here we put the head pointer into our next pointer,
 		 * and then we fall through to point the head at us.
 		 */
@@ -1918,7 +1952,7 @@
 				   XFS_FSS_TO_BB(mp, 1), 0, &agibp);
 	if (error) {
 		cmn_err(CE_WARN,
-			"xfs_iunlink_remove: xfs_trans_read_buf()  returned an error %d on %s.	Returning error.",
+			"xfs_iunlink_remove: xfs_trans_read_buf()  returned an error %d on %s.  Returning error.",
 			error, mp->m_fsname);
 		return error;
 	}
@@ -1935,7 +1969,7 @@
 				     mp, agi);
 		xfs_trans_brelse(tp, agibp);
 		cmn_err(CE_WARN,
-			"xfs_iunlink_remove: XFS_TEST_ERROR()  returned an error on %s.	 Returning EFSCORRUPTED.",
+			"xfs_iunlink_remove: XFS_TEST_ERROR()  returned an error on %s.  Returning EFSCORRUPTED.",
 			 mp->m_fsname);
 		return XFS_ERROR(EFSCORRUPTED);
 	}
@@ -1953,7 +1987,7 @@
 		/*
 		 * We're at the head of the list.  Get the inode's
 		 * on-disk buffer to see if there is anyone after us
-		 * on the list.	 Only modify our next pointer if it
+		 * on the list.  Only modify our next pointer if it
 		 * is not already NULLAGINO.  This saves us the overhead
 		 * of dealing with the buffer when there is no need to
 		 * change it.
@@ -2008,7 +2042,7 @@
 					    &last_ibp, &last_offset);
 			if (error) {
 				cmn_err(CE_WARN,
-			"xfs_iunlink_remove: xfs_inotobp()  returned an error %d on %s.	 Returning error.",
+			"xfs_iunlink_remove: xfs_inotobp()  returned an error %d on %s.  Returning error.",
 					error, mp->m_fsname);
 				return error;
 			}
@@ -2058,7 +2092,7 @@
 /*
  * This is called to return an inode to the inode free list.
  * The inode should already be truncated to 0 length and have
- * no pages associated with it.	 This routine also assumes that
+ * no pages associated with it.  This routine also assumes that
  * the inode is already a part of the transaction.
  *
  * The on-disk copy of the inode will have been added to the list
@@ -2116,12 +2150,12 @@
  * being added or deleted as indicated in rec_diff.  Move the records
  * and pointers in if_broot to fit the new size.  When shrinking this
  * will eliminate holes between the records and pointers created by
- * the caller.	When growing this will create holes to be filled in
+ * the caller.  When growing this will create holes to be filled in
  * by the caller.
  *
  * The caller must not request to add more records than would fit in
  * the on-disk inode root.  If the if_broot is currently NULL, then
- * if we adding records one will be allocated.	The caller must also
+ * if we adding records one will be allocated.  The caller must also
  * not request that the number of records go below zero, although
  * it can go to zero.
  *
@@ -2389,7 +2423,7 @@
 		 * Stuck with malloc/realloc.
 		 * For inline data, the underlying buffer must be
 		 * a multiple of 4 bytes in size so that it can be
-		 * logged and stay on word boundaries.	We enforce
+		 * logged and stay on word boundaries.  We enforce
 		 * that here.
 		 */
 		real_size = roundup(new_size, 4);
@@ -2476,7 +2510,7 @@
 
 	/*
 	 * If the format is local, then we can't have an extents
-	 * array so just look for an inline data array.	 If we're
+	 * array so just look for an inline data array.  If we're
 	 * not local then we may or may not have an extents list,
 	 * so check and free it up if we do.
 	 */
@@ -2581,7 +2615,7 @@
 
 /*
  * Decrement the pin count of the given inode, and wake up
- * anyone in xfs_iwait_unpin() if the count goes to 0.	The
+ * anyone in xfs_iwait_unpin() if the count goes to 0.  The
  * inode must have been previoulsy pinned with a call to xfs_ipin().
  */
 void
@@ -2867,7 +2901,7 @@
 
 	/*
 	 * We can't flush the inode until it is unpinned, so
-	 * wait for it.	 We know noone new can pin it, because
+	 * wait for it.  We know noone new can pin it, because
 	 * we are holding the inode lock shared and you need
 	 * to hold it exclusively to pin the inode.
 	 */
@@ -2967,7 +3001,7 @@
 	for (iq = ip->i_cnext; iq != ip; iq = iq->i_cnext) {
 		/*
 		 * Do an un-protected check to see if the inode is dirty and
-		 * is a candidate for flushing.	 These checks will be repeated
+		 * is a candidate for flushing.  These checks will be repeated
 		 * later after the appropriate locks are acquired.
 		 */
 		iip = iq->i_itemp;
@@ -3049,13 +3083,13 @@
 	return XFS_ERROR(EFSCORRUPTED);
 
 cluster_corrupt_out:
-	/* Corruption detected in the clustering loop.	Invalidate the
+	/* Corruption detected in the clustering loop.  Invalidate the
 	 * inode buffer and shut down the filesystem.
 	 */
 	mutex_spinunlock(&ch->ch_lock, s);
 
 	/*
-	 * Clean up the buffer.	 If it was B_DELWRI, just release it --
+	 * Clean up the buffer.  If it was B_DELWRI, just release it --
 	 * brelse can handle it with no problems.  If not, shut down the
 	 * filesystem before releasing the buffer.
 	 */
@@ -3135,7 +3169,7 @@
 	 * so if we clear i_update_core after they set it we
 	 * are guaranteed to see their updates to the timestamps.
 	 * I believe that this depends on strongly ordered memory
-	 * semantics, but we have that.	 We use the SYNCHRONIZE
+	 * semantics, but we have that.  We use the SYNCHRONIZE
 	 * macro to make sure that the compiler does not reorder
 	 * the i_update_core access below the data copy below.
 	 */
@@ -3252,7 +3286,7 @@
 	/*
 	 * We've recorded everything logged in the inode, so we'd
 	 * like to clear the ilf_fields bits so we don't log and
-	 * flush things unnecessarily.	However, we can't stop
+	 * flush things unnecessarily.  However, we can't stop
 	 * logging all this information until the data we've copied
 	 * into the disk buffer is written to disk.  If we did we might
 	 * overwrite the copy of the inode in the log with all the
@@ -3263,7 +3297,7 @@
 	 * When logging the inode, these bits are moved back to the
 	 * ilf_fields field.  In the xfs_iflush_done() routine we
 	 * clear ili_last_fields, since we know that the information
-	 * those bits represent is permanently on disk.	 As long as
+	 * those bits represent is permanently on disk.  As long as
 	 * the flush completes before the inode is logged again, then
 	 * both ilf_fields and ili_last_fields will be cleared.
 	 *
@@ -3282,7 +3316,7 @@
 		iip->ili_format.ilf_fields = 0;
 		iip->ili_logged = 1;
 
-		ASSERT(sizeof(xfs_lsn_t) == 8); /* don't lock if it shrinks */
+		ASSERT(sizeof(xfs_lsn_t) == 8);	/* don't lock if it shrinks */
 		AIL_LOCK(mp,s);
 		iip->ili_flush_lsn = iip->ili_item.li_lsn;
 		AIL_UNLOCK(mp, s);
@@ -3395,7 +3429,7 @@
 			 * nonexistent vnode.  We break from the loop
 			 * since we know that we modify
 			 * it by pulling ourselves from it in xfs_reclaim()
-			 * called via vn_purge() below.	 Set ip to the next
+			 * called via vn_purge() below.  Set ip to the next
 			 * entry in the list anyway so we'll know below
 			 * whether we reached the end or not.
 			 */
@@ -3493,7 +3527,7 @@
 
 /*
  * Return whether or not it is OK to swap to the given file in the
- * given range.	 Return 0 for OK and otherwise return the error.
+ * given range.  Return 0 for OK and otherwise return the error.
  *
  * It is only OK to swap to a file if it has no holes, and all
  * extents have been initialized.
@@ -3564,7 +3598,7 @@
 
 	/*
 	 * We're not supposed to change timestamps in readonly-mounted
-	 * filesystems.	 Throw it away if anyone asks us.
+	 * filesystems.  Throw it away if anyone asks us.
 	 */
 	if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
 		return;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_inode.h linux-2.5.68-bk12/fs/xfs/xfs_inode.h
--- linux-2.5.68-bk11/fs/xfs/xfs_inode.h	2003-04-19 19:50:30.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_inode.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,19 +29,19 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_INODE_H__
-#define __XFS_INODE_H__
+#ifndef	__XFS_INODE_H__
+#define	__XFS_INODE_H__
 
 /*
  * File incore extent information, present for each of data & attr forks.
  */
-#define XFS_INLINE_EXTS 2
-#define XFS_INLINE_DATA 32
+#define	XFS_INLINE_EXTS	2
+#define	XFS_INLINE_DATA	32
 typedef struct xfs_ifork {
 	int			if_bytes;	/* bytes in if_u1 */
 	int			if_real_bytes;	/* bytes allocated in if_u1 */
 	xfs_bmbt_block_t	*if_broot;	/* file's incore btree root */
-	short			if_broot_bytes; /* bytes allocated for root */
+	short			if_broot_bytes;	/* bytes allocated for root */
 	unsigned char		if_flags;	/* per-fork flags */
 	unsigned char		if_ext_max;	/* max # of extent records */
 	xfs_extnum_t		if_lastex;	/* last if_extents used */
@@ -62,26 +62,26 @@
 /*
  * Flags for xfs_ichgtime().
  */
-#define XFS_ICHGTIME_MOD	0x1	/* data fork modification timestamp */
-#define XFS_ICHGTIME_ACC	0x2	/* data fork access timestamp */
-#define XFS_ICHGTIME_CHG	0x4	/* inode field change timestamp */
+#define	XFS_ICHGTIME_MOD	0x1	/* data fork modification timestamp */
+#define	XFS_ICHGTIME_ACC	0x2	/* data fork access timestamp */
+#define	XFS_ICHGTIME_CHG	0x4	/* inode field change timestamp */
 
 /*
  * Per-fork incore inode flags.
  */
-#define XFS_IFINLINE	0x0001	/* Inline data is read in */
-#define XFS_IFEXTENTS	0x0002	/* All extent pointers are read in */
-#define XFS_IFBROOT	0x0004	/* i_broot points to the bmap b-tree root */
+#define	XFS_IFINLINE	0x0001	/* Inline data is read in */
+#define	XFS_IFEXTENTS	0x0002	/* All extent pointers are read in */
+#define	XFS_IFBROOT	0x0004	/* i_broot points to the bmap b-tree root */
 
 /*
  * Flags for xfs_imap() and xfs_dilocate().
  */
-#define XFS_IMAP_LOOKUP		0x1
+#define	XFS_IMAP_LOOKUP		0x1
 
 /*
  * Maximum number of extent pointers in if_u1.if_extents.
  */
-#define XFS_MAX_INCORE_EXTENTS	32768
+#define	XFS_MAX_INCORE_EXTENTS	32768
 
 
 #ifdef __KERNEL__
@@ -144,8 +144,8 @@
 
 } xfs_iocore_t;
 
-#define	       io_dmevmask     io_dmattrs.da_dmevmask
-#define	       io_dmstate      io_dmattrs.da_dmstate
+#define        io_dmevmask     io_dmattrs.da_dmevmask
+#define        io_dmstate      io_dmattrs.da_dmstate
 
 #define XFS_IO_INODE(io)	((xfs_inode_t *) ((io)->io_obj))
 #define XFS_IO_DCXVN(io)	((dcxvn_t *) ((io)->io_obj))
@@ -170,7 +170,7 @@
  * file system to hash the inodes for that file system.
  */
 typedef struct xfs_ihash {
-	struct xfs_inode	*ih_next;	
+	struct xfs_inode	*ih_next;
 	rwlock_t		ih_lock;
 	uint			ih_version;
 } xfs_ihash_t;
@@ -182,7 +182,7 @@
 #define XFS_IHASH(mp,ino) ((mp)->m_ihash + (((uint)ino) % (mp)->m_ihsize))
 
 /*
- * This is the xfs inode cluster hash.	This hash is used by xfs_iflush to
+ * This is the xfs inode cluster hash.  This hash is used by xfs_iflush to
  * find inodes that share a cluster and can be flushed to disk at the same
  * time.
  */
@@ -208,7 +208,7 @@
  * Most of the on-disk inode is embedded in the i_d field.
  *
  * The extent pointers/inline file space, however, are managed
- * separately.	The memory for this information is pointed to by
+ * separately.  The memory for this information is pointed to by
  * the if_u1 unions depending on the type of the data.
  * This is used to linearize the array of extents for fast in-core
  * access.  This is used until the file's number of extents
@@ -274,7 +274,7 @@
 	unsigned char		i_update_core;	/* timestamps/size is dirty */
 	unsigned char		i_update_size;	/* di_size field is dirty */
 	unsigned int		i_gen;		/* generation count */
-	unsigned int		i_delayed_blks; /* count of delay alloc blks */
+	unsigned int		i_delayed_blks;	/* count of delay alloc blks */
 
 	xfs_dinode_core_t	i_d;		/* most of ondisk inode */
 	xfs_chashlist_t		*i_chash;	/* cluster hash list header */
@@ -286,7 +286,7 @@
 	struct ktrace		*i_xtrace;	/* inode extent list trace */
 	struct ktrace		*i_btrace;	/* inode bmap btree trace */
 	struct ktrace		*i_rwtrace;	/* inode read/write trace */
-	struct ktrace		*i_strat_trace; /* inode strat_write trace */
+	struct ktrace		*i_strat_trace;	/* inode strat_write trace */
 	struct ktrace		*i_lock_trace;	/* inode lock/unlock trace */
 	struct ktrace		*i_dir_trace;	/* inode directory trace */
 #endif /* DEBUG */
@@ -300,57 +300,57 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_PTR)
 xfs_ifork_t *xfs_ifork_ptr(xfs_inode_t *ip, int w);
-#define XFS_IFORK_PTR(ip,w)		xfs_ifork_ptr(ip,w)
+#define	XFS_IFORK_PTR(ip,w)		xfs_ifork_ptr(ip,w)
 #else
-#define XFS_IFORK_PTR(ip,w)   ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp)
+#define	XFS_IFORK_PTR(ip,w)   ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_Q)
 int xfs_ifork_q(xfs_inode_t *ip);
-#define XFS_IFORK_Q(ip)			xfs_ifork_q(ip)
+#define	XFS_IFORK_Q(ip)			xfs_ifork_q(ip)
 #else
-#define XFS_IFORK_Q(ip)			XFS_CFORK_Q(&(ip)->i_d)
+#define	XFS_IFORK_Q(ip)			XFS_CFORK_Q(&(ip)->i_d)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_DSIZE)
 int xfs_ifork_dsize(xfs_inode_t *ip);
-#define XFS_IFORK_DSIZE(ip)		xfs_ifork_dsize(ip)
+#define	XFS_IFORK_DSIZE(ip)		xfs_ifork_dsize(ip)
 #else
-#define XFS_IFORK_DSIZE(ip)		XFS_CFORK_DSIZE(&ip->i_d, ip->i_mount)
+#define	XFS_IFORK_DSIZE(ip)		XFS_CFORK_DSIZE(&ip->i_d, ip->i_mount)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_ASIZE)
 int xfs_ifork_asize(xfs_inode_t *ip);
-#define XFS_IFORK_ASIZE(ip)		xfs_ifork_asize(ip)
+#define	XFS_IFORK_ASIZE(ip)		xfs_ifork_asize(ip)
 #else
-#define XFS_IFORK_ASIZE(ip)		XFS_CFORK_ASIZE(&ip->i_d, ip->i_mount)
+#define	XFS_IFORK_ASIZE(ip)		XFS_CFORK_ASIZE(&ip->i_d, ip->i_mount)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_SIZE)
 int xfs_ifork_size(xfs_inode_t *ip, int w);
-#define XFS_IFORK_SIZE(ip,w)		xfs_ifork_size(ip,w)
+#define	XFS_IFORK_SIZE(ip,w)		xfs_ifork_size(ip,w)
 #else
-#define XFS_IFORK_SIZE(ip,w)		XFS_CFORK_SIZE(&ip->i_d, ip->i_mount, w)
+#define	XFS_IFORK_SIZE(ip,w)		XFS_CFORK_SIZE(&ip->i_d, ip->i_mount, w)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_FORMAT)
 int xfs_ifork_format(xfs_inode_t *ip, int w);
-#define XFS_IFORK_FORMAT(ip,w)		xfs_ifork_format(ip,w)
+#define	XFS_IFORK_FORMAT(ip,w)		xfs_ifork_format(ip,w)
 #else
-#define XFS_IFORK_FORMAT(ip,w)		XFS_CFORK_FORMAT(&ip->i_d, w)
+#define	XFS_IFORK_FORMAT(ip,w)		XFS_CFORK_FORMAT(&ip->i_d, w)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_FMT_SET)
 void xfs_ifork_fmt_set(xfs_inode_t *ip, int w, int n);
-#define XFS_IFORK_FMT_SET(ip,w,n)	xfs_ifork_fmt_set(ip,w,n)
+#define	XFS_IFORK_FMT_SET(ip,w,n)	xfs_ifork_fmt_set(ip,w,n)
 #else
-#define XFS_IFORK_FMT_SET(ip,w,n)	XFS_CFORK_FMT_SET(&ip->i_d, w, n)
+#define	XFS_IFORK_FMT_SET(ip,w,n)	XFS_CFORK_FMT_SET(&ip->i_d, w, n)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_NEXTENTS)
 int xfs_ifork_nextents(xfs_inode_t *ip, int w);
-#define XFS_IFORK_NEXTENTS(ip,w)	xfs_ifork_nextents(ip,w)
+#define	XFS_IFORK_NEXTENTS(ip,w)	xfs_ifork_nextents(ip,w)
 #else
-#define XFS_IFORK_NEXTENTS(ip,w)	XFS_CFORK_NEXTENTS(&ip->i_d, w)
+#define	XFS_IFORK_NEXTENTS(ip,w)	XFS_CFORK_NEXTENTS(&ip->i_d, w)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_NEXT_SET)
 void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
-#define XFS_IFORK_NEXT_SET(ip,w,n)	xfs_ifork_next_set(ip,w,n)
+#define	XFS_IFORK_NEXT_SET(ip,w,n)	xfs_ifork_next_set(ip,w,n)
 #else
-#define XFS_IFORK_NEXT_SET(ip,w,n)	XFS_CFORK_NEXT_SET(&ip->i_d, w, n)
+#define	XFS_IFORK_NEXT_SET(ip,w,n)	XFS_CFORK_NEXT_SET(&ip->i_d, w, n)
 #endif
 
 
@@ -359,25 +359,25 @@
 /*
  * In-core inode flags.
  */
-#define XFS_IGRIO	0x0001	/* inode used for guaranteed rate i/o */
-#define XFS_IUIOSZ	0x0002	/* inode i/o sizes have been explicitly set */
-#define XFS_IQUIESCE	0x0004	/* we have started quiescing for this inode */
-#define XFS_IRECLAIM	0x0008	/* we have started reclaiming this inode    */
+#define XFS_IGRIO	0x0001  /* inode used for guaranteed rate i/o */
+#define XFS_IUIOSZ	0x0002  /* inode i/o sizes have been explicitly set */
+#define XFS_IQUIESCE    0x0004  /* we have started quiescing for this inode */
+#define XFS_IRECLAIM    0x0008  /* we have started reclaiming this inode    */
 
 /*
  * Flags for inode locking.
  */
-#define XFS_IOLOCK_EXCL		0x001
-#define XFS_IOLOCK_SHARED	0x002
-#define XFS_ILOCK_EXCL		0x004
-#define XFS_ILOCK_SHARED	0x008
-#define XFS_IUNLOCK_NONOTIFY	0x010
+#define	XFS_IOLOCK_EXCL		0x001
+#define	XFS_IOLOCK_SHARED	0x002
+#define	XFS_ILOCK_EXCL		0x004
+#define	XFS_ILOCK_SHARED	0x008
+#define	XFS_IUNLOCK_NONOTIFY	0x010
 #define XFS_EXTENT_TOKEN_RD	0x040
 #define XFS_SIZE_TOKEN_RD	0x080
 #define XFS_EXTSIZE_RD		(XFS_EXTENT_TOKEN_RD|XFS_SIZE_TOKEN_RD)
 #define XFS_WILLLEND		0x100	/* Always acquire tokens for lending */
 #define XFS_EXTENT_TOKEN_WR	(XFS_EXTENT_TOKEN_RD | XFS_WILLLEND)
-#define XFS_SIZE_TOKEN_WR	(XFS_SIZE_TOKEN_RD | XFS_WILLLEND)
+#define XFS_SIZE_TOKEN_WR       (XFS_SIZE_TOKEN_RD | XFS_WILLLEND)
 #define XFS_EXTSIZE_WR		(XFS_EXTSIZE_RD | XFS_WILLLEND)
 
 
@@ -389,22 +389,22 @@
 /*
  * Flags for xfs_iflush()
  */
-#define XFS_IFLUSH_DELWRI_ELSE_SYNC	1
-#define XFS_IFLUSH_DELWRI_ELSE_ASYNC	2
-#define XFS_IFLUSH_SYNC			3
-#define XFS_IFLUSH_ASYNC		4
-#define XFS_IFLUSH_DELWRI		5
+#define	XFS_IFLUSH_DELWRI_ELSE_SYNC	1
+#define	XFS_IFLUSH_DELWRI_ELSE_ASYNC	2
+#define	XFS_IFLUSH_SYNC			3
+#define	XFS_IFLUSH_ASYNC		4
+#define	XFS_IFLUSH_DELWRI		5
 
 /*
  * Flags for xfs_iflush_all.
  */
-#define XFS_FLUSH_ALL		0x1
+#define	XFS_FLUSH_ALL		0x1
 
 /*
  * Flags for xfs_itruncate_start().
  */
-#define XFS_ITRUNC_DEFINITE	0x1
-#define XFS_ITRUNC_MAYBE	0x2
+#define	XFS_ITRUNC_DEFINITE	0x1
+#define	XFS_ITRUNC_MAYBE	0x2
 
 /*
  * max file offset is 2^(31+PAGE_SHIFT) - 1 (due to linux page cache)
@@ -416,22 +416,22 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOV)
 struct vnode *xfs_itov(xfs_inode_t *ip);
-#define XFS_ITOV(ip)		xfs_itov(ip)
+#define	XFS_ITOV(ip)		xfs_itov(ip)
 #else
-#define XFS_ITOV(ip)		BHV_TO_VNODE(XFS_ITOBHV(ip))
+#define	XFS_ITOV(ip)		BHV_TO_VNODE(XFS_ITOBHV(ip))
 #endif
-#define XFS_ITOV_NULL(ip)	BHV_TO_VNODE_NULL(XFS_ITOBHV(ip))
+#define	XFS_ITOV_NULL(ip)	BHV_TO_VNODE_NULL(XFS_ITOBHV(ip))
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOBHV)
 struct bhv_desc *xfs_itobhv(xfs_inode_t *ip);
-#define XFS_ITOBHV(ip)		xfs_itobhv(ip)
+#define	XFS_ITOBHV(ip)		xfs_itobhv(ip)
 #else
-#define XFS_ITOBHV(ip)		((struct bhv_desc *)(&((ip)->i_bhv_desc)))
+#define	XFS_ITOBHV(ip)		((struct bhv_desc *)(&((ip)->i_bhv_desc)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOI)
 xfs_inode_t *xfs_bhvtoi(struct bhv_desc *bhvp);
-#define XFS_BHVTOI(bhvp)	xfs_bhvtoi(bhvp)
+#define	XFS_BHVTOI(bhvp)	xfs_bhvtoi(bhvp)
 #else
-#define XFS_BHVTOI(bhvp)	\
+#define	XFS_BHVTOI(bhvp)	\
 	((xfs_inode_t *)((char *)(bhvp) - \
 			 (char *)&(((xfs_inode_t *)0)->i_bhv_desc)))
 #endif
@@ -461,7 +461,7 @@
 void		xfs_chash_free(struct xfs_mount *);
 xfs_inode_t	*xfs_inode_incore(struct xfs_mount *, xfs_ino_t,
 				  struct xfs_trans *);
-void		xfs_inode_lock_init(xfs_inode_t *, struct vnode *);
+void            xfs_inode_lock_init(xfs_inode_t *, struct vnode *);
 int		xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
 			 uint, xfs_inode_t **, xfs_daddr_t);
 void		xfs_iput(xfs_inode_t *, uint);
@@ -533,7 +533,7 @@
 #if defined(DEBUG)
 void		xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
 #else
-#define xfs_inobp_check(mp, bp)
+#define	xfs_inobp_check(mp, bp)
 #endif /* DEBUG */
 
 extern struct kmem_zone	*xfs_chashlist_zone;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_inode_item.c linux-2.5.68-bk12/fs/xfs/xfs_inode_item.c
--- linux-2.5.68-bk11/fs/xfs/xfs_inode_item.c	2003-04-19 19:50:09.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_inode_item.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -36,7 +36,32 @@
  * items as well as utility routines used by the inode specific
  * transaction routines.
  */
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_buf_item.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_trans_priv.h"
+#include "xfs_ag.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_rw.h"
 
 
 kmem_zone_t	*xfs_ili_zone;		/* inode log item zone */
@@ -244,15 +269,15 @@
 	 * update the timestamps BEFORE setting i_update_core,
 	 * so if we clear i_update_core after they set it we
 	 * are guaranteed to see their updates to the timestamps
-	 * either here.	 Likewise, if they set it after we clear it
+	 * either here.  Likewise, if they set it after we clear it
 	 * here, we'll see it either on the next commit of this
 	 * inode or the next time the inode gets flushed via
 	 * xfs_iflush().  This depends on strongly ordered memory
-	 * semantics, but we have that.	 We use the SYNCHRONIZE
+	 * semantics, but we have that.  We use the SYNCHRONIZE
 	 * macro to make sure that the compiler does not reorder
 	 * the i_update_core access below the data copy below.
 	 */
-	if (ip->i_update_core)	{
+	if (ip->i_update_core)  {
 		ip->i_update_core = 0;
 		SYNCHRONIZE();
 	}
@@ -274,7 +299,7 @@
 	/*
 	 * If this is really an old format inode, then we need to
 	 * log it as such.  This means that we have to copy the link
-	 * count from the new field to the old.	 We don't have to worry
+	 * count from the new field to the old.  We don't have to worry
 	 * about the new fields, because nothing trusts them as long as
 	 * the old inode version number is there.  If the superblock already
 	 * has a new version number, then we don't bother converting back.
@@ -324,7 +349,7 @@
 				vecp->i_addr =
 					(char *)(ip->i_df.if_u1.if_extents);
 				vecp->i_len = ip->i_df.if_bytes;
-			} else 
+			} else
 #endif
 			{
 				/*
@@ -449,7 +474,7 @@
 			 */
 			vecp->i_addr = (char *)(ip->i_afp->if_u1.if_extents);
 			vecp->i_len = ip->i_afp->if_bytes;
-#else		
+#else
 			ASSERT(iip->ili_aextents_buf == NULL);
 			/*
 			 * Need to endian flip before logging
@@ -516,7 +541,7 @@
 
 /*
  * This is called to pin the inode associated with the inode log
- * item in memory so it cannot be written out.	Do this by calling
+ * item in memory so it cannot be written out.  Do this by calling
  * xfs_ipin() to bump the pin count in the inode while holding the
  * inode pin lock.
  */
@@ -842,7 +867,7 @@
 	 * Since we were able to lock the inode's flush lock and
 	 * we found it on the AIL, the inode must be dirty.  This
 	 * is because the inode is removed from the AIL while still
-	 * holding the flush lock in xfs_iflush_done().	 Thus, if
+	 * holding the flush lock in xfs_iflush_done().  Thus, if
 	 * we found it in the AIL and were able to obtain the flush
 	 * lock without sleeping, then there must not have been
 	 * anyone in the process of flushing the inode.
@@ -851,7 +876,7 @@
 	       iip->ili_format.ilf_fields != 0);
 
 	/*
-	 * Write out the inode.	 The completion routine ('iflush_done') will
+	 * Write out the inode.  The completion routine ('iflush_done') will
 	 * pull it from the AIL, mark it clean, unlock the flush lock.
 	 */
 	(void) xfs_iflush(ip, XFS_IFLUSH_DELWRI);
@@ -966,7 +991,7 @@
 	/*
 	 * We only want to pull the item from the AIL if it is
 	 * actually there and its location in the log has not
-	 * changed since we started the flush.	Thus, we only bother
+	 * changed since we started the flush.  Thus, we only bother
 	 * if the ili_logged flag is set and the inode's lsn has not
 	 * changed.  First we check the lsn outside
 	 * the lock since it's cheaper, and then we recheck while
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_inode_item.h linux-2.5.68-bk12/fs/xfs/xfs_inode_item.h
--- linux-2.5.68-bk11/fs/xfs/xfs_inode_item.h	2003-04-19 19:50:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_inode_item.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,12 +29,12 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_INODE_ITEM_H__
-#define __XFS_INODE_ITEM_H__
+#ifndef	__XFS_INODE_ITEM_H__
+#define	__XFS_INODE_ITEM_H__
 
 /*
  * This is the structure used to lay out an inode log item in the
- * log.	 The size of the inline data/extents/b-tree root to be logged
+ * log.  The size of the inline data/extents/b-tree root to be logged
  * (if any) is indicated in the ilf_dsize field.  Changes to this structure
  * must be added on to the end.
  *
@@ -48,13 +48,13 @@
  * -Version 2 of this structure (XFS_LI_6_1_INODE) is currently the entire
  *	structure.  This was released with IRIX 6.0.1-XFS and IRIX 6.1.
  * -Version 3 of this structure (XFS_LI_INODE) is the same as version 2
- *	so a new structure definition wasn't necessary.	 However, we had
+ *	so a new structure definition wasn't necessary.  However, we had
  *	to add a new type because the inode cluster size changed from 4K
  *	to 8K and the version number had to be rev'ved to keep older kernels
  *	from trying to recover logs with the 8K buffers in them.  The logging
  *	code can handle recovery on different-sized clusters now so hopefully
  *	this'll be the last time we need to change the inode log item just
- *	for a change in the inode cluster size.	 This new version was
+ *	for a change in the inode cluster size.  This new version was
  *	released with IRIX 6.2.
  */
 typedef struct xfs_inode_log_format {
@@ -89,38 +89,38 @@
 /*
  * Flags for xfs_trans_log_inode flags field.
  */
-#define XFS_ILOG_CORE	0x001	/* log standard inode fields */
-#define XFS_ILOG_DDATA	0x002	/* log i_df.if_data */
-#define XFS_ILOG_DEXT	0x004	/* log i_df.if_extents */
-#define XFS_ILOG_DBROOT 0x008	/* log i_df.i_broot */
-#define XFS_ILOG_DEV	0x010	/* log the dev field */
-#define XFS_ILOG_UUID	0x020	/* log the uuid field */
-#define XFS_ILOG_ADATA	0x040	/* log i_af.if_data */
-#define XFS_ILOG_AEXT	0x080	/* log i_af.if_extents */
-#define XFS_ILOG_ABROOT 0x100	/* log i_af.i_broot */
+#define	XFS_ILOG_CORE	0x001	/* log standard inode fields */
+#define	XFS_ILOG_DDATA	0x002	/* log i_df.if_data */
+#define	XFS_ILOG_DEXT	0x004	/* log i_df.if_extents */
+#define	XFS_ILOG_DBROOT	0x008	/* log i_df.i_broot */
+#define	XFS_ILOG_DEV	0x010	/* log the dev field */
+#define	XFS_ILOG_UUID	0x020	/* log the uuid field */
+#define	XFS_ILOG_ADATA	0x040	/* log i_af.if_data */
+#define	XFS_ILOG_AEXT	0x080	/* log i_af.if_extents */
+#define	XFS_ILOG_ABROOT	0x100	/* log i_af.i_broot */
 
-#define XFS_ILOG_NONCORE	(XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
+#define	XFS_ILOG_NONCORE	(XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
 				 XFS_ILOG_DBROOT | XFS_ILOG_DEV | \
 				 XFS_ILOG_UUID | XFS_ILOG_ADATA | \
 				 XFS_ILOG_AEXT | XFS_ILOG_ABROOT)
 
-#define XFS_ILOG_DFORK		(XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
+#define	XFS_ILOG_DFORK		(XFS_ILOG_DDATA | XFS_ILOG_DEXT | \
 				 XFS_ILOG_DBROOT)
 
-#define XFS_ILOG_AFORK		(XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
+#define	XFS_ILOG_AFORK		(XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
 				 XFS_ILOG_ABROOT)
 
-#define XFS_ILOG_ALL		(XFS_ILOG_CORE | XFS_ILOG_DDATA | \
+#define	XFS_ILOG_ALL		(XFS_ILOG_CORE | XFS_ILOG_DDATA | \
 				 XFS_ILOG_DEXT | XFS_ILOG_DBROOT | \
 				 XFS_ILOG_DEV | XFS_ILOG_UUID | \
 				 XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
 				 XFS_ILOG_ABROOT)
 
-#define XFS_ILI_HOLD		0x1
-#define XFS_ILI_IOLOCKED_EXCL	0x2
-#define XFS_ILI_IOLOCKED_SHARED 0x4
+#define	XFS_ILI_HOLD		0x1
+#define	XFS_ILI_IOLOCKED_EXCL	0x2
+#define	XFS_ILI_IOLOCKED_SHARED	0x4
 
-#define XFS_ILI_IOLOCKED_ANY   (XFS_ILI_IOLOCKED_EXCL | XFS_ILI_IOLOCKED_SHARED)
+#define	XFS_ILI_IOLOCKED_ANY   (XFS_ILI_IOLOCKED_EXCL | XFS_ILI_IOLOCKED_SHARED)
 
 
 #ifdef __KERNEL__
@@ -145,10 +145,10 @@
 						      data exts */
 	struct xfs_bmbt_rec_64	*ili_aextents_buf; /* array of logged
 						      attr exts */
-	unsigned int		ili_pushbuf_flag;  /* one bit used in push_ail */
+	unsigned int            ili_pushbuf_flag;  /* one bit used in push_ail */
 
 #ifdef DEBUG
-	uint64_t		ili_push_owner;	   /* one who sets pushbuf_flag
+	uint64_t                ili_push_owner;    /* one who sets pushbuf_flag
 						      above gets to push the buf */
 #endif
 #ifdef XFS_TRANS_DEBUG
@@ -161,9 +161,9 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ILOG_FDATA)
 int xfs_ilog_fdata(int w);
-#define XFS_ILOG_FDATA(w)	xfs_ilog_fdata(w)
+#define	XFS_ILOG_FDATA(w)	xfs_ilog_fdata(w)
 #else
-#define XFS_ILOG_FDATA(w)	\
+#define	XFS_ILOG_FDATA(w)	\
 	((w) == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA)
 #endif
 
@@ -171,16 +171,16 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ILOG_FBROOT)
 int xfs_ilog_fbroot(int w);
-#define XFS_ILOG_FBROOT(w)	xfs_ilog_fbroot(w)
+#define	XFS_ILOG_FBROOT(w)	xfs_ilog_fbroot(w)
 #else
-#define XFS_ILOG_FBROOT(w)	\
+#define	XFS_ILOG_FBROOT(w)	\
 	((w) == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ILOG_FEXT)
 int xfs_ilog_fext(int w);
-#define XFS_ILOG_FEXT(w)	xfs_ilog_fext(w)
+#define	XFS_ILOG_FEXT(w)	xfs_ilog_fext(w)
 #else
-#define XFS_ILOG_FEXT(w)	\
+#define	XFS_ILOG_FEXT(w)	\
 	((w) == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT)
 #endif
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_inum.h linux-2.5.68-bk12/fs/xfs/xfs_inum.h
--- linux-2.5.68-bk11/fs/xfs/xfs_inum.h	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_inum.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_INUM_H__
-#define __XFS_INUM_H__
+#define	__XFS_INUM_H__
 
 /*
  * Inode number format:
@@ -40,7 +40,7 @@
  * high agno_log-agblklog-inopblog bits - 0
  */
 
-typedef __uint32_t	xfs_agino_t;	/* within allocation grp inode number */
+typedef	__uint32_t	xfs_agino_t;	/* within allocation grp inode number */
 
 /*
  * Useful inode bits for this kernel.
@@ -48,126 +48,126 @@
  * costs too much.
  */
 #if XFS_BIG_FILESYSTEMS
-typedef xfs_ino_t	xfs_intino_t;
+typedef	xfs_ino_t	xfs_intino_t;
 #else
-typedef __uint32_t	xfs_intino_t;
+typedef	__uint32_t	xfs_intino_t;
 #endif
 
-#define NULLFSINO	((xfs_ino_t)-1)
-#define NULLAGINO	((xfs_agino_t)-1)
+#define	NULLFSINO	((xfs_ino_t)-1)
+#define	NULLAGINO	((xfs_agino_t)-1)
 
 struct xfs_mount;
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_MASK)
 __uint32_t xfs_ino_mask(int k);
-#define XFS_INO_MASK(k)			xfs_ino_mask(k)
+#define	XFS_INO_MASK(k)			xfs_ino_mask(k)
 #else
-#define XFS_INO_MASK(k) ((__uint32_t)((1ULL << (k)) - 1))
+#define	XFS_INO_MASK(k)	((__uint32_t)((1ULL << (k)) - 1))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_OFFSET_BITS)
 int xfs_ino_offset_bits(struct xfs_mount *mp);
-#define XFS_INO_OFFSET_BITS(mp)		xfs_ino_offset_bits(mp)
+#define	XFS_INO_OFFSET_BITS(mp)		xfs_ino_offset_bits(mp)
 #else
-#define XFS_INO_OFFSET_BITS(mp) ((mp)->m_sb.sb_inopblog)
+#define	XFS_INO_OFFSET_BITS(mp)	((mp)->m_sb.sb_inopblog)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_AGBNO_BITS)
 int xfs_ino_agbno_bits(struct xfs_mount *mp);
-#define XFS_INO_AGBNO_BITS(mp)		xfs_ino_agbno_bits(mp)
+#define	XFS_INO_AGBNO_BITS(mp)		xfs_ino_agbno_bits(mp)
 #else
-#define XFS_INO_AGBNO_BITS(mp)	((mp)->m_sb.sb_agblklog)
+#define	XFS_INO_AGBNO_BITS(mp)	((mp)->m_sb.sb_agblklog)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_AGINO_BITS)
 int xfs_ino_agino_bits(struct xfs_mount *mp);
-#define XFS_INO_AGINO_BITS(mp)		xfs_ino_agino_bits(mp)
+#define	XFS_INO_AGINO_BITS(mp)		xfs_ino_agino_bits(mp)
 #else
-#define XFS_INO_AGINO_BITS(mp)		((mp)->m_agino_log)
+#define	XFS_INO_AGINO_BITS(mp)		((mp)->m_agino_log)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_AGNO_BITS)
 int xfs_ino_agno_bits(struct xfs_mount *mp);
-#define XFS_INO_AGNO_BITS(mp)		xfs_ino_agno_bits(mp)
+#define	XFS_INO_AGNO_BITS(mp)		xfs_ino_agno_bits(mp)
 #else
-#define XFS_INO_AGNO_BITS(mp)	((mp)->m_agno_log)
+#define	XFS_INO_AGNO_BITS(mp)	((mp)->m_agno_log)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_BITS)
 int xfs_ino_bits(struct xfs_mount *mp);
-#define XFS_INO_BITS(mp)		xfs_ino_bits(mp)
+#define	XFS_INO_BITS(mp)		xfs_ino_bits(mp)
 #else
-#define XFS_INO_BITS(mp)	(XFS_INO_AGNO_BITS(mp) + XFS_INO_AGINO_BITS(mp))
+#define	XFS_INO_BITS(mp)	(XFS_INO_AGNO_BITS(mp) + XFS_INO_AGINO_BITS(mp))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_AGNO)
 xfs_agnumber_t xfs_ino_to_agno(struct xfs_mount *mp, xfs_ino_t i);
-#define XFS_INO_TO_AGNO(mp,i)		xfs_ino_to_agno(mp,i)
+#define	XFS_INO_TO_AGNO(mp,i)		xfs_ino_to_agno(mp,i)
 #else
-#define XFS_INO_TO_AGNO(mp,i)	\
+#define	XFS_INO_TO_AGNO(mp,i)	\
 	((xfs_agnumber_t)((i) >> XFS_INO_AGINO_BITS(mp)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_AGINO)
 xfs_agino_t xfs_ino_to_agino(struct xfs_mount *mp, xfs_ino_t i);
-#define XFS_INO_TO_AGINO(mp,i)		xfs_ino_to_agino(mp,i)
+#define	XFS_INO_TO_AGINO(mp,i)		xfs_ino_to_agino(mp,i)
 #else
-#define XFS_INO_TO_AGINO(mp,i)	\
+#define	XFS_INO_TO_AGINO(mp,i)	\
 	((xfs_agino_t)(i) & XFS_INO_MASK(XFS_INO_AGINO_BITS(mp)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_AGBNO)
 xfs_agblock_t xfs_ino_to_agbno(struct xfs_mount *mp, xfs_ino_t i);
-#define XFS_INO_TO_AGBNO(mp,i)		xfs_ino_to_agbno(mp,i)
+#define	XFS_INO_TO_AGBNO(mp,i)		xfs_ino_to_agbno(mp,i)
 #else
-#define XFS_INO_TO_AGBNO(mp,i)	\
+#define	XFS_INO_TO_AGBNO(mp,i)	\
 	(((xfs_agblock_t)(i) >> XFS_INO_OFFSET_BITS(mp)) & \
 	 XFS_INO_MASK(XFS_INO_AGBNO_BITS(mp)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_OFFSET)
 int xfs_ino_to_offset(struct xfs_mount *mp, xfs_ino_t i);
-#define XFS_INO_TO_OFFSET(mp,i)		xfs_ino_to_offset(mp,i)
+#define	XFS_INO_TO_OFFSET(mp,i)		xfs_ino_to_offset(mp,i)
 #else
-#define XFS_INO_TO_OFFSET(mp,i) \
+#define	XFS_INO_TO_OFFSET(mp,i)	\
 	((int)(i) & XFS_INO_MASK(XFS_INO_OFFSET_BITS(mp)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_INO_TO_FSB)
 xfs_fsblock_t xfs_ino_to_fsb(struct xfs_mount *mp, xfs_ino_t i);
-#define XFS_INO_TO_FSB(mp,i)		xfs_ino_to_fsb(mp,i)
+#define	XFS_INO_TO_FSB(mp,i)		xfs_ino_to_fsb(mp,i)
 #else
-#define XFS_INO_TO_FSB(mp,i)	\
+#define	XFS_INO_TO_FSB(mp,i)	\
 	XFS_AGB_TO_FSB(mp, XFS_INO_TO_AGNO(mp,i), XFS_INO_TO_AGBNO(mp,i))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGINO_TO_INO)
 xfs_ino_t
 xfs_agino_to_ino(struct xfs_mount *mp, xfs_agnumber_t a, xfs_agino_t i);
-#define XFS_AGINO_TO_INO(mp,a,i)	xfs_agino_to_ino(mp,a,i)
+#define	XFS_AGINO_TO_INO(mp,a,i)	xfs_agino_to_ino(mp,a,i)
 #else
-#define XFS_AGINO_TO_INO(mp,a,i)	\
+#define	XFS_AGINO_TO_INO(mp,a,i)	\
 	(((xfs_ino_t)(a) << XFS_INO_AGINO_BITS(mp)) | (i))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGINO_TO_AGBNO)
 xfs_agblock_t xfs_agino_to_agbno(struct xfs_mount *mp, xfs_agino_t i);
-#define XFS_AGINO_TO_AGBNO(mp,i)	xfs_agino_to_agbno(mp,i)
+#define	XFS_AGINO_TO_AGBNO(mp,i)	xfs_agino_to_agbno(mp,i)
 #else
-#define XFS_AGINO_TO_AGBNO(mp,i)	((i) >> XFS_INO_OFFSET_BITS(mp))
+#define	XFS_AGINO_TO_AGBNO(mp,i)	((i) >> XFS_INO_OFFSET_BITS(mp))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGINO_TO_OFFSET)
 int xfs_agino_to_offset(struct xfs_mount *mp, xfs_agino_t i);
-#define XFS_AGINO_TO_OFFSET(mp,i)	xfs_agino_to_offset(mp,i)
+#define	XFS_AGINO_TO_OFFSET(mp,i)	xfs_agino_to_offset(mp,i)
 #else
-#define XFS_AGINO_TO_OFFSET(mp,i)	\
+#define	XFS_AGINO_TO_OFFSET(mp,i)	\
 	((i) & XFS_INO_MASK(XFS_INO_OFFSET_BITS(mp)))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_OFFBNO_TO_AGINO)
 xfs_agino_t xfs_offbno_to_agino(struct xfs_mount *mp, xfs_agblock_t b, int o);
-#define XFS_OFFBNO_TO_AGINO(mp,b,o)	xfs_offbno_to_agino(mp,b,o)
+#define	XFS_OFFBNO_TO_AGINO(mp,b,o)	xfs_offbno_to_agino(mp,b,o)
 #else
-#define XFS_OFFBNO_TO_AGINO(mp,b,o)	\
+#define	XFS_OFFBNO_TO_AGINO(mp,b,o)	\
 	((xfs_agino_t)(((b) << XFS_INO_OFFSET_BITS(mp)) | (o)))
 #endif
 
 #if XFS_BIG_FILESYSTEMS
-#define XFS_MAXINUMBER		((xfs_ino_t)((1ULL << 56) - 1ULL))
-#define XFS_INO64_OFFSET	((xfs_ino_t)(1ULL << 32))
+#define	XFS_MAXINUMBER		((xfs_ino_t)((1ULL << 56) - 1ULL))
+#define	XFS_INO64_OFFSET	((xfs_ino_t)(1ULL << 32))
 #else
-#define XFS_MAXINUMBER		((xfs_ino_t)((1ULL << 32) - 1ULL))
+#define	XFS_MAXINUMBER		((xfs_ino_t)((1ULL << 32) - 1ULL))
 #endif
-#define XFS_MAXINUMBER_32	((xfs_ino_t)((1ULL << 32) - 1ULL))
+#define	XFS_MAXINUMBER_32	((xfs_ino_t)((1ULL << 32) - 1ULL))
 
 #endif	/* __XFS_INUM_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_iocore.c linux-2.5.68-bk12/fs/xfs/xfs_iocore.c
--- linux-2.5.68-bk11/fs/xfs/xfs_iocore.c	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_iocore.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,38 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_itable.h"
+#include "xfs_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_error.h"
+#include "xfs_bit.h"
+#include "xfs_rw.h"
+#include "xfs_quota.h"
+#include "xfs_trans_space.h"
+#include "xfs_dmapi.h"
 
 
 STATIC xfs_fsize_t
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_itable.c linux-2.5.68-bk12/fs/xfs/xfs_itable.c
--- linux-2.5.68-bk11/fs/xfs/xfs_itable.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_itable.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,30 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_ag.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_ialloc.h"
+#include "xfs_itable.h"
+#include "xfs_error.h"
 
 /*
  * Return stat information for one inode.
@@ -51,8 +74,8 @@
 	xfs_dinode_t	*dip;		/* dinode inode pointer */
 	xfs_dinode_core_t *dic;		/* dinode core info pointer */
 	xfs_inode_t	*ip = NULL;	/* incore inode pointer */
-	xfs_arch_t	arch;		/* these are set according to	   */
-	__uint16_t	di_flags;	/* temp */
+	xfs_arch_t      arch;           /* these are set according to      */
+	__uint16_t      di_flags;       /* temp */
 
 	buf = (xfs_bstat_t *)buffer;
 	dip = (xfs_dinode_t *)dibuff;
@@ -100,10 +123,10 @@
 		/*
 		 * The inode format changed when we moved the link count and
 		 * made it 32 bits long.  If this is an old format inode,
-		 * convert it in memory to look like a new one.	 If it gets
+		 * convert it in memory to look like a new one.  If it gets
 		 * flushed to disk we will convert back before flushing or
-		 * logging it.	We zero out the new projid field and the old link
-		 * count field.	 We'll handle clearing the pad field (the remains
+		 * logging it.  We zero out the new projid field and the old link
+		 * count field.  We'll handle clearing the pad field (the remains
 		 * of the old uuid field) when we actually convert the inode to
 		 * the new format. We don't change the version number so that we
 		 * can distinguish this from a real new format inode.
@@ -214,25 +237,25 @@
 	xfs_btree_cur_t		*cur;	/* btree cursor for ialloc btree */
 	int			end_of_ag; /* set if we've seen the ag end */
 	int			error;	/* error code */
-	int			fmterror;/* bulkstat formatter result */
+	int                     fmterror;/* bulkstat formatter result */
 	__int32_t		gcnt;	/* current btree rec's count */
 	xfs_inofree_t		gfree;	/* current btree rec's free mask */
 	xfs_agino_t		gino;	/* current btree rec's start inode */
 	int			i;	/* loop index */
-	int			icount; /* count of inodes good in irbuf */
+	int			icount;	/* count of inodes good in irbuf */
 	xfs_ino_t		ino;	/* inode number (filesystem) */
 	xfs_inobt_rec_t		*irbp;	/* current irec buffer pointer */
-	xfs_inobt_rec_t		*irbuf; /* start of irec buffer */
+	xfs_inobt_rec_t		*irbuf;	/* start of irec buffer */
 	xfs_inobt_rec_t		*irbufend; /* end of good irec buffer entries */
 	xfs_ino_t		lastino=0; /* last inode number returned */
 	int			nbcluster; /* # of blocks in a cluster */
 	int			nicluster; /* # of inodes in a cluster */
-	int			nimask; /* mask for inode clusters */
-	int			nirbuf; /* size of irbuf */
+	int			nimask;	/* mask for inode clusters */
+	int			nirbuf;	/* size of irbuf */
 	int			rval;	/* return value error code */
 	int			tmp;	/* result value from btree calls */
 	int			ubcount; /* size of user's buffer */
-	int			ubleft; /* spaces left in user's buffer */
+	int			ubleft;	/* spaces left in user's buffer */
 	xfs_caddr_t		ubufp;	/* current pointer into user's buffer */
 	xfs_buf_t		*bp;	/* ptr to on-disk inode cluster buf */
 	xfs_dinode_t		*dip;	/* ptr into bp for specific inode */
@@ -360,7 +383,7 @@
 				error = xfs_inobt_increment(cur, 0, &tmp);
 		} else {
 			/*
-			 * Start of ag.	 Lookup the first inode chunk.
+			 * Start of ag.  Lookup the first inode chunk.
 			 */
 			error = xfs_inobt_lookup_ge(cur, 0, 0, 0, &tmp);
 			icount = 0;
@@ -595,7 +618,7 @@
 xfs_bulkstat_single(
 	xfs_mount_t		*mp,	/* mount point for filesystem */
 	xfs_ino_t		*lastinop, /* inode to return */
-	xfs_caddr_t		buffer, /* buffer with inode stats */
+	xfs_caddr_t		buffer,	/* buffer with inode stats */
 	int			*done)	/* 1 if there're more stats to get */
 {
 	xfs_bstat_t		bstat;	/* one bulkstat result structure */
@@ -654,7 +677,7 @@
 	int		bcount;
 	xfs_inogrp_t	*buffer;
 	int		bufidx;
-	xfs_btree_cur_t *cur;
+	xfs_btree_cur_t	*cur;
 	int		error;
 	__int32_t	gcnt;
 	xfs_inofree_t	gfree;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_itable.h linux-2.5.68-bk12/fs/xfs/xfs_itable.h
--- linux-2.5.68-bk11/fs/xfs/xfs_itable.h	2003-04-19 19:51:12.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_itable.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_ITABLE_H__
-#define __XFS_ITABLE_H__
+#define	__XFS_ITABLE_H__
 
 /*
  * xfs_bulkstat() is used to fill in xfs_bstat structures as well as dm_stat
@@ -38,8 +38,8 @@
  * that will iget the inode and fill in the appropriate structure.
  * see xfs_bulkstat_one() and dm_bulkstat_one() in dmi_xfs.c
  */
-typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
-			       struct xfs_trans *tp,
+typedef int (*bulkstat_one_pf)(struct xfs_mount	*mp,
+			       struct xfs_trans	*tp,
 			       xfs_ino_t	ino,
 			       void		*buffer,
 			       xfs_daddr_t	bno,
@@ -48,15 +48,15 @@
 /*
  * Values for stat return value.
  */
-#define BULKSTAT_RV_NOTHING	0
-#define BULKSTAT_RV_DIDONE	1
-#define BULKSTAT_RV_GIVEUP	2
+#define	BULKSTAT_RV_NOTHING	0
+#define	BULKSTAT_RV_DIDONE	1
+#define	BULKSTAT_RV_GIVEUP	2
 
 /*
  * Values for bulkstat flag argument.
  */
-#define BULKSTAT_FG_IGET	0x1	/* Go through the buffer cache */
-#define BULKSTAT_FG_QUICK	0x2	/* No iget, walk the dinode cluster */
+#define	BULKSTAT_FG_IGET	0x1	/* Go through the buffer cache */
+#define	BULKSTAT_FG_QUICK	0x2	/* No iget, walk the dinode cluster */
 #define BULKSTAT_FG_VFSLOCKED	0x4	/* Already have vfs lock */
 
 /*
@@ -96,7 +96,7 @@
 	xfs_mount_t		*mp,	/* mount point for filesystem */
 	xfs_trans_t		*tp,	/* transaction pointer */
 	xfs_ino_t		*last,	/* last inode returned */
-	int			*count, /* size of buffer/count returned */
+	int			*count,	/* size of buffer/count returned */
 	xfs_caddr_t		buffer);/* buffer with inode descriptions */
 
 #endif	/* __XFS_ITABLE_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_log.c linux-2.5.68-bk12/fs/xfs/xfs_log.c
--- linux-2.5.68-bk11/fs/xfs/xfs_log.c	2003-04-19 19:51:20.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_log.c	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -34,7 +34,25 @@
  * High level interface routines for log manager
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_ag.h"
+#include "xfs_sb.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_error.h"
+#include "xfs_log_priv.h"
+#include "xfs_buf_item.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_log_recover.h"
+#include "xfs_bit.h"
+#include "xfs_rw.h"
+#include "xfs_trans_priv.h"
 
 
 #define xlog_write_adv_cnt(ptr, len, off, bytes) \
@@ -46,7 +64,7 @@
 STATIC int	 xlog_bdstrat_cb(struct xfs_buf *);
 STATIC int	 xlog_commit_record(xfs_mount_t *mp, xlog_ticket_t *ticket,
 				    xlog_in_core_t **, xfs_lsn_t *);
-STATIC xlog_t *	 xlog_alloc_log(xfs_mount_t	*mp,
+STATIC xlog_t *  xlog_alloc_log(xfs_mount_t	*mp,
 				dev_t		log_dev,
 				xfs_daddr_t	blk_offset,
 				int		num_bblks);
@@ -77,7 +95,7 @@
 				     int		eventual_size);
 STATIC int  xlog_state_sync(xlog_t *log, xfs_lsn_t lsn, uint flags);
 STATIC int  xlog_state_sync_all(xlog_t *log, uint flags);
-STATIC void xlog_state_want_sync(xlog_t *log, xlog_in_core_t *iclog);
+STATIC void xlog_state_want_sync(xlog_t	*log, xlog_in_core_t *iclog);
 
 /* local functions to manipulate grant head */
 STATIC int  xlog_grant_log_space(xlog_t		*log,
@@ -87,7 +105,7 @@
 STATIC void xlog_regrant_reserve_log_space(xlog_t	 *log,
 					   xlog_ticket_t *ticket);
 STATIC int xlog_regrant_write_log_space(xlog_t		*log,
-					 xlog_ticket_t	*ticket);
+					 xlog_ticket_t  *ticket);
 STATIC void xlog_ungrant_log_space(xlog_t	 *log,
 				   xlog_ticket_t *ticket);
 
@@ -137,7 +155,7 @@
  */
 #if defined(XLOG_NOLOG) || defined(DEBUG)
 int   xlog_debug = 1;
-dev_t xlog_devt	 = 0;
+dev_t xlog_devt  = 0;
 #endif
 
 #if defined(XFS_LOG_TRACE)
@@ -220,8 +238,8 @@
 }
 
 #else
-#define xlog_trace_loggrant(log,tic,string)
-#define xlog_trace_iclog(iclog,state)
+#define	xlog_trace_loggrant(log,tic,string)
+#define	xlog_trace_iclog(iclog,state)
 #endif /* XFS_LOG_TRACE */
 
 /*
@@ -251,7 +269,7 @@
 	     void		**iclog,
 	     uint		flags)
 {
-	xlog_t		*log	= mp->m_log;
+	xlog_t		*log    = mp->m_log;
 	xlog_ticket_t	*ticket = (xfs_log_ticket_t) xtic;
 	xfs_lsn_t	lsn	= 0;
 
@@ -306,7 +324,7 @@
  * Asynchronous forces are implemented by setting the WANT_SYNC
  * bit in the appropriate in-core log and then returning.
  *
- * Synchronous forces are implemented with a semaphore.	 All callers
+ * Synchronous forces are implemented with a semaphore.  All callers
  * to force a given lsn to disk will wait on a semaphore attached to the
  * specific in-core log.  When given in-core log finally completes its
  * write to disk, that thread will wake up all threads waiting on the
@@ -396,7 +414,7 @@
 }
 
 /*
- * Initialize log manager data.	 This routine is intended to be called when
+ * Initialize log manager data.  This routine is intended to be called when
  * a system boots up.  It is not a per filesystem initialization.
  *
  * As you can see, we currently do nothing.
@@ -588,7 +606,7 @@
 #ifdef DEBUG
 	xlog_in_core_t	 *first_iclog;
 #endif
-	xfs_log_iovec_t	 reg[1];
+	xfs_log_iovec_t  reg[1];
 	xfs_log_ticket_t tic = 0;
 	xfs_lsn_t	 lsn;
 	int		 error;
@@ -717,8 +735,8 @@
 }
 
 /*
- * Write region vectors to log.	 The write happens using the space reservation
- * of the ticket (tic).	 It is not a requirement that all writes for a given
+ * Write region vectors to log.  The write happens using the space reservation
+ * of the ticket (tic).  It is not a requirement that all writes for a given
  * transaction occur with one call to xfs_log_write().
  */
 int
@@ -774,7 +792,7 @@
 
 	s = GRANT_LOCK(log);
 
-	/* Also an illegal lsn.	 1 implies that we aren't passing in a legal
+	/* Also an illegal lsn.  1 implies that we aren't passing in a legal
 	 * tail_lsn.
 	 */
 	if (tail_lsn != 1)
@@ -895,7 +913,7 @@
  * is passed in the cycle/bytes formal parms.  In the special case where
  * the reserve head has wrapped passed the tail, this calculation is no
  * longer valid.  In this case, just return 0 which means there is no space
- * in the log.	This works for all places where this function is called
+ * in the log.  This works for all places where this function is called
  * with the reserve head.  Of course, if the write head were to ever
  * wrap the tail, we should blow up.  Rather than catch this case here,
  * we depend on other ASSERTions in other parts of the code.   XXXmiken
@@ -1030,8 +1048,8 @@
 /*
  * Return size of each in-core log record buffer.
  *
- * Low memory machines only get 2 16KB buffers.	 We don't want to waste
- * memory here.	 However, all other machines get at least 2 32KB buffers.
+ * Low memory machines only get 2 16KB buffers.  We don't want to waste
+ * memory here.  However, all other machines get at least 2 32KB buffers.
  * The number is hard coded because we don't care about the minimum
  * memory size, just 32MB systems.
  *
@@ -1177,7 +1195,7 @@
 
 	log->l_mp	   = mp;
 	log->l_dev	   = log_dev;
-	log->l_logsize	   = BBTOB(num_bblks);
+	log->l_logsize     = BBTOB(num_bblks);
 	log->l_logBBstart  = blk_offset;
 	log->l_logBBsize   = num_bblks;
 	log->l_roundoff	   = 0;
@@ -1194,11 +1212,11 @@
 	log->l_grant_reserve_cycle = 1;
 	log->l_grant_write_bytes = 0;
 	log->l_grant_write_cycle = 1;
-	log->l_quotaoffs_flag = 0;	/* XFS_LI_QUOTAOFF logitems */
+	log->l_quotaoffs_flag = 0;      /* XFS_LI_QUOTAOFF logitems */
 
 	xlog_get_iclog_buffer_size(mp, log);
 
-	bp = log->l_xbuf   = XFS_getrbuf(0,mp); /* get my locked buffer */ /* mp needed for pagebuf/linux only */
+	bp = log->l_xbuf   = XFS_getrbuf(0,mp);	/* get my locked buffer */ /* mp needed for pagebuf/linux only */
 
 	XFS_BUF_SET_TARGET(bp, mp->m_logdev_targp);
 	XFS_BUF_SET_SIZE(bp, log->l_iclog_size);
@@ -1278,13 +1296,13 @@
  * ticket.  Return the lsn of the commit record.
  */
 STATIC int
-xlog_commit_record(xfs_mount_t	*mp,
+xlog_commit_record(xfs_mount_t  *mp,
 		   xlog_ticket_t *ticket,
 		   xlog_in_core_t **iclog,
 		   xfs_lsn_t	*commitlsnp)
 {
 	int		error;
-	xfs_log_iovec_t reg[1];
+	xfs_log_iovec_t	reg[1];
 
 	reg[0].i_addr = 0;
 	reg[0].i_len = 0;
@@ -1301,12 +1319,12 @@
 /*
  * Push on the buffer cache code if we ever use more than 75% of the on-disk
  * log space.  This code pushes on the lsn which would supposedly free up
- * the 25% which we want to leave free.	 We may need to adopt a policy which
+ * the 25% which we want to leave free.  We may need to adopt a policy which
  * pushes on an lsn which is further along in the log once we reach the high
- * water mark.	In this manner, we would be creating a low water mark.
+ * water mark.  In this manner, we would be creating a low water mark.
  */
 void
-xlog_grant_push_ail(xfs_mount_t *mp,
+xlog_grant_push_ail(xfs_mount_t	*mp,
 		    int		need_bytes)
 {
     xlog_t	*log = mp->m_log;	/* pointer to the log */
@@ -1368,14 +1386,14 @@
 /*
  * Flush out the in-core log (iclog) to the on-disk log in a synchronous or
  * asynchronous fashion.  Previously, we should have moved the current iclog
- * ptr in the log to point to the next available iclog.	 This allows further
+ * ptr in the log to point to the next available iclog.  This allows further
  * write to continue while this code syncs out an iclog ready to go.
  * Before an in-core log can be written out, the data section must be scanned
  * to save away the 1st word of each BBSIZE block into the header.  We replace
  * it with the current cycle count.  Each BBSIZE block is tagged with the
  * cycle count because there in an implicit assumption that drives will
  * guarantee that entire 512 byte blocks get written at once.  In other words,
- * we can't have part of a 512 byte block written and part not written.	 By
+ * we can't have part of a 512 byte block written and part not written.  By
  * tagging each block, we will know which blocks are valid when recovering
  * after an unclean shutdown.
  *
@@ -1386,7 +1404,7 @@
  *
  * The entire log manager uses a logical block numbering scheme.  Only
  * log_sync (and then only bwrite()) know about the fact that the log may
- * not start with block zero on a given device.	 The log block start offset
+ * not start with block zero on a given device.  The log block start offset
  * is added immediately before calling bwrite().
  */
 
@@ -1432,7 +1450,7 @@
 
 	log->l_roundoff += iclog->ic_roundoff;
 
-	xlog_pack_data(log, iclog);	  /* put cycle number in every block */
+	xlog_pack_data(log, iclog);       /* put cycle number in every block */
 
 	/* real byte length */
 	INT_SET(iclog->ic_header.h_len, ARCH_CONVERT, iclog->ic_offset);
@@ -1510,7 +1528,7 @@
 		/*
 		 * Bump the cycle numbers at the start of each block
 		 * since this part of the buffer is at the start of
-		 * a new cycle.	 Watch out for the header magic number
+		 * a new cycle.  Watch out for the header magic number
 		 * case, though.
 		 */
 		for (i=0; i<split; i += BBSIZE) {
@@ -1651,7 +1669,7 @@
  *	syncing routine.  When a single log_write region needs to span
  *	multiple in-core logs, the XLOG_CONTINUE_TRANS bit should be set
  *	on all log operation writes which don't contain the end of the
- *	region.	 The XLOG_END_TRANS bit is used for the in-core log
+ *	region.  The XLOG_END_TRANS bit is used for the in-core log
  *	operation which contains the end of the continued log_write region.
  * 3. When xlog_state_get_iclog_space() grabs the rest of the current iclog,
  *	we don't really know exactly how much space will be used.  As a result,
@@ -1744,7 +1762,7 @@
 		INT_SET(logop_head->oh_tid, ARCH_CONVERT, ticket->t_tid);
 		logop_head->oh_clientid = ticket->t_clientid;
 		INT_ZERO(logop_head->oh_len, ARCH_CONVERT);
-		logop_head->oh_flags	= XLOG_START_TRANS;
+		logop_head->oh_flags    = XLOG_START_TRANS;
 		INT_ZERO(logop_head->oh_res2, ARCH_CONVERT);
 		ticket->t_flags		&= ~XLOG_TIC_INITED;	/* clear bit */
 		firstwr = 1;			  /* increment log ops below */
@@ -1787,7 +1805,7 @@
 	     * need_copy is the amount we'd like to copy if everything could
 	     * fit in the current memcpy.
 	     */
-	    need_copy = reg[index].i_len - partial_copy_len;
+	    need_copy =	reg[index].i_len - partial_copy_len;
 
 	    copy_off = partial_copy_len;
 	    if (need_copy <= iclog->ic_size - log_offset) { /*complete write */
@@ -1866,9 +1884,9 @@
  *****************************************************************************
  */
 
-/* Clean iclogs starting from the head.	 This ordering must be
+/* Clean iclogs starting from the head.  This ordering must be
  * maintained, so an iclog doesn't become ACTIVE beyond one that
- * is SYNCING.	This is also required to maintain the notion that we use
+ * is SYNCING.  This is also required to maintain the notion that we use
  * a counting semaphore to hold off would be writers to the log when every
  * iclog is trying to sync to disk.
  *
@@ -1883,7 +1901,7 @@
 	iclog = log->l_iclog;
 	do {
 		if (iclog->ic_state == XLOG_STATE_DIRTY) {
-			iclog->ic_state = XLOG_STATE_ACTIVE;
+			iclog->ic_state	= XLOG_STATE_ACTIVE;
 			iclog->ic_offset       = 0;
 			iclog->ic_callback	= 0;   /* don't need to free */
 			/*
@@ -1956,7 +1974,7 @@
 xlog_get_lowest_lsn(
 	xlog_t		*log)
 {
-	xlog_in_core_t	*lsn_log;
+	xlog_in_core_t  *lsn_log;
 	xfs_lsn_t	lowest_lsn, lsn;
 
 	lsn_log = log->l_iclog;
@@ -2003,7 +2021,7 @@
 	do {
 		/*
 		 * Scan all iclogs starting with the one pointed to by the
-		 * log.	 Reset this starting point each time the log is
+		 * log.  Reset this starting point each time the log is
 		 * unlocked (during callbacks).
 		 *
 		 * Keep looping through iclogs until one full pass is made
@@ -2032,7 +2050,7 @@
 			 */
 			if (!(iclog->ic_state & XLOG_STATE_IOERROR)) {
 				/*
-				 * Can only perform callbacks in order.	 Since
+				 * Can only perform callbacks in order.  Since
 				 * this iclog is not in the DONE_SYNC/
 				 * DO_CALLBACK state, we skip the rest and
 				 * just try to clean up.  If we set our iclog
@@ -2159,7 +2177,7 @@
 			 *
 			 * SYNCING - i/o completion will go through logs
 			 * DONE_SYNC - interrupt thread should be waiting for
-			 *		LOG_LOCK
+			 *              LOG_LOCK
 			 * IOERROR - give up hope all ye who enter here
 			 */
 			if (iclog->ic_state == XLOG_STATE_SYNCING ||
@@ -2185,7 +2203,7 @@
  * Finish transitioning this iclog to the dirty state.
  *
  * Make sure that we completely execute this routine only when this is
- * the last call to the iclog.	There is a good chance that iclog flushes,
+ * the last call to the iclog.  There is a good chance that iclog flushes,
  * when we reach the end of the physical log, get turned into 2 separate
  * calls to bwrite.  Hence, one iclog flush could generate two calls to this
  * routine.  By using the reference count bwritecnt, we guarantee that only
@@ -2241,7 +2259,7 @@
  * sleep.  The flush semaphore is set to the number of in-core buffers and
  * decremented around disk syncing.  Therefore, if all buffers are syncing,
  * this semaphore will cause new writes to sleep until a sync completes.
- * Otherwise, this code just does p() followed by v().	This approximates
+ * Otherwise, this code just does p() followed by v().  This approximates
  * a sleep/wakeup except we can't race.
  *
  * The in-core logs are used in a circular fashion. They are not used
@@ -2336,7 +2354,7 @@
 
 	/* Do we have enough room to write the full amount in the remainder
 	 * of this iclog?  Or must we continue a write on the next iclog and
-	 * mark this iclog as completely taken?	 In the case where we switch
+	 * mark this iclog as completely taken?  In the case where we switch
 	 * iclogs (to mark it taken), this particular iclog will release/sync
 	 * to disk in xlog_write().
 	 */
@@ -2654,8 +2672,8 @@
  * Give back the space left from a reservation.
  *
  * All the information we need to make a correct determination of space left
- * is present.	For non-permanent reservations, things are quite easy.	The
- * count should have been decremented to zero.	We only need to deal with the
+ * is present.  For non-permanent reservations, things are quite easy.  The
+ * count should have been decremented to zero.  We only need to deal with the
  * space remaining in the current reservation part of the ticket.  If the
  * ticket contains a permanent reservation, there may be left over space which
  * needs to be released.  A count of N means that N-1 refills of the current
@@ -2722,7 +2740,7 @@
  */
 int
 xlog_state_release_iclog(xlog_t		*log,
-			 xlog_in_core_t *iclog)
+			 xlog_in_core_t	*iclog)
 {
 	SPLDECL(s);
 	int		sync = 0;	/* do we sync? */
@@ -2770,7 +2788,7 @@
  * This routine will mark the current iclog in the ring as WANT_SYNC
  * and move the current iclog pointer to the next iclog in the ring.
  * When this routine is called from xlog_state_get_iclog_space(), the
- * exact size of the iclog has not yet been determined.	 All we know is
+ * exact size of the iclog has not yet been determined.  All we know is
  * that every data block.  We have run out of space in this log record.
  */
 STATIC void
@@ -2823,7 +2841,7 @@
  * implementation means this routine will *not* write out zero length LRs.
  *
  * Basically, we try and perform an intelligent scan of the in-core logs.
- * If we determine there is no flushable data, we just return.	There is no
+ * If we determine there is no flushable data, we just return.  There is no
  * flushable data if:
  *
  *	1. the current iclog is active and has no data; the previous iclog
@@ -2866,7 +2884,7 @@
 		 * If the head is dirty or (active and empty), then
 		 * we need to look at the previous iclog.  If the previous
 		 * iclog is active or dirty we are done.  There is nothing
-		 * to sync out.	 Otherwise, we attach ourselves to the
+		 * to sync out.  Otherwise, we attach ourselves to the
 		 * previous iclog and go to sleep.
 		 */
 		if (iclog->ic_state == XLOG_STATE_DIRTY ||
@@ -2901,7 +2919,7 @@
 					goto no_sleep;
 			} else {
 				/* Someone else is writing to this iclog.
-				 * Use its call to flush out the data.	However,
+				 * Use its call to flush out the data.  However,
 				 * the other thread may not force out this LR,
 				 * so we mark it WANT_SYNC.
 				 */
@@ -3101,7 +3119,7 @@
 
 	/*
 	 * The kmem_zalloc may sleep, so we shouldn't be holding the
-	 * global lock.	 XXXmiken: may want to use zone allocator.
+	 * global lock.  XXXmiken: may want to use zone allocator.
 	 */
 	buf = (xfs_caddr_t) kmem_zalloc(NBPP, 0);
 
@@ -3150,7 +3168,7 @@
 	sv_destroy(&ticket->t_sema);
 
 	/*
-	 * Don't think caching will make that much difference.	It's
+	 * Don't think caching will make that much difference.  It's
 	 * more important to make debug easier.
 	 */
 #if 0
@@ -3160,7 +3178,7 @@
 	/* no need to clear fields */
 #else
 	/* When we debug, it is easier if tickets are cycled */
-	ticket->t_next	   = 0;
+	ticket->t_next     = 0;
 	if (log->l_tail != 0) {
 		log->l_tail->t_next = ticket;
 	} else {
@@ -3196,7 +3214,7 @@
 		goto alloc;
 	}
 	tic		= log->l_freelist;
-	log->l_freelist = tic->t_next;
+	log->l_freelist	= tic->t_next;
 	if (log->l_freelist == NULL)
 		log->l_tail = NULL;
 	log->l_ticket_cnt--;
@@ -3204,7 +3222,7 @@
 
 	/*
 	 * Permanent reservations have up to 'cnt'-1 active log operations
-	 * in the log.	A unit in this case is the amount of space for one
+	 * in the log.  A unit in this case is the amount of space for one
 	 * of these log operations.  Normal reservations have a cnt of 1
 	 * and their unit amount is the total amount of space required.
 	 * The following line of code adds one log record header length
@@ -3212,7 +3230,7 @@
 	 * log record.
 	 *
 	 * One more XLOG_HEADER_SIZE is added to account for possible
-	 * round off errors when syncing a LR to disk.	The bytes are
+	 * round off errors when syncing a LR to disk.  The bytes are
 	 * subtracted if the thread using this ticket is the first writer
 	 * to a new LR.
 	 *
@@ -3251,8 +3269,8 @@
  * part of the log in case we trash the log structure.
  */
 void
-xlog_verify_dest_ptr(xlog_t	*log,
-		     __psint_t	ptr)
+xlog_verify_dest_ptr(xlog_t     *log,
+		     __psint_t  ptr)
 {
 	int i;
 	int good_ptr = 0;
@@ -3275,7 +3293,7 @@
 {
     xfs_buf_t	*bp;
     uint	cycle_no;
-    xfs_daddr_t i;
+    xfs_daddr_t	i;
 
     if (BLOCK_LSN(iclog->ic_header.h_lsn, ARCH_CONVERT) < 10) {
 	cycle_no = CYCLE_LSN(iclog->ic_header.h_lsn, ARCH_CONVERT);
@@ -3608,4 +3626,3 @@
 	} while (iclog != log->l_iclog);
 	return(1);
 }
-
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_log.h linux-2.5.68-bk12/fs/xfs/xfs_log.h
--- linux-2.5.68-bk11/fs/xfs/xfs_log.h	2003-04-19 19:51:23.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_log.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,7 +29,7 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_LOG_H__
+#ifndef	__XFS_LOG_H__
 #define __XFS_LOG_H__
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -69,10 +69,10 @@
 	return 0;
 }
 
-#define XFS_LSN_CMP_ARCH(x,y,arch)	_lsn_cmp(x, y, arch)
-#define XFS_LSN_CMP(x,y) XFS_LSN_CMP_ARCH(x,y,ARCH_NOCONVERT)
-#define XFS_LSN_DIFF_ARCH(x,y,arch)	_lsn_cmp(x, y, arch)
-#define XFS_LSN_DIFF(x,y) XFS_LSN_DIFF_ARCH(x,y,ARCH_NOCONVERT)
+#define	XFS_LSN_CMP_ARCH(x,y,arch)	_lsn_cmp(x, y, arch)
+#define	XFS_LSN_CMP(x,y) XFS_LSN_CMP_ARCH(x,y,ARCH_NOCONVERT)
+#define	XFS_LSN_DIFF_ARCH(x,y,arch)	_lsn_cmp(x, y, arch)
+#define	XFS_LSN_DIFF(x,y) XFS_LSN_DIFF_ARCH(x,y,ARCH_NOCONVERT)
 
 /*
  * Macros, structures, prototypes for interface to the log manager.
@@ -86,7 +86,7 @@
 /*
  * Flags to xfs_log_done()
  */
-#define XFS_LOG_REL_PERM_RESERV 0x1
+#define XFS_LOG_REL_PERM_RESERV	0x1
 
 
 /*
@@ -137,7 +137,7 @@
  * to the log manager.
  */
 typedef struct xfs_log_callback {
-	struct xfs_log_callback *cb_next;
+	struct xfs_log_callback	*cb_next;
 	void			(*cb_func)(void *, int);
 	void			*cb_arg;
 } xfs_log_callback_t;
@@ -173,13 +173,13 @@
 			  __uint8_t	   clientid,
 			  uint		   flags);
 int	  xfs_log_write(struct xfs_mount *mp,
-			xfs_log_iovec_t	 region[],
+			xfs_log_iovec_t  region[],
 			int		 nentries,
 			xfs_log_ticket_t ticket,
 			xfs_lsn_t	 *start_lsn);
 int	  xfs_log_unmount(struct xfs_mount *mp);
 int	  xfs_log_unmount_write(struct xfs_mount *mp);
-void	  xfs_log_unmount_dealloc(struct xfs_mount *mp);
+void      xfs_log_unmount_dealloc(struct xfs_mount *mp);
 int	  xfs_log_force_umount(struct xfs_mount *mp, int logerror);
 int	  xfs_log_need_covered(struct xfs_mount *mp);
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_log_priv.h linux-2.5.68-bk12/fs/xfs/xfs_log_priv.h
--- linux-2.5.68-bk11/fs/xfs/xfs_log_priv.h	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_log_priv.h	2003-05-04 04:41:50.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,11 +29,11 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_LOG_PRIV_H__
+#ifndef	__XFS_LOG_PRIV_H__
 #define __XFS_LOG_PRIV_H__
 
 #if defined(XFS_ALL_TRACE)
-#define XFS_LOG_TRACE
+#define	XFS_LOG_TRACE
 #endif
 
 #if !defined(DEBUG)
@@ -136,7 +136,7 @@
 	if (type == 'w') {						\
 		(log)->l_grant_write_bytes -= (bytes);			\
 		if ((log)->l_grant_write_bytes < 0) {			\
-			(log)->l_grant_write_bytes += (log)->l_logsize; \
+			(log)->l_grant_write_bytes += (log)->l_logsize;	\
 			(log)->l_grant_write_cycle--;			\
 		}							\
 	} else {							\
@@ -158,7 +158,7 @@
 	if (type == 'w') {						\
 		(log)->l_grant_write_bytes += (bytes);			\
 		if ((log)->l_grant_write_bytes > (log)->l_logsize) {	\
-			(log)->l_grant_write_bytes -= (log)->l_logsize; \
+			(log)->l_grant_write_bytes -= (log)->l_logsize;	\
 			(log)->l_grant_write_cycle++;			\
 		}							\
 	} else {							\
@@ -259,7 +259,7 @@
  */
 #define XLOG_CHKSUM_MISMATCH	0x1	/* used only during recovery */
 #define XLOG_ACTIVE_RECOVERY	0x2	/* in the middle of recovery */
-#define XLOG_RECOVERY_NEEDED	0x4	/* log was recovered */
+#define	XLOG_RECOVERY_NEEDED	0x4	/* log was recovered */
 #define XLOG_IO_ERROR		0x8	/* log hit an I/O error, and being
 					   shutdown */
 typedef __uint32_t xlog_tid_t;
@@ -343,11 +343,11 @@
 
 typedef struct xlog_ticket {
 	sv_t		   t_sema;	 /* sleep on this semaphore	 :20 */
-	struct xlog_ticket *t_next;	 /*				 : 4 */
+	struct xlog_ticket *t_next;	 /*			         : 4 */
 	struct xlog_ticket *t_prev;	 /*				 : 4 */
 	xlog_tid_t	   t_tid;	 /* transaction identifier	 : 4 */
 	int		   t_curr_res;	 /* current reservation in bytes : 4 */
-	int		   t_unit_res;	 /* unit reservation in bytes	 : 4 */
+	int		   t_unit_res;	 /* unit reservation in bytes    : 4 */
 	__uint8_t	   t_ocnt;	 /* original count		 : 1 */
 	__uint8_t	   t_cnt;	 /* current count		 : 1 */
 	__uint8_t	   t_clientid;	 /* who does this belong to;	 : 1 */
@@ -359,7 +359,7 @@
 typedef struct xlog_op_header {
 	xlog_tid_t oh_tid;	/* transaction id of operation	:  4 b */
 	int	   oh_len;	/* bytes in data region		:  4 b */
-	__uint8_t  oh_clientid; /* who sent me this		:  1 b */
+	__uint8_t  oh_clientid;	/* who sent me this		:  1 b */
 	__uint8_t  oh_flags;	/*				:  1 b */
 	ushort	   oh_res2;	/* 32 bit align			:  2 b */
 } xlog_op_header_t;
@@ -391,12 +391,12 @@
 	xfs_lsn_t h_tail_lsn;	/* lsn of 1st LR w/ buffers not committed: 8 */
 	uint	  h_chksum;	/* may not be used; non-zero if used	:  4 */
 	int	  h_prev_block; /* block number to previous LR		:  4 */
-	int	  h_num_logops; /* number of log operations in this LR	:  4 */
+	int	  h_num_logops;	/* number of log operations in this LR	:  4 */
 	uint	  h_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE];
 	/* new fields */
-	int	  h_fmt;	/* format of log record			:  4 */
-	uuid_t	  h_fs_uuid;	/* uuid of FS				: 16 */
-	int	  h_size;	/* iclog size				:  4 */
+	int       h_fmt;        /* format of log record                 :  4 */
+	uuid_t    h_fs_uuid;    /* uuid of FS                           : 16 */
+	int       h_size;	/* iclog size				:  4 */
 } xlog_rec_header_t;
 
 typedef struct xlog_rec_ext_header {
@@ -405,7 +405,7 @@
 } xlog_rec_ext_header_t;
 #ifdef __KERNEL__
 /*
- * - A log record header is 512 bytes.	There is plenty of room to grow the
+ * - A log record header is 512 bytes.  There is plenty of room to grow the
  *	xlog_rec_header_t into the reserved space.
  * - ic_data follows, so a write to disk can start at the beginning of
  *	the iclog.
@@ -457,21 +457,21 @@
 /*
  * Defines to save our code from this glop.
  */
-#define ic_forcesema	hic_fields.ic_forcesema
+#define	ic_forcesema	hic_fields.ic_forcesema
 #define ic_writesema	hic_fields.ic_writesema
-#define ic_next		hic_fields.ic_next
-#define ic_prev		hic_fields.ic_prev
-#define ic_bp		hic_fields.ic_bp
-#define ic_log		hic_fields.ic_log
-#define ic_callback	hic_fields.ic_callback
-#define ic_callback_tail hic_fields.ic_callback_tail
-#define ic_trace	hic_fields.ic_trace
-#define ic_size		hic_fields.ic_size
-#define ic_offset	hic_fields.ic_offset
-#define ic_refcnt	hic_fields.ic_refcnt
-#define ic_roundoff	hic_fields.ic_roundoff
-#define ic_bwritecnt	hic_fields.ic_bwritecnt
-#define ic_state	hic_fields.ic_state
+#define	ic_next		hic_fields.ic_next
+#define	ic_prev		hic_fields.ic_prev
+#define	ic_bp		hic_fields.ic_bp
+#define	ic_log		hic_fields.ic_log
+#define	ic_callback	hic_fields.ic_callback
+#define	ic_callback_tail hic_fields.ic_callback_tail
+#define	ic_trace	hic_fields.ic_trace
+#define	ic_size		hic_fields.ic_size
+#define	ic_offset	hic_fields.ic_offset
+#define	ic_refcnt	hic_fields.ic_refcnt
+#define	ic_roundoff	hic_fields.ic_roundoff
+#define	ic_bwritecnt	hic_fields.ic_bwritecnt
+#define	ic_state	hic_fields.ic_state
 #define ic_datap	hic_fields.ic_datap
 #define ic_header	hic_data->ic_h.hic_header
 
@@ -483,29 +483,29 @@
  */
 typedef struct log {
     /* The following block of fields are changed while holding icloglock */
-    sema_t		l_flushsema;	/* iclog flushing semaphore */
+    sema_t		l_flushsema;    /* iclog flushing semaphore */
     int			l_flushcnt;	/* # of procs waiting on this sema */
     int			l_ticket_cnt;	/* free ticket count */
     int			l_ticket_tcnt;	/* total ticket count */
     int			l_covered_state;/* state of "covering disk log entries" */
-    xlog_ticket_t	*l_freelist;	/* free list of tickets */
+    xlog_ticket_t	*l_freelist;    /* free list of tickets */
     xlog_ticket_t	*l_unmount_free;/* kmem_free these addresses */
-    xlog_ticket_t	*l_tail;	/* free list of tickets */
-    xlog_in_core_t	*l_iclog;	/* head log queue	*/
-    lock_t		l_icloglock;	/* grab to change iclog state */
-    xfs_lsn_t		l_tail_lsn;	/* lsn of 1st LR w/ unflush buffers */
+    xlog_ticket_t	*l_tail;        /* free list of tickets */
+    xlog_in_core_t	*l_iclog;       /* head log queue	*/
+    lock_t		l_icloglock;    /* grab to change iclog state */
+    xfs_lsn_t		l_tail_lsn;     /* lsn of 1st LR w/ unflush buffers */
     xfs_lsn_t		l_last_sync_lsn;/* lsn of last LR on disk */
-    struct xfs_mount	*l_mp;		/* mount point */
-    struct xfs_buf	*l_xbuf;	/* extra buffer for log wrapping */
-    dev_t		l_dev;		/* dev_t of log */
-    xfs_daddr_t		l_logBBstart;	/* start block of log */
-    int			l_logsize;	/* size of log in bytes */
-    int			l_logBBsize;	/* size of log in 512 byte chunks */
+    struct xfs_mount	*l_mp;	        /* mount point */
+    struct xfs_buf	*l_xbuf;        /* extra buffer for log wrapping */
+    dev_t		l_dev;	        /* dev_t of log */
+    xfs_daddr_t		l_logBBstart;   /* start block of log */
+    int			l_logsize;      /* size of log in bytes */
+    int			l_logBBsize;    /* size of log in 512 byte chunks */
     int			l_roundoff;	/* round off error of all iclogs */
-    int			l_curr_cycle;	/* Cycle number of log writes */
-    int			l_prev_cycle;	/* Cycle # b4 last block increment */
-    int			l_curr_block;	/* current logical block of log */
-    int			l_prev_block;	/* previous logical block of log */
+    int			l_curr_cycle;   /* Cycle number of log writes */
+    int			l_prev_cycle;   /* Cycle # b4 last block increment */
+    int			l_curr_block;   /* current logical block of log */
+    int			l_prev_block;   /* previous logical block of log */
     int			l_iclog_size;	 /* size of log in bytes */
     int			l_iclog_size_log;/* log power size of log */
     int			l_iclog_bufs;	 /* number of iclog buffers */
@@ -530,8 +530,8 @@
     uint		l_flags;
     uint		l_quotaoffs_flag;/* XFS_DQ_*, if QUOTAOFFs found */
     struct xfs_buf_cancel **l_buf_cancel_table;
-    int			l_iclog_hsize;	/* size of iclog header */
-    int			l_iclog_heads;	/* number of iclog header sectors */
+    int			l_iclog_hsize;  /* size of iclog header */
+    int			l_iclog_heads;  /* number of iclog header sectors */
 } xlog_t;
 
 
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_log_recover.c linux-2.5.68-bk12/fs/xfs/xfs_log_recover.c
--- linux-2.5.68-bk11/fs/xfs/xfs_log_recover.c	2003-04-19 19:49:52.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_log_recover.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,8 +30,40 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-#include <xfs_log_recover.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_ag.h"
+#include "xfs_sb.h"
+#include "xfs_trans.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_error.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_imap.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_error.h"
+#include "xfs_log_priv.h"
+#include "xfs_buf_item.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_log_recover.h"
+#include "xfs_extfree_item.h"
+#include "xfs_trans_priv.h"
+#include "xfs_bit.h"
+#include "xfs_quota.h"
+#include "xfs_rw.h"
 
 STATIC int	xlog_find_zeroed(struct log *log, xfs_daddr_t *blk_no);
 
@@ -44,8 +76,8 @@
 STATIC void	xlog_recover_check_ail(xfs_mount_t *mp, xfs_log_item_t *lip,
 				       int gen);
 #else
-#define xlog_recover_check_summary(log)
-#define xlog_recover_check_ail(mp, lip, gen)
+#define	xlog_recover_check_summary(log)
+#define	xlog_recover_check_ail(mp, lip, gen)
 #endif /* DEBUG */
 
 
@@ -69,7 +101,7 @@
 
 
 /*
- * nbblks should be uint, but oh well.	Just want to catch that 32-bit length.
+ * nbblks should be uint, but oh well.  Just want to catch that 32-bit length.
  */
 int
 xlog_bread(xlog_t	*log,
@@ -242,7 +274,7 @@
 
 /*
  * This routine finds (to an approximation) the first block in the physical
- * log which contains the given cycle.	It uses a binary search algorithm.
+ * log which contains the given cycle.  It uses a binary search algorithm.
  * Note that the algorithm can not be perfect because the disk will not
  * necessarily be perfect.
  */
@@ -299,8 +331,8 @@
 	xfs_daddr_t		i, j;
 	uint			cycle;
 	xfs_buf_t		*bp;
-	char			*buf	    = NULL;
-	int			error	    = 0;
+	char                    *buf        = NULL;
+	int			error       = 0;
 	xfs_daddr_t		bufblks;
 
 	bufblks = 1 << ffs(nbblks);
@@ -356,17 +388,17 @@
 
 STATIC int
 xlog_find_verify_log_record(xlog_t	*log,
-			    xfs_daddr_t start_blk,
-			    xfs_daddr_t *last_blk,
+			    xfs_daddr_t	start_blk,
+			    xfs_daddr_t	*last_blk,
 			    int		extra_bblks)
 {
-    xfs_daddr_t		i;
+    xfs_daddr_t         i;
     xfs_buf_t		*bp;
-    char		*buf	    = NULL;
-    xlog_rec_header_t	*head	    = NULL;
-    int			error	    = 0;
-    int			smallmem    = 0;
-    int			num_blks    = *last_blk - start_blk;
+    char                *buf        = NULL;
+    xlog_rec_header_t	*head       = NULL;
+    int			error       = 0;
+    int                 smallmem    = 0;
+    int                 num_blks    = *last_blk - start_blk;
     int			xhdrs;
 
     ASSERT(start_blk != 0 || *last_blk != start_blk);
@@ -422,8 +454,8 @@
     /*
      * We may have found a log record header before we expected one.
      * last_blk will be the 1st block # with a given cycle #.  We may end
-     * up reading an entire log record.	 In this case, we don't want to
-     * reset last_blk.	Only when last_blk points in the middle of a log
+     * up reading an entire log record.  In this case, we don't want to
+     * reset last_blk.  Only when last_blk points in the middle of a log
      * record do we update last_blk.
      */
     if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb)) {
@@ -465,12 +497,12 @@
 xlog_find_head(xlog_t  *log,
 	       xfs_daddr_t *return_head_blk)
 {
-    xfs_buf_t	*bp;
+    xfs_buf_t   *bp;
     xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk;
-    int	    num_scan_bblks;
+    int     num_scan_bblks;
     uint    first_half_cycle, last_half_cycle;
     uint    stop_on_cycle;
-    int	    error, log_bbnum = log->l_logBBsize;
+    int     error, log_bbnum = log->l_logBBsize;
 
     /* Is the end of the log device zeroed? */
     if ((error = xlog_find_zeroed(log, &first_blk)) == -1) {
@@ -508,12 +540,12 @@
     /*
      * If the 1st half cycle number is equal to the last half cycle number,
      * then the entire log is stamped with the same cycle number.  In this
-     * case, head_blk can't be set to zero (which makes sense).	 The below
+     * case, head_blk can't be set to zero (which makes sense).  The below
      * math doesn't work out properly with head_blk equal to zero.  Instead,
      * we set it to log_bbnum which is an illegal block number, but this
      * value makes the math correct.  If head_blk doesn't changed through
      * all the tests below, *head_blk is set to zero at the very end rather
-     * than log_bbnum.	In a sense, log_bbnum and zero are the same block
+     * than log_bbnum.  In a sense, log_bbnum and zero are the same block
      * in a circular file.
      */
     if (first_half_cycle == last_half_cycle) {
@@ -521,15 +553,15 @@
 	 * In this case we believe that the entire log should have cycle
 	 * number last_half_cycle.  We need to scan backwards from the
 	 * end verifying that there are no holes still containing
-	 * last_half_cycle - 1.	 If we find such a hole, then the start
+	 * last_half_cycle - 1.  If we find such a hole, then the start
 	 * of that hole will be the new head.  The simple case looks like
-	 *	  x | x ... | x - 1 | x
+	 *        x | x ... | x - 1 | x
 	 * Another case that fits this picture would be
-	 *	  x | x + 1 | x ... | x
+	 *        x | x + 1 | x ... | x
 	 * In this case the head really is somwhere at the end of the
 	 * log, as one of the latest writes at the beginning was incomplete.
 	 * One more case is
-	 *	  x | x + 1 | x ... | x - 1 | x
+	 *        x | x + 1 | x ... | x - 1 | x
 	 * This is really the combination of the above two cases, and the
 	 * head has to end up at the start of the x-1 hole at the end of
 	 * the log.
@@ -547,20 +579,20 @@
 	 * In this case we want to find the first block with cycle number
 	 * matching last_half_cycle.  We expect the log to be some
 	 * variation on
-	 *	  x + 1 ... | x ...
+	 *        x + 1 ... | x ...
 	 * The first block with cycle number x (last_half_cycle) will be
-	 * where the new head belongs.	First we do a binary search for
+	 * where the new head belongs.  First we do a binary search for
 	 * the first occurrence of last_half_cycle.  The binary search
 	 * may not be totally accurate, so then we scan back from there
 	 * looking for occurrences of last_half_cycle before us.  If
 	 * that backwards scan wraps around the beginning of the log,
 	 * then we look for occurrences of last_half_cycle - 1 at the
 	 * end of the log.  The cases we're looking for look like
-	 *	  x + 1 ... | x | x + 1 | x ...
-	 *				 ^ binary search stopped here
+	 *        x + 1 ... | x | x + 1 | x ...
+	 *                               ^ binary search stopped here
 	 * or
-	 *	  x + 1 ... | x ... | x - 1 | x
-	 *	  <---------> less than scan distance
+	 *        x + 1 ... | x ... | x - 1 | x
+	 *        <---------> less than scan distance
 	 */
 	stop_on_cycle = last_half_cycle;
 	if ((error = xlog_find_cycle_start(log, bp, first_blk,
@@ -569,7 +601,7 @@
     }
 
     /*
-     * Now validate the answer.	 Scan back some number of maximum possible
+     * Now validate the answer.  Scan back some number of maximum possible
      * blocks and make sure each one has the expected cycle number.  The
      * maximum is determined by the total possible amount of buffering
      * in the in-core log.  The following number can be made tighter if
@@ -590,27 +622,27 @@
     } else {			/* need to read 2 parts of log */
 	/*
 	 * We are going to scan backwards in the log in two parts.  First
-	 * we scan the physical end of the log.	 In this part of the log,
+	 * we scan the physical end of the log.  In this part of the log,
 	 * we are looking for blocks with cycle number last_half_cycle - 1.
 	 * If we find one, then we know that the log starts there, as we've
 	 * found a hole that didn't get written in going around the end
-	 * of the physical log.	 The simple case for this is
-	 *	  x + 1 ... | x ... | x - 1 | x
-	 *	  <---------> less than scan distance
+	 * of the physical log.  The simple case for this is
+	 *        x + 1 ... | x ... | x - 1 | x
+	 *        <---------> less than scan distance
 	 * If all of the blocks at the end of the log have cycle number
 	 * last_half_cycle, then we check the blocks at the start of the
 	 * log looking for occurrences of last_half_cycle.  If we find one,
 	 * then our current estimate for the location of the first
 	 * occurrence of last_half_cycle is wrong and we move back to the
 	 * hole we've found.  This case looks like
-	 *	  x + 1 ... | x | x + 1 | x ...
-	 *				 ^ binary search stopped here
+	 *        x + 1 ... | x | x + 1 | x ...
+	 *                               ^ binary search stopped here
 	 * Another case we need to handle that only occurs in 256k logs is
-	 *	  x + 1 ... | x ... | x+1 | x ...
-	 *		     ^ binary search stops here
+	 *        x + 1 ... | x ... | x+1 | x ...
+	 *                   ^ binary search stops here
 	 * In a 256k log, the scan at the end of the log will see the x+1
 	 * blocks.  We need to skip past those since that is certainly not
-	 * the head of the log.	 By searching for last_half_cycle-1 we
+	 * the head of the log.  By searching for last_half_cycle-1 we
 	 * accomplish that.
 	 */
 	start_blk = log_bbnum - num_scan_bblks + head_blk;
@@ -645,7 +677,7 @@
      */
     num_scan_bblks = BTOBB(XLOG_MAX_RECORD_BSIZE);
     if (head_blk >= num_scan_bblks) {
-	start_blk = head_blk - num_scan_bblks;	/* don't read head_blk */
+	start_blk = head_blk - num_scan_bblks;  /* don't read head_blk */
 
 	/* start ptr at last block ptr before head_blk */
 	if ((error = xlog_find_verify_log_record(log,
@@ -690,7 +722,7 @@
     /*
      * When returning here, we have a good block number.  Bad block
      * means that during a previous crash, we didn't have a clean break
-     * from cycle number N to cycle number N-1.	 In this case, we need
+     * from cycle number N to cycle number N-1.  In this case, we need
      * to find the first block with cycle number N-1.
      */
     return 0;
@@ -710,11 +742,11 @@
  * This will be the block number of the last record to have its
  * associated buffers synced to disk.  Every log record header has
  * a sync lsn embedded in it.  LSNs hold block numbers, so it is easy
- * to get a sync block number.	The only concern is to figure out which
+ * to get a sync block number.  The only concern is to figure out which
  * log record header to believe.
  *
  * The following algorithm uses the log record header with the largest
- * lsn.	 The entire log record does not need to be valid.  We only care
+ * lsn.  The entire log record does not need to be valid.  We only care
  * that the header is valid.
  *
  * We could speed up search by using current head_blk buffer, but it is not
@@ -820,7 +852,7 @@
 
 	/*
 	 * Look for unmount record.  If we find it, then we know there
-	 * was a clean unmount.	 Since 'i' could be the last block in
+	 * was a clean unmount.  Since 'i' could be the last block in
 	 * the physical log, we convert to a log block before comparing
 	 * to the head_blk.
 	 *
@@ -909,7 +941,7 @@
  * Is the log zeroed at all?
  *
  * The last binary search should be changed to perform an X block read
- * once X becomes small enough.	 You can then search linearly through
+ * once X becomes small enough.  You can then search linearly through
  * the X blocks.  This will cut down on the number of reads we need to do.
  *
  * If the log is partially zeroed, this routine will pass back the blkno
@@ -926,10 +958,10 @@
 		 xfs_daddr_t	*blk_no)
 {
 	xfs_buf_t	*bp;
-	uint		first_cycle, last_cycle;
+	uint	        first_cycle, last_cycle;
 	xfs_daddr_t	new_blk, last_blk, start_blk;
-	xfs_daddr_t	num_scan_bblks;
-	int		error, log_bbnum = log->l_logBBsize;
+	xfs_daddr_t     num_scan_bblks;
+	int	        error, log_bbnum = log->l_logBBsize;
 
 	/* check totally zeroed log */
 	bp = xlog_get_bp(1,log->l_mp);
@@ -967,7 +999,7 @@
 		goto bp_err;
 
 	/*
-	 * Validate the answer.	 Because there is no way to guarantee that
+	 * Validate the answer.  Because there is no way to guarantee that
 	 * the entire log is made up of log records which are the same size,
 	 * we scan over the defined maximum blocks.  At this point, the maximum
 	 * is not chosen to mean anything special.   XXXmiken
@@ -982,8 +1014,8 @@
 	/*
 	 * We search for any instances of cycle number 0 that occur before
 	 * our current estimate of the head.  What we're trying to detect is
-	 *	  1 ... | 0 | 1 | 0...
-	 *			 ^ binary search ends here
+	 *        1 ... | 0 | 1 | 0...
+	 *                       ^ binary search ends here
 	 */
 	if ((error = xlog_find_verify_cycle(log, start_blk,
 					 (int)num_scan_bblks, 0, &new_blk)))
@@ -1027,9 +1059,9 @@
 	xlog_rec_header_t	*recp;
 	int			i, j;
 	int			end_block = start_block + blocks;
-	int			error	    = 0;
+	int			error       = 0;
 	xfs_buf_t		*bp;
-	char			*buf;
+	char		        *buf;
 	int			bufblks;
 
 	bufblks = 1 << ffs(blocks);
@@ -1160,7 +1192,7 @@
 	if ((head_block + max_distance) <= log->l_logBBsize) {
 		/*
 		 * We can stomp all the blocks we need to without
-		 * wrapping around the end of the log.	Just do it
+		 * wrapping around the end of the log.  Just do it
 		 * in a single write.  Use the cycle number of the
 		 * current cycle minus one so that the log will look like:
 		 *     n ... | n - 1 ...
@@ -1275,7 +1307,7 @@
 }	/* xlog_recover_add_to_cont_trans */
 
 
-/* The next region to add is the start of a new region.	 It could be
+/* The next region to add is the start of a new region.  It could be
  * a whole region or it could be the first part of a new region.  Because
  * of this, the assumption here is that the type and size fields of all
  * format structures fit into the first 32 bits of the structure.
@@ -1460,7 +1492,7 @@
 	xfs_buf_cancel_t	*nextp;
 	xfs_buf_cancel_t	*prevp;
 	xfs_buf_cancel_t	**bucket;
-	xfs_buf_log_format_v1_t *obuf_f;
+	xfs_buf_log_format_v1_t	*obuf_f;
 	xfs_daddr_t		blkno=0;
 	uint			len=0;
 	ushort			flags=0;
@@ -1511,7 +1543,7 @@
 
 	/*
 	 * The hash bucket is not empty, so search for duplicates of our
-	 * record.  If we find one them just bump its refcount.	 If not
+	 * record.  If we find one them just bump its refcount.  If not
 	 * then add us at the end of the list.
 	 */
 	prevp = NULL;
@@ -1554,7 +1586,7 @@
 	xfs_buf_cancel_t	*bcp;
 	xfs_buf_cancel_t	*prevp;
 	xfs_buf_cancel_t	**bucket;
-	xfs_buf_log_format_v1_t *obuf_f;
+	xfs_buf_log_format_v1_t	*obuf_f;
 	xfs_daddr_t		blkno=0;
 	ushort			flags=0;
 	uint			len=0;
@@ -1665,7 +1697,7 @@
 	int			inodes_per_buf;
 	xfs_agino_t		*logged_nextp;
 	xfs_agino_t		*buffer_nextp;
-	xfs_buf_log_format_v1_t *obuf_f;
+	xfs_buf_log_format_v1_t	*obuf_f;
 	unsigned int		*data_map=NULL;
 	unsigned int		map_size=0;
 
@@ -1761,7 +1793,7 @@
 }	/* xlog_recover_do_inode_buffer */
 
 /*
- * Perform a 'normal' buffer recovery.	Each logged region of the
+ * Perform a 'normal' buffer recovery.  Each logged region of the
  * buffer should be copied over the corresponding region in the
  * given buffer.  The bitmap in the buf log format structure indicates
  * where to place the logged data.
@@ -1771,15 +1803,15 @@
 xlog_recover_do_reg_buffer(xfs_mount_t		*mp,
 			   xlog_recover_item_t	*item,
 			   xfs_buf_t		*bp,
-			   xfs_buf_log_format_t *buf_f)
+			   xfs_buf_log_format_t	*buf_f)
 {
 	int			i;
 	int			bit;
 	int			nbits;
-	xfs_buf_log_format_v1_t *obuf_f;
+	xfs_buf_log_format_v1_t	*obuf_f;
 	unsigned int		*data_map=NULL;
 	unsigned int		map_size=0;
-	int			error;
+	int                     error;
 
 	switch (buf_f->blf_type) {
 	case XFS_LI_BUF:
@@ -1794,7 +1826,7 @@
 		break;
 	}
 	bit = 0;
-	i = 1;	/* 0 is the buf format structure */
+	i = 1;  /* 0 is the buf format structure */
 	while (1) {
 		bit = xfs_next_bit(data_map, map_size, bit);
 		if (bit == -1)
@@ -1967,7 +1999,7 @@
 	if (mp->m_qflags == 0) {
 		return;
 	}
-	
+
 	type = 0;
 	if (buf_f->blf_flags & XFS_BLI_UDQUOT_BUF)
 		type |= XFS_DQ_USER;
@@ -2011,7 +2043,7 @@
 			     int		 pass)
 {
 	xfs_buf_log_format_t	*buf_f;
-	xfs_buf_log_format_v1_t *obuf_f;
+	xfs_buf_log_format_v1_t	*obuf_f;
 	xfs_mount_t		*mp;
 	xfs_buf_t		*bp;
 	int			error;
@@ -2091,7 +2123,7 @@
 		return XFS_ERROR(error);
 
 	/*
-	 * Perform delayed write on the buffer.	 Asynchronous writes will be
+	 * Perform delayed write on the buffer.  Asynchronous writes will be
 	 * slower when taking into account all the buffers to be flushed.
 	 *
 	 * Also make sure that only inode buffers with good sizes stay in
@@ -2099,7 +2131,7 @@
 	 * or XFS_INODE_CLUSTER_SIZE bytes, whichever is bigger.  The inode
 	 * buffers in the log can be a different size if the log was generated
 	 * by an older kernel using unclustered inode buffers or a newer kernel
-	 * running with a different inode cluster size.	 Regardless, if the
+	 * running with a different inode cluster size.  Regardless, if the
 	 * the inode buffer size isn't MAX(blocksize, XFS_INODE_CLUSTER_SIZE)
 	 * for *our* value of XFS_INODE_CLUSTER_SIZE, then we need to keep
 	 * the buffer out of the buffer cache so that the buffer won't
@@ -2158,7 +2190,7 @@
 		 * its cluster is located on disk, and we can't allow
 		 * xfs_imap() to figure it out because the inode btrees
 		 * are not ready to be used.  Therefore do not pass the
-		 * XFS_IMAP_LOOKUP flag to xfs_imap().	This will give
+		 * XFS_IMAP_LOOKUP flag to xfs_imap().  This will give
 		 * us only the single block in which the inode lives
 		 * rather than its cluster, so we must make sure to
 		 * invalidate the buffer when we write it out below.
@@ -2308,7 +2340,7 @@
 	}
 
 	/*
-	 * If we logged any attribute data, recover it.	 There may or
+	 * If we logged any attribute data, recover it.  There may or
 	 * may not have been any other non-core data logged in this
 	 * transaction.
 	 */
@@ -2531,7 +2563,7 @@
 
 /*
  * This routine is called when an efd format structure is found in
- * a committed transaction in the log.	It's purpose is to cancel
+ * a committed transaction in the log.  It's purpose is to cancel
  * the corresponding efi if it was still in the log.  To do this
  * it searches the AIL for the efi with an id equal to that in the
  * efd format structure.  If we find it, we remove the efi from the
@@ -2672,7 +2704,7 @@
  * Remember that EFIs, EFDs, and IUNLINKs are handled later.
  */
 STATIC void
-xlog_recover_free_trans(xlog_recover_t	    *trans)
+xlog_recover_free_trans(xlog_recover_t      *trans)
 {
 	xlog_recover_item_t *first_item, *item, *free_item;
 	int i;
@@ -2725,7 +2757,7 @@
 
 /*
  * There are two valid states of the r_state field.  0 indicates that the
- * transaction structure is in a normal state.	We have either seen the
+ * transaction structure is in a normal state.  We have either seen the
  * start of the transaction or the last operation we added was not a partial
  * operation.  If the last operation we added to the transaction was a
  * partial operation, we need to mark r_state with XLOG_WAS_CONT_TRANS.
@@ -2835,7 +2867,7 @@
 
 	/*
 	 * First check the validity of the extents described by the
-	 * EFI.	 If any are bad, then assume that all are bad and
+	 * EFI.  If any are bad, then assume that all are bad and
 	 * just toss the EFI.
 	 */
 	for (i = 0; i < efip->efi_format.efi_nextents; i++) {
@@ -2913,7 +2945,7 @@
  *
  * When we start, we know that the EFIs are the only things in
  * the AIL.  As we process them, however, other items are added
- * to the AIL.	Since everything added to the AIL must come after
+ * to the AIL.  Since everything added to the AIL must come after
  * everything already in the AIL, we stop processing as soon as
  * we see something other than an EFI in the AIL.
  */
@@ -3009,7 +3041,7 @@
  * inodes will be on the lists in the AGI blocks.  What we do
  * here is scan all the AGIs and fully truncate and free any
  * inodes found on the lists.  Each inode is removed from the
- * lists when it has been fully truncated and is freed.	 The
+ * lists when it has been fully truncated and is freed.  The
  * freeing of the inode and its removal from the list must be
  * atomic.
  */
@@ -3091,7 +3123,7 @@
 					 * being sent when the
 					 * reference on the inode is
 					 * dropped.
-                                         */
+					 */
 					ip->i_d.di_dmevmask = 0;
 
 					/*
@@ -3114,9 +3146,9 @@
 					 * We can't read in the inode
 					 * this bucket points to, or
 					 * this inode is messed up.  Just
-					 * ditch this bucket of inodes.	 We
+					 * ditch this bucket of inodes.  We
 					 * will lose some inodes and space,
-					 * but at least we won't hang.	Call
+					 * but at least we won't hang.  Call
 					 * xlog_recover_clear_agi_bucket()
 					 * to perform a transaction to clear
 					 * the inode pointer in the bucket.
@@ -3282,7 +3314,7 @@
  * Read the log from tail to head and process the log records found.
  * Handle the two cases where the tail and head are in the same cycle
  * and where the active portion of the log wraps around the end of
- * the physical log separately.	 The pass parameter is passed through
+ * the physical log separately.  The pass parameter is passed through
  * to the routines called to process the data and is not looked at
  * here.
  */
@@ -3306,12 +3338,12 @@
 
     /*
      * Read the header of the tail block and get the iclog buffer size from
-     * h_size.	Use this to tell how many sectors make up the log header.
+     * h_size.  Use this to tell how many sectors make up the log header.
      */
     if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb)) {
 	/*
 	 * When using variable length iclogs, read first sector of iclog
-	 * header and extract the header size from it.	Get a new hbp that
+	 * header and extract the header size from it.  Get a new hbp that
 	 * is the correct size.
 	 */
 	hbp = xlog_get_bp(1, log->l_mp);
@@ -3392,7 +3424,7 @@
 	}
     } else {
 	/*
-	 * Perform recovery around the end of the physical log.	 When the head
+	 * Perform recovery around the end of the physical log.  When the head
 	 * is not on the same cycle number as the tail, we can't do a sequential
 	 * recovery as above.
 	 */
@@ -3507,12 +3539,12 @@
 }
 
 /*
- * Do the recovery of the log.	We actually do this in two phases.
+ * Do the recovery of the log.  We actually do this in two phases.
  * The two passes are necessary in order to implement the function
- * of cancelling a record written into the log.	 The first pass
+ * of cancelling a record written into the log.  The first pass
  * determines those things which have been cancelled, and the
  * second pass replays log items normally except for those which
- * have been cancelled.	 The handling of the replay and cancellations
+ * have been cancelled.  The handling of the replay and cancellations
  * takes place in the log item type specific routines.
  *
  * The table of items which have cancel records in the log is allocated
@@ -3699,9 +3731,9 @@
 
 /*
  * In the first part of recovery we replay inodes and buffers and build
- * up the list of extent free items which need to be processed.	 Here
+ * up the list of extent free items which need to be processed.  Here
  * we process the extent free items and clean up the on disk unlinked
- * inode lists.	 This is separated from the first part of recovery so
+ * inode lists.  This is separated from the first part of recovery so
  * that the root and real-time bitmap inodes can be read in from disk in
  * between the two stages.  This is necessary so that we can free space
  * in the real-time portion of the file system.
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_log_recover.h linux-2.5.68-bk12/fs/xfs/xfs_log_recover.h
--- linux-2.5.68-bk11/fs/xfs/xfs_log_recover.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_log_recover.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,17 +29,17 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_LOG_RECOVER_H__
+#ifndef	__XFS_LOG_RECOVER_H__
 #define __XFS_LOG_RECOVER_H__
 
 /*
  * Macros, structures, prototypes for internal log manager use.
  */
 
-#define XLOG_RHASH_BITS	 4
-#define XLOG_RHASH_SIZE 16
+#define XLOG_RHASH_BITS  4
+#define XLOG_RHASH_SIZE	16
 #define XLOG_RHASH_SHIFT 2
-#define XLOG_RHASH(tid) \
+#define XLOG_RHASH(tid)	\
 	((((__uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
 
 #define XLOG_MAX_REGIONS_IN_ITEM   (XFS_MAX_BLOCKSIZE / XFS_BLI_CHUNK / 2 + 1)
@@ -73,9 +73,9 @@
  * This is the number of entries in the l_buf_cancel_table used during
  * recovery.
  */
-#define XLOG_BC_TABLE_SIZE	64
+#define	XLOG_BC_TABLE_SIZE	64
 
-#define XLOG_RECOVER_PASS1	1
-#define XLOG_RECOVER_PASS2	2
+#define	XLOG_RECOVER_PASS1	1
+#define	XLOG_RECOVER_PASS2	2
 
 #endif	/* __XFS_LOG_RECOVER_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_mac.c linux-2.5.68-bk12/fs/xfs/xfs_mac.c
--- linux-2.5.68-bk11/fs/xfs/xfs_mac.c	2003-04-19 19:49:54.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_mac.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
 
 static xfs_mac_label_t *mac_low_high_lp;
 static xfs_mac_label_t *mac_high_low_lp;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_mac.h linux-2.5.68-bk12/fs/xfs/xfs_mac.h
--- linux-2.5.68-bk11/fs/xfs/xfs_mac.h	2003-04-19 19:51:22.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_mac.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -40,23 +40,23 @@
  * divisions (MINT). This is actually a header for the data structure which
  * will have an ml_list with more than one element.
  *
- *	-------------------------------
- *	| ml_msen_type | ml_mint_type |
- *	-------------------------------
- *	| ml_level     | ml_grade     |
- *	-------------------------------
- *	| ml_catcount		      |
- *	-------------------------------
- *	| ml_divcount		      |
- *	-------------------------------
- *	| category 1		      |
- *	| . . .			      |
- *	| category N		      | (where N = ml_catcount)
- *	-------------------------------
- *	| division 1		      |
- *	| . . .			      |
- *	| division M		      | (where M = ml_divcount)
- *	-------------------------------
+ *      -------------------------------
+ *      | ml_msen_type | ml_mint_type |
+ *      -------------------------------
+ *      | ml_level     | ml_grade     |
+ *      -------------------------------
+ *      | ml_catcount                 |
+ *      -------------------------------
+ *      | ml_divcount                 |
+ *      -------------------------------
+ *      | category 1                  |
+ *      | . . .                       |
+ *      | category N                  | (where N = ml_catcount)
+ *      -------------------------------
+ *      | division 1                  |
+ *      | . . .                       |
+ *      | division M                  | (where M = ml_divcount)
+ *      -------------------------------
  */
 #define XFS_MAC_MAX_SETS	250
 typedef struct xfs_mac_label {
@@ -70,18 +70,18 @@
 	__uint16_t	ml_list[XFS_MAC_MAX_SETS];
 } xfs_mac_label_t;
 
-/* MSEN label type names. Choose an upper case ASCII character.	 */
+/* MSEN label type names. Choose an upper case ASCII character.  */
 #define XFS_MSEN_ADMIN_LABEL	'A'	/* Admin: low<admin != tcsec<high */
 #define XFS_MSEN_EQUAL_LABEL	'E'	/* Wildcard - always equal */
 #define XFS_MSEN_HIGH_LABEL	'H'	/* System High - always dominates */
-#define XFS_MSEN_MLD_HIGH_LABEL 'I'	/* System High, multi-level dir */
+#define XFS_MSEN_MLD_HIGH_LABEL	'I'	/* System High, multi-level dir */
 #define XFS_MSEN_LOW_LABEL	'L'	/* System Low - always dominated */
 #define XFS_MSEN_MLD_LABEL	'M'	/* TCSEC label on a multi-level dir */
 #define XFS_MSEN_MLD_LOW_LABEL	'N'	/* System Low, multi-level dir */
 #define XFS_MSEN_TCSEC_LABEL	'T'	/* TCSEC label */
 #define XFS_MSEN_UNKNOWN_LABEL	'U'	/* unknown label */
 
-/* MINT label type names. Choose a lower case ASCII character.	*/
+/* MINT label type names. Choose a lower case ASCII character.  */
 #define XFS_MINT_BIBA_LABEL	'b'	/* Dual of a TCSEC label */
 #define XFS_MINT_EQUAL_LABEL	'e'	/* Wildcard - always equal */
 #define XFS_MINT_HIGH_LABEL	'h'	/* High Grade - always dominates */
@@ -110,7 +110,7 @@
 #define _MAC_EXISTS		xfs_mac_vhaslabel
 
 #else
-#define _MAC_XFS_IACCESS(i,m,c) (0)
+#define _MAC_XFS_IACCESS(i,m,c)	(0)
 #define _MAC_VACCESS(v,c,m)	(0)
 #define _MAC_EXISTS		(NULL)
 #endif
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_macros.c linux-2.5.68-bk12/fs/xfs/xfs_macros.c
--- linux-2.5.68-bk11/fs/xfs/xfs_macros.c	2003-04-19 19:48:57.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_macros.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,10 +30,42 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#define XFS_MACRO_C
-
-#include <xfs.h>
+#define	XFS_MACRO_C
 
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_ialloc.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_rw.h"
+#include "xfs_log_priv.h"
+#include "xfs_da_btree.h"
+#include "xfs_attr_leaf.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_dir2_data.h"
+#include "xfs_dir2_leaf.h"
+#include "xfs_dir2_block.h"
+#include "xfs_dir2_node.h"
+#include "xfs_bit.h"
 
 #if XFS_WANT_FUNCS_C || (XFS_WANT_SPACE_C && XFSSO_ISNULLDSTARTBLOCK)
 int
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_macros.h linux-2.5.68-bk12/fs/xfs/xfs_macros.h
--- linux-2.5.68-bk11/fs/xfs/xfs_macros.h	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_macros.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,14 +30,14 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_MACROS_H__
-#define __XFS_MACROS_H__
+#define	__XFS_MACROS_H__
 
 /*
  * Set for debug kernels and simulation
  * These replacements save space.
  * Used in xfs_macros.c.
  */
-#define XFS_WANT_SPACE_C	\
+#define	XFS_WANT_SPACE_C	\
 	(!defined(_STANDALONE) && defined(DEBUG))
 
 /*
@@ -45,60 +45,60 @@
  * These replacements do not save space.
  * Used in xfs_macros.c.
  */
-#define XFS_WANT_FUNCS_C	\
+#define	XFS_WANT_FUNCS_C	\
 	(!defined(_STANDALONE) && defined(DEBUG))
 
 /*
  * Corresponding names used in .h files.
  */
-#define XFS_WANT_SPACE	(XFS_WANT_SPACE_C && !defined(XFS_MACRO_C))
-#define XFS_WANT_FUNCS	(XFS_WANT_FUNCS_C && !defined(XFS_MACRO_C))
+#define	XFS_WANT_SPACE	(XFS_WANT_SPACE_C && !defined(XFS_MACRO_C))
+#define	XFS_WANT_FUNCS	(XFS_WANT_FUNCS_C && !defined(XFS_MACRO_C))
 
 /*
  * These are the macros that get turned into functions to save space.
  */
-#define XFSSO_NULLSTARTBLOCK 1
-#define XFSSO_XFS_AGB_TO_DADDR 1
+#define	XFSSO_NULLSTARTBLOCK 1
+#define	XFSSO_XFS_AGB_TO_DADDR 1
 #define XFSSO_XFS_AGB_TO_FSB 1
-#define XFSSO_XFS_AGINO_TO_INO 1
-#define XFSSO_XFS_ALLOC_BLOCK_MINRECS 1
-#define XFSSO_XFS_ATTR_SF_NEXTENTRY 1
-#define XFSSO_XFS_BMAP_BLOCK_DMAXRECS 1
-#define XFSSO_XFS_BMAP_BLOCK_IMAXRECS 1
-#define XFSSO_XFS_BMAP_BLOCK_IMINRECS 1
-#define XFSSO_XFS_BMAP_INIT 1
-#define XFSSO_XFS_BMAP_PTR_IADDR 1
-#define XFSSO_XFS_BMAP_SANITY_CHECK 1
-#define XFSSO_XFS_BMAPI_AFLAG 1
-#define XFSSO_XFS_CFORK_SIZE 1
-#define XFSSO_XFS_DA_COOKIE_BNO 1
-#define XFSSO_XFS_DA_COOKIE_ENTRY 1
-#define XFSSO_XFS_DADDR_TO_AGBNO 1
-#define XFSSO_XFS_DADDR_TO_FSB 1
-#define XFSSO_XFS_DFORK_PTR 1
-#define XFSSO_XFS_DIR_SF_GET_DIRINO 1
-#define XFSSO_XFS_DIR_SF_NEXTENTRY 1
-#define XFSSO_XFS_DIR_SF_PUT_DIRINO 1
-#define XFSSO_XFS_FILBLKS_MIN 1
-#define XFSSO_XFS_FSB_SANITY_CHECK 1
-#define XFSSO_XFS_FSB_TO_DADDR 1
-#define XFSSO_XFS_FSB_TO_DB 1
-#define XFSSO_XFS_IALLOC_INODES 1
-#define XFSSO_XFS_IFORK_ASIZE 1
-#define XFSSO_XFS_IFORK_DSIZE 1
-#define XFSSO_XFS_IFORK_FORMAT 1
-#define XFSSO_XFS_IFORK_NEXT_SET 1
-#define XFSSO_XFS_IFORK_NEXTENTS 1
-#define XFSSO_XFS_IFORK_PTR 1
-#define XFSSO_XFS_ILOG_FBROOT 1
-#define XFSSO_XFS_ILOG_FEXT 1
-#define XFSSO_XFS_INO_MASK 1
-#define XFSSO_XFS_INO_TO_FSB 1
-#define XFSSO_XFS_INODE_CLEAR_READ_AHEAD 1
-#define XFSSO_XFS_MIN_FREELIST 1
+#define	XFSSO_XFS_AGINO_TO_INO 1
+#define	XFSSO_XFS_ALLOC_BLOCK_MINRECS 1
+#define	XFSSO_XFS_ATTR_SF_NEXTENTRY 1
+#define	XFSSO_XFS_BMAP_BLOCK_DMAXRECS 1
+#define	XFSSO_XFS_BMAP_BLOCK_IMAXRECS 1
+#define	XFSSO_XFS_BMAP_BLOCK_IMINRECS 1
+#define	XFSSO_XFS_BMAP_INIT 1
+#define	XFSSO_XFS_BMAP_PTR_IADDR 1
+#define	XFSSO_XFS_BMAP_SANITY_CHECK 1
+#define	XFSSO_XFS_BMAPI_AFLAG 1
+#define	XFSSO_XFS_CFORK_SIZE 1
+#define	XFSSO_XFS_DA_COOKIE_BNO 1
+#define	XFSSO_XFS_DA_COOKIE_ENTRY 1
+#define	XFSSO_XFS_DADDR_TO_AGBNO 1
+#define	XFSSO_XFS_DADDR_TO_FSB 1
+#define	XFSSO_XFS_DFORK_PTR 1
+#define	XFSSO_XFS_DIR_SF_GET_DIRINO 1
+#define	XFSSO_XFS_DIR_SF_NEXTENTRY 1
+#define	XFSSO_XFS_DIR_SF_PUT_DIRINO 1
+#define	XFSSO_XFS_FILBLKS_MIN 1
+#define	XFSSO_XFS_FSB_SANITY_CHECK 1
+#define	XFSSO_XFS_FSB_TO_DADDR 1
+#define	XFSSO_XFS_FSB_TO_DB 1
+#define	XFSSO_XFS_IALLOC_INODES 1
+#define	XFSSO_XFS_IFORK_ASIZE 1
+#define	XFSSO_XFS_IFORK_DSIZE 1
+#define	XFSSO_XFS_IFORK_FORMAT 1
+#define	XFSSO_XFS_IFORK_NEXT_SET 1
+#define	XFSSO_XFS_IFORK_NEXTENTS 1
+#define	XFSSO_XFS_IFORK_PTR 1
+#define	XFSSO_XFS_ILOG_FBROOT 1
+#define	XFSSO_XFS_ILOG_FEXT 1
+#define	XFSSO_XFS_INO_MASK 1
+#define	XFSSO_XFS_INO_TO_FSB 1
+#define	XFSSO_XFS_INODE_CLEAR_READ_AHEAD 1
+#define	XFSSO_XFS_MIN_FREELIST 1
 #define XFSSO_XFS_SB_GOOD_VERSION 1
 #define XFSSO_XFS_SB_VERSION_HASNLINK 1
-#define XFSSO_XLOG_GRANT_ADD_SPACE 1
-#define XFSSO_XLOG_GRANT_SUB_SPACE 1
+#define	XFSSO_XLOG_GRANT_ADD_SPACE 1
+#define	XFSSO_XLOG_GRANT_SUB_SPACE 1
 
 #endif	/* __XFS_MACROS_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_mount.c linux-2.5.68-bk12/fs/xfs/xfs_mount.c
--- linux-2.5.68-bk11/fs/xfs/xfs_mount.c	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_mount.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,61 +30,86 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_alloc.h"
+#include "xfs_rtalloc.h"
+#include "xfs_bmap.h"
+#include "xfs_error.h"
+#include "xfs_bit.h"
+#include "xfs_rw.h"
+#include "xfs_quota.h"
+#include "xfs_fsops.h"
 
 STATIC void	xfs_mount_log_sbunit(xfs_mount_t *, __int64_t);
 STATIC int	xfs_uuid_mount(xfs_mount_t *);
 STATIC void	xfs_uuid_unmount(xfs_mount_t *mp);
 
-mutex_t		xfs_uuidtabmon;		/* monitor for uuidtab */
-STATIC int	xfs_uuidtab_size;
-STATIC uuid_t	*xfs_uuidtab;
-
 void xfs_xlatesb(void *, xfs_sb_t *, int, xfs_arch_t, __int64_t);
 
 static struct {
     short offset;
-    short type;	    /* 0 = integer
-		     * 1 = binary / string (no translation)
-		     */
+    short type;     /* 0 = integer
+		* 1 = binary / string (no translation)
+		*/
 } xfs_sb_info[] = {
-    { offsetof(xfs_sb_t, sb_magicnum),	 0 },
-    { offsetof(xfs_sb_t, sb_blocksize),	 0 },
-    { offsetof(xfs_sb_t, sb_dblocks),	 0 },
-    { offsetof(xfs_sb_t, sb_rblocks),	 0 },
-    { offsetof(xfs_sb_t, sb_rextents),	 0 },
-    { offsetof(xfs_sb_t, sb_uuid),	 1 },
-    { offsetof(xfs_sb_t, sb_logstart),	 0 },
-    { offsetof(xfs_sb_t, sb_rootino),	 0 },
-    { offsetof(xfs_sb_t, sb_rbmino),	 0 },
-    { offsetof(xfs_sb_t, sb_rsumino),	 0 },
-    { offsetof(xfs_sb_t, sb_rextsize),	 0 },
-    { offsetof(xfs_sb_t, sb_agblocks),	 0 },
-    { offsetof(xfs_sb_t, sb_agcount),	 0 },
-    { offsetof(xfs_sb_t, sb_rbmblocks),	 0 },
-    { offsetof(xfs_sb_t, sb_logblocks),	 0 },
+    { offsetof(xfs_sb_t, sb_magicnum),   0 },
+    { offsetof(xfs_sb_t, sb_blocksize),  0 },
+    { offsetof(xfs_sb_t, sb_dblocks),    0 },
+    { offsetof(xfs_sb_t, sb_rblocks),    0 },
+    { offsetof(xfs_sb_t, sb_rextents),   0 },
+    { offsetof(xfs_sb_t, sb_uuid),       1 },
+    { offsetof(xfs_sb_t, sb_logstart),   0 },
+    { offsetof(xfs_sb_t, sb_rootino),    0 },
+    { offsetof(xfs_sb_t, sb_rbmino),     0 },
+    { offsetof(xfs_sb_t, sb_rsumino),    0 },
+    { offsetof(xfs_sb_t, sb_rextsize),   0 },
+    { offsetof(xfs_sb_t, sb_agblocks),   0 },
+    { offsetof(xfs_sb_t, sb_agcount),    0 },
+    { offsetof(xfs_sb_t, sb_rbmblocks),  0 },
+    { offsetof(xfs_sb_t, sb_logblocks),  0 },
     { offsetof(xfs_sb_t, sb_versionnum), 0 },
-    { offsetof(xfs_sb_t, sb_sectsize),	 0 },
-    { offsetof(xfs_sb_t, sb_inodesize),	 0 },
-    { offsetof(xfs_sb_t, sb_inopblock),	 0 },
-    { offsetof(xfs_sb_t, sb_fname[0]),	 1 },
-    { offsetof(xfs_sb_t, sb_blocklog),	 0 },
-    { offsetof(xfs_sb_t, sb_sectlog),	 0 },
-    { offsetof(xfs_sb_t, sb_inodelog),	 0 },
-    { offsetof(xfs_sb_t, sb_inopblog),	 0 },
-    { offsetof(xfs_sb_t, sb_agblklog),	 0 },
-    { offsetof(xfs_sb_t, sb_rextslog),	 0 },
+    { offsetof(xfs_sb_t, sb_sectsize),   0 },
+    { offsetof(xfs_sb_t, sb_inodesize),  0 },
+    { offsetof(xfs_sb_t, sb_inopblock),  0 },
+    { offsetof(xfs_sb_t, sb_fname[0]),   1 },
+    { offsetof(xfs_sb_t, sb_blocklog),   0 },
+    { offsetof(xfs_sb_t, sb_sectlog),    0 },
+    { offsetof(xfs_sb_t, sb_inodelog),   0 },
+    { offsetof(xfs_sb_t, sb_inopblog),   0 },
+    { offsetof(xfs_sb_t, sb_agblklog),   0 },
+    { offsetof(xfs_sb_t, sb_rextslog),   0 },
     { offsetof(xfs_sb_t, sb_inprogress), 0 },
-    { offsetof(xfs_sb_t, sb_imax_pct),	 0 },
-    { offsetof(xfs_sb_t, sb_icount),	 0 },
-    { offsetof(xfs_sb_t, sb_ifree),	 0 },
-    { offsetof(xfs_sb_t, sb_fdblocks),	 0 },
-    { offsetof(xfs_sb_t, sb_frextents),	 0 },
-    { offsetof(xfs_sb_t, sb_uquotino),	 0 },
-    { offsetof(xfs_sb_t, sb_gquotino),	 0 },
-    { offsetof(xfs_sb_t, sb_qflags),	 0 },
-    { offsetof(xfs_sb_t, sb_flags),	 0 },
-    { offsetof(xfs_sb_t, sb_shared_vn),	 0 },
+    { offsetof(xfs_sb_t, sb_imax_pct),   0 },
+    { offsetof(xfs_sb_t, sb_icount),     0 },
+    { offsetof(xfs_sb_t, sb_ifree),      0 },
+    { offsetof(xfs_sb_t, sb_fdblocks),   0 },
+    { offsetof(xfs_sb_t, sb_frextents),  0 },
+    { offsetof(xfs_sb_t, sb_uquotino),   0 },
+    { offsetof(xfs_sb_t, sb_gquotino),   0 },
+    { offsetof(xfs_sb_t, sb_qflags),     0 },
+    { offsetof(xfs_sb_t, sb_flags),      0 },
+    { offsetof(xfs_sb_t, sb_shared_vn),  0 },
     { offsetof(xfs_sb_t, sb_inoalignmt), 0 },
     { offsetof(xfs_sb_t, sb_unit),	 0 },
     { offsetof(xfs_sb_t, sb_width),	 0 },
@@ -345,12 +370,12 @@
 /*
  * xfs_xlatesb
  *
- *     data	  - on disk version of sb
- *     sb	  - a superblock
- *     dir	  - conversion direction: <0 - convert sb to buf
- *					  >0 - convert buf to sb
- *     arch	  - architecture to read/write from/to buf
- *     fields	  - which fields to copy (bitmask)
+ *     data       - on disk version of sb
+ *     sb         - a superblock
+ *     dir        - conversion direction: <0 - convert sb to buf
+ *                                        >0 - convert buf to sb
+ *     arch       - architecture to read/write from/to buf
+ *     fields     - which fields to copy (bitmask)
  */
 void
 xfs_xlatesb(
@@ -593,7 +618,7 @@
 xfs_mountfs(
 	vfs_t		*vfsp,
 	xfs_mount_t	*mp,
-	dev_t 		dev, 
+	dev_t		dev,
 	int		mfsi_flags)
 {
 	xfs_buf_t	*bp;
@@ -698,14 +723,14 @@
 		icount = sbp->sb_dblocks * sbp->sb_imax_pct;
 		do_div(icount, 100);
 		do_div(icount, mp->m_ialloc_blks);
-		mp->m_maxicount = (icount * mp->m_ialloc_blks)	<<
+		mp->m_maxicount = (icount * mp->m_ialloc_blks)  <<
 				   sbp->sb_inopblog;
 	} else
 		mp->m_maxicount = 0;
 
 	/*
 	 * XFS uses the uuid from the superblock as the unique
-	 * identifier for fsid.	 We can not use the uuid from the volume
+	 * identifier for fsid.  We can not use the uuid from the volume
 	 * since a single partition filesystem is identical to a single
 	 * partition volume/filesystem.
 	 */
@@ -1092,7 +1117,7 @@
 	xfs_mount_free(mp, 1);
 	return 0;
 }
- 
+
 void
 xfs_unmountfs_close(xfs_mount_t *mp, struct cred *cr)
 {
@@ -1153,7 +1178,7 @@
 			xfs_ioerror_alert("xfs_unmountfs_writesb",
 					  mp, sbp, XFS_BUF_ADDR(sbp));
 		if (error && mp->m_mk_sharedro)
-			xfs_fs_cmn_err(CE_ALERT, mp, "Superblock write error detected while unmounting.	 Filesystem may not be marked shared readonly");
+			xfs_fs_cmn_err(CE_ALERT, mp, "Superblock write error detected while unmounting.  Filesystem may not be marked shared readonly");
 	}
 	xfs_buf_relse(sbp);
 	return (error);
@@ -1169,7 +1194,7 @@
 void
 xfs_mod_sb(xfs_trans_t *tp, __int64_t fields)
 {
-	xfs_buf_t		*bp;
+	xfs_buf_t	*bp;
 	int		first;
 	int		last;
 	xfs_mount_t	*mp;
@@ -1213,11 +1238,11 @@
  */
 STATIC int
 xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field,
-			  int delta, int rsvd)
+			int delta, int rsvd)
 {
 	int		scounter;	/* short counter for 32 bit fields */
 	long long	lcounter;	/* long counter for 64 bit fields */
-	long long res_used, rem;
+	long long	res_used, rem;
 
 	/*
 	 * With the in-core superblock spin lock held, switch
@@ -1370,8 +1395,8 @@
 
 /*
  * xfs_mod_incore_sb() is used to change a field in the in-core
- * superblock structure by the specified delta.	 This modification
- * is protected by the SB_LOCK.	 Just use the xfs_mod_incore_sb_unlocked()
+ * superblock structure by the specified delta.  This modification
+ * is protected by the SB_LOCK.  Just use the xfs_mod_incore_sb_unlocked()
  * routine to do the work.
  */
 int
@@ -1400,7 +1425,7 @@
 int
 xfs_mod_incore_sb_batch(xfs_mount_t *mp, xfs_mod_sb_t *msb, uint nmsb, int rsvd)
 {
-	unsigned long		s;
+	unsigned long	s;
 	int		status=0;
 	xfs_mod_sb_t	*msbp;
 
@@ -1415,7 +1440,7 @@
 	msbp = &msb[0];
 	for (msbp = &msbp[0]; msbp < (msb + nmsb); msbp++) {
 		/*
-		 * Apply the delta at index n.	If it fails, break
+		 * Apply the delta at index n.  If it fails, break
 		 * from the loop so we'll fall into the undo loop
 		 * below.
 		 */
@@ -1428,7 +1453,7 @@
 
 	/*
 	 * If we didn't complete the loop above, then back out
-	 * any changes made to the superblock.	If you add code
+	 * any changes made to the superblock.  If you add code
 	 * between the loop above and here, make sure that you
 	 * preserve the value of status. Loop back until
 	 * we step below the beginning of the array.  Make sure
@@ -1457,10 +1482,12 @@
  * If it can't then we'll return NULL.
  */
 xfs_buf_t *
-xfs_getsb(xfs_mount_t	*mp,
-	  int		flags)
+xfs_getsb(
+	xfs_mount_t	*mp,
+	int		flags)
 {
 	xfs_buf_t	*bp;
+
 	ASSERT(mp->m_sb_bp != NULL);
 	bp = mp->m_sb_bp;
 	if (flags & XFS_BUF_TRYLOCK) {
@@ -1495,67 +1522,36 @@
 }
 
 /*
- * See if the uuid is unique among mounted xfs filesystems.
- * Mount fails if UUID is nil or a FS with the same UUID is already
- * mounted
+ * See if the UUID is unique among mounted XFS filesystems.
+ * Mount fails if UUID is nil or a FS with the same UUID is already mounted.
  */
 STATIC int
-xfs_uuid_mount(xfs_mount_t *mp)
+xfs_uuid_mount(
+	xfs_mount_t	*mp)
 {
-	int	hole;
-	int	i;
-
 	if (uuid_is_nil(&mp->m_sb.sb_uuid)) {
-		cmn_err(CE_WARN, "XFS: Filesystem %s has nil UUID - can't mount",
+		cmn_err(CE_WARN,
+			"XFS: Filesystem %s has nil UUID - can't mount",
 			mp->m_fsname);
 		return -1;
 	}
-
-	mutex_lock(&xfs_uuidtabmon, PVFS);
-	for (i = 0, hole = -1; i < xfs_uuidtab_size; i++) {
-		if (uuid_is_nil(&xfs_uuidtab[i])) {
-			hole = i;
-			continue;
-		}
-		if (uuid_equal(&mp->m_sb.sb_uuid, &xfs_uuidtab[i])) {
-			cmn_err(CE_WARN, "XFS: Filesystem %s has duplicate UUID - can't mount",
-				mp->m_fsname);
-			mutex_unlock(&xfs_uuidtabmon);
-			return -1;
-		}
-	}
-	if (hole < 0) {
-		xfs_uuidtab = kmem_realloc(xfs_uuidtab,
-			(xfs_uuidtab_size + 1) * sizeof(*xfs_uuidtab),
-			xfs_uuidtab_size  * sizeof(*xfs_uuidtab),
-			KM_SLEEP);
-		hole = xfs_uuidtab_size++;
+	if (!uuid_table_insert(&mp->m_sb.sb_uuid)) {
+		cmn_err(CE_WARN,
+			"XFS: Filesystem %s has duplicate UUID - can't mount",
+			mp->m_fsname);
+		return -1;
 	}
-	xfs_uuidtab[hole] = mp->m_sb.sb_uuid;
-	mutex_unlock(&xfs_uuidtabmon);
-
 	return 0;
 }
 
 /*
- * Remove filesystem from the uuid table.
+ * Remove filesystem from the UUID table.
  */
 STATIC void
-xfs_uuid_unmount(xfs_mount_t *mp)
+xfs_uuid_unmount(
+	xfs_mount_t	*mp)
 {
-	int	i;
-
-	mutex_lock(&xfs_uuidtabmon, PVFS);
-	for (i = 0; i < xfs_uuidtab_size; i++) {
-		if (uuid_is_nil(&xfs_uuidtab[i]))
-			continue;
-		if (!uuid_equal(&mp->m_sb.sb_uuid, &xfs_uuidtab[i]))
-			continue;
-		uuid_create_nil(&xfs_uuidtab[i]);
-		break;
-	}
-	ASSERT(i < xfs_uuidtab_size);
-	mutex_unlock(&xfs_uuidtabmon);
+	uuid_table_remove(&mp->m_sb.sb_uuid);
 }
 
 /*
@@ -1564,10 +1560,10 @@
  */
 STATIC void
 xfs_mount_log_sbunit(
-	xfs_mount_t *mp,
-	__int64_t fields)
+	xfs_mount_t	*mp,
+	__int64_t	fields)
 {
-	xfs_trans_t *tp;
+	xfs_trans_t	*tp;
 
 	ASSERT(fields & (XFS_SB_UNIT|XFS_SB_WIDTH|XFS_SB_UUID));
 
@@ -1578,7 +1574,7 @@
 		return;
 	}
 	xfs_mod_sb(tp, fields);
-	(void)xfs_trans_commit(tp, 0, NULL);
+	xfs_trans_commit(tp, 0, NULL);
 }
 
 /* Functions to lock access out of the filesystem for forced
@@ -1603,7 +1599,7 @@
 
 void
 xfs_finish_freeze(
-	xfs_mount_t *mp)
+	xfs_mount_t	*mp)
 {
 	unsigned long	s = mutex_spinlock(&mp->m_freeze_lock);
 
@@ -1617,11 +1613,11 @@
 
 void
 xfs_check_frozen(
-	xfs_mount_t *mp,
-	bhv_desc_t *bdp,
-	int	level)
+	xfs_mount_t	*mp,
+	bhv_desc_t	*bdp,
+	int		level)
 {
-	SPLDECL(s);
+	unsigned long	s;
 
 	if (mp->m_frozen) {
 		s = mutex_spinlock(&mp->m_freeze_lock);
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_mount.h linux-2.5.68-bk12/fs/xfs/xfs_mount.h
--- linux-2.5.68-bk11/fs/xfs/xfs_mount.h	2003-04-19 19:48:46.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_mount.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_MOUNT_H__
-#define __XFS_MOUNT_H__
+#define	__XFS_MOUNT_H__
 
 
 typedef struct xfs_trans_reservations {
@@ -52,7 +52,7 @@
 	uint	tr_attrset;	/* set/create an attribute */
 	uint	tr_attrrm;	/* remove an attribute */
 	uint	tr_clearagi;	/* clear bad agi unlinked ino bucket */
-	uint	tr_growrtalloc; /* grow realtime allocations */
+	uint	tr_growrtalloc;	/* grow realtime allocations */
 	uint	tr_growrtzero;	/* grow realtime zeroing */
 	uint	tr_growrtfree;	/* grow realtime freeing */
 } xfs_trans_reservations_t;
@@ -79,12 +79,12 @@
 struct xfs_bmbt_irec;
 struct xfs_bmap_free;
 
-#define SPLDECL(s)		unsigned long s
-#define AIL_LOCK_T		lock_t
-#define AIL_LOCKINIT(x,y)	spinlock_init(x,y)
-#define AIL_LOCK_DESTROY(x)	spinlock_destroy(x)
-#define AIL_LOCK(mp,s)		s=mutex_spinlock(&(mp)->m_ail_lock)
-#define AIL_UNLOCK(mp,s)	mutex_spinunlock(&(mp)->m_ail_lock, s)
+#define	SPLDECL(s)		unsigned long s
+#define	AIL_LOCK_T		lock_t
+#define	AIL_LOCKINIT(x,y)	spinlock_init(x,y)
+#define	AIL_LOCK_DESTROY(x)	spinlock_destroy(x)
+#define	AIL_LOCK(mp,s)		s=mutex_spinlock(&(mp)->m_ail_lock)
+#define	AIL_UNLOCK(mp,s)	mutex_spinunlock(&(mp)->m_ail_lock, s)
 
 
 /*
@@ -197,7 +197,7 @@
 /*
  * Prototypes and functions for I/O core modularization.
  */
- 
+
 typedef int		(*xfs_ioinit_t)(struct vfs *,
 				struct xfs_mount_args *, int);
 typedef int		(*xfs_bmapi_t)(struct xfs_trans *, void *,
@@ -315,7 +315,7 @@
 	xfs_buftarg_t		*m_logdev_targp;/* ptr to log device */
 	xfs_buftarg_t		*m_rtdev_targp;	/* ptr to rt device */
 #define m_dev		m_ddev_targp->pbr_dev
-	__uint8_t		m_dircook_elog; /* log d-cookie entry bits */
+	__uint8_t		m_dircook_elog;	/* log d-cookie entry bits */
 	__uint8_t		m_blkbit_log;	/* blocklog + NBBY */
 	__uint8_t		m_blkbb_log;	/* blocklog - BBSHIFT */
 	__uint8_t		m_agno_log;	/* log #ag's */
@@ -325,19 +325,19 @@
 	uint			m_blockmask;	/* sb_blocksize-1 */
 	uint			m_blockwsize;	/* sb_blocksize in words */
 	uint			m_blockwmask;	/* blockwsize-1 */
-	uint			m_alloc_mxr[2]; /* XFS_ALLOC_BLOCK_MAXRECS */
-	uint			m_alloc_mnr[2]; /* XFS_ALLOC_BLOCK_MINRECS */
-	uint			m_bmap_dmxr[2]; /* XFS_BMAP_BLOCK_DMAXRECS */
-	uint			m_bmap_dmnr[2]; /* XFS_BMAP_BLOCK_DMINRECS */
-	uint			m_inobt_mxr[2]; /* XFS_INOBT_BLOCK_MAXRECS */
-	uint			m_inobt_mnr[2]; /* XFS_INOBT_BLOCK_MINRECS */
-	uint			m_ag_maxlevels; /* XFS_AG_MAXLEVELS */
+	uint			m_alloc_mxr[2];	/* XFS_ALLOC_BLOCK_MAXRECS */
+	uint			m_alloc_mnr[2];	/* XFS_ALLOC_BLOCK_MINRECS */
+	uint			m_bmap_dmxr[2];	/* XFS_BMAP_BLOCK_DMAXRECS */
+	uint			m_bmap_dmnr[2];	/* XFS_BMAP_BLOCK_DMINRECS */
+	uint			m_inobt_mxr[2];	/* XFS_INOBT_BLOCK_MAXRECS */
+	uint			m_inobt_mnr[2];	/* XFS_INOBT_BLOCK_MINRECS */
+	uint			m_ag_maxlevels;	/* XFS_AG_MAXLEVELS */
 	uint			m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */
-	uint			m_in_maxlevels; /* XFS_IN_MAXLEVELS */
+	uint			m_in_maxlevels;	/* XFS_IN_MAXLEVELS */
 	struct xfs_perag	*m_perag;	/* per-ag accounting info */
 	struct rw_semaphore	m_peraglock;	/* lock for m_perag (pointer) */
 	sema_t			m_growlock;	/* growfs mutex */
-	int			m_fixedfsid[2]; /* unchanged for life of FS */
+	int			m_fixedfsid[2];	/* unchanged for life of FS */
 	uint			m_dmevmask;	/* DMI events for this FS */
 	uint			m_flags;	/* global mount flags */
 	uint			m_attroffset;	/* inode attribute offset */
@@ -360,7 +360,7 @@
 	int			m_lstripemask;	/* log stripe mask */
 	int			m_sinoalign;	/* stripe unit inode alignmnt */
 	int			m_attr_magicpct;/* 37% of the blocksize */
-	int			m_dir_magicpct; /* 37% of the dir blocksize */
+	int			m_dir_magicpct;	/* 37% of the dir blocksize */
 	__uint8_t		m_mk_sharedro;	/* mark shared ro on unmount */
 	__uint8_t		m_inode_quiesce;/* call quiesce on new inodes.
 						   field governed by m_ilock */
@@ -382,17 +382,17 @@
 	uint			m_frozen;	/* FS frozen for shutdown or
 						 * snapshot */
 	sv_t			m_wait_unfreeze;/* waiting to unfreeze */
-	atomic_t		m_active_trans; /* number trans frozen */
+	atomic_t		m_active_trans;	/* number trans frozen */
 } xfs_mount_t;
 
 /*
  * Flags for m_flags.
  */
-#define XFS_MOUNT_WSYNC		0x00000001	/* for nfs - all metadata ops
+#define	XFS_MOUNT_WSYNC		0x00000001	/* for nfs - all metadata ops
 						   must be synchronous except
 						   for space allocations */
 #if XFS_BIG_FILESYSTEMS
-#define XFS_MOUNT_INO64		0x00000002
+#define	XFS_MOUNT_INO64		0x00000002
 #endif
 			     /* 0x00000004	-- currently unused */
 			     /* 0x00000008	-- currently unused */
@@ -401,12 +401,12 @@
 						   disk errors in metadata */
 #define XFS_MOUNT_NOATIME	0x00000020	/* don't modify inode access
 						   times on reads */
-#define XFS_MOUNT_RETERR	0x00000040	/* return alignment errors to
+#define XFS_MOUNT_RETERR	0x00000040      /* return alignment errors to
 						   user */
 #define XFS_MOUNT_NOALIGN	0x00000080	/* turn off stripe alignment
 						   allocations */
 			     /* 0x00000100	-- currently unused */
-                             /*	0x00000200	-- currently unused */
+			     /*	0x00000200	-- currently unused */
 #define XFS_MOUNT_NORECOVERY	0x00000400	/* no recovery - dirty fs */
 #define XFS_MOUNT_SHARED	0x00000800	/* shared mount */
 #define XFS_MOUNT_DFLT_IOSIZE	0x00001000	/* set default i/o size */
@@ -417,7 +417,7 @@
 						 * 32 bits in size */
 #define XFS_MOUNT_NOLOGFLUSH	0x00010000
 
-#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
+#define XFS_FORCED_SHUTDOWN(mp)	((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
 
 /*
  * Default minimum read and write sizes.
@@ -431,7 +431,7 @@
 
 /*
  * Max and min values for UIO and mount-option defined I/O sizes;
- * min value can't be less than a page.	 Currently unused.
+ * min value can't be less than a page.  Currently unused.
  */
 #define XFS_MAX_IO_LOG		16	/* 64K */
 #define XFS_MIN_IO_LOG		PAGE_SHIFT
@@ -440,8 +440,8 @@
  * Synchronous read and write sizes.  This should be
  * better for NFSv2 wsync filesystems.
  */
-#define XFS_WSYNC_READIO_LOG	15	/* 32K */
-#define XFS_WSYNC_WRITEIO_LOG	14	/* 16K */
+#define	XFS_WSYNC_READIO_LOG	15	/* 32K */
+#define	XFS_WSYNC_WRITEIO_LOG	14	/* 16K */
 
 #define xfs_force_shutdown(m,f)	\
 	VFS_FORCE_SHUTDOWN((XFS_MTOVFS(m)), f, __FILE__, __LINE__)
@@ -473,13 +473,13 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MTOVFS)
 struct vfs *xfs_mtovfs(xfs_mount_t *mp);
-#define XFS_MTOVFS(mp)		xfs_mtovfs(mp)
+#define	XFS_MTOVFS(mp)		xfs_mtovfs(mp)
 #else
-#define XFS_MTOVFS(mp)		(bhvtovfs(&(mp)->m_bhv))
+#define	XFS_MTOVFS(mp)		(bhvtovfs(&(mp)->m_bhv))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOM)
 xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp);
-#define XFS_BHVTOM(bdp) xfs_bhvtom(bdp)
+#define	XFS_BHVTOM(bdp)	xfs_bhvtom(bdp)
 #else
 #define XFS_BHVTOM(bdp)		((xfs_mount_t *)BHV_PDATA(bdp))
 #endif
@@ -498,7 +498,7 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGNO)
 xfs_agnumber_t xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d);
-#define XFS_DADDR_TO_AGNO(mp,d)		xfs_daddr_to_agno(mp,d)
+#define XFS_DADDR_TO_AGNO(mp,d)         xfs_daddr_to_agno(mp,d)
 #else
 
 static inline xfs_agnumber_t XFS_DADDR_TO_AGNO(xfs_mount_t *mp, xfs_daddr_t d)
@@ -511,7 +511,7 @@
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGBNO)
 xfs_agblock_t xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d);
-#define XFS_DADDR_TO_AGBNO(mp,d)	xfs_daddr_to_agbno(mp,d)
+#define XFS_DADDR_TO_AGBNO(mp,d)        xfs_daddr_to_agbno(mp,d)
 #else
 
 static inline xfs_agblock_t XFS_DADDR_TO_AGBNO(xfs_mount_t *mp, xfs_daddr_t d)
@@ -530,10 +530,10 @@
 	int		msb_delta;	/* Change to make to specified field */
 } xfs_mod_sb_t;
 
-#define XFS_MOUNT_ILOCK(mp)	mutex_lock(&((mp)->m_ilock), PINOD)
-#define XFS_MOUNT_IUNLOCK(mp)	mutex_unlock(&((mp)->m_ilock))
-#define XFS_SB_LOCK(mp)		mutex_spinlock(&(mp)->m_sb_lock)
-#define XFS_SB_UNLOCK(mp,s)	mutex_spinunlock(&(mp)->m_sb_lock,(s))
+#define	XFS_MOUNT_ILOCK(mp)	mutex_lock(&((mp)->m_ilock), PINOD)
+#define	XFS_MOUNT_IUNLOCK(mp)	mutex_unlock(&((mp)->m_ilock))
+#define	XFS_SB_LOCK(mp)		mutex_spinlock(&(mp)->m_sb_lock)
+#define	XFS_SB_UNLOCK(mp,s)	mutex_spinunlock(&(mp)->m_sb_lock,(s))
 
 extern xfs_mount_t *xfs_mount_init(void);
 extern void	xfs_mod_sb(xfs_trans_t *, __int64_t);
@@ -573,7 +573,7 @@
 extern struct xfs_qmops xfs_qmcore_xfs;
 extern struct xfs_ioops xfs_iocore_xfs;
 
-extern int 	xfs_init(void);
+extern int	xfs_init(void);
 extern void	xfs_cleanup(void);
 
 #endif	/* __KERNEL__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_qmops.c linux-2.5.68-bk12/fs/xfs/xfs_qmops.c
--- linux-2.5.68-bk11/fs/xfs/xfs_qmops.c	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_qmops.c	2003-05-04 04:41:51.000000000 -0700
@@ -29,7 +29,20 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#include <xfs.h>
+#include "xfs.h"
+
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+
 
 #ifndef CONFIG_XFS_QUOTA
 STATIC struct xfs_dquot *
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_quota.h linux-2.5.68-bk12/fs/xfs/xfs_quota.h
--- linux-2.5.68-bk11/fs/xfs/xfs_quota.h	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_quota.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -149,21 +149,21 @@
 /*
  * Disk quotas status in m_qflags, and also sb_qflags. 16 bits.
  */
-#define XFS_UQUOTA_ACCT 0x0001	/* user quota accounting ON */
-#define XFS_UQUOTA_ENFD 0x0002	/* user quota limits enforced */
-#define XFS_UQUOTA_CHKD 0x0004	/* quotacheck run on usr quotas */
-#define XFS_PQUOTA_ACCT 0x0008	/* (IRIX) project quota accounting ON */
-#define XFS_GQUOTA_ENFD 0x0010	/* group quota limits enforced */
-#define XFS_GQUOTA_CHKD 0x0020	/* quotacheck run on grp quotas */
-#define XFS_GQUOTA_ACCT 0x0040	/* group quota accounting ON */
+#define XFS_UQUOTA_ACCT	0x0001  /* user quota accounting ON */
+#define XFS_UQUOTA_ENFD	0x0002  /* user quota limits enforced */
+#define XFS_UQUOTA_CHKD	0x0004  /* quotacheck run on usr quotas */
+#define XFS_PQUOTA_ACCT	0x0008  /* (IRIX) project quota accounting ON */
+#define XFS_GQUOTA_ENFD	0x0010  /* group quota limits enforced */
+#define XFS_GQUOTA_CHKD	0x0020  /* quotacheck run on grp quotas */
+#define XFS_GQUOTA_ACCT	0x0040  /* group quota accounting ON */
 
 /*
  * Incore only flags for quotaoff - these bits get cleared when quota(s)
  * are in the process of getting turned off. These flags are in m_qflags but
  * never in sb_qflags.
  */
-#define XFS_UQUOTA_ACTIVE	0x0080	/* uquotas are being turned off */
-#define XFS_GQUOTA_ACTIVE	0x0100	/* gquotas are being turned off */
+#define XFS_UQUOTA_ACTIVE	0x0080  /* uquotas are being turned off */
+#define XFS_GQUOTA_ACTIVE	0x0100  /* gquotas are being turned off */
 
 /*
  * Checking XFS_IS_*QUOTA_ON() while holding any inode lock guarantees
@@ -189,7 +189,7 @@
 #define XFS_QMOPT_QUOTAOFF	0x0000080 /* quotas are being turned off */
 #define XFS_QMOPT_UMOUNTING	0x0000100 /* filesys is being unmounted */
 #define XFS_QMOPT_DOLOG		0x0000200 /* log buf changes (in quotacheck) */
-#define XFS_QMOPT_DOWARN	0x0000400 /* increase warning cnt if necessary */
+#define XFS_QMOPT_DOWARN        0x0000400 /* increase warning cnt if necessary */
 #define XFS_QMOPT_ILOCKED	0x0000800 /* inode is already locked (excl) */
 #define XFS_QMOPT_DQREPAIR	0x0001000 /* repair dquot, if damaged. */
 
@@ -222,7 +222,7 @@
  * flags to xfs_trans_mod_dquot.
  */
 #define XFS_TRANS_DQ_RES_BLKS	XFS_QMOPT_RES_REGBLKS
-#define XFS_TRANS_DQ_RES_RTBLKS XFS_QMOPT_RES_RTBLKS
+#define XFS_TRANS_DQ_RES_RTBLKS	XFS_QMOPT_RES_RTBLKS
 #define XFS_TRANS_DQ_RES_INOS	XFS_QMOPT_RES_INOS
 #define XFS_TRANS_DQ_BCOUNT	XFS_QMOPT_BCOUNT
 #define XFS_TRANS_DQ_DELBCOUNT	XFS_QMOPT_DELBCOUNT
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_rename.c linux-2.5.68-bk12/fs/xfs/xfs_rename.c
--- linux-2.5.68-bk11/fs/xfs/xfs_rename.c	2003-04-19 19:49:30.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_rename.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,33 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_error.h"
+#include "xfs_quota.h"
+#include "xfs_rw.h"
+#include "xfs_utils.h"
+#include "xfs_trans_space.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_dmapi.h"
 
 
 /*
@@ -79,8 +105,8 @@
 	xfs_inode_t	*dp2,	/* new (target) directory inode */
 	vname_t		*vname1,/* old entry name */
 	vname_t		*vname2,/* new entry name */
-	xfs_inode_t	**ipp1, /* inode of old entry */
-	xfs_inode_t	**ipp2, /* inode of new entry, if it
+	xfs_inode_t	**ipp1,	/* inode of old entry */
+	xfs_inode_t	**ipp2,	/* inode of new entry, if it
 				   already exists, NULL otherwise. */
 	xfs_inode_t	**i_tab,/* array of inode returned, sorted */
 	int		*num_inodes)  /* number of inodes in array */
@@ -138,11 +164,11 @@
 	}
 
 	/*
-	 * i_tab contains a list of pointers to inodes.	 We initialize
+	 * i_tab contains a list of pointers to inodes.  We initialize
 	 * the table here & we'll sort it.  We will then use it to
 	 * order the acquisition of the inode locks.
 	 *
-	 * Note that the table may contain duplicates.	e.g., dp1 == dp2.
+	 * Note that the table may contain duplicates.  e.g., dp1 == dp2.
 	 */
 	i_tab[0] = dp1;
 	i_tab[1] = dp2;
@@ -230,7 +256,7 @@
 	int		src_is_directory;	/* src_name is a directory */
 	int		error;
 	xfs_bmap_free_t free_list;
-	xfs_fsblock_t	first_block;
+	xfs_fsblock_t   first_block;
 	int		cancel_flags;
 	int		committed;
 	xfs_inode_t	*inodes[4];
@@ -570,7 +596,7 @@
 	}
 
 	/*
-	 * Take refs. for vop_link_removed calls below.	 No need to worry
+	 * Take refs. for vop_link_removed calls below.  No need to worry
 	 * about directory refs. because the caller holds them.
 	 *
 	 * Do holds before the xfs_bmap_finish since it might rele them down
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_rtalloc.c linux-2.5.68-bk12/fs/xfs/xfs_rtalloc.c
--- linux-2.5.68-bk11/fs/xfs/xfs_rtalloc.c	2003-04-19 19:48:52.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_rtalloc.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -34,7 +34,37 @@
  * Free realtime space allocation for XFS.
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_alloc.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_fsops.h"
+#include "xfs_error.h"
+#include "xfs_rw.h"
+#include "xfs_inode_item.h"
+#include "xfs_trans_space.h"
 
 
 /*
@@ -90,10 +120,10 @@
 	xfs_daddr_t	d;		/* disk block address */
 	int		error;		/* error return value */
 	xfs_fsblock_t	firstblock;	/* first block allocated in xaction */
-	xfs_bmap_free_t flist;		/* list of freed blocks */
+	xfs_bmap_free_t	flist;		/* list of freed blocks */
 	xfs_fsblock_t	fsbno;		/* filesystem block for bno */
 	xfs_inode_t	*ip;		/* pointer to incore inode */
-	xfs_bmbt_irec_t map;		/* block map output */
+	xfs_bmbt_irec_t	map;		/* block map output */
 	int		nmap;		/* number of block maps */
 	int		resblks;	/* space reservation */
 	xfs_trans_t	*tp;		/* transaction pointer */
@@ -303,7 +333,7 @@
 
 /*
  * Allocate an extent of length minlen<=len<=maxlen, starting at block
- * bno.	 If we don't get maxlen then use prod to trim the length, if given.
+ * bno.  If we don't get maxlen then use prod to trim the length, if given.
  * Returns error; returns starting block in *rtblock.
  * The lengths are all in rtextents.
  */
@@ -383,7 +413,7 @@
 
 /*
  * Allocate an extent of length minlen<=len<=maxlen, starting as near
- * to bno as possible.	If we don't get maxlen then use prod to trim
+ * to bno as possible.  If we don't get maxlen then use prod to trim
  * the length, if given.  The lengths are all in rtextents.
  */
 STATIC int				/* error */
@@ -671,7 +701,7 @@
 			/*
 			 * Get the summary information for this level/block.
 			 */
-			error = xfs_rtget_summary(mp, tp, l, i, rbpp, rsb,
+			error =	xfs_rtget_summary(mp, tp, l, i, rbpp, rsb,
 						  &sum);
 			if (error) {
 				return error;
@@ -682,7 +712,7 @@
 			if (!sum)
 				continue;
 			/*
-			 * Try the allocation.	Make sure the specified
+			 * Try the allocation.  Make sure the specified
 			 * minlen/maxlen are in the possible range for
 			 * this summary level.
 			 */
@@ -1891,7 +1921,7 @@
 int
 xfs_growfs_rt(
 	xfs_mount_t	*mp,		/* mount point for filesystem */
-	xfs_growfs_rt_t *in)		/* growfs rt input struct */
+	xfs_growfs_rt_t	*in)		/* growfs rt input struct */
 {
 	xfs_rtblock_t	bmbno;		/* bitmap block number */
 	xfs_buf_t	*bp;		/* temporary buffer */
@@ -2101,7 +2131,7 @@
 
 /*
  * Allocate an extent in the realtime subvolume, with the usual allocation
- * parameters.	The length units are all in realtime extents, as is the
+ * parameters.  The length units are all in realtime extents, as is the
  * result block number.
  */
 int					/* error */
@@ -2111,7 +2141,7 @@
 	xfs_extlen_t	minlen,		/* minimum length to allocate */
 	xfs_extlen_t	maxlen,		/* maximum length to allocate */
 	xfs_extlen_t	*len,		/* out: actual length allocated */
-	xfs_alloctype_t type,		/* allocation type XFS_ALLOCTYPE... */
+	xfs_alloctype_t	type,		/* allocation type XFS_ALLOCTYPE... */
 	int		wasdel,		/* was a delayed allocation extent */
 	xfs_extlen_t	prod,		/* extent product factor */
 	xfs_rtblock_t	*rtblock)	/* out: start block allocated */
@@ -2154,7 +2184,7 @@
 	switch (type) {
 	case XFS_ALLOCTYPE_ANY_AG:
 		error = xfs_rtallocate_extent_size(mp, tp, minlen, maxlen, len,
-				&sumbp, &sb, prod, &r);
+				&sumbp,	&sb, prod, &r);
 		break;
 	case XFS_ALLOCTYPE_NEAR_BNO:
 		error = xfs_rtallocate_extent_near(mp, tp, bno, minlen, maxlen,
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_rtalloc.h linux-2.5.68-bk12/fs/xfs/xfs_rtalloc.h
--- linux-2.5.68-bk11/fs/xfs/xfs_rtalloc.h	2003-04-19 19:50:29.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_rtalloc.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_RTALLOC_H__
-#define __XFS_RTALLOC_H__
+#define	__XFS_RTALLOC_H__
 
 struct xfs_mount;
 struct xfs_trans;
@@ -38,49 +38,49 @@
 #define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
 
 /* Min and max rt extent sizes, specified in bytes */
-#define XFS_MAX_RTEXTSIZE	(1024 * 1024 * 1024)	/* 1GB */
-#define XFS_DFL_RTEXTSIZE	(64 * 1024)		/* 64KB */
-#define XFS_MIN_RTEXTSIZE	(4 * 1024)		/* 4KB */
+#define	XFS_MAX_RTEXTSIZE	(1024 * 1024 * 1024)	/* 1GB */
+#define	XFS_DFL_RTEXTSIZE	(64 * 1024)	        /* 64KB */
+#define	XFS_MIN_RTEXTSIZE	(4 * 1024)		/* 4KB */
 
 /*
  * Constants for bit manipulations.
  */
-#define XFS_NBBYLOG	3		/* log2(NBBY) */
-#define XFS_WORDLOG	2		/* log2(sizeof(xfs_rtword_t)) */
-#define XFS_NBWORDLOG	(XFS_NBBYLOG + XFS_WORDLOG)
-#define XFS_NBWORD	(1 << XFS_NBWORDLOG)
-#define XFS_WORDMASK	((1 << XFS_WORDLOG) - 1)
-
-#define XFS_BLOCKSIZE(mp)	((mp)->m_sb.sb_blocksize)
-#define XFS_BLOCKMASK(mp)	((mp)->m_blockmask)
-#define XFS_BLOCKWSIZE(mp)	((mp)->m_blockwsize)
-#define XFS_BLOCKWMASK(mp)	((mp)->m_blockwmask)
+#define	XFS_NBBYLOG	3		/* log2(NBBY) */
+#define	XFS_WORDLOG	2		/* log2(sizeof(xfs_rtword_t)) */
+#define	XFS_NBWORDLOG	(XFS_NBBYLOG + XFS_WORDLOG)
+#define	XFS_NBWORD	(1 << XFS_NBWORDLOG)
+#define	XFS_WORDMASK	((1 << XFS_WORDLOG) - 1)
+
+#define	XFS_BLOCKSIZE(mp)	((mp)->m_sb.sb_blocksize)
+#define	XFS_BLOCKMASK(mp)	((mp)->m_blockmask)
+#define	XFS_BLOCKWSIZE(mp)	((mp)->m_blockwsize)
+#define	XFS_BLOCKWMASK(mp)	((mp)->m_blockwmask)
 
 /*
  * Summary and bit manipulation macros.
  */
-#define XFS_SUMOFFS(mp,ls,bb)	((int)((ls) * (mp)->m_sb.sb_rbmblocks + (bb)))
-#define XFS_SUMOFFSTOBLOCK(mp,s)	\
+#define	XFS_SUMOFFS(mp,ls,bb)	((int)((ls) * (mp)->m_sb.sb_rbmblocks + (bb)))
+#define	XFS_SUMOFFSTOBLOCK(mp,s)	\
 	(((s) * (uint)sizeof(xfs_suminfo_t)) >> (mp)->m_sb.sb_blocklog)
-#define XFS_SUMPTR(mp,bp,so)	\
+#define	XFS_SUMPTR(mp,bp,so)	\
 	((xfs_suminfo_t *)((char *)XFS_BUF_PTR(bp) + \
 		(((so) * (uint)sizeof(xfs_suminfo_t)) & XFS_BLOCKMASK(mp))))
 
-#define XFS_BITTOBLOCK(mp,bi)	((bi) >> (mp)->m_blkbit_log)
-#define XFS_BLOCKTOBIT(mp,bb)	((bb) << (mp)->m_blkbit_log)
-#define XFS_BITTOWORD(mp,bi)	\
+#define	XFS_BITTOBLOCK(mp,bi)	((bi) >> (mp)->m_blkbit_log)
+#define	XFS_BLOCKTOBIT(mp,bb)	((bb) << (mp)->m_blkbit_log)
+#define	XFS_BITTOWORD(mp,bi)	\
 	((int)(((bi) >> XFS_NBWORDLOG) & XFS_BLOCKWMASK(mp)))
 
-#define XFS_RTMIN(a,b)	((a) < (b) ? (a) : (b))
-#define XFS_RTMAX(a,b)	((a) > (b) ? (a) : (b))
+#define	XFS_RTMIN(a,b)	((a) < (b) ? (a) : (b))
+#define	XFS_RTMAX(a,b)	((a) > (b) ? (a) : (b))
 
-#define XFS_RTLOBIT(w)	xfs_lowbit32(w)
-#define XFS_RTHIBIT(w)	xfs_highbit32(w)
+#define	XFS_RTLOBIT(w)	xfs_lowbit32(w)
+#define	XFS_RTHIBIT(w)	xfs_highbit32(w)
 
 #if XFS_BIG_FILESYSTEMS
-#define XFS_RTBLOCKLOG(b)	xfs_highbit64(b)
+#define	XFS_RTBLOCKLOG(b)	xfs_highbit64(b)
 #else
-#define XFS_RTBLOCKLOG(b)	xfs_highbit32(b)
+#define	XFS_RTBLOCKLOG(b)	xfs_highbit32(b)
 #endif
 
 
@@ -93,18 +93,18 @@
 
 /*
  * Allocate an extent in the realtime subvolume, with the usual allocation
- * parameters.	The length units are all in realtime extents, as is the
+ * parameters.  The length units are all in realtime extents, as is the
  * result block number.
  */
 int					/* error */
 xfs_rtallocate_extent(
 	struct xfs_trans	*tp,	/* transaction pointer */
 	xfs_rtblock_t		bno,	/* starting block number to allocate */
-	xfs_extlen_t		minlen, /* minimum length to allocate */
-	xfs_extlen_t		maxlen, /* maximum length to allocate */
+	xfs_extlen_t		minlen,	/* minimum length to allocate */
+	xfs_extlen_t		maxlen,	/* maximum length to allocate */
 	xfs_extlen_t		*len,	/* out: actual length allocated */
 	xfs_alloctype_t		type,	/* allocation type XFS_ALLOCTYPE... */
-	int			wasdel, /* was a delayed allocation extent */
+	int			wasdel,	/* was a delayed allocation extent */
 	xfs_extlen_t		prod,	/* extent product factor */
 	xfs_rtblock_t		*rtblock); /* out: start block allocated */
 
@@ -145,7 +145,7 @@
 	struct xfs_mount	*mp,	/* file system mount point */
 	struct xfs_trans	*tp,	/* transaction pointer */
 	xfs_extlen_t		len,	/* allocation length (rtextents) */
-	xfs_rtblock_t		*pick); /* result rt extent */
+	xfs_rtblock_t		*pick);	/* result rt extent */
 
 /*
  * Debug code: print out the value of a range in the bitmap.
@@ -174,12 +174,12 @@
 	xfs_growfs_rt_t		*in);	/* user supplied growfs struct */
 
 #else
-# define xfs_rtallocate_extent(t,b,min,max,l,a,f,p,rb)	(ENOSYS)
-# define xfs_rtfree_extent(t,b,l)			(ENOSYS)
-# define xfs_rtpick_extent(m,t,l,rb)			(ENOSYS)
-# define xfs_growfs_rt(mp,in)				(ENOSYS)
-# define xfs_rtmount_init(m)	(((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))
-# define xfs_rtmount_inodes(m)	(((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))
+# define xfs_rtallocate_extent(t,b,min,max,l,a,f,p,rb)  (ENOSYS)
+# define xfs_rtfree_extent(t,b,l)                       (ENOSYS)
+# define xfs_rtpick_extent(m,t,l,rb)                    (ENOSYS)
+# define xfs_growfs_rt(mp,in)                           (ENOSYS)
+# define xfs_rtmount_init(m)    (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))
+# define xfs_rtmount_inodes(m)  (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))
 #endif	/* CONFIG_XFS_RT */
 
 #endif	/* __KERNEL__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_rw.c linux-2.5.68-bk12/fs/xfs/xfs_rw.c
--- linux-2.5.68-bk11/fs/xfs/xfs_rw.c	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_rw.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,8 +30,39 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_itable.h"
+#include "xfs_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_acl.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_error.h"
+#include "xfs_buf_item.h"
+#include "xfs_rw.h"
 
 /*
  * This is a subroutine for xfs_write() and other writers (xfs_ioctl)
@@ -255,8 +286,8 @@
 	struct xfs_mount *mp,
 	xfs_buftarg_t	 *target,
 	xfs_daddr_t	 blkno,
-	int		 len,
-	uint		 flags,
+	int              len,
+	uint             flags,
 	xfs_buf_t	 **bpp)
 {
 	xfs_buf_t	 *bp;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_rw.h linux-2.5.68-bk12/fs/xfs/xfs_rw.h
--- linux-2.5.68-bk11/fs/xfs/xfs_rw.h	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_rw.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,8 +29,8 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_RW_H__
-#define __XFS_RW_H__
+#ifndef	__XFS_RW_H__
+#define	__XFS_RW_H__
 
 struct bhv_desc;
 struct bmapval;
@@ -46,16 +46,16 @@
 /*
  * Maximum count of bmaps used by read and write paths.
  */
-#define XFS_MAX_RW_NBMAPS	4
+#define	XFS_MAX_RW_NBMAPS	4
 
 /*
  * Counts of readahead buffers to use based on physical memory size.
  * None of these should be more than XFS_MAX_RW_NBMAPS.
  */
-#define XFS_RW_NREADAHEAD_16MB	2
-#define XFS_RW_NREADAHEAD_32MB	3
-#define XFS_RW_NREADAHEAD_K32	4
-#define XFS_RW_NREADAHEAD_K64	4
+#define	XFS_RW_NREADAHEAD_16MB	2
+#define	XFS_RW_NREADAHEAD_32MB	3
+#define	XFS_RW_NREADAHEAD_K32	4
+#define	XFS_RW_NREADAHEAD_K64	4
 
 /*
  * Maximum size of a buffer that we\'ll map.  Making this
@@ -66,8 +66,8 @@
  *
  * This is currently set to 512 KB.
  */
-#define XFS_MAX_BMAP_LEN_BB	1024
-#define XFS_MAX_BMAP_LEN_BYTES	524288
+#define	XFS_MAX_BMAP_LEN_BB	1024
+#define	XFS_MAX_BMAP_LEN_BYTES	524288
 
 /*
  * Convert the given file system block to a disk block.
@@ -77,9 +77,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_DB)
 xfs_daddr_t xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb);
-#define XFS_FSB_TO_DB(ip,fsb)	xfs_fsb_to_db(ip,fsb)
+#define	XFS_FSB_TO_DB(ip,fsb)	xfs_fsb_to_db(ip,fsb)
 #else
-#define XFS_FSB_TO_DB(ip,fsb) \
+#define	XFS_FSB_TO_DB(ip,fsb) \
 		(((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) ? \
 		 (xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \
 		 XFS_FSB_TO_DADDR((ip)->i_mount, (fsb)))
@@ -93,34 +93,34 @@
 /*
  * Defines for the trace mechanisms in xfs_rw.c.
  */
-#define XFS_RW_KTRACE_SIZE	64
-#define XFS_STRAT_KTRACE_SIZE	64
-#define XFS_STRAT_GTRACE_SIZE	512
+#define	XFS_RW_KTRACE_SIZE	64
+#define	XFS_STRAT_KTRACE_SIZE	64
+#define	XFS_STRAT_GTRACE_SIZE	512
 
-#define XFS_READ_ENTER		1
-#define XFS_WRITE_ENTER		2
+#define	XFS_READ_ENTER		1
+#define	XFS_WRITE_ENTER		2
 #define XFS_IOMAP_READ_ENTER	3
-#define XFS_IOMAP_WRITE_ENTER	4
-#define XFS_IOMAP_READ_MAP	5
-#define XFS_IOMAP_WRITE_MAP	6
-#define XFS_IOMAP_WRITE_NOSPACE 7
-#define XFS_ITRUNC_START	8
-#define XFS_ITRUNC_FINISH1	9
-#define XFS_ITRUNC_FINISH2	10
-#define XFS_CTRUNC1		11
-#define XFS_CTRUNC2		12
-#define XFS_CTRUNC3		13
-#define XFS_CTRUNC4		14
-#define XFS_CTRUNC5		15
-#define XFS_CTRUNC6		16
-#define XFS_BUNMAPI		17
-#define XFS_INVAL_CACHED	18
-#define XFS_DIORD_ENTER		19
-#define XFS_DIOWR_ENTER		20
+#define	XFS_IOMAP_WRITE_ENTER	4
+#define	XFS_IOMAP_READ_MAP	5
+#define	XFS_IOMAP_WRITE_MAP	6
+#define	XFS_IOMAP_WRITE_NOSPACE	7
+#define	XFS_ITRUNC_START	8
+#define	XFS_ITRUNC_FINISH1	9
+#define	XFS_ITRUNC_FINISH2	10
+#define	XFS_CTRUNC1		11
+#define	XFS_CTRUNC2		12
+#define	XFS_CTRUNC3		13
+#define	XFS_CTRUNC4		14
+#define	XFS_CTRUNC5		15
+#define	XFS_CTRUNC6		16
+#define	XFS_BUNMAPI		17
+#define	XFS_INVAL_CACHED	18
+#define	XFS_DIORD_ENTER		19
+#define	XFS_DIOWR_ENTER		20
 
 #if defined(XFS_ALL_TRACE)
-#define XFS_RW_TRACE
-#define XFS_STRAT_TRACE
+#define	XFS_RW_TRACE
+#define	XFS_STRAT_TRACE
 #endif
 
 #if !defined(DEBUG)
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_sb.h linux-2.5.68-bk12/fs/xfs/xfs_sb.h
--- linux-2.5.68-bk11/fs/xfs/xfs_sb.h	2003-04-19 19:49:11.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_sb.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_SB_H__
-#define __XFS_SB_H__
+#define	__XFS_SB_H__
 
 /*
  * Super block
@@ -41,29 +41,29 @@
 struct xfs_buf;
 struct xfs_mount;
 
-#define XFS_SB_MAGIC		0x58465342	/* 'XFSB' */
-#define XFS_SB_VERSION_1	1		/* 5.3, 6.0.1, 6.1 */
-#define XFS_SB_VERSION_2	2		/* 6.2 - attributes */
-#define XFS_SB_VERSION_3	3		/* 6.2 - new inode version */
-#define XFS_SB_VERSION_4	4		/* 6.2+ - bitmask version */
-#define XFS_SB_VERSION_NUMBITS		0x000f
-#define XFS_SB_VERSION_ALLFBITS		0xfff0
-#define XFS_SB_VERSION_SASHFBITS	0xf000
-#define XFS_SB_VERSION_REALFBITS	0x0ff0
-#define XFS_SB_VERSION_ATTRBIT		0x0010
-#define XFS_SB_VERSION_NLINKBIT		0x0020
-#define XFS_SB_VERSION_QUOTABIT		0x0040
-#define XFS_SB_VERSION_ALIGNBIT		0x0080
-#define XFS_SB_VERSION_DALIGNBIT	0x0100
-#define XFS_SB_VERSION_SHAREDBIT	0x0200
+#define	XFS_SB_MAGIC		0x58465342	/* 'XFSB' */
+#define	XFS_SB_VERSION_1	1		/* 5.3, 6.0.1, 6.1 */
+#define	XFS_SB_VERSION_2	2		/* 6.2 - attributes */
+#define	XFS_SB_VERSION_3	3		/* 6.2 - new inode version */
+#define	XFS_SB_VERSION_4	4		/* 6.2+ - bitmask version */
+#define	XFS_SB_VERSION_NUMBITS		0x000f
+#define	XFS_SB_VERSION_ALLFBITS		0xfff0
+#define	XFS_SB_VERSION_SASHFBITS	0xf000
+#define	XFS_SB_VERSION_REALFBITS	0x0ff0
+#define	XFS_SB_VERSION_ATTRBIT		0x0010
+#define	XFS_SB_VERSION_NLINKBIT		0x0020
+#define	XFS_SB_VERSION_QUOTABIT		0x0040
+#define	XFS_SB_VERSION_ALIGNBIT		0x0080
+#define	XFS_SB_VERSION_DALIGNBIT	0x0100
+#define	XFS_SB_VERSION_SHAREDBIT	0x0200
 #define XFS_SB_VERSION_LOGV2BIT		0x0400
 #define XFS_SB_VERSION_SECTORBIT	0x0800
-#define XFS_SB_VERSION_EXTFLGBIT	0x1000
-#define XFS_SB_VERSION_DIRV2BIT		0x2000
-#define XFS_SB_VERSION_OKSASHFBITS	\
+#define	XFS_SB_VERSION_EXTFLGBIT	0x1000
+#define	XFS_SB_VERSION_DIRV2BIT		0x2000
+#define	XFS_SB_VERSION_OKSASHFBITS	\
 	(XFS_SB_VERSION_EXTFLGBIT | \
 	 XFS_SB_VERSION_DIRV2BIT)
-#define XFS_SB_VERSION_OKREALFBITS	\
+#define	XFS_SB_VERSION_OKREALFBITS	\
 	(XFS_SB_VERSION_ATTRBIT | \
 	 XFS_SB_VERSION_NLINKBIT | \
 	 XFS_SB_VERSION_QUOTABIT | \
@@ -72,11 +72,11 @@
 	 XFS_SB_VERSION_SHAREDBIT | \
 	 XFS_SB_VERSION_LOGV2BIT | \
 	 XFS_SB_VERSION_SECTORBIT)
-#define XFS_SB_VERSION_OKSASHBITS	\
+#define	XFS_SB_VERSION_OKSASHBITS	\
 	(XFS_SB_VERSION_NUMBITS | \
 	 XFS_SB_VERSION_REALFBITS | \
 	 XFS_SB_VERSION_OKSASHFBITS)
-#define XFS_SB_VERSION_OKREALBITS	\
+#define	XFS_SB_VERSION_OKREALBITS	\
 	(XFS_SB_VERSION_NUMBITS | \
 	 XFS_SB_VERSION_OKREALFBITS | \
 	 XFS_SB_VERSION_OKSASHFBITS)
@@ -123,7 +123,7 @@
 	__uint8_t	sb_imax_pct;	/* max % of fs for inode space */
 					/* statistics */
 	/*
-	 * These fields must remain contiguous.	 If you really
+	 * These fields must remain contiguous.  If you really
 	 * want to change their layout, make sure you fix the
 	 * code in xfs_trans_apply_sb_deltas().
 	 */
@@ -171,22 +171,22 @@
  * Mask values, defined based on the xfs_sb_field_t values.
  * Only define the ones we're using.
  */
-#define XFS_SB_MVAL(x)		(1LL << XFS_SBS_ ## x)
-#define XFS_SB_UUID		XFS_SB_MVAL(UUID)
-#define XFS_SB_FNAME		XFS_SB_MVAL(FNAME)
-#define XFS_SB_ROOTINO		XFS_SB_MVAL(ROOTINO)
-#define XFS_SB_RBMINO		XFS_SB_MVAL(RBMINO)
-#define XFS_SB_RSUMINO		XFS_SB_MVAL(RSUMINO)
-#define XFS_SB_VERSIONNUM	XFS_SB_MVAL(VERSIONNUM)
+#define	XFS_SB_MVAL(x)		(1LL << XFS_SBS_ ## x)
+#define	XFS_SB_UUID		XFS_SB_MVAL(UUID)
+#define	XFS_SB_FNAME		XFS_SB_MVAL(FNAME)
+#define	XFS_SB_ROOTINO		XFS_SB_MVAL(ROOTINO)
+#define	XFS_SB_RBMINO		XFS_SB_MVAL(RBMINO)
+#define	XFS_SB_RSUMINO		XFS_SB_MVAL(RSUMINO)
+#define	XFS_SB_VERSIONNUM	XFS_SB_MVAL(VERSIONNUM)
 #define XFS_SB_UQUOTINO		XFS_SB_MVAL(UQUOTINO)
 #define XFS_SB_GQUOTINO		XFS_SB_MVAL(GQUOTINO)
 #define XFS_SB_QFLAGS		XFS_SB_MVAL(QFLAGS)
 #define XFS_SB_SHARED_VN	XFS_SB_MVAL(SHARED_VN)
 #define XFS_SB_UNIT		XFS_SB_MVAL(UNIT)
 #define XFS_SB_WIDTH		XFS_SB_MVAL(WIDTH)
-#define XFS_SB_NUM_BITS		((int)XFS_SBS_FIELDCOUNT)
-#define XFS_SB_ALL_BITS		((1LL << XFS_SB_NUM_BITS) - 1)
-#define XFS_SB_MOD_BITS		\
+#define	XFS_SB_NUM_BITS		((int)XFS_SBS_FIELDCOUNT)
+#define	XFS_SB_ALL_BITS		((1LL << XFS_SB_NUM_BITS) - 1)
+#define	XFS_SB_MOD_BITS		\
 	(XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \
 	 XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \
 	 XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH)
@@ -205,22 +205,22 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_NUM)
 int xfs_sb_version_num(xfs_sb_t *sbp);
-#define XFS_SB_VERSION_NUM(sbp) xfs_sb_version_num(sbp)
+#define	XFS_SB_VERSION_NUM(sbp)	xfs_sb_version_num(sbp)
 #else
-#define XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS)
+#define	XFS_SB_VERSION_NUM(sbp)	((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS)
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_GOOD_VERSION)
 int xfs_sb_good_version(xfs_sb_t *sbp);
-#define XFS_SB_GOOD_VERSION(sbp)	xfs_sb_good_version(sbp)
+#define	XFS_SB_GOOD_VERSION(sbp)	xfs_sb_good_version(sbp)
 #else
-#define XFS_SB_GOOD_VERSION_INT(sbp)	\
+#define	XFS_SB_GOOD_VERSION_INT(sbp)	\
 	((((sbp)->sb_versionnum >= XFS_SB_VERSION_1) && \
 	  ((sbp)->sb_versionnum <= XFS_SB_VERSION_3)) || \
 	 ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
 	  !((sbp)->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS)
 #ifdef __KERNEL__
-#define XFS_SB_GOOD_VERSION(sbp)	\
+#define	XFS_SB_GOOD_VERSION(sbp)	\
 	(XFS_SB_GOOD_VERSION_INT(sbp) && \
 	  (sbp)->sb_shared_vn <= XFS_SB_MAX_SHARED_VN) ))
 #else
@@ -237,7 +237,7 @@
 #endif /* __KERNEL__ */
 #endif
 
-#define XFS_SB_GOOD_SASH_VERSION(sbp)	\
+#define	XFS_SB_GOOD_SASH_VERSION(sbp)	\
 	((((sbp)->sb_versionnum >= XFS_SB_VERSION_1) && \
 	  ((sbp)->sb_versionnum <= XFS_SB_VERSION_3)) || \
 	 ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
@@ -245,9 +245,9 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_TONEW)
 unsigned xfs_sb_version_tonew(unsigned v);
-#define XFS_SB_VERSION_TONEW(v) xfs_sb_version_tonew(v)
+#define	XFS_SB_VERSION_TONEW(v)	xfs_sb_version_tonew(v)
 #else
-#define XFS_SB_VERSION_TONEW(v) \
+#define	XFS_SB_VERSION_TONEW(v)	\
 	((((v) == XFS_SB_VERSION_1) ? \
 		0 : \
 		(((v) == XFS_SB_VERSION_2) ? \
@@ -258,9 +258,9 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_TOOLD)
 unsigned xfs_sb_version_toold(unsigned v);
-#define XFS_SB_VERSION_TOOLD(v) xfs_sb_version_toold(v)
+#define	XFS_SB_VERSION_TOOLD(v)	xfs_sb_version_toold(v)
 #else
-#define XFS_SB_VERSION_TOOLD(v) \
+#define	XFS_SB_VERSION_TOOLD(v)	\
 	(((v) & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) ? \
 		0 : \
 		(((v) & XFS_SB_VERSION_NLINKBIT) ? \
@@ -272,9 +272,9 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASATTR)
 int xfs_sb_version_hasattr(xfs_sb_t *sbp);
-#define XFS_SB_VERSION_HASATTR(sbp)	xfs_sb_version_hasattr(sbp)
+#define	XFS_SB_VERSION_HASATTR(sbp)	xfs_sb_version_hasattr(sbp)
 #else
-#define XFS_SB_VERSION_HASATTR(sbp)	\
+#define	XFS_SB_VERSION_HASATTR(sbp)	\
 	(((sbp)->sb_versionnum == XFS_SB_VERSION_2) || \
 	 ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \
 	 ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
@@ -283,9 +283,9 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDATTR)
 void xfs_sb_version_addattr(xfs_sb_t *sbp);
-#define XFS_SB_VERSION_ADDATTR(sbp)	xfs_sb_version_addattr(sbp)
+#define	XFS_SB_VERSION_ADDATTR(sbp)	xfs_sb_version_addattr(sbp)
 #else
-#define XFS_SB_VERSION_ADDATTR(sbp)	\
+#define	XFS_SB_VERSION_ADDATTR(sbp)	\
 	((sbp)->sb_versionnum = \
 	 (((sbp)->sb_versionnum == XFS_SB_VERSION_1) ? \
 		XFS_SB_VERSION_2 : \
@@ -296,9 +296,9 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASNLINK)
 int xfs_sb_version_hasnlink(xfs_sb_t *sbp);
-#define XFS_SB_VERSION_HASNLINK(sbp)	xfs_sb_version_hasnlink(sbp)
+#define	XFS_SB_VERSION_HASNLINK(sbp)	xfs_sb_version_hasnlink(sbp)
 #else
-#define XFS_SB_VERSION_HASNLINK(sbp)	\
+#define	XFS_SB_VERSION_HASNLINK(sbp)	\
 	(((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \
 	 ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
 	  ((sbp)->sb_versionnum & XFS_SB_VERSION_NLINKBIT)))
@@ -306,9 +306,9 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDNLINK)
 void xfs_sb_version_addnlink(xfs_sb_t *sbp);
-#define XFS_SB_VERSION_ADDNLINK(sbp)	xfs_sb_version_addnlink(sbp)
+#define	XFS_SB_VERSION_ADDNLINK(sbp)	xfs_sb_version_addnlink(sbp)
 #else
-#define XFS_SB_VERSION_ADDNLINK(sbp)	\
+#define	XFS_SB_VERSION_ADDNLINK(sbp)	\
 	((sbp)->sb_versionnum = \
 	 ((sbp)->sb_versionnum <= XFS_SB_VERSION_2 ? \
 		XFS_SB_VERSION_3 : \
@@ -317,18 +317,18 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASQUOTA)
 int xfs_sb_version_hasquota(xfs_sb_t *sbp);
-#define XFS_SB_VERSION_HASQUOTA(sbp)	xfs_sb_version_hasquota(sbp)
+#define	XFS_SB_VERSION_HASQUOTA(sbp)	xfs_sb_version_hasquota(sbp)
 #else
-#define XFS_SB_VERSION_HASQUOTA(sbp)	\
+#define	XFS_SB_VERSION_HASQUOTA(sbp)	\
 	((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
 	 ((sbp)->sb_versionnum & XFS_SB_VERSION_QUOTABIT))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_ADDQUOTA)
 void xfs_sb_version_addquota(xfs_sb_t *sbp);
-#define XFS_SB_VERSION_ADDQUOTA(sbp)	xfs_sb_version_addquota(sbp)
+#define	XFS_SB_VERSION_ADDQUOTA(sbp)	xfs_sb_version_addquota(sbp)
 #else
-#define XFS_SB_VERSION_ADDQUOTA(sbp)	\
+#define	XFS_SB_VERSION_ADDQUOTA(sbp)	\
 	((sbp)->sb_versionnum = \
 	 (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 ? \
 		((sbp)->sb_versionnum | XFS_SB_VERSION_QUOTABIT) : \
@@ -338,18 +338,18 @@
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASALIGN)
 int xfs_sb_version_hasalign(xfs_sb_t *sbp);
-#define XFS_SB_VERSION_HASALIGN(sbp)	xfs_sb_version_hasalign(sbp)
+#define	XFS_SB_VERSION_HASALIGN(sbp)	xfs_sb_version_hasalign(sbp)
 #else
-#define XFS_SB_VERSION_HASALIGN(sbp)	\
+#define	XFS_SB_VERSION_HASALIGN(sbp)	\
 	((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
 	 ((sbp)->sb_versionnum & XFS_SB_VERSION_ALIGNBIT))
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_SUBALIGN)
 void xfs_sb_version_subalign(xfs_sb_t *sbp);
-#define XFS_SB_VERSION_SUBALIGN(sbp)	xfs_sb_version_subalign(sbp)
+#define	XFS_SB_VERSION_SUBALIGN(sbp)	xfs_sb_version_subalign(sbp)
 #else
-#define XFS_SB_VERSION_SUBALIGN(sbp)	\
+#define	XFS_SB_VERSION_SUBALIGN(sbp)	\
 	((sbp)->sb_versionnum = \
 	 XFS_SB_VERSION_TOOLD((sbp)->sb_versionnum & ~XFS_SB_VERSION_ALIGNBIT))
 #endif
@@ -460,29 +460,29 @@
 #define XFS_SB_DADDR	((xfs_daddr_t)0)	/* daddr in filesystem/ag */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_BLOCK)
 xfs_agblock_t xfs_sb_block(struct xfs_mount *mp);
-#define XFS_SB_BLOCK(mp)	xfs_sb_block(mp)
+#define	XFS_SB_BLOCK(mp)	xfs_sb_block(mp)
 #else
-#define XFS_SB_BLOCK(mp)	XFS_HDR_BLOCK(mp, XFS_SB_DADDR)
+#define	XFS_SB_BLOCK(mp)	XFS_HDR_BLOCK(mp, XFS_SB_DADDR)
 #endif
 
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_HDR_BLOCK)
 xfs_agblock_t xfs_hdr_block(struct xfs_mount *mp, xfs_daddr_t d);
-#define XFS_HDR_BLOCK(mp,d)	xfs_hdr_block(mp,d)
+#define	XFS_HDR_BLOCK(mp,d)	xfs_hdr_block(mp,d)
 #else
-#define XFS_HDR_BLOCK(mp,d)	((xfs_agblock_t)(XFS_BB_TO_FSBT(mp,d)))
+#define	XFS_HDR_BLOCK(mp,d)	((xfs_agblock_t)(XFS_BB_TO_FSBT(mp,d)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_FSB)
 xfs_fsblock_t xfs_daddr_to_fsb(struct xfs_mount *mp, xfs_daddr_t d);
-#define XFS_DADDR_TO_FSB(mp,d)		xfs_daddr_to_fsb(mp,d)
+#define	XFS_DADDR_TO_FSB(mp,d)		xfs_daddr_to_fsb(mp,d)
 #else
-#define XFS_DADDR_TO_FSB(mp,d) \
+#define	XFS_DADDR_TO_FSB(mp,d) \
 	XFS_AGB_TO_FSB(mp, XFS_DADDR_TO_AGNO(mp,d), XFS_DADDR_TO_AGBNO(mp,d))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_DADDR)
 xfs_daddr_t xfs_fsb_to_daddr(struct xfs_mount *mp, xfs_fsblock_t fsbno);
-#define XFS_FSB_TO_DADDR(mp,fsbno)	xfs_fsb_to_daddr(mp,fsbno)
+#define	XFS_FSB_TO_DADDR(mp,fsbno)	xfs_fsb_to_daddr(mp,fsbno)
 #else
-#define XFS_FSB_TO_DADDR(mp,fsbno) \
+#define	XFS_FSB_TO_DADDR(mp,fsbno) \
 	XFS_AGB_TO_DADDR(mp, XFS_FSB_TO_AGNO(mp,fsbno), \
 			 XFS_FSB_TO_AGBNO(mp,fsbno))
 #endif
@@ -511,11 +511,11 @@
 /*
  * File system block to basic block conversions.
  */
-#define XFS_FSB_TO_BB(mp,fsbno) ((fsbno) << (mp)->m_blkbb_log)
-#define XFS_BB_TO_FSB(mp,bb)	\
+#define	XFS_FSB_TO_BB(mp,fsbno)	((fsbno) << (mp)->m_blkbb_log)
+#define	XFS_BB_TO_FSB(mp,bb)	\
 	(((bb) + (XFS_FSB_TO_BB(mp,1) - 1)) >> (mp)->m_blkbb_log)
-#define XFS_BB_TO_FSBT(mp,bb)	((bb) >> (mp)->m_blkbb_log)
-#define XFS_BB_FSB_OFFSET(mp,bb) ((bb) & ((mp)->m_bsize - 1))
+#define	XFS_BB_TO_FSBT(mp,bb)	((bb) >> (mp)->m_blkbb_log)
+#define	XFS_BB_FSB_OFFSET(mp,bb) ((bb) & ((mp)->m_bsize - 1))
 
 /*
  * File system block to byte conversions.
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_trans.c linux-2.5.68-bk12/fs/xfs/xfs_trans.c
--- linux-2.5.68-bk11/fs/xfs/xfs_trans.c	2003-04-19 19:49:25.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_trans.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,35 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_error.h"
+#include "xfs_trans_priv.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_alloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_quota.h"
+#include "xfs_trans_space.h"
 
 
 STATIC void	xfs_trans_apply_sb_deltas(xfs_trans_t *);
@@ -134,8 +162,8 @@
 
 /*
  * This is called to create a new transaction which will share the
- * permanent log reservation of the given transaction.	The remaining
- * unused block and rt extent reservations are also inherited.	This
+ * permanent log reservation of the given transaction.  The remaining
+ * unused block and rt extent reservations are also inherited.  This
  * implies that the original transaction is no longer allowed to allocate
  * blocks.  Locks and log items, however, are no inherited.  They must
  * be added to the new transaction explicitly.
@@ -214,7 +242,7 @@
 
 	/*
 	 * Attempt to reserve the needed disk blocks by decrementing
-	 * the number needed from the number available.	 This will
+	 * the number needed from the number available.  This will
 	 * fail if the count would go below zero.
 	 */
 	if (blocks > 0) {
@@ -255,7 +283,7 @@
 
 	/*
 	 * Attempt to reserve the needed realtime extents by decrementing
-	 * the number needed from the number available.	 This will
+	 * the number needed from the number available.  This will
 	 * fail if the count would go below zero.
 	 */
 	if (rtextents > 0) {
@@ -345,7 +373,7 @@
 	case XFS_TRANS_SB_FDBLOCKS:
 		/*
 		 * Track the number of blocks allocated in the
-		 * transaction.	 Make sure it does not exceed the
+		 * transaction.  Make sure it does not exceed the
 		 * number reserved.
 		 */
 		if (delta < 0) {
@@ -366,7 +394,7 @@
 	case XFS_TRANS_SB_FREXTENTS:
 		/*
 		 * Track the number of blocks allocated in the
-		 * transaction.	 Make sure it does not exceed the
+		 * transaction.  Make sure it does not exceed the
 		 * number reserved.
 		 */
 		if (delta < 0) {
@@ -532,7 +560,7 @@
 	rsvd = (tp->t_flags & XFS_TRANS_RESERVE) != 0;
 
 	/*
-	 * Release any reserved blocks.	 Any that were allocated
+	 * Release any reserved blocks.  Any that were allocated
 	 * will be taken back again by fdblocks_delta below.
 	 */
 	if (tp->t_blk_res > 0) {
@@ -660,7 +688,7 @@
 	int			error;
 	int			log_flags;
 	int			sync;
-#define XFS_TRANS_LOGVEC_COUNT	16
+#define	XFS_TRANS_LOGVEC_COUNT	16
 	xfs_log_iovec_t		log_vector_fast[XFS_TRANS_LOGVEC_COUNT];
 #if defined(XLOG_NOLOG) || defined(DEBUG)
 	static xfs_lsn_t	trans_lsn = 1;
@@ -816,7 +844,7 @@
 	 * when the transaction commit really hits the on-disk log).
 	 * After this call we cannot reference tp, because the call
 	 * can happen at any time and the call will free the transaction
-	 * structure pointed to by tp.	The only case where we call
+	 * structure pointed to by tp.  The only case where we call
 	 * the completion routine (xfs_trans_committed) directly is
 	 * if the log is turned off on a debug kernel or we're
 	 * running in simulation mode (the log is explicitly turned
@@ -887,8 +915,8 @@
 
 /*
  * Total up the number of log iovecs needed to commit this
- * transaction.	 The transaction itself needs one for the
- * transaction header.	Ask each dirty item in turn how many
+ * transaction.  The transaction itself needs one for the
+ * transaction header.  Ask each dirty item in turn how many
  * it needs to get the total.
  */
 STATIC uint
@@ -956,7 +984,7 @@
 
 /*
  * Fill in the vector with pointers to data to be logged
- * by this transaction.	 The transaction header takes
+ * by this transaction.  The transaction header takes
  * the first vector, and then each dirty item takes the
  * number of vectors it indicated it needed in xfs_trans_count_vecs().
  *
@@ -1044,7 +1072,7 @@
 		flags &= ~XFS_TRANS_ABORT;
 	/*
 	 * See if the caller is relying on us to shut down the
-	 * filesystem.	This happens in paths where we detect
+	 * filesystem.  This happens in paths where we detect
 	 * corruption and decide to give up.
 	 */
 	if ((tp->t_flags & XFS_TRANS_DIRTY) &&
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_trans.h linux-2.5.68-bk12/fs/xfs/xfs_trans.h
--- linux-2.5.68-bk11/fs/xfs/xfs_trans.h	2003-04-19 19:50:33.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_trans.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -29,8 +29,8 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __XFS_TRANS_H__
-#define __XFS_TRANS_H__
+#ifndef	__XFS_TRANS_H__
+#define	__XFS_TRANS_H__
 
 /*
  * This is the structure written in the log at the head of
@@ -48,22 +48,22 @@
 	uint		th_num_items;		/* num items logged by trans */
 } xfs_trans_header_t;
 
-#define XFS_TRANS_HEADER_MAGIC	0x5452414e	/* TRAN */
+#define	XFS_TRANS_HEADER_MAGIC	0x5452414e	/* TRAN */
 
 /*
  * Log item types.
  */
-#define XFS_LI_5_3_BUF		0x1234	/* v1 bufs, 1-block inode buffers */
-#define XFS_LI_5_3_INODE	0x1235	/* 1-block inode buffers */
-#define XFS_LI_EFI		0x1236
-#define XFS_LI_EFD		0x1237
-#define XFS_LI_IUNLINK		0x1238
-#define XFS_LI_6_1_INODE	0x1239	/* 4K non-aligned inode bufs */
-#define XFS_LI_6_1_BUF		0x123a	/* v1, 4K inode buffers */
-#define XFS_LI_INODE		0x123b	/* aligned ino chunks, var-size ibufs */
-#define XFS_LI_BUF		0x123c	/* v2 bufs, variable sized inode bufs */
-#define XFS_LI_DQUOT		0x123d
-#define XFS_LI_QUOTAOFF		0x123e
+#define	XFS_LI_5_3_BUF		0x1234	/* v1 bufs, 1-block inode buffers */
+#define	XFS_LI_5_3_INODE	0x1235	/* 1-block inode buffers */
+#define	XFS_LI_EFI		0x1236
+#define	XFS_LI_EFD		0x1237
+#define	XFS_LI_IUNLINK		0x1238
+#define	XFS_LI_6_1_INODE	0x1239	/* 4K non-aligned inode bufs */
+#define	XFS_LI_6_1_BUF		0x123a	/* v1, 4K inode buffers */
+#define	XFS_LI_INODE		0x123b	/* aligned ino chunks, var-size ibufs */
+#define	XFS_LI_BUF		0x123c	/* v2 bufs, variable sized inode bufs */
+#define	XFS_LI_DQUOT		0x123d
+#define	XFS_LI_QUOTAOFF		0x123e
 
 /*
  * Transaction types.  Used to distinguish types of buffers.
@@ -84,15 +84,15 @@
 #define XFS_TRANS_GROWFS		14
 #define XFS_TRANS_STRAT_WRITE		15
 #define XFS_TRANS_DIOSTRAT		16
-#define XFS_TRANS_WRITE_SYNC		17
-#define XFS_TRANS_WRITEID		18
-#define XFS_TRANS_ADDAFORK		19
-#define XFS_TRANS_ATTRINVAL		20
-#define XFS_TRANS_ATRUNCATE		21
-#define XFS_TRANS_ATTR_SET		22
-#define XFS_TRANS_ATTR_RM		23
-#define XFS_TRANS_ATTR_FLAG		24
-#define XFS_TRANS_CLEAR_AGI_BUCKET	25
+#define	XFS_TRANS_WRITE_SYNC		17
+#define	XFS_TRANS_WRITEID		18
+#define	XFS_TRANS_ADDAFORK		19
+#define	XFS_TRANS_ATTRINVAL		20
+#define	XFS_TRANS_ATRUNCATE		21
+#define	XFS_TRANS_ATTR_SET		22
+#define	XFS_TRANS_ATTR_RM		23
+#define	XFS_TRANS_ATTR_FLAG		24
+#define	XFS_TRANS_CLEAR_AGI_BUCKET	25
 #define XFS_TRANS_QM_SBCHANGE		26
 /*
  * Dummy entries since we use the transaction type to index into the
@@ -108,10 +108,10 @@
 #define XFS_TRANS_QM_QUOTAOFF_END	34
 #define XFS_TRANS_SB_UNIT		35
 #define XFS_TRANS_FSYNC_TS		36
-#define XFS_TRANS_GROWFSRT_ALLOC	37
-#define XFS_TRANS_GROWFSRT_ZERO		38
-#define XFS_TRANS_GROWFSRT_FREE		39
-#define XFS_TRANS_SWAPEXT		40
+#define	XFS_TRANS_GROWFSRT_ALLOC	37
+#define	XFS_TRANS_GROWFSRT_ZERO		38
+#define	XFS_TRANS_GROWFSRT_FREE		39
+#define	XFS_TRANS_SWAPEXT		40
 /* new transaction types need to be reflected in xfs_logprint(8) */
 
 
@@ -162,7 +162,7 @@
 	struct xfs_item_ops		*li_ops;	/* function list */
 } xfs_log_item_t;
 
-#define XFS_LI_IN_AIL	0x1
+#define	XFS_LI_IN_AIL	0x1
 #define XFS_LI_ABORTED	0x2
 
 typedef struct xfs_item_ops {
@@ -196,10 +196,10 @@
 /*
  * Return values for the IOP_TRYLOCK() routines.
  */
-#define XFS_ITEM_SUCCESS	0
-#define XFS_ITEM_PINNED		1
-#define XFS_ITEM_LOCKED		2
-#define XFS_ITEM_FLUSHING	3
+#define	XFS_ITEM_SUCCESS	0
+#define	XFS_ITEM_PINNED		1
+#define	XFS_ITEM_LOCKED		2
+#define	XFS_ITEM_FLUSHING	3
 #define XFS_ITEM_PUSHBUF	4
 
 #endif	/* __KERNEL__ */
@@ -229,7 +229,7 @@
  * in this chunk's array are free.  The unused field is the first value
  * not used since this chunk was allocated.
  */
-#define XFS_LIC_NUM_SLOTS	15
+#define	XFS_LIC_NUM_SLOTS	15
 typedef struct xfs_log_item_chunk {
 	struct xfs_log_item_chunk	*lic_next;
 	ushort				lic_free;
@@ -237,77 +237,77 @@
 	xfs_log_item_desc_t		lic_descs[XFS_LIC_NUM_SLOTS];
 } xfs_log_item_chunk_t;
 
-#define XFS_LIC_MAX_SLOT	(XFS_LIC_NUM_SLOTS - 1)
-#define XFS_LIC_FREEMASK	((1 << XFS_LIC_NUM_SLOTS) - 1)
+#define	XFS_LIC_MAX_SLOT	(XFS_LIC_NUM_SLOTS - 1)
+#define	XFS_LIC_FREEMASK	((1 << XFS_LIC_NUM_SLOTS) - 1)
 
 
 /*
- * Initialize the given chunk.	Set the chunk's free descriptor mask
+ * Initialize the given chunk.  Set the chunk's free descriptor mask
  * to indicate that all descriptors are free.  The caller gets to set
- * lic_unused to the right value (0 matches all free).	The
+ * lic_unused to the right value (0 matches all free).  The
  * lic_descs.lid_index values are set up as each desc is allocated.
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_INIT)
 void xfs_lic_init(xfs_log_item_chunk_t *cp);
-#define XFS_LIC_INIT(cp)	xfs_lic_init(cp)
+#define	XFS_LIC_INIT(cp)	xfs_lic_init(cp)
 #else
-#define XFS_LIC_INIT(cp)	((cp)->lic_free = XFS_LIC_FREEMASK)
+#define	XFS_LIC_INIT(cp)	((cp)->lic_free = XFS_LIC_FREEMASK)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_INIT_SLOT)
 void xfs_lic_init_slot(xfs_log_item_chunk_t *cp, int slot);
-#define XFS_LIC_INIT_SLOT(cp,slot)	xfs_lic_init_slot(cp, slot)
+#define	XFS_LIC_INIT_SLOT(cp,slot)	xfs_lic_init_slot(cp, slot)
 #else
-#define XFS_LIC_INIT_SLOT(cp,slot)	\
+#define	XFS_LIC_INIT_SLOT(cp,slot)	\
 	((cp)->lic_descs[slot].lid_index = (unsigned char)(slot))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_VACANCY)
 int xfs_lic_vacancy(xfs_log_item_chunk_t *cp);
-#define XFS_LIC_VACANCY(cp)		xfs_lic_vacancy(cp)
+#define	XFS_LIC_VACANCY(cp)		xfs_lic_vacancy(cp)
 #else
-#define XFS_LIC_VACANCY(cp)		(((cp)->lic_free) & XFS_LIC_FREEMASK)
+#define	XFS_LIC_VACANCY(cp)		(((cp)->lic_free) & XFS_LIC_FREEMASK)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_ALL_FREE)
 void xfs_lic_all_free(xfs_log_item_chunk_t *cp);
-#define XFS_LIC_ALL_FREE(cp)		xfs_lic_all_free(cp)
+#define	XFS_LIC_ALL_FREE(cp)		xfs_lic_all_free(cp)
 #else
-#define XFS_LIC_ALL_FREE(cp)		((cp)->lic_free = XFS_LIC_FREEMASK)
+#define	XFS_LIC_ALL_FREE(cp)		((cp)->lic_free = XFS_LIC_FREEMASK)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_ARE_ALL_FREE)
 int xfs_lic_are_all_free(xfs_log_item_chunk_t *cp);
-#define XFS_LIC_ARE_ALL_FREE(cp)	xfs_lic_are_all_free(cp)
+#define	XFS_LIC_ARE_ALL_FREE(cp)	xfs_lic_are_all_free(cp)
 #else
-#define XFS_LIC_ARE_ALL_FREE(cp)	(((cp)->lic_free & XFS_LIC_FREEMASK) ==\
+#define	XFS_LIC_ARE_ALL_FREE(cp)	(((cp)->lic_free & XFS_LIC_FREEMASK) ==\
 					XFS_LIC_FREEMASK)
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_ISFREE)
 int xfs_lic_isfree(xfs_log_item_chunk_t *cp, int slot);
-#define XFS_LIC_ISFREE(cp,slot) xfs_lic_isfree(cp,slot)
+#define	XFS_LIC_ISFREE(cp,slot)	xfs_lic_isfree(cp,slot)
 #else
-#define XFS_LIC_ISFREE(cp,slot) ((cp)->lic_free & (1 << (slot)))
+#define	XFS_LIC_ISFREE(cp,slot)	((cp)->lic_free & (1 << (slot)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_CLAIM)
 void xfs_lic_claim(xfs_log_item_chunk_t *cp, int slot);
-#define XFS_LIC_CLAIM(cp,slot)		xfs_lic_claim(cp,slot)
+#define	XFS_LIC_CLAIM(cp,slot)		xfs_lic_claim(cp,slot)
 #else
-#define XFS_LIC_CLAIM(cp,slot)		((cp)->lic_free &= ~(1 << (slot)))
+#define	XFS_LIC_CLAIM(cp,slot)		((cp)->lic_free &= ~(1 << (slot)))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_RELSE)
 void xfs_lic_relse(xfs_log_item_chunk_t *cp, int slot);
-#define XFS_LIC_RELSE(cp,slot)		xfs_lic_relse(cp,slot)
+#define	XFS_LIC_RELSE(cp,slot)		xfs_lic_relse(cp,slot)
 #else
-#define XFS_LIC_RELSE(cp,slot)		((cp)->lic_free |= 1 << (slot))
+#define	XFS_LIC_RELSE(cp,slot)		((cp)->lic_free |= 1 << (slot))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_SLOT)
 xfs_log_item_desc_t *xfs_lic_slot(xfs_log_item_chunk_t *cp, int slot);
-#define XFS_LIC_SLOT(cp,slot)		xfs_lic_slot(cp,slot)
+#define	XFS_LIC_SLOT(cp,slot)		xfs_lic_slot(cp,slot)
 #else
-#define XFS_LIC_SLOT(cp,slot)		(&((cp)->lic_descs[slot]))
+#define	XFS_LIC_SLOT(cp,slot)		(&((cp)->lic_descs[slot]))
 #endif
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_DESC_TO_SLOT)
 int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp);
-#define XFS_LIC_DESC_TO_SLOT(dp)	xfs_lic_desc_to_slot(dp)
+#define	XFS_LIC_DESC_TO_SLOT(dp)	xfs_lic_desc_to_slot(dp)
 #else
-#define XFS_LIC_DESC_TO_SLOT(dp)	((uint)((dp)->lid_index))
+#define	XFS_LIC_DESC_TO_SLOT(dp)	((uint)((dp)->lid_index))
 #endif
 /*
  * Calculate the address of a chunk given a descriptor pointer:
@@ -318,9 +318,9 @@
  */
 #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_DESC_TO_CHUNK)
 xfs_log_item_chunk_t *xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp);
-#define XFS_LIC_DESC_TO_CHUNK(dp)	xfs_lic_desc_to_chunk(dp)
+#define	XFS_LIC_DESC_TO_CHUNK(dp)	xfs_lic_desc_to_chunk(dp)
 #else
-#define XFS_LIC_DESC_TO_CHUNK(dp)	((xfs_log_item_chunk_t*) \
+#define	XFS_LIC_DESC_TO_CHUNK(dp)	((xfs_log_item_chunk_t*) \
 					(((xfs_caddr_t)((dp) - (dp)->lid_index)) -\
 					(xfs_caddr_t)(((xfs_log_item_chunk_t*) \
 					0)->lic_descs)))
@@ -346,14 +346,14 @@
 	xfs_log_busy_slot_t		lbc_busy[XFS_LBC_NUM_SLOTS];
 } xfs_log_busy_chunk_t;
 
-#define XFS_LBC_MAX_SLOT	(XFS_LBC_NUM_SLOTS - 1)
-#define XFS_LBC_FREEMASK	((1U << XFS_LBC_NUM_SLOTS) - 1)
+#define	XFS_LBC_MAX_SLOT	(XFS_LBC_NUM_SLOTS - 1)
+#define	XFS_LBC_FREEMASK	((1U << XFS_LBC_NUM_SLOTS) - 1)
 
-#define XFS_LBC_INIT(cp)	((cp)->lbc_free = XFS_LBC_FREEMASK)
-#define XFS_LBC_CLAIM(cp, slot) ((cp)->lbc_free &= ~(1 << (slot)))
-#define XFS_LBC_SLOT(cp, slot)	(&((cp)->lbc_busy[(slot)]))
-#define XFS_LBC_VACANCY(cp)	(((cp)->lbc_free) & XFS_LBC_FREEMASK)
-#define XFS_LBC_ISFREE(cp, slot) ((cp)->lbc_free & (1 << (slot)))
+#define	XFS_LBC_INIT(cp)	((cp)->lbc_free = XFS_LBC_FREEMASK)
+#define	XFS_LBC_CLAIM(cp, slot)	((cp)->lbc_free &= ~(1 << (slot)))
+#define	XFS_LBC_SLOT(cp, slot)	(&((cp)->lbc_busy[(slot)]))
+#define	XFS_LBC_VACANCY(cp)	(((cp)->lbc_free) & XFS_LBC_FREEMASK)
+#define	XFS_LBC_ISFREE(cp, slot) ((cp)->lbc_free & (1 << (slot)))
 
 /*
  * This is the type of function which can be given to xfs_trans_callback()
@@ -373,21 +373,21 @@
 	unsigned int		t_log_res;	/* amt of log space resvd */
 	unsigned int		t_log_count;	/* count for perm log res */
 	unsigned int		t_blk_res;	/* # of blocks resvd */
-	unsigned int		t_blk_res_used; /* # of resvd blocks used */
+	unsigned int		t_blk_res_used;	/* # of resvd blocks used */
 	unsigned int		t_rtx_res;	/* # of rt extents resvd */
-	unsigned int		t_rtx_res_used; /* # of resvd rt extents used */
+	unsigned int		t_rtx_res_used;	/* # of resvd rt extents used */
 	xfs_log_ticket_t	t_ticket;	/* log mgr ticket */
 	sema_t			t_sema;		/* sema for commit completion */
 	xfs_lsn_t		t_lsn;		/* log seq num of start of
 						 * transaction. */
-	xfs_lsn_t		t_commit_lsn;	/* log seq num of end of 
+	xfs_lsn_t		t_commit_lsn;	/* log seq num of end of
 						 * transaction. */
 	struct xfs_mount	*t_mountp;	/* ptr to fs mount struct */
-	struct xfs_dquot_acct	*t_dqinfo;	/* accting info for dquots */
+	struct xfs_dquot_acct   *t_dqinfo;	/* accting info for dquots */
 	xfs_trans_callback_t	t_callback;	/* transaction callback */
 	void			*t_callarg;	/* callback arg */
 	unsigned int		t_flags;	/* misc flags */
-	long			t_icount_delta; /* superblock icount change */
+	long			t_icount_delta;	/* superblock icount change */
 	long			t_ifree_delta;	/* superblock ifree change */
 	long			t_fdblocks_delta; /* superblock fdblocks chg */
 	long			t_res_fdblocks_delta; /* on-disk only chg */
@@ -414,42 +414,42 @@
 #endif	/* __KERNEL__ */
 
 
-#define XFS_TRANS_MAGIC		0x5452414E	/* 'TRAN' */
+#define	XFS_TRANS_MAGIC		0x5452414E	/* 'TRAN' */
 /*
  * Values for t_flags.
  */
-#define XFS_TRANS_DIRTY		0x01	/* something needs to be logged */
-#define XFS_TRANS_SB_DIRTY	0x02	/* superblock is modified */
-#define XFS_TRANS_PERM_LOG_RES	0x04	/* xact took a permanent log res */
-#define XFS_TRANS_SYNC		0x08	/* make commit synchronous */
+#define	XFS_TRANS_DIRTY		0x01	/* something needs to be logged */
+#define	XFS_TRANS_SB_DIRTY	0x02	/* superblock is modified */
+#define	XFS_TRANS_PERM_LOG_RES	0x04	/* xact took a permanent log res */
+#define	XFS_TRANS_SYNC		0x08	/* make commit synchronous */
 #define XFS_TRANS_DQ_DIRTY	0x10	/* at least one dquot in trx dirty */
-#define XFS_TRANS_RESERVE	0x20	/* OK to use reserved data blocks */
+#define XFS_TRANS_RESERVE	0x20    /* OK to use reserved data blocks */
 
 /*
  * Values for call flags parameter.
  */
-#define XFS_TRANS_NOSLEEP		0x1
-#define XFS_TRANS_WAIT			0x2
-#define XFS_TRANS_RELEASE_LOG_RES	0x4
-#define XFS_TRANS_ABORT			0x8
+#define	XFS_TRANS_NOSLEEP		0x1
+#define	XFS_TRANS_WAIT			0x2
+#define	XFS_TRANS_RELEASE_LOG_RES	0x4
+#define	XFS_TRANS_ABORT			0x8
 
 /*
  * Field values for xfs_trans_mod_sb.
  */
-#define XFS_TRANS_SB_ICOUNT		0x00000001
-#define XFS_TRANS_SB_IFREE		0x00000002
-#define XFS_TRANS_SB_FDBLOCKS		0x00000004
-#define XFS_TRANS_SB_RES_FDBLOCKS	0x00000008
-#define XFS_TRANS_SB_FREXTENTS		0x00000010
-#define XFS_TRANS_SB_RES_FREXTENTS	0x00000020
-#define XFS_TRANS_SB_DBLOCKS		0x00000040
-#define XFS_TRANS_SB_AGCOUNT		0x00000080
-#define XFS_TRANS_SB_IMAXPCT		0x00000100
-#define XFS_TRANS_SB_REXTSIZE		0x00000200
-#define XFS_TRANS_SB_RBMBLOCKS		0x00000400
-#define XFS_TRANS_SB_RBLOCKS		0x00000800
-#define XFS_TRANS_SB_REXTENTS		0x00001000
-#define XFS_TRANS_SB_REXTSLOG		0x00002000
+#define	XFS_TRANS_SB_ICOUNT		0x00000001
+#define	XFS_TRANS_SB_IFREE		0x00000002
+#define	XFS_TRANS_SB_FDBLOCKS		0x00000004
+#define	XFS_TRANS_SB_RES_FDBLOCKS	0x00000008
+#define	XFS_TRANS_SB_FREXTENTS		0x00000010
+#define	XFS_TRANS_SB_RES_FREXTENTS	0x00000020
+#define	XFS_TRANS_SB_DBLOCKS		0x00000040
+#define	XFS_TRANS_SB_AGCOUNT		0x00000080
+#define	XFS_TRANS_SB_IMAXPCT		0x00000100
+#define	XFS_TRANS_SB_REXTSIZE		0x00000200
+#define	XFS_TRANS_SB_RBMBLOCKS		0x00000400
+#define	XFS_TRANS_SB_RBLOCKS		0x00000800
+#define	XFS_TRANS_SB_REXTENTS		0x00001000
+#define	XFS_TRANS_SB_REXTSLOG		0x00002000
 
 
 /*
@@ -475,9 +475,9 @@
  * involved in freeing or allocating an extent.
  * 2 trees * (2 blocks/level * max depth - 1) * block size
  */
-#define XFS_ALLOCFREE_LOG_RES(mp,nx) \
+#define	XFS_ALLOCFREE_LOG_RES(mp,nx) \
 	((nx) * (2 * XFS_FSB_TO_B((mp), 2 * XFS_AG_MAXLEVELS(mp) - 1)))
-#define XFS_ALLOCFREE_LOG_COUNT(mp,nx) \
+#define	XFS_ALLOCFREE_LOG_COUNT(mp,nx) \
 	((nx) * (2 * (2 * XFS_AG_MAXLEVELS(mp) - 1)))
 
 /*
@@ -487,10 +487,10 @@
  * v2 directory blocks can be fragmented below the dirblksize down to the fsb
  * size, so account for that in the DAENTER macros.
  */
-#define XFS_DIROP_LOG_RES(mp)	\
+#define	XFS_DIROP_LOG_RES(mp)	\
 	(XFS_FSB_TO_B(mp, XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK)) + \
 	 (XFS_FSB_TO_B(mp, XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)))
-#define XFS_DIROP_LOG_COUNT(mp) \
+#define	XFS_DIROP_LOG_COUNT(mp)	\
 	(XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK) + \
 	 XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)
 
@@ -522,7 +522,7 @@
 	  XFS_ALLOCFREE_LOG_RES(mp, 2) + \
 	  (128 * (5 + XFS_ALLOCFREE_LOG_COUNT(mp, 2))))))
 
-#define XFS_WRITE_LOG_RES(mp)	((mp)->m_reservations.tr_write)
+#define	XFS_WRITE_LOG_RES(mp)	((mp)->m_reservations.tr_write)
 
 /*
  * In truncating a file we free up to two extents at once.  We can modify:
@@ -535,7 +535,7 @@
  *    worst case split in allocation btrees per extent assuming 4 extents:
  *		4 exts * 2 trees * (2 * max depth - 1) * block size
  */
-#define XFS_CALC_ITRUNCATE_LOG_RES(mp) \
+#define	XFS_CALC_ITRUNCATE_LOG_RES(mp) \
 	(MAX( \
 	 ((mp)->m_sb.sb_inodesize + \
 	  XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + 1) + \
@@ -546,7 +546,7 @@
 	  XFS_ALLOCFREE_LOG_RES(mp, 4) + \
 	  (128 * (9 + XFS_ALLOCFREE_LOG_COUNT(mp, 4))))))
 
-#define XFS_ITRUNCATE_LOG_RES(mp)   ((mp)->m_reservations.tr_itruncate)
+#define	XFS_ITRUNCATE_LOG_RES(mp)   ((mp)->m_reservations.tr_itruncate)
 
 /*
  * In renaming a files we can modify:
@@ -560,7 +560,7 @@
  *    the superblock for the free block count: sector size
  *    the allocation btrees: 3 exts * 2 trees * (2 * max depth - 1) * block size
  */
-#define XFS_CALC_RENAME_LOG_RES(mp) \
+#define	XFS_CALC_RENAME_LOG_RES(mp) \
 	(MAX( \
 	 ((4 * (mp)->m_sb.sb_inodesize) + \
 	  (2 * XFS_DIROP_LOG_RES(mp)) + \
@@ -571,7 +571,7 @@
 	  XFS_ALLOCFREE_LOG_RES(mp, 3) + \
 	  (128 * (7 + XFS_ALLOCFREE_LOG_COUNT(mp, 3))))))
 
-#define XFS_RENAME_LOG_RES(mp)	((mp)->m_reservations.tr_rename)
+#define	XFS_RENAME_LOG_RES(mp)	((mp)->m_reservations.tr_rename)
 
 /*
  * For creating a link to an inode:
@@ -585,7 +585,7 @@
  *    the superblock for the free block count: sector size
  *    the allocation btrees: 2 trees * (2 * max depth - 1) * block size
  */
-#define XFS_CALC_LINK_LOG_RES(mp) \
+#define	XFS_CALC_LINK_LOG_RES(mp) \
 	(MAX( \
 	 ((mp)->m_sb.sb_inodesize + \
 	  (mp)->m_sb.sb_inodesize + \
@@ -597,7 +597,7 @@
 	  XFS_ALLOCFREE_LOG_RES(mp, 1) + \
 	  (128 * (3 + XFS_ALLOCFREE_LOG_COUNT(mp, 1))))))
 
-#define XFS_LINK_LOG_RES(mp)	((mp)->m_reservations.tr_link)
+#define	XFS_LINK_LOG_RES(mp)	((mp)->m_reservations.tr_link)
 
 /*
  * For removing a directory entry we can modify:
@@ -611,7 +611,7 @@
  *    the superblock for the free block count: sector size
  *    the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block size
  */
-#define XFS_CALC_REMOVE_LOG_RES(mp)	\
+#define	XFS_CALC_REMOVE_LOG_RES(mp)	\
 	(MAX( \
 	 ((mp)->m_sb.sb_inodesize + \
 	  (mp)->m_sb.sb_inodesize + \
@@ -623,7 +623,7 @@
 	  XFS_ALLOCFREE_LOG_RES(mp, 2) + \
 	  (128 * (5 + XFS_ALLOCFREE_LOG_COUNT(mp, 2))))))
 
-#define XFS_REMOVE_LOG_RES(mp)	((mp)->m_reservations.tr_remove)
+#define	XFS_REMOVE_LOG_RES(mp)	((mp)->m_reservations.tr_remove)
 
 /*
  * For symlink we can modify:
@@ -639,7 +639,7 @@
  *    the inode btree: max depth * blocksize
  *    the allocation btrees: 2 trees * (2 * max depth - 1) * block size
  */
-#define XFS_CALC_SYMLINK_LOG_RES(mp)		\
+#define	XFS_CALC_SYMLINK_LOG_RES(mp)		\
 	(MAX( \
 	 ((mp)->m_sb.sb_inodesize + \
 	  (mp)->m_sb.sb_inodesize + \
@@ -654,7 +654,7 @@
 	  (128 * (2 + XFS_IALLOC_BLOCKS(mp) + XFS_IN_MAXLEVELS(mp) + \
 	   XFS_ALLOCFREE_LOG_COUNT(mp, 1))))))
 
-#define XFS_SYMLINK_LOG_RES(mp) ((mp)->m_reservations.tr_symlink)
+#define	XFS_SYMLINK_LOG_RES(mp)	((mp)->m_reservations.tr_symlink)
 
 /*
  * For create we can modify:
@@ -671,7 +671,7 @@
  *    the inode btree: max depth * blocksize
  *    the allocation btrees: 2 trees * (max depth - 1) * block size
  */
-#define XFS_CALC_CREATE_LOG_RES(mp)		\
+#define	XFS_CALC_CREATE_LOG_RES(mp)		\
 	(MAX( \
 	 ((mp)->m_sb.sb_inodesize + \
 	  (mp)->m_sb.sb_inodesize + \
@@ -686,14 +686,14 @@
 	  (128 * (2 + XFS_IALLOC_BLOCKS(mp) + XFS_IN_MAXLEVELS(mp) + \
 	   XFS_ALLOCFREE_LOG_COUNT(mp, 1))))))
 
-#define XFS_CREATE_LOG_RES(mp)	((mp)->m_reservations.tr_create)
+#define	XFS_CREATE_LOG_RES(mp)	((mp)->m_reservations.tr_create)
 
 /*
  * Making a new directory is the same as creating a new file.
  */
-#define XFS_CALC_MKDIR_LOG_RES(mp)	XFS_CALC_CREATE_LOG_RES(mp)
+#define	XFS_CALC_MKDIR_LOG_RES(mp)	XFS_CALC_CREATE_LOG_RES(mp)
 
-#define XFS_MKDIR_LOG_RES(mp)	((mp)->m_reservations.tr_mkdir)
+#define	XFS_MKDIR_LOG_RES(mp)	((mp)->m_reservations.tr_mkdir)
 
 /*
  * In freeing an inode we can modify:
@@ -703,7 +703,7 @@
  *    the inode btree entry: block size
  *    the on disk inode before ours in the agi hash list: inode cluster size
  */
-#define XFS_CALC_IFREE_LOG_RES(mp) \
+#define	XFS_CALC_IFREE_LOG_RES(mp) \
 	((mp)->m_sb.sb_inodesize + \
 	 (mp)->m_sb.sb_sectsize + \
 	 (mp)->m_sb.sb_sectsize + \
@@ -711,16 +711,16 @@
 	 MAX((__uint16_t)XFS_FSB_TO_B((mp), 1), XFS_INODE_CLUSTER_SIZE(mp)) + \
 	 (128 * 5))
 
-#define XFS_IFREE_LOG_RES(mp)	((mp)->m_reservations.tr_ifree)
+#define	XFS_IFREE_LOG_RES(mp)	((mp)->m_reservations.tr_ifree)
 
 /*
  * When only changing the inode we log the inode and possibly the superblock
  * We also add a bit of slop for the transaction stuff.
  */
-#define XFS_CALC_ICHANGE_LOG_RES(mp)	((mp)->m_sb.sb_inodesize + \
+#define	XFS_CALC_ICHANGE_LOG_RES(mp)	((mp)->m_sb.sb_inodesize + \
 					 (mp)->m_sb.sb_sectsize + 512)
 
-#define XFS_ICHANGE_LOG_RES(mp) ((mp)->m_reservations.tr_ichange)
+#define	XFS_ICHANGE_LOG_RES(mp)	((mp)->m_reservations.tr_ichange)
 
 /*
  * Growing the data section of the filesystem.
@@ -728,12 +728,12 @@
  *	agi and agf
  *	allocation btrees
  */
-#define XFS_CALC_GROWDATA_LOG_RES(mp) \
+#define	XFS_CALC_GROWDATA_LOG_RES(mp) \
 	((mp)->m_sb.sb_sectsize * 3 + \
 	 XFS_ALLOCFREE_LOG_RES(mp, 1) + \
 	 (128 * (3 + XFS_ALLOCFREE_LOG_COUNT(mp, 1))))
 
-#define XFS_GROWDATA_LOG_RES(mp)    ((mp)->m_reservations.tr_growdata)
+#define	XFS_GROWDATA_LOG_RES(mp)    ((mp)->m_reservations.tr_growdata)
 
 /*
  * Growing the rt section of the filesystem.
@@ -745,7 +745,7 @@
  *	bitmap/summary inode: inode size
  *	allocation btrees for 1 block alloc: 2 * (2 * maxdepth - 1) * blocksize
  */
-#define XFS_CALC_GROWRTALLOC_LOG_RES(mp) \
+#define	XFS_CALC_GROWRTALLOC_LOG_RES(mp) \
 	(2 * (mp)->m_sb.sb_sectsize + \
 	 XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK)) + \
 	 (mp)->m_sb.sb_inodesize + \
@@ -754,17 +754,17 @@
 	  (3 + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + \
 	   XFS_ALLOCFREE_LOG_COUNT(mp, 1))))
 
-#define XFS_GROWRTALLOC_LOG_RES(mp)	((mp)->m_reservations.tr_growrtalloc)
+#define	XFS_GROWRTALLOC_LOG_RES(mp)	((mp)->m_reservations.tr_growrtalloc)
 
 /*
  * Growing the rt section of the filesystem.
  * In the second set of transactions (ZERO) we zero the new metadata blocks.
  *	one bitmap/summary block: blocksize
  */
-#define XFS_CALC_GROWRTZERO_LOG_RES(mp) \
+#define	XFS_CALC_GROWRTZERO_LOG_RES(mp) \
 	((mp)->m_sb.sb_blocksize + 128)
 
-#define XFS_GROWRTZERO_LOG_RES(mp)	((mp)->m_reservations.tr_growrtzero)
+#define	XFS_GROWRTZERO_LOG_RES(mp)	((mp)->m_reservations.tr_growrtzero)
 
 /*
  * Growing the rt section of the filesystem.
@@ -776,38 +776,38 @@
  *	one bitmap block: blocksize
  *	summary blocks: new summary size
  */
-#define XFS_CALC_GROWRTFREE_LOG_RES(mp) \
+#define	XFS_CALC_GROWRTFREE_LOG_RES(mp) \
 	((mp)->m_sb.sb_sectsize + \
 	 2 * (mp)->m_sb.sb_inodesize + \
 	 (mp)->m_sb.sb_blocksize + \
 	 (mp)->m_rsumsize + \
 	 (128 * 5))
 
-#define XFS_GROWRTFREE_LOG_RES(mp)	((mp)->m_reservations.tr_growrtfree)
+#define	XFS_GROWRTFREE_LOG_RES(mp)	((mp)->m_reservations.tr_growrtfree)
 
 /*
  * Logging the inode modification timestamp on a synchronous write.
  *	inode
  */
-#define XFS_CALC_SWRITE_LOG_RES(mp) \
+#define	XFS_CALC_SWRITE_LOG_RES(mp) \
 	((mp)->m_sb.sb_inodesize + 128)
 
-#define XFS_SWRITE_LOG_RES(mp)	((mp)->m_reservations.tr_swrite)
+#define	XFS_SWRITE_LOG_RES(mp)	((mp)->m_reservations.tr_swrite)
 
 /*
  * Logging the inode timestamps on an fsync -- same as SWRITE
  * as long as SWRITE logs the entire inode core
  */
-#define XFS_FSYNC_TS_LOG_RES(mp)	((mp)->m_reservations.tr_swrite)
+#define XFS_FSYNC_TS_LOG_RES(mp)        ((mp)->m_reservations.tr_swrite)
 
 /*
  * Logging the inode mode bits when writing a setuid/setgid file
  *	inode
  */
-#define XFS_CALC_WRITEID_LOG_RES(mp) \
+#define	XFS_CALC_WRITEID_LOG_RES(mp) \
 	((mp)->m_sb.sb_inodesize + 128)
 
-#define XFS_WRITEID_LOG_RES(mp) ((mp)->m_reservations.tr_swrite)
+#define	XFS_WRITEID_LOG_RES(mp)	((mp)->m_reservations.tr_swrite)
 
 /*
  * Converting the inode from non-attributed to attributed.
@@ -817,7 +817,7 @@
  *	bmap blocks for the new directory block
  *	allocation btrees
  */
-#define XFS_CALC_ADDAFORK_LOG_RES(mp)	\
+#define	XFS_CALC_ADDAFORK_LOG_RES(mp)	\
 	((mp)->m_sb.sb_inodesize + \
 	 (mp)->m_sb.sb_sectsize * 2 + \
 	 (mp)->m_dirblksize + \
@@ -829,7 +829,7 @@
 			 XFS_DAENTER_BMAP1B(mp, XFS_DATA_FORK) + 1) + \
 		 XFS_ALLOCFREE_LOG_COUNT(mp, 1))))
 
-#define XFS_ADDAFORK_LOG_RES(mp)	((mp)->m_reservations.tr_addafork)
+#define	XFS_ADDAFORK_LOG_RES(mp)	((mp)->m_reservations.tr_addafork)
 
 /*
  * Removing the attribute fork of a file
@@ -842,7 +842,7 @@
  *    worst case split in allocation btrees per extent assuming 4 extents:
  *		4 exts * 2 trees * (2 * max depth - 1) * block size
  */
-#define XFS_CALC_ATTRINVAL_LOG_RES(mp)	\
+#define	XFS_CALC_ATTRINVAL_LOG_RES(mp)	\
 	(MAX( \
 	 ((mp)->m_sb.sb_inodesize + \
 	  XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK)) + \
@@ -853,7 +853,7 @@
 	  XFS_ALLOCFREE_LOG_RES(mp, 4) + \
 	  (128 * (9 + XFS_ALLOCFREE_LOG_COUNT(mp, 4))))))
 
-#define XFS_ATTRINVAL_LOG_RES(mp)	((mp)->m_reservations.tr_attrinval)
+#define	XFS_ATTRINVAL_LOG_RES(mp)	((mp)->m_reservations.tr_attrinval)
 
 /*
  * Setting an attribute.
@@ -865,13 +865,13 @@
  * Since attribute transaction space is dependent on the size of the attribute,
  * the calculation is done partially at mount time and partially at runtime.
  */
-#define XFS_CALC_ATTRSET_LOG_RES(mp)	\
+#define	XFS_CALC_ATTRSET_LOG_RES(mp)	\
 	((mp)->m_sb.sb_inodesize + \
 	 (mp)->m_sb.sb_sectsize + \
 	  XFS_FSB_TO_B((mp), XFS_DA_NODE_MAXDEPTH) + \
 	  (128 * (2 + XFS_DA_NODE_MAXDEPTH)))
 
-#define XFS_ATTRSET_LOG_RES(mp, ext)	\
+#define	XFS_ATTRSET_LOG_RES(mp, ext)	\
 	((mp)->m_reservations.tr_attrset + \
 	 (ext * (mp)->m_sb.sb_sectsize) + \
 	 (ext * XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))) + \
@@ -888,7 +888,7 @@
  *    the superblock for the free block count: sector size
  *    the allocation btrees: 2 exts * 2 trees * (2 * max depth - 1) * block size
  */
-#define XFS_CALC_ATTRRM_LOG_RES(mp)	\
+#define	XFS_CALC_ATTRRM_LOG_RES(mp)	\
 	(MAX( \
 	  ((mp)->m_sb.sb_inodesize + \
 	  XFS_FSB_TO_B((mp), XFS_DA_NODE_MAXDEPTH) + \
@@ -900,69 +900,69 @@
 	  XFS_ALLOCFREE_LOG_RES(mp, 2) + \
 	  (128 * (5 + XFS_ALLOCFREE_LOG_COUNT(mp, 2))))))
 
-#define XFS_ATTRRM_LOG_RES(mp)	((mp)->m_reservations.tr_attrrm)
+#define	XFS_ATTRRM_LOG_RES(mp)	((mp)->m_reservations.tr_attrrm)
 
 /*
  * Clearing a bad agino number in an agi hash bucket.
  */
-#define XFS_CALC_CLEAR_AGI_BUCKET_LOG_RES(mp) \
+#define	XFS_CALC_CLEAR_AGI_BUCKET_LOG_RES(mp) \
 	((mp)->m_sb.sb_sectsize + 128)
 
-#define XFS_CLEAR_AGI_BUCKET_LOG_RES(mp)  ((mp)->m_reservations.tr_clearagi)
+#define	XFS_CLEAR_AGI_BUCKET_LOG_RES(mp)  ((mp)->m_reservations.tr_clearagi)
 
 
 /*
  * Various log count values.
  */
-#define XFS_DEFAULT_LOG_COUNT		1
-#define XFS_DEFAULT_PERM_LOG_COUNT	2
-#define XFS_ITRUNCATE_LOG_COUNT		2
-#define XFS_CREATE_LOG_COUNT		2
-#define XFS_MKDIR_LOG_COUNT		3
-#define XFS_SYMLINK_LOG_COUNT		3
-#define XFS_REMOVE_LOG_COUNT		2
-#define XFS_LINK_LOG_COUNT		2
-#define XFS_RENAME_LOG_COUNT		2
-#define XFS_WRITE_LOG_COUNT		2
-#define XFS_ADDAFORK_LOG_COUNT		2
-#define XFS_ATTRINVAL_LOG_COUNT		1
-#define XFS_ATTRSET_LOG_COUNT		3
-#define XFS_ATTRRM_LOG_COUNT		3
+#define	XFS_DEFAULT_LOG_COUNT		1
+#define	XFS_DEFAULT_PERM_LOG_COUNT	2
+#define	XFS_ITRUNCATE_LOG_COUNT		2
+#define	XFS_CREATE_LOG_COUNT		2
+#define	XFS_MKDIR_LOG_COUNT		3
+#define	XFS_SYMLINK_LOG_COUNT		3
+#define	XFS_REMOVE_LOG_COUNT		2
+#define	XFS_LINK_LOG_COUNT		2
+#define	XFS_RENAME_LOG_COUNT		2
+#define	XFS_WRITE_LOG_COUNT		2
+#define	XFS_ADDAFORK_LOG_COUNT		2
+#define	XFS_ATTRINVAL_LOG_COUNT		1
+#define	XFS_ATTRSET_LOG_COUNT		3
+#define	XFS_ATTRRM_LOG_COUNT		3
 
 /*
  * Here we centralize the specification of XFS meta-data buffer
  * reference count values.  This determine how hard the buffer
  * cache tries to hold onto the buffer.
  */
-#define XFS_AGF_REF		4
-#define XFS_AGI_REF		4
-#define XFS_AGFL_REF		3
-#define XFS_INO_BTREE_REF	3
-#define XFS_ALLOC_BTREE_REF	2
-#define XFS_BMAP_BTREE_REF	2
-#define XFS_DIR_BTREE_REF	2
-#define XFS_ATTR_BTREE_REF	1
-#define XFS_INO_REF		1
-#define XFS_DQUOT_REF		1
+#define	XFS_AGF_REF		4
+#define	XFS_AGI_REF		4
+#define	XFS_AGFL_REF		3
+#define	XFS_INO_BTREE_REF	3
+#define	XFS_ALLOC_BTREE_REF	2
+#define	XFS_BMAP_BTREE_REF	2
+#define	XFS_DIR_BTREE_REF	2
+#define	XFS_ATTR_BTREE_REF	1
+#define	XFS_INO_REF		1
+#define	XFS_DQUOT_REF		1
 
 #ifdef __KERNEL__
 /*
  * XFS transaction mechanism exported interfaces that are
  * actually macros.
  */
-#define xfs_trans_get_log_res(tp)	((tp)->t_log_res)
-#define xfs_trans_get_log_count(tp)	((tp)->t_log_count)
-#define xfs_trans_get_block_res(tp)	((tp)->t_blk_res)
-#define xfs_trans_set_sync(tp)		((tp)->t_flags |= XFS_TRANS_SYNC)
+#define	xfs_trans_get_log_res(tp)	((tp)->t_log_res)
+#define	xfs_trans_get_log_count(tp)	((tp)->t_log_count)
+#define	xfs_trans_get_block_res(tp)	((tp)->t_blk_res)
+#define	xfs_trans_set_sync(tp)		((tp)->t_flags |= XFS_TRANS_SYNC)
 
 #ifdef DEBUG
-#define xfs_trans_agblocks_delta(tp, d) ((tp)->t_ag_freeblks_delta += (long)d)
-#define xfs_trans_agflist_delta(tp, d)	((tp)->t_ag_flist_delta += (long)d)
-#define xfs_trans_agbtree_delta(tp, d)	((tp)->t_ag_btree_delta += (long)d)
-#else
-#define xfs_trans_agblocks_delta(tp, d)
-#define xfs_trans_agflist_delta(tp, d)
-#define xfs_trans_agbtree_delta(tp, d)
+#define	xfs_trans_agblocks_delta(tp, d)	((tp)->t_ag_freeblks_delta += (long)d)
+#define	xfs_trans_agflist_delta(tp, d)	((tp)->t_ag_flist_delta += (long)d)
+#define	xfs_trans_agbtree_delta(tp, d)	((tp)->t_ag_btree_delta += (long)d)
+#else
+#define	xfs_trans_agblocks_delta(tp, d)
+#define	xfs_trans_agflist_delta(tp, d)
+#define	xfs_trans_agbtree_delta(tp, d)
 #endif
 
 /*
@@ -1000,13 +1000,13 @@
 void		xfs_trans_ihold_release(xfs_trans_t *, struct xfs_inode *);
 void		xfs_trans_log_buf(xfs_trans_t *, struct xfs_buf *, uint, uint);
 void		xfs_trans_log_inode(xfs_trans_t *, struct xfs_inode *, uint);
-struct xfs_efi_log_item *xfs_trans_get_efi(xfs_trans_t *, uint);
+struct xfs_efi_log_item	*xfs_trans_get_efi(xfs_trans_t *, uint);
 void		xfs_efi_release(struct xfs_efi_log_item *, uint);
 void		xfs_trans_log_efi_extent(xfs_trans_t *,
 					 struct xfs_efi_log_item *,
 					 xfs_fsblock_t,
 					 xfs_extlen_t);
-struct xfs_efd_log_item *xfs_trans_get_efd(xfs_trans_t *,
+struct xfs_efd_log_item	*xfs_trans_get_efd(xfs_trans_t *,
 				  struct xfs_efi_log_item *,
 				  uint);
 void		xfs_trans_log_efd_extent(xfs_trans_t *,
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_trans_ail.c linux-2.5.68-bk12/fs/xfs/xfs_trans_ail.c
--- linux-2.5.68-bk11/fs/xfs/xfs_trans_ail.c	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_trans_ail.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,19 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_log.h"
+#include "xfs_trans_priv.h"
+#include "xfs_error.h"
 
 STATIC void xfs_ail_insert(xfs_ail_entry_t *, xfs_log_item_t *);
 STATIC xfs_log_item_t * xfs_ail_delete(xfs_ail_entry_t *, xfs_log_item_t *);
@@ -40,7 +52,7 @@
 #ifdef XFSDEBUG
 STATIC void xfs_ail_check(xfs_ail_entry_t *);
 #else
-#define xfs_ail_check(a)
+#define	xfs_ail_check(a)
 #endif /* XFSDEBUG */
 
 
@@ -95,7 +107,7 @@
 	int			flush_log;
 	SPLDECL(s);
 
-#define XFS_TRANS_PUSH_AIL_RESTARTS	10
+#define	XFS_TRANS_PUSH_AIL_RESTARTS	10
 
 	AIL_LOCK(mp,s);
 	lip = xfs_trans_first_ail(mp, &gen);
@@ -111,7 +123,7 @@
 
 	/*
 	 * While the item we are looking at is below the given threshold
-	 * try to flush it out.	 Make sure to limit the number of times
+	 * try to flush it out.  Make sure to limit the number of times
 	 * we allow xfs_trans_next_ail() to restart scanning from the
 	 * beginning of the list.  We'd like not to stop until we've at least
 	 * tried to push on everything in the AIL with an LSN less than
@@ -127,7 +139,7 @@
 		 * If we can lock the item without sleeping, unlock
 		 * the AIL lock and flush the item.  Then re-grab the
 		 * AIL lock so we can look for the next item on the
-		 * AIL.	 Since we unlock the AIL while we flush the
+		 * AIL.  Since we unlock the AIL while we flush the
 		 * item, the next routine may start over again at the
 		 * the beginning of the list if anything has changed.
 		 * That is what the generation count is for.
@@ -262,17 +274,17 @@
 
 /*
  * Update the position of the item in the AIL with the new
- * lsn.	 If it is not yet in the AIL, add it.  Otherwise, move
+ * lsn.  If it is not yet in the AIL, add it.  Otherwise, move
  * it to its new position by removing it and re-adding it.
  *
- * Wakeup anyone with an lsn less than the item's lsn.	If the item
+ * Wakeup anyone with an lsn less than the item's lsn.  If the item
  * we move in the AIL is the minimum one, update the tail lsn in the
  * log manager.
  *
  * Increment the AIL's generation count to indicate that the tree
  * has changed.
  *
- * This function must be called with the AIL lock held.	 The lock
+ * This function must be called with the AIL lock held.  The lock
  * is dropped before returning, so the caller must pass in the
  * cookie returned by AIL_LOCK.
  */
@@ -314,7 +326,7 @@
 }	/* xfs_trans_update_ail */
 
 /*
- * Delete the given item from the AIL.	It must already be in
+ * Delete the given item from the AIL.  It must already be in
  * the AIL.
  *
  * Wakeup anyone with an lsn less than item's lsn.    If the item
@@ -325,7 +337,7 @@
  * bump the AIL's generation count to indicate that the tree
  * has changed.
  *
- * This function must be called with the AIL lock held.	 The lock
+ * This function must be called with the AIL lock held.  The lock
  * is dropped before returning, so the caller must pass in the
  * cookie returned by AIL_LOCK.
  */
@@ -456,7 +468,7 @@
  */
 STATIC void
 xfs_ail_insert(
-	xfs_ail_entry_t *base,
+	xfs_ail_entry_t	*base,
 	xfs_log_item_t	*lip)
 /* ARGSUSED */
 {
@@ -490,12 +502,12 @@
 }
 
 /*
- * Delete the given item from the AIL.	Return a pointer to the item.
+ * Delete the given item from the AIL.  Return a pointer to the item.
  */
 /*ARGSUSED*/
 STATIC xfs_log_item_t *
 xfs_ail_delete(
-	xfs_ail_entry_t *base,
+	xfs_ail_entry_t	*base,
 	xfs_log_item_t	*lip)
 /* ARGSUSED */
 {
@@ -514,7 +526,7 @@
  */
 STATIC xfs_log_item_t *
 xfs_ail_min(
-	xfs_ail_entry_t *base)
+	xfs_ail_entry_t	*base)
 /* ARGSUSED */
 {
 	register xfs_log_item_t *forw = base->ail_forw;
@@ -531,7 +543,7 @@
  */
 STATIC xfs_log_item_t *
 xfs_ail_next(
-	xfs_ail_entry_t *base,
+	xfs_ail_entry_t	*base,
 	xfs_log_item_t	*lip)
 /* ARGSUSED */
 {
@@ -583,6 +595,3 @@
 	ASSERT(base->ail_back == prev_lip);
 }
 #endif /* XFSDEBUG */
-
-
-
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_trans_buf.c linux-2.5.68-bk12/fs/xfs/xfs_trans_buf.c
--- linux-2.5.68-bk11/fs/xfs/xfs_trans_buf.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_trans_buf.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,21 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_buf_item.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_trans_priv.h"
+#include "xfs_error.h"
+#include "xfs_rw.h"
 
 
 STATIC xfs_buf_t *xfs_trans_buf_item_match(xfs_trans_t *, xfs_buftarg_t *,
@@ -41,7 +55,7 @@
 
 /*
  * Get and lock the buffer for the caller if it is not already
- * locked within the given transaction.	 If it is already locked
+ * locked within the given transaction.  If it is already locked
  * within the transaction, just increment its lock recursion count
  * and return a pointer to it.
  *
@@ -258,7 +272,7 @@
 
 /*
  * Get and lock the buffer for the caller if it is not already
- * locked within the given transaction.	 If it has not yet been
+ * locked within the given transaction.  If it has not yet been
  * read in, read it from disk. If it is already locked
  * within the transaction and already read in, just increment its
  * lock recursion count and return a pointer to it.
@@ -489,7 +503,7 @@
  * xfs_trans_... buffer allocation routines if the buffer has not
  * been modified within this transaction.  If the buffer is modified
  * within this transaction, do decrement the recursion count but do
- * not release the buffer even if the count goes to 0.	If the buffer is not
+ * not release the buffer even if the count goes to 0.  If the buffer is not
  * modified within the transaction, decrement the recursion count and
  * release the buffer if the recursion count goes to 0.
  *
@@ -566,7 +580,7 @@
 	/*
 	 * If the buffer has been invalidated, then we can't release
 	 * it until the transaction commits to disk unless it is re-dirtied
-	 * as part of this transaction.	 This prevents us from pulling
+	 * as part of this transaction.  This prevents us from pulling
 	 * the item from the AIL before we should.
 	 */
 	if (bip->bli_flags & XFS_BLI_STALE) {
@@ -701,7 +715,7 @@
 
 /*
  * This function is used to indicate that the buffer should not be
- * unlocked until the transaction is committed to disk.	 Since we
+ * unlocked until the transaction is committed to disk.  Since we
  * are going to keep the lock held, make the transaction synchronous
  * so that the lock is not held too long.
  *
@@ -807,7 +821,7 @@
  * This called to invalidate a buffer that is being used within
  * a transaction.  Typically this is because the blocks in the
  * buffer are being freed, so we need to prevent it from being
- * written out when we're done.	 Allowing it to be written again
+ * written out when we're done.  Allowing it to be written again
  * might overwrite data in the free blocks if they are reallocated
  * to a file.
  *
@@ -857,7 +871,7 @@
 
 	/*
 	 * Clear the dirty bit in the buffer and set the STALE flag
-	 * in the buf log item.	 The STALE flag will be used in
+	 * in the buf log item.  The STALE flag will be used in
 	 * xfs_buf_item_unpin() to determine if it should clean up
 	 * when the last reference to the buf item is given up.
 	 * We set the XFS_BLI_CANCEL flag in the buf log format structure
@@ -1018,7 +1032,7 @@
 			    (XFS_BUF_ADDR(bp) == blkno) &&
 			    (XFS_BUF_COUNT(bp) == len)) {
 				/*
-				 * We found it.	 Break out and
+				 * We found it.  Break out and
 				 * return the pointer to the buffer.
 				 */
 				break;
@@ -1075,7 +1089,7 @@
 			    (XFS_BUF_ADDR(bp) == blkno) &&
 			    (XFS_BUF_COUNT(bp) == len)) {
 				/*
-				 * We found it.	 Break out and
+				 * We found it.  Break out and
 				 * return the pointer to the buffer.
 				 */
 				return bp;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_trans_extfree.c linux-2.5.68-bk12/fs/xfs/xfs_trans_extfree.c
--- linux-2.5.68-bk11/fs/xfs/xfs_trans_extfree.c	2003-04-19 19:49:28.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_trans_extfree.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,18 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_trans_priv.h"
+#include "xfs_extfree_item.h"
 
 /*
  * This routine is called to allocate an "extent free intention"
@@ -117,7 +128,7 @@
 
 /*
  * This routine is called to indicate that the described
- * extent is to be logged as having been freed.	 It should
+ * extent is to be logged as having been freed.  It should
  * be called once for each extent freed.
  */
 void
@@ -143,8 +154,3 @@
 	extp->ext_len = ext_len;
 	efdp->efd_next_extent++;
 }
-
-
-
-
-
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_trans_inode.c linux-2.5.68-bk12/fs/xfs/xfs_trans_inode.c
--- linux-2.5.68-bk11/fs/xfs/xfs_trans_inode.c	2003-04-19 19:48:48.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_trans_inode.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,21 +30,43 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_trans_priv.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
 
 #ifdef XFS_TRANS_DEBUG
 STATIC void
 xfs_trans_inode_broot_debug(
 	xfs_inode_t	*ip);
 #else
-#define xfs_trans_inode_broot_debug(ip)
+#define	xfs_trans_inode_broot_debug(ip)
 #endif
 
 
 /*
  * Get and lock the inode for the caller if it is not already
- * locked within the given transaction.	 If it is already locked
+ * locked within the given transaction.  If it is already locked
  * within the transaction, just increment its lock recursion count
  * and return a pointer to it.
  *
@@ -52,8 +74,8 @@
  * opposed to the io lock, must be taken exclusively.  This ensures
  * that the inode can be involved in only 1 transaction at a time.
  * Lock recursion is handled on the io lock, but only for lock modes
- * of equal or lesser strength.	 That is, you can recur on the io lock
- * held EXCL with a SHARED request but not vice versa.	Also, if
+ * of equal or lesser strength.  That is, you can recur on the io lock
+ * held EXCL with a SHARED request but not vice versa.  Also, if
  * the inode is already a part of the transaction then you cannot
  * go from not holding the io lock to having it EXCL or SHARED.
  *
@@ -221,7 +243,7 @@
 
 	/*
 	 * If the release is just for a recursive lock on the inode lock,
-	 * then decrement the count and return.	 We can assert that
+	 * then decrement the count and return.  We can assert that
 	 * the caller is dropping an EXCL lock on the inode, because
 	 * inode must be locked EXCL within transactions.
 	 */
@@ -268,7 +290,7 @@
 /*
  * Add the locked inode to the transaction.
  * The inode must be locked, and it cannot be associated with any
- * transaction.	 The caller must specify the locks already held
+ * transaction.  The caller must specify the locks already held
  * on the inode.
  */
 void
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_trans_item.c linux-2.5.68-bk12/fs/xfs/xfs_trans_item.c
--- linux-2.5.68-bk11/fs/xfs/xfs_trans_item.c	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_trans_item.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,8 +30,12 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
 
 STATIC int	xfs_trans_unlock_chunk(xfs_log_item_chunk_t *,
 					int, int, xfs_lsn_t);
@@ -140,7 +144,7 @@
  * to the given slot.
  */
 void
-xfs_trans_free_item(xfs_trans_t *tp, xfs_log_item_desc_t *lidp)
+xfs_trans_free_item(xfs_trans_t	*tp, xfs_log_item_desc_t *lidp)
 {
 	uint			slot;
 	xfs_log_item_chunk_t	*licp;
@@ -158,7 +162,7 @@
 	 * the chunk. First pull it from the chunk list and then
 	 * free it back to the heap.  We didn't bother with a doubly
 	 * linked list here because the lists should be very short
-	 * and this is not a performance path.	It's better to save
+	 * and this is not a performance path.  It's better to save
 	 * the memory of the extra pointer.
 	 *
 	 * Also decrement the transaction structure's count of free items
@@ -180,14 +184,14 @@
  * This is called to find the descriptor corresponding to the given
  * log item.  It returns a pointer to the descriptor.
  * The log item MUST have a corresponding descriptor in the given
- * transaction.	 This routine does not return NULL, it panics.
+ * transaction.  This routine does not return NULL, it panics.
  *
  * The descriptor pointer is kept in the log item's li_desc field.
  * Just return it.
  */
 /*ARGSUSED*/
 xfs_log_item_desc_t *
-xfs_trans_find_item(xfs_trans_t *tp, xfs_log_item_t *lip)
+xfs_trans_find_item(xfs_trans_t	*tp, xfs_log_item_t *lip)
 {
 	ASSERT(lip->li_desc != NULL);
 
@@ -450,7 +454,7 @@
 
 /*
  * This is called to add the given busy item to the transaction's
- * list of busy items.	It must find a free busy item descriptor
+ * list of busy items.  It must find a free busy item descriptor
  * or allocate a new one and add the item to that descriptor.
  * The function returns a pointer to busy descriptor used to point
  * to the new busy entry.  The log busy entry will now point to its new
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_trans_priv.h linux-2.5.68-bk12/fs/xfs/xfs_trans_priv.h
--- linux-2.5.68-bk11/fs/xfs/xfs_trans_priv.h	2003-04-19 19:50:49.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_trans_priv.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_TRANS_PRIV_H__
-#define __XFS_TRANS_PRIV_H__
+#define	__XFS_TRANS_PRIV_H__
 
 struct xfs_log_item;
 struct xfs_log_item_desc;
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_trans_space.h linux-2.5.68-bk12/fs/xfs/xfs_trans_space.h
--- linux-2.5.68-bk11/fs/xfs/xfs_trans_space.h	2003-04-19 19:49:22.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_trans_space.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -35,71 +35,71 @@
 /*
  * Components of space reservations.
  */
-#define XFS_MAX_CONTIG_EXTENTS_PER_BLOCK(mp)	\
+#define XFS_MAX_CONTIG_EXTENTS_PER_BLOCK(mp)    \
 		(((mp)->m_alloc_mxr[0]) - ((mp)->m_alloc_mnr[0]))
-#define XFS_EXTENTADD_SPACE_RES(mp,w)	(XFS_BM_MAXLEVELS(mp,w) - 1)
+#define	XFS_EXTENTADD_SPACE_RES(mp,w)	(XFS_BM_MAXLEVELS(mp,w) - 1)
 #define XFS_NEXTENTADD_SPACE_RES(mp,b,w)\
 	(((b + XFS_MAX_CONTIG_EXTENTS_PER_BLOCK(mp) - 1) / \
 	  XFS_MAX_CONTIG_EXTENTS_PER_BLOCK(mp)) * \
 	  XFS_EXTENTADD_SPACE_RES(mp,w))
-#define XFS_DAENTER_1B(mp,w)	((w) == XFS_DATA_FORK ? (mp)->m_dirblkfsbs : 1)
-#define XFS_DAENTER_DBS(mp,w)	\
+#define	XFS_DAENTER_1B(mp,w)	((w) == XFS_DATA_FORK ? (mp)->m_dirblkfsbs : 1)
+#define	XFS_DAENTER_DBS(mp,w)	\
 	(XFS_DA_NODE_MAXDEPTH + \
 	 ((XFS_DIR_IS_V2(mp) && (w) == XFS_DATA_FORK) ? 2 : 0))
-#define XFS_DAENTER_BLOCKS(mp,w)	\
+#define	XFS_DAENTER_BLOCKS(mp,w)	\
 	(XFS_DAENTER_1B(mp,w) * XFS_DAENTER_DBS(mp,w))
-#define XFS_DAENTER_BMAP1B(mp,w)	\
+#define	XFS_DAENTER_BMAP1B(mp,w)	\
 	XFS_NEXTENTADD_SPACE_RES(mp, XFS_DAENTER_1B(mp, w), w)
-#define XFS_DAENTER_BMAPS(mp,w)		\
+#define	XFS_DAENTER_BMAPS(mp,w)		\
 	(XFS_DAENTER_DBS(mp,w) * XFS_DAENTER_BMAP1B(mp,w))
-#define XFS_DAENTER_SPACE_RES(mp,w)	\
+#define	XFS_DAENTER_SPACE_RES(mp,w)	\
 	(XFS_DAENTER_BLOCKS(mp,w) + XFS_DAENTER_BMAPS(mp,w))
-#define XFS_DAREMOVE_SPACE_RES(mp,w)	XFS_DAENTER_BMAPS(mp,w)
-#define XFS_DIRENTER_MAX_SPLIT(mp,nl)	\
+#define	XFS_DAREMOVE_SPACE_RES(mp,w)	XFS_DAENTER_BMAPS(mp,w)
+#define	XFS_DIRENTER_MAX_SPLIT(mp,nl)	\
 	(((mp)->m_sb.sb_blocksize == 512 && \
 	  XFS_DIR_IS_V1(mp) && \
 	  (nl) >= XFS_DIR_LEAF_CAN_DOUBLE_SPLIT_LEN) ? 2 : 1)
-#define XFS_DIRENTER_SPACE_RES(mp,nl)	\
+#define	XFS_DIRENTER_SPACE_RES(mp,nl)	\
 	(XFS_DAENTER_SPACE_RES(mp, XFS_DATA_FORK) * \
 	 XFS_DIRENTER_MAX_SPLIT(mp,nl))
-#define XFS_DIRREMOVE_SPACE_RES(mp)	\
+#define	XFS_DIRREMOVE_SPACE_RES(mp)	\
 	XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK)
-#define XFS_IALLOC_SPACE_RES(mp)	\
+#define	XFS_IALLOC_SPACE_RES(mp)	\
 	(XFS_IALLOC_BLOCKS(mp) + XFS_IN_MAXLEVELS(mp)-1)
 
 /*
  * Space reservation values for various transactions.
  */
-#define XFS_ADDAFORK_SPACE_RES(mp)	\
+#define	XFS_ADDAFORK_SPACE_RES(mp)	\
 	((mp)->m_dirblkfsbs + \
 	 (XFS_DIR_IS_V1(mp) ? 0 : XFS_DAENTER_BMAP1B(mp, XFS_DATA_FORK)))
-#define XFS_ATTRRM_SPACE_RES(mp)	\
+#define	XFS_ATTRRM_SPACE_RES(mp)	\
 	XFS_DAREMOVE_SPACE_RES(mp, XFS_ATTR_FORK)
 /* This macro is not used - see inline code in xfs_attr_set */
-#define XFS_ATTRSET_SPACE_RES(mp, v)	\
+#define	XFS_ATTRSET_SPACE_RES(mp, v)	\
 	(XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK) + XFS_B_TO_FSB(mp, v))
-#define XFS_CREATE_SPACE_RES(mp,nl)	\
+#define	XFS_CREATE_SPACE_RES(mp,nl)	\
 	(XFS_IALLOC_SPACE_RES(mp) + XFS_DIRENTER_SPACE_RES(mp,nl))
-#define XFS_DIOSTRAT_SPACE_RES(mp, v)	\
+#define	XFS_DIOSTRAT_SPACE_RES(mp, v)	\
 	(XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK) + (v))
-#define XFS_GROWFS_SPACE_RES(mp)	\
+#define	XFS_GROWFS_SPACE_RES(mp)	\
 	(2 * XFS_AG_MAXLEVELS(mp))
-#define XFS_GROWFSRT_SPACE_RES(mp,b)	\
+#define	XFS_GROWFSRT_SPACE_RES(mp,b)	\
 	((b) + XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK))
-#define XFS_LINK_SPACE_RES(mp,nl)	\
+#define	XFS_LINK_SPACE_RES(mp,nl)	\
 	XFS_DIRENTER_SPACE_RES(mp,nl)
-#define XFS_MKDIR_SPACE_RES(mp,nl)	\
+#define	XFS_MKDIR_SPACE_RES(mp,nl)	\
 	(XFS_IALLOC_SPACE_RES(mp) + XFS_DIRENTER_SPACE_RES(mp,nl))
-#define XFS_QM_DQALLOC_SPACE_RES(mp)	\
+#define	XFS_QM_DQALLOC_SPACE_RES(mp)	\
 	(XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK) + \
 	 XFS_DQUOT_CLUSTER_SIZE_FSB)
-#define XFS_QM_QINOCREATE_SPACE_RES(mp) \
+#define	XFS_QM_QINOCREATE_SPACE_RES(mp)	\
 	XFS_IALLOC_SPACE_RES(mp)
-#define XFS_REMOVE_SPACE_RES(mp)	\
+#define	XFS_REMOVE_SPACE_RES(mp)	\
 	XFS_DIRREMOVE_SPACE_RES(mp)
-#define XFS_RENAME_SPACE_RES(mp,nl)	\
+#define	XFS_RENAME_SPACE_RES(mp,nl)	\
 	(XFS_DIRREMOVE_SPACE_RES(mp) + XFS_DIRENTER_SPACE_RES(mp,nl))
-#define XFS_SYMLINK_SPACE_RES(mp,nl,b)	\
+#define	XFS_SYMLINK_SPACE_RES(mp,nl,b)	\
 	(XFS_IALLOC_SPACE_RES(mp) + XFS_DIRENTER_SPACE_RES(mp,nl) + (b))
 
 #endif	/* __XFS_TRANS_SPACE_H__ */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_types.h linux-2.5.68-bk12/fs/xfs/xfs_types.h
--- linux-2.5.68-bk11/fs/xfs/xfs_types.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_types.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 #ifndef __XFS_TYPES_H__
-#define __XFS_TYPES_H__
+#define	__XFS_TYPES_H__
 
 #ifdef __KERNEL__
 
@@ -95,21 +95,21 @@
 #endif
 
 typedef __uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
-typedef __uint32_t	xfs_extlen_t;	/* extent length in blocks */
-typedef __uint32_t	xfs_agnumber_t; /* allocation group number */
+typedef	__uint32_t	xfs_extlen_t;	/* extent length in blocks */
+typedef	__uint32_t	xfs_agnumber_t;	/* allocation group number */
 typedef __int32_t	xfs_extnum_t;	/* # of extents in a file */
 typedef __int16_t	xfs_aextnum_t;	/* # extents in an attribute fork */
-typedef __int64_t	xfs_fsize_t;	/* bytes in a file */
+typedef	__int64_t	xfs_fsize_t;	/* bytes in a file */
 typedef __uint64_t	xfs_ufsize_t;	/* unsigned bytes in a file */
 
-typedef __int32_t	xfs_suminfo_t;	/* type of bitmap summary info */
-typedef __int32_t	xfs_rtword_t;	/* word type for bitmap manipulations */
+typedef	__int32_t	xfs_suminfo_t;	/* type of bitmap summary info */
+typedef	__int32_t	xfs_rtword_t;	/* word type for bitmap manipulations */
 
-typedef __int64_t	xfs_lsn_t;	/* log sequence number */
-typedef __int32_t	xfs_tid_t;	/* transaction identifier */
+typedef	__int64_t	xfs_lsn_t;	/* log sequence number */
+typedef	__int32_t	xfs_tid_t;	/* transaction identifier */
 
-typedef __uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
-typedef __uint32_t	xfs_dahash_t;	/* dir/attr hash value */
+typedef	__uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
+typedef	__uint32_t	xfs_dahash_t;	/* dir/attr hash value */
 
 typedef __uint16_t	xfs_prid_t;	/* prid_t truncated to 16bits in XFS */
 
@@ -119,23 +119,23 @@
  */
 typedef __uint64_t	xfs_dfsbno_t;	/* blockno in filesystem (agno|agbno) */
 typedef __uint64_t	xfs_drfsbno_t;	/* blockno in filesystem (raw) */
-typedef __uint64_t	xfs_drtbno_t;	/* extent (block) in realtime area */
-typedef __uint64_t	xfs_dfiloff_t;	/* block number in a file */
-typedef __uint64_t	xfs_dfilblks_t; /* number of blocks in a file */
+typedef	__uint64_t	xfs_drtbno_t;	/* extent (block) in realtime area */
+typedef	__uint64_t	xfs_dfiloff_t;	/* block number in a file */
+typedef	__uint64_t	xfs_dfilblks_t;	/* number of blocks in a file */
 
 /*
  * Memory based types are conditional.
  */
 #if XFS_BIG_FILESYSTEMS
-typedef __uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
-typedef __uint64_t	xfs_rfsblock_t; /* blockno in filesystem (raw) */
+typedef	__uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
+typedef __uint64_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
 typedef __uint64_t	xfs_rtblock_t;	/* extent (block) in realtime area */
-typedef __int64_t	xfs_srtblock_t; /* signed version of xfs_rtblock_t */
+typedef	__int64_t	xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
 #else
-typedef __uint32_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
-typedef __uint32_t	xfs_rfsblock_t; /* blockno in filesystem (raw) */
+typedef	__uint32_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
+typedef __uint32_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
 typedef __uint32_t	xfs_rtblock_t;	/* extent (block) in realtime area */
-typedef __int32_t	xfs_srtblock_t; /* signed version of xfs_rtblock_t */
+typedef	__int32_t	xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
 #endif
 typedef __uint64_t	xfs_fileoff_t;	/* block number in a file */
 typedef __int64_t	xfs_sfiloff_t;	/* signed block number in a file */
@@ -146,28 +146,28 @@
 /*
  * Null values for the types.
  */
-#define NULLDFSBNO	((xfs_dfsbno_t)-1)
-#define NULLDRFSBNO	((xfs_drfsbno_t)-1)
-#define NULLDRTBNO	((xfs_drtbno_t)-1)
-#define NULLDFILOFF	((xfs_dfiloff_t)-1)
-
-#define NULLFSBLOCK	((xfs_fsblock_t)-1)
-#define NULLRFSBLOCK	((xfs_rfsblock_t)-1)
-#define NULLRTBLOCK	((xfs_rtblock_t)-1)
-#define NULLFILEOFF	((xfs_fileoff_t)-1)
-
-#define NULLAGBLOCK	((xfs_agblock_t)-1)
-#define NULLAGNUMBER	((xfs_agnumber_t)-1)
-#define NULLEXTNUM	((xfs_extnum_t)-1)
+#define	NULLDFSBNO	((xfs_dfsbno_t)-1)
+#define	NULLDRFSBNO	((xfs_drfsbno_t)-1)
+#define	NULLDRTBNO	((xfs_drtbno_t)-1)
+#define	NULLDFILOFF	((xfs_dfiloff_t)-1)
+
+#define	NULLFSBLOCK	((xfs_fsblock_t)-1)
+#define	NULLRFSBLOCK	((xfs_rfsblock_t)-1)
+#define	NULLRTBLOCK	((xfs_rtblock_t)-1)
+#define	NULLFILEOFF	((xfs_fileoff_t)-1)
+
+#define	NULLAGBLOCK	((xfs_agblock_t)-1)
+#define	NULLAGNUMBER	((xfs_agnumber_t)-1)
+#define	NULLEXTNUM	((xfs_extnum_t)-1)
 
 #define NULLCOMMITLSN	((xfs_lsn_t)-1)
 
 /*
  * Max values for extlen, extnum, aextnum.
  */
-#define MAXEXTLEN	((xfs_extlen_t)0x001fffff)	/* 21 bits */
-#define MAXEXTNUM	((xfs_extnum_t)0x7fffffff)	/* signed int */
-#define MAXAEXTNUM	((xfs_aextnum_t)0x7fff)		/* signed short */
+#define	MAXEXTLEN	((xfs_extlen_t)0x001fffff)	/* 21 bits */
+#define	MAXEXTNUM	((xfs_extnum_t)0x7fffffff)	/* signed int */
+#define	MAXAEXTNUM	((xfs_aextnum_t)0x7fff)		/* signed short */
 
 /*
  * MAXNAMELEN is the length (including the terminating null) of
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_utils.c linux-2.5.68-bk12/fs/xfs/xfs_utils.c
--- linux-2.5.68-bk11/fs/xfs/xfs_utils.c	2003-04-19 19:51:16.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_utils.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,30 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_error.h"
+#include "xfs_quota.h"
+#include "xfs_rw.h"
+#include "xfs_itable.h"
+#include "xfs_utils.h"
 
 /*
  * xfs_get_dir_entry is used to get a reference to an inode given
@@ -191,7 +214,7 @@
 		/*
 		 * Normally, xfs_trans_commit releases all the locks.
 		 * We call bhold to hang on to the ialloc_context across
-		 * the commit.	Holding this buffer prevents any other
+		 * the commit.  Holding this buffer prevents any other
 		 * processes from doing any allocations in this
 		 * allocation group.
 		 */
@@ -371,9 +394,9 @@
 	    (ip->i_d.di_nlink > XFS_MAXLINK_1)) {
 		/*
 		 * The inode has increased its number of links beyond
-		 * what can fit in an old format inode.	 It now needs
+		 * what can fit in an old format inode.  It now needs
 		 * to be converted to a version 2 inode with a 32 bit
-		 * link count.	If this is the first inode in the file
+		 * link count.  If this is the first inode in the file
 		 * system to do this, then we need to bump the superblock
 		 * version number as well.
 		 */
@@ -385,7 +408,7 @@
 }
 
 /*
- * Try to truncate the given file to 0 length.	Currently called
+ * Try to truncate the given file to 0 length.  Currently called
  * only out of xfs_remove when it has to truncate a file to free
  * up space for the remove to proceed.
  */
@@ -428,7 +451,7 @@
 	}
 
 	/*
-	 * Follow the normal truncate locking protocol.	 Since we
+	 * Follow the normal truncate locking protocol.  Since we
 	 * hold the inode in the transaction, we know that it's number
 	 * of references will stay constant.
 	 */
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_utils.h linux-2.5.68-bk12/fs/xfs/xfs_utils.h
--- linux-2.5.68-bk11/fs/xfs/xfs_utils.h	2003-04-19 19:51:14.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_utils.h	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -34,7 +34,7 @@
 
 #define IRELE(ip)	VN_RELE(XFS_ITOV(ip))
 #define IHOLD(ip)	VN_HOLD(XFS_ITOV(ip))
-#define ITRACE(ip)	vn_trace_ref(XFS_ITOV(ip), __FILE__, __LINE__, \
+#define	ITRACE(ip)	vn_trace_ref(XFS_ITOV(ip), __FILE__, __LINE__, \
 				(inst_t *)__return_address)
 
 extern int xfs_rename (bhv_desc_t *, vname_t *, vnode_t *, vname_t *, cred_t *);
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_vfsops.c linux-2.5.68-bk12/fs/xfs/xfs_vfsops.c
--- linux-2.5.68-bk11/fs/xfs/xfs_vfsops.c	2003-04-19 19:48:54.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_vfsops.c	2003-05-04 04:41:51.000000000 -0700
@@ -13,7 +13,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -32,7 +32,44 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_alloc.h"
+#include "xfs_ialloc.h"
+#include "xfs_alloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_ag.h"
+#include "xfs_error.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_rw.h"
+#include "xfs_buf_item.h"
+#include "xfs_extfree_item.h"
+#include "xfs_quota.h"
+#include "xfs_dmapi.h"
+#include "xfs_dir2_trace.h"
+#include "xfs_acl.h"
+#include "xfs_attr.h"
+#include "xfs_clnt.h"
+#include "xfs_log_priv.h"
 
 STATIC int xfs_sync(bhv_desc_t *, int, cred_t *);
 
@@ -49,23 +86,21 @@
 	extern kmem_zone_t	*xfs_efd_zone;
 	extern kmem_zone_t	*xfs_efi_zone;
 	extern kmem_zone_t	*xfs_dabuf_zone;
-	extern mutex_t		xfs_uuidtabmon;
 #ifdef DEBUG_NOT
-	extern ktrace_t		*xfs_alloc_trace_buf;
-	extern ktrace_t		*xfs_bmap_trace_buf;
-	extern ktrace_t		*xfs_bmbt_trace_buf;
-	extern ktrace_t		*xfs_dir_trace_buf;
-	extern ktrace_t		*xfs_attr_trace_buf;
-	extern ktrace_t		*xfs_dir2_trace_buf;
+	extern ktrace_t	        *xfs_alloc_trace_buf;
+	extern ktrace_t	        *xfs_bmap_trace_buf;
+	extern ktrace_t	        *xfs_bmbt_trace_buf;
+	extern ktrace_t	        *xfs_dir_trace_buf;
+	extern ktrace_t	        *xfs_attr_trace_buf;
+	extern ktrace_t	        *xfs_dir2_trace_buf;
 #endif	/* DEBUG */
 #ifdef XFS_DABUF_DEBUG
-	extern lock_t		xfs_dabuf_global_lock;
+	extern lock_t	        xfs_dabuf_global_lock;
 #endif
 
 #ifdef XFS_DABUF_DEBUG
 	spinlock_init(&xfs_dabuf_global_lock, "xfsda");
 #endif
-	mutex_init(&xfs_uuidtabmon, MUTEX_DEFAULT, "xfs_uuidtab");
 
 	/*
 	 * Initialize all of the zone allocators we use.
@@ -180,7 +215,7 @@
 
 /*
  * xfs_start_flags
- * 
+ *
  * This function fills in xfs_mount_t fields based on mount args.
  * Note: the superblock has _not_ yet been read in.
  */
@@ -205,7 +240,7 @@
 	if (ap->logbufs != 0 && ap->logbufs != -1 &&
 	    (ap->logbufs < XLOG_NUM_ICLOGS ||
 	     ap->logbufs > XLOG_MAX_ICLOGS)) {
-		cmn_err(CE_WARN, 
+		cmn_err(CE_WARN,
 			"XFS: invalid logbufs value: %d [not %d-%d]",
 			ap->logbufs, XLOG_NUM_ICLOGS, XLOG_MAX_ICLOGS);
 		return XFS_ERROR(EINVAL);
@@ -564,6 +599,46 @@
 	return XFS_ERROR(error);
 }
 
+STATIC int
+xfs_mntupdate(
+	bhv_desc_t			*bdp,
+	int				*flags,
+	struct xfs_mount_args		*args)
+{
+	struct vfs	*vfsp = bhvtovfs(bdp);
+	xfs_mount_t	*mp = XFS_BHVTOM(bdp);
+	int		pincount, error;
+
+	if (args->flags & XFSMNT_NOATIME)
+		mp->m_flags |= XFS_MOUNT_NOATIME;
+	else
+		mp->m_flags &= ~XFS_MOUNT_NOATIME;
+
+	if (!(vfsp->vfs_flag & VFS_RDONLY)) {
+		VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error);
+	}
+
+	if (*flags & MS_RDONLY) {
+		pagebuf_delwri_flush(mp->m_ddev_targp, 0, NULL);
+		xfs_finish_reclaim_all(mp);
+
+		do {
+			VFS_SYNC(vfsp, SYNC_ATTR|SYNC_WAIT, NULL, error);
+			pagebuf_delwri_flush(mp->m_ddev_targp, PBDF_WAIT,
+								&pincount);
+		} while (pincount);
+
+		/* Ok now write out an unmount record */
+		xfs_log_unmount_write(mp);
+		xfs_unmountfs_writesb(mp);
+		vfsp->vfs_flag |= VFS_RDONLY;
+	} else {
+		vfsp->vfs_flag &= ~VFS_RDONLY;
+	}
+
+	return 0;
+}
+
 /*
  * xfs_unmount_flush implements a set of flush operation on special
  * inodes, which are needed as a separate set of operations so that
@@ -573,7 +648,7 @@
 xfs_unmount_flush(
 	xfs_mount_t	*mp,		/* Mount structure we are getting
 					   rid of. */
-	int		relocation)	/* Called from vfs relocation. */
+	int             relocation)	/* Called from vfs relocation. */
 {
 	xfs_inode_t	*rip = mp->m_rootip;
 	xfs_inode_t	*rbmip;
@@ -651,8 +726,8 @@
  * xfs_root extracts the root vnode from a vfs.
  *
  * vfsp -- the vfs struct for the desired file system
- * vpp	-- address of the caller's vnode pointer which should be
- *	   set to the desired fs root vnode
+ * vpp  -- address of the caller's vnode pointer which should be
+ *         set to the desired fs root vnode
  */
 STATIC int
 xfs_root(
@@ -733,24 +808,24 @@
  * vfs_sync() so that items at the tail of the log are always moving out.
  *
  * Flags:
- *	SYNC_BDFLUSH - We're being called from vfs_sync() so we don't want
+ *      SYNC_BDFLUSH - We're being called from vfs_sync() so we don't want
  *		       to sleep if we can help it.  All we really need
  *		       to do is ensure that the log is synced at least
  *		       periodically.  We also push the inodes and
  *		       superblock if we can lock them without sleeping
  *			and they are not pinned.
- *	SYNC_ATTR    - We need to flush the inodes.  If SYNC_BDFLUSH is not
+ *      SYNC_ATTR    - We need to flush the inodes.  If SYNC_BDFLUSH is not
  *		       set, then we really want to lock each inode and flush
  *		       it.
- *	SYNC_WAIT    - All the flushes that take place in this call should
+ *      SYNC_WAIT    - All the flushes that take place in this call should
  *		       be synchronous.
- *	SYNC_DELWRI  - This tells us to push dirty pages associated with
- *		       inodes.	SYNC_WAIT and SYNC_BDFLUSH are used to
+ *      SYNC_DELWRI  - This tells us to push dirty pages associated with
+ *		       inodes.  SYNC_WAIT and SYNC_BDFLUSH are used to
  *		       determine if they should be flushed sync, async, or
  *		       delwri.
- *	SYNC_CLOSE   - This flag is passed when the system is being
+ *      SYNC_CLOSE   - This flag is passed when the system is being
  *		       unmounted.  We should sync and invalidate everthing.
- *	SYNC_FSDATA  - This indicates that the caller would like to make
+ *      SYNC_FSDATA  - This indicates that the caller would like to make
  *		       sure the superblock is safe on disk.  We can ensure
  *		       this by simply makeing sure the log gets flushed
  *		       if SYNC_BDFLUSH is set, and by actually writing it
@@ -774,23 +849,23 @@
  * xfs sync routine for internal use
  *
  * This routine supports all of the flags defined for the generic VFS_SYNC
- * interface as explained above under xys_sync.	 In the interests of not
+ * interface as explained above under xys_sync.  In the interests of not
  * changing interfaces within the 6.5 family, additional internallly-
  * required functions are specified within a separate xflags parameter,
  * only available by calling this routine.
  *
  * xflags:
- *	XFS_XSYNC_RELOC - Sync for relocation.	Don't try to get behavior
- *			  locks as this will cause you to hang.	 Not all
- *			  combinations of flags are necessarily supported
- *			  when this is specified.
+ *	XFS_XSYNC_RELOC - Sync for relocation.  Don't try to get behavior
+ *                        locks as this will cause you to hang.  Not all
+ *                        combinations of flags are necessarily supported
+ *                        when this is specified.
  */
 int
 xfs_syncsub(
 	xfs_mount_t	*mp,
 	int		flags,
-	int		xflags,
-	int		*bypassed)
+	int             xflags,
+	int             *bypassed)
 {
 	xfs_inode_t	*ip = NULL;
 	xfs_inode_t	*ip_next;
@@ -824,7 +899,7 @@
  * must be locked when this is called. After the call the list will no
  * longer be locked.
  */
-#define IPOINTER_INSERT(ip, mp) { \
+#define IPOINTER_INSERT(ip, mp)	{ \
 		ASSERT(ipointer_in == B_FALSE); \
 		ipointer->ip_mnext = ip->i_mnext; \
 		ipointer->ip_mprev = ip; \
@@ -841,7 +916,7 @@
  * the whole list. If we are the current head of the list then move the head
  * past us.
  */
-#define IPOINTER_REMOVE(ip, mp) { \
+#define IPOINTER_REMOVE(ip, mp)	{ \
 		ASSERT(ipointer_in == B_TRUE); \
 		if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \
 			ip = ipointer->ip_mnext; \
@@ -975,7 +1050,7 @@
 		 * then we can skip inodes for which it looks like
 		 * there is nothing to do.  Since we don't have the
 		 * inode locked this is racey, but these are periodic
-		 * calls so it doesn't matter.	For the others we want
+		 * calls so it doesn't matter.  For the others we want
 		 * to know for sure, so we at least try to lock them.
 		 */
 		if (flags & SYNC_BDFLUSH) {
@@ -1002,7 +1077,7 @@
 		 * lock in xfs_ireclaim() after the inode is pulled from
 		 * the mount list will sleep until we release it here.
 		 * This keeps the vnode from being freed while we reference
-		 * it.	It is also cheaper and simpler than actually doing
+		 * it.  It is also cheaper and simpler than actually doing
 		 * a vn_get() for every inode we touch here.
 		 */
 		if (xfs_ilock_nowait(ip, lock_flags) == 0) {
@@ -1066,7 +1141,7 @@
 			 *
 			 * We don't set the VREMAPPING bit in the vnode
 			 * here, because we don't hold the vnode lock
-			 * exclusively.	 It doesn't really matter, though,
+			 * exclusively.  It doesn't really matter, though,
 			 * because we only come here when we're shutting
 			 * down anyway.
 			 */
@@ -1281,7 +1356,7 @@
 			/*
 			 * If we had to take a reference on the vnode
 			 * above, then wait until after we've unlocked
-			 * the inode to release the reference.	This is
+			 * the inode to release the reference.  This is
 			 * because we can be already holding the inode
 			 * lock when VN_RELE() calls xfs_inactive().
 			 *
@@ -1496,12 +1571,246 @@
 }
 
 
+#define MNTOPT_LOGBUFS	"logbufs"	/* number of XFS log buffers */
+#define MNTOPT_LOGBSIZE	"logbsize"	/* size of XFS log buffers */
+#define MNTOPT_LOGDEV	"logdev"	/* log device */
+#define MNTOPT_RTDEV	"rtdev"		/* realtime I/O device */
+#define MNTOPT_BIOSIZE	"biosize"	/* log2 of preferred buffered io size */
+#define MNTOPT_WSYNC	"wsync"		/* safe-mode nfs compatible mount */
+#define MNTOPT_INO64	"ino64"		/* force inodes into 64-bit range */
+#define MNTOPT_NOALIGN	"noalign"	/* turn off stripe alignment */
+#define MNTOPT_SUNIT	"sunit"		/* data volume stripe unit */
+#define MNTOPT_SWIDTH	"swidth"	/* data volume stripe width */
+#define MNTOPT_NOUUID	"nouuid"	/* ignore filesystem UUID */
+#define MNTOPT_MTPT	"mtpt"		/* filesystem mount point */
+#define MNTOPT_NORECOVERY   "norecovery"   /* don't run XFS recovery */
+#define MNTOPT_NOLOGFLUSH   "nologflush"   /* don't hard flush on log writes */
+#define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */
+
+
+int
+xfs_parseargs(
+	struct bhv_desc		*bhv,
+	char			*options,
+	struct xfs_mount_args	*args,
+	int			update)
+{
+	struct vfs		*vfsp = bhvtovfs(bhv);
+	char			*this_char, *value, *eov;
+	int			dsunit, dswidth, vol_dsunit, vol_dswidth;
+	int			iosize;
+
+	if (!options)
+		return 0;
+
+	iosize = dsunit = dswidth = vol_dsunit = vol_dswidth = 0;
+
+	while ((this_char = strsep(&options, ",")) != NULL) {
+		if (!*this_char)
+			continue;
+		if ((value = strchr(this_char, '=')) != NULL)
+			*value++ = 0;
+
+		if (!strcmp(this_char, MNTOPT_LOGBUFS)) {
+			if (!value || !*value) {
+				printk("XFS: %s option requires an argument\n",
+					MNTOPT_LOGBUFS);
+				return -EINVAL;
+			}
+			args->logbufs = simple_strtoul(value, &eov, 10);
+		} else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) {
+			int	last, in_kilobytes = 0;
+
+			if (!value || !*value) {
+				printk("XFS: %s option requires an argument\n",
+					MNTOPT_LOGBSIZE);
+				return -EINVAL;
+			}
+			last = strlen(value) - 1;
+			if (value[last] == 'K' || value[last] == 'k') {
+				in_kilobytes = 1;
+				value[last] = '\0';
+			}
+			args->logbufsize = simple_strtoul(value, &eov, 10);
+			if (in_kilobytes)
+				args->logbufsize <<= 10;
+		} else if (!strcmp(this_char, MNTOPT_LOGDEV)) {
+			if (!value || !*value) {
+				printk("XFS: %s option requires an argument\n",
+					MNTOPT_LOGDEV);
+				return -EINVAL;
+			}
+			strncpy(args->logname, value, MAXNAMELEN);
+		} else if (!strcmp(this_char, MNTOPT_MTPT)) {
+			if (!value || !*value) {
+				printk("XFS: %s option requires an argument\n",
+					MNTOPT_MTPT);
+				return -EINVAL;
+			}
+			strncpy(args->mtpt, value, MAXNAMELEN);
+		} else if (!strcmp(this_char, MNTOPT_RTDEV)) {
+			if (!value || !*value) {
+				printk("XFS: %s option requires an argument\n",
+					MNTOPT_RTDEV);
+				return -EINVAL;
+			}
+			strncpy(args->rtname, value, MAXNAMELEN);
+		} else if (!strcmp(this_char, MNTOPT_BIOSIZE)) {
+			if (!value || !*value) {
+				printk("XFS: %s option requires an argument\n",
+					MNTOPT_BIOSIZE); 
+				return -EINVAL;
+			}
+			iosize = simple_strtoul(value, &eov, 10);
+			args->flags |= XFSMNT_IOSIZE;
+			args->iosizelog = (uint8_t) iosize;
+		} else if (!strcmp(this_char, MNTOPT_WSYNC)) {
+			args->flags |= XFSMNT_WSYNC;
+		} else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) {
+			args->flags |= XFSMNT_OSYNCISOSYNC;
+		} else if (!strcmp(this_char, MNTOPT_NORECOVERY)) {
+			args->flags |= XFSMNT_NORECOVERY;
+		} else if (!strcmp(this_char, MNTOPT_INO64)) {
+			args->flags |= XFSMNT_INO64;
+#ifndef XFS_BIG_FILESYSTEMS
+			printk("XFS: %s option not allowed on this system\n",
+				MNTOPT_INO64);
+			return -EINVAL;
+#endif
+		} else if (!strcmp(this_char, MNTOPT_NOALIGN)) {
+			args->flags |= XFSMNT_NOALIGN;
+		} else if (!strcmp(this_char, MNTOPT_SUNIT)) {
+			if (!value || !*value) {
+				printk("XFS: %s option requires an argument\n",
+					MNTOPT_SUNIT);
+				return -EINVAL;
+			}
+			dsunit = simple_strtoul(value, &eov, 10);
+		} else if (!strcmp(this_char, MNTOPT_SWIDTH)) {
+			if (!value || !*value) {
+				printk("XFS: %s option requires an argument\n",
+					MNTOPT_SWIDTH);
+				return -EINVAL;
+			}
+			dswidth = simple_strtoul(value, &eov, 10);
+		} else if (!strcmp(this_char, MNTOPT_NOUUID)) {
+			args->flags |= XFSMNT_NOUUID;
+		} else if (!strcmp(this_char, MNTOPT_NOLOGFLUSH)) {
+			args->flags |= XFSMNT_NOLOGFLUSH;
+		} else if (!strcmp(this_char, "osyncisdsync")) {
+			/* no-op, this is now the default */
+printk("XFS: osyncisdsync is now the default, option is deprecated.\n");
+		} else if (!strcmp(this_char, "irixsgid")) {
+printk("XFS: irixsgid is now a sysctl(2) variable, option is deprecated.\n");
+		} else {
+			printk("XFS: unknown mount option [%s].\n", this_char);
+			return -EINVAL;
+		}
+	}
+
+	if (args->flags & XFSMNT_NORECOVERY) {
+		if ((vfsp->vfs_flag & VFS_RDONLY) == 0) {
+			printk("XFS: no-recovery mounts must be read-only.\n");
+			return -EINVAL;
+		}
+	}
+
+	if ((args->flags & XFSMNT_NOALIGN) && (dsunit || dswidth)) {
+		printk(
+	"XFS: sunit and swidth options incompatible with the noalign option\n");
+		return -EINVAL;
+	}
+
+	if ((dsunit && !dswidth) || (!dsunit && dswidth)) {
+		printk("XFS: sunit and swidth must be specified together\n");
+		return -EINVAL;
+	}
+
+	if (dsunit && (dswidth % dsunit != 0)) {
+		printk(
+	"XFS: stripe width (%d) must be a multiple of the stripe unit (%d)\n",
+			dswidth, dsunit);
+		return -EINVAL;
+	}
+
+	if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) {
+		if (dsunit) {
+			args->sunit = dsunit;
+			args->flags |= XFSMNT_RETERR;
+		} else {
+			args->sunit = vol_dsunit;
+		}
+		dswidth ? (args->swidth = dswidth) :
+			  (args->swidth = vol_dswidth);
+	} else {
+		args->sunit = args->swidth = 0;
+	}
+
+	return 0;
+}
+
+int
+xfs_showargs(
+	struct bhv_desc		*bhv,
+	struct seq_file		*m)
+{
+	static struct proc_xfs_info {
+		int	flag;
+		char	*str;
+	} xfs_info[] = {
+		/* the few simple ones we can get from the mount struct */
+		{ XFS_MOUNT_NOALIGN,		"," MNTOPT_NOALIGN },
+		{ XFS_MOUNT_NORECOVERY,		"," MNTOPT_NORECOVERY },
+		{ XFS_MOUNT_OSYNCISOSYNC,	"," MNTOPT_OSYNCISOSYNC },
+		{ XFS_MOUNT_NOUUID,		"," MNTOPT_NOUUID },
+		{ 0, NULL }
+	};
+	struct proc_xfs_info	*xfs_infop;
+	struct xfs_mount	*mp = XFS_BHVTOM(bhv);
+	char			b[BDEVNAME_SIZE];
+
+	for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
+		if (mp->m_flags & xfs_infop->flag)
+			seq_puts(m, xfs_infop->str);
+	}
+
+	if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE)
+		seq_printf(m, "," MNTOPT_BIOSIZE "=%d", mp->m_writeio_log);
+
+	if (mp->m_logbufs > 0)
+		seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs);
+
+	if (mp->m_logbsize > 0)
+		seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize);
+
+	if (mp->m_ddev_targp->pbr_dev != mp->m_logdev_targp->pbr_dev)
+		seq_printf(m, "," MNTOPT_LOGDEV "=%s",
+				bdevname(mp->m_logdev_targp->pbr_bdev, b));
+
+	if (mp->m_rtdev_targp &&
+	    mp->m_ddev_targp->pbr_dev != mp->m_rtdev_targp->pbr_dev)
+		seq_printf(m, "," MNTOPT_RTDEV "=%s",
+				bdevname(mp->m_rtdev_targp->pbr_bdev, b));
+
+	if (mp->m_dalign > 0)
+		seq_printf(m, "," MNTOPT_SUNIT "=%d",
+				(int)XFS_FSB_TO_BB(mp, mp->m_dalign));
+
+	if (mp->m_swidth > 0)
+		seq_printf(m, "," MNTOPT_SWIDTH "=%d",
+				(int)XFS_FSB_TO_BB(mp, mp->m_swidth));
+
+	return 0;
+}
+
+
 vfsops_t xfs_vfsops = {
 	BHV_IDENTITY_INIT(VFS_BHV_XFS,VFS_POSITION_XFS),
 	.vfs_parseargs		= xfs_parseargs,
 	.vfs_showargs		= xfs_showargs,
 	.vfs_mount		= xfs_mount,
 	.vfs_unmount		= xfs_unmount,
+	.vfs_mntupdate		= xfs_mntupdate,
 	.vfs_root		= xfs_root,
 	.vfs_statvfs		= xfs_statvfs,
 	.vfs_sync		= xfs_sync,
diff -urN linux-2.5.68-bk11/fs/xfs/xfs_vnodeops.c linux-2.5.68-bk12/fs/xfs/xfs_vnodeops.c
--- linux-2.5.68-bk11/fs/xfs/xfs_vnodeops.c	2003-04-19 19:51:22.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfs_vnodeops.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,7 +30,45 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
+#include "xfs.h"
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_itable.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_alloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode_item.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_attr.h"
+#include "xfs_rw.h"
+#include "xfs_error.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_quota.h"
+#include "xfs_utils.h"
+#include "xfs_trans_space.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_dmapi.h"
+#include "xfs_mac.h"
+#include "xfs_log_priv.h"
 
 
 /*
@@ -46,7 +84,7 @@
 
 /*
  * For xfs, we check that the file isn't too big to be opened by this kernel.
- * No other open action is required for regular files.	Devices are handled
+ * No other open action is required for regular files.  Devices are handled
  * through the specfs file system, pipes through fifofs.  Device and
  * fifo vnodes are "wrapped" by specfs and fifofs vnodes, respectively,
  * when a new vnode is first looked up or created.
@@ -227,7 +265,9 @@
 		((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ?
 			XFS_XFLAG_REALTIME : 0) |
 		((ip->i_d.di_flags & XFS_DIFLAG_PREALLOC) ?
-			XFS_XFLAG_PREALLOC : 0);
+			XFS_XFLAG_PREALLOC : 0) |
+		(XFS_IFORK_Q(ip) ?
+			XFS_XFLAG_HASATTR : 0);
 	vap->va_extsize = ip->i_d.di_extsize << mp->m_sb.sb_blocklog;
 	vap->va_nextents =
 		(ip->i_df.if_flags & XFS_IFEXTENTS) ?
@@ -607,10 +647,10 @@
 	}
 
 	/*
-	 * Now we can make the changes.	 Before we join the inode
+	 * Now we can make the changes.  Before we join the inode
 	 * to the transaction, if XFS_AT_SIZE is set then take care of
 	 * the part of the truncation that must be done without the
-	 * inode lock.	This needs to be done before joining the inode
+	 * inode lock.  This needs to be done before joining the inode
 	 * to the transaction, because the inode cannot be unlocked
 	 * once it is a part of the transaction.
 	 */
@@ -917,14 +957,14 @@
 	uio_t		*uiop,
 	cred_t		*credp)
 {
-	xfs_inode_t	*ip;
+	xfs_inode_t     *ip;
 	int		count;
 	xfs_off_t	offset;
 	int		pathlen;
 	vnode_t		*vp;
 	int		error = 0;
 	xfs_mount_t	*mp;
-	int		nmaps;
+	int             nmaps;
 	xfs_bmbt_irec_t mval[SYMLINK_MAPS];
 	xfs_daddr_t	d;
 	int		byte_cnt;
@@ -970,7 +1010,7 @@
 	}
 	else {
 		/*
-		 * Symlink not inline.	Call bmap to get it in.
+		 * Symlink not inline.  Call bmap to get it in.
 		 */
 		nmaps = SYMLINK_MAPS;
 
@@ -1051,7 +1091,7 @@
 
 	syncall = error = error2 = 0;
 
-	if (stop == -1)	 {
+	if (stop == -1)  {
 		ASSERT(start >= 0);
 		if (start == 0)
 			syncall = 1;
@@ -1097,9 +1137,9 @@
 	 * because it has to change some field in the inode core
 	 * (typically nextents or nblocks).  That assumption
 	 * implies that any transactions against an inode will
-	 * catch any non-transactional updates.	 If inode-altering
+	 * catch any non-transactional updates.  If inode-altering
 	 * transactions exist that violate this assumption, the
-	 * code breaks.	 Right now, it figures that if the involved
+	 * code breaks.  Right now, it figures that if the involved
 	 * update_* field is clear and the inode is unpinned, the
 	 * inode is clean.  Either it's been flushed or it's been
 	 * committed and the commit has hit the disk unpinning the inode.
@@ -1177,7 +1217,7 @@
 
 #if 0
 /*
- * This is a utility routine for xfs_inactive.	It is called when a
+ * This is a utility routine for xfs_inactive.  It is called when a
  * transaction attempting to free up the disk space for a file encounters
  * an error.  It cancels the old transaction and starts up a new one
  * to be used to free up the inode.  It also sets the inode size and extent
@@ -1239,11 +1279,11 @@
 	xfs_fileoff_t	last_fsb;
 	xfs_filblks_t	map_len;
 	int		nimaps;
-	xfs_bmbt_irec_t imap;
+	xfs_bmbt_irec_t	imap;
 
 	/*
 	 * Figure out if there are any blocks beyond the end
-	 * of the file.	 If not, then there is nothing to do.
+	 * of the file.  If not, then there is nothing to do.
 	 */
 	end_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)ip->i_d.di_size));
 	last_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAX_FILE_OFFSET);
@@ -1335,10 +1375,10 @@
 	int		done;
 	int		error;
 	xfs_fsblock_t	first_block;
-	xfs_bmap_free_t free_list;
+	xfs_bmap_free_t	free_list;
 	int		i;
 	xfs_mount_t	*mp;
-	xfs_bmbt_irec_t mval[SYMLINK_MAPS];
+	xfs_bmbt_irec_t	mval[SYMLINK_MAPS];
 	int		nmaps;
 	xfs_trans_t	*ntp;
 	int		size;
@@ -1350,7 +1390,7 @@
 	/*
 	 * We're freeing a symlink that has some
 	 * blocks allocated to it.  Free the
-	 * blocks here.	 We know that we've got
+	 * blocks here.  We know that we've got
 	 * either 1 or 2 extents and that we can
 	 * free them all in one bunmapi call.
 	 */
@@ -1788,7 +1828,7 @@
 	if (error) {
 		/*
 		 * If we fail to free the inode, shut down.  The cancel
-		 * might do that, we need to make sure.	 Otherwise the
+		 * might do that, we need to make sure.  Otherwise the
 		 * inode might be lost for a long time or forever.
 		 */
 		if (!XFS_FORCED_SHUTDOWN(mp)) {
@@ -1859,7 +1899,7 @@
 }
 
 
-#define XFS_CREATE_NEW_MAXTRIES 10000
+#define	XFS_CREATE_NEW_MAXTRIES	10000
 
 /*
  * xfs_create (create a new file).
@@ -1875,11 +1915,11 @@
 	char			*name = VNAME(dentry);
 	vnode_t			*dir_vp;
 	xfs_inode_t		*dp, *ip;
-	vnode_t			*vp=NULL;
+	vnode_t		        *vp=NULL;
 	xfs_trans_t		*tp;
-	xfs_mount_t		*mp;
+	xfs_mount_t	        *mp;
 	xfs_dev_t		rdev;
-	int			error;
+	int                     error;
 	xfs_bmap_free_t		free_list;
 	xfs_fsblock_t		first_block;
 	boolean_t		dp_joined_to_trans;
@@ -1940,7 +1980,7 @@
 	resblks = XFS_CREATE_SPACE_RES(mp, namelen);
 	/*
 	 * Initially assume that the file does not exist and
-	 * reserve the resources for that case.	 If that is not
+	 * reserve the resources for that case.  If that is not
 	 * the case we'll drop the one we have and get a more
 	 * appropriate transaction later.
 	 */
@@ -2340,10 +2380,10 @@
 }
 
 #ifdef	DEBUG
-#define REMOVE_DEBUG_TRACE(x)	{remove_which_error_return = (x);}
+#define	REMOVE_DEBUG_TRACE(x)	{remove_which_error_return = (x);}
 int remove_which_error_return = 0;
 #else /* ! DEBUG */
-#define REMOVE_DEBUG_TRACE(x)
+#define	REMOVE_DEBUG_TRACE(x)
 #endif	/* ! DEBUG */
 
 
@@ -2359,12 +2399,12 @@
 {
 	vnode_t			*dir_vp;
 	char			*name = VNAME(dentry);
-	xfs_inode_t		*dp, *ip;
-	xfs_trans_t		*tp = NULL;
+	xfs_inode_t             *dp, *ip;
+	xfs_trans_t             *tp = NULL;
 	xfs_mount_t		*mp;
-	int			error = 0;
-	xfs_bmap_free_t		free_list;
-	xfs_fsblock_t		first_block;
+	int                     error = 0;
+	xfs_bmap_free_t         free_list;
+	xfs_fsblock_t           first_block;
 	int			cancel_flags;
 	int			committed;
 	int			dm_di_mode = 0;
@@ -2567,7 +2607,7 @@
  error_rele:
 	/*
 	 * In this case make sure to not release the inode until after
-	 * the current transaction is aborted.	Releasing it beforehand
+	 * the current transaction is aborted.  Releasing it beforehand
 	 * can cause us to go to xfs_inactive and start a recursive
 	 * transaction which can easily deadlock with the current one.
 	 */
@@ -2597,8 +2637,8 @@
 	xfs_mount_t		*mp;
 	xfs_inode_t		*ips[2];
 	int			error;
-	xfs_bmap_free_t		free_list;
-	xfs_fsblock_t		first_block;
+	xfs_bmap_free_t         free_list;
+	xfs_fsblock_t           first_block;
 	int			cancel_flags;
 	int			committed;
 	vnode_t			*target_dir_vp;
@@ -2765,7 +2805,7 @@
 	cred_t			*credp)
 {
 	char			*dir_name = VNAME(dentry);
-	xfs_inode_t		*dp;
+	xfs_inode_t             *dp;
 	xfs_inode_t		*cdp;	/* inode of created dir */
 	vnode_t			*cvp;	/* vnode of created dir */
 	xfs_trans_t		*tp;
@@ -2774,8 +2814,8 @@
 	int			cancel_flags;
 	int			error;
 	int			committed;
-	xfs_bmap_free_t		free_list;
-	xfs_fsblock_t		first_block;
+	xfs_bmap_free_t         free_list;
+	xfs_fsblock_t           first_block;
 	vnode_t			*dir_vp;
 	boolean_t		dp_joined_to_trans;
 	boolean_t		created = B_FALSE;
@@ -2869,7 +2909,7 @@
 	 * create the directory inode.
 	 */
 	rdev = (vap->va_mask & XFS_AT_RDEV) ? vap->va_rdev : 0;
-	error = xfs_dir_ialloc(&tp, dp, 
+	error = xfs_dir_ialloc(&tp, dp,
 			MAKEIMODE(vap->va_type,vap->va_mode), 2,
 			rdev, credp, prid, resblks > 0,
 		&cdp, NULL);
@@ -2998,13 +3038,13 @@
 	cred_t			*credp)
 {
 	char			*name = VNAME(dentry);
-	xfs_inode_t		*dp;
-	xfs_inode_t		*cdp;	/* child directory */
-	xfs_trans_t		*tp;
+	xfs_inode_t             *dp;
+	xfs_inode_t             *cdp;   /* child directory */
+	xfs_trans_t             *tp;
 	xfs_mount_t		*mp;
-	int			error;
-	xfs_bmap_free_t		free_list;
-	xfs_fsblock_t		first_block;
+	int                     error;
+	xfs_bmap_free_t         free_list;
+	xfs_fsblock_t           first_block;
 	int			cancel_flags;
 	int			committed;
 	vnode_t			*dir_vp;
@@ -3038,7 +3078,7 @@
 
 	/*
 	 * We need to get a reference to cdp before we get our log
-	 * reservation.	 The reason for this is that we cannot call
+	 * reservation.  The reason for this is that we cannot call
 	 * xfs_iget for an inode for which we do not have a reference
 	 * once we've acquired a log reservation.  This is because the
 	 * inode we are trying to get might be in xfs_inactive going
@@ -3112,7 +3152,7 @@
 	if (dp != cdp) {
 		/*
 		 * Only increment the parent directory vnode count if
-		 * we didn't bump it in looking up cdp.	 The only time
+		 * we didn't bump it in looking up cdp.  The only time
 		 * we don't bump it is when we're looking up ".".
 		 */
 		VN_HOLD(dir_vp);
@@ -3335,9 +3375,9 @@
 	 * Check component lengths of the target path name.
 	 */
 	pathlen = strlen(target_path);
-	if (pathlen >= MAXPATHLEN)	/* total string too long */
+	if (pathlen >= MAXPATHLEN)      /* total string too long */
 		return XFS_ERROR(ENAMETOOLONG);
-	if (pathlen >= MAXNAMELEN) {	/* is any component too long? */
+	if (pathlen >= MAXNAMELEN) {    /* is any component too long? */
 		int len, total;
 		char *path;
 
@@ -3663,7 +3703,7 @@
 	bhv_desc_t	*bdp,
 	vrwlock_t	locktype)
 {
-	xfs_inode_t	*ip;
+	xfs_inode_t     *ip;
 	vnode_t		*vp;
 
 	vp = BHV_TO_VNODE(bdp);
@@ -3707,7 +3747,7 @@
 
 	if (flags & FLUSH_LOG) {
 		xfs_inode_log_item_t *iip = ip->i_itemp;
- 
+
 		if (iip && iip->ili_last_lsn) {
 			xlog_t	*log = mp->m_log;
 			xfs_lsn_t	sync_lsn;
@@ -3782,7 +3822,7 @@
 	u_int16_t	state,
 	cred_t		*credp)
 {
-	xfs_inode_t	*ip;
+	xfs_inode_t     *ip;
 	xfs_trans_t	*tp;
 	xfs_mount_t	*mp;
 	int		error;
@@ -3806,7 +3846,7 @@
 	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
 
 	ip->i_iocore.io_dmevmask = ip->i_d.di_dmevmask = evmask;
-	ip->i_iocore.io_dmstate	 = ip->i_d.di_dmstate  = state;
+	ip->i_iocore.io_dmstate  = ip->i_d.di_dmstate  = state;
 
 	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
 	IHOLD(ip);
@@ -3990,21 +4030,21 @@
 				ip = ip->i_mnext;
 				continue;
 			}
-	
+
 			/*
 			 * It's up to our caller to purge the root
 			 * and quota vnodes later.
 			 */
 			vp = XFS_ITOV_NULL(ip);
-	
+
 			if (!vp) {
-				XFS_MOUNT_IUNLOCK(mp);	
+				XFS_MOUNT_IUNLOCK(mp);
 				xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC);
 				purged = 1;
 				break;
 			}
 		} while (ip != mp->m_inodes);
-	
+
 		done = !purged;
 	}
 
@@ -4014,7 +4054,7 @@
 
 /*
  * xfs_alloc_file_space()
- *	This routine allocates disk space for the given file.
+ *      This routine allocates disk space for the given file.
  *
  *	If alloc_type == 0, this request is for an ALLOCSP type
  *	request which will change the file size.  In this case, no
@@ -4027,8 +4067,8 @@
  *	length.
  *
  * RETURNS:
- *	 0 on success
- *	errno on error
+ *       0 on success
+ *      errno on error
  *
  */
 int
@@ -4087,14 +4127,14 @@
 	imapp = &imaps[0];
 	reccount = 1;
 	xfs_bmapi_flags = XFS_BMAPI_WRITE | (alloc_type ? XFS_BMAPI_PREALLOC : 0);
-	startoffset_fsb = XFS_B_TO_FSBT(mp, offset);
+	startoffset_fsb	= XFS_B_TO_FSBT(mp, offset);
 	allocatesize_fsb = XFS_B_TO_FSB(mp, count);
 
 	/*	Generate a DMAPI event if needed.	*/
 	if (alloc_type != 0 && offset < ip->i_d.di_size &&
 			(attr_flags&ATTR_DMI) == 0  &&
 			DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) {
-		xfs_off_t	    end_dmi_offset;
+		xfs_off_t           end_dmi_offset;
 
 		end_dmi_offset = offset+len;
 		if (end_dmi_offset > ip->i_d.di_size)
@@ -4297,14 +4337,14 @@
 
 /*
  * xfs_free_file_space()
- *	This routine frees disk space for the given file.
+ *      This routine frees disk space for the given file.
  *
  *	This routine is only called by xfs_change_file_space
  *	for an UNRESVSP type call.
  *
  * RETURNS:
- *	 0 on success
- *	errno on error
+ *       0 on success
+ *      errno on error
  *
  */
 STATIC int
@@ -4343,7 +4383,7 @@
 	if (len <= 0)	/* if nothing being freed */
 		return error;
 	rt = (ip->i_d.di_flags & XFS_DIFLAG_REALTIME);
-	startoffset_fsb = XFS_B_TO_FSB(mp, offset);
+	startoffset_fsb	= XFS_B_TO_FSB(mp, offset);
 	end_dmi_offset = offset + len;
 	endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset);
 
@@ -4495,13 +4535,13 @@
 
 /*
  * xfs_change_file_space()
- *	This routine allocates or frees disk space for the given file.
- *	The user specified parameters are checked for alignment and size
- *	limitations.
+ *      This routine allocates or frees disk space for the given file.
+ *      The user specified parameters are checked for alignment and size
+ *      limitations.
  *
  * RETURNS:
- *	 0 on success
- *	errno on error
+ *       0 on success
+ *      errno on error
  *
  */
 int
diff -urN linux-2.5.68-bk11/fs/xfs/xfsidbg.c linux-2.5.68-bk12/fs/xfs/xfsidbg.c
--- linux-2.5.68-bk11/fs/xfs/xfsidbg.c	2003-04-19 19:50:35.000000000 -0700
+++ linux-2.5.68-bk12/fs/xfs/xfsidbg.c	2003-05-04 04:41:51.000000000 -0700
@@ -11,7 +11,7 @@
  *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
- * or the like.	 Any license provided herein, whether implied or
+ * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
@@ -30,9 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#include <xfs.h>
-#include <xfs_log_recover.h>
-#include "quota/xfs_qm.h"
+#include "xfs.h"
 #include "pagebuf/page_buf_internal.h"
 
 #include <linux/ctype.h>
@@ -41,7 +39,49 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 
-MODULE_AUTHOR("SGI <sgi.com>");
+#include "xfs_macros.h"
+#include "xfs_types.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_dmapi.h"
+#include "xfs_mount.h"
+#include "xfs_alloc.h"
+#include "xfs_ag.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_buf_item.h"
+#include "xfs_extfree_item.h"
+#include "xfs_inode_item.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_da_btree.h"
+#include "xfs_attr.h"
+#include "xfs_attr_leaf.h"
+#include "xfs_dir_leaf.h"
+#include "xfs_dir2_data.h"
+#include "xfs_dir2_leaf.h"
+#include "xfs_dir2_block.h"
+#include "xfs_dir2_node.h"
+#include "xfs_dir2_trace.h"
+#include "xfs_log_priv.h"
+#include "xfs_log_recover.h"
+#include "xfs_rw.h"
+#include "xfs_bit.h"
+#include "xfs_quota.h"
+#include "xfs_log_recover.h"
+#include "quota/xfs_qm.h"
+
+MODULE_AUTHOR("Silicon Graphics, Inc.");
 MODULE_DESCRIPTION("Additional kdb commands for debugging XFS");
 MODULE_LICENSE("GPL");
 
@@ -1398,9 +1438,9 @@
 #ifdef	CONFIG_XFS_VNODE_TRACING
 	kdb_printf("   v_trace 0x%p\n", vp->v_trace);
 #endif	/* CONFIG_XFS_VNODE_TRACING */
-        
+
 	kdb_printf("   v_vfsp 0x%p v_number %Lx\n",
-	        vp->v_vfsp, vp->v_number);
+		vp->v_vfsp, vp->v_number);
 }
 
 
@@ -1645,7 +1685,7 @@
 					ip->i_size);
 
 	kdb_printf(
-		" i_mode = 0x%x	 i_nlink = %d  i_rdev = 0x%x i_state = 0x%lx\n",
+		" i_mode = 0x%x  i_nlink = %d  i_rdev = 0x%x i_state = 0x%lx\n",
 					ip->i_mode, ip->i_nlink,
 					kdev_t_to_nr(ip->i_rdev), ip->i_state);
 
@@ -1732,11 +1772,9 @@
 /*  0 */ "READ", "WRITE", "MAPPED", "PARTIAL", "ASYNC",
 /*  5 */ "NONE", "DELWRI", "FREED", "SYNC", "MAPPABLE",
 /* 10 */ "STALE", "FS_MANAGED", "INVALID12", "LOCK", "TRYLOCK",
-/* 15 */ "FILE_ALLOCATE", "DONT_BLOCK", "DIRECT", "INVALID18", "LOCKABLE",
-/* 20 */ "PRIVATE_BH", "ALL_PAGES_MAPPED", "ADDR_ALLOCATED", "MEM_ALLOCATED",
-	 "FORCEIO",
-/* 25 */ "FLUSH", "READ_AHEAD", "INVALID27", "INVALID28", "INVALID29",
-/* 30 */ "INVALID30", "INVALID31",
+/* 15 */ "DONT_BLOCK", "LOCKABLE", "PRIVATE_BH", "ALL_PAGES_MAPPED", 
+	 "ADDR_ALLOCATED",
+/* 20 */ "MEM_ALLOCATED", "FORCEIO", "FLUSH", "READ_AHEAD",
 	 NULL };
 
 static char	*pbm_flag_vals[] = {
@@ -1756,7 +1794,7 @@
 	for (index = 0; flags && mapping[index]; flags >>= 1, index++) {
 		if (flags & 1) {
 			if ((offset + strlen(mapping[index]) + 1) >= 80) {
-				strcat(buffer, "\n	      ");
+				strcat(buffer, "\n            ");
 				offset = 12;
 			} else if (offset > 12) {
 				strcat(buffer, " ");
@@ -1865,9 +1903,9 @@
 
 	/* 0x20 */
 	struct iovec **io_iovec;	/* iovec list indexed by iovec_index */
-	loff_t io_iovec_offset; /* offset into current iovec. */
+	loff_t io_iovec_offset;	/* offset into current iovec. */
 	int io_iovec_index;	/* current iovec being processed */
-	unsigned int io_sshift; /* sector bit shift */
+	unsigned int io_sshift;	/* sector bit shift */
 	loff_t io_i_size;	/* size of the file */
 } pb_io_desc_t;
 
@@ -1910,7 +1948,7 @@
 kdbm_pbmap(int argc, const char **argv, const char **envp,
 	struct pt_regs *regs)
 {
-	page_buf_bmap_t pbm;
+	page_buf_bmap_t	pbm;
 	unsigned long addr;
 	long	offset=0;
 	int nextarg;
@@ -1943,7 +1981,7 @@
 # endif
 #include "pagebuf/page_buf_trace.h"
 
-#define EV_SIZE (sizeof(event_names)/sizeof(char *))
+#define EV_SIZE	(sizeof(event_names)/sizeof(char *))
 
 void
 pb_trace_core(
@@ -1954,7 +1992,7 @@
 {
 	extern struct pagebuf_trace_buf pb_trace;
 	int i, total, end;
-	pagebuf_trace_t *trace;
+	pagebuf_trace_t	*trace;
 	char	*event;
 	char	value[10];
 
@@ -2013,9 +2051,9 @@
 			   trace->misc);
 		kdb_symbol_print((unsigned int)trace->ra, NULL,
 			KDB_SP_SPACEB|KDB_SP_PAREN|KDB_SP_NEWLINE);
-		kdb_printf("	offset 0x%Lx size 0x%x task 0x%p\n",
+		kdb_printf("    offset 0x%Lx size 0x%x task 0x%p\n",
 			   trace->offset, trace->size, trace->task);
-		kdb_printf("	flags: %s\n",
+		kdb_printf("    flags: %s\n",
 			   pb_flags(trace->flags));
 	}
 }
@@ -2101,7 +2139,7 @@
   {  "vn",	kdbm_vn,	"<vnode>", "Dump inode/vnode/trace"},
   {  "vnode",	kdbm_vnode,	"<vnode>", "Dump vnode"},
 #ifdef	CONFIG_XFS_VNODE_TRACING
-  {  "vntrace", kdbm_vntrace,	"<vntrace>", "Dump vnode Trace"},
+  {  "vntrace",	kdbm_vntrace,	"<vntrace>", "Dump vnode Trace"},
   {  "vntraceaddr",	kdbm_vntraceaddr, "<vntrace>", "Dump vnode Trace by Address"},
 #endif	/* CONFIG_XFS_VNODE_TRACING */
   {  "xagf",	kdbm_xfs_xagf,	"<agf>",
@@ -2116,21 +2154,21 @@
   {  "xalmtrc",	kdbm_xfs_xalmtrace,	"<xfs_mount_t>",
 				"Dump XFS alloc mount-point trace" },
 #endif
-  {  "xattrcx", kdbm_xfs_xattrcontext,	"<xfs_attr_list_context_t>",
+  {  "xattrcx",	kdbm_xfs_xattrcontext,	"<xfs_attr_list_context_t>",
 				"Dump XFS attr_list context struct"},
-  {  "xattrlf", kdbm_xfs_xattrleaf,	"<xfs_attr_leafblock_t>",
+  {  "xattrlf",	kdbm_xfs_xattrleaf,	"<xfs_attr_leafblock_t>",
 				"Dump XFS attribute leaf block"},
-  {  "xattrsf", kdbm_xfs_xattrsf,	"<xfs_attr_shortform_t>",
+  {  "xattrsf",	kdbm_xfs_xattrsf,	"<xfs_attr_shortform_t>",
 				"Dump XFS attribute shortform"},
   {  "xbirec",	kdbm_xfs_xbirec,	"<xfs_bmbt_irec_t",
 				"Dump XFS bmap incore record"},
-  {  "xbmalla", kdbm_xfs_xbmalla,	"<xfs_bmalloca_t>",
+  {  "xbmalla",	kdbm_xfs_xbmalla,	"<xfs_bmalloca_t>",
 				"Dump XFS bmalloc args structure"},
   {  "xbrec",	kdbm_xfs_xbrec,		"<xfs_bmbt_rec_64_t",
 				"Dump XFS bmap record"},
   {  "xbroot",	kdbm_xfs_xbroot,	"<xfs_inode_t>",
 				"Dump XFS bmap btree root (data)"},
-  {  "xbroota", kdbm_xfs_xbroota,	"<xfs_inode_t>",
+  {  "xbroota",	kdbm_xfs_xbroota,	"<xfs_inode_t>",
 				"Dump XFS bmap btree root (attr)"},
   {  "xbtcur",	kdbm_xfs_xbtcur,	"<xfs_btree_cur_t>",
 				"Dump XFS btree cursor"},
@@ -2138,17 +2176,17 @@
 				"Dump XFS data from a buffer"},
   {  "xchash",	kdbm_xfs_xchash,	"<xfs_mount_t>",
 				"Dump XFS cluster hash"},
-  {  "xchlist", kdbm_xfs_xchashlist,	"<xfs_chashlist_t>",
+  {  "xchlist",	kdbm_xfs_xchashlist,	"<xfs_chashlist_t>",
 				"Dump XFS cluster hash list"},
-  {  "xd2free", kdbm_xfs_xdir2free,	"<xfs_dir2_free_t>",
+  {  "xd2free",	kdbm_xfs_xdir2free,	"<xfs_dir2_free_t>",
 				"Dump XFS directory v2 freemap"},
-  {  "xdaargs", kdbm_xfs_xdaargs,	"<xfs_da_args_t>",
+  {  "xdaargs",	kdbm_xfs_xdaargs,	"<xfs_da_args_t>",
 				"Dump XFS dir/attr args structure"},
   {  "xdabuf",	kdbm_xfs_xdabuf,	"<xfs_dabuf_t>",
 				"Dump XFS dir/attr buf structure"},
-  {  "xdanode", kdbm_xfs_xdanode,	"<xfs_da_intnode_t>",
+  {  "xdanode",	kdbm_xfs_xdanode,	"<xfs_da_intnode_t>",
 				"Dump XFS dir/attr node block"},
-  {  "xdastat", kdbm_xfs_xdastate,	"<xfs_da_state_t>",
+  {  "xdastat",	kdbm_xfs_xdastate,	"<xfs_da_state_t>",
 				"Dump XFS dir/attr state_blk struct"},
   {  "xdelay",	kdbm_xfs_delayed_blocks,	"<xfs_mount_t>",
 				"Dump delayed block totals"},
@@ -2156,17 +2194,17 @@
 				"Dump XFS directory leaf block"},
   {  "xdirsf",	kdbm_xfs_xdirsf,	"<xfs_dir_shortform_t>",
 				"Dump XFS directory shortform"},
-  {  "xdir2sf", kdbm_xfs_xdir2sf,	"<xfs_dir2_sf_t>",
+  {  "xdir2sf",	kdbm_xfs_xdir2sf,	"<xfs_dir2_sf_t>",
 				"Dump XFS directory v2 shortform"},
-  {  "xdiskdq", kdbm_xfs_xqm_diskdq,	"<xfs_disk_dquot_t>",
+  {  "xdiskdq",	kdbm_xfs_xqm_diskdq,	"<xfs_disk_dquot_t>",
 				"Dump XFS ondisk dquot (quota) struct"},
   {  "xdqatt",	kdbm_xfs_xqm_dqattached_inos,	"<xfs_mount_t>",
 				 "All incore inodes with dquots"},
-  {  "xdqinfo", kdbm_xfs_xqm_tpdqinfo,	"<xfs_trans_t>",
+  {  "xdqinfo",	kdbm_xfs_xqm_tpdqinfo,	"<xfs_trans_t>",
 				"Dump dqinfo structure of a trans"},
   {  "xdquot",	kdbm_xfs_xqm_dquot,	"<xfs_dquot_t>",
 				"Dump XFS dquot (quota) structure"},
-  {  "xexlist", kdbm_xfs_xexlist,	"<xfs_inode_t>",
+  {  "xexlist",	kdbm_xfs_xexlist,	"<xfs_inode_t>",
 				"Dump XFS bmap extents in inode"},
   {  "xflist",	kdbm_xfs_xflist,	"<xfs_bmap_free_t>",
 				"Dump XFS to-be-freed extent list"},
@@ -2178,13 +2216,13 @@
 				"Dump XFS in-core log"},
   {  "xihash",	kdbm_xfs_xihash,	"<xfs_mount_t>",
 				"Dump XFS inode hash statistics"},
-  {  "xinodes", kdbm_xfs_xinodes,	"<xfs_mount_t>",
+  {  "xinodes",	kdbm_xfs_xinodes,	"<xfs_mount_t>",
 				"Dump XFS inodes per mount"},
   {  "xquiesce",kdbm_xfs_xinodes_quiesce, "<xfs_mount_t>",
 				"Dump non-quiesced XFS inodes per mount"},
-  {  "xl_rcit", kdbm_xfs_xlog_ritem,	"<xlog_recover_item_t>",
+  {  "xl_rcit",	kdbm_xfs_xlog_ritem,	"<xlog_recover_item_t>",
 				"Dump XFS recovery item"},
-  {  "xl_rctr", kdbm_xfs_xlog_rtrans,	"<xlog_recover_t>",
+  {  "xl_rctr",	kdbm_xfs_xlog_rtrans,	"<xlog_recover_t>",
 				"Dump XFS recovery transaction"},
   {  "xl_rctr2",kdbm_xfs_xlog_rtrans_entire,	"<xlog_recover_t>",
 				"Dump entire recovery transaction"},
@@ -2194,24 +2232,24 @@
 				"Dump XFS log"},
   {  "xlogcb",	kdbm_xfs_xiclogcb,	"<xlog_in_core_t>",
 				"Dump XFS in-core log callbacks"},
-  {  "xlogitm", kdbm_xfs_xlogitem,	"<xfs_log_item_t>",
+  {  "xlogitm",	kdbm_xfs_xlogitem,	"<xfs_log_item_t>",
 				"Dump XFS log item structure"},
   {  "xmount",	kdbm_xfs_xmount,	"<xfs_mount_t>",
 				"Dump XFS mount structure"},
   {  "xnode",	kdbm_xfs_xnode,		"<xfs_inode_t>",
 				"Dump XFS inode"},
-  {  "xiocore", kdbm_xfs_xcore,		"<xfs_iocore_t>",
+  {  "xiocore",	kdbm_xfs_xcore,		"<xfs_iocore_t>",
 				"Dump XFS iocore"},
   {  "xperag",	kdbm_xfs_xperag,	"<xfs_mount_t>",
 				"Dump XFS per-allocation group data"},
-  {  "xqinfo",	kdbm_xfs_xqm_qinfo,	"<xfs_mount_t>",
+  {  "xqinfo",  kdbm_xfs_xqm_qinfo,	"<xfs_mount_t>",
 				"Dump mount->m_quotainfo structure"},
 #ifdef	CONFIG_XFS_QUOTA
   {  "xqm",	kdbm_xfs_xqm,		"",
 				"Dump XFS quota manager structure"},
-  {  "xqmfree", kdbm_xfs_xqm_freelist,	"",
+  {  "xqmfree",	kdbm_xfs_xqm_freelist,	"",
 				"Dump XFS global freelist of dquots"},
-  {  "xqmhtab", kdbm_xfs_xqm_htab,	"",
+  {  "xqmhtab",	kdbm_xfs_xqm_htab,	"",
 				"Dump XFS hashtable of dquots"},
 #endif	/* CONFIG_XFS_QUOTA */
   {  "xqmplist",kdbm_xfs_xqm_mplist,	"<xfs_mount_t>",
@@ -2319,7 +2357,7 @@
  */
 static int
 xfs_alloc_trace_entry(ktrace_entry_t *ktep)
-{		  
+{
 	static char *modagf_flags[] = {
 		"magicnum",
 		"versionnum",
@@ -2348,10 +2386,10 @@
 	"agno %d agbno %d minlen %d maxlen %d mod %d prod %d minleft %d\n",
 			(__psunsigned_t)ktep->val[4],
 			(__psunsigned_t)ktep->val[5],
-			(__psunsigned_t)ktep->val[6], 
-			(__psunsigned_t)ktep->val[7], 
+			(__psunsigned_t)ktep->val[6],
+			(__psunsigned_t)ktep->val[7],
 			(__psunsigned_t)ktep->val[8],
-			(__psunsigned_t)ktep->val[9], 
+			(__psunsigned_t)ktep->val[9],
 			(__psunsigned_t)ktep->val[10]);
 		kdb_printf("total %d alignment %d len %d type %s otype %s\n",
 			(__psunsigned_t)ktep->val[11],
@@ -2535,7 +2573,7 @@
 			xfs_bmbt_disk_get_all((xfs_bmbt_rec_t *)r, &irec);
 			kdb_printf("rec %d startoff %Ld startblock %Lx blockcount %Ld flag %d\n",
 				i, irec.br_startoff,
-				(__uint64_t)irec.br_startblock, 
+				(__uint64_t)irec.br_startblock,
 				irec.br_blockcount, irec.br_state);
 		}
 	} else {
@@ -2616,7 +2654,7 @@
 		kdb_printf("buf 0x%p blkno 0x%Lx ", blip->bli_buf,
 			     blip->bli_format.blf_blkno);
 		printflags(blip->bli_flags, bli_flags, "flags:");
-		kdb_printf("\n	 ");
+		kdb_printf("\n   ");
 		xfsidbg_xbuf_real(blip->bli_buf, 1);
 		return;
 	}
@@ -2685,7 +2723,7 @@
 	kdb_printf("efd extents:\n");
 	ep = &(efdp->efd_format.efd_extents[0]);
 	for (i = 0; i < efdp->efd_next_extent; i++, ep++) {
-		kdb_printf("	block %Lx len %d\n",
+		kdb_printf("    block %Lx len %d\n",
 			ep->ext_start, ep->ext_len);
 	}
 }
@@ -2720,7 +2758,7 @@
 	kdb_printf("efi extents:\n");
 	ep = &(efip->efi_format.efi_extents[0]);
 	for (i = 0; i < efip->efi_next_extent; i++, ep++) {
-		kdb_printf("	block %Lx len %d\n",
+		kdb_printf("    block %Lx len %d\n",
 			ep->ext_start, ep->ext_len);
 	}
 }
@@ -2843,9 +2881,9 @@
 xfs_fmtuuid(uuid_t *uu)
 {
 	static char rval[40];
-	char	    *o		= rval;
-	char	    *i		= (unsigned char*)uu;
-	int	    b;
+	char        *o          = rval;
+	char        *i          = (unsigned char*)uu;
+	int         b;
 
 	for (b=0;b<16;b++) {
 	    o+=sprintf(o, "%02x", *i++);
@@ -3271,7 +3309,7 @@
 		k = ~(XFS_ATTR_LOCAL | XFS_ATTR_ROOT | XFS_ATTR_INCOMPLETE);
 		if ((e->flags & k) != 0)
 			kdb_printf("0x%x", e->flags & k);
-		kdb_printf(">\n	    name \"");
+		kdb_printf(">\n     name \"");
 		if (e->flags & XFS_ATTR_LOCAL) {
 			l = XFS_ATTR_LEAF_NAME_LOCAL(leaf, j);
 			for (k = 0; k < l->namelen; k++)
@@ -3367,7 +3405,7 @@
 
 	xfs_bmbt_get_all((xfs_bmbt_rec_t *)r, &irec);
 	kdb_printf("startoff %Ld startblock %Lx blockcount %Ld flag %d\n",
-		irec.br_startoff, (__uint64_t)irec.br_startblock, 
+		irec.br_startoff, (__uint64_t)irec.br_startblock,
 		irec.br_blockcount, irec.br_state);
 }
 
@@ -3574,7 +3612,7 @@
 			xfsidbg_xsb(sb, 1);
 		}
 	} else if ((dqb = d)->d_magic == XFS_DQUOT_MAGIC) {
-#define XFSIDBG_DQTYPESTR(d)	 \
+#define XFSIDBG_DQTYPESTR(d)     \
 	((INT_GET((d)->d_flags, ARCH_CONVERT) & XFS_DQ_USER) ? "USR" : \
 	((INT_GET((d)->d_flags, ARCH_CONVERT) & XFS_DQ_GROUP) ? "GRP" : "???"))
 		kdb_printf("Quota blk starting ID [%d], type %s at 0x%p\n",
@@ -4027,7 +4065,7 @@
 
 	kdb_printf("xlog_in_core/header at 0x%p/0x%p\n",
 		iclog, iclog->hic_data);
-	kdb_printf("magicno: %x	 cycle: %d  version: %d	 lsn: 0x%Lx\n",
+	kdb_printf("magicno: %x  cycle: %d  version: %d  lsn: 0x%Lx\n",
 		INT_GET(iclog->ic_header.h_magicno, ARCH_CONVERT), INT_GET(iclog->ic_header.h_cycle, ARCH_CONVERT),
 		INT_GET(iclog->ic_header.h_version, ARCH_CONVERT), INT_GET(iclog->ic_header.h_lsn, ARCH_CONVERT));
 	kdb_printf("tail_lsn: 0x%Lx  len: %d  prev_block: %d  num_ops: %d\n",
@@ -4035,13 +4073,13 @@
 		INT_GET(iclog->ic_header.h_prev_block, ARCH_CONVERT), INT_GET(iclog->ic_header.h_num_logops, ARCH_CONVERT));
 	kdb_printf("cycle_data: ");
 	for (i=0; i<(iclog->ic_size>>BBSHIFT); i++) {
-		kdb_printf("%x	", INT_GET(iclog->ic_header.h_cycle_data[i], ARCH_CONVERT));
+		kdb_printf("%x  ", INT_GET(iclog->ic_header.h_cycle_data[i], ARCH_CONVERT));
 	}
 	kdb_printf("\n");
 	kdb_printf("size: %d\n", INT_GET(iclog->ic_header.h_size, ARCH_CONVERT));
 	kdb_printf("\n");
 	kdb_printf("--------------------------------------------------\n");
-	kdb_printf("data: 0x%p	&forcesema: 0x%p  next: 0x%p bp: 0x%p\n",
+	kdb_printf("data: 0x%p  &forcesema: 0x%p  next: 0x%p bp: 0x%p\n",
 		iclog->ic_datap, &iclog->ic_forcesema, iclog->ic_next,
 		iclog->ic_bp);
 	kdb_printf("log: 0x%p  callb: 0x%p  callb_tail: 0x%p  roundoff: %d\n",
@@ -4217,7 +4255,7 @@
 	kdb_printf("&icloglock: 0x%p  tail_lsn: %s  last_sync_lsn: %s \n",
 		&log->l_icloglock, xfs_fmtlsn(&log->l_tail_lsn),
 		xfs_fmtlsn(&log->l_last_sync_lsn));
-	kdb_printf("mp: 0x%p  xbuf: 0x%p  roundoff: %d	l_covered_state: %s \n",
+	kdb_printf("mp: 0x%p  xbuf: 0x%p  roundoff: %d  l_covered_state: %s \n",
 		log->l_mp, log->l_xbuf, log->l_roundoff,
 			xfsidbg_get_cstate(log->l_covered_state));
 	kdb_printf("flags: ");
@@ -4235,7 +4273,7 @@
 		log->l_iclog_hsize, log->l_iclog_heads);
 	kdb_printf("&grant_lock: 0x%p  resHeadQ: 0x%p  wrHeadQ: 0x%p\n",
 		&log->l_grant_lock, log->l_reserve_headq, log->l_write_headq);
-	kdb_printf("GResCycle: %d  GResBytes: %d  GWrCycle: %d	GWrBytes: %d\n",
+	kdb_printf("GResCycle: %d  GResBytes: %d  GWrCycle: %d  GWrBytes: %d\n",
 		log->l_grant_reserve_cycle, log->l_grant_reserve_bytes,
 		log->l_grant_write_cycle, log->l_grant_write_bytes);
 	rbytes = log->l_grant_reserve_bytes + log->l_roundoff;
@@ -4397,9 +4435,9 @@
 	};
 
 	kdb_printf("xlog_ticket at 0x%p\n", tic);
-	kdb_printf("next: 0x%p	prev: 0x%p  tid: 0x%x  \n",
+	kdb_printf("next: 0x%p  prev: 0x%p  tid: 0x%x  \n",
 		tic->t_next, tic->t_prev, tic->t_tid);
-	kdb_printf("curr_res: %d  unit_res: %d	ocnt: %d  cnt: %d\n",
+	kdb_printf("curr_res: %d  unit_res: %d  ocnt: %d  cnt: %d\n",
 		tic->t_curr_res, tic->t_unit_res, (int)tic->t_ocnt,
 		(int)tic->t_cnt);
 	kdb_printf("clientid: %c  \n", tic->t_clientid);
@@ -4497,7 +4535,7 @@
 		"6-1-buf",	/* 7 */
 		"inode",	/* 8 */
 		"buf",		/* 9 */
-		"dquot",	/* 10 */
+		"dquot",        /* 10 */
 		0
 		};
 	static char *li_flags[] = {
@@ -4517,7 +4555,7 @@
 		kdb_printf("[%d] type %s ", count,
 			      lid_type[lip->li_type - XFS_LI_5_3_BUF + 1]);
 		printflags((uint)(lip->li_flags), li_flags, "flags:");
-		kdb_printf("  lsn %s\n	 ", xfs_fmtlsn(&(lip->li_lsn)));
+		kdb_printf("  lsn %s\n   ", xfs_fmtlsn(&(lip->li_lsn)));
 		switch (lip->li_type) {
 		case XFS_LI_BUF:
 			xfs_buf_item_print((xfs_buf_log_item_t *)lip, 1);
@@ -4559,7 +4597,7 @@
 	static char *xmount_flags[] = {
 		"WSYNC",	/* 0x0001 */
 		"INO64",	/* 0x0002 */
-		"RQCHK",	/* 0x0004 */
+		"RQCHK",        /* 0x0004 */
 		"FSCLEAN",	/* 0x0008 */
 		"FSSHUTDN",	/* 0x0010 */
 		"NOATIME",	/* 0x0020 */
@@ -4812,7 +4850,7 @@
 static void
 xfsidbg_xcore(xfs_iocore_t *io)
 {
-        kdb_printf("io_obj 0x%p io_flags 0x%x io_mount 0x%p\n",
+	kdb_printf("io_obj 0x%p io_flags 0x%x io_mount 0x%p\n",
 			io->io_obj, io->io_flags, io->io_mount);
 	kdb_printf("new_size %Lx\n", io->io_new_size);
 }
@@ -4889,7 +4927,7 @@
 				pag->pagf_flcount, pag->pagf_freeblks,
 				pag->pagf_longest, pag->pagf_metadata);
 		if (pag->pagi_init)
-			kdb_printf("	i_freecount %d i_inodeok %d\n",
+			kdb_printf("    i_freecount %d i_inodeok %d\n",
 				pag->pagi_freecount, pag->pagi_inodeok);
 		if (pag->pagf_init) {
 			for (busy = 0; busy < XFS_PAGB_NUM_SLOTS; busy++) {
@@ -4979,7 +5017,7 @@
 	printflags(dqp->dq_flags, qflags, "flags:");
 	kdb_printf("\nblkno 0x%llx\tboffset 0x%x\n",
 		(unsigned long long) dqp->q_blkno, (int) dqp->q_bufoffset);
-	kdb_printf("qlock 0x%p	flock 0x%p (%s) pincount 0x%x\n",
+	kdb_printf("qlock 0x%p  flock 0x%p (%s) pincount 0x%x\n",
 		&dqp->q_qlock,
 		&dqp->q_flock,
 		(valusema(&dqp->q_flock) <= 0) ? "LCK" : "UNLKD",
@@ -4999,7 +5037,7 @@
 	   kdb_printf( \
 	      "\t%d. [0x%p] \"%d (%s)\"\t blks = %d, inos = %d refs = %d\n", \
 			 ++i, dqp, (int) INT_GET(dqp->q_core.d_id, ARCH_CONVERT), \
-			 DQFLAGTO_TYPESTR(dqp),	     \
+			 DQFLAGTO_TYPESTR(dqp),      \
 			 (int) INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT), \
 			 (int) INT_GET(dqp->q_core.d_icount, ARCH_CONVERT), \
 			 (int) dqp->q_nrefs); }\
@@ -5007,7 +5045,7 @@
 }
 
 static void
-xfsidbg_xqm_dqattached_inos(xfs_mount_t *mp)
+xfsidbg_xqm_dqattached_inos(xfs_mount_t	*mp)
 {
 	xfs_inode_t	*ip;
 	int		n = 0;
@@ -5235,9 +5273,9 @@
 	static char *xtp_flags[] = {
 		"dirty",	/* 0x1 */
 		"sb_dirty",	/* 0x2 */
-		"perm_log_res", /* 0x4 */
-		"sync",		/* 0x08 */
-		"dq_dirty",	/* 0x10 */
+		"perm_log_res",	/* 0x4 */
+		"sync",         /* 0x08 */
+		"dq_dirty",     /* 0x10 */
 		0
 		};
 	static char *lid_flags[] = {
@@ -5281,14 +5319,14 @@
 	case XFS_TRANS_QM_SETQLIM:	kdb_printf("QM_SETQLIM");		break;
 	case XFS_TRANS_QM_DQCLUSTER:	kdb_printf("QM_DQCLUSTER");	break;
 	case XFS_TRANS_QM_QINOCREATE:	kdb_printf("QM_QINOCREATE");	break;
-	case XFS_TRANS_QM_QUOTAOFF_END: kdb_printf("QM_QOFF_END");		break;
+	case XFS_TRANS_QM_QUOTAOFF_END:	kdb_printf("QM_QOFF_END");		break;
 	case XFS_TRANS_SB_UNIT:		kdb_printf("SB_UNIT");		break;
 	case XFS_TRANS_FSYNC_TS:	kdb_printf("FSYNC_TS");		break;
 	case XFS_TRANS_GROWFSRT_ALLOC:	kdb_printf("GROWFSRT_ALLOC");	break;
 	case XFS_TRANS_GROWFSRT_ZERO:	kdb_printf("GROWFSRT_ZERO");	break;
 	case XFS_TRANS_GROWFSRT_FREE:	kdb_printf("GROWFSRT_FREE");	break;
 
-	default:			kdb_printf("0x%x", tp->t_type); break;
+	default:			kdb_printf("0x%x", tp->t_type);	break;
 	}
 	kdb_printf(" mount 0x%p\n", tp->t_mountp);
 	kdb_printf("flags ");
diff -urN linux-2.5.68-bk11/include/asm-i386/elf.h linux-2.5.68-bk12/include/asm-i386/elf.h
--- linux-2.5.68-bk11/include/asm-i386/elf.h	2003-04-19 19:50:08.000000000 -0700
+++ linux-2.5.68-bk12/include/asm-i386/elf.h	2003-05-04 04:41:52.000000000 -0700
@@ -101,7 +101,7 @@
  * for more of them, start the x86-specific ones at 32.
  */
 #define AT_SYSINFO		32
-#define AT_SYSINFO_EH_FRAME	33
+#define AT_SYSINFO_EHDR		33
 
 #ifdef __KERNEL__
 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
@@ -119,15 +119,56 @@
 #define ELF_CORE_SYNC dump_smp_unlazy_fpu
 #endif
 
-/* Offset from the beginning of the page where the .eh_frame information
-   for the code in the vsyscall page starts.  */
-#define EH_FRAME_OFFSET 96
+#define VSYSCALL_BASE	(__fix_to_virt(FIX_VSYSCALL))
+#define VSYSCALL_EHDR	((const struct elfhdr *) VSYSCALL_BASE)
+#define VSYSCALL_ENTRY	((unsigned long) &__kernel_vsyscall)
+extern void __kernel_vsyscall;
 
 #define ARCH_DLINFO						\
 do {								\
-		NEW_AUX_ENT(AT_SYSINFO, 0xffffe000);		\
-		NEW_AUX_ENT(AT_SYSINFO_EH_FRAME,		\
-			    0xffffe000 + EH_FRAME_OFFSET);	\
+		NEW_AUX_ENT(AT_SYSINFO,	VSYSCALL_ENTRY);	\
+		NEW_AUX_ENT(AT_SYSINFO_EHDR, VSYSCALL_BASE);	\
+} while (0)
+
+/*
+ * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
+ * extra segments containing the vsyscall DSO contents.  Dumping its
+ * contents makes post-mortem fully interpretable later without matching up
+ * the same kernel and hardware config to see what PC values meant.
+ * Dumping its extra ELF program headers includes all the other information
+ * a debugger needs to easily find how the vsyscall DSO was being used.
+ */
+#define ELF_CORE_EXTRA_PHDRS		(VSYSCALL_EHDR->e_phnum)
+#define ELF_CORE_WRITE_EXTRA_PHDRS					      \
+do {									      \
+	const struct elf_phdr *const vsyscall_phdrs =			      \
+		(const struct elf_phdr *) (VSYSCALL_BASE		      \
+					   + VSYSCALL_EHDR->e_phoff);	      \
+	int i;								      \
+	Elf32_Off ofs = 0;						      \
+	for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) {			      \
+		struct elf_phdr phdr = vsyscall_phdrs[i];		      \
+		if (phdr.p_type == PT_LOAD) {				      \
+			ofs = phdr.p_offset = offset;			      \
+			offset += phdr.p_filesz;			      \
+		}							      \
+		else							      \
+			phdr.p_offset += ofs;				      \
+		phdr.p_paddr = 0; /* match other core phdrs */		      \
+		DUMP_WRITE(&phdr, sizeof(phdr));			      \
+	}								      \
+} while (0)
+#define ELF_CORE_WRITE_EXTRA_DATA					      \
+do {									      \
+	const struct elf_phdr *const vsyscall_phdrs =			      \
+		(const struct elf_phdr *) (VSYSCALL_BASE		      \
+					   + VSYSCALL_EHDR->e_phoff);	      \
+	int i;								      \
+	for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) {			      \
+		if (vsyscall_phdrs[i].p_type == PT_LOAD)		      \
+			DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr,	      \
+				   vsyscall_phdrs[i].p_filesz);		      \
+	}								      \
 } while (0)
 
 #endif
diff -urN linux-2.5.68-bk11/include/asm-i386/pgalloc.h linux-2.5.68-bk12/include/asm-i386/pgalloc.h
--- linux-2.5.68-bk11/include/asm-i386/pgalloc.h	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk12/include/asm-i386/pgalloc.h	2003-05-04 04:41:52.000000000 -0700
@@ -20,11 +20,11 @@
  * Allocate and free page tables.
  */
 
-pgd_t *pgd_alloc(struct mm_struct *);
-void pgd_free(pgd_t *pgd);
+extern pgd_t *pgd_alloc(struct mm_struct *);
+extern void pgd_free(pgd_t *pgd);
 
-pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
-struct page *pte_alloc_one(struct mm_struct *, unsigned long);
+extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
+extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
 
 static inline void pte_free_kernel(pte_t *pte)
 {
diff -urN linux-2.5.68-bk11/include/asm-i386/pgtable-3level.h linux-2.5.68-bk12/include/asm-i386/pgtable-3level.h
--- linux-2.5.68-bk11/include/asm-i386/pgtable-3level.h	2003-04-19 19:50:37.000000000 -0700
+++ linux-2.5.68-bk12/include/asm-i386/pgtable-3level.h	2003-05-04 04:41:52.000000000 -0700
@@ -123,4 +123,6 @@
 #define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) })
 #define PTE_FILE_MAX_BITS       32
 
+extern struct kmem_cache_s *pae_pgd_cachep;
+
 #endif /* _I386_PGTABLE_3LEVEL_H */
diff -urN linux-2.5.68-bk11/include/asm-i386/pgtable.h linux-2.5.68-bk12/include/asm-i386/pgtable.h
--- linux-2.5.68-bk11/include/asm-i386/pgtable.h	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk12/include/asm-i386/pgtable.h	2003-05-04 04:41:52.000000000 -0700
@@ -41,13 +41,22 @@
 #ifndef __ASSEMBLY__
 #ifdef CONFIG_X86_PAE
 # include <asm/pgtable-3level.h>
+
+/*
+ * Need to initialise the X86 PAE caches
+ */
+extern void pgtable_cache_init(void);
+
 #else
 # include <asm/pgtable-2level.h>
-#endif
 
-void pgtable_cache_init(void);
+/*
+ * No page table caches to initialise
+ */
+#define pgtable_cache_init()	do { } while (0)
 
 #endif
+#endif
 
 #define PMD_SIZE	(1UL << PMD_SHIFT)
 #define PMD_MASK	(~(PMD_SIZE-1))
@@ -183,6 +192,7 @@
  * The following only work if pte_present() is true.
  * Undefined behaviour if not..
  */
+static inline int pte_user(pte_t pte)		{ return (pte).pte_low & _PAGE_USER; }
 static inline int pte_read(pte_t pte)		{ return (pte).pte_low & _PAGE_USER; }
 static inline int pte_exec(pte_t pte)		{ return (pte).pte_low & _PAGE_USER; }
 static inline int pte_dirty(pte_t pte)		{ return (pte).pte_low & _PAGE_DIRTY; }
diff -urN linux-2.5.68-bk11/include/asm-sparc/page.h linux-2.5.68-bk12/include/asm-sparc/page.h
--- linux-2.5.68-bk11/include/asm-sparc/page.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/include/asm-sparc/page.h	2003-05-04 04:41:53.000000000 -0700
@@ -24,7 +24,6 @@
 
 #ifdef __KERNEL__
 
-/* #include <asm/head.h> XXX */      /* for KERNBASE */
 #include <asm/btfixup.h>
 
 #ifndef __ASSEMBLY__
diff -urN linux-2.5.68-bk11/include/linux/elf.h linux-2.5.68-bk12/include/linux/elf.h
--- linux-2.5.68-bk11/include/linux/elf.h	2003-04-19 19:48:52.000000000 -0700
+++ linux-2.5.68-bk12/include/linux/elf.h	2003-05-04 04:41:53.000000000 -0700
@@ -29,8 +29,11 @@
 #define PT_NOTE    4
 #define PT_SHLIB   5
 #define PT_PHDR    6
+#define PT_LOOS	   0x60000000
+#define PT_HIOS	   0x6fffffff
 #define PT_LOPROC  0x70000000
 #define PT_HIPROC  0x7fffffff
+#define PT_GNU_EH_FRAME		0x6474e550
 #define PT_MIPS_REGINFO		0x70000000
 
 /* Flags in the e_flags field of the header */
diff -urN linux-2.5.68-bk11/include/linux/if_pppox.h linux-2.5.68-bk12/include/linux/if_pppox.h
--- linux-2.5.68-bk11/include/linux/if_pppox.h	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/include/linux/if_pppox.h	2003-05-04 04:41:53.000000000 -0700
@@ -140,8 +140,6 @@
 	int		(*create)(struct socket *sock);
 	int		(*ioctl)(struct socket *sock, unsigned int cmd,
 				 unsigned long arg);
-	int		(*release)(struct socket *sock);
-	void            (*sk_free)(struct sock *sk);
 	struct module	*owner;
 };
 
@@ -150,9 +148,6 @@
 extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
 extern int pppox_channel_ioctl(struct ppp_channel *pc, unsigned int cmd,
 			       unsigned long arg);
-extern struct sock *pppox_sk_alloc(struct socket *sock, int protocol,
-				   int priority, int zero_it,
-				   kmem_cache_t *slab);
 
 /* PPPoX socket states */
 enum {
diff -urN linux-2.5.68-bk11/include/linux/jhash.h linux-2.5.68-bk12/include/linux/jhash.h
--- linux-2.5.68-bk11/include/linux/jhash.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.5.68-bk12/include/linux/jhash.h	2003-05-04 04:41:53.000000000 -0700
@@ -0,0 +1,143 @@
+#ifndef _LINUX_JHASH_H
+#define _LINUX_JHASH_H
+
+/* jhash.h: Jenkins hash support.
+ *
+ * Copyright (C) 1996 Bob Jenkins (bob_jenkins@burtleburtle.net)
+ *
+ * http://burtleburtle.net/bob/hash/
+ *
+ * These are the credits from Bob's sources:
+ *
+ * lookup2.c, by Bob Jenkins, December 1996, Public Domain.
+ * hash(), hash2(), hash3, and mix() are externally useful functions.
+ * Routines to test the hash are included if SELF_TEST is defined.
+ * You can use this free for any purpose.  It has no warranty.
+ *
+ * Copyright (C) 2003 David S. Miller (davem@redhat.com)
+ *
+ * I've modified Bob's hash to be useful in the Linux kernel, and
+ * any bugs present are surely my fault.  -DaveM
+ */
+
+/* NOTE: Arguments are modified. */
+#define __jhash_mix(a, b, c) \
+{ \
+  a -= b; a -= c; a ^= (c>>13); \
+  b -= c; b -= a; b ^= (a<<8); \
+  c -= a; c -= b; c ^= (b>>13); \
+  a -= b; a -= c; a ^= (c>>12);  \
+  b -= c; b -= a; b ^= (a<<16); \
+  c -= a; c -= b; c ^= (b>>5); \
+  a -= b; a -= c; a ^= (c>>3);  \
+  b -= c; b -= a; b ^= (a<<10); \
+  c -= a; c -= b; c ^= (b>>15); \
+}
+
+/* The golden ration: an arbitrary value */
+#define JHASH_GOLDEN_RATIO	0x9e3779b9
+
+/* The most generic version, hashes an arbitrary sequence
+ * of bytes.  No alignment or length assumptions are made about
+ * the input key.
+ */
+static inline u32 jhash(void *key, u32 length, u32 initval)
+{
+	u32 a, b, c, len;
+	u8 *k = key;
+
+	len = length;
+	a = b = JHASH_GOLDEN_RATIO;
+	c = initval;
+
+	while (len >= 12) {
+		a += (k[0] +((u32)k[1]<<8) +((u32)k[2]<<16) +((u32)k[3]<<24));
+		b += (k[4] +((u32)k[5]<<8) +((u32)k[6]<<16) +((u32)k[7]<<24));
+		c += (k[8] +((u32)k[9]<<8) +((u32)k[10]<<16)+((u32)k[11]<<24));
+
+		__jhash_mix(a,b,c);
+
+		k += 12;
+		len -= 12;
+	}
+
+	c += length;
+	switch (len) {
+	case 11: c += ((u32)k[10]<<24);
+	case 10: c += ((u32)k[9]<<16);
+	case 9 : c += ((u32)k[8]<<8);
+	case 8 : b += ((u32)k[7]<<24);
+	case 7 : b += ((u32)k[6]<<16);
+	case 6 : b += ((u32)k[5]<<8);
+	case 5 : b += k[4];
+	case 4 : a += ((u32)k[3]<<24);
+	case 3 : a += ((u32)k[2]<<16);
+	case 2 : a += ((u32)k[1]<<8);
+	case 1 : a += k[0];
+	};
+
+	__jhash_mix(a,b,c);
+
+	return c;
+}
+
+/* A special optimized version that handles 1 or more of u32s.
+ * The length parameter here is the number of u32s in the key.
+ */
+static inline u32 jhash2(u32 *k, u32 length, u32 initval)
+{
+	u32 a, b, c, len;
+
+	a = b = JHASH_GOLDEN_RATIO;
+	c = initval;
+	len = length;
+
+	while (len >= 3) {
+		a += k[0];
+		b += k[1];
+		c += k[2];
+		__jhash_mix(a, b, c);
+		k += 3; len -= 3;
+	}
+
+	c += length * 4;
+
+	switch (len) {
+	case 2 : b += k[1];
+	case 1 : a += k[0];
+	};
+
+	__jhash_mix(a,b,c);
+
+	return c;
+}
+
+
+/* A special ultra-optimized versions that knows they are hashing exactly
+ * 3, 2 or 1 word(s).
+ *
+ * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally
+ *       done at the end is not done here.
+ */
+static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
+{
+	a += JHASH_GOLDEN_RATIO;
+	b += JHASH_GOLDEN_RATIO;
+	c += initval;
+
+	__jhash_mix(a, b, c);
+
+	return c;
+}
+
+static inline u32 jhash_2words(u32 a, u32 b, u32 initval)
+{
+	return jhash_3words(a, b, 0, initval);
+}
+
+static inline u32 jhash_1word(u32 a, u32 initval)
+{
+	return jhash_3words(a, 0, 0, initval);
+}
+
+#endif /* _LINUX_JHASH_H */
diff -urN linux-2.5.68-bk11/include/linux/net.h linux-2.5.68-bk12/include/linux/net.h
--- linux-2.5.68-bk11/include/linux/net.h	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/include/linux/net.h	2003-05-04 04:41:53.000000000 -0700
@@ -89,9 +89,11 @@
 struct kiocb;
 struct sockaddr;
 struct msghdr;
+struct module;
 
 struct proto_ops {
 	int		family;
+	struct module	*owner;
 	int		(*release)   (struct socket *sock);
 	int		(*bind)	     (struct socket *sock,
 				      struct sockaddr *umyaddr,
@@ -127,8 +129,6 @@
 				      int offset, size_t size, int flags);
 };
 
-struct module;
-
 struct net_proto_family {
 	int		family;
 	int		(*create)(struct socket *sock, int protocol);
@@ -140,9 +140,6 @@
 	struct module	*owner;
 };
 
-extern int	     net_family_get(int family);
-extern void	     net_family_put(int family);
-
 struct iovec;
 
 extern int	     sock_wake_async(struct socket *sk, int how, int band);
@@ -227,7 +224,7 @@
 	      \
 static struct proto_ops name##_ops = {			\
 	.family		= fam,				\
-							\
+	.owner		= THIS_MODULE,			\
 	.release	= __lock_##name##_release,	\
 	.bind		= __lock_##name##_bind,		\
 	.connect	= __lock_##name##_connect,	\
diff -urN linux-2.5.68-bk11/include/linux/pci_ids.h linux-2.5.68-bk12/include/linux/pci_ids.h
--- linux-2.5.68-bk11/include/linux/pci_ids.h	2003-04-19 19:49:14.000000000 -0700
+++ linux-2.5.68-bk12/include/linux/pci_ids.h	2003-05-04 04:41:53.000000000 -0700
@@ -2025,6 +2025,7 @@
 #define PCI_DEVICE_ID_MICROGATE_USC	0x0010
 #define PCI_DEVICE_ID_MICROGATE_SCC	0x0020
 #define PCI_DEVICE_ID_MICROGATE_SCA	0x0030
+#define PCI_DEVICE_ID_MICROGATE_USC2	0x0210
 
 #define PCI_VENDOR_ID_HINT		0x3388
 #define PCI_DEVICE_ID_HINT_VXPROII_IDE	0x8013
diff -urN linux-2.5.68-bk11/include/linux/sysctl.h linux-2.5.68-bk12/include/linux/sysctl.h
--- linux-2.5.68-bk11/include/linux/sysctl.h	2003-04-19 19:49:56.000000000 -0700
+++ linux-2.5.68-bk12/include/linux/sysctl.h	2003-05-04 04:41:53.000000000 -0700
@@ -327,7 +327,8 @@
 	NET_IPV4_ROUTE_GC_ELASTICITY=14,
 	NET_IPV4_ROUTE_MTU_EXPIRES=15,
 	NET_IPV4_ROUTE_MIN_PMTU=16,
-	NET_IPV4_ROUTE_MIN_ADVMSS=17
+	NET_IPV4_ROUTE_MIN_ADVMSS=17,
+	NET_IPV4_ROUTE_SECRET_INTERVAL=18,
 };
 
 enum
diff -urN linux-2.5.68-bk11/include/net/ip.h linux-2.5.68-bk12/include/net/ip.h
--- linux-2.5.68-bk11/include/net/ip.h	2003-04-19 19:50:08.000000000 -0700
+++ linux-2.5.68-bk12/include/net/ip.h	2003-05-04 04:41:54.000000000 -0700
@@ -47,6 +47,7 @@
 #define IPSKB_MASQUERADED	1
 #define IPSKB_TRANSLATED	2
 #define IPSKB_FORWARDED		4
+#define IPSKB_XFRM_TUNNEL_SIZE	8
 };
 
 struct ipcm_cookie
diff -urN linux-2.5.68-bk11/include/net/sock.h linux-2.5.68-bk12/include/net/sock.h
--- linux-2.5.68-bk11/include/net/sock.h	2003-04-19 19:50:30.000000000 -0700
+++ linux-2.5.68-bk12/include/net/sock.h	2003-05-04 04:41:54.000000000 -0700
@@ -43,7 +43,7 @@
 #include <linux/config.h>
 #include <linux/timer.h>
 #include <linux/cache.h>
-
+#include <linux/module.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>	/* struct sk_buff */
 #include <linux/security.h>
@@ -197,6 +197,7 @@
 	void			*user_data;
   
 	/* Callbacks */
+	struct module		*owner;
 	void			(*state_change)(struct sock *sk);
 	void			(*data_ready)(struct sock *sk,int bytes);
 	void			(*write_space)(struct sock *sk);
@@ -270,6 +271,23 @@
 	} stats[NR_CPUS];
 };
 
+static __inline__ void sk_set_owner(struct sock *sk, struct module *owner)
+{
+	/*
+	 * One should use sk_set_owner just once, after struct sock creation,
+	 * be it shortly after sk_alloc or after a function that returns a new
+	 * struct sock (and that down the call chain called sk_alloc), e.g. the
+	 * IPv4 and IPv6 modules share tcp_create_openreq_child, so if
+	 * tcp_create_openreq_child called sk_set_owner IPv6 would have to
+	 * change the ownership of this struct sock, with one not needed
+	 * transient sk_set_owner call.
+	 */
+	if (unlikely(sk->owner != NULL))
+		BUG();
+	sk->owner = owner;
+	__module_get(owner);
+}
+
 /* Called with local bh disabled */
 static __inline__ void sock_prot_inc_use(struct proto *prot)
 {
diff -urN linux-2.5.68-bk11/include/net/tcp.h linux-2.5.68-bk12/include/net/tcp.h
--- linux-2.5.68-bk11/include/net/tcp.h	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk12/include/net/tcp.h	2003-05-04 04:41:54.000000000 -0700
@@ -1627,6 +1627,7 @@
 	int			qlen;
 	int			qlen_young;
 	int			clock_hand;
+	u32			hash_rnd;
 	struct open_request	*syn_table[TCP_SYNQ_HSIZE];
 };
 
diff -urN linux-2.5.68-bk11/include/net/xfrm.h linux-2.5.68-bk12/include/net/xfrm.h
--- linux-2.5.68-bk11/include/net/xfrm.h	2003-04-19 19:50:41.000000000 -0700
+++ linux-2.5.68-bk12/include/net/xfrm.h	2003-05-04 04:41:54.000000000 -0700
@@ -760,6 +760,7 @@
 extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type);
 extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
 extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
+extern int xfrm4_tunnel_check_size(struct sk_buff *skb);
 extern int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp);
 extern int xfrm6_clear_mutable_options(struct sk_buff *skb, u16 *nh_offset, int dir);
 extern int xfrm_user_policy(struct sock *sk, int optname, u8 *optval, int optlen);
diff -urN linux-2.5.68-bk11/include/video/mach64.h linux-2.5.68-bk12/include/video/mach64.h
--- linux-2.5.68-bk11/include/video/mach64.h	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk12/include/video/mach64.h	2003-05-04 04:41:54.000000000 -0700
@@ -558,7 +558,7 @@
 #define CRTC_CSYNC_EN		0x00000010
 #define CRTC_PIX_BY_2_EN	0x00000020	/* unused on RAGE */
 #define CRTC_DISPLAY_DIS	0x00000040
-#define CRTC_VGA_XOVERSCAN	0x00000080
+#define CRTC_VGA_XOVERSCAN	0x00000040
 
 #define CRTC_PIX_WIDTH_MASK	0x00000700
 #define CRTC_PIX_WIDTH_4BPP	0x00000100
@@ -849,19 +849,7 @@
 #define LI_CHIP_ID	0x4c49	/* RAGE LT PRO */
 #define LP_CHIP_ID	0x4c50	/* RAGE LT PRO */
 #define LT_CHIP_ID	0x4c54	/* RAGE LT */
-
-/* mach64CT family / (Rage XL) class */
-#define GR_CHIP_ID	0x4752	/* RAGE XL, BGA, PCI33 */
-#define GS_CHIP_ID	0x4753	/* RAGE XL, PQFP, PCI33 */
-#define GM_CHIP_ID	0x474d	/* RAGE XL, BGA, AGP 1x,2x */
-#define GN_CHIP_ID	0x474e	/* RAGE XL, PQFP,AGP 1x,2x */
-#define GO_CHIP_ID	0x474f	/* RAGE XL, BGA, PCI66 */
-#define GL_CHIP_ID	0x474c	/* RAGE XL, PQFP, PCI66 */
-
-#define IS_XL(id) ((id)==GR_CHIP_ID || (id)==GS_CHIP_ID || \
-		   (id)==GM_CHIP_ID || (id)==GN_CHIP_ID || \
-		   (id)==GO_CHIP_ID || (id)==GL_CHIP_ID)	
-
+#define XL_CHIP_ID	0x4752	/* RAGE (XL) */
 #define GT_CHIP_ID	0x4754	/* RAGE (GT) */
 #define GU_CHIP_ID	0x4755	/* RAGE II/II+ (GTB) */
 #define GV_CHIP_ID	0x4756	/* RAGE IIC, PCI */
@@ -1160,65 +1148,6 @@
 #define APC_LUT_MN		0x39
 #define APC_LUT_OP		0x3A
 
-/* Values in LCD_GEN_CTRL */
-#define CRT_ON                          0x00000001ul
-#define LCD_ON                          0x00000002ul
-#define HORZ_DIVBY2_EN                  0x00000004ul
-#define DONT_DS_ICON                    0x00000008ul
-#define LOCK_8DOT                       0x00000010ul
-#define ICON_ENABLE                     0x00000020ul
-#define DONT_SHADOW_VPAR                0x00000040ul
-#define V2CLK_PM_EN                     0x00000080ul
-#define RST_FM                          0x00000100ul
-#define DISABLE_PCLK_RESET              0x00000200ul    /* XC/XL */
-#define DIS_HOR_CRT_DIVBY2              0x00000400ul
-#define SCLK_SEL                        0x00000800ul
-#define SCLK_DELAY                      0x0000f000ul
-#define TVCLK_PM_EN                     0x00010000ul
-#define VCLK_DAC_PM_EN                  0x00020000ul
-#define VCLK_LCD_OFF                    0x00040000ul
-#define SELECT_WAIT_4MS                 0x00080000ul
-#define XTALIN_PM_EN                    0x00080000ul    /* XC/XL */
-#define V2CLK_DAC_PM_EN                 0x00100000ul
-#define LVDS_EN                         0x00200000ul
-#define LVDS_PLL_EN                     0x00400000ul
-#define LVDS_PLL_RESET                  0x00800000ul
-#define LVDS_RESERVED_BITS              0x07000000ul
-#define CRTC_RW_SELECT                  0x08000000ul    /* LTPro */
-#define USE_SHADOWED_VEND               0x10000000ul
-#define USE_SHADOWED_ROWCUR             0x20000000ul
-#define SHADOW_EN                       0x40000000ul
-#define SHADOW_RW_EN                    0x80000000ul
-
-/* Values in HORZ_STRETCHING */
-#define HORZ_STRETCH_BLEND              0x00000ffful
-#define HORZ_STRETCH_RATIO              0x0000fffful
-#define HORZ_STRETCH_LOOP               0x00070000ul
-#define HORZ_STRETCH_LOOP09                     0x00000000ul
-#define HORZ_STRETCH_LOOP11                     0x00010000ul
-#define HORZ_STRETCH_LOOP12                     0x00020000ul
-#define HORZ_STRETCH_LOOP14                     0x00030000ul
-#define HORZ_STRETCH_LOOP15                     0x00040000ul
-/*      ?                                       0x00050000ul */
-/*      ?                                       0x00060000ul */
-/*      ?                                       0x00070000ul */
-/*      ?                               0x00080000ul */
-#define HORZ_PANEL_SIZE                 0x0ff00000ul    /* XC/XL */
-/*      ?                               0x10000000ul */
-#define AUTO_HORZ_RATIO                 0x20000000ul    /* XC/XL */
-#define HORZ_STRETCH_MODE               0x40000000ul
-#define HORZ_STRETCH_EN                 0x80000000ul
-
-/* Values in VERT_STRETCHING */
-#define VERT_STRETCH_RATIO0             0x000003fful
-#define VERT_STRETCH_RATIO1             0x000ffc00ul
-#define VERT_STRETCH_RATIO2             0x3ff00000ul
-#define VERT_STRETCH_USE0               0x40000000ul
-#define VERT_STRETCH_EN                 0x80000000ul
-
-/* Values in EXT_VERT_STRETCH */
-#define AUTO_VERT_RATIO                 0x00400000ul
-#define VERT_STRETCH_MODE		0x00000400ul
 
 /* Values in LCD_MISC_CNTL */
 #define BIAS_MOD_LEVEL_MASK	0x0000ff00
diff -urN linux-2.5.68-bk11/mm/memory.c linux-2.5.68-bk12/mm/memory.c
--- linux-2.5.68-bk11/mm/memory.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/mm/memory.c	2003-05-04 04:41:54.000000000 -0700
@@ -51,6 +51,7 @@
 #include <asm/uaccess.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
+#include <asm/pgtable.h>
 
 #include <linux/swapops.h>
 
@@ -688,6 +689,45 @@
 
 		vma = find_extend_vma(mm, start);
 
+#ifdef FIXADDR_START
+		if (!vma && start >= FIXADDR_START && start < FIXADDR_TOP) {
+			static struct vm_area_struct fixmap_vma = {
+				/* Catch users - if there are any valid
+				   ones, we can make this be "&init_mm" or
+				   something.  */
+				.vm_mm = NULL,
+				.vm_start = FIXADDR_START,
+				.vm_end = FIXADDR_TOP,
+				.vm_page_prot = PAGE_READONLY,
+				.vm_flags = VM_READ | VM_EXEC,
+			};
+			unsigned long pg = start & PAGE_MASK;
+			pgd_t *pgd;
+			pmd_t *pmd;
+			pte_t *pte;
+			pgd = pgd_offset_k(pg);
+			if (!pgd)
+				return i ? : -EFAULT;
+			pmd = pmd_offset(pgd, pg);
+			if (!pmd)
+				return i ? : -EFAULT;
+			pte = pte_offset_kernel(pmd, pg);
+			if (!pte || !pte_present(*pte) || !pte_user(*pte) ||
+			    !(write ? pte_write(*pte) : pte_read(*pte)))
+				return i ? : -EFAULT;
+			if (pages) {
+				pages[i] = pte_page(*pte);
+				get_page(pages[i]);
+			}
+			if (vmas)
+				vmas[i] = &fixmap_vma;
+			i++;
+			start += PAGE_SIZE;
+			len--;
+			continue;
+		}
+#endif
+
 		if (!vma || (pages && (vma->vm_flags & VM_IO))
 				|| !(flags & vma->vm_flags))
 			return i ? : -EFAULT;
diff -urN linux-2.5.68-bk11/net/appletalk/ddp.c linux-2.5.68-bk12/net/appletalk/ddp.c
--- linux-2.5.68-bk11/net/appletalk/ddp.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/appletalk/ddp.c	2003-05-04 04:41:54.000000000 -0700
@@ -1778,6 +1778,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(atalk_dgram_ops) = {
 	.family		= PF_APPLETALK,
+	.owner		= THIS_MODULE,
 	.release	= atalk_release,
 	.bind		= atalk_bind,
 	.connect	= atalk_connect,
diff -urN linux-2.5.68-bk11/net/ax25/af_ax25.c linux-2.5.68-bk12/net/ax25/af_ax25.c
--- linux-2.5.68-bk11/net/ax25/af_ax25.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/ax25/af_ax25.c	2003-05-04 04:41:54.000000000 -0700
@@ -845,6 +845,7 @@
 	}
 
 	sock_init_data(sock, sk);
+	sk_set_owner(sk, THIS_MODULE);
 
 	sk->destruct = ax25_free_sock;
 	sock->ops    = &ax25_proto_ops;
@@ -880,6 +881,7 @@
 	}
 
 	sock_init_data(NULL, sk);
+	sk_set_owner(sk, THIS_MODULE);
 
 	sk->destruct = ax25_free_sock;
 	sk->type     = osk->type;
@@ -1913,7 +1915,7 @@
 
 static struct proto_ops ax25_proto_ops = {
 	.family =	PF_AX25,
-
+	.owner =	THIS_MODULE,
 	.release =	ax25_release,
 	.bind =		ax25_bind,
 	.connect =	ax25_connect,
diff -urN linux-2.5.68-bk11/net/bluetooth/bnep/sock.c linux-2.5.68-bk12/net/bluetooth/bnep/sock.c
--- linux-2.5.68-bk11/net/bluetooth/bnep/sock.c	2003-04-19 19:51:23.000000000 -0700
+++ linux-2.5.68-bk12/net/bluetooth/bnep/sock.c	2003-05-04 04:41:54.000000000 -0700
@@ -148,6 +148,7 @@
 
 static struct proto_ops bnep_sock_ops = {
 	.family     = PF_BLUETOOTH,
+	.owner      = THIS_MODULE,
 	.release    = bnep_sock_release,
 	.ioctl      = bnep_sock_ioctl,
 	.bind       = sock_no_bind,
diff -urN linux-2.5.68-bk11/net/bluetooth/hci_sock.c linux-2.5.68-bk12/net/bluetooth/hci_sock.c
--- linux-2.5.68-bk11/net/bluetooth/hci_sock.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/bluetooth/hci_sock.c	2003-05-04 04:41:54.000000000 -0700
@@ -553,6 +553,7 @@
 
 struct proto_ops hci_sock_ops = {
 	.family =	PF_BLUETOOTH,
+	.owner =	THIS_MODULE,
 	.release =	hci_sock_release,
 	.bind =		hci_sock_bind,
 	.getname =	hci_sock_getname,
diff -urN linux-2.5.68-bk11/net/bluetooth/l2cap.c linux-2.5.68-bk12/net/bluetooth/l2cap.c
--- linux-2.5.68-bk11/net/bluetooth/l2cap.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/bluetooth/l2cap.c	2003-05-04 04:41:54.000000000 -0700
@@ -2084,6 +2084,7 @@
 
 static struct proto_ops l2cap_sock_ops = {
 	.family  =      PF_BLUETOOTH,
+	.owner   =	THIS_MODULE,
 	.release =      l2cap_sock_release,
 	.bind    =      l2cap_sock_bind,
 	.connect =      l2cap_sock_connect,
@@ -2104,6 +2105,7 @@
 static struct net_proto_family l2cap_sock_family_ops = {
 	.family =       PF_BLUETOOTH,
 	.create	=       l2cap_sock_create,
+	.owner	=	THIS_MODULE,
 };
 
 static struct hci_proto l2cap_hci_proto = {
diff -urN linux-2.5.68-bk11/net/bluetooth/rfcomm/sock.c linux-2.5.68-bk12/net/bluetooth/rfcomm/sock.c
--- linux-2.5.68-bk11/net/bluetooth/rfcomm/sock.c	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk12/net/bluetooth/rfcomm/sock.c	2003-05-04 04:41:54.000000000 -0700
@@ -856,6 +856,7 @@
 
 static struct proto_ops rfcomm_sock_ops = {
 	.family		= PF_BLUETOOTH,
+	.owner		= THIS_MODULE,
 	.release	= rfcomm_sock_release,
 	.bind		= rfcomm_sock_bind,
 	.connect	= rfcomm_sock_connect,
diff -urN linux-2.5.68-bk11/net/bluetooth/sco.c linux-2.5.68-bk12/net/bluetooth/sco.c
--- linux-2.5.68-bk11/net/bluetooth/sco.c	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/net/bluetooth/sco.c	2003-05-04 04:41:54.000000000 -0700
@@ -969,6 +969,7 @@
 
 static struct proto_ops sco_sock_ops = {
 	.family  =      PF_BLUETOOTH,
+	.owner   =	THIS_MODULE,
 	.release =      sco_sock_release,
 	.bind    =     	sco_sock_bind,
 	.connect =      sco_sock_connect,
@@ -989,6 +990,7 @@
 static struct net_proto_family sco_sock_family_ops = {
 	.family =       PF_BLUETOOTH,
 	.create =       sco_sock_create,
+	.owner	=	THIS_MODULE,
 };
 
 static struct hci_proto sco_hci_proto = {
diff -urN linux-2.5.68-bk11/net/core/dev.c linux-2.5.68-bk12/net/core/dev.c
--- linux-2.5.68-bk11/net/core/dev.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/core/dev.c	2003-05-04 04:41:55.000000000 -0700
@@ -1789,7 +1789,7 @@
 	struct net_device *dev;
 	loff_t i;
 
-	for (i = 0, dev = dev_base; dev && i < pos; dev = dev->next);
+	for (i = 0, dev = dev_base; dev && i < pos; ++i, dev = dev->next);
 
 	return i == pos ? dev : NULL;
 }
@@ -1797,11 +1797,12 @@
 void *dev_seq_start(struct seq_file *seq, loff_t *pos)
 {
 	read_lock(&dev_base_lock);
-	return *pos ? dev_get_idx(seq, *pos) : (void *)1;
+	return *pos ? dev_get_idx(seq, *pos - 1) : (void *)1;
 }
 
 void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
+	++*pos;
 	return v == (void *)1 ? dev_base : ((struct net_device *)v)->next;
 }
 
@@ -1843,11 +1844,11 @@
 static int dev_seq_show(struct seq_file *seq, void *v)
 {
 	if (v == (void *)1)
-		seq_printf(seq, "Inter-|   Receive                            "
-				"                    |  Transmit\n"
-				" face |bytes    packets errs drop fifo frame "
-				"compressed multicast|bytes    packets errs "
-				"drop fifo colls carrier compressed\n");
+		seq_puts(seq, "Inter-|   Receive                            "
+			      "                    |  Transmit\n"
+			      " face |bytes    packets errs drop fifo frame "
+			      "compressed multicast|bytes    packets errs "
+			      "drop fifo colls carrier compressed\n");
 	else
 		dev_seq_printf_stats(seq, v);
 	return 0;
diff -urN linux-2.5.68-bk11/net/core/sock.c linux-2.5.68-bk12/net/core/sock.c
--- linux-2.5.68-bk11/net/core/sock.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/core/sock.c	2003-05-04 04:41:55.000000000 -0700
@@ -591,8 +591,6 @@
 {
 	struct sock *sk = NULL;
 
-	if (!net_family_get(family))
-		goto out;
 	if (!slab)
 		slab = sk_cachep;
 	sk = kmem_cache_alloc(slab, priority);
@@ -604,16 +602,14 @@
 			sock_lock_init(sk);
 		}
 		sk->slab = slab;
-	} else
-		net_family_put(family);
-out:
+	}
 	return sk;
 }
 
 void sk_free(struct sock *sk)
 {
 	struct sk_filter *filter;
-	const int family = sk->family;
+	struct module *owner = sk->owner;
 
 	if (sk->destruct)
 		sk->destruct(sk);
@@ -628,7 +624,7 @@
 		printk(KERN_DEBUG "sk_free: optmem leakage (%d bytes) detected.\n", atomic_read(&sk->omem_alloc));
 
 	kmem_cache_free(sk->slab, sk);
-	net_family_put(family);
+	module_put(owner);
 }
 
 void __init sk_init(void)
@@ -1112,6 +1108,7 @@
 	sk->rcvlowat		=	1;
 	sk->rcvtimeo		=	MAX_SCHEDULE_TIMEOUT;
 	sk->sndtimeo		=	MAX_SCHEDULE_TIMEOUT;
+	sk->owner		=	NULL;
 
 	atomic_set(&sk->refcnt, 1);
 }
diff -urN linux-2.5.68-bk11/net/decnet/af_decnet.c linux-2.5.68-bk12/net/decnet/af_decnet.c
--- linux-2.5.68-bk11/net/decnet/af_decnet.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/decnet/af_decnet.c	2003-05-04 04:41:55.000000000 -0700
@@ -485,6 +485,7 @@
 	if (sock)
 		sock->ops = &dn_proto_ops;
 	sock_init_data(sock, sk);
+	sk_set_owner(sk, THIS_MODULE);
 
 	sk->backlog_rcv = dn_nsp_backlog_rcv;
 	sk->destruct    = dn_destruct;
@@ -2235,7 +2236,7 @@
 
 static struct proto_ops dn_proto_ops = {
 	.family =	AF_DECnet,
-
+	.owner =	THIS_MODULE,
 	.release =	dn_release,
 	.bind =		dn_bind,
 	.connect =	dn_connect,
diff -urN linux-2.5.68-bk11/net/econet/af_econet.c linux-2.5.68-bk12/net/econet/af_econet.c
--- linux-2.5.68-bk11/net/econet/af_econet.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/econet/af_econet.c	2003-05-04 04:41:55.000000000 -0700
@@ -694,7 +694,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(econet_ops) = {
 	.family =	PF_ECONET,
-
+	.owner =	THIS_MODULE,
 	.release =	econet_release,
 	.bind =		econet_bind,
 	.connect =	sock_no_connect,
diff -urN linux-2.5.68-bk11/net/ipv4/af_inet.c linux-2.5.68-bk12/net/ipv4/af_inet.c
--- linux-2.5.68-bk11/net/ipv4/af_inet.c	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/af_inet.c	2003-05-04 04:41:55.000000000 -0700
@@ -390,6 +390,7 @@
 	inet->id = 0;
 
 	sock_init_data(sock, sk);
+	sk_set_owner(sk, THIS_MODULE);
 
 	sk->destruct = inet_sock_destruct;
 	sk->zapped	= 0;
@@ -882,7 +883,7 @@
 
 struct proto_ops inet_stream_ops = {
 	.family =	PF_INET,
-
+	.owner =	THIS_MODULE,
 	.release =	inet_release,
 	.bind =		inet_bind,
 	.connect =	inet_stream_connect,
@@ -903,7 +904,7 @@
 
 struct proto_ops inet_dgram_ops = {
 	.family =	PF_INET,
-
+	.owner =	THIS_MODULE,
 	.release =	inet_release,
 	.bind =		inet_bind,
 	.connect =	inet_dgram_connect,
diff -urN linux-2.5.68-bk11/net/ipv4/ah.c linux-2.5.68-bk12/net/ipv4/ah.c
--- linux-2.5.68-bk11/net/ipv4/ah.c	2003-04-19 19:50:45.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/ah.c	2003-05-04 04:41:55.000000000 -0700
@@ -74,6 +74,9 @@
 	spin_lock_bh(&x->lock);
 	if ((err = xfrm_state_check_expire(x)) != 0)
 		goto error;
+	if (x->props.mode)
+		if ((err = xfrm4_tunnel_check_size(skb)) != 0)
+			goto error;
 	if ((err = xfrm_state_check_space(x, skb)) != 0)
 		goto error;
 
diff -urN linux-2.5.68-bk11/net/ipv4/esp.c linux-2.5.68-bk12/net/ipv4/esp.c
--- linux-2.5.68-bk11/net/ipv4/esp.c	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/esp.c	2003-05-04 04:41:55.000000000 -0700
@@ -49,6 +49,9 @@
 	spin_lock_bh(&x->lock);
 	if ((err = xfrm_state_check_expire(x)) != 0)
 		goto error;
+	if (x->props.mode)
+		if ((err = xfrm4_tunnel_check_size(skb)) != 0)
+			goto error;
 	if ((err = xfrm_state_check_space(x, skb)) != 0)
 		goto error;
 
diff -urN linux-2.5.68-bk11/net/ipv4/ipcomp.c linux-2.5.68-bk12/net/ipv4/ipcomp.c
--- linux-2.5.68-bk11/net/ipv4/ipcomp.c	2003-04-19 19:50:44.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/ipcomp.c	2003-05-04 04:41:55.000000000 -0700
@@ -176,6 +176,9 @@
 	
 	if ((err = xfrm_state_check_expire(x)) != 0)
 		goto error;
+	if (x->props.mode)
+		if ((err = xfrm4_tunnel_check_size(skb)) != 0)
+			goto error;
 	if ((err = xfrm_state_check_space(x, skb)) != 0)
 		goto error;
 
diff -urN linux-2.5.68-bk11/net/ipv4/netfilter/ip_conntrack_core.c linux-2.5.68-bk12/net/ipv4/netfilter/ip_conntrack_core.c
--- linux-2.5.68-bk11/net/ipv4/netfilter/ip_conntrack_core.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/netfilter/ip_conntrack_core.c	2003-05-04 04:41:55.000000000 -0700
@@ -28,6 +28,8 @@
 #include <linux/stddef.h>
 #include <linux/sysctl.h>
 #include <linux/slab.h>
+#include <linux/random.h>
+#include <linux/jhash.h>
 /* For ERR_PTR().  Yeah, I know... --RR */
 #include <linux/fs.h>
 
@@ -104,20 +106,19 @@
 	nf_conntrack_put(&ct->infos[0]);
 }
 
-static inline u_int32_t
+static int ip_conntrack_hash_rnd_initted;
+static unsigned int ip_conntrack_hash_rnd;
+
+static u_int32_t
 hash_conntrack(const struct ip_conntrack_tuple *tuple)
 {
 #if 0
 	dump_tuple(tuple);
 #endif
-	/* ntohl because more differences in low bits. */
-	/* To ensure that halves of the same connection don't hash
-	   clash, we add the source per-proto again. */
-	return (ntohl(tuple->src.ip + tuple->dst.ip
-		     + tuple->src.u.all + tuple->dst.u.all
-		     + tuple->dst.protonum)
-		+ ntohs(tuple->src.u.all))
-		% ip_conntrack_htable_size;
+	return (jhash_3words(tuple->src.ip,
+	                     (tuple->dst.ip ^ tuple->dst.protonum),
+	                     (tuple->src.u.all | (tuple->dst.u.all << 16)),
+	                     ip_conntrack_hash_rnd) % ip_conntrack_htable_size);
 }
 
 int
@@ -613,11 +614,16 @@
 {
 	struct ip_conntrack *conntrack;
 	struct ip_conntrack_tuple repl_tuple;
-	size_t hash, repl_hash;
+	size_t hash;
 	struct ip_conntrack_expect *expected;
 	int i;
 	static unsigned int drop_next = 0;
 
+	if (!ip_conntrack_hash_rnd_initted) {
+		get_random_bytes(&ip_conntrack_hash_rnd, 4);
+		ip_conntrack_hash_rnd_initted = 1;
+	}
+
 	hash = hash_conntrack(tuple);
 
 	if (ip_conntrack_max &&
@@ -641,7 +647,6 @@
 		DEBUGP("Can't invert tuple.\n");
 		return NULL;
 	}
-	repl_hash = hash_conntrack(&repl_tuple);
 
 	conntrack = kmem_cache_alloc(ip_conntrack_cachep, GFP_ATOMIC);
 	if (!conntrack) {
diff -urN linux-2.5.68-bk11/net/ipv4/netfilter/ipt_conntrack.c linux-2.5.68-bk12/net/ipv4/netfilter/ipt_conntrack.c
--- linux-2.5.68-bk11/net/ipv4/netfilter/ipt_conntrack.c	2003-04-19 19:50:49.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/netfilter/ipt_conntrack.c	2003-05-04 04:41:55.000000000 -0700
@@ -27,7 +27,11 @@
 
 #define FWINV(bool,invflg) ((bool) ^ !!(sinfo->invflags & invflg))
 
-	statebit = ct ? IPT_CONNTRACK_STATE_INVALID : IPT_CONNTRACK_STATE_BIT(ctinfo);
+	if (ct)
+		statebit = IPT_CONNTRACK_STATE_BIT(ctinfo);
+	else
+		statebit = IPT_CONNTRACK_STATE_INVALID;
+
 	if(sinfo->flags & IPT_CONNTRACK_STATE) {
 		if (ct) {
 			if(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip !=
diff -urN linux-2.5.68-bk11/net/ipv4/route.c linux-2.5.68-bk12/net/ipv4/route.c
--- linux-2.5.68-bk11/net/ipv4/route.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/route.c	2003-05-04 04:41:55.000000000 -0700
@@ -86,6 +86,7 @@
 #include <linux/mroute.h>
 #include <linux/netfilter_ipv4.h>
 #include <linux/random.h>
+#include <linux/jhash.h>
 #include <linux/rcupdate.h>
 #include <net/protocol.h>
 #include <net/ip.h>
@@ -120,13 +121,14 @@
 int ip_rt_mtu_expires		= 10 * 60 * HZ;
 int ip_rt_min_pmtu		= 512 + 20 + 20;
 int ip_rt_min_advmss		= 256;
-
+int ip_rt_secret_interval	= 10 * 60 * HZ;
 static unsigned long rt_deadline;
 
 #define RTprint(a...)	printk(KERN_DEBUG a)
 
 static struct timer_list rt_flush_timer;
 static struct timer_list rt_periodic_timer;
+static struct timer_list rt_secret_timer;
 
 /*
  *	Interface to generic destination cache.
@@ -196,19 +198,17 @@
 static struct rt_hash_bucket 	*rt_hash_table;
 static unsigned			rt_hash_mask;
 static int			rt_hash_log;
+static unsigned int		rt_hash_rnd;
 
 struct rt_cache_stat *rt_cache_stat;
 
 static int rt_intern_hash(unsigned hash, struct rtable *rth,
 				struct rtable **res);
 
-static unsigned rt_hash_code(u32 daddr, u32 saddr, u8 tos)
+static unsigned int rt_hash_code(u32 daddr, u32 saddr, u8 tos)
 {
-	unsigned hash = ((daddr & 0xF0F0F0F0) >> 4) |
-			((daddr & 0x0F0F0F0F) << 4);
-	hash ^= saddr ^ tos;
-	hash ^= (hash >> 16);
-	return (hash ^ (hash >> 8)) & rt_hash_mask;
+	return (jhash_3words(daddr, saddr, (u32) tos, rt_hash_rnd)
+		& rt_hash_mask);
 }
 
 #ifdef CONFIG_PROC_FS
@@ -566,6 +566,15 @@
 	spin_unlock_bh(&rt_flush_lock);
 }
 
+static void rt_secret_rebuild(unsigned long dummy)
+{
+	unsigned long now = jiffies;
+
+	get_random_bytes(&rt_hash_rnd, 4);
+	rt_cache_flush(0);
+	mod_timer(&rt_secret_timer, now + ip_rt_secret_interval);
+}
+
 /*
    Short description of GC goals.
 
@@ -2553,6 +2562,15 @@
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
+	{
+		.ctl_name	= NET_IPV4_ROUTE_SECRET_INTERVAL,
+		.procname	= "secret_interval",
+		.data		= &ip_rt_secret_interval,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec_jiffies,
+		.strategy	= &sysctl_jiffies,
+	},
 	{ .ctl_name = 0 }
 };
 #endif
@@ -2584,17 +2602,28 @@
 		*eof = 1;
 	}
 
-	/* Copy first cpu. */
-	*start = buffer;
-	memcpy(buffer, IP_RT_ACCT_CPU(0), length);
-
-	/* Add the other cpus in, one int at a time */
-	for (i = 1; i < NR_CPUS; i++) {
-		unsigned int j;
-		if (!cpu_online(i))
-			continue;
-		for (j = 0; j < length/4; j++)
-			((u32*)buffer)[j] += ((u32*)IP_RT_ACCT_CPU(i))[j];
+	offset /= sizeof(u32);
+
+	if (length > 0) {
+		u32 *src = ((u32 *) IP_RT_ACCT_CPU(0)) + offset;
+		u32 *dst = (u32 *) buffer;
+
+		/* Copy first cpu. */
+		*start = buffer;
+		memcpy(dst, src, length);
+
+		/* Add the other cpus in, one int at a time */
+		for (i = 1; i < NR_CPUS; i++) {
+			unsigned int j;
+
+			if (!cpu_online(i))
+				continue;
+
+			src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
+
+			for (j = 0; j < length/4; j++)
+				dst[j] += src[j];
+		}
 	}
 	return length;
 }
@@ -2605,6 +2634,9 @@
 {
 	int i, order, goal, rc = 0;
 
+	rt_hash_rnd = (int) ((num_physpages ^ (num_physpages>>8)) ^
+			     (jiffies ^ (jiffies >> 7)));
+
 #ifdef CONFIG_NET_CLS_ROUTE
 	for (order = 0;
 	     (PAGE_SIZE << order) < 256 * sizeof(struct ip_rt_acct) * NR_CPUS; order++)
@@ -2674,6 +2706,8 @@
 	rt_flush_timer.function = rt_run_flush;
 	init_timer(&rt_periodic_timer);
 	rt_periodic_timer.function = rt_check_expire;
+	init_timer(&rt_secret_timer);
+	rt_secret_timer.function = rt_secret_rebuild;
 
 	/* All the timers, started at system startup tend
 	   to synchronize. Perturb it a bit.
@@ -2682,6 +2716,10 @@
 					ip_rt_gc_interval;
 	add_timer(&rt_periodic_timer);
 
+	rt_secret_timer.expires = jiffies + net_random() % ip_rt_secret_interval +
+		ip_rt_secret_interval;
+	add_timer(&rt_secret_timer);
+
 #ifdef CONFIG_PROC_FS
 	if (rt_cache_proc_init())
 		goto out_enomem;
diff -urN linux-2.5.68-bk11/net/ipv4/syncookies.c linux-2.5.68-bk12/net/ipv4/syncookies.c
--- linux-2.5.68-bk11/net/ipv4/syncookies.c	2003-04-19 19:48:48.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/syncookies.c	2003-05-04 04:41:55.000000000 -0700
@@ -101,9 +101,10 @@
 	struct sock *child;
 
 	child = tp->af_specific->syn_recv_sock(sk, skb, req, dst);
-	if (child)
+	if (child) {
+		sk_set_owner(child, sk->owner);
 		tcp_acceptq_queue(sk, req, child);
-	else
+	} else
 		tcp_openreq_free(req);
 
 	return child;
diff -urN linux-2.5.68-bk11/net/ipv4/tcp.c linux-2.5.68-bk12/net/ipv4/tcp.c
--- linux-2.5.68-bk11/net/ipv4/tcp.c	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/tcp.c	2003-05-04 04:41:55.000000000 -0700
@@ -254,6 +254,7 @@
 #include <linux/init.h>
 #include <linux/smp_lock.h>
 #include <linux/fs.h>
+#include <linux/random.h>
 
 #include <net/icmp.h>
 #include <net/tcp.h>
@@ -551,6 +552,7 @@
 	for (lopt->max_qlen_log = 6; ; lopt->max_qlen_log++)
 		if ((1 << lopt->max_qlen_log) >= sysctl_max_syn_backlog)
 			break;
+	get_random_bytes(&lopt->hash_rnd, 4);
 
 	write_lock_bh(&tp->syn_wait_lock);
 	tp->listen_opt = lopt;
diff -urN linux-2.5.68-bk11/net/ipv4/tcp_ipv4.c linux-2.5.68-bk12/net/ipv4/tcp_ipv4.c
--- linux-2.5.68-bk11/net/ipv4/tcp_ipv4.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/tcp_ipv4.c	2003-05-04 04:41:55.000000000 -0700
@@ -58,6 +58,7 @@
 #include <linux/fcntl.h>
 #include <linux/random.h>
 #include <linux/cache.h>
+#include <linux/jhash.h>
 #include <linux/init.h>
 
 #include <net/icmp.h>
@@ -883,12 +884,9 @@
 	return ((struct rtable *)skb->dst)->rt_iif;
 }
 
-static __inline__ unsigned tcp_v4_synq_hash(u32 raddr, u16 rport)
+static __inline__ u32 tcp_v4_synq_hash(u32 raddr, u16 rport, u32 rnd)
 {
-	unsigned h = raddr ^ rport;
-	h ^= h >> 16;
-	h ^= h >> 8;
-	return h & (TCP_SYNQ_HSIZE - 1);
+	return (jhash_2words(raddr, (u32) rport, rnd) & (TCP_SYNQ_HSIZE - 1));
 }
 
 static struct open_request *tcp_v4_search_req(struct tcp_opt *tp,
@@ -899,7 +897,7 @@
 	struct tcp_listen_opt *lopt = tp->listen_opt;
 	struct open_request *req, **prev;
 
-	for (prev = &lopt->syn_table[tcp_v4_synq_hash(raddr, rport)];
+	for (prev = &lopt->syn_table[tcp_v4_synq_hash(raddr, rport, lopt->hash_rnd)];
 	     (req = *prev) != NULL;
 	     prev = &req->dl_next) {
 		if (req->rmt_port == rport &&
@@ -919,7 +917,7 @@
 {
 	struct tcp_opt *tp = tcp_sk(sk);
 	struct tcp_listen_opt *lopt = tp->listen_opt;
-	unsigned h = tcp_v4_synq_hash(req->af.v4_req.rmt_addr, req->rmt_port);
+	u32 h = tcp_v4_synq_hash(req->af.v4_req.rmt_addr, req->rmt_port, lopt->hash_rnd);
 
 	req->expires = jiffies + TCP_TIMEOUT_INIT;
 	req->retrans = 0;
diff -urN linux-2.5.68-bk11/net/ipv4/tcp_minisocks.c linux-2.5.68-bk12/net/ipv4/tcp_minisocks.c
--- linux-2.5.68-bk11/net/ipv4/tcp_minisocks.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/tcp_minisocks.c	2003-05-04 04:41:55.000000000 -0700
@@ -967,6 +967,7 @@
 	if (child == NULL)
 		goto listen_overflow;
 
+	sk_set_owner(child, sk->owner);
 	tcp_synq_unlink(tp, req, prev);
 	tcp_synq_removed(sk, req);
 
diff -urN linux-2.5.68-bk11/net/ipv4/xfrm4_tunnel.c linux-2.5.68-bk12/net/ipv4/xfrm4_tunnel.c
--- linux-2.5.68-bk11/net/ipv4/xfrm4_tunnel.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv4/xfrm4_tunnel.c	2003-05-04 04:41:55.000000000 -0700
@@ -9,13 +9,40 @@
 #include <net/icmp.h>
 #include <net/inet_ecn.h>
 
+int xfrm4_tunnel_check_size(struct sk_buff *skb)
+{
+	int mtu, ret = 0;
+	struct dst_entry *dst;
+	struct iphdr *iph = skb->nh.iph;
+
+	if (IPCB(skb)->flags & IPSKB_XFRM_TUNNEL_SIZE)
+		goto out;
+
+	IPCB(skb)->flags |= IPSKB_XFRM_TUNNEL_SIZE;
+	
+	if (!(iph->frag_off & htons(IP_DF)))
+		goto out;
+
+	dst = skb->dst;
+	mtu = dst_pmtu(dst) - dst->header_len - dst->trailer_len;
+	if (skb->len > mtu) {
+		icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
+		ret = -EMSGSIZE;
+	}
+out:
+	return ret;
+}
+
 static int ipip_output(struct sk_buff *skb)
 {
 	struct dst_entry *dst = skb->dst;
 	struct xfrm_state *x = dst->xfrm;
 	struct iphdr *iph, *top_iph;
-	int tos;
+	int tos, err;
 
+	if ((err = xfrm4_tunnel_check_size(skb)) != 0)
+		goto error_nolock;
+		
 	iph = skb->nh.iph;
 
 	spin_lock_bh(&x->lock);
@@ -46,9 +73,14 @@
 
 	if ((skb->dst = dst_pop(dst)) == NULL) {
 		kfree_skb(skb);
-		return -EHOSTUNREACH;
+		err = -EHOSTUNREACH;
+		goto error_nolock;
 	}
 	return NET_XMIT_BYPASS;
+
+error_nolock:
+	kfree_skb(skb);
+	return err;
 }
 
 static inline void ipip_ecn_decapsulate(struct iphdr *outer_iph, struct sk_buff *skb)
diff -urN linux-2.5.68-bk11/net/ipv6/af_inet6.c linux-2.5.68-bk12/net/ipv6/af_inet6.c
--- linux-2.5.68-bk11/net/ipv6/af_inet6.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv6/af_inet6.c	2003-05-04 04:41:56.000000000 -0700
@@ -193,6 +193,7 @@
 
 	sock->ops = answer->ops;
 	sock_init_data(sock, sk);
+	sk_set_owner(sk, THIS_MODULE);
 
 	sk->prot = answer->prot;
 	sk->no_check = answer->no_check;
@@ -498,7 +499,7 @@
 
 struct proto_ops inet6_stream_ops = {
 	.family =	PF_INET6,
-
+	.owner =	THIS_MODULE,
 	.release =	inet6_release,
 	.bind =		inet6_bind,
 	.connect =	inet_stream_connect,		/* ok		*/
@@ -519,7 +520,7 @@
 
 struct proto_ops inet6_dgram_ops = {
 	.family =	PF_INET6,
-
+	.owner =	THIS_MODULE,
 	.release =	inet6_release,
 	.bind =		inet6_bind,
 	.connect =	inet_dgram_connect,		/* ok		*/
diff -urN linux-2.5.68-bk11/net/ipv6/tcp_ipv6.c linux-2.5.68-bk12/net/ipv6/tcp_ipv6.c
--- linux-2.5.68-bk11/net/ipv6/tcp_ipv6.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/ipv6/tcp_ipv6.c	2003-05-04 04:41:56.000000000 -0700
@@ -36,6 +36,7 @@
 #include <linux/in6.h>
 #include <linux/netdevice.h>
 #include <linux/init.h>
+#include <linux/jhash.h>
 #include <linux/ipsec.h>
 
 #include <linux/ipv6.h>
@@ -387,12 +388,11 @@
  * Open request hash tables.
  */
 
-static __inline__ unsigned tcp_v6_synq_hash(struct in6_addr *raddr, u16 rport)
+static u32 tcp_v6_synq_hash(struct in6_addr *raddr, u16 rport, u32 rnd)
 {
-	unsigned h = raddr->s6_addr32[3] ^ rport;
-	h ^= h>>16;
-	h ^= h>>8;
-	return h&(TCP_SYNQ_HSIZE-1);
+	return (jhash_3words(raddr->s6_addr32[0] ^ raddr->s6_addr32[1],
+	                     raddr->s6_addr32[2] ^ raddr->s6_addr32[3],
+	                     (u32) rport, rnd) & (TCP_SYNQ_HSIZE - 1));
 }
 
 static struct open_request *tcp_v6_search_req(struct tcp_opt *tp,
@@ -405,7 +405,7 @@
 	struct tcp_listen_opt *lopt = tp->listen_opt;
 	struct open_request *req, **prev;  
 
-	for (prev = &lopt->syn_table[tcp_v6_synq_hash(raddr, rport)];
+	for (prev = &lopt->syn_table[tcp_v6_synq_hash(raddr, rport, lopt->hash_rnd)];
 	     (req = *prev) != NULL;
 	     prev = &req->dl_next) {
 		if (req->rmt_port == rport &&
@@ -1162,7 +1162,7 @@
 {
 	struct tcp_opt *tp = tcp_sk(sk);
 	struct tcp_listen_opt *lopt = tp->listen_opt;
-	unsigned h = tcp_v6_synq_hash(&req->af.v6_req.rmt_addr, req->rmt_port);
+	u32 h = tcp_v6_synq_hash(&req->af.v6_req.rmt_addr, req->rmt_port, lopt->hash_rnd);
 
 	req->sk = NULL;
 	req->expires = jiffies + TCP_TIMEOUT_INIT;
@@ -1308,7 +1308,6 @@
 #ifdef INET_REFCNT_DEBUG
 		atomic_inc(&inet6_sock_nr);
 #endif
-		MOD_INC_USE_COUNT;
 
 		/* It is tricky place. Until this moment IPv4 tcp
 		   worked with IPv6 af_tcp.af_specific.
@@ -1358,7 +1357,6 @@
 #ifdef INET_REFCNT_DEBUG
 	atomic_inc(&inet6_sock_nr);
 #endif
-	MOD_INC_USE_COUNT;
 
 	ip6_dst_store(newsk, dst, NULL);
 	sk->route_caps = dst->dev->features&~(NETIF_F_IP_CSUM|NETIF_F_TSO);
diff -urN linux-2.5.68-bk11/net/ipx/af_ipx.c linux-2.5.68-bk12/net/ipx/af_ipx.c
--- linux-2.5.68-bk11/net/ipx/af_ipx.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/ipx/af_ipx.c	2003-05-04 04:41:56.000000000 -0700
@@ -2221,6 +2221,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = {
 	.family		= PF_IPX,
+	.owner		= THIS_MODULE,
 	.release	= ipx_release,
 	.bind		= ipx_bind,
 	.connect	= ipx_connect,
diff -urN linux-2.5.68-bk11/net/irda/af_irda.c linux-2.5.68-bk12/net/irda/af_irda.c
--- linux-2.5.68-bk11/net/irda/af_irda.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/irda/af_irda.c	2003-05-04 04:41:56.000000000 -0700
@@ -2408,7 +2408,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = {
 	.family =	PF_IRDA,
-
+	.owner =	THIS_MODULE,
 	.release =	irda_release,
 	.bind =		irda_bind,
 	.connect =	irda_connect,
@@ -2429,7 +2429,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = {
 	.family =	PF_IRDA,
-
+	.owner =	THIS_MODULE,
 	.release =	irda_release,
 	.bind =		irda_bind,
 	.connect =	irda_connect,
@@ -2450,7 +2450,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = {
 	.family =	PF_IRDA,
-
+	.owner =	THIS_MODULE,
 	.release =	irda_release,
 	.bind =		irda_bind,
 	.connect =	irda_connect,
@@ -2472,7 +2472,7 @@
 #ifdef CONFIG_IRDA_ULTRA
 static struct proto_ops SOCKOPS_WRAPPED(irda_ultra_ops) = {
 	.family =	PF_IRDA,
-
+	.owner =	THIS_MODULE,
 	.release =	irda_release,
 	.bind =		irda_bind,
 	.connect =	sock_no_connect,
diff -urN linux-2.5.68-bk11/net/key/af_key.c linux-2.5.68-bk12/net/key/af_key.c
--- linux-2.5.68-bk11/net/key/af_key.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/key/af_key.c	2003-05-04 04:41:56.000000000 -0700
@@ -152,9 +152,10 @@
 	sk = sk_alloc(PF_KEY, GFP_KERNEL, 1, NULL);
 	if (sk == NULL)
 		goto out;
-
+	
 	sock->ops = &pfkey_ops;
 	sock_init_data(sock, sk);
+	sk_set_owner(sk, THIS_MODULE);
 
 	err = -ENOMEM;
 	pfk = pfkey_sk(sk) = kmalloc(sizeof(*pfk), GFP_KERNEL);
@@ -2761,7 +2762,7 @@
 
 static struct proto_ops pfkey_ops = {
 	.family		=	PF_KEY,
-
+	.owner		=	THIS_MODULE,
 	/* Operations that make no sense on pfkey sockets. */
 	.bind		=	sock_no_bind,
 	.connect	=	sock_no_connect,
diff -urN linux-2.5.68-bk11/net/llc/af_llc.c linux-2.5.68-bk12/net/llc/af_llc.c
--- linux-2.5.68-bk11/net/llc/af_llc.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/llc/af_llc.c	2003-05-04 04:41:56.000000000 -0700
@@ -1023,6 +1023,7 @@
 
 static struct proto_ops llc_ui_ops = {
 	.family	     = PF_LLC,
+	.owner       = THIS_MODULE,
 	.release     = llc_ui_release,
 	.bind	     = llc_ui_bind,
 	.connect     = llc_ui_connect,
diff -urN linux-2.5.68-bk11/net/netlink/af_netlink.c linux-2.5.68-bk12/net/netlink/af_netlink.c
--- linux-2.5.68-bk11/net/netlink/af_netlink.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/netlink/af_netlink.c	2003-05-04 04:41:57.000000000 -0700
@@ -235,6 +235,7 @@
 		return -ENOMEM;
 
 	sock_init_data(sock,sk);
+	sk_set_owner(sk, THIS_MODULE);
 
 	nlk = nlk_sk(sk) = kmalloc(sizeof(*nlk), GFP_KERNEL);
 	if (!nlk) {
@@ -1030,7 +1031,7 @@
                 
 struct proto_ops netlink_ops = {
 	.family =	PF_NETLINK,
-
+	.owner =	THIS_MODULE,
 	.release =	netlink_release,
 	.bind =		netlink_bind,
 	.connect =	netlink_connect,
diff -urN linux-2.5.68-bk11/net/netrom/af_netrom.c linux-2.5.68-bk12/net/netrom/af_netrom.c
--- linux-2.5.68-bk11/net/netrom/af_netrom.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/netrom/af_netrom.c	2003-05-04 04:41:57.000000000 -0700
@@ -1227,7 +1227,7 @@
 
 static struct proto_ops nr_proto_ops = {
 	.family		=	PF_NETROM,
-
+	.owner		=	THIS_MODULE,
 	.release	=	nr_release,
 	.bind		=	nr_bind,
 	.connect	=	nr_connect,
diff -urN linux-2.5.68-bk11/net/netsyms.c linux-2.5.68-bk12/net/netsyms.c
--- linux-2.5.68-bk11/net/netsyms.c	2003-04-19 19:49:12.000000000 -0700
+++ linux-2.5.68-bk12/net/netsyms.c	2003-05-04 04:41:57.000000000 -0700
@@ -320,6 +320,7 @@
 EXPORT_SYMBOL(xfrm4_rcv);
 EXPORT_SYMBOL(xfrm4_tunnel_register);
 EXPORT_SYMBOL(xfrm4_tunnel_deregister);
+EXPORT_SYMBOL(xfrm4_tunnel_check_size);
 EXPORT_SYMBOL(xfrm_register_type);
 EXPORT_SYMBOL(xfrm_unregister_type);
 EXPORT_SYMBOL(xfrm_get_type);
diff -urN linux-2.5.68-bk11/net/packet/af_packet.c linux-2.5.68-bk12/net/packet/af_packet.c
--- linux-2.5.68-bk11/net/packet/af_packet.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/packet/af_packet.c	2003-05-04 04:41:57.000000000 -0700
@@ -950,6 +950,7 @@
 		sock->ops = &packet_ops_spkt;
 #endif
 	sock_init_data(sock,sk);
+	sk_set_owner(sk, THIS_MODULE);
 
 	po = pkt_sk(sk) = kmalloc(sizeof(*po), GFP_KERNEL);
 	if (!po)
@@ -1705,7 +1706,7 @@
 #ifdef CONFIG_SOCK_PACKET
 struct proto_ops packet_ops_spkt = {
 	.family =	PF_PACKET,
-
+	.owner =	THIS_MODULE,
 	.release =	packet_release,
 	.bind =		packet_bind_spkt,
 	.connect =	sock_no_connect,
@@ -1727,7 +1728,7 @@
 
 struct proto_ops packet_ops = {
 	.family =	PF_PACKET,
-
+	.owner =	THIS_MODULE,
 	.release =	packet_release,
 	.bind =		packet_bind,
 	.connect =	sock_no_connect,
diff -urN linux-2.5.68-bk11/net/rose/af_rose.c linux-2.5.68-bk12/net/rose/af_rose.c
--- linux-2.5.68-bk11/net/rose/af_rose.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/rose/af_rose.c	2003-05-04 04:41:57.000000000 -0700
@@ -1424,7 +1424,7 @@
 
 static struct proto_ops rose_proto_ops = {
 	.family		=	PF_ROSE,
-
+	.owner		=	THIS_MODULE,
 	.release	=	rose_release,
 	.bind		=	rose_bind,
 	.connect	=	rose_connect,
diff -urN linux-2.5.68-bk11/net/sctp/ipv6.c linux-2.5.68-bk12/net/sctp/ipv6.c
--- linux-2.5.68-bk11/net/sctp/ipv6.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/sctp/ipv6.c	2003-05-04 04:41:57.000000000 -0700
@@ -508,6 +508,7 @@
 		goto out;
 
 	sock_init_data(NULL, newsk);
+	sk_set_owner(newsk, THIS_MODULE);
 
 	newsk->type = SOCK_STREAM;
 
@@ -749,6 +750,7 @@
 
 static struct proto_ops inet6_seqpacket_ops = {
 	.family     = PF_INET6,
+	.owner      = THIS_MODULE,
 	.release    = inet6_release,
 	.bind       = inet6_bind,
 	.connect    = inet_dgram_connect,
diff -urN linux-2.5.68-bk11/net/sctp/protocol.c linux-2.5.68-bk12/net/sctp/protocol.c
--- linux-2.5.68-bk11/net/sctp/protocol.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/sctp/protocol.c	2003-05-04 04:41:57.000000000 -0700
@@ -499,6 +499,7 @@
 		goto out;
 
 	sock_init_data(NULL, newsk);
+	sk_set_owner(newsk, THIS_MODULE);
 
 	newsk->type = SOCK_STREAM;
 
@@ -748,6 +749,7 @@
 /* Socket operations.  */
 struct proto_ops inet_seqpacket_ops = {
 	.family      = PF_INET,
+	.owner       = THIS_MODULE,
 	.release     = inet_release,       /* Needs to be wrapped... */
 	.bind        = inet_bind,
 	.connect     = inet_dgram_connect,
diff -urN linux-2.5.68-bk11/net/socket.c linux-2.5.68-bk12/net/socket.c
--- linux-2.5.68-bk11/net/socket.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/socket.c	2003-05-04 04:41:57.000000000 -0700
@@ -141,36 +141,6 @@
 
 static struct net_proto_family *net_families[NPROTO];
 
-static __inline__ void net_family_bug(int family)
-{
-	printk(KERN_ERR "%d is not yet sock_registered!\n", family);
-	BUG();
-}
-
-int net_family_get(int family)
-{
-	struct net_proto_family *prot = net_families[family];
-	int rc = 1;
-
-	barrier();
-	if (likely(prot != NULL))
-		rc = try_module_get(prot->owner);
-	else
-		net_family_bug(family);
-	return rc;
-}
-
-void net_family_put(int family)
-{
-	struct net_proto_family *prot = net_families[family];
-
-	barrier();
-	if (likely(prot != NULL))
-		module_put(prot->owner);
-	else
-		net_family_bug(family);
-}
-
 #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
 static atomic_t net_family_lockct = ATOMIC_INIT(0);
 static spinlock_t net_family_lock = SPIN_LOCK_UNLOCKED;
@@ -535,11 +505,11 @@
 void sock_release(struct socket *sock)
 {
 	if (sock->ops) {
-		const int family = sock->ops->family;
+		struct module *owner = sock->ops->owner;
 
 		sock->ops->release(sock);
 		sock->ops = NULL;
-		net_family_put(family);
+		module_put(owner);
 	}
 
 	if (sock->fasync_list)
@@ -1091,19 +1061,37 @@
 
 	sock->type  = type;
 
+	/*
+	 * We will call the ->create function, that possibly is in a loadable
+	 * module, so we have to bump that loadable module refcnt first.
+	 */
 	i = -EAFNOSUPPORT;
-	if (!net_family_get(family))
-		goto out_release;
-
-	if ((i = net_families[family]->create(sock, protocol)) < 0) 
+	if (!try_module_get(net_families[family]->owner))
 		goto out_release;
 
+	if ((i = net_families[family]->create(sock, protocol)) < 0)
+		goto out_module_put;
+	/*
+	 * Now to bump the refcnt of the [loadable] module that owns this
+	 * socket at sock_release time we decrement its refcnt.
+	 */
+	if (!try_module_get(sock->ops->owner)) {
+		sock->ops = NULL;
+		goto out_module_put;
+	}
+	/*
+	 * Now that we're done with the ->create function, the [loadable]
+	 * module can have its refcnt decremented
+	 */
+	module_put(net_families[family]->owner);
 	*res = sock;
 	security_socket_post_create(sock, family, type, protocol);
 
 out:
 	net_family_read_unlock();
 	return i;
+out_module_put:
+	module_put(net_families[family]->owner);
 out_release:
 	sock_release(sock);
 	goto out;
@@ -1288,28 +1276,30 @@
 	if (err)
 		goto out_release;
 
-	err = -EAFNOSUPPORT;
-	if (!net_family_get(sock->ops->family))
-		goto out_release;
+	/*
+	 * We don't need try_module_get here, as the listening socket (sock)
+	 * has the protocol module (sock->ops->owner) held.
+	 */
+	__module_get(sock->ops->owner);
 
 	err = sock->ops->accept(sock, newsock, sock->file->f_flags);
 	if (err < 0)
-		goto out_family_put;
+		goto out_module_put;
 
 	if (upeer_sockaddr) {
 		if(newsock->ops->getname(newsock, (struct sockaddr *)address, &len, 2)<0) {
 			err = -ECONNABORTED;
-			goto out_family_put;
+			goto out_module_put;
 		}
 		err = move_addr_to_user(address, len, upeer_sockaddr, upeer_addrlen);
 		if (err < 0)
-			goto out_family_put;
+			goto out_module_put;
 	}
 
 	/* File flags are not inherited via accept() unlike another OSes. */
 
 	if ((err = sock_map_fd(newsock)) < 0)
-		goto out_family_put;
+		goto out_module_put;
 
 	security_socket_post_accept(sock, newsock);
 
@@ -1317,8 +1307,8 @@
 	sockfd_put(sock);
 out:
 	return err;
-out_family_put:
-	net_family_put(sock->ops->family);
+out_module_put:
+	module_put(sock->ops->owner);
 out_release:
 	sock_release(newsock);
 	goto out_put;
diff -urN linux-2.5.68-bk11/net/unix/af_unix.c linux-2.5.68-bk12/net/unix/af_unix.c
--- linux-2.5.68-bk11/net/unix/af_unix.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/unix/af_unix.c	2003-05-04 04:41:57.000000000 -0700
@@ -494,6 +494,7 @@
 	atomic_inc(&unix_nr_socks);
 
 	sock_init_data(sock,sk);
+	sk_set_owner(sk, THIS_MODULE);
 
 	sk->write_space		=	unix_write_space;
 
@@ -1884,7 +1885,7 @@
 
 struct proto_ops unix_stream_ops = {
 	.family =	PF_UNIX,
-	
+	.owner =	THIS_MODULE,
 	.release =	unix_release,
 	.bind =		unix_bind,
 	.connect =	unix_stream_connect,
@@ -1905,7 +1906,7 @@
 
 struct proto_ops unix_dgram_ops = {
 	.family =	PF_UNIX,
-
+	.owner =	THIS_MODULE,
 	.release =	unix_release,
 	.bind =		unix_bind,
 	.connect =	unix_dgram_connect,
diff -urN linux-2.5.68-bk11/net/unix/sysctl_net_unix.c linux-2.5.68-bk12/net/unix/sysctl_net_unix.c
--- linux-2.5.68-bk11/net/unix/sysctl_net_unix.c	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk12/net/unix/sysctl_net_unix.c	2003-05-04 04:41:57.000000000 -0700
@@ -20,7 +20,7 @@
 		.procname	= "max_dgram_qlen",
 		.data		= &sysctl_unix_max_dgram_qlen,
 		.maxlen		= sizeof(int),
-		.mode		= 0600,
+		.mode		= 0644,
 		.proc_handler	= &proc_dointvec
 	},
 	{ .ctl_name = 0 }
diff -urN linux-2.5.68-bk11/net/wanrouter/af_wanpipe.c linux-2.5.68-bk12/net/wanrouter/af_wanpipe.c
--- linux-2.5.68-bk11/net/wanrouter/af_wanpipe.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/wanrouter/af_wanpipe.c	2003-05-04 04:41:57.000000000 -0700
@@ -2551,7 +2551,7 @@
 
 struct proto_ops wanpipe_ops = {
 	.family = 	PF_WANPIPE,
-
+	.owner =	THIS_MODULE,
 	.release = 	wanpipe_release,
 	.bind = 	wanpipe_bind,
 	.connect = 	wanpipe_connect,
diff -urN linux-2.5.68-bk11/net/x25/af_x25.c linux-2.5.68-bk12/net/x25/af_x25.c
--- linux-2.5.68-bk11/net/x25/af_x25.c	2003-05-04 04:39:47.000000000 -0700
+++ linux-2.5.68-bk12/net/x25/af_x25.c	2003-05-04 04:41:57.000000000 -0700
@@ -1323,7 +1323,7 @@
 
 static struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = {
 	.family =	AF_X25,
-
+	.owner =	THIS_MODULE,
 	.release =	x25_release,
 	.bind =		x25_bind,
 	.connect =	x25_connect,
