From 55e7229e45a33e302c7df27bb79e05d4c6149702 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 5 May 2005 14:27:56 -0700 Subject: [PATCH] --- yaml --- r: 960 b: refs/heads/master c: 8edf72ebce06d52e855438ec18fe20dea7a4cc04 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/Kconfig | 20 +- trunk/arch/arm/kernel/entry-armv.S | 14 +- trunk/arch/arm/kernel/head.S | 3 +- trunk/arch/arm/kernel/process.c | 25 +-- trunk/arch/arm/kernel/sys_arm.c | 2 +- trunk/arch/arm/kernel/traps.c | 14 +- trunk/arch/arm/kernel/vmlinux.lds.S | 3 +- trunk/arch/arm/mach-clps711x/Kconfig | 3 - trunk/arch/arm/mach-footbridge/Kconfig | 12 -- trunk/arch/arm/mach-imx/Kconfig | 1 - trunk/arch/arm/mm/Kconfig | 24 +-- trunk/arch/sparc64/kernel/sparc64_ksyms.c | 2 +- trunk/arch/sparc64/mm/init.c | 2 +- trunk/drivers/net/appletalk/cops.c | 4 +- trunk/drivers/net/appletalk/ltpc.c | 2 +- trunk/drivers/net/tg3.c | 85 +++++---- trunk/fs/xfs/Makefile | 2 +- trunk/fs/xfs/linux-2.6/xfs_aops.c | 81 ++++---- trunk/fs/xfs/linux-2.6/xfs_buf.c | 11 +- trunk/fs/xfs/linux-2.6/xfs_file.c | 43 +---- trunk/fs/xfs/linux-2.6/xfs_lrw.c | 3 - trunk/fs/xfs/linux-2.6/xfs_vnode.c | 5 +- trunk/fs/xfs/linux-2.6/xfs_vnode.h | 10 +- trunk/fs/xfs/xfs_dfrag.c | 2 +- trunk/fs/xfs/xfs_iget.c | 51 +---- trunk/fs/xfs/xfs_inode.c | 2 +- trunk/fs/xfs/xfs_inode.h | 6 +- trunk/fs/xfs/xfs_iomap.c | 26 ++- trunk/fs/xfs/xfs_iomap.h | 25 +-- trunk/fs/xfs/xfs_mount.c | 9 - trunk/fs/xfs/xfs_mount.h | 19 +- trunk/fs/xfs/xfs_types.h | 1 - trunk/fs/xfs/xfs_utils.c | 2 +- trunk/fs/xfs/xfs_utils.h | 2 +- trunk/fs/xfs/xfs_vfsops.c | 67 +++---- trunk/fs/xfs/xfs_vnodeops.c | 11 +- trunk/include/asm-arm/arch-imx/imxfb.h | 35 ---- trunk/include/asm-arm/processor.h | 7 +- trunk/include/asm-arm/thread_info.h | 6 +- trunk/include/asm-sparc64/pgalloc.h | 9 +- trunk/include/linux/if_ltalk.h | 2 +- trunk/include/net/sock.h | 2 - trunk/net/appletalk/dev.c | 22 +-- trunk/net/core/sock.c | 12 +- trunk/net/decnet/dn_dev.c | 2 +- trunk/net/ipv4/multipath_wrandom.c | 6 +- trunk/scripts/kconfig/Makefile | 14 +- trunk/scripts/kconfig/POTFILES.in | 5 - trunk/scripts/kconfig/conf.c | 20 +- trunk/scripts/kconfig/confdata.c | 16 +- trunk/scripts/kconfig/gconf.c | 52 +++-- trunk/scripts/kconfig/kxgettext.c | 221 ---------------------- trunk/scripts/kconfig/lkc.h | 8 - trunk/scripts/kconfig/mconf.c | 120 ++++++------ trunk/scripts/kconfig/menu.c | 4 +- trunk/scripts/kconfig/qconf.cc | 59 ++---- 57 files changed, 356 insertions(+), 862 deletions(-) delete mode 100644 trunk/include/asm-arm/arch-imx/imxfb.h delete mode 100644 trunk/scripts/kconfig/POTFILES.in delete mode 100644 trunk/scripts/kconfig/kxgettext.c diff --git a/[refs] b/[refs] index 271eefbd7d17..699c7616701d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fd4e5f29f7354c3e3edaa03d37a7bf83b0cbae36 +refs/heads/master: 8edf72ebce06d52e855438ec18fe20dea7a4cc04 diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig index bf397a9f8ac2..8bfcb37460fa 100644 --- a/trunk/arch/arm/Kconfig +++ b/trunk/arch/arm/Kconfig @@ -85,7 +85,6 @@ choice config ARCH_CLPS7500 bool "Cirrus-CL-PS7500FE" select TIMER_ACORN - select ISA config ARCH_CLPS711X bool "CLPS711x/EP721x-based" @@ -97,7 +96,6 @@ config ARCH_CO285 config ARCH_EBSA110 bool "EBSA-110" - select ISA help This is an evaluation board for the StrongARM processor available from Digital. It has limited hardware on-board, including an onboard @@ -122,16 +120,13 @@ config ARCH_INTEGRATOR config ARCH_IOP3XX bool "IOP3xx-based" - select PCI config ARCH_IXP4XX bool "IXP4xx-based" select DMABOUNCE - select PCI config ARCH_IXP2000 bool "IXP2400/2800-based" - select PCI config ARCH_L7200 bool "LinkUp-L7200" @@ -160,8 +155,6 @@ config ARCH_RPC config ARCH_SA1100 bool "SA1100-based" - select ISA - select DISCONTIGMEM config ARCH_S3C2410 bool "Samsung S3C2410" @@ -172,9 +165,6 @@ config ARCH_S3C2410 config ARCH_SHARK bool "Shark" - select ISA - select ISA_DMA - select PCI config ARCH_LH7A40X bool "Sharp LH7A40X" @@ -262,6 +252,8 @@ config ARM_AMBA config ISA bool + depends on FOOTBRIDGE_HOST || ARCH_SHARK || ARCH_CLPS7500 || ARCH_EBSA110 || ARCH_CDB89712 || ARCH_EDB7211 || ARCH_SA1100 || ARCH_MX1ADS + default y help Find out whether you have ISA slots on your motherboard. ISA is the name of a bus system, i.e. the way the CPU talks to the other stuff @@ -271,6 +263,8 @@ config ISA config ISA_DMA bool + depends on FOOTBRIDGE_HOST || ARCH_SHARK + default y config ISA_DMA_API bool @@ -278,6 +272,7 @@ config ISA_DMA_API config PCI bool "PCI support" if ARCH_INTEGRATOR_AP + default y if ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_IXP2000 help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside @@ -305,7 +300,7 @@ menu "Kernel Features" config SMP bool "Symmetric Multi-Processing (EXPERIMENTAL)" - depends on EXPERIMENTAL #&& n + depends on EXPERIMENTAL && n help This enables support for systems with more than one CPU. If you have a system with only one CPU, like most personal computers, say N. If @@ -345,7 +340,8 @@ config PREEMPT config DISCONTIGMEM bool - default (ARCH_LH7A40X && !LH7A40X_CONTIGMEM) + depends on ARCH_EDB7211 || ARCH_SA1100 || (ARCH_LH7A40X && !LH7A40X_CONTIGMEM) + default y help Say Y to support efficient handling of discontiguous physical memory, for architectures which are either NUMA (Non-Uniform Memory Access) diff --git a/trunk/arch/arm/kernel/entry-armv.S b/trunk/arch/arm/kernel/entry-armv.S index 4eb36155dc93..080df907f242 100644 --- a/trunk/arch/arm/kernel/entry-armv.S +++ b/trunk/arch/arm/kernel/entry-armv.S @@ -17,8 +17,8 @@ #include #include -#include /* should be moved into entry-macro.S */ -#include /* should be moved into entry-macro.S */ +#include @ should be moved into entry-macro.S +#include @ should be moved into entry-macro.S #include #include "entry-header.S" @@ -505,9 +505,9 @@ ENTRY(__switch_to) mra r4, r5, acc0 stmia ip, {r4, r5} #endif -#if defined(CONFIG_HAS_TLS_REG) +#ifdef CONFIG_HAS_TLS_REG mcr p15, 0, r3, c13, c0, 3 @ set TLS register -#elif !defined(CONFIG_TLS_REG_EMUL) +#else mov r4, #0xffff0fff str r3, [r4, #-15] @ TLS val at 0xffff0ff0 #endif @@ -690,7 +690,11 @@ __kuser_cmpxchg: @ 0xffff0fc0 __kuser_get_tls: @ 0xffff0fe0 -#if !defined(CONFIG_HAS_TLS_REG) && !defined(CONFIG_TLS_REG_EMUL) +#ifndef CONFIG_HAS_TLS_REG + +#ifdef CONFIG_SMP /* sanity check */ +#error "CONFIG_SMP without CONFIG_HAS_TLS_REG is wrong" +#endif ldr r0, [pc, #(16 - 8)] @ TLS stored at 0xffff0ff0 mov pc, lr diff --git a/trunk/arch/arm/kernel/head.S b/trunk/arch/arm/kernel/head.S index 4733877296d4..171b3e811c71 100644 --- a/trunk/arch/arm/kernel/head.S +++ b/trunk/arch/arm/kernel/head.S @@ -19,7 +19,6 @@ #include #include #include -#include #include #define PROCINFO_MMUFLAGS 8 @@ -132,7 +131,7 @@ __switch_data: .long processor_id @ r4 .long __machine_arch_type @ r5 .long cr_alignment @ r6 - .long init_thread_union + THREAD_START_SP @ sp + .long init_thread_union+8192 @ sp /* * The following fragment of code is executed with the MMU on, and uses diff --git a/trunk/arch/arm/kernel/process.c b/trunk/arch/arm/kernel/process.c index 8f146a4b4752..26eacd3e5def 100644 --- a/trunk/arch/arm/kernel/process.c +++ b/trunk/arch/arm/kernel/process.c @@ -256,6 +256,8 @@ static unsigned long *thread_info_head; static unsigned int nr_thread_info; #define EXTRA_TASK_STRUCT 4 +#define ll_alloc_task_struct() ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) +#define ll_free_task_struct(p) free_pages((unsigned long)(p),1) struct thread_info *alloc_thread_info(struct task_struct *task) { @@ -272,16 +274,17 @@ struct thread_info *alloc_thread_info(struct task_struct *task) } if (!thread) - thread = (struct thread_info *) - __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER); + thread = ll_alloc_task_struct(); -#ifdef CONFIG_DEBUG_STACK_USAGE +#ifdef CONFIG_MAGIC_SYSRQ /* * The stack must be cleared if you want SYSRQ-T to * give sensible stack usage information */ - if (thread) - memzero(thread, THREAD_SIZE); + if (thread) { + char *p = (char *)thread; + memzero(p+KERNEL_STACK_SIZE, KERNEL_STACK_SIZE); + } #endif return thread; } @@ -294,7 +297,7 @@ void free_thread_info(struct thread_info *thread) thread_info_head = p; nr_thread_info += 1; } else - free_pages((unsigned long)thread, THREAD_SIZE_ORDER); + ll_free_task_struct(thread); } /* @@ -347,7 +350,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start, struct thread_info *thread = p->thread_info; struct pt_regs *childregs; - childregs = ((struct pt_regs *)((unsigned long)thread + THREAD_START_SP)) - 1; + childregs = ((struct pt_regs *)((unsigned long)thread + THREAD_SIZE - 8)) - 1; *childregs = *regs; childregs->ARM_r0 = 0; childregs->ARM_sp = stack_start; @@ -444,17 +447,15 @@ EXPORT_SYMBOL(kernel_thread); unsigned long get_wchan(struct task_struct *p) { unsigned long fp, lr; - unsigned long stack_start, stack_end; + unsigned long stack_page; int count = 0; if (!p || p == current || p->state == TASK_RUNNING) return 0; - stack_start = (unsigned long)(p->thread_info + 1); - stack_end = ((unsigned long)p->thread_info) + THREAD_SIZE; - + stack_page = 4096 + (unsigned long)p->thread_info; fp = thread_saved_fp(p); do { - if (fp < stack_start || fp > stack_end) + if (fp < stack_page || fp > 4092+stack_page) return 0; lr = pc_pointer (((unsigned long *)fp)[-1]); if (!in_sched_functions(lr)) diff --git a/trunk/arch/arm/kernel/sys_arm.c b/trunk/arch/arm/kernel/sys_arm.c index f897ce2ccf0d..ef32577da304 100644 --- a/trunk/arch/arm/kernel/sys_arm.c +++ b/trunk/arch/arm/kernel/sys_arm.c @@ -302,7 +302,7 @@ long execve(const char *filename, char **argv, char **envp) "b ret_to_user" : : "r" (current_thread_info()), - "Ir" (THREAD_START_SP - sizeof(regs)), + "Ir" (THREAD_SIZE - 8 - sizeof(regs)), "r" (®s), "Ir" (sizeof(regs)) : "r0", "r1", "r2", "r3", "ip", "memory"); diff --git a/trunk/arch/arm/kernel/traps.c b/trunk/arch/arm/kernel/traps.c index 14df16b983f4..3a001fe5540b 100644 --- a/trunk/arch/arm/kernel/traps.c +++ b/trunk/arch/arm/kernel/traps.c @@ -218,8 +218,7 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) tsk->comm, tsk->pid, tsk->thread_info + 1); if (!user_mode(regs) || in_interrupt()) { - dump_mem("Stack: ", regs->ARM_sp, - THREAD_SIZE + (unsigned long)tsk->thread_info); + dump_mem("Stack: ", regs->ARM_sp, 8192+(unsigned long)tsk->thread_info); dump_backtrace(regs, tsk); dump_instr(regs); } @@ -451,9 +450,9 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) case NR(set_tls): thread->tp_value = regs->ARM_r0; -#if defined(CONFIG_HAS_TLS_REG) +#ifdef CONFIG_HAS_TLS_REG asm ("mcr p15, 0, %0, c13, c0, 3" : : "r" (regs->ARM_r0) ); -#elif !defined(CONFIG_TLS_REG_EMUL) +#else /* * User space must never try to access this directly. * Expect your app to break eventually if you do so. @@ -498,14 +497,11 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) return 0; } -#ifdef CONFIG_TLS_REG_EMUL +#if defined(CONFIG_CPU_32v6) && !defined(CONFIG_HAS_TLS_REG) /* * We might be running on an ARMv6+ processor which should have the TLS - * register but for some reason we can't use it, or maybe an SMP system - * using a pre-ARMv6 processor (there are apparently a few prototypes like - * that in existence) and therefore access to that register must be - * emulated. + * register, but for some reason we can't use it and have to emulate it. */ static int get_tp_trap(struct pt_regs *regs, unsigned int instr) diff --git a/trunk/arch/arm/kernel/vmlinux.lds.S b/trunk/arch/arm/kernel/vmlinux.lds.S index ad2d66c93a5c..a39c6a42d68a 100644 --- a/trunk/arch/arm/kernel/vmlinux.lds.S +++ b/trunk/arch/arm/kernel/vmlinux.lds.S @@ -5,7 +5,6 @@ #include #include -#include OUTPUT_ARCH(arm) ENTRY(stext) @@ -104,7 +103,7 @@ SECTIONS __data_loc = ALIGN(4); /* location in binary */ . = DATAADDR; #else - . = ALIGN(THREAD_SIZE); + . = ALIGN(8192); __data_loc = .; #endif diff --git a/trunk/arch/arm/mach-clps711x/Kconfig b/trunk/arch/arm/mach-clps711x/Kconfig index 45c930ccd064..f6e676322ca9 100644 --- a/trunk/arch/arm/mach-clps711x/Kconfig +++ b/trunk/arch/arm/mach-clps711x/Kconfig @@ -10,7 +10,6 @@ config ARCH_AUTCPU12 config ARCH_CDB89712 bool "CDB89712" - select ISA help This is an evaluation board from Cirrus for the CS89712 processor. The board includes 2 serial ports, Ethernet, IRDA, and expansion @@ -27,8 +26,6 @@ config ARCH_CLEP7312 config ARCH_EDB7211 bool "EDB7211" - select ISA - select DISCONTIGMEM help Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211 evaluation board. diff --git a/trunk/arch/arm/mach-footbridge/Kconfig b/trunk/arch/arm/mach-footbridge/Kconfig index 324d9edeec38..1090c680b6dd 100644 --- a/trunk/arch/arm/mach-footbridge/Kconfig +++ b/trunk/arch/arm/mach-footbridge/Kconfig @@ -5,9 +5,6 @@ menu "Footbridge Implementations" config ARCH_CATS bool "CATS" select FOOTBRIDGE_HOST - select ISA - select ISA_DMA - select PCI help Say Y here if you intend to run this kernel on the CATS. @@ -16,9 +13,6 @@ config ARCH_CATS config ARCH_PERSONAL_SERVER bool "Compaq Personal Server" select FOOTBRIDGE_HOST - select ISA - select ISA_DMA - select PCI ---help--- Say Y here if you intend to run this kernel on the Compaq Personal Server. @@ -48,9 +42,6 @@ config ARCH_EBSA285_HOST bool "EBSA285 (host mode)" select ARCH_EBSA285 select FOOTBRIDGE_HOST - select ISA - select ISA_DMA - select PCI help Say Y here if you intend to run this kernel on the EBSA285 card in host ("central function") mode. @@ -60,9 +51,6 @@ config ARCH_EBSA285_HOST config ARCH_NETWINDER bool "NetWinder" select FOOTBRIDGE_HOST - select ISA - select ISA_DMA - select PCI help Say Y here if you intend to run this kernel on the Rebel.COM NetWinder. Information about this machine can be found at: diff --git a/trunk/arch/arm/mach-imx/Kconfig b/trunk/arch/arm/mach-imx/Kconfig index cddd194ac6eb..ec85813ee5dc 100644 --- a/trunk/arch/arm/mach-imx/Kconfig +++ b/trunk/arch/arm/mach-imx/Kconfig @@ -4,7 +4,6 @@ menu "IMX Implementations" config ARCH_MX1ADS bool "mx1ads" depends on ARCH_IMX - select ISA help Say Y here if you are using the Motorola MX1ADS board diff --git a/trunk/arch/arm/mm/Kconfig b/trunk/arch/arm/mm/Kconfig index c4fc6be629de..27892e34b060 100644 --- a/trunk/arch/arm/mm/Kconfig +++ b/trunk/arch/arm/mm/Kconfig @@ -410,23 +410,17 @@ config CPU_BPREDICT_DISABLE help Say Y here to disable branch prediction. If unsure, say N. -config TLS_REG_EMUL - bool - default y if (SMP || CPU_32v6) && (CPU_32v5 || CPU_32v4 || CPU_32v3) - help - We might be running on an ARMv6+ processor which should have the TLS - register but for some reason we can't use it, or maybe an SMP system - using a pre-ARMv6 processor (there are apparently a few prototypes - like that in existence) and therefore access to that register must - be emulated. - config HAS_TLS_REG bool - depends on CPU_32v6 - default y if !TLS_REG_EMUL + depends on CPU_32v6 && !CPU_32v5 && !CPU_32v4 && !CPU_32v3 + default y help This selects support for the CP15 thread register. - It is defined to be available on ARMv6 or later. If a particular - ARMv6 or later CPU doesn't support it then it must omc;ide "select - TLS_REG_EMUL" along with its other caracteristics. + It is defined to be available on ARMv6 or later. However + if the kernel is configured to support multiple CPUs including + a pre-ARMv6 processors, or if a given ARMv6 processor doesn't + implement the thread register for some reason, then access to + this register from user space must be trapped and emulated. + If user space is relying on the __kuser_get_tls code then + there should not be any impact. diff --git a/trunk/arch/sparc64/kernel/sparc64_ksyms.c b/trunk/arch/sparc64/kernel/sparc64_ksyms.c index cad5a1122800..e78cc53594fa 100644 --- a/trunk/arch/sparc64/kernel/sparc64_ksyms.c +++ b/trunk/arch/sparc64/kernel/sparc64_ksyms.c @@ -278,7 +278,7 @@ EXPORT_SYMBOL(verify_compat_iovec); EXPORT_SYMBOL(dump_thread); EXPORT_SYMBOL(dump_fpu); -EXPORT_SYMBOL(__pte_alloc_one_kernel); +EXPORT_SYMBOL(pte_alloc_one_kernel); #ifndef CONFIG_SMP EXPORT_SYMBOL(pgt_quicklists); #endif diff --git a/trunk/arch/sparc64/mm/init.c b/trunk/arch/sparc64/mm/init.c index db6fa77b4dab..9c5222075da9 100644 --- a/trunk/arch/sparc64/mm/init.c +++ b/trunk/arch/sparc64/mm/init.c @@ -1114,7 +1114,7 @@ struct pgtable_cache_struct pgt_quicklists; #else #define DC_ALIAS_SHIFT 0 #endif -pte_t *__pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) +pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { struct page *page; unsigned long color; diff --git a/trunk/drivers/net/appletalk/cops.c b/trunk/drivers/net/appletalk/cops.c index 9edaa183227a..2161c2d585f0 100644 --- a/trunk/drivers/net/appletalk/cops.c +++ b/trunk/drivers/net/appletalk/cops.c @@ -65,7 +65,7 @@ static const char *version = #include #include #include -#include +#include /* For ltalk_setup() */ #include /* For udelay() */ #include #include @@ -223,7 +223,7 @@ struct net_device * __init cops_probe(int unit) int base_addr; int err = 0; - dev = alloc_ltalkdev(sizeof(struct cops_local)); + dev = alloc_netdev(sizeof(struct cops_local), "lt%d", ltalk_setup); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/trunk/drivers/net/appletalk/ltpc.c b/trunk/drivers/net/appletalk/ltpc.c index db4f369637b6..ad8e943231a1 100644 --- a/trunk/drivers/net/appletalk/ltpc.c +++ b/trunk/drivers/net/appletalk/ltpc.c @@ -1039,7 +1039,7 @@ struct net_device * __init ltpc_probe(void) unsigned long f; unsigned long timeout; - dev = alloc_ltalkdev(sizeof(struct ltpc_private)); + dev = alloc_netdev(sizeof(struct ltpc_private), "lt%d", ltalk_setup); if (!dev) goto out; diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index f79b02e80e75..058c70c6f1ac 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -61,8 +61,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.27" -#define DRV_MODULE_RELDATE "May 5, 2005" +#define DRV_MODULE_VERSION "3.26" +#define DRV_MODULE_RELDATE "April 24, 2005" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -3020,7 +3020,7 @@ static irqreturn_t tg3_test_isr(int irq, void *dev_id, } static int tg3_init_hw(struct tg3 *); -static int tg3_halt(struct tg3 *, int); +static int tg3_halt(struct tg3 *); #ifdef CONFIG_NET_POLL_CONTROLLER static void tg3_poll_controller(struct net_device *dev) @@ -3044,7 +3044,7 @@ static void tg3_reset_task(void *_data) restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER; tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER; - tg3_halt(tp, 0); + tg3_halt(tp); tg3_init_hw(tp); tg3_netif_start(tp); @@ -3390,7 +3390,7 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu) spin_lock_irq(&tp->lock); spin_lock(&tp->tx_lock); - tg3_halt(tp, 1); + tg3_halt(tp); tg3_set_mtu(dev, tp, new_mtu); @@ -3657,7 +3657,7 @@ static int tg3_alloc_consistent(struct tg3 *tp) /* To stop a block, clear the enable bit and poll till it * clears. tp->lock is held. */ -static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int silent) +static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit) { unsigned int i; u32 val; @@ -3690,7 +3690,7 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int break; } - if (i == MAX_WAIT_CNT && !silent) { + if (i == MAX_WAIT_CNT) { printk(KERN_ERR PFX "tg3_stop_block timed out, " "ofs=%lx enable_bit=%x\n", ofs, enable_bit); @@ -3701,7 +3701,7 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int } /* tp->lock is held. */ -static int tg3_abort_hw(struct tg3 *tp, int silent) +static int tg3_abort_hw(struct tg3 *tp) { int i, err; @@ -3711,20 +3711,22 @@ static int tg3_abort_hw(struct tg3 *tp, int silent) tw32_f(MAC_RX_MODE, tp->rx_mode); udelay(10); - err = tg3_stop_block(tp, RCVBDI_MODE, RCVBDI_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, RCVLPC_MODE, RCVLPC_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, RCVLSC_MODE, RCVLSC_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, RCVDBDI_MODE, RCVDBDI_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, RCVDCC_MODE, RCVDCC_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, RCVCC_MODE, RCVCC_MODE_ENABLE, silent); - - err |= tg3_stop_block(tp, SNDBDS_MODE, SNDBDS_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, SNDBDI_MODE, SNDBDI_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, SNDDATAI_MODE, SNDDATAI_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, RDMAC_MODE, RDMAC_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, SNDDATAC_MODE, SNDDATAC_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, DMAC_MODE, DMAC_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, SNDBDC_MODE, SNDBDC_MODE_ENABLE, silent); + err = tg3_stop_block(tp, RCVBDI_MODE, RCVBDI_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVLPC_MODE, RCVLPC_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVLSC_MODE, RCVLSC_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVDBDI_MODE, RCVDBDI_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVDCC_MODE, RCVDCC_MODE_ENABLE); + err |= tg3_stop_block(tp, RCVCC_MODE, RCVCC_MODE_ENABLE); + + err |= tg3_stop_block(tp, SNDBDS_MODE, SNDBDS_MODE_ENABLE); + err |= tg3_stop_block(tp, SNDBDI_MODE, SNDBDI_MODE_ENABLE); + err |= tg3_stop_block(tp, SNDDATAI_MODE, SNDDATAI_MODE_ENABLE); + err |= tg3_stop_block(tp, RDMAC_MODE, RDMAC_MODE_ENABLE); + err |= tg3_stop_block(tp, SNDDATAC_MODE, SNDDATAC_MODE_ENABLE); + err |= tg3_stop_block(tp, DMAC_MODE, DMAC_MODE_ENABLE); + err |= tg3_stop_block(tp, SNDBDC_MODE, SNDBDC_MODE_ENABLE); + if (err) + goto out; tp->mac_mode &= ~MAC_MODE_TDE_ENABLE; tw32_f(MAC_MODE, tp->mac_mode); @@ -3742,24 +3744,27 @@ static int tg3_abort_hw(struct tg3 *tp, int silent) printk(KERN_ERR PFX "tg3_abort_hw timed out for %s, " "TX_MODE_ENABLE will not clear MAC_TX_MODE=%08x\n", tp->dev->name, tr32(MAC_TX_MODE)); - err |= -ENODEV; + return -ENODEV; } - err |= tg3_stop_block(tp, HOSTCC_MODE, HOSTCC_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, WDMAC_MODE, WDMAC_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, MBFREE_MODE, MBFREE_MODE_ENABLE, silent); + err = tg3_stop_block(tp, HOSTCC_MODE, HOSTCC_MODE_ENABLE); + err |= tg3_stop_block(tp, WDMAC_MODE, WDMAC_MODE_ENABLE); + err |= tg3_stop_block(tp, MBFREE_MODE, MBFREE_MODE_ENABLE); tw32(FTQ_RESET, 0xffffffff); tw32(FTQ_RESET, 0x00000000); - err |= tg3_stop_block(tp, BUFMGR_MODE, BUFMGR_MODE_ENABLE, silent); - err |= tg3_stop_block(tp, MEMARB_MODE, MEMARB_MODE_ENABLE, silent); + err |= tg3_stop_block(tp, BUFMGR_MODE, BUFMGR_MODE_ENABLE); + err |= tg3_stop_block(tp, MEMARB_MODE, MEMARB_MODE_ENABLE); + if (err) + goto out; if (tp->hw_status) memset(tp->hw_status, 0, TG3_HW_STATUS_SIZE); if (tp->hw_stats) memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats)); +out: return err; } @@ -4081,7 +4086,7 @@ static void tg3_stop_fw(struct tg3 *tp) } /* tp->lock is held. */ -static int tg3_halt(struct tg3 *tp, int silent) +static int tg3_halt(struct tg3 *tp) { int err; @@ -4089,7 +4094,7 @@ static int tg3_halt(struct tg3 *tp, int silent) tg3_write_sig_pre_reset(tp, RESET_KIND_SHUTDOWN); - tg3_abort_hw(tp, silent); + tg3_abort_hw(tp); err = tg3_chip_reset(tp); tg3_write_sig_legacy(tp, RESET_KIND_SHUTDOWN); @@ -5058,7 +5063,9 @@ static int tg3_reset_hw(struct tg3 *tp) tg3_write_sig_pre_reset(tp, RESET_KIND_INIT); if (tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) { - tg3_abort_hw(tp, 1); + err = tg3_abort_hw(tp); + if (err) + return err; } err = tg3_chip_reset(tp); @@ -5912,7 +5919,7 @@ static int tg3_test_msi(struct tg3 *tp) spin_lock_irq(&tp->lock); spin_lock(&tp->tx_lock); - tg3_halt(tp, 1); + tg3_halt(tp); err = tg3_init_hw(tp); spin_unlock(&tp->tx_lock); @@ -5977,7 +5984,7 @@ static int tg3_open(struct net_device *dev) err = tg3_init_hw(tp); if (err) { - tg3_halt(tp, 1); + tg3_halt(tp); tg3_free_rings(tp); } else { tp->timer_offset = HZ / 10; @@ -6013,7 +6020,7 @@ static int tg3_open(struct net_device *dev) pci_disable_msi(tp->pdev); tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; } - tg3_halt(tp, 1); + tg3_halt(tp); tg3_free_rings(tp); tg3_free_consistent(tp); @@ -6286,7 +6293,7 @@ static int tg3_close(struct net_device *dev) tg3_disable_ints(tp); - tg3_halt(tp, 1); + tg3_halt(tp); tg3_free_rings(tp); tp->tg3_flags &= ~(TG3_FLAG_INIT_COMPLETE | @@ -7006,7 +7013,7 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e tp->tx_pending = ering->tx_pending; if (netif_running(dev)) { - tg3_halt(tp, 1); + tg3_halt(tp); tg3_init_hw(tp); tg3_netif_start(tp); } @@ -7049,7 +7056,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam tp->tg3_flags &= ~TG3_FLAG_TX_PAUSE; if (netif_running(dev)) { - tg3_halt(tp, 1); + tg3_halt(tp); tg3_init_hw(tp); tg3_netif_start(tp); } @@ -9232,7 +9239,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { pci_save_state(tp->pdev); tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); - tg3_halt(tp, 1); + tg3_halt(tp); } err = tg3_test_dma(tp); @@ -9355,7 +9362,7 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state) spin_lock_irq(&tp->lock); spin_lock(&tp->tx_lock); - tg3_halt(tp, 1); + tg3_halt(tp); spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); diff --git a/trunk/fs/xfs/Makefile b/trunk/fs/xfs/Makefile index d3ff78354638..554e4a18c152 100644 --- a/trunk/fs/xfs/Makefile +++ b/trunk/fs/xfs/Makefile @@ -49,7 +49,7 @@ ifeq ($(CONFIG_XFS_TRACE),y) EXTRA_CFLAGS += -DXFS_LOG_TRACE EXTRA_CFLAGS += -DXFS_RW_TRACE EXTRA_CFLAGS += -DPAGEBUF_TRACE - EXTRA_CFLAGS += -DXFS_VNODE_TRACE + # EXTRA_CFLAGS += -DXFS_VNODE_TRACE endif obj-$(CONFIG_XFS_FS) += xfs.o diff --git a/trunk/fs/xfs/linux-2.6/xfs_aops.c b/trunk/fs/xfs/linux-2.6/xfs_aops.c index 9278e9aba9ba..76a84758073a 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_aops.c +++ b/trunk/fs/xfs/linux-2.6/xfs_aops.c @@ -558,8 +558,7 @@ xfs_submit_page( int i; BUG_ON(PageWriteback(page)); - if (bh_count) - set_page_writeback(page); + set_page_writeback(page); if (clear_dirty) clear_page_dirty(page); unlock_page(page); @@ -579,6 +578,9 @@ xfs_submit_page( if (probed_page && clear_dirty) wbc->nr_to_write--; /* Wrote an "extra" page */ + } else { + end_page_writeback(page); + wbc->pages_skipped++; /* We didn't write this page */ } } @@ -600,26 +602,21 @@ xfs_convert_page( { struct buffer_head *bh_arr[MAX_BUF_PER_PAGE], *bh, *head; xfs_iomap_t *mp = iomapp, *tmp; - unsigned long offset, end_offset; - int index = 0; + unsigned long end, offset; + pgoff_t end_index; + int i = 0, index = 0; int bbits = inode->i_blkbits; - int len, page_dirty; - - end_offset = (i_size_read(inode) & (PAGE_CACHE_SIZE - 1)); - - /* - * page_dirty is initially a count of buffers on the page before - * EOF and is decrememted as we move each into a cleanable state. - */ - len = 1 << inode->i_blkbits; - end_offset = max(end_offset, PAGE_CACHE_SIZE); - end_offset = roundup(end_offset, len); - page_dirty = end_offset / len; - offset = 0; + end_index = i_size_read(inode) >> PAGE_CACHE_SHIFT; + if (page->index < end_index) { + end = PAGE_CACHE_SIZE; + } else { + end = i_size_read(inode) & (PAGE_CACHE_SIZE-1); + } bh = head = page_buffers(page); do { - if (offset >= end_offset) + offset = i << bbits; + if (offset >= end) break; if (!(PageUptodate(page) || buffer_uptodate(bh))) continue; @@ -628,7 +625,6 @@ xfs_convert_page( if (startio) { lock_buffer(bh); bh_arr[index++] = bh; - page_dirty--; } continue; } @@ -661,11 +657,10 @@ xfs_convert_page( unlock_buffer(bh); mark_buffer_dirty(bh); } - page_dirty--; - } while (offset += len, (bh = bh->b_this_page) != head); + } while (i++, (bh = bh->b_this_page) != head); - if (startio && index) { - xfs_submit_page(page, wbc, bh_arr, index, 1, !page_dirty); + if (startio) { + xfs_submit_page(page, wbc, bh_arr, index, 1, index == i); } else { unlock_page(page); } @@ -730,11 +725,8 @@ xfs_page_state_convert( __uint64_t end_offset; pgoff_t end_index, last_index, tlast; int len, err, i, cnt = 0, uptodate = 1; - int flags; - int page_dirty; - - /* wait for other IO threads? */ - flags = (startio && wbc->sync_mode != WB_SYNC_NONE) ? 0 : BMAPI_TRYLOCK; + int flags = startio ? 0 : BMAPI_TRYLOCK; + int page_dirty, delalloc = 0; /* Is this page beyond the end of the file? */ offset = i_size_read(inode); @@ -748,22 +740,19 @@ xfs_page_state_convert( } } - end_offset = min_t(unsigned long long, - (loff_t)(page->index + 1) << PAGE_CACHE_SHIFT, offset); offset = (loff_t)page->index << PAGE_CACHE_SHIFT; + end_offset = min_t(unsigned long long, + offset + PAGE_CACHE_SIZE, i_size_read(inode)); + + bh = head = page_buffers(page); + iomp = NULL; /* - * page_dirty is initially a count of buffers on the page before - * EOF and is decrememted as we move each into a cleanable state. + * page_dirty is initially a count of buffers on the page and + * is decrememted as we move each into a cleanable state. */ - len = 1 << inode->i_blkbits; - p_offset = max(p_offset, PAGE_CACHE_SIZE); - p_offset = roundup(p_offset, len); - page_dirty = p_offset / len; - - iomp = NULL; - p_offset = 0; - bh = head = page_buffers(page); + len = bh->b_size; + page_dirty = PAGE_CACHE_SIZE / len; do { if (offset >= end_offset) @@ -815,6 +804,7 @@ xfs_page_state_convert( */ } else if (buffer_delay(bh)) { if (!iomp) { + delalloc = 1; err = xfs_map_blocks(inode, offset, len, &iomap, BMAPI_ALLOCATE | flags); if (err) { @@ -885,15 +875,14 @@ xfs_page_state_convert( if (uptodate && bh == head) SetPageUptodate(page); - if (startio) { - WARN_ON(page_dirty); - xfs_submit_page(page, wbc, bh_arr, cnt, 0, !page_dirty); - } + if (startio) + xfs_submit_page(page, wbc, bh_arr, cnt, 0, 1); if (iomp) { - offset = (iomp->iomap_offset + iomp->iomap_bsize - 1) >> + tlast = (iomp->iomap_offset + iomp->iomap_bsize - 1) >> PAGE_CACHE_SHIFT; - tlast = min_t(pgoff_t, offset, last_index); + if (delalloc && (tlast > last_index)) + tlast = last_index; xfs_cluster_write(inode, page->index + 1, iomp, wbc, startio, unmapped, tlast); } diff --git a/trunk/fs/xfs/linux-2.6/xfs_buf.c b/trunk/fs/xfs/linux-2.6/xfs_buf.c index 997963e53622..23e0eb67fc25 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_buf.c +++ b/trunk/fs/xfs/linux-2.6/xfs_buf.c @@ -1746,15 +1746,13 @@ STATIC DECLARE_COMPLETION(pagebuf_daemon_done); STATIC struct task_struct *pagebuf_daemon_task; STATIC int pagebuf_daemon_active; STATIC int force_flush; -STATIC int force_sleep; + STATIC int pagebuf_daemon_wakeup( int priority, unsigned int mask) { - if (force_sleep) - return 0; force_flush = 1; barrier(); wake_up_process(pagebuf_daemon_task); @@ -1780,12 +1778,7 @@ pagebuf_daemon( INIT_LIST_HEAD(&tmp); do { - if (unlikely(current->flags & PF_FREEZE)) { - force_sleep = 1; - refrigerator(PF_FREEZE); - } else { - force_sleep = 0; - } + try_to_freeze(PF_FREEZE); set_current_state(TASK_INTERRUPTIBLE); schedule_timeout((xfs_buf_timer_centisecs * HZ) / 100); diff --git a/trunk/fs/xfs/linux-2.6/xfs_file.c b/trunk/fs/xfs/linux-2.6/xfs_file.c index d0d412afd261..9f057a4a5b06 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_file.c +++ b/trunk/fs/xfs/linux-2.6/xfs_file.c @@ -515,49 +515,10 @@ linvfs_open_exec( } #endif /* HAVE_FOP_OPEN_EXEC */ -/* - * Temporary workaround to the AIO direct IO write problem. - * This code can go and we can revert to do_sync_write once - * the writepage(s) rework is merged. - */ -STATIC ssize_t -linvfs_write( - struct file *filp, - const char __user *buf, - size_t len, - loff_t *ppos) -{ - struct kiocb kiocb; - ssize_t ret; - - init_sync_kiocb(&kiocb, filp); - kiocb.ki_pos = *ppos; - ret = __linvfs_write(&kiocb, buf, 0, len, kiocb.ki_pos); - *ppos = kiocb.ki_pos; - return ret; -} -STATIC ssize_t -linvfs_write_invis( - struct file *filp, - const char __user *buf, - size_t len, - loff_t *ppos) -{ - struct kiocb kiocb; - ssize_t ret; - - init_sync_kiocb(&kiocb, filp); - kiocb.ki_pos = *ppos; - ret = __linvfs_write(&kiocb, buf, IO_INVIS, len, kiocb.ki_pos); - *ppos = kiocb.ki_pos; - return ret; -} - - struct file_operations linvfs_file_operations = { .llseek = generic_file_llseek, .read = do_sync_read, - .write = linvfs_write, + .write = do_sync_write, .readv = linvfs_readv, .writev = linvfs_writev, .aio_read = linvfs_aio_read, @@ -579,7 +540,7 @@ struct file_operations linvfs_file_operations = { struct file_operations linvfs_invis_file_operations = { .llseek = generic_file_llseek, .read = do_sync_read, - .write = linvfs_write_invis, + .write = do_sync_write, .readv = linvfs_readv_invis, .writev = linvfs_writev_invis, .aio_read = linvfs_aio_read_invis, diff --git a/trunk/fs/xfs/linux-2.6/xfs_lrw.c b/trunk/fs/xfs/linux-2.6/xfs_lrw.c index aa9daaea6c34..ff145fd0d1a4 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_lrw.c +++ b/trunk/fs/xfs/linux-2.6/xfs_lrw.c @@ -683,9 +683,6 @@ xfs_write( (xip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? mp->m_rtdev_targp : mp->m_ddev_targp; - if (ioflags & IO_ISAIO) - return XFS_ERROR(-ENOSYS); - if ((pos & target->pbr_smask) || (count & target->pbr_smask)) return XFS_ERROR(-EINVAL); diff --git a/trunk/fs/xfs/linux-2.6/xfs_vnode.c b/trunk/fs/xfs/linux-2.6/xfs_vnode.c index a832d165f24f..849c61c74f3c 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_vnode.c +++ b/trunk/fs/xfs/linux-2.6/xfs_vnode.c @@ -156,6 +156,7 @@ vn_initialize( #ifdef XFS_VNODE_TRACE vp->v_trace = ktrace_alloc(VNODE_TRACE_SIZE, KM_SLEEP); + printk("Allocated VNODE_TRACE at 0x%p\n", vp->v_trace); #endif /* XFS_VNODE_TRACE */ vn_trace_exit(vp, "vn_initialize", (inst_t *)__return_address); @@ -423,13 +424,13 @@ vn_remove( * Vnode tracing code. */ void -vn_trace_entry(vnode_t *vp, const char *func, inst_t *ra) +vn_trace_entry(vnode_t *vp, char *func, inst_t *ra) { KTRACE_ENTER(vp, VNODE_KTRACE_ENTRY, func, 0, ra); } void -vn_trace_exit(vnode_t *vp, const char *func, inst_t *ra) +vn_trace_exit(vnode_t *vp, char *func, inst_t *ra) { KTRACE_ENTER(vp, VNODE_KTRACE_EXIT, func, 0, ra); } diff --git a/trunk/fs/xfs/linux-2.6/xfs_vnode.h b/trunk/fs/xfs/linux-2.6/xfs_vnode.h index 00466c3194ac..da76c1f1e11c 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_vnode.h +++ b/trunk/fs/xfs/linux-2.6/xfs_vnode.h @@ -86,11 +86,10 @@ typedef struct vnode { vnumber_t v_number; /* in-core vnode number */ vn_bhv_head_t v_bh; /* behavior head */ spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */ + struct inode v_inode; /* Linux inode */ #ifdef XFS_VNODE_TRACE struct ktrace *v_trace; /* trace header structure */ #endif - struct inode v_inode; /* Linux inode */ - /* inode MUST be last */ } vnode_t; #define v_fbhv v_bh.bh_first /* first behavior */ @@ -410,7 +409,7 @@ typedef struct vattr { int va_mask; /* bit-mask of attributes present */ enum vtype va_type; /* vnode type (for create) */ mode_t va_mode; /* file access mode and type */ - xfs_nlink_t va_nlink; /* number of references to file */ + nlink_t va_nlink; /* number of references to file */ uid_t va_uid; /* owner user id */ gid_t va_gid; /* owner group id */ xfs_ino_t va_nodeid; /* file id */ @@ -626,7 +625,6 @@ static inline int VN_BAD(struct vnode *vp) #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 */ /* * Flags to VOP_FSYNC and VOP_RECLAIM. @@ -648,8 +646,8 @@ static inline int VN_BAD(struct vnode *vp) #define VNODE_KTRACE_REF 4 #define VNODE_KTRACE_RELE 5 -extern void vn_trace_entry(struct vnode *, const char *, inst_t *); -extern void vn_trace_exit(struct vnode *, const char *, inst_t *); +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 *); diff --git a/trunk/fs/xfs/xfs_dfrag.c b/trunk/fs/xfs/xfs_dfrag.c index 63abdc2ac7f4..08d551a17347 100644 --- a/trunk/fs/xfs/xfs_dfrag.c +++ b/trunk/fs/xfs/xfs_dfrag.c @@ -182,7 +182,7 @@ xfs_swapext( if (VN_CACHED(tvp) != 0) xfs_inval_cached_pages(XFS_ITOV(tip), &(tip->i_iocore), - (xfs_off_t)0, 0, 0); + (loff_t)0, 0, 0); /* Verify O_DIRECT for ftmp */ if (VN_CACHED(tvp) != 0) { diff --git a/trunk/fs/xfs/xfs_iget.c b/trunk/fs/xfs/xfs_iget.c index d3da00045f26..3a0ba1dfd0e8 100644 --- a/trunk/fs/xfs/xfs_iget.c +++ b/trunk/fs/xfs/xfs_iget.c @@ -135,40 +135,6 @@ xfs_chash_free(xfs_mount_t *mp) mp->m_chash = NULL; } -/* - * Try to move an inode to the front of its hash list if possible - * (and if its not there already). Called right after obtaining - * the list version number and then dropping the read_lock on the - * hash list in question (which is done right after looking up the - * inode in question...). - */ -STATIC void -xfs_ihash_promote( - xfs_ihash_t *ih, - xfs_inode_t *ip, - ulong version) -{ - xfs_inode_t *iq; - - if ((ip->i_prevp != &ih->ih_next) && write_trylock(&ih->ih_lock)) { - if (likely(version == ih->ih_version)) { - /* remove from list */ - if ((iq = ip->i_next)) { - iq->i_prevp = ip->i_prevp; - } - *ip->i_prevp = iq; - - /* insert at list head */ - iq = ih->ih_next; - iq->i_prevp = &ip->i_next; - ip->i_next = iq; - ip->i_prevp = &ih->ih_next; - ih->ih_next = ip; - } - write_unlock(&ih->ih_lock); - } -} - /* * Look up an inode by number in the given file system. * The inode is looked up in the hash table for the file system @@ -263,9 +229,7 @@ xfs_iget_core( XFS_STATS_INC(xs_ig_found); ip->i_flags &= ~XFS_IRECLAIMABLE; - version = ih->ih_version; read_unlock(&ih->ih_lock); - xfs_ihash_promote(ih, ip, version); XFS_MOUNT_ILOCK(mp); list_del_init(&ip->i_reclaim); @@ -295,15 +259,8 @@ xfs_iget_core( inode_vp, vp); } - /* - * Inode cache hit: if ip is not at the front of - * its hash chain, move it there now. - * Do this with the lock held for update, but - * do statistics after releasing the lock. - */ - version = ih->ih_version; read_unlock(&ih->ih_lock); - xfs_ihash_promote(ih, ip, version); + XFS_STATS_INC(xs_ig_found); finish_inode: @@ -590,7 +547,6 @@ xfs_inode_incore(xfs_mount_t *mp, { xfs_ihash_t *ih; xfs_inode_t *ip; - ulong version; ih = XFS_IHASH(mp, ino); read_lock(&ih->ih_lock); @@ -598,15 +554,11 @@ xfs_inode_incore(xfs_mount_t *mp, if (ip->i_ino == ino) { /* * If we find it and tp matches, return it. - * Also move it to the front of the hash list - * if we find it and it is not already there. * Otherwise break from the loop and return * NULL. */ if (ip->i_transp == tp) { - version = ih->ih_version; read_unlock(&ih->ih_lock); - xfs_ihash_promote(ih, ip, version); return (ip); } break; @@ -733,7 +685,6 @@ xfs_iextract( iq->i_prevp = ip->i_prevp; } *ip->i_prevp = iq; - ih->ih_version++; write_unlock(&ih->ih_lock); /* diff --git a/trunk/fs/xfs/xfs_inode.c b/trunk/fs/xfs/xfs_inode.c index bc8c8c7f9039..43c632ab86ad 100644 --- a/trunk/fs/xfs/xfs_inode.c +++ b/trunk/fs/xfs/xfs_inode.c @@ -1130,7 +1130,7 @@ xfs_ialloc( xfs_trans_t *tp, xfs_inode_t *pip, mode_t mode, - xfs_nlink_t nlink, + nlink_t nlink, xfs_dev_t rdev, cred_t *cr, xfs_prid_t prid, diff --git a/trunk/fs/xfs/xfs_inode.h b/trunk/fs/xfs/xfs_inode.h index 37e1c316f3b6..a53b1ccf6070 100644 --- a/trunk/fs/xfs/xfs_inode.h +++ b/trunk/fs/xfs/xfs_inode.h @@ -495,9 +495,9 @@ int xfs_itobp(struct xfs_mount *, struct xfs_trans *, int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, xfs_inode_t **, xfs_daddr_t); int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); -int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, - xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, - int, struct xfs_buf **, boolean_t *, xfs_inode_t **); +int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, nlink_t, + xfs_dev_t, struct cred *, xfs_prid_t, int, + struct xfs_buf **, boolean_t *, xfs_inode_t **); void xfs_xlate_dinode_core(xfs_caddr_t, struct xfs_dinode_core *, int); uint xfs_ip2xflags(struct xfs_inode *); diff --git a/trunk/fs/xfs/xfs_iomap.c b/trunk/fs/xfs/xfs_iomap.c index 991f8a61f7c4..3826e8f0e28a 100644 --- a/trunk/fs/xfs/xfs_iomap.c +++ b/trunk/fs/xfs/xfs_iomap.c @@ -308,8 +308,7 @@ xfs_iomap( break; } - error = XFS_IOMAP_WRITE_ALLOCATE(mp, io, offset, count, - &imap, &nimaps); + error = XFS_IOMAP_WRITE_ALLOCATE(mp, io, &imap, &nimaps); break; case BMAPI_UNWRITTEN: lockmode = 0; @@ -366,7 +365,7 @@ xfs_flush_space( int xfs_iomap_write_direct( xfs_inode_t *ip, - xfs_off_t offset, + loff_t offset, size_t count, int flags, xfs_bmbt_irec_t *ret_imap, @@ -542,7 +541,7 @@ xfs_iomap_write_direct( int xfs_iomap_write_delay( xfs_inode_t *ip, - xfs_off_t offset, + loff_t offset, size_t count, int ioflag, xfs_bmbt_irec_t *ret_imap, @@ -747,8 +746,6 @@ xfs_iomap_write_delay( int xfs_iomap_write_allocate( xfs_inode_t *ip, - xfs_off_t offset, - size_t count, xfs_bmbt_irec_t *map, int *retmap) { @@ -773,9 +770,9 @@ xfs_iomap_write_allocate( if ((error = XFS_QM_DQATTACH(mp, ip, 0))) return XFS_ERROR(error); - offset_fsb = XFS_B_TO_FSBT(mp, offset); + offset_fsb = map->br_startoff; count_fsb = map->br_blockcount; - map_start_fsb = map->br_startoff; + map_start_fsb = offset_fsb; XFS_STATS_ADD(xs_xstrat_bytes, XFS_FSB_TO_B(mp, count_fsb)); @@ -871,9 +868,9 @@ xfs_iomap_write_allocate( imap[i].br_startoff, imap[i].br_blockcount,imap[i].br_state); } - if ((offset_fsb >= imap[i].br_startoff) && - (offset_fsb < (imap[i].br_startoff + - imap[i].br_blockcount))) { + if ((map->br_startoff >= imap[i].br_startoff) && + (map->br_startoff < (imap[i].br_startoff + + imap[i].br_blockcount))) { *map = imap[i]; *retmap = 1; XFS_STATS_INC(xs_xstrat_quick); @@ -886,8 +883,9 @@ xfs_iomap_write_allocate( * file, just surrounding data, try again. */ nimaps--; - map_start_fsb = imap[nimaps].br_startoff + - imap[nimaps].br_blockcount; + offset_fsb = imap[nimaps].br_startoff + + imap[nimaps].br_blockcount; + map_start_fsb = offset_fsb; } trans_cancel: @@ -901,7 +899,7 @@ xfs_iomap_write_allocate( int xfs_iomap_write_unwritten( xfs_inode_t *ip, - xfs_off_t offset, + loff_t offset, size_t count) { xfs_mount_t *mp = ip->i_mount; diff --git a/trunk/fs/xfs/xfs_iomap.h b/trunk/fs/xfs/xfs_iomap.h index 4daaa5212102..31c91087cb33 100644 --- a/trunk/fs/xfs/xfs_iomap.h +++ b/trunk/fs/xfs/xfs_iomap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2003,2004 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 @@ -29,6 +29,9 @@ * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ + + + #ifndef __XFS_IOMAP_H__ #define __XFS_IOMAP_H__ @@ -53,7 +56,7 @@ typedef enum { BMAPI_UNWRITTEN = (1 << 3), /* unwritten extents to real extents */ /* modifiers */ BMAPI_IGNSTATE = (1 << 4), /* ignore unwritten state on read */ - BMAPI_DIRECT = (1 << 5), /* direct instead of buffered write */ + BMAPI_DIRECT = (1 << 5), /* direct instead of buffered write */ BMAPI_MMAP = (1 << 6), /* allocate for mmap write */ BMAPI_SYNC = (1 << 7), /* sync write to flush delalloc space */ BMAPI_TRYLOCK = (1 << 8), /* non-blocking request */ @@ -64,13 +67,13 @@ typedef enum { /* * xfs_iomap_t: File system I/O map * - * The iomap_bn field is expressed in 512-byte blocks, and is where the + * The iomap_bn field is expressed in 512-byte blocks, and is where the * mapping starts on disk. * * The iomap_offset, iomap_bsize and iomap_delta fields are in bytes. * iomap_offset is the offset of the mapping in the file itself. - * iomap_bsize is the size of the mapping, iomap_delta is the - * desired data's offset into the mapping, given the offset supplied + * iomap_bsize is the size of the mapping, iomap_delta is the + * desired data's offset into the mapping, given the offset supplied * to the file I/O map routine. * * When a request is made to read beyond the logical end of the object, @@ -81,8 +84,8 @@ typedef enum { typedef struct xfs_iomap { xfs_daddr_t iomap_bn; /* first 512b blk of mapping */ xfs_buftarg_t *iomap_target; - xfs_off_t iomap_offset; /* offset of mapping, bytes */ - xfs_off_t iomap_bsize; /* size of mapping, bytes */ + loff_t iomap_offset; /* offset of mapping, bytes */ + loff_t iomap_bsize; /* size of mapping, bytes */ size_t iomap_delta; /* offset into mapping, bytes */ iomap_flags_t iomap_flags; } xfs_iomap_t; @@ -93,12 +96,12 @@ struct xfs_bmbt_irec; extern int xfs_iomap(struct xfs_iocore *, xfs_off_t, ssize_t, int, struct xfs_iomap *, int *); -extern int xfs_iomap_write_direct(struct xfs_inode *, xfs_off_t, size_t, +extern int xfs_iomap_write_direct(struct xfs_inode *, loff_t, size_t, int, struct xfs_bmbt_irec *, int *, int); -extern int xfs_iomap_write_delay(struct xfs_inode *, xfs_off_t, size_t, int, +extern int xfs_iomap_write_delay(struct xfs_inode *, loff_t, size_t, int, struct xfs_bmbt_irec *, int *); -extern int xfs_iomap_write_allocate(struct xfs_inode *, xfs_off_t, size_t, +extern int xfs_iomap_write_allocate(struct xfs_inode *, struct xfs_bmbt_irec *, int *); -extern int xfs_iomap_write_unwritten(struct xfs_inode *, xfs_off_t, size_t); +extern int xfs_iomap_write_unwritten(struct xfs_inode *, loff_t, size_t); #endif /* __XFS_IOMAP_H__*/ diff --git a/trunk/fs/xfs/xfs_mount.c b/trunk/fs/xfs/xfs_mount.c index 2ec967d93e5a..b57423caef9b 100644 --- a/trunk/fs/xfs/xfs_mount.c +++ b/trunk/fs/xfs/xfs_mount.c @@ -300,15 +300,6 @@ xfs_mount_validate_sb( return XFS_ERROR(EFSCORRUPTED); } - /* - * Version 1 directory format has never worked on Linux. - */ - if (unlikely(!XFS_SB_VERSION_HASDIRV2(sbp))) { - cmn_err(CE_WARN, - "XFS: Attempted to mount file system using version 1 directory format"); - return XFS_ERROR(ENOSYS); - } - /* * Until this is fixed only page-sized or smaller data blocks work. */ diff --git a/trunk/fs/xfs/xfs_mount.h b/trunk/fs/xfs/xfs_mount.h index 30dd08fb9f57..5fc6201dd8e2 100644 --- a/trunk/fs/xfs/xfs_mount.h +++ b/trunk/fs/xfs/xfs_mount.h @@ -210,16 +210,15 @@ typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *, struct xfs_bmap_free *); typedef int (*xfs_bmap_eof_t)(void *, xfs_fileoff_t, int, int *); typedef int (*xfs_iomap_write_direct_t)( - void *, xfs_off_t, size_t, int, + void *, loff_t, size_t, int, struct xfs_bmbt_irec *, int *, int); typedef int (*xfs_iomap_write_delay_t)( - void *, xfs_off_t, size_t, int, + void *, loff_t, size_t, int, struct xfs_bmbt_irec *, int *); typedef int (*xfs_iomap_write_allocate_t)( - void *, xfs_off_t, size_t, - struct xfs_bmbt_irec *, int *); + void *, struct xfs_bmbt_irec *, int *); typedef int (*xfs_iomap_write_unwritten_t)( - void *, xfs_off_t, size_t); + void *, loff_t, size_t); typedef uint (*xfs_lck_map_shared_t)(void *); typedef void (*xfs_lock_t)(void *, uint); typedef void (*xfs_lock_demote_t)(void *, uint); @@ -259,9 +258,9 @@ typedef struct xfs_ioops { #define XFS_IOMAP_WRITE_DELAY(mp, io, offset, count, flags, mval, nmap) \ (*(mp)->m_io_ops.xfs_iomap_write_delay) \ ((io)->io_obj, offset, count, flags, mval, nmap) -#define XFS_IOMAP_WRITE_ALLOCATE(mp, io, offset, count, mval, nmap) \ +#define XFS_IOMAP_WRITE_ALLOCATE(mp, io, mval, nmap) \ (*(mp)->m_io_ops.xfs_iomap_write_allocate) \ - ((io)->io_obj, offset, count, mval, nmap) + ((io)->io_obj, mval, nmap) #define XFS_IOMAP_WRITE_UNWRITTEN(mp, io, offset, count) \ (*(mp)->m_io_ops.xfs_iomap_write_unwritten) \ ((io)->io_obj, offset, count) @@ -429,10 +428,10 @@ typedef struct xfs_mount { #define XFS_WRITEIO_LOG_LARGE 16 /* - * Max and min values for mount-option defined I/O - * preallocation sizes. + * Max and min values for UIO and mount-option defined I/O sizes; + * min value can't be less than a page. Currently unused. */ -#define XFS_MAX_IO_LOG 30 /* 1G */ +#define XFS_MAX_IO_LOG 16 /* 64K */ #define XFS_MIN_IO_LOG PAGE_SHIFT /* diff --git a/trunk/fs/xfs/xfs_types.h b/trunk/fs/xfs/xfs_types.h index e4bf711e48ff..04609d27ea51 100644 --- a/trunk/fs/xfs/xfs_types.h +++ b/trunk/fs/xfs/xfs_types.h @@ -63,7 +63,6 @@ typedef __u64 xfs_ino_t; /* type */ typedef __s64 xfs_daddr_t; /* type */ typedef char * xfs_caddr_t; /* type */ typedef __u32 xfs_dev_t; -typedef __u32 xfs_nlink_t; /* __psint_t is the same size as a pointer */ #if (BITS_PER_LONG == 32) diff --git a/trunk/fs/xfs/xfs_utils.c b/trunk/fs/xfs/xfs_utils.c index d1f8146a06ea..816b945fa0ea 100644 --- a/trunk/fs/xfs/xfs_utils.c +++ b/trunk/fs/xfs/xfs_utils.c @@ -147,7 +147,7 @@ xfs_dir_ialloc( xfs_inode_t *dp, /* directory within whose allocate the inode. */ mode_t mode, - xfs_nlink_t nlink, + nlink_t nlink, xfs_dev_t rdev, cred_t *credp, prid_t prid, /* project id */ diff --git a/trunk/fs/xfs/xfs_utils.h b/trunk/fs/xfs/xfs_utils.h index 01d98b4b7af7..e1ed6a588000 100644 --- a/trunk/fs/xfs/xfs_utils.h +++ b/trunk/fs/xfs/xfs_utils.h @@ -42,7 +42,7 @@ extern int xfs_get_dir_entry (vname_t *, xfs_inode_t **); extern int xfs_dir_lookup_int (bhv_desc_t *, uint, vname_t *, xfs_ino_t *, xfs_inode_t **); extern int xfs_truncate_file (xfs_mount_t *, xfs_inode_t *); -extern int xfs_dir_ialloc (xfs_trans_t **, xfs_inode_t *, mode_t, xfs_nlink_t, +extern int xfs_dir_ialloc (xfs_trans_t **, xfs_inode_t *, mode_t, nlink_t, xfs_dev_t, cred_t *, prid_t, int, xfs_inode_t **, int *); extern int xfs_droplink (xfs_trans_t *, xfs_inode_t *); diff --git a/trunk/fs/xfs/xfs_vfsops.c b/trunk/fs/xfs/xfs_vfsops.c index b53736650100..00aae9c6a904 100644 --- a/trunk/fs/xfs/xfs_vfsops.c +++ b/trunk/fs/xfs/xfs_vfsops.c @@ -1649,7 +1649,6 @@ xfs_vget( #define MNTOPT_SWIDTH "swidth" /* data volume stripe width */ #define MNTOPT_NOUUID "nouuid" /* ignore filesystem UUID */ #define MNTOPT_MTPT "mtpt" /* filesystem mount point */ -#define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */ #define MNTOPT_IHASHSIZE "ihashsize" /* size of inode hash table */ #define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ #define MNTOPT_NOLOGFLUSH "nologflush" /* don't hard flush on log writes */ @@ -1658,28 +1657,6 @@ xfs_vget( #define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ #define MNTOPT_NOIKEEP "noikeep" /* free empty inode clusters */ -STATIC unsigned long -suffix_strtoul(const char *cp, char **endp, unsigned int base) -{ - int last, shift_left_factor = 0; - char *value = (char *)cp; - - last = strlen(value) - 1; - if (value[last] == 'K' || value[last] == 'k') { - shift_left_factor = 10; - value[last] = '\0'; - } - if (value[last] == 'M' || value[last] == 'm') { - shift_left_factor = 20; - value[last] = '\0'; - } - if (value[last] == 'G' || value[last] == 'g') { - shift_left_factor = 30; - value[last] = '\0'; - } - - return simple_strtoul(cp, endp, base) << shift_left_factor; -} int xfs_parseargs( @@ -1711,60 +1688,60 @@ xfs_parseargs( if (!strcmp(this_char, MNTOPT_LOGBUFS)) { if (!value || !*value) { printk("XFS: %s option requires an argument\n", - this_char); + 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", - this_char); + MNTOPT_LOGBSIZE); return EINVAL; } - args->logbufsize = suffix_strtoul(value, &eov, 10); + 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", - this_char); + 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", - this_char); + 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", - this_char); + 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", - this_char); + 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_ALLOCSIZE)) { - if (!value || !*value) { - printk("XFS: %s option requires an argument\n", - this_char); - return EINVAL; - } - iosize = suffix_strtoul(value, &eov, 10); - args->flags |= XFSMNT_IOSIZE; - args->iosizelog = ffs(iosize) - 1; } else if (!strcmp(this_char, MNTOPT_IHASHSIZE)) { if (!value || !*value) { printk("XFS: %s option requires an argument\n", - this_char); + this_char); return EINVAL; } args->flags |= XFSMNT_IHASHSIZE; @@ -1779,7 +1756,7 @@ xfs_parseargs( args->flags |= XFSMNT_INO64; #if !XFS_BIG_INUMS printk("XFS: %s option not allowed on this system\n", - this_char); + MNTOPT_INO64); return EINVAL; #endif } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { @@ -1789,14 +1766,14 @@ xfs_parseargs( } else if (!strcmp(this_char, MNTOPT_SUNIT)) { if (!value || !*value) { printk("XFS: %s option requires an argument\n", - this_char); + 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", - this_char); + MNTOPT_SWIDTH); return EINVAL; } dswidth = simple_strtoul(value, &eov, 10); @@ -1804,7 +1781,7 @@ xfs_parseargs( args->flags &= ~XFSMNT_32BITINODES; #if !XFS_BIG_INUMS printk("XFS: %s option not allowed on this system\n", - this_char); + MNTOPT_64BITINODE); return EINVAL; #endif } else if (!strcmp(this_char, MNTOPT_NOUUID)) { @@ -1900,7 +1877,7 @@ xfs_showargs( seq_printf(m, "," MNTOPT_IHASHSIZE "=%d", mp->m_ihsize); if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) - seq_printf(m, "," MNTOPT_ALLOCSIZE "=%d", 1<m_writeio_log); + seq_printf(m, "," MNTOPT_BIOSIZE "=%d", mp->m_writeio_log); if (mp->m_logbufs > 0) seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); diff --git a/trunk/fs/xfs/xfs_vnodeops.c b/trunk/fs/xfs/xfs_vnodeops.c index 25a526629b12..70092963ca9e 100644 --- a/trunk/fs/xfs/xfs_vnodeops.c +++ b/trunk/fs/xfs/xfs_vnodeops.c @@ -305,7 +305,7 @@ xfs_setattr( int mandlock_before, mandlock_after; struct xfs_dquot *udqp, *gdqp, *olddquot1, *olddquot2; int file_owner; - int need_iolock = 1; + int need_iolock = (flags & ATTR_DMI) == 0; vp = BHV_TO_VNODE(bdp); vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); @@ -384,9 +384,6 @@ xfs_setattr( */ tp = NULL; lock_flags = XFS_ILOCK_EXCL; - ASSERT(flags & ATTR_NOLOCK ? flags & ATTR_DMI : 1); - if (flags & ATTR_NOLOCK) - need_iolock = 0; if (!(mask & XFS_AT_SIZE)) { if ((mask != (XFS_AT_CTIME|XFS_AT_ATIME|XFS_AT_MTIME)) || (mp->m_flags & XFS_MOUNT_WSYNC)) { @@ -4323,7 +4320,7 @@ xfs_free_file_space( int rt; xfs_fileoff_t startoffset_fsb; xfs_trans_t *tp; - int need_iolock = 1; + int need_iolock = (attr_flags & ATTR_DMI) == 0; vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); mp = ip->i_mount; @@ -4351,12 +4348,8 @@ xfs_free_file_space( return(error); } - ASSERT(attr_flags & ATTR_NOLOCK ? attr_flags & ATTR_DMI : 1); - if (attr_flags & ATTR_NOLOCK) - need_iolock = 0; if (need_iolock) xfs_ilock(ip, XFS_IOLOCK_EXCL); - rounding = MAX((__uint8_t)(1 << mp->m_sb.sb_blocklog), (__uint8_t)NBPP); ilen = len + (offset & (rounding - 1)); diff --git a/trunk/include/asm-arm/arch-imx/imxfb.h b/trunk/include/asm-arm/arch-imx/imxfb.h deleted file mode 100644 index 2346d454ab9c..000000000000 --- a/trunk/include/asm-arm/arch-imx/imxfb.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This structure describes the machine which we are running on. - */ -struct imxfb_mach_info { - u_long pixclock; - - u_short xres; - u_short yres; - - u_char bpp; - u_char hsync_len; - u_char left_margin; - u_char right_margin; - - u_char vsync_len; - u_char upper_margin; - u_char lower_margin; - u_char sync; - - u_int cmap_greyscale:1, - cmap_inverse:1, - cmap_static:1, - unused:29; - - u_int pcr; - u_int pwmr; - u_int lscr1; - - u_char * fixed_screen_cpu; - dma_addr_t fixed_screen_dma; - - void (*lcd_power)(int); - void (*backlight_power)(int); -}; -void set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info); diff --git a/trunk/include/asm-arm/processor.h b/trunk/include/asm-arm/processor.h index 7d4118e09054..4a9845997a75 100644 --- a/trunk/include/asm-arm/processor.h +++ b/trunk/include/asm-arm/processor.h @@ -23,6 +23,8 @@ #include #include +#define KERNEL_STACK_SIZE PAGE_SIZE + union debug_insn { u32 arm; u16 thumb; @@ -85,9 +87,8 @@ unsigned long get_wchan(struct task_struct *p); */ extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); -#define KSTK_REGS(tsk) (((struct pt_regs *)(THREAD_START_SP + (unsigned long)(tsk)->thread_info)) - 1) -#define KSTK_EIP(tsk) KSTK_REGS(tsk)->ARM_pc -#define KSTK_ESP(tsk) KSTK_REGS(tsk)->ARM_sp +#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019]) +#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1017]) /* * Prefetching support - only ARMv5. diff --git a/trunk/include/asm-arm/thread_info.h b/trunk/include/asm-arm/thread_info.h index 66c585c50cf9..a61618fb433c 100644 --- a/trunk/include/asm-arm/thread_info.h +++ b/trunk/include/asm-arm/thread_info.h @@ -14,10 +14,6 @@ #include -#define THREAD_SIZE_ORDER 1 -#define THREAD_SIZE 8192 -#define THREAD_START_SP (THREAD_SIZE - 8) - #ifndef __ASSEMBLY__ struct task_struct; @@ -81,6 +77,8 @@ struct thread_info { #define init_thread_info (init_thread_union.thread_info) #define init_stack (init_thread_union.stack) +#define THREAD_SIZE 8192 + /* * how to get the thread information struct from C */ diff --git a/trunk/include/asm-sparc64/pgalloc.h b/trunk/include/asm-sparc64/pgalloc.h index 2c28e1f605b7..b9b1914aae63 100644 --- a/trunk/include/asm-sparc64/pgalloc.h +++ b/trunk/include/asm-sparc64/pgalloc.h @@ -122,17 +122,12 @@ static __inline__ void free_pmd_slow(pmd_t *pmd) #define pmd_populate(MM,PMD,PTE_PAGE) \ pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) -extern pte_t *__pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address); - -static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) -{ - return __pte_alloc_one_kernel(mm, address); -} +extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address); static inline struct page * pte_alloc_one(struct mm_struct *mm, unsigned long addr) { - pte_t *pte = __pte_alloc_one_kernel(mm, addr); + pte_t *pte = pte_alloc_one_kernel(mm, addr); if (pte) return virt_to_page(pte); diff --git a/trunk/include/linux/if_ltalk.h b/trunk/include/linux/if_ltalk.h index 76525760ba48..e75e832b7ff0 100644 --- a/trunk/include/linux/if_ltalk.h +++ b/trunk/include/linux/if_ltalk.h @@ -6,7 +6,7 @@ #define LTALK_ALEN 1 #ifdef __KERNEL__ -extern struct net_device *alloc_ltalkdev(int sizeof_priv); +extern void ltalk_setup(struct net_device *); #endif #endif diff --git a/trunk/include/net/sock.h b/trunk/include/net/sock.h index 77f02f86346e..cc4c9190b7fd 100644 --- a/trunk/include/net/sock.h +++ b/trunk/include/net/sock.h @@ -141,7 +141,6 @@ struct sock_common { * @sk_callback_lock: used with the callbacks in the end of this struct * @sk_error_queue: rarely used * @sk_prot: protocol handlers inside a network family - * @sk_prot_creator: sk_prot of original sock creator (see ipv6_setsockopt, IPV6_ADDRFORM for instance) * @sk_err: last error * @sk_err_soft: errors that don't cause failure but are the cause of a persistent failure not just 'timed out' * @sk_ack_backlog: current listen backlog @@ -219,7 +218,6 @@ struct sock { } sk_backlog; struct sk_buff_head sk_error_queue; struct proto *sk_prot; - struct proto *sk_prot_creator; rwlock_t sk_callback_lock; int sk_err, sk_err_soft; diff --git a/trunk/net/appletalk/dev.c b/trunk/net/appletalk/dev.c index 1237e208e246..76598445d84b 100644 --- a/trunk/net/appletalk/dev.c +++ b/trunk/net/appletalk/dev.c @@ -19,7 +19,7 @@ static int ltalk_mac_addr(struct net_device *dev, void *addr) return -EINVAL; } -static void ltalk_setup(struct net_device *dev) +void ltalk_setup(struct net_device *dev) { /* Fill in the fields of the device structure with localtalk-generic values. */ @@ -40,22 +40,4 @@ static void ltalk_setup(struct net_device *dev) dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP; } - -/** - * alloc_ltalkdev - Allocates and sets up an localtalk device - * @sizeof_priv: Size of additional driver-private structure to be allocated - * for this localtalk device - * - * Fill in the fields of the device structure with localtalk-generic - * values. Basically does everything except registering the device. - * - * Constructs a new net device, complete with a private data area of - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for - * this private data area. - */ - -struct net_device *alloc_ltalkdev(int sizeof_priv) -{ - return alloc_netdev(sizeof_priv, "lt%d", ltalk_setup); -} -EXPORT_SYMBOL(alloc_ltalkdev); +EXPORT_SYMBOL(ltalk_setup); diff --git a/trunk/net/core/sock.c b/trunk/net/core/sock.c index 92c0676e4708..98171ddd7e7d 100644 --- a/trunk/net/core/sock.c +++ b/trunk/net/core/sock.c @@ -635,11 +635,7 @@ struct sock *sk_alloc(int family, int priority, struct proto *prot, int zero_it) if (zero_it) { memset(sk, 0, prot->obj_size); sk->sk_family = family; - /* - * See comment in struct sock definition to understand - * why we need sk_prot_creator -acme - */ - sk->sk_prot = sk->sk_prot_creator = prot; + sk->sk_prot = prot; sock_lock_init(sk); } @@ -658,7 +654,7 @@ struct sock *sk_alloc(int family, int priority, struct proto *prot, int zero_it) void sk_free(struct sock *sk) { struct sk_filter *filter; - struct module *owner = sk->sk_prot_creator->owner; + struct module *owner = sk->sk_prot->owner; if (sk->sk_destruct) sk->sk_destruct(sk); @@ -676,8 +672,8 @@ void sk_free(struct sock *sk) __FUNCTION__, atomic_read(&sk->sk_omem_alloc)); security_sk_free(sk); - if (sk->sk_prot_creator->slab != NULL) - kmem_cache_free(sk->sk_prot_creator->slab, sk); + if (sk->sk_prot->slab != NULL) + kmem_cache_free(sk->sk_prot->slab, sk); else kfree(sk); module_put(owner); diff --git a/trunk/net/decnet/dn_dev.c b/trunk/net/decnet/dn_dev.c index ee7bf46eb78a..e6e23eb14428 100644 --- a/trunk/net/decnet/dn_dev.c +++ b/trunk/net/decnet/dn_dev.c @@ -1426,7 +1426,7 @@ static struct rtnetlink_link dnet_rtnetlink_table[RTM_NR_MSGTYPES] = [RTM_GETRULE - RTM_BASE] = { .dumpit = dn_fib_dump_rules, }, #else [RTM_GETROUTE - RTM_BASE] = { .doit = dn_cache_getroute, - .dumpit = dn_cache_dump, }, + .dumpit = dn_cache_dump, #endif }; diff --git a/trunk/net/ipv4/multipath_wrandom.c b/trunk/net/ipv4/multipath_wrandom.c index c3d2ca1a6781..10b23e1bece6 100644 --- a/trunk/net/ipv4/multipath_wrandom.c +++ b/trunk/net/ipv4/multipath_wrandom.c @@ -172,7 +172,7 @@ static void wrandom_select_route(const struct flowi *flp, multipath_comparekeys(&rt->fl, flp)) { struct multipath_candidate* mpc = (struct multipath_candidate*) - kmalloc(size_mpc, GFP_ATOMIC); + kmalloc(size_mpc, GFP_KERNEL); if (!mpc) return; @@ -244,7 +244,7 @@ static void wrandom_set_nhinfo(__u32 network, if (!target_route) { const size_t size_rt = sizeof(struct multipath_route); target_route = (struct multipath_route *) - kmalloc(size_rt, GFP_ATOMIC); + kmalloc(size_rt, GFP_KERNEL); target_route->gw = nh->nh_gw; target_route->oif = nh->nh_oif; @@ -265,7 +265,7 @@ static void wrandom_set_nhinfo(__u32 network, if (!target_dest) { const size_t size_dst = sizeof(struct multipath_dest); target_dest = (struct multipath_dest*) - kmalloc(size_dst, GFP_ATOMIC); + kmalloc(size_dst, GFP_KERNEL); target_dest->nh_info = nh; target_dest->network = network; diff --git a/trunk/scripts/kconfig/Makefile b/trunk/scripts/kconfig/Makefile index 09abb891d11f..5a5ddc40f36c 100644 --- a/trunk/scripts/kconfig/Makefile +++ b/trunk/scripts/kconfig/Makefile @@ -2,7 +2,7 @@ # Kernel configuration targets # These targets are used from top-level makefile -.PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config +.PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig xconfig: $(obj)/qconf $< arch/$(ARCH)/Kconfig @@ -23,13 +23,6 @@ oldconfig: $(obj)/conf silentoldconfig: $(obj)/conf $< -s arch/$(ARCH)/Kconfig -update-po-config: $(obj)/kxgettext - xgettext --default-domain=linux \ - --add-comments --keyword=_ --keyword=N_ \ - --files-from=scripts/kconfig/POTFILES.in \ - -o scripts/kconfig/linux.pot - scripts/kconfig/kxgettext arch/$(ARCH)/Kconfig >> scripts/kconfig/linux.pot - .PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig randconfig: $(obj)/conf @@ -79,10 +72,9 @@ help: # Based on GTK which needs to be installed to compile it # object files used by all kconfig flavours -hostprogs-y := conf mconf qconf gconf kxgettext +hostprogs-y := conf mconf qconf gconf conf-objs := conf.o zconf.tab.o mconf-objs := mconf.o zconf.tab.o -kxgettext-objs := kxgettext.o zconf.tab.o ifeq ($(MAKECMDGOALS),xconfig) qconf-target := 1 @@ -115,7 +107,7 @@ HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs` HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ -D LKC_DIRECT_LINK -$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o $(obj)/kxgettext: $(obj)/zconf.tab.h +$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h $(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped $(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped diff --git a/trunk/scripts/kconfig/POTFILES.in b/trunk/scripts/kconfig/POTFILES.in deleted file mode 100644 index cc94e46a79e8..000000000000 --- a/trunk/scripts/kconfig/POTFILES.in +++ /dev/null @@ -1,5 +0,0 @@ -scripts/kconfig/mconf.c -scripts/kconfig/conf.c -scripts/kconfig/confdata.c -scripts/kconfig/gconf.c -scripts/kconfig/qconf.cc diff --git a/trunk/scripts/kconfig/conf.c b/trunk/scripts/kconfig/conf.c index 70e7264c6942..a494d1aeb9f9 100644 --- a/trunk/scripts/kconfig/conf.c +++ b/trunk/scripts/kconfig/conf.c @@ -34,7 +34,7 @@ static int conf_cnt; static signed char line[128]; static struct menu *rootEntry; -static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); +static char nohelp_text[] = "Sorry, no help available for this option yet.\n"; static void strip(signed char *str) { @@ -56,9 +56,9 @@ static void strip(signed char *str) static void check_stdin(void) { if (!valid_stdin && input_mode == ask_silent) { - printf(_("aborted!\n\n")); - printf(_("Console input/output is redirected. ")); - printf(_("Run 'make oldconfig' to update configuration.\n\n")); + printf("aborted!\n\n"); + printf("Console input/output is redirected. "); + printf("Run 'make oldconfig' to update configuration.\n\n"); exit(1); } } @@ -470,7 +470,7 @@ static void check_conf(struct menu *menu) if (sym) { if (sym_is_changable(sym) && !sym_has_value(sym)) { if (!conf_cnt++) - printf(_("*\n* Restart config...\n*\n")); + printf("*\n* Restart config...\n*\n"); rootEntry = menu_get_parent_menu(menu); conf(rootEntry); } @@ -504,7 +504,7 @@ int main(int ac, char **av) input_mode = set_default; defconfig_file = av[i++]; if (!defconfig_file) { - printf(_("%s: No default config file specified\n"), + printf("%s: No default config file specified\n", av[0]); exit(1); } @@ -530,7 +530,7 @@ int main(int ac, char **av) } name = av[i]; if (!name) { - printf(_("%s: Kconfig file missing\n"), av[0]); + printf("%s: Kconfig file missing\n", av[0]); } conf_parse(name); //zconfdump(stdout); @@ -547,12 +547,12 @@ int main(int ac, char **av) break; case ask_silent: if (stat(".config", &tmpstat)) { - printf(_("***\n" + printf("***\n" "*** You have not yet configured your kernel!\n" "***\n" "*** Please run some configurator (e.g. \"make oldconfig\" or\n" "*** \"make menuconfig\" or \"make xconfig\").\n" - "***\n")); + "***\n"); exit(1); } case ask_all: @@ -576,7 +576,7 @@ int main(int ac, char **av) check_conf(&rootmenu); } while (conf_cnt); if (conf_write(NULL)) { - fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); + fprintf(stderr, "\n*** Error during writing of the kernel configuration.\n\n"); return 1; } return 0; diff --git a/trunk/scripts/kconfig/confdata.c b/trunk/scripts/kconfig/confdata.c index 2755c459d780..1e82ae390a69 100644 --- a/trunk/scripts/kconfig/confdata.c +++ b/trunk/scripts/kconfig/confdata.c @@ -88,9 +88,9 @@ int conf_read(const char *name) name = conf_expand_value(name); in = zconf_fopen(name); if (in) { - printf(_("#\n" - "# using defaults found in %s\n" - "#\n"), name); + printf("#\n" + "# using defaults found in %s\n" + "#\n", name); break; } } @@ -312,11 +312,11 @@ int conf_write(const char *name) if (env && *env) use_timestamp = 0; - fprintf(out, _("#\n" - "# Automatically generated make config: don't edit\n" - "# Linux kernel version: %s\n" - "%s%s" - "#\n"), + fprintf(out, "#\n" + "# Automatically generated make config: don't edit\n" + "# Linux kernel version: %s\n" + "%s%s" + "#\n", sym_get_string_value(sym), use_timestamp ? "# " : "", use_timestamp ? ctime(&now) : ""); diff --git a/trunk/scripts/kconfig/gconf.c b/trunk/scripts/kconfig/gconf.c index ad6b12043874..6fdbe6e3ce0d 100644 --- a/trunk/scripts/kconfig/gconf.c +++ b/trunk/scripts/kconfig/gconf.c @@ -41,7 +41,7 @@ static gboolean resizeable = FALSE; static gboolean config_changed = FALSE; static char nohelp_text[] = - N_("Sorry, no help available for this option yet.\n"); + "Sorry, no help available for this option yet.\n"; GtkWidget *main_wnd = NULL; GtkWidget *tree1_w = NULL; // left frame @@ -193,7 +193,7 @@ void init_main_window(const gchar * glade_file) xml = glade_xml_new(glade_file, "window1", NULL); if (!xml) - g_error(_("GUI loading failed !\n")); + g_error("GUI loading failed !\n"); glade_xml_signal_autoconnect(xml); main_wnd = glade_xml_get_widget(xml, "window1"); @@ -275,7 +275,7 @@ void init_main_window(const gchar * glade_file) /*"style", PANGO_STYLE_OBLIQUE, */ NULL); - sprintf(title, _("Linux Kernel v%s Configuration"), + sprintf(title, "Linux Kernel v%s Configuration", getenv("KERNELRELEASE")); gtk_window_set_title(GTK_WINDOW(main_wnd), title); @@ -325,7 +325,7 @@ void init_left_tree(void) column = gtk_tree_view_column_new(); gtk_tree_view_append_column(view, column); - gtk_tree_view_column_set_title(column, _("Options")); + gtk_tree_view_column_set_title(column, "Options"); renderer = gtk_cell_renderer_toggle_new(); gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), @@ -370,7 +370,7 @@ void init_right_tree(void) column = gtk_tree_view_column_new(); gtk_tree_view_append_column(view, column); - gtk_tree_view_column_set_title(column, _("Options")); + gtk_tree_view_column_set_title(column, "Options"); renderer = gtk_cell_renderer_pixbuf_new(); gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column), @@ -401,7 +401,7 @@ void init_right_tree(void) renderer = gtk_cell_renderer_text_new(); gtk_tree_view_insert_column_with_attributes(view, -1, - _("Name"), renderer, + "Name", renderer, "text", COL_NAME, "foreground-gdk", COL_COLOR, NULL); @@ -425,7 +425,7 @@ void init_right_tree(void) COL_COLOR, NULL); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_insert_column_with_attributes(view, -1, - _("Value"), renderer, + "Value", renderer, "text", COL_VALUE, "editable", COL_EDIT, @@ -466,15 +466,15 @@ static void text_insert_help(struct menu *menu) GtkTextIter start, end; const char *prompt = menu_get_prompt(menu); gchar *name; - const char *help = _(nohelp_text); + const char *help = nohelp_text; if (!menu->sym) help = ""; else if (menu->sym->help) - help = _(menu->sym->help); + help = menu->sym->help; if (menu->sym && menu->sym->name) - name = g_strdup_printf(_(menu->sym->name)); + name = g_strdup_printf(menu->sym->name); else name = g_strdup(""); @@ -530,7 +530,7 @@ gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event, if (config_changed == FALSE) return FALSE; - dialog = gtk_dialog_new_with_buttons(_("Warning !"), + dialog = gtk_dialog_new_with_buttons("Warning !", GTK_WINDOW(main_wnd), (GtkDialogFlags) (GTK_DIALOG_MODAL | @@ -544,7 +544,7 @@ gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event, gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL); - label = gtk_label_new(_("\nSave configuration ?\n")); + label = gtk_label_new("\nSave configuration ?\n"); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label); gtk_widget_show(label); @@ -604,7 +604,7 @@ load_filename(GtkFileSelection * file_selector, gpointer user_data) (user_data)); if (conf_read(fn)) - text_insert_msg(_("Error"), _("Unable to load configuration !")); + text_insert_msg("Error", "Unable to load configuration !"); else display_tree(&rootmenu); } @@ -613,7 +613,7 @@ void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data) { GtkWidget *fs; - fs = gtk_file_selection_new(_("Load file...")); + fs = gtk_file_selection_new("Load file..."); g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), "clicked", G_CALLBACK(load_filename), (gpointer) fs); @@ -632,7 +632,7 @@ void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data) void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data) { if (conf_write(NULL)) - text_insert_msg(_("Error"), _("Unable to save configuration !")); + text_insert_msg("Error", "Unable to save configuration !"); config_changed = FALSE; } @@ -647,7 +647,7 @@ store_filename(GtkFileSelection * file_selector, gpointer user_data) (user_data)); if (conf_write(fn)) - text_insert_msg(_("Error"), _("Unable to save configuration !")); + text_insert_msg("Error", "Unable to save configuration !"); gtk_widget_destroy(GTK_WIDGET(user_data)); } @@ -656,7 +656,7 @@ void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data) { GtkWidget *fs; - fs = gtk_file_selection_new(_("Save file as...")); + fs = gtk_file_selection_new("Save file as..."); g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), "clicked", G_CALLBACK(store_filename), (gpointer) fs); @@ -740,7 +740,7 @@ on_show_debug_info1_activate(GtkMenuItem * menuitem, gpointer user_data) void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data) { GtkWidget *dialog; - const gchar *intro_text = _( + const gchar *intro_text = "Welcome to gkc, the GTK+ graphical kernel configuration tool\n" "for Linux.\n" "For each option, a blank box indicates the feature is disabled, a\n" @@ -756,7 +756,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data) "option.\n" "\n" "Toggling Show Debug Info under the Options menu will show \n" - "the dependencies, which you can then match by examining other options."); + "the dependencies, which you can then match by examining other options."; dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -773,8 +773,8 @@ void on_about1_activate(GtkMenuItem * menuitem, gpointer user_data) { GtkWidget *dialog; const gchar *about_text = - _("gkc is copyright (c) 2002 Romain Lievin .\n" - "Based on the source code from Roman Zippel.\n"); + "gkc is copyright (c) 2002 Romain Lievin .\n" + "Based on the source code from Roman Zippel.\n"; dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -791,9 +791,9 @@ void on_license1_activate(GtkMenuItem * menuitem, gpointer user_data) { GtkWidget *dialog; const gchar *license_text = - _("gkc is released under the terms of the GNU GPL v2.\n" - "For more information, please see the source code or\n" - "visit http://www.fsf.org/licenses/licenses.html\n"); + "gkc is released under the terms of the GNU GPL v2.\n" + "For more information, please see the source code or\n" + "visit http://www.fsf.org/licenses/licenses.html\n"; dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -1579,10 +1579,6 @@ int main(int ac, char *av[]) kconfig_load(); #endif - bindtextdomain(PACKAGE, LOCALEDIR); - bind_textdomain_codeset(PACKAGE, "UTF-8"); - textdomain(PACKAGE); - /* GTK stuffs */ gtk_set_locale(); gtk_init(&ac, &av); diff --git a/trunk/scripts/kconfig/kxgettext.c b/trunk/scripts/kconfig/kxgettext.c deleted file mode 100644 index 1c88d7c6d5a7..000000000000 --- a/trunk/scripts/kconfig/kxgettext.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Arnaldo Carvalho de Melo , 2005 - * - * Released under the terms of the GNU GPL v2.0 - */ - -#include -#include - -#define LKC_DIRECT_LINK -#include "lkc.h" - -static char *escape(const char* text, char *bf, int len) -{ - char *bfp = bf; - int multiline = strchr(text, '\n') != NULL; - - *bfp++ = '"'; - --len; - - if (multiline) { - *bfp++ = '"'; - *bfp++ = '\n'; - *bfp++ = '"'; - len -= 3; - } - - while (*text != '\0' && len > 1) { - if (*text == '"') - *bfp++ = '\\'; - else if (*text == '\n') { - *bfp++ = '\\'; - *bfp++ = 'n'; - *bfp++ = '"'; - *bfp++ = '\n'; - *bfp++ = '"'; - len -= 5; - ++text; - goto next; - } - *bfp++ = *text++; -next: - --len; - } - - if (multiline) - bfp -= 3; - - *bfp++ = '"'; - *bfp = '\0'; - - return bf; -} - -struct file_line { - struct file_line *next; - char* file; - int lineno; -}; - -static struct file_line *file_line__new(char *file, int lineno) -{ - struct file_line *self = malloc(sizeof(*self)); - - if (self == NULL) - goto out; - - self->file = file; - self->lineno = lineno; - self->next = NULL; -out: - return self; -} - -struct message { - const char *msg; - const char *option; - struct message *next; - struct file_line *files; -}; - -static struct message *message__list; - -static struct message *message__new(const char *msg, char *option, char *file, int lineno) -{ - struct message *self = malloc(sizeof(*self)); - - if (self == NULL) - goto out; - - self->files = file_line__new(file, lineno); - if (self->files == NULL) - goto out_fail; - - self->msg = strdup(msg); - if (self->msg == NULL) - goto out_fail_msg; - - self->option = option; - self->next = NULL; -out: - return self; -out_fail_msg: - free(self->files); -out_fail: - free(self); - self = NULL; - goto out; -} - -static struct message *mesage__find(const char *msg) -{ - struct message *m = message__list; - - while (m != NULL) { - if (strcmp(m->msg, msg) == 0) - break; - m = m->next; - } - - return m; -} - -static int message__add_file_line(struct message *self, char *file, int lineno) -{ - int rc = -1; - struct file_line *fl = file_line__new(file, lineno); - - if (fl == NULL) - goto out; - - fl->next = self->files; - self->files = fl; - rc = 0; -out: - return rc; -} - -static int message__add(const char *msg, char *option, char *file, int lineno) -{ - int rc = 0; - char bf[16384]; - char *escaped = escape(msg, bf, sizeof(bf)); - struct message *m = mesage__find(escaped); - - if (m != NULL) - rc = message__add_file_line(m, file, lineno); - else { - m = message__new(escaped, option, file, lineno); - - if (m != NULL) { - m->next = message__list; - message__list = m; - } else - rc = -1; - } - return rc; -} - -void menu_build_message_list(struct menu *menu) -{ - struct menu *child; - - message__add(menu_get_prompt(menu), NULL, - menu->file == NULL ? "Root Menu" : menu->file->name, - menu->lineno); - - if (menu->sym != NULL && menu->sym->help != NULL) - message__add(menu->sym->help, menu->sym->name, - menu->file == NULL ? "Root Menu" : menu->file->name, - menu->lineno); - - for (child = menu->list; child != NULL; child = child->next) - if (child->prompt != NULL) - menu_build_message_list(child); -} - -static void message__print_file_lineno(struct message *self) -{ - struct file_line *fl = self->files; - - printf("\n#: %s:%d", fl->file, fl->lineno); - fl = fl->next; - - while (fl != NULL) { - printf(", %s:%d", fl->file, fl->lineno); - fl = fl->next; - } - - if (self->option != NULL) - printf(", %s:00000", self->option); - - putchar('\n'); -} - -static void message__print_gettext_msgid_msgstr(struct message *self) -{ - message__print_file_lineno(self); - - printf("msgid %s\n" - "msgstr \"\"\n", self->msg); -} - -void menu__xgettext(void) -{ - struct message *m = message__list; - - while (m != NULL) { - message__print_gettext_msgid_msgstr(m); - m = m->next; - } -} - -int main(int ac, char **av) -{ - conf_parse(av[1]); - - menu_build_message_list(menu_get_root_menu(NULL)); - menu__xgettext(); - return 0; -} diff --git a/trunk/scripts/kconfig/lkc.h b/trunk/scripts/kconfig/lkc.h index 8b84c42b49b5..b8a67fc9d647 100644 --- a/trunk/scripts/kconfig/lkc.h +++ b/trunk/scripts/kconfig/lkc.h @@ -8,8 +8,6 @@ #include "expr.h" -#include - #ifdef __cplusplus extern "C" { #endif @@ -25,12 +23,6 @@ extern "C" { #define SRCTREE "srctree" -#define PACKAGE "linux" -#define LOCALEDIR "/usr/share/locale" - -#define _(text) gettext(text) -#define N_(text) (text) - int zconfparse(void); void zconfdump(FILE *out); diff --git a/trunk/scripts/kconfig/mconf.c b/trunk/scripts/kconfig/mconf.c index e5db10ca9564..730d316fe7fe 100644 --- a/trunk/scripts/kconfig/mconf.c +++ b/trunk/scripts/kconfig/mconf.c @@ -4,8 +4,6 @@ * * Introduced single menu mode (show all sub-menus in one large tree). * 2002-11-06 Petr Baudis - * - * i18n, 2005, Arnaldo Carvalho de Melo */ #include @@ -25,7 +23,7 @@ #include "lkc.h" static char menu_backtitle[128]; -static const char mconf_readme[] = N_( +static const char mconf_readme[] = "Overview\n" "--------\n" "Some kernel features may be built directly into the kernel.\n" @@ -158,39 +156,39 @@ static const char mconf_readme[] = N_( "\n" "Note that this mode can eventually be a little more CPU expensive\n" "(especially with a larger number of unrolled categories) than the\n" -"default mode.\n"), -menu_instructions[] = N_( +"default mode.\n", +menu_instructions[] = "Arrow keys navigate the menu. " " selects submenus --->. " "Highlighted letters are hotkeys. " "Pressing includes, excludes, modularizes features. " "Press to exit, for Help, for Search. " - "Legend: [*] built-in [ ] excluded module < > module capable"), -radiolist_instructions[] = N_( + "Legend: [*] built-in [ ] excluded module < > module capable", +radiolist_instructions[] = "Use the arrow keys to navigate this window or " "press the hotkey of the item you wish to select " "followed by the . " - "Press for additional information about this option."), -inputbox_instructions_int[] = N_( + "Press for additional information about this option.", +inputbox_instructions_int[] = "Please enter a decimal value. " "Fractions will not be accepted. " - "Use the key to move from the input field to the buttons below it."), -inputbox_instructions_hex[] = N_( + "Use the key to move from the input field to the buttons below it.", +inputbox_instructions_hex[] = "Please enter a hexadecimal value. " - "Use the key to move from the input field to the buttons below it."), -inputbox_instructions_string[] = N_( + "Use the key to move from the input field to the buttons below it.", +inputbox_instructions_string[] = "Please enter a string value. " - "Use the key to move from the input field to the buttons below it."), -setmod_text[] = N_( + "Use the key to move from the input field to the buttons below it.", +setmod_text[] = "This feature depends on another which has been configured as a module.\n" - "As a result, this feature will be built as a module."), -nohelp_text[] = N_( - "There is no help available for this kernel option.\n"), -load_config_text[] = N_( + "As a result, this feature will be built as a module.", +nohelp_text[] = + "There is no help available for this kernel option.\n", +load_config_text[] = "Enter the name of the configuration file you wish to load. " "Accept the name shown to restore the configuration you " - "last retrieved. Leave blank to abort."), -load_config_help[] = N_( + "last retrieved. Leave blank to abort.", +load_config_help[] = "\n" "For various reasons, one may wish to keep several different kernel\n" "configurations available on a single machine.\n" @@ -200,11 +198,11 @@ load_config_help[] = N_( "to modify that configuration.\n" "\n" "If you are uncertain, then you have probably never used alternate\n" - "configuration files. You should therefor leave this blank to abort.\n"), -save_config_text[] = N_( + "configuration files. You should therefor leave this blank to abort.\n", +save_config_text[] = "Enter a filename to which this configuration should be saved " - "as an alternate. Leave blank to abort."), -save_config_help[] = N_( + "as an alternate. Leave blank to abort.", +save_config_help[] = "\n" "For various reasons, one may wish to keep different kernel\n" "configurations available on a single machine.\n" @@ -214,8 +212,8 @@ save_config_help[] = N_( "configuration options you have selected at that time.\n" "\n" "If you are uncertain what all this means then you should probably\n" - "leave this blank.\n"), -search_help[] = N_( + "leave this blank.\n", +search_help[] = "\n" "Search for CONFIG_ symbols and display their relations.\n" "Example: search for \"^FOO\"\n" @@ -252,7 +250,7 @@ search_help[] = N_( "Examples: USB => find all CONFIG_ symbols containing USB\n" " ^USB => find all CONFIG_ symbols starting with USB\n" " USB$ => find all CONFIG_ symbols ending with USB\n" - "\n"); + "\n"; static signed char buf[4096], *bufptr = buf; static signed char input_buf[4096]; @@ -307,8 +305,8 @@ static void init_wsize(void) } if (rows < 19 || cols < 80) { - fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); - fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n")); + fprintf(stderr, "Your display is too small to run Menuconfig!\n"); + fprintf(stderr, "It must be at least 19 lines by 80 columns.\n"); exit(1); } @@ -528,9 +526,9 @@ static void search_conf(void) again: cprint_init(); cprint("--title"); - cprint(_("Search Configuration Parameter")); + cprint("Search Configuration Parameter"); cprint("--inputbox"); - cprint(_("Enter Keyword")); + cprint("Enter Keyword"); cprint("10"); cprint("75"); cprint(""); @@ -541,7 +539,7 @@ static void search_conf(void) case 0: break; case 1: - show_helptext(_("Search Configuration"), search_help); + show_helptext("Search Configuration", search_help); goto again; default: return; @@ -550,7 +548,7 @@ static void search_conf(void) sym_arr = sym_re_search(input_buf); res = get_relations_str(sym_arr); free(sym_arr); - show_textbox(_("Search Results"), str_get(&res), 0, 0); + show_textbox("Search Results", str_get(&res), 0, 0); str_free(&res); } @@ -723,9 +721,9 @@ static void conf(struct menu *menu) while (1) { cprint_init(); cprint("--title"); - cprint("%s", prompt ? prompt : _("Main Menu")); + cprint("%s", prompt ? prompt : "Main Menu"); cprint("--menu"); - cprint(_(menu_instructions)); + cprint(menu_instructions); cprint("%d", rows); cprint("%d", cols); cprint("%d", rows - 10); @@ -738,9 +736,9 @@ static void conf(struct menu *menu) cprint(":"); cprint("--- "); cprint("L"); - cprint(_(" Load an Alternate Configuration File")); + cprint(" Load an Alternate Configuration File"); cprint("S"); - cprint(_(" Save Configuration to an Alternate File")); + cprint(" Save Configuration to an Alternate File"); } stat = exec_conf(); if (stat < 0) @@ -795,7 +793,7 @@ static void conf(struct menu *menu) if (sym) show_help(submenu); else - show_helptext("README", _(mconf_readme)); + show_helptext("README", mconf_readme); break; case 3: if (type == 't') { @@ -851,7 +849,7 @@ static void show_help(struct menu *menu) { if (sym->name) { str_printf(&help, "CONFIG_%s:\n\n", sym->name); - str_append(&help, _(sym->help)); + str_append(&help, sym->help); str_append(&help, "\n"); } } else { @@ -888,9 +886,9 @@ static void conf_choice(struct menu *menu) while (1) { cprint_init(); cprint("--title"); - cprint("%s", prompt ? prompt : _("Main Menu")); + cprint("%s", prompt ? prompt : "Main Menu"); cprint("--radiolist"); - cprint(_(radiolist_instructions)); + cprint(radiolist_instructions); cprint("15"); cprint("70"); cprint("6"); @@ -937,17 +935,17 @@ static void conf_string(struct menu *menu) while (1) { cprint_init(); cprint("--title"); - cprint("%s", prompt ? prompt : _("Main Menu")); + cprint("%s", prompt ? prompt : "Main Menu"); cprint("--inputbox"); switch (sym_get_type(menu->sym)) { case S_INT: - cprint(_(inputbox_instructions_int)); + cprint(inputbox_instructions_int); break; case S_HEX: - cprint(_(inputbox_instructions_hex)); + cprint(inputbox_instructions_hex); break; case S_STRING: - cprint(_(inputbox_instructions_string)); + cprint(inputbox_instructions_string); break; default: /* panic? */; @@ -960,7 +958,7 @@ static void conf_string(struct menu *menu) case 0: if (sym_set_string_value(menu->sym, input_buf)) return; - show_textbox(NULL, _("You have made an invalid entry."), 5, 43); + show_textbox(NULL, "You have made an invalid entry.", 5, 43); break; case 1: show_help(menu); @@ -989,10 +987,10 @@ static void conf_load(void) return; if (!conf_read(input_buf)) return; - show_textbox(NULL, _("File does not exist!"), 5, 38); + show_textbox(NULL, "File does not exist!", 5, 38); break; case 1: - show_helptext(_("Load Alternate Configuration"), load_config_help); + show_helptext("Load Alternate Configuration", load_config_help); break; case 255: return; @@ -1018,10 +1016,10 @@ static void conf_save(void) return; if (!conf_write(input_buf)) return; - show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60); + show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60); break; case 1: - show_helptext(_("Save Alternate Configuration"), save_config_help); + show_helptext("Save Alternate Configuration", save_config_help); break; case 255: return; @@ -1042,16 +1040,12 @@ int main(int ac, char **av) char *mode; int stat; - setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE, LOCALEDIR); - textdomain(PACKAGE); - conf_parse(av[1]); conf_read(NULL); sym = sym_lookup("KERNELRELEASE", 0); sym_calc_value(sym); - sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"), + sprintf(menu_backtitle, "Linux Kernel v%s Configuration", sym_get_string_value(sym)); mode = getenv("MENUCONFIG_MODE"); @@ -1068,7 +1062,7 @@ int main(int ac, char **av) do { cprint_init(); cprint("--yesno"); - cprint(_("Do you wish to save your new kernel configuration?")); + cprint("Do you wish to save your new kernel configuration?"); cprint("5"); cprint("60"); stat = exec_conf(); @@ -1076,20 +1070,20 @@ int main(int ac, char **av) if (stat == 0) { if (conf_write(NULL)) { - fprintf(stderr, _("\n\n" + fprintf(stderr, "\n\n" "Error during writing of the kernel configuration.\n" "Your kernel configuration changes were NOT saved." - "\n\n")); + "\n\n"); return 1; } - printf(_("\n\n" + printf("\n\n" "*** End of Linux kernel configuration.\n" "*** Execute 'make' to build the kernel or try 'make help'." - "\n\n")); + "\n\n"); } else { - fprintf(stderr, _("\n\n" + fprintf(stderr, "\n\n" "Your kernel configuration changes were NOT saved." - "\n\n")); + "\n\n"); } return 0; diff --git a/trunk/scripts/kconfig/menu.c b/trunk/scripts/kconfig/menu.c index 8c59b212722d..0c13156f3344 100644 --- a/trunk/scripts/kconfig/menu.c +++ b/trunk/scripts/kconfig/menu.c @@ -365,9 +365,9 @@ bool menu_is_visible(struct menu *menu) const char *menu_get_prompt(struct menu *menu) { if (menu->prompt) - return _(menu->prompt->text); + return menu->prompt->text; else if (menu->sym) - return _(menu->sym->name); + return menu->sym->name; return NULL; } diff --git a/trunk/scripts/kconfig/qconf.cc b/trunk/scripts/kconfig/qconf.cc index 4590cd31623f..0cdbf9dbbd51 100644 --- a/trunk/scripts/kconfig/qconf.cc +++ b/trunk/scripts/kconfig/qconf.cc @@ -26,23 +26,8 @@ #include "qconf.moc" #include "images.c" -#ifdef _ -# undef _ -# define _ qgettext -#endif - static QApplication *configApp; -static inline QString qgettext(const char* str) -{ - return QString::fromLocal8Bit(gettext(str)); -} - -static inline QString qgettext(const QString& str) -{ - return QString::fromLocal8Bit(gettext(str.latin1())); -} - ConfigSettings::ConfigSettings() : showAll(false), showName(false), showRange(false), showData(false) { @@ -192,7 +177,7 @@ void ConfigItem::updateMenu(void) sym = menu->sym; prop = menu->prompt; - prompt = QString::fromLocal8Bit(menu_get_prompt(menu)); + prompt = menu_get_prompt(menu); if (prop) switch (prop->type) { case P_MENU: @@ -218,7 +203,7 @@ void ConfigItem::updateMenu(void) if (!sym) goto set_prompt; - setText(nameColIdx, QString::fromLocal8Bit(sym->name)); + setText(nameColIdx, sym->name); type = sym_get_type(sym); switch (type) { @@ -228,9 +213,9 @@ void ConfigItem::updateMenu(void) if (!sym_is_changable(sym) && !list->showAll) { setPixmap(promptColIdx, 0); - setText(noColIdx, QString::null); - setText(modColIdx, QString::null); - setText(yesColIdx, QString::null); + setText(noColIdx, 0); + setText(modColIdx, 0); + setText(yesColIdx, 0); break; } expr = sym_get_tristate_value(sym); @@ -272,7 +257,6 @@ void ConfigItem::updateMenu(void) const char* data; data = sym_get_string_value(sym); - #if QT_VERSION >= 300 int i = list->mapIdx(dataColIdx); if (i >= 0) @@ -280,9 +264,9 @@ void ConfigItem::updateMenu(void) #endif setText(dataColIdx, data); if (type == S_STRING) - prompt = QString("%1: %2").arg(prompt).arg(data); + prompt.sprintf("%s: %s", prompt.latin1(), data); else - prompt = QString("(%2) %1").arg(prompt).arg(data); + prompt.sprintf("(%s) %s", data, prompt.latin1()); break; } if (!sym_has_value(sym) && visible) @@ -359,9 +343,9 @@ void ConfigLineEdit::show(ConfigItem* i) { item = i; if (sym_get_string_value(item->menu->sym)) - setText(QString::fromLocal8Bit(sym_get_string_value(item->menu->sym))); + setText(sym_get_string_value(item->menu->sym)); else - setText(QString::null); + setText(0); Parent::show(); setFocus(); } @@ -977,7 +961,7 @@ ConfigMainWindow::ConfigMainWindow(void) delete configSettings; } -static QString print_filter(const QString &str) +static QString print_filter(const char *str) { QRegExp re("[<>&\"\\n]"); QString res = str; @@ -1010,7 +994,7 @@ static QString print_filter(const QString &str) static void expr_print_help(void *data, const char *str) { - reinterpret_cast(data)->append(print_filter(str)); + ((QString*)data)->append(print_filter(str)); } /* @@ -1025,7 +1009,7 @@ void ConfigMainWindow::setHelp(QListViewItem* item) if (item) menu = ((ConfigItem*)item)->menu; if (!menu) { - helpText->setText(QString::null); + helpText->setText(NULL); return; } @@ -1035,16 +1019,16 @@ void ConfigMainWindow::setHelp(QListViewItem* item) if (sym) { if (menu->prompt) { head += ""; - head += print_filter(_(menu->prompt->text)); + head += print_filter(menu->prompt->text); head += ""; if (sym->name) { head += " ("; - head += print_filter(_(sym->name)); + head += print_filter(sym->name); head += ")"; } } else if (sym->name) { head += ""; - head += print_filter(_(sym->name)); + head += print_filter(sym->name); head += ""; } head += "

