diff options
author | Jaroslav Kysela <perex@petra> | 2005-06-22 06:19:24 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@petra> | 2005-06-22 06:19:24 -0400 |
commit | da04b128cf0d74dd4cab270c53d9264e70f9203e (patch) | |
tree | 095355c32dfd709236a85b497d3bd461d7cdfe8a /include/linux | |
parent | fae6ec69c84d71b1d5bda9ede1a262c1681684aa (diff) | |
parent | 2a5a68b840cbab31baab2d9b2e1e6de3b289ae1e (diff) |
Merge with rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'include/linux')
32 files changed, 709 insertions, 268 deletions
diff --git a/include/linux/arcfb.h b/include/linux/arcfb.h new file mode 100644 index 000000000000..721e7654daeb --- /dev/null +++ b/include/linux/arcfb.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __LINUX_ARCFB_H__ | ||
2 | #define __LINUX_ARCFB_H__ | ||
3 | |||
4 | #define FBIO_WAITEVENT _IO('F', 0x88) | ||
5 | #define FBIO_GETCONTROL2 _IOR('F', 0x89, size_t) | ||
6 | |||
7 | #endif | ||
8 | |||
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index a1657fb99516..9343c89d843c 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #define AUTOFS_MIN_PROTO_VERSION 3 | 23 | #define AUTOFS_MIN_PROTO_VERSION 3 |
24 | #define AUTOFS_MAX_PROTO_VERSION 4 | 24 | #define AUTOFS_MAX_PROTO_VERSION 4 |
25 | 25 | ||
26 | #define AUTOFS_PROTO_SUBVERSION 6 | 26 | #define AUTOFS_PROTO_SUBVERSION 7 |
27 | 27 | ||
28 | /* Mask for expire behaviour */ | 28 | /* Mask for expire behaviour */ |
29 | #define AUTOFS_EXP_IMMEDIATE 1 | 29 | #define AUTOFS_EXP_IMMEDIATE 1 |
diff --git a/include/linux/fb.h b/include/linux/fb.h index b468bf496547..bc24beeed971 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -524,11 +524,11 @@ struct fb_pixmap { | |||
524 | u32 offset; /* current offset to buffer */ | 524 | u32 offset; /* current offset to buffer */ |
525 | u32 buf_align; /* byte alignment of each bitmap */ | 525 | u32 buf_align; /* byte alignment of each bitmap */ |
526 | u32 scan_align; /* alignment per scanline */ | 526 | u32 scan_align; /* alignment per scanline */ |
527 | u32 access_align; /* alignment per read/write */ | 527 | u32 access_align; /* alignment per read/write (bits) */ |
528 | u32 flags; /* see FB_PIXMAP_* */ | 528 | u32 flags; /* see FB_PIXMAP_* */ |
529 | /* access methods */ | 529 | /* access methods */ |
530 | void (*outbuf)(struct fb_info *info, u8 *addr, u8 *src, unsigned int size); | 530 | void (*writeio)(struct fb_info *info, void __iomem *dst, void *src, unsigned int size); |
531 | u8 (*inbuf) (struct fb_info *info, u8 *addr); | 531 | void (*readio) (struct fb_info *info, void *dst, void __iomem *src, unsigned int size); |
532 | }; | 532 | }; |
533 | 533 | ||
534 | 534 | ||
@@ -816,18 +816,9 @@ extern int unregister_framebuffer(struct fb_info *fb_info); | |||
816 | extern int fb_prepare_logo(struct fb_info *fb_info); | 816 | extern int fb_prepare_logo(struct fb_info *fb_info); |
817 | extern int fb_show_logo(struct fb_info *fb_info); | 817 | extern int fb_show_logo(struct fb_info *fb_info); |
818 | extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); | 818 | extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); |
819 | extern void fb_iomove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, | 819 | extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, |
820 | u8 *dst, u32 d_pitch, u8 *src, u32 idx, | ||
821 | u32 height, u32 shift_high, u32 shift_low, u32 mod); | 820 | u32 height, u32 shift_high, u32 shift_low, u32 mod); |
822 | extern void fb_iomove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, | 821 | extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height); |
823 | u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, | ||
824 | u32 height); | ||
825 | extern void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, | ||
826 | u8 *dst, u32 d_pitch, u8 *src, u32 idx, | ||
827 | u32 height, u32 shift_high, u32 shift_low, u32 mod); | ||
828 | extern void fb_sysmove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, | ||
829 | u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, | ||
830 | u32 height); | ||
831 | extern void fb_set_suspend(struct fb_info *info, int state); | 822 | extern void fb_set_suspend(struct fb_info *info, int state); |
832 | extern int fb_get_color_depth(struct fb_var_screeninfo *var); | 823 | extern int fb_get_color_depth(struct fb_var_screeninfo *var); |
833 | extern int fb_get_options(char *name, char **option); | 824 | extern int fb_get_options(char *name, char **option); |
diff --git a/include/linux/font.h b/include/linux/font.h index fc2d690c9d5f..8fc80a7d78ac 100644 --- a/include/linux/font.h +++ b/include/linux/font.h | |||
@@ -25,19 +25,23 @@ struct font_desc { | |||
25 | #define VGA8x16_IDX 1 | 25 | #define VGA8x16_IDX 1 |
26 | #define PEARL8x8_IDX 2 | 26 | #define PEARL8x8_IDX 2 |
27 | #define VGA6x11_IDX 3 | 27 | #define VGA6x11_IDX 3 |
28 | #define SUN8x16_IDX 4 | 28 | #define FONT7x14_IDX 4 |
29 | #define SUN12x22_IDX 5 | 29 | #define FONT10x18_IDX 5 |
30 | #define ACORN8x8_IDX 6 | 30 | #define SUN8x16_IDX 6 |
31 | #define MINI4x6_IDX 7 | 31 | #define SUN12x22_IDX 7 |
32 | #define ACORN8x8_IDX 8 | ||
33 | #define MINI4x6_IDX 9 | ||
32 | 34 | ||
33 | extern struct font_desc font_vga_8x8, | 35 | extern struct font_desc font_vga_8x8, |
34 | font_vga_8x16, | 36 | font_vga_8x16, |
35 | font_pearl_8x8, | 37 | font_pearl_8x8, |
36 | font_vga_6x11, | 38 | font_vga_6x11, |
37 | font_sun_8x16, | 39 | font_7x14, |
38 | font_sun_12x22, | 40 | font_10x18, |
39 | font_acorn_8x8, | 41 | font_sun_8x16, |
40 | font_mini_4x6; | 42 | font_sun_12x22, |
43 | font_acorn_8x8, | ||
44 | font_mini_4x6; | ||
41 | 45 | ||
42 | /* Find a font with a specific name */ | 46 | /* Find a font with a specific name */ |
43 | 47 | ||
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index faaff4c64559..70f54af87b9f 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -51,6 +51,7 @@ struct gianfar_platform_data { | |||
51 | 51 | ||
52 | /* board specific information */ | 52 | /* board specific information */ |
53 | u32 board_flags; | 53 | u32 board_flags; |
54 | u32 phy_flags; | ||
54 | u32 phyid; | 55 | u32 phyid; |
55 | u32 interruptPHY; | 56 | u32 interruptPHY; |
56 | u8 mac_addr[6]; | 57 | u8 mac_addr[6]; |
@@ -61,9 +62,14 @@ struct gianfar_platform_data { | |||
61 | #define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 | 62 | #define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 |
62 | #define FSL_GIANFAR_DEV_HAS_RMON 0x00000004 | 63 | #define FSL_GIANFAR_DEV_HAS_RMON 0x00000004 |
63 | #define FSL_GIANFAR_DEV_HAS_MULTI_INTR 0x00000008 | 64 | #define FSL_GIANFAR_DEV_HAS_MULTI_INTR 0x00000008 |
65 | #define FSL_GIANFAR_DEV_HAS_CSUM 0x00000010 | ||
66 | #define FSL_GIANFAR_DEV_HAS_VLAN 0x00000020 | ||
67 | #define FSL_GIANFAR_DEV_HAS_EXTENDED_HASH 0x00000040 | ||
68 | #define FSL_GIANFAR_DEV_HAS_PADDING 0x00000080 | ||
64 | 69 | ||
65 | /* Flags in gianfar_platform_data */ | 70 | /* Flags in gianfar_platform_data */ |
66 | #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* if not set use a timer */ | 71 | #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */ |
72 | #define FSL_GIANFAR_BRD_IS_REDUCED 0x00000002 /* Set if RGMII, RMII */ | ||
67 | 73 | ||
68 | struct fsl_i2c_platform_data { | 74 | struct fsl_i2c_platform_data { |
69 | /* device specific information */ | 75 | /* device specific information */ |
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h new file mode 100644 index 000000000000..7fd0576a4454 --- /dev/null +++ b/include/linux/genalloc.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Basic general purpose allocator for managing special purpose memory | ||
3 | * not managed by the regular kmalloc/kfree interface. | ||
4 | * Uses for this includes on-device special memory, uncached memory | ||
5 | * etc. | ||
6 | * | ||
7 | * This code is based on the buddy allocator found in the sym53c8xx_2 | ||
8 | * driver, adapted for general purpose use. | ||
9 | * | ||
10 | * This source code is licensed under the GNU General Public License, | ||
11 | * Version 2. See the file COPYING for more details. | ||
12 | */ | ||
13 | |||
14 | #include <linux/spinlock.h> | ||
15 | |||
16 | #define ALLOC_MIN_SHIFT 5 /* 32 bytes minimum */ | ||
17 | /* | ||
18 | * Link between free memory chunks of a given size. | ||
19 | */ | ||
20 | struct gen_pool_link { | ||
21 | struct gen_pool_link *next; | ||
22 | }; | ||
23 | |||
24 | /* | ||
25 | * Memory pool descriptor. | ||
26 | */ | ||
27 | struct gen_pool { | ||
28 | spinlock_t lock; | ||
29 | unsigned long (*get_new_chunk)(struct gen_pool *); | ||
30 | struct gen_pool *next; | ||
31 | struct gen_pool_link *h; | ||
32 | unsigned long private; | ||
33 | int max_chunk_shift; | ||
34 | }; | ||
35 | |||
36 | unsigned long gen_pool_alloc(struct gen_pool *poolp, int size); | ||
37 | void gen_pool_free(struct gen_pool *mp, unsigned long ptr, int size); | ||
38 | struct gen_pool *gen_pool_create(int nr_chunks, int max_chunk_shift, | ||
39 | unsigned long (*fp)(struct gen_pool *), | ||
40 | unsigned long data); | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index af7407e8cfc5..8d6bf608b199 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -39,6 +39,7 @@ struct vm_area_struct; | |||
39 | #define __GFP_COMP 0x4000u /* Add compound page metadata */ | 39 | #define __GFP_COMP 0x4000u /* Add compound page metadata */ |
40 | #define __GFP_ZERO 0x8000u /* Return zeroed page on success */ | 40 | #define __GFP_ZERO 0x8000u /* Return zeroed page on success */ |
41 | #define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ | 41 | #define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ |
42 | #define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ | ||
42 | 43 | ||
43 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 44 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ |
44 | #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) | 45 | #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) |
@@ -47,7 +48,7 @@ struct vm_area_struct; | |||
47 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | 48 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ |
48 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ | 49 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ |
49 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ | 50 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ |
50 | __GFP_NOMEMALLOC) | 51 | __GFP_NOMEMALLOC|__GFP_NORECLAIM) |
51 | 52 | ||
52 | #define GFP_ATOMIC (__GFP_HIGH) | 53 | #define GFP_ATOMIC (__GFP_HIGH) |
53 | #define GFP_NOIO (__GFP_WAIT) | 54 | #define GFP_NOIO (__GFP_WAIT) |
@@ -132,5 +133,10 @@ extern void FASTCALL(free_cold_page(struct page *page)); | |||
132 | #define free_page(addr) free_pages((addr),0) | 133 | #define free_page(addr) free_pages((addr),0) |
133 | 134 | ||
134 | void page_alloc_init(void); | 135 | void page_alloc_init(void); |
136 | #ifdef CONFIG_NUMA | ||
137 | void drain_remote_pages(void); | ||
138 | #else | ||
139 | static inline void drain_remote_pages(void) { }; | ||
140 | #endif | ||
135 | 141 | ||
136 | #endif /* __LINUX_GFP_H */ | 142 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6af1ae4a8211..f529d1442815 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #ifdef CONFIG_HUGETLB_PAGE | 4 | #ifdef CONFIG_HUGETLB_PAGE |
5 | 5 | ||
6 | #include <linux/mempolicy.h> | 6 | #include <linux/mempolicy.h> |
7 | #include <asm/tlbflush.h> | ||
7 | 8 | ||
8 | struct ctl_table; | 9 | struct ctl_table; |
9 | 10 | ||
@@ -22,12 +23,6 @@ int hugetlb_report_meminfo(char *); | |||
22 | int hugetlb_report_node_meminfo(int, char *); | 23 | int hugetlb_report_node_meminfo(int, char *); |
23 | int is_hugepage_mem_enough(size_t); | 24 | int is_hugepage_mem_enough(size_t); |
24 | unsigned long hugetlb_total_pages(void); | 25 | unsigned long hugetlb_total_pages(void); |
25 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | ||
26 | int write); | ||
27 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | ||
28 | pmd_t *pmd, int write); | ||
29 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
30 | int pmd_huge(pmd_t pmd); | ||
31 | struct page *alloc_huge_page(void); | 26 | struct page *alloc_huge_page(void); |
32 | void free_huge_page(struct page *); | 27 | void free_huge_page(struct page *); |
33 | 28 | ||
@@ -35,6 +30,17 @@ extern unsigned long max_huge_pages; | |||
35 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
36 | extern int sysctl_hugetlb_shm_group; | 31 | extern int sysctl_hugetlb_shm_group; |
37 | 32 | ||
33 | /* arch callbacks */ | ||
34 | |||
35 | pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr); | ||
36 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr); | ||
37 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | ||
38 | int write); | ||
39 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | ||
40 | pmd_t *pmd, int write); | ||
41 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
42 | int pmd_huge(pmd_t pmd); | ||
43 | |||
38 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE | 44 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE |
39 | #define is_hugepage_only_range(mm, addr, len) 0 | 45 | #define is_hugepage_only_range(mm, addr, len) 0 |
40 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 46 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ |
@@ -48,6 +54,28 @@ extern int sysctl_hugetlb_shm_group; | |||
48 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 54 | int prepare_hugepage_range(unsigned long addr, unsigned long len); |
49 | #endif | 55 | #endif |
50 | 56 | ||
57 | #ifndef ARCH_HAS_SETCLEAR_HUGE_PTE | ||
58 | #define set_huge_pte_at(mm, addr, ptep, pte) set_pte_at(mm, addr, ptep, pte) | ||
59 | #define huge_ptep_get_and_clear(mm, addr, ptep) ptep_get_and_clear(mm, addr, ptep) | ||
60 | #else | ||
61 | void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, | ||
62 | pte_t *ptep, pte_t pte); | ||
63 | pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | ||
64 | pte_t *ptep); | ||
65 | #endif | ||
66 | |||
67 | #ifndef ARCH_HAS_HUGETLB_PREFAULT_HOOK | ||
68 | #define hugetlb_prefault_arch_hook(mm) do { } while (0) | ||
69 | #else | ||
70 | void hugetlb_prefault_arch_hook(struct mm_struct *mm); | ||
71 | #endif | ||
72 | |||
73 | #ifndef ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE | ||
74 | #define hugetlb_clean_stale_pgtable(pte) BUG() | ||
75 | #else | ||
76 | void hugetlb_clean_stale_pgtable(pte_t *pte); | ||
77 | #endif | ||
78 | |||
51 | #else /* !CONFIG_HUGETLB_PAGE */ | 79 | #else /* !CONFIG_HUGETLB_PAGE */ |
52 | 80 | ||
53 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 81 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
diff --git a/include/linux/ioc4.h b/include/linux/ioc4.h new file mode 100644 index 000000000000..3dd18b785ebd --- /dev/null +++ b/include/linux/ioc4.h | |||
@@ -0,0 +1,179 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_IOC4_H | ||
10 | #define _LINUX_IOC4_H | ||
11 | |||
12 | #include <linux/interrupt.h> | ||
13 | |||
14 | /*************** | ||
15 | * Definitions * | ||
16 | ***************/ | ||
17 | |||
18 | /* Miscellaneous values inherent to hardware */ | ||
19 | |||
20 | #define IOC4_EXTINT_COUNT_DIVISOR 520 /* PCI clocks per COUNT tick */ | ||
21 | |||
22 | /*********************************** | ||
23 | * Structures needed by subdrivers * | ||
24 | ***********************************/ | ||
25 | |||
26 | /* This structure fully describes the IOC4 miscellaneous registers which | ||
27 | * appear at bar[0]+0x00000 through bar[0]+0x0005c. The corresponding | ||
28 | * PCI resource is managed by the main IOC4 driver because it contains | ||
29 | * registers of interest to many different IOC4 subdrivers. | ||
30 | */ | ||
31 | struct ioc4_misc_regs { | ||
32 | /* Miscellaneous IOC4 registers */ | ||
33 | union ioc4_pci_err_addr_l { | ||
34 | uint32_t raw; | ||
35 | struct { | ||
36 | uint32_t valid:1; /* Address captured */ | ||
37 | uint32_t master_id:4; /* Unit causing error | ||
38 | * 0/1: Serial port 0 TX/RX | ||
39 | * 2/3: Serial port 1 TX/RX | ||
40 | * 4/5: Serial port 2 TX/RX | ||
41 | * 6/7: Serial port 3 TX/RX | ||
42 | * 8: ATA/ATAPI | ||
43 | * 9-15: Undefined | ||
44 | */ | ||
45 | uint32_t mul_err:1; /* Multiple errors occurred */ | ||
46 | uint32_t addr:26; /* Bits 31-6 of error addr */ | ||
47 | } fields; | ||
48 | } pci_err_addr_l; | ||
49 | uint32_t pci_err_addr_h; /* Bits 63-32 of error addr */ | ||
50 | union ioc4_sio_int { | ||
51 | uint32_t raw; | ||
52 | struct { | ||
53 | uint8_t tx_mt:1; /* TX ring buffer empty */ | ||
54 | uint8_t rx_full:1; /* RX ring buffer full */ | ||
55 | uint8_t rx_high:1; /* RX high-water exceeded */ | ||
56 | uint8_t rx_timer:1; /* RX timer has triggered */ | ||
57 | uint8_t delta_dcd:1; /* DELTA_DCD seen */ | ||
58 | uint8_t delta_cts:1; /* DELTA_CTS seen */ | ||
59 | uint8_t intr_pass:1; /* Interrupt pass-through */ | ||
60 | uint8_t tx_explicit:1; /* TX, MCW, or delay complete */ | ||
61 | } fields[4]; | ||
62 | } sio_ir; /* Serial interrupt state */ | ||
63 | union ioc4_other_int { | ||
64 | uint32_t raw; | ||
65 | struct { | ||
66 | uint32_t ata_int:1; /* ATA port passthru */ | ||
67 | uint32_t ata_memerr:1; /* ATA halted by mem error */ | ||
68 | uint32_t memerr:4; /* Serial halted by mem err */ | ||
69 | uint32_t kbd_int:1; /* kbd/mouse intr asserted */ | ||
70 | uint32_t reserved:16; /* zero */ | ||
71 | uint32_t rt_int:1; /* INT_OUT section latch */ | ||
72 | uint32_t gen_int:8; /* Intr. from generic pins */ | ||
73 | } fields; | ||
74 | } other_ir; /* Other interrupt state */ | ||
75 | union ioc4_sio_int sio_ies; /* Serial interrupt enable set */ | ||
76 | union ioc4_other_int other_ies; /* Other interrupt enable set */ | ||
77 | union ioc4_sio_int sio_iec; /* Serial interrupt enable clear */ | ||
78 | union ioc4_other_int other_iec; /* Other interrupt enable clear */ | ||
79 | union ioc4_sio_cr { | ||
80 | uint32_t raw; | ||
81 | struct { | ||
82 | uint32_t cmd_pulse:4; /* Bytebus strobe width */ | ||
83 | uint32_t arb_diag:3; /* PCI bus requester */ | ||
84 | uint32_t sio_diag_idle:1; /* Active ser req? */ | ||
85 | uint32_t ata_diag_idle:1; /* Active ATA req? */ | ||
86 | uint32_t ata_diag_active:1; /* ATA req is winner */ | ||
87 | uint32_t reserved:22; /* zero */ | ||
88 | } fields; | ||
89 | } sio_cr; | ||
90 | uint32_t unused1; | ||
91 | union ioc4_int_out { | ||
92 | uint32_t raw; | ||
93 | struct { | ||
94 | uint32_t count:16; /* Period control */ | ||
95 | uint32_t mode:3; /* Output signal shape */ | ||
96 | uint32_t reserved:11; /* zero */ | ||
97 | uint32_t diag:1; /* Timebase control */ | ||
98 | uint32_t int_out:1; /* Current value */ | ||
99 | } fields; | ||
100 | } int_out; /* External interrupt output control */ | ||
101 | uint32_t unused2; | ||
102 | union ioc4_gpcr { | ||
103 | uint32_t raw; | ||
104 | struct { | ||
105 | uint32_t dir:8; /* Pin direction */ | ||
106 | uint32_t edge:8; /* Edge/level mode */ | ||
107 | uint32_t reserved1:4; /* zero */ | ||
108 | uint32_t int_out_en:1; /* INT_OUT enable */ | ||
109 | uint32_t reserved2:11; /* zero */ | ||
110 | } fields; | ||
111 | } gpcr_s; /* Generic PIO control set */ | ||
112 | union ioc4_gpcr gpcr_c; /* Generic PIO control clear */ | ||
113 | union ioc4_gpdr { | ||
114 | uint32_t raw; | ||
115 | struct { | ||
116 | uint32_t gen_pin:8; /* State of pins */ | ||
117 | uint32_t reserved:24; | ||
118 | } fields; | ||
119 | } gpdr; /* Generic PIO data */ | ||
120 | uint32_t unused3; | ||
121 | union ioc4_gppr { | ||
122 | uint32_t raw; | ||
123 | struct { | ||
124 | uint32_t gen_pin:1; /* Single pin state */ | ||
125 | uint32_t reserved:31; | ||
126 | } fields; | ||
127 | } gppr[8]; /* Generic PIO pins */ | ||
128 | }; | ||
129 | |||
130 | /* Masks for GPCR DIR pins */ | ||
131 | #define IOC4_GPCR_DIR_0 0x01 /* External interrupt output */ | ||
132 | #define IOC4_GPCR_DIR_1 0x02 /* External interrupt input */ | ||
133 | #define IOC4_GPCR_DIR_2 0x04 | ||
134 | #define IOC4_GPCR_DIR_3 0x08 /* Keyboard/mouse presence */ | ||
135 | #define IOC4_GPCR_DIR_4 0x10 /* Ser. port 0 xcvr select (0=232, 1=422) */ | ||
136 | #define IOC4_GPCR_DIR_5 0x20 /* Ser. port 1 xcvr select (0=232, 1=422) */ | ||
137 | #define IOC4_GPCR_DIR_6 0x40 /* Ser. port 2 xcvr select (0=232, 1=422) */ | ||
138 | #define IOC4_GPCR_DIR_7 0x80 /* Ser. port 3 xcvr select (0=232, 1=422) */ | ||
139 | |||
140 | /* Masks for GPCR EDGE pins */ | ||
141 | #define IOC4_GPCR_EDGE_0 0x01 | ||
142 | #define IOC4_GPCR_EDGE_1 0x02 /* External interrupt input */ | ||
143 | #define IOC4_GPCR_EDGE_2 0x04 | ||
144 | #define IOC4_GPCR_EDGE_3 0x08 | ||
145 | #define IOC4_GPCR_EDGE_4 0x10 | ||
146 | #define IOC4_GPCR_EDGE_5 0x20 | ||
147 | #define IOC4_GPCR_EDGE_6 0x40 | ||
148 | #define IOC4_GPCR_EDGE_7 0x80 | ||
149 | |||
150 | /* One of these per IOC4 */ | ||
151 | struct ioc4_driver_data { | ||
152 | struct list_head idd_list; | ||
153 | unsigned long idd_bar0; | ||
154 | struct pci_dev *idd_pdev; | ||
155 | const struct pci_device_id *idd_pci_id; | ||
156 | struct __iomem ioc4_misc_regs *idd_misc_regs; | ||
157 | unsigned long count_period; | ||
158 | void *idd_serial_data; | ||
159 | }; | ||
160 | |||
161 | /* One per submodule */ | ||
162 | struct ioc4_submodule { | ||
163 | struct list_head is_list; | ||
164 | char *is_name; | ||
165 | struct module *is_owner; | ||
166 | int (*is_probe) (struct ioc4_driver_data *); | ||
167 | int (*is_remove) (struct ioc4_driver_data *); | ||
168 | }; | ||
169 | |||
170 | #define IOC4_NUM_CARDS 8 /* max cards per partition */ | ||
171 | |||
172 | /********************************** | ||
173 | * Functions needed by submodules * | ||
174 | **********************************/ | ||
175 | |||
176 | extern int ioc4_register_submodule(struct ioc4_submodule *); | ||
177 | extern void ioc4_unregister_submodule(struct ioc4_submodule *); | ||
178 | |||
179 | #endif /* _LINUX_IOC4_H */ | ||
diff --git a/include/linux/ioc4_common.h b/include/linux/ioc4_common.h deleted file mode 100644 index b03bcc46df55..000000000000 --- a/include/linux/ioc4_common.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_IOC4_COMMON_H | ||
10 | #define _LINUX_IOC4_COMMON_H | ||
11 | |||
12 | /* prototypes */ | ||
13 | |||
14 | int ioc4_serial_init(void); | ||
15 | |||
16 | int ioc4_serial_attach_one(struct pci_dev *pdev, const struct | ||
17 | pci_device_id *pci_id); | ||
18 | int ioc4_ide_attach_one(struct pci_dev *pdev, const struct | ||
19 | pci_device_id *pci_id); | ||
20 | |||
21 | #endif /* _LINUX_IOC4_COMMON_H */ | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index c3ff4d101667..7fc1022be9ee 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -47,6 +47,10 @@ struct hw_interrupt_type { | |||
47 | void (*ack)(unsigned int irq); | 47 | void (*ack)(unsigned int irq); |
48 | void (*end)(unsigned int irq); | 48 | void (*end)(unsigned int irq); |
49 | void (*set_affinity)(unsigned int irq, cpumask_t dest); | 49 | void (*set_affinity)(unsigned int irq, cpumask_t dest); |
50 | /* Currently used only by UML, might disappear one day.*/ | ||
51 | #ifdef CONFIG_IRQ_RELEASE_METHOD | ||
52 | void (*release)(unsigned int irq, void *dev_id); | ||
53 | #endif | ||
50 | }; | 54 | }; |
51 | 55 | ||
52 | typedef struct hw_interrupt_type hw_irq_controller; | 56 | typedef struct hw_interrupt_type hw_irq_controller; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 17518fe0b311..1813b162b0a8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -691,6 +691,12 @@ extern void show_mem(void); | |||
691 | extern void si_meminfo(struct sysinfo * val); | 691 | extern void si_meminfo(struct sysinfo * val); |
692 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 692 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
693 | 693 | ||
694 | #ifdef CONFIG_NUMA | ||
695 | extern void setup_per_cpu_pageset(void); | ||
696 | #else | ||
697 | static inline void setup_per_cpu_pageset(void) {} | ||
698 | #endif | ||
699 | |||
694 | /* prio_tree.c */ | 700 | /* prio_tree.c */ |
695 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); | 701 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); |
696 | void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); | 702 | void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e530c6c092f1..4733d35d8223 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -63,6 +63,12 @@ struct per_cpu_pageset { | |||
63 | #endif | 63 | #endif |
64 | } ____cacheline_aligned_in_smp; | 64 | } ____cacheline_aligned_in_smp; |
65 | 65 | ||
66 | #ifdef CONFIG_NUMA | ||
67 | #define zone_pcp(__z, __cpu) ((__z)->pageset[(__cpu)]) | ||
68 | #else | ||
69 | #define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)]) | ||
70 | #endif | ||
71 | |||
66 | #define ZONE_DMA 0 | 72 | #define ZONE_DMA 0 |
67 | #define ZONE_NORMAL 1 | 73 | #define ZONE_NORMAL 1 |
68 | #define ZONE_HIGHMEM 2 | 74 | #define ZONE_HIGHMEM 2 |
@@ -122,8 +128,11 @@ struct zone { | |||
122 | */ | 128 | */ |
123 | unsigned long lowmem_reserve[MAX_NR_ZONES]; | 129 | unsigned long lowmem_reserve[MAX_NR_ZONES]; |
124 | 130 | ||
131 | #ifdef CONFIG_NUMA | ||
132 | struct per_cpu_pageset *pageset[NR_CPUS]; | ||
133 | #else | ||
125 | struct per_cpu_pageset pageset[NR_CPUS]; | 134 | struct per_cpu_pageset pageset[NR_CPUS]; |
126 | 135 | #endif | |
127 | /* | 136 | /* |
128 | * free areas of different sizes | 137 | * free areas of different sizes |
129 | */ | 138 | */ |
@@ -145,6 +154,14 @@ struct zone { | |||
145 | int all_unreclaimable; /* All pages pinned */ | 154 | int all_unreclaimable; /* All pages pinned */ |
146 | 155 | ||
147 | /* | 156 | /* |
157 | * Does the allocator try to reclaim pages from the zone as soon | ||
158 | * as it fails a watermark_ok() in __alloc_pages? | ||
159 | */ | ||
160 | int reclaim_pages; | ||
161 | /* A count of how many reclaimers are scanning this zone */ | ||
162 | atomic_t reclaim_in_progress; | ||
163 | |||
164 | /* | ||
148 | * prev_priority holds the scanning priority for this zone. It is | 165 | * prev_priority holds the scanning priority for this zone. It is |
149 | * defined as the scanning priority at which we achieved our reclaim | 166 | * defined as the scanning priority at which we achieved our reclaim |
150 | * target at the previous try_to_free_pages() or balance_pgdat() | 167 | * target at the previous try_to_free_pages() or balance_pgdat() |
@@ -381,7 +398,7 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, | |||
381 | 398 | ||
382 | #include <linux/topology.h> | 399 | #include <linux/topology.h> |
383 | /* Returns the number of the current Node. */ | 400 | /* Returns the number of the current Node. */ |
384 | #define numa_node_id() (cpu_to_node(_smp_processor_id())) | 401 | #define numa_node_id() (cpu_to_node(raw_smp_processor_id())) |
385 | 402 | ||
386 | #ifndef CONFIG_DISCONTIGMEM | 403 | #ifndef CONFIG_DISCONTIGMEM |
387 | 404 | ||
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 9e5750079e09..3ebc36afae1a 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -75,12 +75,6 @@ enum nf_ip_hook_priorities { | |||
75 | #define SO_ORIGINAL_DST 80 | 75 | #define SO_ORIGINAL_DST 80 |
76 | 76 | ||
77 | #ifdef __KERNEL__ | 77 | #ifdef __KERNEL__ |
78 | #ifdef CONFIG_NETFILTER_DEBUG | ||
79 | void nf_debug_ip_local_deliver(struct sk_buff *skb); | ||
80 | void nf_debug_ip_loopback_xmit(struct sk_buff *newskb); | ||
81 | void nf_debug_ip_finish_output2(struct sk_buff *skb); | ||
82 | #endif /*CONFIG_NETFILTER_DEBUG*/ | ||
83 | |||
84 | extern int ip_route_me_harder(struct sk_buff **pskb); | 78 | extern int ip_route_me_harder(struct sk_buff **pskb); |
85 | 79 | ||
86 | /* Call this before modifying an existing IP packet: ensures it is | 80 | /* Call this before modifying an existing IP packet: ensures it is |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h index d84be02cb4fc..694aec9b4784 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_core.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _IP_CONNTRACK_CORE_H | 1 | #ifndef _IP_CONNTRACK_CORE_H |
2 | #define _IP_CONNTRACK_CORE_H | 2 | #define _IP_CONNTRACK_CORE_H |
3 | #include <linux/netfilter.h> | 3 | #include <linux/netfilter.h> |
4 | #include <linux/netfilter_ipv4/lockhelp.h> | ||
5 | 4 | ||
6 | /* This header is used to share core functionality between the | 5 | /* This header is used to share core functionality between the |
7 | standalone connection tracking module, and the compatibility layer's use | 6 | standalone connection tracking module, and the compatibility layer's use |
@@ -47,6 +46,6 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb) | |||
47 | 46 | ||
48 | extern struct list_head *ip_conntrack_hash; | 47 | extern struct list_head *ip_conntrack_hash; |
49 | extern struct list_head ip_conntrack_expect_list; | 48 | extern struct list_head ip_conntrack_expect_list; |
50 | DECLARE_RWLOCK_EXTERN(ip_conntrack_lock); | 49 | extern rwlock_t ip_conntrack_lock; |
51 | #endif /* _IP_CONNTRACK_CORE_H */ | 50 | #endif /* _IP_CONNTRACK_CORE_H */ |
52 | 51 | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index 2b72b86176f0..e201ec6e9905 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
@@ -50,10 +50,9 @@ struct ip_nat_multi_range_compat | |||
50 | 50 | ||
51 | #ifdef __KERNEL__ | 51 | #ifdef __KERNEL__ |
52 | #include <linux/list.h> | 52 | #include <linux/list.h> |
53 | #include <linux/netfilter_ipv4/lockhelp.h> | ||
54 | 53 | ||
55 | /* Protects NAT hash tables, and NAT-private part of conntracks. */ | 54 | /* Protects NAT hash tables, and NAT-private part of conntracks. */ |
56 | DECLARE_RWLOCK_EXTERN(ip_nat_lock); | 55 | extern rwlock_t ip_nat_lock; |
57 | 56 | ||
58 | /* The structure embedded in the conntrack structure. */ | 57 | /* The structure embedded in the conntrack structure. */ |
59 | struct ip_nat_info | 58 | struct ip_nat_info |
diff --git a/include/linux/netfilter_ipv4/listhelp.h b/include/linux/netfilter_ipv4/listhelp.h index f2ae7c5e57bb..360429f48737 100644 --- a/include/linux/netfilter_ipv4/listhelp.h +++ b/include/linux/netfilter_ipv4/listhelp.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _LISTHELP_H | 2 | #define _LISTHELP_H |
3 | #include <linux/config.h> | 3 | #include <linux/config.h> |
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/netfilter_ipv4/lockhelp.h> | ||
6 | 5 | ||
7 | /* Header to do more comprehensive job than linux/list.h; assume list | 6 | /* Header to do more comprehensive job than linux/list.h; assume list |
8 | is first entry in structure. */ | 7 | is first entry in structure. */ |
diff --git a/include/linux/netfilter_ipv4/lockhelp.h b/include/linux/netfilter_ipv4/lockhelp.h deleted file mode 100644 index a3288633ab46..000000000000 --- a/include/linux/netfilter_ipv4/lockhelp.h +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | #ifndef _LOCKHELP_H | ||
2 | #define _LOCKHELP_H | ||
3 | #include <linux/config.h> | ||
4 | |||
5 | #include <linux/spinlock.h> | ||
6 | #include <asm/atomic.h> | ||
7 | #include <linux/interrupt.h> | ||
8 | #include <linux/smp.h> | ||
9 | |||
10 | /* Header to do help in lock debugging. */ | ||
11 | |||
12 | #ifdef CONFIG_NETFILTER_DEBUG | ||
13 | struct spinlock_debug | ||
14 | { | ||
15 | spinlock_t l; | ||
16 | atomic_t locked_by; | ||
17 | }; | ||
18 | |||
19 | struct rwlock_debug | ||
20 | { | ||
21 | rwlock_t l; | ||
22 | long read_locked_map; | ||
23 | long write_locked_map; | ||
24 | }; | ||
25 | |||
26 | #define DECLARE_LOCK(l) \ | ||
27 | struct spinlock_debug l = { SPIN_LOCK_UNLOCKED, ATOMIC_INIT(-1) } | ||
28 | #define DECLARE_LOCK_EXTERN(l) \ | ||
29 | extern struct spinlock_debug l | ||
30 | #define DECLARE_RWLOCK(l) \ | ||
31 | struct rwlock_debug l = { RW_LOCK_UNLOCKED, 0, 0 } | ||
32 | #define DECLARE_RWLOCK_EXTERN(l) \ | ||
33 | extern struct rwlock_debug l | ||
34 | |||
35 | #define MUST_BE_LOCKED(l) \ | ||
36 | do { if (atomic_read(&(l)->locked_by) != smp_processor_id()) \ | ||
37 | printk("ASSERT %s:%u %s unlocked\n", __FILE__, __LINE__, #l); \ | ||
38 | } while(0) | ||
39 | |||
40 | #define MUST_BE_UNLOCKED(l) \ | ||
41 | do { if (atomic_read(&(l)->locked_by) == smp_processor_id()) \ | ||
42 | printk("ASSERT %s:%u %s locked\n", __FILE__, __LINE__, #l); \ | ||
43 | } while(0) | ||
44 | |||
45 | /* Write locked OK as well. */ | ||
46 | #define MUST_BE_READ_LOCKED(l) \ | ||
47 | do { if (!((l)->read_locked_map & (1UL << smp_processor_id())) \ | ||
48 | && !((l)->write_locked_map & (1UL << smp_processor_id()))) \ | ||
49 | printk("ASSERT %s:%u %s not readlocked\n", __FILE__, __LINE__, #l); \ | ||
50 | } while(0) | ||
51 | |||
52 | #define MUST_BE_WRITE_LOCKED(l) \ | ||
53 | do { if (!((l)->write_locked_map & (1UL << smp_processor_id()))) \ | ||
54 | printk("ASSERT %s:%u %s not writelocked\n", __FILE__, __LINE__, #l); \ | ||
55 | } while(0) | ||
56 | |||
57 | #define MUST_BE_READ_WRITE_UNLOCKED(l) \ | ||
58 | do { if ((l)->read_locked_map & (1UL << smp_processor_id())) \ | ||
59 | printk("ASSERT %s:%u %s readlocked\n", __FILE__, __LINE__, #l); \ | ||
60 | else if ((l)->write_locked_map & (1UL << smp_processor_id())) \ | ||
61 | printk("ASSERT %s:%u %s writelocked\n", __FILE__, __LINE__, #l); \ | ||
62 | } while(0) | ||
63 | |||
64 | #define LOCK_BH(lk) \ | ||
65 | do { \ | ||
66 | MUST_BE_UNLOCKED(lk); \ | ||
67 | spin_lock_bh(&(lk)->l); \ | ||
68 | atomic_set(&(lk)->locked_by, smp_processor_id()); \ | ||
69 | } while(0) | ||
70 | |||
71 | #define UNLOCK_BH(lk) \ | ||
72 | do { \ | ||
73 | MUST_BE_LOCKED(lk); \ | ||
74 | atomic_set(&(lk)->locked_by, -1); \ | ||
75 | spin_unlock_bh(&(lk)->l); \ | ||
76 | } while(0) | ||
77 | |||
78 | #define READ_LOCK(lk) \ | ||
79 | do { \ | ||
80 | MUST_BE_READ_WRITE_UNLOCKED(lk); \ | ||
81 | read_lock_bh(&(lk)->l); \ | ||
82 | set_bit(smp_processor_id(), &(lk)->read_locked_map); \ | ||
83 | } while(0) | ||
84 | |||
85 | #define WRITE_LOCK(lk) \ | ||
86 | do { \ | ||
87 | MUST_BE_READ_WRITE_UNLOCKED(lk); \ | ||
88 | write_lock_bh(&(lk)->l); \ | ||
89 | set_bit(smp_processor_id(), &(lk)->write_locked_map); \ | ||
90 | } while(0) | ||
91 | |||
92 | #define READ_UNLOCK(lk) \ | ||
93 | do { \ | ||
94 | if (!((lk)->read_locked_map & (1UL << smp_processor_id()))) \ | ||
95 | printk("ASSERT: %s:%u %s not readlocked\n", \ | ||
96 | __FILE__, __LINE__, #lk); \ | ||
97 | clear_bit(smp_processor_id(), &(lk)->read_locked_map); \ | ||
98 | read_unlock_bh(&(lk)->l); \ | ||
99 | } while(0) | ||
100 | |||
101 | #define WRITE_UNLOCK(lk) \ | ||
102 | do { \ | ||
103 | MUST_BE_WRITE_LOCKED(lk); \ | ||
104 | clear_bit(smp_processor_id(), &(lk)->write_locked_map); \ | ||
105 | write_unlock_bh(&(lk)->l); \ | ||
106 | } while(0) | ||
107 | |||
108 | #else | ||
109 | #define DECLARE_LOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED | ||
110 | #define DECLARE_LOCK_EXTERN(l) extern spinlock_t l | ||
111 | #define DECLARE_RWLOCK(l) rwlock_t l = RW_LOCK_UNLOCKED | ||
112 | #define DECLARE_RWLOCK_EXTERN(l) extern rwlock_t l | ||
113 | |||
114 | #define MUST_BE_LOCKED(l) | ||
115 | #define MUST_BE_UNLOCKED(l) | ||
116 | #define MUST_BE_READ_LOCKED(l) | ||
117 | #define MUST_BE_WRITE_LOCKED(l) | ||
118 | #define MUST_BE_READ_WRITE_UNLOCKED(l) | ||
119 | |||
120 | #define LOCK_BH(l) spin_lock_bh(l) | ||
121 | #define UNLOCK_BH(l) spin_unlock_bh(l) | ||
122 | |||
123 | #define READ_LOCK(l) read_lock_bh(l) | ||
124 | #define WRITE_LOCK(l) write_lock_bh(l) | ||
125 | #define READ_UNLOCK(l) read_unlock_bh(l) | ||
126 | #define WRITE_UNLOCK(l) write_unlock_bh(l) | ||
127 | #endif /*CONFIG_NETFILTER_DEBUG*/ | ||
128 | |||
129 | #endif /* _LOCKHELP_H */ | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 561d4dc75836..3029cad63a01 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -147,7 +147,7 @@ struct netlink_callback | |||
147 | int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); | 147 | int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); |
148 | int (*done)(struct netlink_callback *cb); | 148 | int (*done)(struct netlink_callback *cb); |
149 | int family; | 149 | int family; |
150 | long args[4]; | 150 | long args[5]; |
151 | }; | 151 | }; |
152 | 152 | ||
153 | struct netlink_notify | 153 | struct netlink_notify |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 39ab8c6b5652..f5a6695d4d21 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -61,21 +61,20 @@ | |||
61 | #define PG_active 6 | 61 | #define PG_active 6 |
62 | #define PG_slab 7 /* slab debug (Suparna wants this) */ | 62 | #define PG_slab 7 /* slab debug (Suparna wants this) */ |
63 | 63 | ||
64 | #define PG_highmem 8 | 64 | #define PG_checked 8 /* kill me in 2.5.<early>. */ |
65 | #define PG_checked 9 /* kill me in 2.5.<early>. */ | 65 | #define PG_arch_1 9 |
66 | #define PG_arch_1 10 | 66 | #define PG_reserved 10 |
67 | #define PG_reserved 11 | 67 | #define PG_private 11 /* Has something at ->private */ |
68 | 68 | ||
69 | #define PG_private 12 /* Has something at ->private */ | 69 | #define PG_writeback 12 /* Page is under writeback */ |
70 | #define PG_writeback 13 /* Page is under writeback */ | 70 | #define PG_nosave 13 /* Used for system suspend/resume */ |
71 | #define PG_nosave 14 /* Used for system suspend/resume */ | 71 | #define PG_compound 14 /* Part of a compound page */ |
72 | #define PG_compound 15 /* Part of a compound page */ | 72 | #define PG_swapcache 15 /* Swap page: swp_entry_t in private */ |
73 | 73 | ||
74 | #define PG_swapcache 16 /* Swap page: swp_entry_t in private */ | 74 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ |
75 | #define PG_mappedtodisk 17 /* Has blocks allocated on-disk */ | 75 | #define PG_reclaim 17 /* To be reclaimed asap */ |
76 | #define PG_reclaim 18 /* To be reclaimed asap */ | 76 | #define PG_nosave_free 18 /* Free, should not be written */ |
77 | #define PG_nosave_free 19 /* Free, should not be written */ | 77 | #define PG_uncached 19 /* Page has been mapped as uncached */ |
78 | #define PG_uncached 20 /* Page has been mapped as uncached */ | ||
79 | 78 | ||
80 | /* | 79 | /* |
81 | * Global page accounting. One instance per CPU. Only unsigned longs are | 80 | * Global page accounting. One instance per CPU. Only unsigned longs are |
@@ -136,8 +135,8 @@ struct page_state { | |||
136 | 135 | ||
137 | extern void get_page_state(struct page_state *ret); | 136 | extern void get_page_state(struct page_state *ret); |
138 | extern void get_full_page_state(struct page_state *ret); | 137 | extern void get_full_page_state(struct page_state *ret); |
139 | extern unsigned long __read_page_state(unsigned offset); | 138 | extern unsigned long __read_page_state(unsigned long offset); |
140 | extern void __mod_page_state(unsigned offset, unsigned long delta); | 139 | extern void __mod_page_state(unsigned long offset, unsigned long delta); |
141 | 140 | ||
142 | #define read_page_state(member) \ | 141 | #define read_page_state(member) \ |
143 | __read_page_state(offsetof(struct page_state, member)) | 142 | __read_page_state(offsetof(struct page_state, member)) |
@@ -215,7 +214,7 @@ extern void __mod_page_state(unsigned offset, unsigned long delta); | |||
215 | #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) | 214 | #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) |
216 | 215 | ||
217 | #ifdef CONFIG_HIGHMEM | 216 | #ifdef CONFIG_HIGHMEM |
218 | #define PageHighMem(page) test_bit(PG_highmem, &(page)->flags) | 217 | #define PageHighMem(page) is_highmem(page_zone(page)) |
219 | #else | 218 | #else |
220 | #define PageHighMem(page) 0 /* needed to optimize away at compile time */ | 219 | #define PageHighMem(page) 0 /* needed to optimize away at compile time */ |
221 | #endif | 220 | #endif |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0422031161ba..d9a25647a295 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -52,12 +52,12 @@ void release_pages(struct page **pages, int nr, int cold); | |||
52 | 52 | ||
53 | static inline struct page *page_cache_alloc(struct address_space *x) | 53 | static inline struct page *page_cache_alloc(struct address_space *x) |
54 | { | 54 | { |
55 | return alloc_pages(mapping_gfp_mask(x), 0); | 55 | return alloc_pages(mapping_gfp_mask(x)|__GFP_NORECLAIM, 0); |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline struct page *page_cache_alloc_cold(struct address_space *x) | 58 | static inline struct page *page_cache_alloc_cold(struct address_space *x) |
59 | { | 59 | { |
60 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); | 60 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD|__GFP_NORECLAIM, 0); |
61 | } | 61 | } |
62 | 62 | ||
63 | typedef int filler_t(void *, struct page *); | 63 | typedef int filler_t(void *, struct page *); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b8b4ebf9abf1..63e89e47b8e9 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -575,6 +575,7 @@ | |||
575 | #define PCI_DEVICE_ID_CT_65550 0x00e0 | 575 | #define PCI_DEVICE_ID_CT_65550 0x00e0 |
576 | #define PCI_DEVICE_ID_CT_65554 0x00e4 | 576 | #define PCI_DEVICE_ID_CT_65554 0x00e4 |
577 | #define PCI_DEVICE_ID_CT_65555 0x00e5 | 577 | #define PCI_DEVICE_ID_CT_65555 0x00e5 |
578 | #define PCI_DEVICE_ID_CT_69000 0x00c0 | ||
578 | 579 | ||
579 | #define PCI_VENDOR_ID_MIRO 0x1031 | 580 | #define PCI_VENDOR_ID_MIRO 0x1031 |
580 | #define PCI_DEVICE_ID_MIRO_36050 0x5601 | 581 | #define PCI_DEVICE_ID_MIRO_36050 0x5601 |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h new file mode 100644 index 000000000000..e24b74b11150 --- /dev/null +++ b/include/linux/raid/bitmap.h | |||
@@ -0,0 +1,273 @@ | |||
1 | /* | ||
2 | * bitmap.h: Copyright (C) Peter T. Breuer (ptb@ot.uc3m.es) 2003 | ||
3 | * | ||
4 | * additions: Copyright (C) 2003-2004, Paul Clements, SteelEye Technology, Inc. | ||
5 | */ | ||
6 | #ifndef BITMAP_H | ||
7 | #define BITMAP_H 1 | ||
8 | |||
9 | #define BITMAP_MAJOR 3 | ||
10 | #define BITMAP_MINOR 38 | ||
11 | |||
12 | /* | ||
13 | * in-memory bitmap: | ||
14 | * | ||
15 | * Use 16 bit block counters to track pending writes to each "chunk". | ||
16 | * The 2 high order bits are special-purpose, the first is a flag indicating | ||
17 | * whether a resync is needed. The second is a flag indicating whether a | ||
18 | * resync is active. | ||
19 | * This means that the counter is actually 14 bits: | ||
20 | * | ||
21 | * +--------+--------+------------------------------------------------+ | ||
22 | * | resync | resync | counter | | ||
23 | * | needed | active | | | ||
24 | * | (0-1) | (0-1) | (0-16383) | | ||
25 | * +--------+--------+------------------------------------------------+ | ||
26 | * | ||
27 | * The "resync needed" bit is set when: | ||
28 | * a '1' bit is read from storage at startup. | ||
29 | * a write request fails on some drives | ||
30 | * a resync is aborted on a chunk with 'resync active' set | ||
31 | * It is cleared (and resync-active set) when a resync starts across all drives | ||
32 | * of the chunk. | ||
33 | * | ||
34 | * | ||
35 | * The "resync active" bit is set when: | ||
36 | * a resync is started on all drives, and resync_needed is set. | ||
37 | * resync_needed will be cleared (as long as resync_active wasn't already set). | ||
38 | * It is cleared when a resync completes. | ||
39 | * | ||
40 | * The counter counts pending write requests, plus the on-disk bit. | ||
41 | * When the counter is '1' and the resync bits are clear, the on-disk | ||
42 | * bit can be cleared aswell, thus setting the counter to 0. | ||
43 | * When we set a bit, or in the counter (to start a write), if the fields is | ||
44 | * 0, we first set the disk bit and set the counter to 1. | ||
45 | * | ||
46 | * If the counter is 0, the on-disk bit is clear and the stipe is clean | ||
47 | * Anything that dirties the stipe pushes the counter to 2 (at least) | ||
48 | * and sets the on-disk bit (lazily). | ||
49 | * If a periodic sweep find the counter at 2, it is decremented to 1. | ||
50 | * If the sweep find the counter at 1, the on-disk bit is cleared and the | ||
51 | * counter goes to zero. | ||
52 | * | ||
53 | * Also, we'll hijack the "map" pointer itself and use it as two 16 bit block | ||
54 | * counters as a fallback when "page" memory cannot be allocated: | ||
55 | * | ||
56 | * Normal case (page memory allocated): | ||
57 | * | ||
58 | * page pointer (32-bit) | ||
59 | * | ||
60 | * [ ] ------+ | ||
61 | * | | ||
62 | * +-------> [ ][ ]..[ ] (4096 byte page == 2048 counters) | ||
63 | * c1 c2 c2048 | ||
64 | * | ||
65 | * Hijacked case (page memory allocation failed): | ||
66 | * | ||
67 | * hijacked page pointer (32-bit) | ||
68 | * | ||
69 | * [ ][ ] (no page memory allocated) | ||
70 | * counter #1 (16-bit) counter #2 (16-bit) | ||
71 | * | ||
72 | */ | ||
73 | |||
74 | #ifdef __KERNEL__ | ||
75 | |||
76 | #define PAGE_BITS (PAGE_SIZE << 3) | ||
77 | #define PAGE_BIT_SHIFT (PAGE_SHIFT + 3) | ||
78 | |||
79 | typedef __u16 bitmap_counter_t; | ||
80 | #define COUNTER_BITS 16 | ||
81 | #define COUNTER_BIT_SHIFT 4 | ||
82 | #define COUNTER_BYTE_RATIO (COUNTER_BITS / 8) | ||
83 | #define COUNTER_BYTE_SHIFT (COUNTER_BIT_SHIFT - 3) | ||
84 | |||
85 | #define NEEDED_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 1))) | ||
86 | #define RESYNC_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 2))) | ||
87 | #define COUNTER_MAX ((bitmap_counter_t) RESYNC_MASK - 1) | ||
88 | #define NEEDED(x) (((bitmap_counter_t) x) & NEEDED_MASK) | ||
89 | #define RESYNC(x) (((bitmap_counter_t) x) & RESYNC_MASK) | ||
90 | #define COUNTER(x) (((bitmap_counter_t) x) & COUNTER_MAX) | ||
91 | |||
92 | /* how many counters per page? */ | ||
93 | #define PAGE_COUNTER_RATIO (PAGE_BITS / COUNTER_BITS) | ||
94 | /* same, except a shift value for more efficient bitops */ | ||
95 | #define PAGE_COUNTER_SHIFT (PAGE_BIT_SHIFT - COUNTER_BIT_SHIFT) | ||
96 | /* same, except a mask value for more efficient bitops */ | ||
97 | #define PAGE_COUNTER_MASK (PAGE_COUNTER_RATIO - 1) | ||
98 | |||
99 | #define BITMAP_BLOCK_SIZE 512 | ||
100 | #define BITMAP_BLOCK_SHIFT 9 | ||
101 | |||
102 | /* how many blocks per chunk? (this is variable) */ | ||
103 | #define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->chunksize >> BITMAP_BLOCK_SHIFT) | ||
104 | #define CHUNK_BLOCK_SHIFT(bitmap) ((bitmap)->chunkshift - BITMAP_BLOCK_SHIFT) | ||
105 | #define CHUNK_BLOCK_MASK(bitmap) (CHUNK_BLOCK_RATIO(bitmap) - 1) | ||
106 | |||
107 | /* when hijacked, the counters and bits represent even larger "chunks" */ | ||
108 | /* there will be 1024 chunks represented by each counter in the page pointers */ | ||
109 | #define PAGEPTR_BLOCK_RATIO(bitmap) \ | ||
110 | (CHUNK_BLOCK_RATIO(bitmap) << PAGE_COUNTER_SHIFT >> 1) | ||
111 | #define PAGEPTR_BLOCK_SHIFT(bitmap) \ | ||
112 | (CHUNK_BLOCK_SHIFT(bitmap) + PAGE_COUNTER_SHIFT - 1) | ||
113 | #define PAGEPTR_BLOCK_MASK(bitmap) (PAGEPTR_BLOCK_RATIO(bitmap) - 1) | ||
114 | |||
115 | /* | ||
116 | * on-disk bitmap: | ||
117 | * | ||
118 | * Use one bit per "chunk" (block set). We do the disk I/O on the bitmap | ||
119 | * file a page at a time. There's a superblock at the start of the file. | ||
120 | */ | ||
121 | |||
122 | /* map chunks (bits) to file pages - offset by the size of the superblock */ | ||
123 | #define CHUNK_BIT_OFFSET(chunk) ((chunk) + (sizeof(bitmap_super_t) << 3)) | ||
124 | |||
125 | #endif | ||
126 | |||
127 | /* | ||
128 | * bitmap structures: | ||
129 | */ | ||
130 | |||
131 | #define BITMAP_MAGIC 0x6d746962 | ||
132 | |||
133 | /* use these for bitmap->flags and bitmap->sb->state bit-fields */ | ||
134 | enum bitmap_state { | ||
135 | BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ | ||
136 | BITMAP_STALE = 0x002 /* the bitmap file is out of date or had -EIO */ | ||
137 | }; | ||
138 | |||
139 | /* the superblock at the front of the bitmap file -- little endian */ | ||
140 | typedef struct bitmap_super_s { | ||
141 | __u32 magic; /* 0 BITMAP_MAGIC */ | ||
142 | __u32 version; /* 4 the bitmap major for now, could change... */ | ||
143 | __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */ | ||
144 | __u64 events; /* 24 event counter for the bitmap (1)*/ | ||
145 | __u64 events_cleared;/*32 event counter when last bit cleared (2) */ | ||
146 | __u64 sync_size; /* 40 the size of the md device's sync range(3) */ | ||
147 | __u32 state; /* 48 bitmap state information */ | ||
148 | __u32 chunksize; /* 52 the bitmap chunk size in bytes */ | ||
149 | __u32 daemon_sleep; /* 56 seconds between disk flushes */ | ||
150 | |||
151 | __u8 pad[256 - 60]; /* set to zero */ | ||
152 | } bitmap_super_t; | ||
153 | |||
154 | /* notes: | ||
155 | * (1) This event counter is updated before the eventcounter in the md superblock | ||
156 | * When a bitmap is loaded, it is only accepted if this event counter is equal | ||
157 | * to, or one greater than, the event counter in the superblock. | ||
158 | * (2) This event counter is updated when the other one is *if*and*only*if* the | ||
159 | * array is not degraded. As bits are not cleared when the array is degraded, | ||
160 | * this represents the last time that any bits were cleared. | ||
161 | * If a device is being added that has an event count with this value or | ||
162 | * higher, it is accepted as conforming to the bitmap. | ||
163 | * (3)This is the number of sectors represented by the bitmap, and is the range that | ||
164 | * resync happens across. For raid1 and raid5/6 it is the size of individual | ||
165 | * devices. For raid10 it is the size of the array. | ||
166 | */ | ||
167 | |||
168 | #ifdef __KERNEL__ | ||
169 | |||
170 | /* the in-memory bitmap is represented by bitmap_pages */ | ||
171 | struct bitmap_page { | ||
172 | /* | ||
173 | * map points to the actual memory page | ||
174 | */ | ||
175 | char *map; | ||
176 | /* | ||
177 | * in emergencies (when map cannot be alloced), hijack the map | ||
178 | * pointer and use it as two counters itself | ||
179 | */ | ||
180 | unsigned int hijacked:1; | ||
181 | /* | ||
182 | * count of dirty bits on the page | ||
183 | */ | ||
184 | unsigned int count:31; | ||
185 | }; | ||
186 | |||
187 | /* keep track of bitmap file pages that have pending writes on them */ | ||
188 | struct page_list { | ||
189 | struct list_head list; | ||
190 | struct page *page; | ||
191 | }; | ||
192 | |||
193 | /* the main bitmap structure - one per mddev */ | ||
194 | struct bitmap { | ||
195 | struct bitmap_page *bp; | ||
196 | unsigned long pages; /* total number of pages in the bitmap */ | ||
197 | unsigned long missing_pages; /* number of pages not yet allocated */ | ||
198 | |||
199 | mddev_t *mddev; /* the md device that the bitmap is for */ | ||
200 | |||
201 | int counter_bits; /* how many bits per block counter */ | ||
202 | |||
203 | /* bitmap chunksize -- how much data does each bit represent? */ | ||
204 | unsigned long chunksize; | ||
205 | unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */ | ||
206 | unsigned long chunks; /* total number of data chunks for the array */ | ||
207 | |||
208 | /* We hold a count on the chunk currently being synced, and drop | ||
209 | * it when the last block is started. If the resync is aborted | ||
210 | * midway, we need to be able to drop that count, so we remember | ||
211 | * the counted chunk.. | ||
212 | */ | ||
213 | unsigned long syncchunk; | ||
214 | |||
215 | __u64 events_cleared; | ||
216 | |||
217 | /* bitmap spinlock */ | ||
218 | spinlock_t lock; | ||
219 | |||
220 | long offset; /* offset from superblock if file is NULL */ | ||
221 | struct file *file; /* backing disk file */ | ||
222 | struct page *sb_page; /* cached copy of the bitmap file superblock */ | ||
223 | struct page **filemap; /* list of cache pages for the file */ | ||
224 | unsigned long *filemap_attr; /* attributes associated w/ filemap pages */ | ||
225 | unsigned long file_pages; /* number of pages in the file */ | ||
226 | |||
227 | unsigned long flags; | ||
228 | |||
229 | /* | ||
230 | * the bitmap daemon - periodically wakes up and sweeps the bitmap | ||
231 | * file, cleaning up bits and flushing out pages to disk as necessary | ||
232 | */ | ||
233 | unsigned long daemon_lastrun; /* jiffies of last run */ | ||
234 | unsigned long daemon_sleep; /* how many seconds between updates? */ | ||
235 | |||
236 | /* | ||
237 | * bitmap_writeback_daemon waits for file-pages that have been written, | ||
238 | * as there is no way to get a call-back when a page write completes. | ||
239 | */ | ||
240 | mdk_thread_t *writeback_daemon; | ||
241 | spinlock_t write_lock; | ||
242 | wait_queue_head_t write_wait; | ||
243 | struct list_head complete_pages; | ||
244 | mempool_t *write_pool; | ||
245 | }; | ||
246 | |||
247 | /* the bitmap API */ | ||
248 | |||
249 | /* these are used only by md/bitmap */ | ||
250 | int bitmap_create(mddev_t *mddev); | ||
251 | void bitmap_destroy(mddev_t *mddev); | ||
252 | int bitmap_active(struct bitmap *bitmap); | ||
253 | |||
254 | char *file_path(struct file *file, char *buf, int count); | ||
255 | void bitmap_print_sb(struct bitmap *bitmap); | ||
256 | int bitmap_update_sb(struct bitmap *bitmap); | ||
257 | |||
258 | int bitmap_setallbits(struct bitmap *bitmap); | ||
259 | void bitmap_write_all(struct bitmap *bitmap); | ||
260 | |||
261 | /* these are exported */ | ||
262 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); | ||
263 | void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, | ||
264 | int success); | ||
265 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks); | ||
266 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); | ||
267 | void bitmap_close_sync(struct bitmap *bitmap); | ||
268 | |||
269 | int bitmap_unplug(struct bitmap *bitmap); | ||
270 | int bitmap_daemon_work(struct bitmap *bitmap); | ||
271 | #endif | ||
272 | |||
273 | #endif | ||
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index a6a67d102bfa..ffa316ce4dc8 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -60,7 +60,14 @@ | |||
60 | */ | 60 | */ |
61 | #define MD_MAJOR_VERSION 0 | 61 | #define MD_MAJOR_VERSION 0 |
62 | #define MD_MINOR_VERSION 90 | 62 | #define MD_MINOR_VERSION 90 |
63 | #define MD_PATCHLEVEL_VERSION 1 | 63 | /* |
64 | * MD_PATCHLEVEL_VERSION indicates kernel functionality. | ||
65 | * >=1 means different superblock formats are selectable using SET_ARRAY_INFO | ||
66 | * and major_version/minor_version accordingly | ||
67 | * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT | ||
68 | * in the super status byte | ||
69 | */ | ||
70 | #define MD_PATCHLEVEL_VERSION 2 | ||
64 | 71 | ||
65 | extern int register_md_personality (int p_num, mdk_personality_t *p); | 72 | extern int register_md_personality (int p_num, mdk_personality_t *p); |
66 | extern int unregister_md_personality (int p_num); | 73 | extern int unregister_md_personality (int p_num); |
@@ -69,7 +76,7 @@ extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev), | |||
69 | extern void md_unregister_thread (mdk_thread_t *thread); | 76 | extern void md_unregister_thread (mdk_thread_t *thread); |
70 | extern void md_wakeup_thread(mdk_thread_t *thread); | 77 | extern void md_wakeup_thread(mdk_thread_t *thread); |
71 | extern void md_check_recovery(mddev_t *mddev); | 78 | extern void md_check_recovery(mddev_t *mddev); |
72 | extern void md_write_start(mddev_t *mddev); | 79 | extern void md_write_start(mddev_t *mddev, struct bio *bi); |
73 | extern void md_write_end(mddev_t *mddev); | 80 | extern void md_write_end(mddev_t *mddev); |
74 | extern void md_handle_safemode(mddev_t *mddev); | 81 | extern void md_handle_safemode(mddev_t *mddev); |
75 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); | 82 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); |
@@ -78,6 +85,12 @@ extern void md_unplug_mddev(mddev_t *mddev); | |||
78 | 85 | ||
79 | extern void md_print_devices (void); | 86 | extern void md_print_devices (void); |
80 | 87 | ||
88 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | ||
89 | sector_t sector, int size, struct page *page); | ||
90 | extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, | ||
91 | struct page *page, int rw); | ||
92 | |||
93 | |||
81 | #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } | 94 | #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } |
82 | 95 | ||
83 | #endif | 96 | #endif |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index c9a0d4013be7..8c14ba565a45 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -15,6 +15,9 @@ | |||
15 | #ifndef _MD_K_H | 15 | #ifndef _MD_K_H |
16 | #define _MD_K_H | 16 | #define _MD_K_H |
17 | 17 | ||
18 | /* and dm-bio-list.h is not under include/linux because.... ??? */ | ||
19 | #include "../../../drivers/md/dm-bio-list.h" | ||
20 | |||
18 | #define MD_RESERVED 0UL | 21 | #define MD_RESERVED 0UL |
19 | #define LINEAR 1UL | 22 | #define LINEAR 1UL |
20 | #define RAID0 2UL | 23 | #define RAID0 2UL |
@@ -180,6 +183,10 @@ struct mdk_rdev_s | |||
180 | 183 | ||
181 | int desc_nr; /* descriptor index in the superblock */ | 184 | int desc_nr; /* descriptor index in the superblock */ |
182 | int raid_disk; /* role of device in array */ | 185 | int raid_disk; /* role of device in array */ |
186 | int saved_raid_disk; /* role that device used to have in the | ||
187 | * array and could again if we did a partial | ||
188 | * resync from the bitmap | ||
189 | */ | ||
183 | 190 | ||
184 | atomic_t nr_pending; /* number of pending requests. | 191 | atomic_t nr_pending; /* number of pending requests. |
185 | * only maintained for arrays that | 192 | * only maintained for arrays that |
@@ -252,6 +259,11 @@ struct mddev_s | |||
252 | atomic_t recovery_active; /* blocks scheduled, but not written */ | 259 | atomic_t recovery_active; /* blocks scheduled, but not written */ |
253 | wait_queue_head_t recovery_wait; | 260 | wait_queue_head_t recovery_wait; |
254 | sector_t recovery_cp; | 261 | sector_t recovery_cp; |
262 | |||
263 | spinlock_t write_lock; | ||
264 | wait_queue_head_t sb_wait; /* for waiting on superblock updates */ | ||
265 | atomic_t pending_writes; /* number of active superblock writes */ | ||
266 | |||
255 | unsigned int safemode; /* if set, update "clean" superblock | 267 | unsigned int safemode; /* if set, update "clean" superblock |
256 | * when no writes pending. | 268 | * when no writes pending. |
257 | */ | 269 | */ |
@@ -260,6 +272,13 @@ struct mddev_s | |||
260 | atomic_t writes_pending; | 272 | atomic_t writes_pending; |
261 | request_queue_t *queue; /* for plugging ... */ | 273 | request_queue_t *queue; /* for plugging ... */ |
262 | 274 | ||
275 | struct bitmap *bitmap; /* the bitmap for the device */ | ||
276 | struct file *bitmap_file; /* the bitmap file */ | ||
277 | long bitmap_offset; /* offset from superblock of | ||
278 | * start of bitmap. May be | ||
279 | * negative, but not '0' | ||
280 | */ | ||
281 | |||
263 | struct list_head all_mddevs; | 282 | struct list_head all_mddevs; |
264 | }; | 283 | }; |
265 | 284 | ||
@@ -291,7 +310,7 @@ struct mdk_personality_s | |||
291 | int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); | 310 | int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); |
292 | int (*hot_remove_disk) (mddev_t *mddev, int number); | 311 | int (*hot_remove_disk) (mddev_t *mddev, int number); |
293 | int (*spare_active) (mddev_t *mddev); | 312 | int (*spare_active) (mddev_t *mddev); |
294 | int (*sync_request)(mddev_t *mddev, sector_t sector_nr, int go_faster); | 313 | sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); |
295 | int (*resize) (mddev_t *mddev, sector_t sectors); | 314 | int (*resize) (mddev_t *mddev, sector_t sectors); |
296 | int (*reshape) (mddev_t *mddev, int raid_disks); | 315 | int (*reshape) (mddev_t *mddev, int raid_disks); |
297 | int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); | 316 | int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); |
@@ -334,6 +353,7 @@ typedef struct mdk_thread_s { | |||
334 | unsigned long flags; | 353 | unsigned long flags; |
335 | struct completion *event; | 354 | struct completion *event; |
336 | struct task_struct *tsk; | 355 | struct task_struct *tsk; |
356 | unsigned long timeout; | ||
337 | const char *name; | 357 | const char *name; |
338 | } mdk_thread_t; | 358 | } mdk_thread_t; |
339 | 359 | ||
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 8ba95d67329f..dc65cd435494 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -96,6 +96,7 @@ typedef struct mdp_device_descriptor_s { | |||
96 | #define MD_SB_CLEAN 0 | 96 | #define MD_SB_CLEAN 0 |
97 | #define MD_SB_ERRORS 1 | 97 | #define MD_SB_ERRORS 1 |
98 | 98 | ||
99 | #define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */ | ||
99 | typedef struct mdp_superblock_s { | 100 | typedef struct mdp_superblock_s { |
100 | /* | 101 | /* |
101 | * Constant generic information | 102 | * Constant generic information |
@@ -184,7 +185,7 @@ struct mdp_superblock_1 { | |||
184 | /* constant array information - 128 bytes */ | 185 | /* constant array information - 128 bytes */ |
185 | __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ | 186 | __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ |
186 | __u32 major_version; /* 1 */ | 187 | __u32 major_version; /* 1 */ |
187 | __u32 feature_map; /* 0 for now */ | 188 | __u32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */ |
188 | __u32 pad0; /* always set to 0 when writing */ | 189 | __u32 pad0; /* always set to 0 when writing */ |
189 | 190 | ||
190 | __u8 set_uuid[16]; /* user-space generated. */ | 191 | __u8 set_uuid[16]; /* user-space generated. */ |
@@ -197,7 +198,11 @@ struct mdp_superblock_1 { | |||
197 | 198 | ||
198 | __u32 chunksize; /* in 512byte sectors */ | 199 | __u32 chunksize; /* in 512byte sectors */ |
199 | __u32 raid_disks; | 200 | __u32 raid_disks; |
200 | __u8 pad1[128-96]; /* set to 0 when written */ | 201 | __u32 bitmap_offset; /* sectors after start of superblock that bitmap starts |
202 | * NOTE: signed, so bitmap can be before superblock | ||
203 | * only meaningful of feature_map[0] is set. | ||
204 | */ | ||
205 | __u8 pad1[128-100]; /* set to 0 when written */ | ||
201 | 206 | ||
202 | /* constant this-device information - 64 bytes */ | 207 | /* constant this-device information - 64 bytes */ |
203 | __u64 data_offset; /* sector start of data, often 0 */ | 208 | __u64 data_offset; /* sector start of data, often 0 */ |
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h index a2df5c2a42af..81da20ccec4d 100644 --- a/include/linux/raid/md_u.h +++ b/include/linux/raid/md_u.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t) | 23 | #define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t) |
24 | #define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) | 24 | #define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) |
25 | #define RAID_AUTORUN _IO (MD_MAJOR, 0x14) | 25 | #define RAID_AUTORUN _IO (MD_MAJOR, 0x14) |
26 | #define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t) | ||
26 | 27 | ||
27 | /* configuration */ | 28 | /* configuration */ |
28 | #define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) | 29 | #define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) |
@@ -36,6 +37,7 @@ | |||
36 | #define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) | 37 | #define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) |
37 | #define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29) | 38 | #define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29) |
38 | #define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a) | 39 | #define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a) |
40 | #define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int) | ||
39 | 41 | ||
40 | /* usage */ | 42 | /* usage */ |
41 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) | 43 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) |
@@ -106,6 +108,11 @@ typedef struct mdu_start_info_s { | |||
106 | 108 | ||
107 | } mdu_start_info_t; | 109 | } mdu_start_info_t; |
108 | 110 | ||
111 | typedef struct mdu_bitmap_file_s | ||
112 | { | ||
113 | char pathname[4096]; | ||
114 | } mdu_bitmap_file_t; | ||
115 | |||
109 | typedef struct mdu_param_s | 116 | typedef struct mdu_param_s |
110 | { | 117 | { |
111 | int personality; /* 1,2,3,4 */ | 118 | int personality; /* 1,2,3,4 */ |
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index abbfdd9afe1e..9d93cf12e890 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h | |||
@@ -36,12 +36,21 @@ struct r1_private_data_s { | |||
36 | spinlock_t device_lock; | 36 | spinlock_t device_lock; |
37 | 37 | ||
38 | struct list_head retry_list; | 38 | struct list_head retry_list; |
39 | /* queue pending writes and submit them on unplug */ | ||
40 | struct bio_list pending_bio_list; | ||
41 | /* queue of writes that have been unplugged */ | ||
42 | struct bio_list flushing_bio_list; | ||
43 | |||
39 | /* for use when syncing mirrors: */ | 44 | /* for use when syncing mirrors: */ |
40 | 45 | ||
41 | spinlock_t resync_lock; | 46 | spinlock_t resync_lock; |
42 | int nr_pending; | 47 | int nr_pending; |
43 | int barrier; | 48 | int barrier; |
44 | sector_t next_resync; | 49 | sector_t next_resync; |
50 | int fullsync; /* set to 1 if a full sync is needed, | ||
51 | * (fresh device added). | ||
52 | * Cleared when a sync completes. | ||
53 | */ | ||
45 | 54 | ||
46 | wait_queue_head_t wait_idle; | 55 | wait_queue_head_t wait_idle; |
47 | wait_queue_head_t wait_resume; | 56 | wait_queue_head_t wait_resume; |
@@ -85,14 +94,17 @@ struct r1bio_s { | |||
85 | int read_disk; | 94 | int read_disk; |
86 | 95 | ||
87 | struct list_head retry_list; | 96 | struct list_head retry_list; |
97 | struct bitmap_update *bitmap_update; | ||
88 | /* | 98 | /* |
89 | * if the IO is in WRITE direction, then multiple bios are used. | 99 | * if the IO is in WRITE direction, then multiple bios are used. |
90 | * We choose the number when they are allocated. | 100 | * We choose the number when they are allocated. |
91 | */ | 101 | */ |
92 | struct bio *bios[0]; | 102 | struct bio *bios[0]; |
103 | /* DO NOT PUT ANY NEW FIELDS HERE - bios array is contiguously alloced*/ | ||
93 | }; | 104 | }; |
94 | 105 | ||
95 | /* bits for r1bio.state */ | 106 | /* bits for r1bio.state */ |
96 | #define R1BIO_Uptodate 0 | 107 | #define R1BIO_Uptodate 0 |
97 | #define R1BIO_IsSync 1 | 108 | #define R1BIO_IsSync 1 |
109 | #define R1BIO_Degraded 2 | ||
98 | #endif | 110 | #endif |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4dbb109022f3..b58afd97a180 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -201,8 +201,8 @@ extern unsigned long | |||
201 | arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | 201 | arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, |
202 | unsigned long len, unsigned long pgoff, | 202 | unsigned long len, unsigned long pgoff, |
203 | unsigned long flags); | 203 | unsigned long flags); |
204 | extern void arch_unmap_area(struct vm_area_struct *area); | 204 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
205 | extern void arch_unmap_area_topdown(struct vm_area_struct *area); | 205 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); |
206 | 206 | ||
207 | #define set_mm_counter(mm, member, value) (mm)->_##member = (value) | 207 | #define set_mm_counter(mm, member, value) (mm)->_##member = (value) |
208 | #define get_mm_counter(mm, member) ((mm)->_##member) | 208 | #define get_mm_counter(mm, member) ((mm)->_##member) |
@@ -218,9 +218,10 @@ struct mm_struct { | |||
218 | unsigned long (*get_unmapped_area) (struct file *filp, | 218 | unsigned long (*get_unmapped_area) (struct file *filp, |
219 | unsigned long addr, unsigned long len, | 219 | unsigned long addr, unsigned long len, |
220 | unsigned long pgoff, unsigned long flags); | 220 | unsigned long pgoff, unsigned long flags); |
221 | void (*unmap_area) (struct vm_area_struct *area); | 221 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); |
222 | unsigned long mmap_base; /* base of mmap area */ | 222 | unsigned long mmap_base; /* base of mmap area */ |
223 | unsigned long free_area_cache; /* first hole */ | 223 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ |
224 | unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */ | ||
224 | pgd_t * pgd; | 225 | pgd_t * pgd; |
225 | atomic_t mm_users; /* How many users with user space? */ | 226 | atomic_t mm_users; /* How many users with user space? */ |
226 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ | 227 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index cc04f5cd2286..d7c839a21842 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -193,7 +193,6 @@ struct skb_shared_info { | |||
193 | * @nfcache: Cache info | 193 | * @nfcache: Cache info |
194 | * @nfct: Associated connection, if any | 194 | * @nfct: Associated connection, if any |
195 | * @nfctinfo: Relationship of this skb to the connection | 195 | * @nfctinfo: Relationship of this skb to the connection |
196 | * @nf_debug: Netfilter debugging | ||
197 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 196 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
198 | * @private: Data which is private to the HIPPI implementation | 197 | * @private: Data which is private to the HIPPI implementation |
199 | * @tc_index: Traffic control index | 198 | * @tc_index: Traffic control index |
@@ -264,9 +263,6 @@ struct sk_buff { | |||
264 | __u32 nfcache; | 263 | __u32 nfcache; |
265 | __u32 nfctinfo; | 264 | __u32 nfctinfo; |
266 | struct nf_conntrack *nfct; | 265 | struct nf_conntrack *nfct; |
267 | #ifdef CONFIG_NETFILTER_DEBUG | ||
268 | unsigned int nf_debug; | ||
269 | #endif | ||
270 | #ifdef CONFIG_BRIDGE_NETFILTER | 266 | #ifdef CONFIG_BRIDGE_NETFILTER |
271 | struct nf_bridge_info *nf_bridge; | 267 | struct nf_bridge_info *nf_bridge; |
272 | #endif | 268 | #endif |
@@ -1219,15 +1215,6 @@ static inline void nf_reset(struct sk_buff *skb) | |||
1219 | { | 1215 | { |
1220 | nf_conntrack_put(skb->nfct); | 1216 | nf_conntrack_put(skb->nfct); |
1221 | skb->nfct = NULL; | 1217 | skb->nfct = NULL; |
1222 | #ifdef CONFIG_NETFILTER_DEBUG | ||
1223 | skb->nf_debug = 0; | ||
1224 | #endif | ||
1225 | } | ||
1226 | static inline void nf_reset_debug(struct sk_buff *skb) | ||
1227 | { | ||
1228 | #ifdef CONFIG_NETFILTER_DEBUG | ||
1229 | skb->nf_debug = 0; | ||
1230 | #endif | ||
1231 | } | 1218 | } |
1232 | 1219 | ||
1233 | #ifdef CONFIG_BRIDGE_NETFILTER | 1220 | #ifdef CONFIG_BRIDGE_NETFILTER |
diff --git a/include/linux/smp.h b/include/linux/smp.h index dcf1db3b35d3..9dfa3ee769ae 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -92,10 +92,7 @@ void smp_prepare_boot_cpu(void); | |||
92 | /* | 92 | /* |
93 | * These macros fold the SMP functionality into a single CPU system | 93 | * These macros fold the SMP functionality into a single CPU system |
94 | */ | 94 | */ |
95 | 95 | #define raw_smp_processor_id() 0 | |
96 | #if !defined(__smp_processor_id) || !defined(CONFIG_PREEMPT) | ||
97 | # define smp_processor_id() 0 | ||
98 | #endif | ||
99 | #define hard_smp_processor_id() 0 | 96 | #define hard_smp_processor_id() 0 |
100 | #define smp_call_function(func,info,retry,wait) ({ 0; }) | 97 | #define smp_call_function(func,info,retry,wait) ({ 0; }) |
101 | #define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) | 98 | #define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) |
@@ -106,30 +103,25 @@ static inline void smp_send_reschedule(int cpu) { } | |||
106 | #endif /* !SMP */ | 103 | #endif /* !SMP */ |
107 | 104 | ||
108 | /* | 105 | /* |
109 | * DEBUG_PREEMPT support: check whether smp_processor_id() is being | 106 | * smp_processor_id(): get the current CPU ID. |
110 | * used in a preemption-safe way. | ||
111 | * | 107 | * |
112 | * An architecture has to enable this debugging code explicitly. | 108 | * if DEBUG_PREEMPT is enabled the we check whether it is |
113 | * It can do so by renaming the smp_processor_id() macro to | 109 | * used in a preemption-safe way. (smp_processor_id() is safe |
114 | * __smp_processor_id(). This should only be done after some minimal | 110 | * if it's used in a preemption-off critical section, or in |
115 | * testing, because usually there are a number of false positives | 111 | * a thread that is bound to the current CPU.) |
116 | * that an architecture will trigger. | ||
117 | * | 112 | * |
118 | * To fix a false positive (i.e. smp_processor_id() use that the | 113 | * NOTE: raw_smp_processor_id() is for internal use only |
119 | * debugging code reports but which use for some reason is legal), | 114 | * (smp_processor_id() is the preferred variant), but in rare |
120 | * change the smp_processor_id() reference to _smp_processor_id(), | 115 | * instances it might also be used to turn off false positives |
121 | * which is the nondebug variant. NOTE: don't use this to hack around | 116 | * (i.e. smp_processor_id() use that the debugging code reports but |
122 | * real bugs. | 117 | * which use for some reason is legal). Don't use this to hack around |
118 | * the warning message, as your code might not work under PREEMPT. | ||
123 | */ | 119 | */ |
124 | #ifdef __smp_processor_id | 120 | #ifdef CONFIG_DEBUG_PREEMPT |
125 | # if defined(CONFIG_PREEMPT) && defined(CONFIG_DEBUG_PREEMPT) | 121 | extern unsigned int debug_smp_processor_id(void); |
126 | extern unsigned int smp_processor_id(void); | 122 | # define smp_processor_id() debug_smp_processor_id() |
127 | # else | ||
128 | # define smp_processor_id() __smp_processor_id() | ||
129 | # endif | ||
130 | # define _smp_processor_id() __smp_processor_id() | ||
131 | #else | 123 | #else |
132 | # define _smp_processor_id() smp_processor_id() | 124 | # define smp_processor_id() raw_smp_processor_id() |
133 | #endif | 125 | #endif |
134 | 126 | ||
135 | #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) | 127 | #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 3bbc41be9bd0..2343f999e6e1 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -172,7 +172,8 @@ extern int rotate_reclaimable_page(struct page *page); | |||
172 | extern void swap_setup(void); | 172 | extern void swap_setup(void); |
173 | 173 | ||
174 | /* linux/mm/vmscan.c */ | 174 | /* linux/mm/vmscan.c */ |
175 | extern int try_to_free_pages(struct zone **, unsigned int, unsigned int); | 175 | extern int try_to_free_pages(struct zone **, unsigned int); |
176 | extern int zone_reclaim(struct zone *, unsigned int, unsigned int); | ||
176 | extern int shrink_all_memory(int); | 177 | extern int shrink_all_memory(int); |
177 | extern int vm_swappiness; | 178 | extern int vm_swappiness; |
178 | 179 | ||