You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(11) |
Jun
(66) |
Jul
(16) |
Aug
(2) |
Sep
(7) |
Oct
(17) |
Nov
(1) |
Dec
(220) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(154) |
Feb
(167) |
Mar
(159) |
Apr
(172) |
May
(35) |
Jun
(58) |
Jul
(97) |
Aug
(285) |
Sep
(139) |
Oct
(252) |
Nov
(8) |
Dec
(3) |
| 2004 |
Jan
(13) |
Feb
(159) |
Mar
(136) |
Apr
(33) |
May
(50) |
Jun
(42) |
Jul
(140) |
Aug
(42) |
Sep
(199) |
Oct
(31) |
Nov
(55) |
Dec
|
| 2005 |
Jan
|
Feb
(12) |
Mar
(214) |
Apr
(119) |
May
(21) |
Jun
(2) |
Jul
(127) |
Aug
(10) |
Sep
(3) |
Oct
(24) |
Nov
(1) |
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(45) |
May
(13) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(26) |
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(35) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-29 10:46:02
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32127/arch/vax/boot Modified Files: cpu_sel.c Log Message: - Fix pointer vs. struct braino. Index: cpu_sel.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/cpu_sel.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- cpu_sel.c 29 Sep 2004 10:41:27 -0000 1.10 +++ cpu_sel.c 29 Sep 2004 10:45:45 -0000 1.11 @@ -254,7 +254,7 @@ */ sidex = * ((unsigned long *) mvm->sidex_addr); if ((sidex & mvm->sidex_mask) == mvm->sidex_match) { - mvm->mv.sidex = sidex; + mvm->mv->sidex = sidex; return mvm->mv; } } |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-29 10:44:30
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31777 Modified Files: cpu_ka46.c Log Message: - Reference implementation of a vector match for the KA46. This isn't yet tested (this box isn't yet attached to the power cord since I came back from Oldenburg). Index: cpu_ka46.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel/cpu_ka46.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- cpu_ka46.c 18 Sep 2004 23:06:33 -0000 1.16 +++ cpu_ka46.c 29 Sep 2004 10:44:14 -0000 1.17 @@ -81,7 +81,9 @@ ka46_cache_clear(); ka46_cache_enable(); +#ifndef USE_NEW_VECTORS mv_ka46.sidex = *(unsigned int *)RIGEL_SIDEX_ADDR; +#endif __mtpr(PR_ACCS, 2); /* Enable floating points */ } @@ -137,6 +139,19 @@ .clock_init = ka4x_clock_init, }; +#ifdef USE_NEW_VECTORS +struct machvec_match mvm_ka46 = { + .mv = &mv_ka46, + .sid_mask = VAX_SID_FAMILY_MASK, + .sid_match = VAX_MARIAH << VAX_SID_FAMILY_SHIFT, + .sidex_addr = RIGEL_SIDEX_ADDR, /* This is bogus: mariah isn't rigel + and so it should have an own + define! */ + .sidex_mask = 0x00000000, + .sidex_match = 0x00000000, +}; +#endif /* USE_NEW_VECTORS */ + static struct platform_device ka46_vsbus_device = { .name = "ka4x-vsbus" }; |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-29 10:41:37
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31236/boot Modified Files: cpu_sel.c Log Message: - I think it's worth not setting the sidex value (in the mv) in each individual cpu_xx.c file, we can do that here... Index: cpu_sel.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/cpu_sel.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- cpu_sel.c 29 Sep 2004 10:38:38 -0000 1.9 +++ cpu_sel.c 29 Sep 2004 10:41:27 -0000 1.10 @@ -253,8 +253,10 @@ * If a SIDEX match was supplied, too, check it! */ sidex = * ((unsigned long *) mvm->sidex_addr); - if ((sidex & mvm->sidex_mask) == mvm->sidex_match) + if ((sidex & mvm->sidex_mask) == mvm->sidex_match) { + mvm->mv.sidex = sidex; return mvm->mv; + } } } |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-29 10:39:32
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30855 Modified Files: vmlinux.lds.S Log Message: - Add some variables around our match structures so we can find them:-) Index: vmlinux.lds.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel/vmlinux.lds.S,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- vmlinux.lds.S 28 Sep 2004 08:48:52 -0000 1.3 +++ vmlinux.lds.S 29 Sep 2004 10:39:17 -0000 1.4 @@ -96,7 +96,9 @@ *(.initcall7.init) } __initcall_end = .; - + __init_vecmatch_start = .; + .init.vecmatch : { *(.init.vecmatch) } + __init_vecmatch_end = .; . = ALIGN(4096); .init.ramfs : { __initramfs_start = .; |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-29 10:38:52
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30638 Modified Files: cpu_sel.c Log Message: - Add an alternative implementation of idcpu() using the new vector match structure in spe... - If you don't like something, hack it. Index: cpu_sel.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/cpu_sel.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- cpu_sel.c 23 Sep 2004 23:33:15 -0000 1.8 +++ cpu_sel.c 29 Sep 2004 10:38:38 -0000 1.9 @@ -226,6 +226,49 @@ #endif } +#ifdef USE_NEW_VECTORS +extern struct machvec_match __init_vecmatch_start, __init_vecmatch_end; + +struct vax_mv * +idcpu (void) +{ + unsigned long sid; + unsigned long sidex; + struct machvec_match *mvm; + + sid = __mfpr (PR_SID); + + for (mvm = &__init_vecmatch_start; mvm < &__init_vecmatch_end; mvm++) { + if ((sid & mvm->sid_mask) == mvm->sid_match) { + /* + * No sidex known? Accept the vector. + * FIXME: Maybe sort the metch structs to have + * those with "long" masks first, then the loose + * entries with weaker/shorter masks + */ + if (!mvm->sidex_addr) + return mvm->mv; + + /* + * If a SIDEX match was supplied, too, check it! + */ + sidex = * ((unsigned long *) mvm->sidex_addr); + if ((sidex & mvm->sidex_mask) == mvm->sidex_match) + return mvm->mv; + } + } + + /* + * No matching vector found, so you're on your own to get a SID + * and SIDEX value and add it to one of the existing vectors (if + * that works for you) or create an own vector for your machine. + */ + HALT; + + /* Not reached */ + return NULL; +} +#else struct vax_mv *idcpu(void) { unsigned int sid; @@ -278,4 +321,5 @@ return NULL; } +#endif |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-29 10:33:54
|
Update of /cvsroot/linux-vax/kernel-2.5/include/asm-vax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29946 Modified Files: mv.h Log Message: - Rename. Index: mv.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/include/asm-vax/mv.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- mv.h 29 Sep 2004 09:57:30 -0000 1.20 +++ mv.h 29 Sep 2004 10:33:45 -0000 1.21 @@ -81,7 +81,7 @@ #define SET_VECTOR(vec) \ static struct machvec_match __init_vecmatch_##vec \ __attribute_used__ \ - __attribute__((__section__(".vax.vecmatch"))) = &(vec) + __attribute__((__section__(".init.vecmatch"))) = &(vec) #endif /* USE_NEW_VECTORS */ |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-29 09:57:44
|
Update of /cvsroot/linux-vax/kernel-2.5/include/asm-vax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23240 Modified Files: mv.h Log Message: - So I now start to implement the new vector matching stuff. If you dislike something, just hack it as you think and check it in. - The new code is currently be guarded by USE_NEW_VECTORS, which is per default #undef'ed. Index: mv.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/include/asm-vax/mv.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- mv.h 13 May 2004 09:43:14 -0000 1.19 +++ mv.h 29 Sep 2004 09:57:30 -0000 1.20 @@ -54,6 +54,7 @@ extern struct vax_mv mv_ka43; extern struct vax_mv mv_ka46; extern struct vax_mv mv_ka48; +extern struct vax_mv mv_ka49; extern struct vax_mv mv_ka55; extern struct vax_mv mv_ka410; extern struct vax_mv mv_ka630; @@ -62,6 +63,26 @@ extern struct vax_mv mv_ka660; extern struct vax_mv mv_vxt; +#undef USE_NEW_VECTORS +#ifdef USE_NEW_VECTORS +/* + * This defines a match for a machine vector and a macro to install + * such a match structure. + */ +struct machvec_match { + struct vax_mv *mv; + unsigned long sid_mask; + unsigned long sid_match; + unsigned long sidex_addr; + unsigned long sidex_mask; + unsigned long sidex_match; +}; + +#define SET_VECTOR(vec) \ + static struct machvec_match __init_vecmatch_##vec \ + __attribute_used__ \ + __attribute__((__section__(".vax.vecmatch"))) = &(vec) +#endif /* USE_NEW_VECTORS */ /* |
|
From: Kenn H. <ke...@us...> - 2004-09-28 22:26:49
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31158 Modified Files: head.S hexdump.S Log Message: Our compiler is built to consider r0-r5 as not-preserved-across-call registers (I thought it was only r0 and r1). So avoid using these registers where we're calling C code. Also use boot_memmove to relocate the booting kernel image (slightly slower, but more readable) Index: hexdump.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/hexdump.S,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- hexdump.S 26 Sep 2004 14:44:06 -0000 1.5 +++ hexdump.S 28 Sep 2004 22:26:39 -0000 1.6 @@ -7,6 +7,10 @@ # .globl hexdump hexdump: +# This is broken since the C code can clobber r0 to r5 and this +# code has not been updated for this + halt + # move offset to start dumping at into r4 # movl $0xffa800,r4 # movl ap,r4 Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/head.S,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- head.S 28 Sep 2004 08:48:52 -0000 1.14 +++ head.S 28 Sep 2004 22:26:38 -0000 1.15 @@ -60,16 +60,16 @@ # pointers to virtual addresses in S0 space. We need to change # the pointers to the functions we use before VM init to point # into the newly-loaded kernel image.) - movl mv, %r2 - moval start, %r3 + movl mv, %r10 + moval start, %r8 - subl2 $PAGE_OFFSET+KERNEL_START_PHYS, %r3 - addl2 %r3, MV_PRE_VM_PUTCHAR(%r2) - addl2 %r3, MV_PRE_VM_GETCHAR(%r2) - addl2 %r3, MV_CPU_TYPE_STR(%r2) + subl2 $PAGE_OFFSET+KERNEL_START_PHYS, %r8 + addl2 %r8, MV_PRE_VM_PUTCHAR(%r10) + addl2 %r8, MV_PRE_VM_GETCHAR(%r10) + addl2 %r8, MV_CPU_TYPE_STR(%r10) # pre_vm_init is called after we relocate - subl2 $PAGE_OFFSET, MV_PRE_VM_INIT(%r2) + subl2 $PAGE_OFFSET, MV_PRE_VM_INIT(%r10) # print the cpu type calls $0, boot_crlf @@ -114,47 +114,29 @@ movl mv, boot_mv # copy the loaded image higher up in physical RAM - # chunks of 65535B data are moved top-to-bottom while - # inside one chunk the data is moved bottom-to-top. - # Assumed that 1MB - load_address > 65535B otherwise - # it will break. + movl $__bss_start, %r6 subl2 $start, %r6 # byte count to r6 - movab __bss_start, %r1 - subl2 $0xffff, %r1 # r1 points to top chunk of source - movl $KERNEL_START_PHYS, %r3 # dest address to r3 - addl2 %r6, %r3 - subl2 $0xffff,%r3 # r3 points to top chunk of dest -copy_chunk: - cmpl $0xffff,%r6 - bgeq last_chunk - movc3 $0xffff, (%r1), (%r3) - subl2 $0x1fffe, %r1 # place r1 to bottom of new src. chunk - subl2 $0x1fffe, %r3 # place r3 to bottom of new dest. chunk - subl2 $0xffff, %r6 - beql copy_done # this instruction is probably not needed - brb copy_chunk -last_chunk: - movab start, %r1 - movl $KERNEL_START_PHYS, %r3 - movc3 %r6, (%r1), (%r3) -copy_done: + pushl %r6 + pushab start # source address + pushl $KERNEL_START_PHYS # dest address + calls $3, boot_memmove # Next we have to fill the .bss section will zeros. We do it now # instead of when we are preparing the loadable image because it # makes the image smaller. subl3 $__bss_start, $_end, %r6 # length of .bss to r6 - subl3 $start, $__bss_start, %r3 # offset of .bss to r3 - addl2 $KERNEL_START_PHYS, %r3 # phys address of .bss start now in r3 + subl3 $start, $__bss_start, %r7 # offset of .bss to r7 + addl2 $KERNEL_START_PHYS, %r7 # phys address of .bss start now in r7 pushl %r6 - pushl %r3 + pushl %r7 calls $2, boot_memzero - addl2 %r6, %r3 + addl2 %r6, %r7 - decl %r3 - movl %r3, %r9 # save phys addr of last byte of kernel + decl %r7 + movl %r7, %r9 # save phys addr of last byte of kernel # in R9. We will need this later. # Need to know the distance we have moved the kernel, so that we can @@ -163,10 +145,10 @@ subl3 %r2, $KERNEL_START_PHYS, %r2 # r2 = START_PHYS - load_address # calculate the position after jump to reloc - movl $KERNEL_START_PHYS, %r3 - addl2 $reloc, %r3 - subl2 $start, %r3 - jmp (%r3) + movl $KERNEL_START_PHYS, %r8 + addl2 $reloc, %r8 + subl2 $start, %r8 + jmp (%r8) halt reloc: @@ -176,12 +158,12 @@ # fix up the machine vector pointer (by restoring it from boot_mv and # adding in the distance that the kernel was re-located) addl3 %r2, boot_mv, mv - movl mv, %r3 + movl mv, %r10 #and the pre-vm i/o functions - addl2 %r2, MV_PRE_VM_PUTCHAR(%r3) - addl2 %r2, MV_PRE_VM_GETCHAR(%r3) - addl2 %r2, MV_CPU_TYPE_STR(%r3) + addl2 %r2, MV_PRE_VM_PUTCHAR(%r10) + addl2 %r2, MV_PRE_VM_GETCHAR(%r10) + addl2 %r2, MV_CPU_TYPE_STR(%r10) pushab msg_relocated # debugging line no 2 calls $1, boot_printstr @@ -196,8 +178,8 @@ # save RPB before it gets obliterated movl boot_r11, %r11 movc3 $RPB_SIZE, (%r11), boot_rpb - movl mv, %r3 - calls $0, *MV_PRE_VM_INIT(%r3) + movl mv, %r10 + calls $0, *MV_PRE_VM_INIT(%r10) # set up the system page table for all of physical memory. # for the i386, the first page only is setup. For us, as the @@ -235,7 +217,7 @@ blssu sysfill # We need to align the IOMAP/VMALLOC tables (well at least the VMALLOC - # tables, but no harm.. well waste the space here or later) on a Linux + # tables, but no harm.. we will waste the space here or later) on a Linux # PAGE boundary (4K) # we need to check is r7 4k-aligned if not we need to fill zero until it # is, so round up r7 to the next page, add 7 then and with 7, @@ -298,8 +280,8 @@ addl2 $PAGE_OFFSET, iomap_base # ... and the IOMAP PTEs addl2 $PAGE_OFFSET, vmallocmap_base # ... and the IOMAP PTEs addl2 $PAGE_OFFSET, mv # fix up machine vector pointer - movl mv, %r3 - addl2 $PAGE_OFFSET, MV_CPU_TYPE_STR(%r3) + movl mv, %r10 + addl2 $PAGE_OFFSET, MV_CPU_TYPE_STR(%r10) # relocate the interrupt stack. The C code will turn the # last page of the interrupt stack into a read-only guard @@ -314,7 +296,7 @@ # Now that we have ISP (the interrupt stack pointer) sorted, # we need to move over to working on the kernel stack. We do this - # my loading KSP with the top of the kernel stack for the 'init task' + # by loading KSP with the top of the kernel stack for the 'init task' # and faking a saved PC/PSL on the interrupt stack which we then # 'return' to moval init_thread_union, %r0 |
|
From: Kenn H. <ke...@us...> - 2004-09-28 22:24:49
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30901 Modified Files: lib.c Log Message: There's no reason why we shouldn't plagiarize lib/string.c for our boot_memset and boot_memmove functions! Index: lib.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/lib.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- lib.c 28 Sep 2004 08:48:52 -0000 1.3 +++ lib.c 28 Sep 2004 22:24:39 -0000 1.4 @@ -1,5 +1,6 @@ #include <linux/init.h> +#include <linux/types.h> #include <asm/mv.h> @@ -52,12 +53,38 @@ } } -void __boot boot_memzero(unsigned char *addr, unsigned int size) + + +void * __boot boot_memset(void *s, int c, size_t count) { - while (size) { - *addr = 0; - addr++; - size--; + char *xs = (char *) s; + + while (count--) + *xs++ = c; + + return s; +} + +void * __boot boot_memzero(void *s, size_t count) +{ + return boot_memset(s, 0, count); +} + + +void __boot boot_memmove(void *dest, const void *src, size_t count) +{ + char *tmp, *s; + + if (dest <= src) { + tmp = (char *) dest; + s = (char *) src; + while (count--) + *tmp++ = *s++; + } else { + tmp = (char *) dest + count; + s = (char *) src + count; + while (count--) + *--tmp = *--s; } } |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-28 18:03:36
|
Update of /cvsroot/linux-vax/kernel-2.5/drivers/input/mouse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4981 Modified Files: Kconfig Log Message: - Import the *correct* patch I sent Vojtech and Andrew... Index: Kconfig =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/drivers/input/mouse/Kconfig,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Kconfig 28 Sep 2004 17:38:51 -0000 1.8 +++ Kconfig 28 Sep 2004 18:03:26 -0000 1.9 @@ -127,6 +127,6 @@ puck) or a VSXXX-GA (rectangular) mouse. Theses mice are typically used on DECstations or VAXstations, but can also be used on any box capable of RS232 (with some adaptor - described in the source file). This driver should also works - with the digitizer (VSXXX-AB) DEC produced. + described in the source file). This driver also works with the + digitizer (VSXXX-AB) DEC produced. |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-28 17:39:02
|
Update of /cvsroot/linux-vax/kernel-2.5/drivers/input/mouse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31338 Modified Files: Kconfig Log Message: - Small docu update (tablet is supported), already sent to Andrew and Vojtech. Index: Kconfig =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/drivers/input/mouse/Kconfig,v retrieving revision 1.1.1.14 retrieving revision 1.8 diff -u -d -r1.1.1.14 -r1.8 --- Kconfig 2 Sep 2004 19:10:33 -0000 1.1.1.14 +++ Kconfig 28 Sep 2004 17:38:51 -0000 1.8 @@ -127,6 +127,6 @@ puck) or a VSXXX-GA (rectangular) mouse. Theses mice are typically used on DECstations or VAXstations, but can also be used on any box capable of RS232 (with some adaptor - described in the source file). This driver should, in theory, - also work with the digitizer DEC produced, but it isn't tested - with that (I don't have the hardware yet). + described in the source file). This driver should also works + with the digitizer (VSXXX-AB) DEC produced. + |
|
From: Kenn H. <ke...@us...> - 2004-09-28 08:49:02
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16807/arch/vax/boot Modified Files: head.S lib.c mmstart.S Added Files: boot_sections.h Log Message: All early boot code should live at the very start of the kernel image Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/head.S,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- head.S 26 Sep 2004 22:44:18 -0000 1.13 +++ head.S 28 Sep 2004 08:48:52 -0000 1.14 @@ -14,7 +14,10 @@ #include <asm/pgtable.h> /* PTE definitions */ #include <asm/irq.h> /* interrupt stack definitions */ -.section .vaxboot +#include "boot_sections.h" + +__BOOT + .globl _stext _stext: .globl start Index: mmstart.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/mmstart.S,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mmstart.S 15 Jun 2003 22:33:56 -0000 1.4 +++ mmstart.S 28 Sep 2004 08:48:52 -0000 1.5 @@ -11,7 +11,10 @@ #include <asm/page.h> #include <asm/pgtable.h> -.section .vaxbootlib +#include "boot_sections.h" + +__BOOT + .globl VAX_start_mm .balign 0x200 VAX_start_mm: Index: lib.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/lib.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lib.c 26 Sep 2004 22:44:18 -0000 1.2 +++ lib.c 28 Sep 2004 08:48:52 -0000 1.3 @@ -3,23 +3,25 @@ #include <asm/mv.h> -void __init boot_putchar(unsigned int c) +#include "boot_sections.h" + +void __boot boot_putchar(unsigned int c) { mv->pre_vm_putchar(c); } -void __init boot_crlf(void) +void __boot boot_crlf(void) { boot_putchar('\n'); boot_putchar('\r'); } -void __init boot_printspace(void) +void __boot boot_printspace(void) { boot_putchar(' '); } -void __init boot_printstr(char *s) +void __boot boot_printstr(char *s) { while (*s) { boot_putchar(*s); @@ -27,7 +29,7 @@ } } -void __init boot_printchar(unsigned int c) +void __boot boot_printchar(unsigned int c) { if ((c >= 0x20) && (c <= 0x7e)) { boot_putchar(c); @@ -36,7 +38,7 @@ } } -void __init boot_printint(unsigned int x) +void __boot boot_printint(unsigned int x) { int i; int d; @@ -50,7 +52,7 @@ } } -void boot_memzero(unsigned char *addr, unsigned int size) +void __boot boot_memzero(unsigned char *addr, unsigned int size) { while (size) { *addr = 0; --- NEW FILE: boot_sections.h --- #define __boot __attribute__ ((__section__ (".boot.text"))) #define __boottdata __attribute__ ((__section__ (".boot.data"))) /* For assembly routines */ #define __BOOT .section ".boot.text","ax" #define __BOOTDATA .section ".boot.data","aw" |
|
From: Kenn H. <ke...@us...> - 2004-09-28 08:49:02
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16807/arch/vax/kernel Modified Files: vmlinux.lds.S Log Message: All early boot code should live at the very start of the kernel image Index: vmlinux.lds.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel/vmlinux.lds.S,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vmlinux.lds.S 19 Jul 2004 08:43:20 -0000 1.2 +++ vmlinux.lds.S 28 Sep 2004 08:48:52 -0000 1.3 @@ -23,9 +23,9 @@ .text : { /* boot code comes first. The fact that it is linked at 0x80100000 doesn't matter because it's all - hand-crafted position-independent code */ - *(.vaxboot) - *(.vaxbootlib) + position-independent code */ + *(.boot.text) + *(.boot.data) /* Kernel C code starts here */ *(.text) |
|
From: Kenn H. <ke...@us...> - 2004-09-26 22:44:32
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30718 Modified Files: head.S lib.c Log Message: Zero-filling of bss section now done with a more readable C helper Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/head.S,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- head.S 26 Sep 2004 14:44:06 -0000 1.12 +++ head.S 26 Sep 2004 22:44:18 -0000 1.13 @@ -144,18 +144,12 @@ subl3 $start, $__bss_start, %r3 # offset of .bss to r3 addl2 $KERNEL_START_PHYS, %r3 # phys address of .bss start now in r3 -fill_chunk: - cmpl $0xffff, %r6 - bgeq last_fill - movc5 $0, (%r3), $0, $0xffff, (%r3) # After movc5, r3 points to next dest addr - subl2 $0xffff, %r6 - beql fill_done - brb fill_chunk -last_fill: - movc5 $0, (%r3), $0, %r6, (%r3) - # After movc5, r3 points to just after - # end of kernel -fill_done: + + pushl %r6 + pushl %r3 + calls $2, boot_memzero + addl2 %r6, %r3 + decl %r3 movl %r3, %r9 # save phys addr of last byte of kernel # in R9. We will need this later. Index: lib.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/lib.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- lib.c 26 Sep 2004 14:44:06 -0000 1.1 +++ lib.c 26 Sep 2004 22:44:18 -0000 1.2 @@ -50,3 +50,12 @@ } } +void boot_memzero(unsigned char *addr, unsigned int size) +{ + while (size) { + *addr = 0; + addr++; + size--; + } +} + |
|
From: Kenn H. <ke...@us...> - 2004-09-26 14:44:42
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32324 Modified Files: head.S hexdump.S Added Files: lib.c Removed Files: lib.S Log Message: Convert boot-time printing code in lib.S from assembler to C and update all callers Index: hexdump.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/hexdump.S,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- hexdump.S 15 Jun 2003 22:33:56 -0000 1.4 +++ hexdump.S 26 Sep 2004 14:44:06 -0000 1.5 @@ -13,32 +13,33 @@ # movl $0x0, r4 movl %r10,%r4 movl %r9,%r11 - jsb printint - jsb space - movl (%r4),%r10 - jsb printint - jsb space - movl %r11,%r10 - jsb printint - jsb crlf + pushl %r10 + calls $1, boot_printint + calls $1, boot_printspace + pushl (%r4) + calls $1, boot_printint + calls $1, boot_printspace + pushl %r11 + calls $1, boot_printint + calls $0, boot_crlf clrl %r3 clrl %r9 LOOP: - movl %r11, %r10 - jsb printint - jsb space - movl %r3, %r10 - jsb printint - jsb space - movl %r4, %r10 - jsb printint - jsb space - movl (%r4), %r10 - jsb printint - jsb space + pushl %r11 + calls $1, boot_printint + calls $1, boot_printspace + pushl %r3 + calls $1, boot_printint + calls $1, boot_printspace + pushl %r4 + calls $1, boot_printint + calls $1, boot_printspace + pushl (%r4) + calls $1, boot_printint + calls $1, boot_printspace jmp PASC -LRET: jsb crlf +LRET: calls $1, boot_crlf incl %r3 incl %r9 # page length on my uvax is about 0x1f lines @@ -51,27 +52,27 @@ rsb PASC: movl %r4, %r6 - movl %r6, %r10 - jsb printchar + pushl (%r6) + calls $1, boot_printchar incl %r6 - movl %r6, %r10 - jsb printchar + pushl (%r6) + calls $1, boot_printchar incl %r6 - movl %r6, %r10 - jsb printchar + pushl (%r6) + calls $1, boot_printchar incl %r6 - movl %r6, %r10 - jsb printchar + pushl (%r6) + calls $1, boot_printchar jmp LRET pause: - movab more, %r10 - jsb printstr + pushab more + calls $1, boot_printstr GCLOOP: jsb 0x20040044 tstl %r0 beql GCLOOP clrl %r9 - jsb crlf + calls $1, boot_crlf jmp LRET2 more: --- NEW FILE: lib.c --- #include <linux/init.h> #include <asm/mv.h> void __init boot_putchar(unsigned int c) { mv->pre_vm_putchar(c); } void __init boot_crlf(void) { boot_putchar('\n'); boot_putchar('\r'); } void __init boot_printspace(void) { boot_putchar(' '); } void __init boot_printstr(char *s) { while (*s) { boot_putchar(*s); s++; } } void __init boot_printchar(unsigned int c) { if ((c >= 0x20) && (c <= 0x7e)) { boot_putchar(c); } else { boot_putchar('.'); } } void __init boot_printint(unsigned int x) { int i; int d; for (i = 28; i>= 0; i -= 4) { d = (x >> i) & 0x0f; if (d > 9) { boot_putchar(d - 10 + 'A'); } else { boot_putchar(d + '0'); } } } Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/head.S,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- head.S 14 Jun 2004 12:14:20 -0000 1.11 +++ head.S 26 Sep 2004 14:44:06 -0000 1.12 @@ -69,38 +69,38 @@ subl2 $PAGE_OFFSET, MV_PRE_VM_INIT(%r2) # print the cpu type - jsb crlf - movab msg_cpu_type, %r10 - jsb printstr + calls $0, boot_crlf + pushab msg_cpu_type + calls $1, boot_printstr movl mv, %r10 calls $0, *MV_CPU_TYPE_STR(%r10) - movl %r0, %r10 - jsb printstr - jsb crlf + pushl %r0 + calls $1, boot_printstr + calls $0, boot_crlf # print first line of debug diagnostics - movab msg_loaded, %r10 # ascii string - jsb printstr - moval start, %r10 # where we were loaded - jsb printint - jsb crlf - movab msg_registers, %r10 # ascii string - jsb printstr - jsb space + pushab msg_loaded # ascii string + calls $1, boot_printstr + pushal start # where we were loaded + calls $1, boot_printint + calls $0, boot_crlf + pushab msg_registers # ascii string + calls $1, boot_printstr + calls $0, boot_printspace movl boot_r11, %r11 - movl %r11,%r10 # r11 (holds the rpb base address, usually 0x0) - jsb printint - jsb space - movl 48(%r11), %r10 # saved r5 in RPB (argument to BOOT command) - jsb printint - jsb space - movl %ap, %r10 # argument pointer (struct arglist) - jsb printint - jsb space - movl %sp, %r10 # stack pointer - jsb printint - jsb crlf + pushl %r11 # r11 (holds the rpb base address, usually 0x0) + calls $1, boot_printint + calls $0, boot_printspace + pushl 48(%r11) # saved r5 in RPB (argument to BOOT command) + calls $1, boot_printint + calls $0, boot_printspace + pushl %ap # argument pointer (struct arglist) + calls $1, boot_printint + calls $0, boot_printspace + pushl %sp # stack pointer + calls $1, boot_printint + calls $0, boot_crlf # Save off the current machine vector address in boot_mv, because it # lies in the .bss section and it will get clobbered real soon... @@ -186,11 +186,11 @@ addl2 %r2, MV_PRE_VM_GETCHAR(%r3) addl2 %r2, MV_CPU_TYPE_STR(%r3) - movab msg_relocated, %r10 # debugging line no 2 - jsb printstr - moval reloc, %r10 # where we are now (physical) - jsb printint - jsb crlf + pushab msg_relocated # debugging line no 2 + calls $1, boot_printstr + pushal reloc # where we are now (physical) + calls $1, boot_printint + calls $0, boot_crlf # Grab stuff we need between ioremaps in setup_arch/paging_init and # start of virtual memory @@ -290,9 +290,9 @@ # no need to TBIA - memory mapping not enabled # ready to turn on VM - moval msg_starting_vm, %r10 - jsb printstr - jsb crlf + moval msg_starting_vm, -(%sp) + calls $1, boot_printstr + calls $0, boot_crlf calls $0, VAX_start_mm # do that ole black magic # made it @@ -352,11 +352,11 @@ clrl prom_sidex clrl cpu_type mfpr $PR_SID, cpu_type - movab msg_cpu_type, %r10 - jsb printstr - movl cpu_type, %r10 - jsb printint - jsb space + pushab msg_cpu_type + calls $1, boot_printstr + pushl cpu_type + calls $1, boot_printint + calls $0, boot_printspace movl cpu_type, %r7 extv $24, $8, %r7, %r6 cmpl %r6, $0x0A @@ -364,13 +364,13 @@ # note - we may not need to do this here. Is the board type used # before we remap prom? movl 0x20040004, prom_sidex # FIXME: This looks bogus... Do all VAXen have sidex at this address, if they have it at all? - movab msg_sidex, %r10 - jsb printstr - movl prom_sidex, %r10 - jsb printint + pushab msg_sidex + calls $1, boot_printstr + pushl prom_sidex + calls $1, boot_printint no_sidex: - jsb crlf - jsb crlf + calls $0, boot_crlf + calls $0, boot_crlf rsb msg_cpu_type: --- lib.S DELETED --- |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-24 00:18:20
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23232 Modified Files: super.c Log Message: - Dollar is $ and semicolon is ; ... Index: super.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/super.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- super.c 23 Sep 2004 00:59:34 -0000 1.13 +++ super.c 24 Sep 2004 00:18:04 -0000 1.14 @@ -208,8 +208,8 @@ ods2sb->flags.v_raw = 0; ods2sb->flags.v_lowercase = 0; ods2sb->flags.v_version = SB_M_VERSALL; - ods2sb->dollar = '_'; - ods2sb->semicolon = '.'; + ods2sb->dollar = '$'; + ods2sb->semicolon = ';'; /* * ...then try to parse user-supplied options |
|
From: Kenn H. <ke...@us...> - 2004-09-23 23:33:31
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/boot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14135 Modified Files: cpu_sel.c Log Message: Fix typo in comment Index: cpu_sel.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/boot/cpu_sel.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- cpu_sel.c 26 Feb 2004 11:34:34 -0000 1.7 +++ cpu_sel.c 23 Sep 2004 23:33:15 -0000 1.8 @@ -1,5 +1,5 @@ /* - * Boot-time CPU identification - required virtual memory to be + * Boot-time CPU identification - requires virtual memory to be * turned off (MAPEN=0). * * $Id$ |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-23 13:43:10
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6789 Modified Files: Makefile inode.c ods2.h util.c Log Message: - Implement some functions for timestamp handling / conversion between VMS' timestamps and the struct timespec Linux uses in it's VFS. However, I don't know if this is actually *correct* as it is implemented right now. Index: inode.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/inode.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- inode.c 23 Sep 2004 02:06:27 -0000 1.9 +++ inode.c 23 Sep 2004 13:43:02 -0000 1.10 @@ -230,12 +230,9 @@ inode->i_uid = le16_to_cpu (fh2p->u5.s1.fh2_w_mem); inode->i_gid = le16_to_cpu (fh2p->u5.s1.fh2_w_grp); - inode->i_ctime.tv_sec = vms2unix_sec (fi2p->fi2_q_credate); - inode->i_ctime.tv_nsec = vms2unix_nsec (fi2p->fi2_q_credate); - inode->i_mtime.tv_sec = vms2unix_sec (fi2p->fi2_q_revdate); - inode->i_mtime.tv_nsec = vms2unix_nsec (fi2p->fi2_q_revdate); - inode->i_atime.tv_sec = vms2unix_sec (fi2p->fi2_q_revdate); - inode->i_atime.tv_nsec = vms2unix_nsec (fi2p->fi2_q_revdate); + vms2timespec (&inode->i_ctime, fi2p->fi2_q_credate); + vms2timespec (&inode->i_mtime, fi2p->fi2_q_revdate); + vms2timespec (&inode->i_atime, fi2p->fi2_q_revdate); /* * Note that we don't use the system Index: util.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/util.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- util.c 23 Sep 2004 02:07:49 -0000 1.11 +++ util.c 23 Sep 2004 13:43:02 -0000 1.12 @@ -20,17 +20,6 @@ #include <linux/buffer_head.h> #include "ods2.h" -static u64 -div64 (u64 a, u32 b0) { - u32 a1, a2; - u32 res; - - a1 = ((u32 *)&a)[0]; - a2 = ((u32 *)&a)[1]; - res = a1/b0 + (u64)a2 * (u64)(0xffffffff/b0) + a2 / b0 + (a2 * (0xffffffff % b0)) / b0; - return res; -} - u32 vbn2lbn (struct super_block *sb, struct ods2map *map, u32 vbn) { @@ -208,22 +197,24 @@ * It works for a file created 1-jan-1971 and for a file created 1-jan-2038 * as well as for files created 1992 and 2003. * - * FIXME: Needs 2.4.x i_[cma]time -> 2.6.x i_[cma]time porting!!! - * FIXME: "u16 *vms_timestamp" is an array in real life, which gets - * casted to a u64 later on... */ -time_t -vms2unix_sec (u16 *vms_timestamp) +void +vms2timespec (struct timespec *dest, vms_timestamp_t src) { - printk (KERN_ERR "%s probably isn't yet correct, because it uses 2.4.x style i_[mca]time!\n", __FUNCTION__); - return (u64)div64((le64_to_cpu(*(u64 *)&(vms_timestamp)) - 0x007c953d63a19980ull) >> 7, 78125) + 2; + /* time_t = (vms-350669880092000)/10000000 + 2 */ + dest->tv_sec = (le64_to_cpu (src) - 35066988009200000ull) / 10000000 + 2; + dest->tv_nsec = (le64_to_cpu (src) - 35066988009200000ull) % 10000000; } -long -vms2unix_nsec (u16 *vms_timestamp) +void +timespec2vms (vms_timestamp_t *dest, struct timespec *src) { - printk (KERN_ERR "%s isn't yet correct!\n", __FUNCTION__); - return 0; + vms_timestamp_t temp; + + /* vms = 10000000 * (time_t - 2) + 35066988009200000 */ + temp = (src->tv_sec - 2) * 10000000 + 35066988009200000ull; + temp += src->tv_nsec / 100; + *dest = cpu_to_le64 (temp); } int Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 22 Sep 2004 06:24:30 -0000 1.3 +++ Makefile 23 Sep 2004 13:43:02 -0000 1.4 @@ -6,7 +6,3 @@ ods2-objs := super.o inode.o file.o dir.o util.o -# Intentionally misspelled, only for local compile testing -lcean: - -rm -f *.o *.lst .*.o.cmd - Index: ods2.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/ods2.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ods2.h 22 Sep 2004 09:13:39 -0000 1.9 +++ ods2.h 23 Sep 2004 13:43:02 -0000 1.10 @@ -29,6 +29,12 @@ #define ODS2_SB(sb) (sb->s_fs_info) /* + * VMS' timestamps are a 64bit unsigned integer, with little-endian + * on-disk format. So *always* keep a vms_timestamp_t in LE byteorder! + */ +typedef u64 vms_timestamp_t; + +/* * This is the home block on a ODS2 disk. */ struct hm2def { @@ -140,14 +146,14 @@ * fives different tomes as well as the file name. */ struct fi2def { - char fi2_t_filename[20]; - u16 fi2_w_revision; - u16 fi2_q_credate[4]; // really __int64 - u16 fi2_q_revdate[4]; // really __int64 - u16 fi2_q_expdate[4]; // really __int64 - u16 fi2_q_bakdate[4]; // really __int64 - char fi2_filenameext[66]; - //char fi2_t_userlabel[80]; // from http://www.pi-net.dyndns.org/conan/sys$common/syslib/sys$lib_c.tlb?key=FI2DEF&title=Library%20/sys$common/syslib/sys$lib_c.tlb&referer= + char fi2_t_filename[20]; + u16 fi2_w_revision; + vms_timestamp_t fi2_q_credate; + vms_timestamp_t fi2_q_revdate; + vms_timestamp_t fi2_q_expdate; + vms_timestamp_t fi2_q_bakdate; + char fi2_filenameext[66]; + //char fi2_t_userlabel[80]; // from http://www.pi-net.dyndns.org/conan/sys$common/syslib/sys$lib_c.tlb?key=FI2DEF&title=Library%20/sys$common/syslib/sys$lib_c.tlb&referer= }; /* @@ -524,8 +530,8 @@ /* * util.c */ -extern time_t vms2unix_sec (u16 *vms_timestamp); -extern long vms2unix_nsec (u16 *vms_timestamp); +extern void vms2timespec (struct timespec *dest, vms_timestamp_t src); +extern void timespec2vms (vms_timestamp_t *dest, struct timespec *src); /* FIXME: hacks in util.c */ extern int get_hardsect_size (int xx); |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-23 02:08:02
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31104 Modified Files: util.c Log Message: - No need for div64 to be non-static. Index: util.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/util.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- util.c 23 Sep 2004 02:05:11 -0000 1.10 +++ util.c 23 Sep 2004 02:07:49 -0000 1.11 @@ -20,7 +20,7 @@ #include <linux/buffer_head.h> #include "ods2.h" -u64 +static u64 div64 (u64 a, u32 b0) { u32 a1, a2; u32 res; |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-23 02:06:36
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30952 Modified Files: inode.c Log Message: - No real work, only shifting code around. Index: inode.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/inode.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- inode.c 22 Sep 2004 07:14:35 -0000 1.8 +++ inode.c 23 Sep 2004 02:06:27 -0000 1.9 @@ -81,10 +81,11 @@ stored together with each FID. */ - if (( vp = strrchr(name, ods2p->semicolon)) != NULL) { + vp = strrchr (name, ods2p->semicolon); + if (vp) { *vp++ = 0; - if (sscanf(vp, "%d", &vers) != 1) { + if (sscanf (vp, "%d", &vers) != 1) { *--vp = ods2p->semicolon; } else if (vers > 32767) { printk("ODS2-fs error with version number for %s (%s)\n", name, vp); @@ -92,28 +93,36 @@ } } - while ((lbn = vbn2lbn(sb, ods2fhp->map, vbn)) > 0 && - (bh = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL && bh->b_data != NULL) { + while ((lbn = vbn2lbn(sb, ods2fhp->map, vbn)) > 0 + && (bh = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL + && bh->b_data != NULL) { - rec = (u16 *)(GETBLKP(sb, lbn, bh->b_data)); + rec = (u16 *) GETBLKP (sb, lbn, bh->b_data); while (*rec != 65535 && *rec != 0) { struct dirdef *dire = (struct dirdef *) rec; - if (dire->u1.s1.dir_b_namecount == strlen(name)) { - char dirname[dire->u1.s1.dir_b_namecount + 1]; + if (dire->u1.s1.dir_b_namecount == strlen (name)) { + /* FIXME: Stack usage? */ + char dirname[dire->u1.s1.dir_b_namecount + 1]; - memcpy(dirname, &dire->u1.s1.dir_t_name, dire->u1.s1.dir_b_namecount); + memcpy (dirname, &dire->u1.s1.dir_t_name, dire->u1.s1.dir_b_namecount); dirname[dire->u1.s1.dir_b_namecount] = 0; if (ods2p->dollar != '$' || ods2p->flags.v_lowercase) { - char *p = dirname; - char cnt = dire->u1.s1.dir_b_namecount; + char *p = dirname; + char cnt = dire->u1.s1.dir_b_namecount; - while (*p && cnt-- > 0) { if (*p == '$') { *p = ods2p->dollar; } if (ods2p->flags.v_lowercase) { *p = tolower(*p); } p++; } + while (*p && cnt-- > 0) { + if (*p == '$') + *p = ods2p->dollar; + if (ods2p->flags.v_lowercase) + *p = tolower (*p); + p++; + } } - if (strcmp(dirname, name) == 0) { - int curbyte = 0; + if (strcmp (dirname, name) == 0) { + int curbyte = 0; while (curbyte < dire->u1.s1.dir_w_size) { u32 ino; @@ -128,7 +137,7 @@ d_add(dentry, inode); return NULL; } - printk("ODS2-fs error when iget for file %s\n", name); + printk (KERN_ERR "ODS2-fs error when iget for file %s\n", name); return ERR_PTR(-EACCES); } curbyte += 8; @@ -161,7 +170,7 @@ set bit mean granted access. */ -char unsigned vms2unixprot[] = { /* ODS2 prot */ +unsigned char vms2unixprot[] = { /* ODS2 prot */ S_IROTH | S_IWOTH | S_IXOTH , /* D E W R */ 0 | S_IWOTH | S_IXOTH , /* D E W */ S_IROTH | S_IWOTH | S_IXOTH , /* D E R */ @@ -188,11 +197,13 @@ struct buffer_head *bh; u32 fhlbn; - if ((fhlbn = ino2fhlbn(sb, inode->i_ino)) > 0 && - (bh = sb_bread(sb, GETBLKNO(sb, fhlbn))) != NULL && bh->b_data != NULL) { + if ((fhlbn = ino2fhlbn (sb, inode->i_ino)) > 0 + && (bh = sb_bread(sb, GETBLKNO(sb, fhlbn))) != NULL + && bh->b_data != NULL) { struct fh2def *fh2p = (struct fh2def *) GETBLKP(sb, fhlbn, bh->b_data); - if ((inode->u.generic_ip = kmalloc (sizeof (struct ods2fh), GFP_KERNEL)) != NULL) { + inode->u.generic_ip = kmalloc (sizeof (struct ods2fh), GFP_KERNEL); + if (inode->u.generic_ip) { struct ods2fh *ods2fhp; struct fi2def *fi2p; struct fatdef *fatp; @@ -204,9 +215,8 @@ fatp = (struct fatdef *) &(fh2p->fh2_w_recattr); if (verify_fh(fh2p, inode->i_ino)) { - - memcpy(&ods2fhp->fat, fatp, sizeof (struct fatdef)); - ods2fhp->map = getmap(sb, fh2p); + memcpy (&ods2fhp->fat, fatp, sizeof (struct fatdef)); + ods2fhp->map = getmap (sb, fh2p); if (fh2p->u4.s1.fch_v_directory) { inode->i_mode = S_IFDIR; @@ -217,20 +227,20 @@ inode->i_fop = &ods2_file_operations; } - inode->i_uid = le16_to_cpu(fh2p->u5.s1.fh2_w_mem); - inode->i_gid = le16_to_cpu(fh2p->u5.s1.fh2_w_grp); + inode->i_uid = le16_to_cpu (fh2p->u5.s1.fh2_w_mem); + inode->i_gid = le16_to_cpu (fh2p->u5.s1.fh2_w_grp); - inode->i_ctime.tv_sec = vms2unix_sec(fi2p->fi2_q_credate); - inode->i_ctime.tv_nsec = vms2unix_nsec(fi2p->fi2_q_credate); - inode->i_mtime.tv_sec = vms2unix_sec(fi2p->fi2_q_revdate); - inode->i_mtime.tv_nsec = vms2unix_nsec(fi2p->fi2_q_revdate); - inode->i_atime.tv_sec = vms2unix_sec(fi2p->fi2_q_revdate); - inode->i_atime.tv_nsec = vms2unix_nsec(fi2p->fi2_q_revdate); + inode->i_ctime.tv_sec = vms2unix_sec (fi2p->fi2_q_credate); + inode->i_ctime.tv_nsec = vms2unix_nsec (fi2p->fi2_q_credate); + inode->i_mtime.tv_sec = vms2unix_sec (fi2p->fi2_q_revdate); + inode->i_mtime.tv_nsec = vms2unix_nsec (fi2p->fi2_q_revdate); + inode->i_atime.tv_sec = vms2unix_sec (fi2p->fi2_q_revdate); + inode->i_atime.tv_nsec = vms2unix_nsec (fi2p->fi2_q_revdate); /* - Note that we don't use the system protection bits for ODS2. - */ - + * Note that we don't use the system + * protection bits for ODS2. + */ inode->i_mode |= vms2unixprot[(le16_to_cpu(fh2p->fh2_w_fileprot) >> 4) & 0x0f] << 6; /* owner */ inode->i_mode |= vms2unixprot[(le16_to_cpu(fh2p->fh2_w_fileprot) >> 8) & 0x0f] << 3; /* group */ inode->i_mode |= vms2unixprot[(le16_to_cpu(fh2p->fh2_w_fileprot) >> 12) & 0x0f]; /* world => other */ @@ -238,43 +248,44 @@ inode->i_blksize = 512; inode->i_blocks = ((le16_to_cpu(fatp->u1.s1.fat_w_hiblkh) << 16) | le16_to_cpu(fatp->u1.s1.fat_w_hiblkl)); inode->i_size = ((le16_to_cpu(fatp->u2.s1.fat_w_efblkh) << 16) | le16_to_cpu(fatp->u2.s1.fat_w_efblkl)) << 9; - if (inode->i_size > 0) { inode->i_size -= 512; } + if (inode->i_size > 0) + inode->i_size -= 512; inode->i_size += le16_to_cpu(fatp->fat_w_ffbyte); - if ((fatp->u0.s0.fat_v_rtype == FAT_C_VFC || fatp->u0.s0.fat_v_rtype == FAT_C_VARIABLE) && !ods2p->flags.v_raw) { + if ((fatp->u0.s0.fat_v_rtype == FAT_C_VFC + || fatp->u0.s0.fat_v_rtype == FAT_C_VARIABLE) + && !ods2p->flags.v_raw) { if ((ods2fhp->ods2vari = (struct ods2vari *) kmalloc(sizeof (struct ods2vari), GFP_KERNEL)) != NULL) { memset(ods2fhp->ods2vari, 0 , sizeof (struct ods2vari)); sema_init(&(ods2fhp->ods2vari->sem), 1); } else { - printk("ODS2-fs kmalloc failed for vari data\n"); + printk(KERN_ERR "ODS2-fs kmalloc failed for vari data\n"); } } - ods2fhp->parent = (fh2p->u6.s1.fid_b_nmx << 16) | le16_to_cpu(fh2p->u6.s1.fid_w_num); + ods2fhp->parent = (fh2p->u6.s1.fid_b_nmx << 16) | le16_to_cpu(fh2p->u6.s1.fid_w_num); //inode->i_version = ++event; FIXME bforget(bh); return; } - printk("ODS2-fs not a valid file header\n"); + printk (KERN_ERR "ODS2-fs not a valid file header\n"); } else { - bforget(bh); - printk("ODS2-fs kmalloc failed for extension inode\n"); - kfree(inode->u.generic_ip); + bforget (bh); + printk (KERN_ERR "ODS2-fs kmalloc failed for extension inode\n"); + kfree (inode->u.generic_ip); } } - printk("ODS2-fs error reading inode\n"); - make_bad_inode(inode); + printk (KERN_ERR "ODS2-fs error reading inode\n"); + make_bad_inode (inode); } /* - For a read only file system there is nothing to do for put_inode. -*/ - -void ods2_put_inode(struct inode *inode) { + * For a read only file system there is nothing to do for put_inode. + */ +void ods2_put_inode (struct inode *inode) { } - -void ods2_clear_inode(struct inode *inode) { +void ods2_clear_inode (struct inode *inode) { struct ods2fh *ods2fhp = (struct ods2fh *) inode->u.generic_ip; if (ods2fhp != NULL) { @@ -282,8 +293,7 @@ while (map != NULL) { struct ods2map *nxt = map->nxt; - - kfree(map); + kfree (map); map = nxt; } ods2fhp->map = NULL; @@ -301,22 +311,21 @@ ods2varp = nxt; } } - kfree(ods2fhp->ods2vari); + kfree (ods2fhp->ods2vari); ods2fhp->ods2vari = NULL; } - kfree(inode->u.generic_ip); + kfree (inode->u.generic_ip); inode->u.generic_ip = NULL; } } - /* - This routine doesn't need to be defined for a read only filesystem - but we do it for fun so remember to call clear_inode otherwise you - will run out of memory... -*/ - -void ods2_delete_inode(struct inode *inode) { - clear_inode(inode); + * This routine doesn't need to be defined for a read only filesystem + * but we do it for fun so remember to call clear_inode otherwise you + * will run out of memory... + */ +void +ods2_delete_inode (struct inode *inode) { + clear_inode (inode); } |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-23 02:05:21
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30608 Modified Files: util.c Log Message: - Remove two real bugs: - Double type at variable declaration. - Missing constant suffix (would lead to a u64 cutted down to a u32 ...) Index: util.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/util.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- util.c 22 Sep 2004 09:13:39 -0000 1.9 +++ util.c 23 Sep 2004 02:05:11 -0000 1.10 @@ -23,7 +23,7 @@ u64 div64 (u64 a, u32 b0) { u32 a1, a2; - u32 long res; /* FIXME: What?! */ + u32 res; a1 = ((u32 *)&a)[0]; a2 = ((u32 *)&a)[1]; @@ -216,7 +216,7 @@ vms2unix_sec (u16 *vms_timestamp) { printk (KERN_ERR "%s probably isn't yet correct, because it uses 2.4.x style i_[mca]time!\n", __FUNCTION__); - return (u64)div64((le64_to_cpu(*(u64 *)&(vms_timestamp)) - 0x007c953d63a19980L) >> 7, 78125) + 2; + return (u64)div64((le64_to_cpu(*(u64 *)&(vms_timestamp)) - 0x007c953d63a19980ull) >> 7, 78125) + 2; } long |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-23 00:59:52
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19483 Modified Files: super.c Log Message: - Move assignment and check out of if (). - Fix return values of ods2_read_ibitmap (). Index: super.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/super.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- super.c 22 Sep 2004 07:14:35 -0000 1.12 +++ super.c 23 Sep 2004 00:59:34 -0000 1.13 @@ -137,7 +137,7 @@ * and copy data from the INDEXF.SYS file. At the same time the * number of free file headers are counted. */ -int +static int ods2_read_ibitmap (struct super_block *sb) { struct ods2sb *ods2p = ODS2_SB (sb); @@ -145,27 +145,30 @@ struct buffer_head *bh; ods2p->kstatfs.f_ffree = 0; - if ((ods2p->ibitmap = kmalloc(ods2p->hm2.hm2_w_ibmapsize << 9, GFP_KERNEL)) != NULL) { - memset(ods2p->ibitmap, 0, (ods2p->hm2.hm2_w_ibmapsize << 9)); - for (idx = 0 ; idx < ods2p->hm2.hm2_w_ibmapsize ; idx++) { - if ((bh = sb_bread(sb, GETBLKNO(sb, ods2p->hm2.hm2_l_ibmaplbn + idx))) != NULL && bh->b_data != NULL) { - u8 *bp = (GETBLKP(sb, ods2p->hm2.hm2_l_ibmaplbn + idx, bh->b_data)); + + ods2p->ibitmap = kmalloc (ods2p->hm2.hm2_w_ibmapsize << 9, GFP_KERNEL); + if (ods2p->ibitmap) { + memset (ods2p->ibitmap, 0, ods2p->hm2.hm2_w_ibmapsize << 9); + for (idx = 0; idx < ods2p->hm2.hm2_w_ibmapsize; idx++) { + bh = sb_bread (sb, GETBLKNO (sb, ods2p->hm2.hm2_l_ibmaplbn + idx)); + if (bh && bh->b_data) { + u8 *bp = GETBLKP (sb, ods2p->hm2.hm2_l_ibmaplbn + idx, bh->b_data); int cnt; - memcpy((ods2p->ibitmap + (idx << 9)), GETBLKP(sb, ods2p->hm2.hm2_l_ibmaplbn + idx, bh->b_data), 512); - for (cnt = 0; cnt < 512; cnt++, bp++) { + memcpy (ods2p->ibitmap + (idx << 9), GETBLKP (sb, ods2p->hm2.hm2_l_ibmaplbn + idx, bh->b_data), 512); + for (cnt = 0; cnt < 512; cnt++, bp++) ods2p->kstatfs.f_ffree += (nibble2bits[(*bp & 0x0f) ^ 0xf] + nibble2bits[(*bp >> 4) ^ 0xf]); - } bforget(bh); } } - return 1; + + return 0; } + printk("ODS2-fs error when allocating memory for index file header bitmap\n"); - return 0; + return -ENOMEM; } - /* * Parse options that can be supplied (mount -o xxxxxxx) */ @@ -214,7 +217,7 @@ if (!options) return 0; - while ((p = strsep(&options, ",")) != NULL) { + while ((p = strsep (&options, ",")) != NULL) { if (!*p) continue; @@ -267,10 +270,8 @@ return 0; } - /* - * This is the routine that is invoked when an ODS2 file system - * is mounted. + * This is the routine that is invoked when an ODS2 file system is mounted. */ static int ods2_fill_super (struct super_block *sb, void *data, int silent) @@ -355,7 +356,7 @@ /* * We need to be able to read the index file header bitmap. */ - if (ods2_read_ibitmap(sb)) { + if (ods2_read_ibitmap (sb) == 0) { /* * We need to be able to read BITMAP.SYS as * it contains the bitmap for allocated @@ -389,13 +390,13 @@ volname[12] = 0; memcpy(volowner, ods2p->hm2.hm2_t_ownername, 12); volowner[12] = 0; - printk(KERN_NOTICE "ODS2-fs This is a valid ODS2 file system with format /%s/ and volume name /%s/ and owner /%s/\n", format, volname, volowner); + printk (KERN_NOTICE "ODS2-fs This is a valid ODS2 file system with format /%s/ and volume name /%s/ and owner /%s/\n", format, volname, volowner); return 0; } - kfree(ods2p->ibitmap); + kfree (ods2p->ibitmap); } } - kfree(ODS2_SB(sb)); + kfree (ODS2_SB (sb)); } return -EINVAL; } |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-22 09:13:55
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7270 Modified Files: ods2.h util.c Log Message: - Random stuff... Index: util.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/util.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- util.c 22 Sep 2004 07:14:35 -0000 1.8 +++ util.c 22 Sep 2004 09:13:39 -0000 1.9 @@ -97,6 +97,7 @@ u16 size = 0; switch (fm2p->u1.fm1.fm2_v_format) { + /* FIXME: Use defines */ case 0: size = 1; break; case 1: cnt = fm2p->u1.fm1.fm2_b_count1; lbn = (fm2p->u1.fm1.fm2_v_highlbn << 16) | fm2p->u1.fm1.fm2_w_lowlbn; size = 2; break; case 2: cnt = fm2p->u1.fm2.fm2_v_count2; lbn = (le16_to_cpu(fm2p->u1.fm2.fm2_l_lbn2[1]) << 16) | le16_to_cpu(fm2p->u1.fm2.fm2_l_lbn2[0]); size = 3; break; @@ -160,8 +161,7 @@ u32 lbn; if ((lbn = vbn2lbn(sb, ods2fhp->map, vbn)) > 0) { - - if (ods2filep->bhp == NULL || GETBLKNO(sb, lbn) != ods2filep->bhp->b_blocknr) { + if (!ods2filep->bhp || GETBLKNO(sb, lbn) != ods2filep->bhp->b_blocknr) { brelse(ods2filep->bhp); ods2filep->bhp = NULL; if ((ods2filep->bhp = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL) { @@ -176,6 +176,7 @@ } } } + return NULL; } @@ -208,12 +209,14 @@ * as well as for files created 1992 and 2003. * * FIXME: Needs 2.4.x i_[cma]time -> 2.6.x i_[cma]time porting!!! + * FIXME: "u16 *vms_timestamp" is an array in real life, which gets + * casted to a u64 later on... */ time_t vms2unix_sec (u16 *vms_timestamp) { printk (KERN_ERR "%s probably isn't yet correct, because it uses 2.4.x style i_[mca]time!\n", __FUNCTION__); - return ((u64)div64((le64_to_cpu(*(u64 *)&(vms_timestamp)) - 0x007c953d63a19980L) >> 7, 78125) + 2); + return (u64)div64((le64_to_cpu(*(u64 *)&(vms_timestamp)) - 0x007c953d63a19980L) >> 7, 78125) + 2; } long Index: ods2.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/ods2.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ods2.h 22 Sep 2004 06:27:17 -0000 1.8 +++ ods2.h 22 Sep 2004 09:13:39 -0000 1.9 @@ -18,7 +18,9 @@ /* * The following structures are defined in the book - * "VMS File System Internals" + * "VMS File System Internals". Also, you can find quite some infos about + * the struct layouts at + * http://www.pi-net.dyndns.org/conan/sys$common/syslib/sys$lib_c.tlb . */ /* @@ -26,7 +28,6 @@ */ #define ODS2_SB(sb) (sb->s_fs_info) - /* * This is the home block on a ODS2 disk. */ @@ -127,7 +128,7 @@ } u3; u16 scb_w_writecnt; char scb_t_volockname[12]; - u16 scb_q_mounttime[4]; + u16 scb_q_mounttime[4]; // really __int64 u16 scb_w_backrev; u64 scb_q_genernum; u8 scb_b_reserved[446]; @@ -141,11 +142,12 @@ struct fi2def { char fi2_t_filename[20]; u16 fi2_w_revision; - u16 fi2_q_credate[4]; - u16 fi2_q_revdate[4]; - u16 fi2_q_expdate[4]; - u16 fi2_q_bakdate[4]; - char fi_2_filenameext[66]; + u16 fi2_q_credate[4]; // really __int64 + u16 fi2_q_revdate[4]; // really __int64 + u16 fi2_q_expdate[4]; // really __int64 + u16 fi2_q_bakdate[4]; // really __int64 + char fi2_filenameext[66]; + //char fi2_t_userlabel[80]; // from http://www.pi-net.dyndns.org/conan/sys$common/syslib/sys$lib_c.tlb?key=FI2DEF&title=Library%20/sys$common/syslib/sys$lib_c.tlb&referer= }; /* |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-22 07:14:50
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14600 Modified Files: dir.c file.c inode.c super.c util.c Log Message: - Empty lines are empty. Really... Index: inode.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/inode.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- inode.c 20 Sep 2004 20:27:17 -0000 1.7 +++ inode.c 22 Sep 2004 07:14:35 -0000 1.8 @@ -70,10 +70,10 @@ u32 lbn; int vers = 0; char name[dentry->d_name.len + 1]; - + memcpy(name, dentry->d_name.name, dentry->d_name.len); name[dentry->d_name.len] = 0; - + /* We need to extract any version number and terminate the file name with file type at the ; character because in the directory file only the file name and type @@ -83,7 +83,7 @@ if (( vp = strrchr(name, ods2p->semicolon)) != NULL) { *vp++ = 0; - + if (sscanf(vp, "%d", &vers) != 1) { *--vp = ods2p->semicolon; } else if (vers > 32767) { @@ -94,34 +94,34 @@ while ((lbn = vbn2lbn(sb, ods2fhp->map, vbn)) > 0 && (bh = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL && bh->b_data != NULL) { - + rec = (u16 *)(GETBLKP(sb, lbn, bh->b_data)); - + while (*rec != 65535 && *rec != 0) { struct dirdef *dire = (struct dirdef *) rec; - + if (dire->u1.s1.dir_b_namecount == strlen(name)) { char dirname[dire->u1.s1.dir_b_namecount + 1]; - + memcpy(dirname, &dire->u1.s1.dir_t_name, dire->u1.s1.dir_b_namecount); dirname[dire->u1.s1.dir_b_namecount] = 0; if (ods2p->dollar != '$' || ods2p->flags.v_lowercase) { char *p = dirname; char cnt = dire->u1.s1.dir_b_namecount; - + while (*p && cnt-- > 0) { if (*p == '$') { *p = ods2p->dollar; } if (ods2p->flags.v_lowercase) { *p = tolower(*p); } p++; } } if (strcmp(dirname, name) == 0) { int curbyte = 0; - + while (curbyte < dire->u1.s1.dir_w_size) { u32 ino; struct dirdef *dirv = (struct dirdef *) ((char *)dire + ((dire->u1.s1.dir_b_namecount + 1) & ~1) + 6 + curbyte); - + if (dirv->u1.s2.dir_w_version == vers || vers == 0) { struct inode *inode; - + ino = (dirv->u1.s2.u2.s3.fid_b_nmx << 16) | le16_to_cpu(dirv->u1.s2.u2.s3.fid_w_num); brelse(bh); if ((inode = iget(dir->i_sb, ino)) != NULL) { @@ -219,28 +219,28 @@ inode->i_uid = le16_to_cpu(fh2p->u5.s1.fh2_w_mem); inode->i_gid = le16_to_cpu(fh2p->u5.s1.fh2_w_grp); - + inode->i_ctime.tv_sec = vms2unix_sec(fi2p->fi2_q_credate); inode->i_ctime.tv_nsec = vms2unix_nsec(fi2p->fi2_q_credate); inode->i_mtime.tv_sec = vms2unix_sec(fi2p->fi2_q_revdate); inode->i_mtime.tv_nsec = vms2unix_nsec(fi2p->fi2_q_revdate); inode->i_atime.tv_sec = vms2unix_sec(fi2p->fi2_q_revdate); inode->i_atime.tv_nsec = vms2unix_nsec(fi2p->fi2_q_revdate); - + /* Note that we don't use the system protection bits for ODS2. */ - + inode->i_mode |= vms2unixprot[(le16_to_cpu(fh2p->fh2_w_fileprot) >> 4) & 0x0f] << 6; /* owner */ inode->i_mode |= vms2unixprot[(le16_to_cpu(fh2p->fh2_w_fileprot) >> 8) & 0x0f] << 3; /* group */ inode->i_mode |= vms2unixprot[(le16_to_cpu(fh2p->fh2_w_fileprot) >> 12) & 0x0f]; /* world => other */ - + inode->i_blksize = 512; inode->i_blocks = ((le16_to_cpu(fatp->u1.s1.fat_w_hiblkh) << 16) | le16_to_cpu(fatp->u1.s1.fat_w_hiblkl)); inode->i_size = ((le16_to_cpu(fatp->u2.s1.fat_w_efblkh) << 16) | le16_to_cpu(fatp->u2.s1.fat_w_efblkl)) << 9; if (inode->i_size > 0) { inode->i_size -= 512; } inode->i_size += le16_to_cpu(fatp->fat_w_ffbyte); - + if ((fatp->u0.s0.fat_v_rtype == FAT_C_VFC || fatp->u0.s0.fat_v_rtype == FAT_C_VARIABLE) && !ods2p->flags.v_raw) { if ((ods2fhp->ods2vari = (struct ods2vari *) kmalloc(sizeof (struct ods2vari), GFP_KERNEL)) != NULL) { memset(ods2fhp->ods2vari, 0 , sizeof (struct ods2vari)); @@ -249,7 +249,7 @@ printk("ODS2-fs kmalloc failed for vari data\n"); } } - + ods2fhp->parent = (fh2p->u6.s1.fid_b_nmx << 16) | le16_to_cpu(fh2p->u6.s1.fid_w_num); //inode->i_version = ++event; FIXME bforget(bh); @@ -276,7 +276,7 @@ void ods2_clear_inode(struct inode *inode) { struct ods2fh *ods2fhp = (struct ods2fh *) inode->u.generic_ip; - + if (ods2fhp != NULL) { struct ods2map *map = ods2fhp->map; @@ -287,7 +287,7 @@ map = nxt; } ods2fhp->map = NULL; - + if (ods2fhp->ods2vari != NULL) { /* in case the file was of variable record type */ int idx; Index: util.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/util.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- util.c 22 Sep 2004 06:24:30 -0000 1.7 +++ util.c 22 Sep 2004 07:14:35 -0000 1.8 @@ -54,12 +54,12 @@ ino2fhlbn (struct super_block *sb, u32 ino) { struct ods2sb *ods2p = ODS2_SB (sb); - + if (ino < 17) { /* the first 16 file headers are located at known locations in INDEXF.SYS */ return le16_to_cpu(ods2p->hm2.hm2_w_ibmapsize) + le32_to_cpu(ods2p->hm2.hm2_l_ibmaplbn) + ino - 1; } else { struct ods2fh *ods2fhp = (struct ods2fh *) ods2p->indexf->u.generic_ip; - + return vbn2lbn(sb, ods2fhp->map, le16_to_cpu(ods2p->hm2.hm2_w_cluster) * 4 + le16_to_cpu(ods2p->hm2.hm2_w_ibmapsize) + ino); } @@ -121,7 +121,7 @@ mapinuse -= size; fm2p = (struct fm2def *) ((short unsigned *) (fm2p) + size); } - + /* * If there is an extension header we need to read all of them because * they could have additional mapping information. Index: super.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/super.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- super.c 22 Sep 2004 07:10:35 -0000 1.11 +++ super.c 22 Sep 2004 07:14:35 -0000 1.12 @@ -77,7 +77,7 @@ struct ods2sb *ods2p = ODS2_SB (sb); struct inode *inode; struct buffer_head *bh; - + if ((inode = iget(sb, 2)) != NULL) { /* this is BITMAP.SYS */ struct ods2fh *ods2fhp = (struct ods2fh *) (inode->u.generic_ip); u32 lbn; @@ -90,7 +90,7 @@ short unsigned chksum = 0; for (p = (short unsigned *)scb ; p < (short unsigned *)&(scb->scb_w_checksum) ; chksum += *p++); - + if (scb->u1.s1.scb_b_structlevl == 2 && scb->u1.s1.scb_b_structlevv >= 1 && scb->scb_w_cluster == ods2p->hm2.hm2_w_cluster @@ -98,7 +98,7 @@ struct buffer_head *bh2; u32 vbn = 1; u32 bitset = 0; - + /* * We need to loop through all bytes that make up the bitmap. * The fastest way to count the number of bits set in the byte @@ -349,9 +349,9 @@ sb->s_op = &ods2_sops; ods2p->indexf = iget(sb, 1); /* read INDEXF.SYS. */ - + sb->s_root = d_alloc_root(iget(sb, 4)); /* this is 000000.DIR;1 */ - + /* * We need to be able to read the index file header bitmap. */ @@ -369,7 +369,7 @@ char format[13]; char volname[13]; char volowner[13]; - + /* * We need to fill in statfs structure * used when any user want to get Index: file.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/file.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- file.c 20 Sep 2004 21:15:47 -0000 1.7 +++ file.c 22 Sep 2004 07:14:35 -0000 1.8 @@ -202,22 +202,22 @@ struct ods2vari *ods2vari = ods2fhp->ods2vari; u32 vbn = 0; u16 cpylen; - + if (*loff == 0) { ods2filep->currec = 0; ods2filep->curbyte = 0; ods2filep->reclen = 0; } - + if (ods2filep->reclen == 65535) { brelse(ods2filep->bhp); ods2filep->bhp = NULL; return 0; } - + while (1) { - + /* We need to loop until the calculated value of currec offset plus currect byte offset from currec give the same VBN as the last one we fetched. @@ -231,11 +231,11 @@ ods2filep->reclen = 65535; return (buf - buforg); } - + /* If curbyte is zero we will start on a new record. */ - + if (ods2filep->curbyte == 0) { ods2filep->reclen = le16_to_cpu(*((u16 *)((char *)ods2filep->data + (ods2filep->currec & 511)))); @@ -244,10 +244,10 @@ update_virtual_file_pos(*loff, ods2vari, ods2filep->currec); up(&(ods2vari->sem)); } - + if ((ods2filep->reclen == 65535 && !(fatp->fat_b_rattrib & FAT_M_NOSPAN)) || (ods2filep->currec >= inode->i_size)) { /* end of records */ - + ods2filep->reclen = 65535; return (buf - buforg); } @@ -260,19 +260,19 @@ } } } while (((ods2filep->currec + ods2filep->curbyte) >> 9) != vbn); - + cpylen = MIN(MIN((ods2filep->reclen - ods2filep->curbyte + 2), buflen), (512 - ((ods2filep->currec + ods2filep->curbyte) & 511))); - + if (cpylen > 0) { u8 *recp = (u8 *)((char *)ods2filep->data + ((ods2filep->currec + ods2filep->curbyte) & 511)); - + memcpy(buf, recp, cpylen); *loff += cpylen; /* loff will always be a virtual offset for a variable record file */ buf += cpylen; buflen -= cpylen; ods2filep->curbyte += cpylen; } - + if (ods2filep->curbyte - 2 == ods2filep->reclen) { if (buflen > 0) { if (fatp->fat_b_rattrib & FAT_M_FORTRANCC || fatp->fat_b_rattrib & FAT_M_IMPLIEDCC || fatp->fat_b_rattrib & FAT_M_PRINTCC) { @@ -284,7 +284,7 @@ ods2filep->curbyte = 0; } } - + if (buflen == 0) { return (buf - buforg); } } } @@ -332,7 +332,7 @@ struct ods2file *ods2filep = (struct ods2file *) filp->private_data; u32 vbn = 0; u16 cpylen; - + while (*loff < inode->i_size) { vbn = *loff >> 9; if (!(getfilebh(filp, vbn + 1))) { @@ -341,7 +341,7 @@ } if ((cpylen = MIN(MIN(inode->i_size - *loff, buflen), 512 - (*loff & 511))) > 0) { u8 *recp = (u8 *)((char *)ods2filep->data + (*loff & 511)); - + memcpy(buf, recp, cpylen); *loff += cpylen; buf += cpylen; @@ -449,7 +449,7 @@ { struct inode *inode = filp->f_dentry->d_inode; loff_t offs; - + if (seek == 0) { /* SEEK_SET */ offs = MIN(loff, inode->i_size); } else { @@ -580,7 +580,7 @@ } while (1) { - + do { vbn = currec >> 9; if (!(getfilebh(filp, vbn + 1))) { @@ -609,7 +609,7 @@ currec = (vbn + 1) * 512; /* next block... */ } } while (reclen == 65535); - + if (coffs <= offs && (coffs + reclen - (fatp->u0.s0.fat_v_rtype == FAT_C_VFC ? fatp->fat_b_vfcsize : 0)) >= offs) { /* we have found our location */ ods2filep->currec = currec; ods2filep->curbyte = (offs - coffs) + 2 + (fatp->u0.s0.fat_v_rtype == FAT_C_VFC ? fatp->fat_b_vfcsize : 0); Index: dir.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/dir.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- dir.c 22 Sep 2004 07:10:35 -0000 1.8 +++ dir.c 22 Sep 2004 07:14:35 -0000 1.9 @@ -50,7 +50,7 @@ */ if (pos == -1) return 0; - + /* * When we get called the first time for a directory file, the file * position is set to 0. We must then return two fake entries, @@ -63,7 +63,7 @@ ods2filep->curbyte = 0; vbn = 0; } - + /* * As long we can translate the virtual block number, VBN, to a * logical block number, LBN, and read the block we continue to loop. @@ -73,7 +73,7 @@ && (bh = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL && bh->b_data != NULL) { u16 *recp = (short unsigned *)((char *)(GETBLKP(sb, lbn, bh->b_data)) + (ods2filep->currec & 511)); - + /* * For a ODS2 directory each block contains 1 to 62 directory * entries. Note that a directory entry can not span between @@ -111,7 +111,7 @@ ods2filep->curbyte = ((dire->u1.s1.dir_b_namecount + 1) & ~1) + 6; } filp->f_pos = ods2filep->currec + ods2filep->curbyte; - + while (ods2filep->curbyte < dire->u1.s1.dir_w_size && !(ods2p->flags.v_version != SB_M_VERSALL && strlen(dirname) == strlen(cdirname) @@ -155,23 +155,23 @@ filp->f_pos += dire->u1.s1.dir_w_size; } } - + /* When we come here there are no more versions for the file name. We then reset our current byte offset and set current record offset to the next directory entry. */ - + ods2filep->curbyte = 0; ods2filep->currec += le16_to_cpu(dire->u1.s1.dir_w_size) + 2; recp = (u16 *)((char *)recp + le16_to_cpu(dire->u1.s1.dir_w_size) + 2); } - + /* When we come here there are no more directory entries in the current block and we just release the buffer and increase the VBN counter. */ - + brelse(bh); vbn++; ods2filep->currec = vbn * 512; |
|
From: Jan-Benedict G. <jb...@us...> - 2004-09-22 07:10:48
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13852 Modified Files: dir.c super.c Log Message: - More eye-candy. Index: super.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/super.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- super.c 22 Sep 2004 06:24:30 -0000 1.10 +++ super.c 22 Sep 2004 07:10:35 -0000 1.11 @@ -25,11 +25,10 @@ #include "ods2.h" /* - This routine is executed when the ODS2 file system is unmounted. - The only thing we need to do is to release file INDEXF.SYS;1 and - deallocate memory used for index file header bitmap. -*/ - + * This routine is executed when the ODS2 file system is unmounted. + * The only thing we need to do is to release file INDEXF.SYS;1 and + * deallocate memory used for index file header bitmap. + */ static void ods2_put_super(struct super_block *sb) { struct ods2sb *ods2p = ODS2_SB (sb); @@ -41,11 +40,10 @@ } /* - This routine is executed when the user want to get information - about the ODS2 file system. As we are read only we can just copy - the information we were gathering during the mount into the buffer. -*/ - + * This routine is executed when the user want to get information + * about the ODS2 file system. As we are read only we can just copy + * the information we were gathering during the mount into the buffer. + */ int ods2_statfs(struct super_block *sb, struct kstatfs *buf) { struct ods2sb *ods2p = ODS2_SB (sb); @@ -68,15 +66,13 @@ /* - This array is used to get the number of bits set for a nibble value. -*/ - + * This array is used to get the number of bits set for a nibble value. + * */ static char unsigned nibble2bits[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; /* - This routine open and read the BITMAP.SYS;1 file. -*/ - + * This routine open and read the BITMAP.SYS;1 file. + */ int ods2_read_bitmap(struct super_block *sb) { struct ods2sb *ods2p = ODS2_SB (sb); struct inode *inode; @@ -86,37 +82,37 @@ struct ods2fh *ods2fhp = (struct ods2fh *) (inode->u.generic_ip); u32 lbn; - if ((lbn = vbn2lbn(sb, ods2fhp->map, 1)) > 0 && - (bh = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL && bh->b_data != NULL) { - + if ((lbn = vbn2lbn(sb, ods2fhp->map, 1)) > 0 + && (bh = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL + && bh->b_data != NULL) { struct scbdef *scb = (struct scbdef *) GETBLKP(sb, lbn, bh->b_data); short unsigned *p; short unsigned chksum = 0; - + for (p = (short unsigned *)scb ; p < (short unsigned *)&(scb->scb_w_checksum) ; chksum += *p++); - if (scb->u1.s1.scb_b_structlevl == 2 && scb->u1.s1.scb_b_structlevv >= 1 && - scb->scb_w_cluster == ods2p->hm2.hm2_w_cluster && - scb->scb_w_checksum == chksum) { - + if (scb->u1.s1.scb_b_structlevl == 2 + && scb->u1.s1.scb_b_structlevv >= 1 + && scb->scb_w_cluster == ods2p->hm2.hm2_w_cluster + && scb->scb_w_checksum == chksum) { struct buffer_head *bh2; u32 vbn = 1; u32 bitset = 0; /* - We need to loop through all bytes that make up the bitmap. - The fastest way to count the number of bits set in the byte - is to have a nibble table that has the number of bits for the - values of 0 to 15. By adding the number of bits for the low - and high nibble we can get the total amount of bits set. - */ + * We need to loop through all bytes that make up the bitmap. + * The fastest way to count the number of bits set in the byte + * is to have a nibble table that has the number of bits for the + * values of 0 to 15. By adding the number of bits for the low + * and high nibble we can get the total amount of bits set. + */ + while (vbn * 512 < inode->i_size + && (lbn = vbn2lbn(sb, ods2fhp->map, vbn + 1)) > 0 + && (bh2 = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL + && bh->b_data != NULL) { + u8 *bp = (char unsigned *)(GETBLKP(sb, lbn, bh2->b_data)); + int cnt; - while (vbn * 512 < inode->i_size && (lbn = vbn2lbn(sb, ods2fhp->map, vbn + 1)) > 0 && - (bh2 = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL && bh->b_data != NULL) { - - u8 *bp = (char unsigned *)(GETBLKP(sb, lbn, bh2->b_data)); - int cnt; - for (cnt = 0; cnt < 512; cnt++, bp++) { bitset += (nibble2bits[*bp & 0x0f] + nibble2bits[*bp >> 4]); } brelse(bh2); vbn++; @@ -137,10 +133,10 @@ } /* - This routine allocate memory for the index file header bitmap - and copy data from the INDEXF.SYS file. At the same time the - number of free file headers are counted. -*/ + * This routine allocate memory for the index file header bitmap + * and copy data from the INDEXF.SYS file. At the same time the + * number of free file headers are counted. + */ int ods2_read_ibitmap (struct super_block *sb) { @@ -153,8 +149,8 @@ memset(ods2p->ibitmap, 0, (ods2p->hm2.hm2_w_ibmapsize << 9)); for (idx = 0 ; idx < ods2p->hm2.hm2_w_ibmapsize ; idx++) { if ((bh = sb_bread(sb, GETBLKNO(sb, ods2p->hm2.hm2_l_ibmaplbn + idx))) != NULL && bh->b_data != NULL) { - u8 *bp = (GETBLKP(sb, ods2p->hm2.hm2_l_ibmaplbn + idx, bh->b_data)); - int cnt; + u8 *bp = (GETBLKP(sb, ods2p->hm2.hm2_l_ibmaplbn + idx, bh->b_data)); + int cnt; memcpy((ods2p->ibitmap + (idx << 9)), GETBLKP(sb, ods2p->hm2.hm2_l_ibmaplbn + idx, bh->b_data), 512); for (cnt = 0; cnt < 512; cnt++, bp++) { @@ -338,20 +334,18 @@ /* * This is the way to check for a valid home block. */ - if (ods2p->hm2.hm2_l_homelbn != 0 && - ods2p->hm2.hm2_l_alhomelbn != 0 && - ods2p->hm2.hm2_l_altidxlbn != 0 && - ods2p->hm2.hm2_w_cluster != 0 && - ods2p->hm2.u1.s1.hm2_b_structlevl == 2 && - ods2p->hm2.u1.s1.hm2_b_structlevv >= 1 && - ods2p->hm2.hm2_w_homevbn != 0 && - ods2p->hm2.hm2_l_ibmaplbn != 0 && - ods2p->hm2.hm2_l_maxfiles > ods2p->hm2.hm2_w_resfiles && - ods2p->hm2.hm2_w_resfiles >= 5 && - chksum1 == ods2p->hm2.hm2_w_checksum1 && - chksum2 == ods2p->hm2.hm2_w_checksum2) { - - + if (ods2p->hm2.hm2_l_homelbn != 0 + && ods2p->hm2.hm2_l_alhomelbn != 0 + && ods2p->hm2.hm2_l_altidxlbn != 0 + && ods2p->hm2.hm2_w_cluster != 0 + && ods2p->hm2.u1.s1.hm2_b_structlevl == 2 + && ods2p->hm2.u1.s1.hm2_b_structlevv >= 1 + && ods2p->hm2.hm2_w_homevbn != 0 + && ods2p->hm2.hm2_l_ibmaplbn != 0 + && ods2p->hm2.hm2_l_maxfiles > ods2p->hm2.hm2_w_resfiles + && ods2p->hm2.hm2_w_resfiles >= 5 + && chksum1 == ods2p->hm2.hm2_w_checksum1 + && chksum2 == ods2p->hm2.hm2_w_checksum2) { sb->s_op = &ods2_sops; ods2p->indexf = iget(sb, 1); /* read INDEXF.SYS. */ Index: dir.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/dir.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- dir.c 20 Sep 2004 21:15:47 -0000 1.7 +++ dir.c 22 Sep 2004 07:10:35 -0000 1.8 @@ -43,6 +43,7 @@ char cdirname[256]; /* FIXME: large stack useage!!! */ memset (cdirname, ' ', sizeof (cdirname)); + /* * When there are no more files to return the file position in file * is set to -1. @@ -51,11 +52,10 @@ return 0; /* - When we get called the first time for a directory file the file - position is set to 0. We must then return two fake entries, - . for the current directory and .. for the parent directory. - */ - + * When we get called the first time for a directory file, the file + * position is set to 0. We must then return two fake entries, + * "." for the current directory and ".." for the parent directory. + */ if (pos == 0) { filldir(dirent, ".", 1, 0, inode->i_ino, DT_DIR); filldir(dirent, "..", 2, 1, ods2fhp->parent, DT_DIR); @@ -65,45 +65,61 @@ } /* - As long we can translate the virtual block number, VBN, to a - logical block number, LBN, and read the block we continue to loop. - */ - - while (vbn * 512 < inode->i_size && (lbn = vbn2lbn(sb, ods2fhp->map, vbn + 1)) > 0 && - (bh = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL && bh->b_data != NULL) { - - u16 *recp = (short unsigned *)((char *)(GETBLKP(sb, lbn, bh->b_data)) + (ods2filep->currec & 511)); + * As long we can translate the virtual block number, VBN, to a + * logical block number, LBN, and read the block we continue to loop. + */ + while (vbn * 512 < inode->i_size + && (lbn = vbn2lbn(sb, ods2fhp->map, vbn + 1)) > 0 + && (bh = sb_bread(sb, GETBLKNO(sb, lbn))) != NULL && + bh->b_data != NULL) { + u16 *recp = (short unsigned *)((char *)(GETBLKP(sb, lbn, bh->b_data)) + (ods2filep->currec & 511)); /* - For a ODS2 directory each block contains 1 to 62 directory entries. - Note that a directory entry can not span between two or more blocks. - We should be able to use the routine to read variable block size but - because directory file is so specific we do our own block decoding here. - When there are no more directory entries in the current block the record - length -1 is inserted as the last record. - */ - - while (*recp != 65535 && *recp <= 512 && ods2filep->currec < inode->i_size) { + * For a ODS2 directory each block contains 1 to 62 directory + * entries. Note that a directory entry can not span between + * two or more blocks. We should be able to use the routine + * to read variable block size but because directory file is + * so specific we do our own block decoding here. + * When there are no more directory entries in the current + * block, the record length -1 is inserted as the last + * record. + */ + while (*recp != 65535 + && *recp <= 512 + && ods2filep->currec < inode->i_size) { struct dirdef *dire = (struct dirdef *) recp; char dirname[dire->u1.s1.dir_b_namecount + 1]; /* FIXME: Check stack useage */ memcpy(dirname, &dire->u1.s1.dir_t_name, dire->u1.s1.dir_b_namecount); dirname[dire->u1.s1.dir_b_namecount] = 0; + if (ods2p->dollar != '$' || ods2p->flags.v_lowercase) { char *p = dirname; char cnt = dire->u1.s1.dir_b_namecount; - while (*p && cnt-- > 0) { if (*p == '$') { *p = ods2p->dollar; } if (ods2p->flags.v_lowercase) { *p = tolower(*p); } p++; } + while (*p && cnt-- > 0) { + if (*p == '$') { + *p = ods2p->dollar; + } + if (ods2p->flags.v_lowercase) { + *p = tolower (*p); + } + p++; + } + } + if (ods2filep->curbyte == 0) { + ods2filep->curbyte = ((dire->u1.s1.dir_b_namecount + 1) & ~1) + 6; } - if (ods2filep->curbyte == 0) { ods2filep->curbyte = ((dire->u1.s1.dir_b_namecount + 1) & ~1) + 6; } filp->f_pos = ods2filep->currec + ods2filep->curbyte; - while (ods2filep->curbyte < dire->u1.s1.dir_w_size && - !(ods2p->flags.v_version != SB_M_VERSALL && strlen(dirname) == strlen(cdirname) && strncmp(dirname, cdirname, strlen(dirname)) == 0)) { - + while (ods2filep->curbyte < dire->u1.s1.dir_w_size + && !(ods2p->flags.v_version != SB_M_VERSALL + && strlen(dirname) == strlen(cdirname) + && strncmp(dirname, cdirname, strlen(dirname)) == 0)) { struct dirdef *dirv = (struct dirdef *) ((char *)dire + ods2filep->curbyte); u32 ino = (dirv->u1.s2.u2.s3.fid_b_nmx << 16) | le16_to_cpu(dirv->u1.s2.u2.s3.fid_w_num); - char dirnamev[dire->u1.s1.dir_b_namecount + 1 + 5 + 1]; /* FIXME: Check stack useage! */ + /* FIXME: Check stack useage! */ + char dirnamev[dire->u1.s1.dir_b_namecount + 1 + 5 + 1]; if (ino != 4) { /* we must ignore 000000.DIR as it is the same as . */ if (ods2p->flags.v_version == SB_M_VERSNONE) @@ -127,7 +143,9 @@ brelse(bh); return 0; } - if (ods2p->flags.v_version != SB_M_VERSALL) { strcpy(cdirname, dirname); } + if (ods2p->flags.v_version != SB_M_VERSALL) { + strcpy(cdirname, dirname); + } } if (ods2p->flags.v_version == SB_M_VERSALL) { ods2filep->curbyte += 8; |