"; @@ -1065,7 +1049,7 @@ void ConfigMainWindow::setHelp(QListViewItem* item) case P_PROMPT: case P_MENU: debug += "prompt: "; - debug += print_filter(_(prop->text)); + debug += print_filter(prop->text); debug += "
"; break; case P_DEFAULT: @@ -1104,10 +1088,10 @@ void ConfigMainWindow::setHelp(QListViewItem* item) debug += "
"; } - help = print_filter(_(sym->help)); + help = print_filter(sym->help); } else if (menu->prompt) { head += ""; - head += print_filter(_(menu->prompt->text)); + head += print_filter(menu->prompt->text); head += "

"; if (showDebug) { if (menu->prompt->visible.expr) { @@ -1127,7 +1111,7 @@ void ConfigMainWindow::loadConfig(void) QString s = QFileDialog::getOpenFileName(".config", NULL, this); if (s.isNull()) return; - if (conf_read(QFile::encodeName(s))) + if (conf_read(s.latin1())) QMessageBox::information(this, "qconf", "Unable to load configuration!"); ConfigView::updateListAll(); } @@ -1143,7 +1127,7 @@ void ConfigMainWindow::saveConfigAs(void) QString s = QFileDialog::getSaveFileName(".config", NULL, this); if (s.isNull()) return; - if (conf_write(QFile::encodeName(s))) + if (conf_write(s.latin1())) QMessageBox::information(this, "qconf", "Unable to save configuration!"); } @@ -1388,9 +1372,6 @@ int main(int ac, char** av) ConfigMainWindow* v; const char *name; - bindtextdomain(PACKAGE, LOCALEDIR); - textdomain(PACKAGE); - #ifndef LKC_DIRECT_LINK kconfig_load(); #endif