diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ata.h | 7 | ||||
-rw-r--r-- | include/linux/device.h | 3 | ||||
-rw-r--r-- | include/linux/dma-mapping.h | 1 | ||||
-rw-r--r-- | include/linux/hugetlb.h | 45 | ||||
-rw-r--r-- | include/linux/libata.h | 5 | ||||
-rw-r--r-- | include/linux/migrate.h | 36 | ||||
-rw-r--r-- | include/linux/mm.h | 48 | ||||
-rw-r--r-- | include/linux/mm_inline.h | 2 | ||||
-rw-r--r-- | include/linux/msdos_fs.h | 2 | ||||
-rw-r--r-- | include/linux/net.h | 6 | ||||
-rw-r--r-- | include/linux/netfilter/x_tables.h | 64 | ||||
-rw-r--r-- | include/linux/netfilter_arp/arp_tables.h | 37 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ip_tables.h | 70 | ||||
-rw-r--r-- | include/linux/netfilter_ipv6/ip6_tables.h | 69 | ||||
-rw-r--r-- | include/linux/page-flags.h | 24 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 2 | ||||
-rw-r--r-- | include/linux/rtc.h | 4 | ||||
-rw-r--r-- | include/linux/serial_core.h | 3 | ||||
-rw-r--r-- | include/linux/slab.h | 3 | ||||
-rw-r--r-- | include/linux/smp.h | 23 | ||||
-rw-r--r-- | include/linux/swap.h | 38 | ||||
-rw-r--r-- | include/linux/workqueue.h | 6 | ||||
-rw-r--r-- | include/linux/x25.h | 26 |
23 files changed, 277 insertions, 247 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index b02a16c435e7..312a2c0c64e6 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -146,6 +146,8 @@ enum { | |||
146 | ATA_CMD_STANDBYNOW1 = 0xE0, | 146 | ATA_CMD_STANDBYNOW1 = 0xE0, |
147 | ATA_CMD_IDLEIMMEDIATE = 0xE1, | 147 | ATA_CMD_IDLEIMMEDIATE = 0xE1, |
148 | ATA_CMD_INIT_DEV_PARAMS = 0x91, | 148 | ATA_CMD_INIT_DEV_PARAMS = 0x91, |
149 | ATA_CMD_READ_NATIVE_MAX = 0xF8, | ||
150 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, | ||
149 | 151 | ||
150 | /* SETFEATURES stuff */ | 152 | /* SETFEATURES stuff */ |
151 | SETFEATURES_XFER = 0x03, | 153 | SETFEATURES_XFER = 0x03, |
@@ -204,7 +206,6 @@ enum ata_tf_protocols { | |||
204 | ATA_PROT_UNKNOWN, /* unknown/invalid */ | 206 | ATA_PROT_UNKNOWN, /* unknown/invalid */ |
205 | ATA_PROT_NODATA, /* no data */ | 207 | ATA_PROT_NODATA, /* no data */ |
206 | ATA_PROT_PIO, /* PIO single sector */ | 208 | ATA_PROT_PIO, /* PIO single sector */ |
207 | ATA_PROT_PIO_MULT, /* PIO multiple sector */ | ||
208 | ATA_PROT_DMA, /* DMA */ | 209 | ATA_PROT_DMA, /* DMA */ |
209 | ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ | 210 | ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ |
210 | ATA_PROT_ATAPI_NODATA, /* packet command, no data */ | 211 | ATA_PROT_ATAPI_NODATA, /* packet command, no data */ |
@@ -247,18 +248,22 @@ struct ata_taskfile { | |||
247 | }; | 248 | }; |
248 | 249 | ||
249 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 250 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) |
251 | #define ata_id_is_cfa(id) ((id)[0] == 0x848A) | ||
250 | #define ata_id_is_sata(id) ((id)[93] == 0) | 252 | #define ata_id_is_sata(id) ((id)[93] == 0) |
251 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) | 253 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) |
252 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) | 254 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) |
255 | #define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10)) | ||
253 | #define ata_id_has_fua(id) ((id)[84] & (1 << 6)) | 256 | #define ata_id_has_fua(id) ((id)[84] & (1 << 6)) |
254 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) | 257 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) |
255 | #define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13)) | 258 | #define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13)) |
256 | #define ata_id_has_lba48(id) ((id)[83] & (1 << 10)) | 259 | #define ata_id_has_lba48(id) ((id)[83] & (1 << 10)) |
260 | #define ata_id_has_hpa(id) ((id)[82] & (1 << 10)) | ||
257 | #define ata_id_has_wcache(id) ((id)[82] & (1 << 5)) | 261 | #define ata_id_has_wcache(id) ((id)[82] & (1 << 5)) |
258 | #define ata_id_has_pm(id) ((id)[82] & (1 << 3)) | 262 | #define ata_id_has_pm(id) ((id)[82] & (1 << 3)) |
259 | #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) | 263 | #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) |
260 | #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) | 264 | #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) |
261 | #define ata_id_removeable(id) ((id)[0] & (1 << 7)) | 265 | #define ata_id_removeable(id) ((id)[0] & (1 << 7)) |
266 | #define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) | ||
262 | #define ata_id_u32(id,n) \ | 267 | #define ata_id_u32(id,n) \ |
263 | (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) | 268 | (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) |
264 | #define ata_id_u64(id,n) \ | 269 | #define ata_id_u64(id,n) \ |
diff --git a/include/linux/device.h b/include/linux/device.h index 5b595fdfb672..f6e72a65a3f2 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -378,6 +378,7 @@ extern void device_bind_driver(struct device * dev); | |||
378 | extern void device_release_driver(struct device * dev); | 378 | extern void device_release_driver(struct device * dev); |
379 | extern int device_attach(struct device * dev); | 379 | extern int device_attach(struct device * dev); |
380 | extern void driver_attach(struct device_driver * drv); | 380 | extern void driver_attach(struct device_driver * drv); |
381 | extern void device_reprobe(struct device *dev); | ||
381 | 382 | ||
382 | 383 | ||
383 | /* | 384 | /* |
@@ -399,7 +400,7 @@ extern struct device * get_device(struct device * dev); | |||
399 | extern void put_device(struct device * dev); | 400 | extern void put_device(struct device * dev); |
400 | 401 | ||
401 | 402 | ||
402 | /* drivers/base/power.c */ | 403 | /* drivers/base/power/shutdown.c */ |
403 | extern void device_shutdown(void); | 404 | extern void device_shutdown(void); |
404 | 405 | ||
405 | 406 | ||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 2d80cc761a15..a8731062a74c 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -20,6 +20,7 @@ enum dma_data_direction { | |||
20 | #define DMA_31BIT_MASK 0x000000007fffffffULL | 20 | #define DMA_31BIT_MASK 0x000000007fffffffULL |
21 | #define DMA_30BIT_MASK 0x000000003fffffffULL | 21 | #define DMA_30BIT_MASK 0x000000003fffffffULL |
22 | #define DMA_29BIT_MASK 0x000000001fffffffULL | 22 | #define DMA_29BIT_MASK 0x000000001fffffffULL |
23 | #define DMA_28BIT_MASK 0x000000000fffffffULL | ||
23 | 24 | ||
24 | #include <asm/dma-mapping.h> | 25 | #include <asm/dma-mapping.h> |
25 | 26 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 68d82ad6b17c..d6f1019625af 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -20,10 +20,7 @@ void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long) | |||
20 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | 20 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); |
21 | int hugetlb_report_meminfo(char *); | 21 | int hugetlb_report_meminfo(char *); |
22 | int hugetlb_report_node_meminfo(int, char *); | 22 | int hugetlb_report_node_meminfo(int, char *); |
23 | int is_hugepage_mem_enough(size_t); | ||
24 | unsigned long hugetlb_total_pages(void); | 23 | unsigned long hugetlb_total_pages(void); |
25 | struct page *alloc_huge_page(struct vm_area_struct *, unsigned long); | ||
26 | void free_huge_page(struct page *); | ||
27 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
28 | unsigned long address, int write_access); | 25 | unsigned long address, int write_access); |
29 | 26 | ||
@@ -39,18 +36,35 @@ struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | |||
39 | int write); | 36 | int write); |
40 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 37 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
41 | pmd_t *pmd, int write); | 38 | pmd_t *pmd, int write); |
42 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
43 | int pmd_huge(pmd_t pmd); | 39 | int pmd_huge(pmd_t pmd); |
40 | void hugetlb_change_protection(struct vm_area_struct *vma, | ||
41 | unsigned long address, unsigned long end, pgprot_t newprot); | ||
44 | 42 | ||
45 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE | 43 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE |
46 | #define is_hugepage_only_range(mm, addr, len) 0 | 44 | #define is_hugepage_only_range(mm, addr, len) 0 |
47 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 45 | #endif |
48 | do { } while (0) | 46 | |
47 | #ifndef ARCH_HAS_HUGETLB_FREE_PGD_RANGE | ||
48 | #define hugetlb_free_pgd_range free_pgd_range | ||
49 | #else | ||
50 | void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | ||
51 | unsigned long end, unsigned long floor, | ||
52 | unsigned long ceiling); | ||
49 | #endif | 53 | #endif |
50 | 54 | ||
51 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE | 55 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE |
52 | #define prepare_hugepage_range(addr, len) \ | 56 | /* |
53 | is_aligned_hugepage_range(addr, len) | 57 | * If the arch doesn't supply something else, assume that hugepage |
58 | * size aligned regions are ok without further preparation. | ||
59 | */ | ||
60 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | ||
61 | { | ||
62 | if (len & ~HPAGE_MASK) | ||
63 | return -EINVAL; | ||
64 | if (addr & ~HPAGE_MASK) | ||
65 | return -EINVAL; | ||
66 | return 0; | ||
67 | } | ||
54 | #else | 68 | #else |
55 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 69 | int prepare_hugepage_range(unsigned long addr, unsigned long len); |
56 | #endif | 70 | #endif |
@@ -87,20 +101,17 @@ static inline unsigned long hugetlb_total_pages(void) | |||
87 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) | 101 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) |
88 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) | 102 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) |
89 | #define unmap_hugepage_range(vma, start, end) BUG() | 103 | #define unmap_hugepage_range(vma, start, end) BUG() |
90 | #define is_hugepage_mem_enough(size) 0 | ||
91 | #define hugetlb_report_meminfo(buf) 0 | 104 | #define hugetlb_report_meminfo(buf) 0 |
92 | #define hugetlb_report_node_meminfo(n, buf) 0 | 105 | #define hugetlb_report_node_meminfo(n, buf) 0 |
93 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 106 | #define follow_huge_pmd(mm, addr, pmd, write) NULL |
94 | #define is_aligned_hugepage_range(addr, len) 0 | ||
95 | #define prepare_hugepage_range(addr, len) (-EINVAL) | 107 | #define prepare_hugepage_range(addr, len) (-EINVAL) |
96 | #define pmd_huge(x) 0 | 108 | #define pmd_huge(x) 0 |
97 | #define is_hugepage_only_range(mm, addr, len) 0 | 109 | #define is_hugepage_only_range(mm, addr, len) 0 |
98 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 110 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
99 | do { } while (0) | ||
100 | #define alloc_huge_page(vma, addr) ({ NULL; }) | ||
101 | #define free_huge_page(p) ({ (void)(p); BUG(); }) | ||
102 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | 111 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) |
103 | 112 | ||
113 | #define hugetlb_change_protection(vma, address, end, newprot) | ||
114 | |||
104 | #ifndef HPAGE_MASK | 115 | #ifndef HPAGE_MASK |
105 | #define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ | 116 | #define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ |
106 | #define HPAGE_SIZE PAGE_SIZE | 117 | #define HPAGE_SIZE PAGE_SIZE |
@@ -128,6 +139,8 @@ struct hugetlbfs_sb_info { | |||
128 | 139 | ||
129 | struct hugetlbfs_inode_info { | 140 | struct hugetlbfs_inode_info { |
130 | struct shared_policy policy; | 141 | struct shared_policy policy; |
142 | /* Protected by the (global) hugetlb_lock */ | ||
143 | unsigned long prereserved_hpages; | ||
131 | struct inode vfs_inode; | 144 | struct inode vfs_inode; |
132 | }; | 145 | }; |
133 | 146 | ||
@@ -144,6 +157,10 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
144 | extern struct file_operations hugetlbfs_file_operations; | 157 | extern struct file_operations hugetlbfs_file_operations; |
145 | extern struct vm_operations_struct hugetlb_vm_ops; | 158 | extern struct vm_operations_struct hugetlb_vm_ops; |
146 | struct file *hugetlb_zero_setup(size_t); | 159 | struct file *hugetlb_zero_setup(size_t); |
160 | int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info, | ||
161 | unsigned long atleast_hpages); | ||
162 | void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info, | ||
163 | unsigned long atmost_hpages); | ||
147 | int hugetlb_get_quota(struct address_space *mapping); | 164 | int hugetlb_get_quota(struct address_space *mapping); |
148 | void hugetlb_put_quota(struct address_space *mapping); | 165 | void hugetlb_put_quota(struct address_space *mapping); |
149 | 166 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 239408ecfddf..7a54244d30aa 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -502,13 +502,13 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i | |||
502 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 502 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
503 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); | 503 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); |
504 | extern int ata_pci_device_resume(struct pci_dev *pdev); | 504 | extern int ata_pci_device_resume(struct pci_dev *pdev); |
505 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); | ||
505 | #endif /* CONFIG_PCI */ | 506 | #endif /* CONFIG_PCI */ |
506 | extern int ata_device_add(const struct ata_probe_ent *ent); | 507 | extern int ata_device_add(const struct ata_probe_ent *ent); |
507 | extern void ata_host_set_remove(struct ata_host_set *host_set); | 508 | extern void ata_host_set_remove(struct ata_host_set *host_set); |
508 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 509 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
509 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 510 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
510 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 511 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
511 | extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd); | ||
512 | extern int ata_scsi_error(struct Scsi_Host *host); | 512 | extern int ata_scsi_error(struct Scsi_Host *host); |
513 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | 513 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); |
514 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | 514 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); |
@@ -543,6 +543,7 @@ extern void ata_port_stop (struct ata_port *ap); | |||
543 | extern void ata_host_stop (struct ata_host_set *host_set); | 543 | extern void ata_host_stop (struct ata_host_set *host_set); |
544 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); | 544 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); |
545 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 545 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |
546 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); | ||
546 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); | 547 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); |
547 | extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, | 548 | extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, |
548 | unsigned int buflen); | 549 | unsigned int buflen); |
@@ -609,7 +610,7 @@ extern void ata_pci_host_stop (struct ata_host_set *host_set); | |||
609 | extern struct ata_probe_ent * | 610 | extern struct ata_probe_ent * |
610 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); | 611 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); |
611 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); | 612 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); |
612 | 613 | extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long); | |
613 | #endif /* CONFIG_PCI */ | 614 | #endif /* CONFIG_PCI */ |
614 | 615 | ||
615 | 616 | ||
diff --git a/include/linux/migrate.h b/include/linux/migrate.h new file mode 100644 index 000000000000..7d09962c3c0b --- /dev/null +++ b/include/linux/migrate.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef _LINUX_MIGRATE_H | ||
2 | #define _LINUX_MIGRATE_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | #include <linux/mm.h> | ||
6 | |||
7 | #ifdef CONFIG_MIGRATION | ||
8 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | ||
9 | extern int putback_lru_pages(struct list_head *l); | ||
10 | extern int migrate_page(struct page *, struct page *); | ||
11 | extern void migrate_page_copy(struct page *, struct page *); | ||
12 | extern int migrate_page_remove_references(struct page *, struct page *, int); | ||
13 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
14 | struct list_head *moved, struct list_head *failed); | ||
15 | int migrate_pages_to(struct list_head *pagelist, | ||
16 | struct vm_area_struct *vma, int dest); | ||
17 | extern int fail_migrate_page(struct page *, struct page *); | ||
18 | |||
19 | extern int migrate_prep(void); | ||
20 | |||
21 | #else | ||
22 | |||
23 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | ||
24 | { return -ENOSYS; } | ||
25 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | ||
26 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | ||
27 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | ||
28 | |||
29 | static inline int migrate_prep(void) { return -ENOSYS; } | ||
30 | |||
31 | /* Possible settings for the migrate_page() method in address_operations */ | ||
32 | #define migrate_page NULL | ||
33 | #define fail_migrate_page NULL | ||
34 | |||
35 | #endif /* CONFIG_MIGRATION */ | ||
36 | #endif /* _LINUX_MIGRATE_H */ | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 498ff8778fb6..6aa016f1d3ae 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -286,43 +286,34 @@ struct page { | |||
286 | * | 286 | * |
287 | * Also, many kernel routines increase the page count before a critical | 287 | * Also, many kernel routines increase the page count before a critical |
288 | * routine so they can be sure the page doesn't go away from under them. | 288 | * routine so they can be sure the page doesn't go away from under them. |
289 | * | ||
290 | * Since 2.6.6 (approx), a free page has ->_count = -1. This is so that we | ||
291 | * can use atomic_add_negative(-1, page->_count) to detect when the page | ||
292 | * becomes free and so that we can also use atomic_inc_and_test to atomically | ||
293 | * detect when we just tried to grab a ref on a page which some other CPU has | ||
294 | * already deemed to be freeable. | ||
295 | * | ||
296 | * NO code should make assumptions about this internal detail! Use the provided | ||
297 | * macros which retain the old rules: page_count(page) == 0 is a free page. | ||
298 | */ | 289 | */ |
299 | 290 | ||
300 | /* | 291 | /* |
301 | * Drop a ref, return true if the logical refcount fell to zero (the page has | 292 | * Drop a ref, return true if the logical refcount fell to zero (the page has |
302 | * no users) | 293 | * no users) |
303 | */ | 294 | */ |
304 | #define put_page_testzero(p) \ | 295 | static inline int put_page_testzero(struct page *page) |
305 | ({ \ | 296 | { |
306 | BUG_ON(atomic_read(&(p)->_count) == -1);\ | 297 | BUG_ON(atomic_read(&page->_count) == 0); |
307 | atomic_add_negative(-1, &(p)->_count); \ | 298 | return atomic_dec_and_test(&page->_count); |
308 | }) | 299 | } |
309 | 300 | ||
310 | /* | 301 | /* |
311 | * Grab a ref, return true if the page previously had a logical refcount of | 302 | * Try to grab a ref unless the page has a refcount of zero, return false if |
312 | * zero. ie: returns true if we just grabbed an already-deemed-to-be-free page | 303 | * that is the case. |
313 | */ | 304 | */ |
314 | #define get_page_testone(p) atomic_inc_and_test(&(p)->_count) | 305 | static inline int get_page_unless_zero(struct page *page) |
315 | 306 | { | |
316 | #define set_page_count(p,v) atomic_set(&(p)->_count, (v) - 1) | 307 | return atomic_inc_not_zero(&page->_count); |
317 | #define __put_page(p) atomic_dec(&(p)->_count) | 308 | } |
318 | 309 | ||
319 | extern void FASTCALL(__page_cache_release(struct page *)); | 310 | extern void FASTCALL(__page_cache_release(struct page *)); |
320 | 311 | ||
321 | static inline int page_count(struct page *page) | 312 | static inline int page_count(struct page *page) |
322 | { | 313 | { |
323 | if (PageCompound(page)) | 314 | if (unlikely(PageCompound(page))) |
324 | page = (struct page *)page_private(page); | 315 | page = (struct page *)page_private(page); |
325 | return atomic_read(&page->_count) + 1; | 316 | return atomic_read(&page->_count); |
326 | } | 317 | } |
327 | 318 | ||
328 | static inline void get_page(struct page *page) | 319 | static inline void get_page(struct page *page) |
@@ -332,8 +323,19 @@ static inline void get_page(struct page *page) | |||
332 | atomic_inc(&page->_count); | 323 | atomic_inc(&page->_count); |
333 | } | 324 | } |
334 | 325 | ||
326 | /* | ||
327 | * Setup the page count before being freed into the page allocator for | ||
328 | * the first time (boot or memory hotplug) | ||
329 | */ | ||
330 | static inline void init_page_count(struct page *page) | ||
331 | { | ||
332 | atomic_set(&page->_count, 1); | ||
333 | } | ||
334 | |||
335 | void put_page(struct page *page); | 335 | void put_page(struct page *page); |
336 | 336 | ||
337 | void split_page(struct page *page, unsigned int order); | ||
338 | |||
337 | /* | 339 | /* |
338 | * Multiple processes may "see" the same page. E.g. for untouched | 340 | * Multiple processes may "see" the same page. E.g. for untouched |
339 | * mappings of /dev/null, all processes see the same page full of | 341 | * mappings of /dev/null, all processes see the same page full of |
@@ -1046,7 +1048,7 @@ int in_gate_area_no_task(unsigned long addr); | |||
1046 | 1048 | ||
1047 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, | 1049 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, |
1048 | void __user *, size_t *, loff_t *); | 1050 | void __user *, size_t *, loff_t *); |
1049 | int shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1051 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, |
1050 | unsigned long lru_pages); | 1052 | unsigned long lru_pages); |
1051 | void drop_pagecache(void); | 1053 | void drop_pagecache(void); |
1052 | void drop_slab(void); | 1054 | void drop_slab(void); |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 8ac854f7f190..3b6723dfaff3 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -32,7 +32,7 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
32 | { | 32 | { |
33 | list_del(&page->lru); | 33 | list_del(&page->lru); |
34 | if (PageActive(page)) { | 34 | if (PageActive(page)) { |
35 | ClearPageActive(page); | 35 | __ClearPageActive(page); |
36 | zone->nr_active--; | 36 | zone->nr_active--; |
37 | } else { | 37 | } else { |
38 | zone->nr_inactive--; | 38 | zone->nr_inactive--; |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index e933e2a355ad..8bcd9450d926 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
@@ -199,7 +199,7 @@ struct fat_mount_options { | |||
199 | sys_immutable:1, /* set = system files are immutable */ | 199 | sys_immutable:1, /* set = system files are immutable */ |
200 | dotsOK:1, /* set = hidden and system files are named '.filename' */ | 200 | dotsOK:1, /* set = hidden and system files are named '.filename' */ |
201 | isvfat:1, /* 0=no vfat long filename support, 1=vfat support */ | 201 | isvfat:1, /* 0=no vfat long filename support, 1=vfat support */ |
202 | utf8:1, /* Use of UTF8 character set (Default) */ | 202 | utf8:1, /* Use of UTF-8 character set (Default) */ |
203 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ | 203 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ |
204 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ | 204 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ |
205 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ | 205 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ |
diff --git a/include/linux/net.h b/include/linux/net.h index 152fa6551fd8..84a490e5f0a1 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -143,6 +143,8 @@ struct proto_ops { | |||
143 | struct poll_table_struct *wait); | 143 | struct poll_table_struct *wait); |
144 | int (*ioctl) (struct socket *sock, unsigned int cmd, | 144 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
145 | unsigned long arg); | 145 | unsigned long arg); |
146 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, | ||
147 | unsigned long arg); | ||
146 | int (*listen) (struct socket *sock, int len); | 148 | int (*listen) (struct socket *sock, int len); |
147 | int (*shutdown) (struct socket *sock, int flags); | 149 | int (*shutdown) (struct socket *sock, int flags); |
148 | int (*setsockopt)(struct socket *sock, int level, | 150 | int (*setsockopt)(struct socket *sock, int level, |
@@ -251,6 +253,8 @@ SOCKCALL_UWRAP(name, poll, (struct file *file, struct socket *sock, struct poll_ | |||
251 | (file, sock, wait)) \ | 253 | (file, sock, wait)) \ |
252 | SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ | 254 | SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ |
253 | unsigned long arg), (sock, cmd, arg)) \ | 255 | unsigned long arg), (sock, cmd, arg)) \ |
256 | SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int cmd, \ | ||
257 | unsigned long arg), (sock, cmd, arg)) \ | ||
254 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ | 258 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ |
255 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ | 259 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ |
256 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ | 260 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ |
@@ -275,6 +279,7 @@ static const struct proto_ops name##_ops = { \ | |||
275 | .getname = __lock_##name##_getname, \ | 279 | .getname = __lock_##name##_getname, \ |
276 | .poll = __lock_##name##_poll, \ | 280 | .poll = __lock_##name##_poll, \ |
277 | .ioctl = __lock_##name##_ioctl, \ | 281 | .ioctl = __lock_##name##_ioctl, \ |
282 | .compat_ioctl = __lock_##name##_compat_ioctl, \ | ||
278 | .listen = __lock_##name##_listen, \ | 283 | .listen = __lock_##name##_listen, \ |
279 | .shutdown = __lock_##name##_shutdown, \ | 284 | .shutdown = __lock_##name##_shutdown, \ |
280 | .setsockopt = __lock_##name##_setsockopt, \ | 285 | .setsockopt = __lock_##name##_setsockopt, \ |
@@ -283,6 +288,7 @@ static const struct proto_ops name##_ops = { \ | |||
283 | .recvmsg = __lock_##name##_recvmsg, \ | 288 | .recvmsg = __lock_##name##_recvmsg, \ |
284 | .mmap = __lock_##name##_mmap, \ | 289 | .mmap = __lock_##name##_mmap, \ |
285 | }; | 290 | }; |
291 | |||
286 | #endif | 292 | #endif |
287 | 293 | ||
288 | #define MODULE_ALIAS_NETPROTO(proto) \ | 294 | #define MODULE_ALIAS_NETPROTO(proto) \ |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 46a0f974f87c..1350e47b0234 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -4,6 +4,62 @@ | |||
4 | #define XT_FUNCTION_MAXNAMELEN 30 | 4 | #define XT_FUNCTION_MAXNAMELEN 30 |
5 | #define XT_TABLE_MAXNAMELEN 32 | 5 | #define XT_TABLE_MAXNAMELEN 32 |
6 | 6 | ||
7 | struct xt_entry_match | ||
8 | { | ||
9 | union { | ||
10 | struct { | ||
11 | u_int16_t match_size; | ||
12 | |||
13 | /* Used by userspace */ | ||
14 | char name[XT_FUNCTION_MAXNAMELEN-1]; | ||
15 | |||
16 | u_int8_t revision; | ||
17 | } user; | ||
18 | struct { | ||
19 | u_int16_t match_size; | ||
20 | |||
21 | /* Used inside the kernel */ | ||
22 | struct xt_match *match; | ||
23 | } kernel; | ||
24 | |||
25 | /* Total length */ | ||
26 | u_int16_t match_size; | ||
27 | } u; | ||
28 | |||
29 | unsigned char data[0]; | ||
30 | }; | ||
31 | |||
32 | struct xt_entry_target | ||
33 | { | ||
34 | union { | ||
35 | struct { | ||
36 | u_int16_t target_size; | ||
37 | |||
38 | /* Used by userspace */ | ||
39 | char name[XT_FUNCTION_MAXNAMELEN-1]; | ||
40 | |||
41 | u_int8_t revision; | ||
42 | } user; | ||
43 | struct { | ||
44 | u_int16_t target_size; | ||
45 | |||
46 | /* Used inside the kernel */ | ||
47 | struct xt_target *target; | ||
48 | } kernel; | ||
49 | |||
50 | /* Total length */ | ||
51 | u_int16_t target_size; | ||
52 | } u; | ||
53 | |||
54 | unsigned char data[0]; | ||
55 | }; | ||
56 | |||
57 | struct xt_standard_target | ||
58 | { | ||
59 | struct xt_entry_target target; | ||
60 | int verdict; | ||
61 | }; | ||
62 | |||
7 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision | 63 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision |
8 | * kernel supports, if >= revision. */ | 64 | * kernel supports, if >= revision. */ |
9 | struct xt_get_revision | 65 | struct xt_get_revision |
@@ -220,10 +276,10 @@ struct xt_table_info | |||
220 | char *entries[NR_CPUS]; | 276 | char *entries[NR_CPUS]; |
221 | }; | 277 | }; |
222 | 278 | ||
223 | extern int xt_register_target(int af, struct xt_target *target); | 279 | extern int xt_register_target(struct xt_target *target); |
224 | extern void xt_unregister_target(int af, struct xt_target *target); | 280 | extern void xt_unregister_target(struct xt_target *target); |
225 | extern int xt_register_match(int af, struct xt_match *target); | 281 | extern int xt_register_match(struct xt_match *target); |
226 | extern void xt_unregister_match(int af, struct xt_match *target); | 282 | extern void xt_unregister_match(struct xt_match *target); |
227 | 283 | ||
228 | extern int xt_check_match(const struct xt_match *match, unsigned short family, | 284 | extern int xt_check_match(const struct xt_match *match, unsigned short family, |
229 | unsigned int size, const char *table, unsigned int hook, | 285 | unsigned int size, const char *table, unsigned int hook, |
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index fd21796e5131..62cc27daca4e 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -65,35 +65,8 @@ struct arpt_arp { | |||
65 | u_int16_t invflags; | 65 | u_int16_t invflags; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct arpt_entry_target | 68 | #define arpt_entry_target xt_entry_target |
69 | { | 69 | #define arpt_standard_target xt_standard_target |
70 | union { | ||
71 | struct { | ||
72 | u_int16_t target_size; | ||
73 | |||
74 | /* Used by userspace */ | ||
75 | char name[ARPT_FUNCTION_MAXNAMELEN-1]; | ||
76 | u_int8_t revision; | ||
77 | } user; | ||
78 | struct { | ||
79 | u_int16_t target_size; | ||
80 | |||
81 | /* Used inside the kernel */ | ||
82 | struct arpt_target *target; | ||
83 | } kernel; | ||
84 | |||
85 | /* Total length */ | ||
86 | u_int16_t target_size; | ||
87 | } u; | ||
88 | |||
89 | unsigned char data[0]; | ||
90 | }; | ||
91 | |||
92 | struct arpt_standard_target | ||
93 | { | ||
94 | struct arpt_entry_target target; | ||
95 | int verdict; | ||
96 | }; | ||
97 | 70 | ||
98 | /* Values for "flag" field in struct arpt_ip (general arp structure). | 71 | /* Values for "flag" field in struct arpt_ip (general arp structure). |
99 | * No flags defined yet. | 72 | * No flags defined yet. |
@@ -263,8 +236,10 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
263 | */ | 236 | */ |
264 | #ifdef __KERNEL__ | 237 | #ifdef __KERNEL__ |
265 | 238 | ||
266 | #define arpt_register_target(tgt) xt_register_target(NF_ARP, tgt) | 239 | #define arpt_register_target(tgt) \ |
267 | #define arpt_unregister_target(tgt) xt_unregister_target(NF_ARP, tgt) | 240 | ({ (tgt)->family = NF_ARP; \ |
241 | xt_register_target(tgt); }) | ||
242 | #define arpt_unregister_target(tgt) xt_unregister_target(tgt) | ||
268 | 243 | ||
269 | extern int arpt_register_table(struct arpt_table *table, | 244 | extern int arpt_register_table(struct arpt_table *table, |
270 | const struct arpt_replace *repl); | 245 | const struct arpt_replace *repl); |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 76ba24b68515..d5b8c0d6a12b 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -52,61 +52,9 @@ struct ipt_ip { | |||
52 | u_int8_t invflags; | 52 | u_int8_t invflags; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | struct ipt_entry_match | 55 | #define ipt_entry_match xt_entry_match |
56 | { | 56 | #define ipt_entry_target xt_entry_target |
57 | union { | 57 | #define ipt_standard_target xt_standard_target |
58 | struct { | ||
59 | u_int16_t match_size; | ||
60 | |||
61 | /* Used by userspace */ | ||
62 | char name[IPT_FUNCTION_MAXNAMELEN-1]; | ||
63 | |||
64 | u_int8_t revision; | ||
65 | } user; | ||
66 | struct { | ||
67 | u_int16_t match_size; | ||
68 | |||
69 | /* Used inside the kernel */ | ||
70 | struct ipt_match *match; | ||
71 | } kernel; | ||
72 | |||
73 | /* Total length */ | ||
74 | u_int16_t match_size; | ||
75 | } u; | ||
76 | |||
77 | unsigned char data[0]; | ||
78 | }; | ||
79 | |||
80 | struct ipt_entry_target | ||
81 | { | ||
82 | union { | ||
83 | struct { | ||
84 | u_int16_t target_size; | ||
85 | |||
86 | /* Used by userspace */ | ||
87 | char name[IPT_FUNCTION_MAXNAMELEN-1]; | ||
88 | |||
89 | u_int8_t revision; | ||
90 | } user; | ||
91 | struct { | ||
92 | u_int16_t target_size; | ||
93 | |||
94 | /* Used inside the kernel */ | ||
95 | struct ipt_target *target; | ||
96 | } kernel; | ||
97 | |||
98 | /* Total length */ | ||
99 | u_int16_t target_size; | ||
100 | } u; | ||
101 | |||
102 | unsigned char data[0]; | ||
103 | }; | ||
104 | |||
105 | struct ipt_standard_target | ||
106 | { | ||
107 | struct ipt_entry_target target; | ||
108 | int verdict; | ||
109 | }; | ||
110 | 58 | ||
111 | #define ipt_counters xt_counters | 59 | #define ipt_counters xt_counters |
112 | 60 | ||
@@ -321,11 +269,15 @@ ipt_get_target(struct ipt_entry *e) | |||
321 | #include <linux/init.h> | 269 | #include <linux/init.h> |
322 | extern void ipt_init(void) __init; | 270 | extern void ipt_init(void) __init; |
323 | 271 | ||
324 | #define ipt_register_target(tgt) xt_register_target(AF_INET, tgt) | 272 | #define ipt_register_target(tgt) \ |
325 | #define ipt_unregister_target(tgt) xt_unregister_target(AF_INET, tgt) | 273 | ({ (tgt)->family = AF_INET; \ |
274 | xt_register_target(tgt); }) | ||
275 | #define ipt_unregister_target(tgt) xt_unregister_target(tgt) | ||
326 | 276 | ||
327 | #define ipt_register_match(mtch) xt_register_match(AF_INET, mtch) | 277 | #define ipt_register_match(mtch) \ |
328 | #define ipt_unregister_match(mtch) xt_unregister_match(AF_INET, mtch) | 278 | ({ (mtch)->family = AF_INET; \ |
279 | xt_register_match(mtch); }) | ||
280 | #define ipt_unregister_match(mtch) xt_unregister_match(mtch) | ||
329 | 281 | ||
330 | //#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl) | 282 | //#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl) |
331 | //#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl) | 283 | //#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl) |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index f249b574f0fa..d0d5d1ee4be3 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -56,60 +56,9 @@ struct ip6t_ip6 { | |||
56 | u_int8_t invflags; | 56 | u_int8_t invflags; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | /* FIXME: If alignment in kernel different from userspace? --RR */ | 59 | #define ip6t_entry_match xt_entry_match |
60 | struct ip6t_entry_match | 60 | #define ip6t_entry_target xt_entry_target |
61 | { | 61 | #define ip6t_standard_target xt_standard_target |
62 | union { | ||
63 | struct { | ||
64 | u_int16_t match_size; | ||
65 | |||
66 | /* Used by userspace */ | ||
67 | char name[IP6T_FUNCTION_MAXNAMELEN-1]; | ||
68 | u_int8_t revision; | ||
69 | } user; | ||
70 | struct { | ||
71 | u_int16_t match_size; | ||
72 | |||
73 | /* Used inside the kernel */ | ||
74 | struct ip6t_match *match; | ||
75 | } kernel; | ||
76 | |||
77 | /* Total length */ | ||
78 | u_int16_t match_size; | ||
79 | } u; | ||
80 | |||
81 | unsigned char data[0]; | ||
82 | }; | ||
83 | |||
84 | struct ip6t_entry_target | ||
85 | { | ||
86 | union { | ||
87 | struct { | ||
88 | u_int16_t target_size; | ||
89 | |||
90 | /* Used by userspace */ | ||
91 | char name[IP6T_FUNCTION_MAXNAMELEN-1]; | ||
92 | u_int8_t revision; | ||
93 | } user; | ||
94 | struct { | ||
95 | u_int16_t target_size; | ||
96 | |||
97 | /* Used inside the kernel */ | ||
98 | struct ip6t_target *target; | ||
99 | } kernel; | ||
100 | |||
101 | /* Total length */ | ||
102 | u_int16_t target_size; | ||
103 | } u; | ||
104 | |||
105 | unsigned char data[0]; | ||
106 | }; | ||
107 | |||
108 | struct ip6t_standard_target | ||
109 | { | ||
110 | struct ip6t_entry_target target; | ||
111 | int verdict; | ||
112 | }; | ||
113 | 62 | ||
114 | #define ip6t_counters xt_counters | 63 | #define ip6t_counters xt_counters |
115 | 64 | ||
@@ -334,11 +283,15 @@ ip6t_get_target(struct ip6t_entry *e) | |||
334 | #include <linux/init.h> | 283 | #include <linux/init.h> |
335 | extern void ip6t_init(void) __init; | 284 | extern void ip6t_init(void) __init; |
336 | 285 | ||
337 | #define ip6t_register_target(tgt) xt_register_target(AF_INET6, tgt) | 286 | #define ip6t_register_target(tgt) \ |
338 | #define ip6t_unregister_target(tgt) xt_unregister_target(AF_INET6, tgt) | 287 | ({ (tgt)->family = AF_INET6; \ |
288 | xt_register_target(tgt); }) | ||
289 | #define ip6t_unregister_target(tgt) xt_unregister_target(tgt) | ||
339 | 290 | ||
340 | #define ip6t_register_match(match) xt_register_match(AF_INET6, match) | 291 | #define ip6t_register_match(match) \ |
341 | #define ip6t_unregister_match(match) xt_unregister_match(AF_INET6, match) | 292 | ({ (match)->family = AF_INET6; \ |
293 | xt_register_match(match); }) | ||
294 | #define ip6t_unregister_match(match) xt_unregister_match(match) | ||
342 | 295 | ||
343 | extern int ip6t_register_table(struct ip6t_table *table, | 296 | extern int ip6t_register_table(struct ip6t_table *table, |
344 | const struct ip6t_replace *repl); | 297 | const struct ip6t_replace *repl); |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index d52999c43336..9ea629c02a4b 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -86,8 +86,9 @@ | |||
86 | * - The __xxx_page_state variants can be used safely when interrupts are | 86 | * - The __xxx_page_state variants can be used safely when interrupts are |
87 | * disabled. | 87 | * disabled. |
88 | * - The __xxx_page_state variants can be used if the field is only | 88 | * - The __xxx_page_state variants can be used if the field is only |
89 | * modified from process context, or only modified from interrupt context. | 89 | * modified from process context and protected from preemption, or only |
90 | * In this case, the field should be commented here. | 90 | * modified from interrupt context. In this case, the field should be |
91 | * commented here. | ||
91 | */ | 92 | */ |
92 | struct page_state { | 93 | struct page_state { |
93 | unsigned long nr_dirty; /* Dirty writeable pages */ | 94 | unsigned long nr_dirty; /* Dirty writeable pages */ |
@@ -239,22 +240,19 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
239 | #define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) | 240 | #define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) |
240 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) | 241 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) |
241 | 242 | ||
242 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) | ||
243 | #define PageLRU(page) test_bit(PG_lru, &(page)->flags) | 243 | #define PageLRU(page) test_bit(PG_lru, &(page)->flags) |
244 | #define TestSetPageLRU(page) test_and_set_bit(PG_lru, &(page)->flags) | 244 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) |
245 | #define TestClearPageLRU(page) test_and_clear_bit(PG_lru, &(page)->flags) | 245 | #define ClearPageLRU(page) clear_bit(PG_lru, &(page)->flags) |
246 | #define __ClearPageLRU(page) __clear_bit(PG_lru, &(page)->flags) | ||
246 | 247 | ||
247 | #define PageActive(page) test_bit(PG_active, &(page)->flags) | 248 | #define PageActive(page) test_bit(PG_active, &(page)->flags) |
248 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) | 249 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) |
249 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) | 250 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) |
250 | #define TestClearPageActive(page) test_and_clear_bit(PG_active, &(page)->flags) | 251 | #define __ClearPageActive(page) __clear_bit(PG_active, &(page)->flags) |
251 | #define TestSetPageActive(page) test_and_set_bit(PG_active, &(page)->flags) | ||
252 | 252 | ||
253 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) | 253 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) |
254 | #define SetPageSlab(page) set_bit(PG_slab, &(page)->flags) | 254 | #define __SetPageSlab(page) __set_bit(PG_slab, &(page)->flags) |
255 | #define ClearPageSlab(page) clear_bit(PG_slab, &(page)->flags) | 255 | #define __ClearPageSlab(page) __clear_bit(PG_slab, &(page)->flags) |
256 | #define TestClearPageSlab(page) test_and_clear_bit(PG_slab, &(page)->flags) | ||
257 | #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) | ||
258 | 256 | ||
259 | #ifdef CONFIG_HIGHMEM | 257 | #ifdef CONFIG_HIGHMEM |
260 | #define PageHighMem(page) is_highmem(page_zone(page)) | 258 | #define PageHighMem(page) is_highmem(page_zone(page)) |
@@ -329,8 +327,8 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
329 | #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) | 327 | #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) |
330 | 328 | ||
331 | #define PageCompound(page) test_bit(PG_compound, &(page)->flags) | 329 | #define PageCompound(page) test_bit(PG_compound, &(page)->flags) |
332 | #define SetPageCompound(page) set_bit(PG_compound, &(page)->flags) | 330 | #define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) |
333 | #define ClearPageCompound(page) clear_bit(PG_compound, &(page)->flags) | 331 | #define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) |
334 | 332 | ||
335 | #ifdef CONFIG_SWAP | 333 | #ifdef CONFIG_SWAP |
336 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) | 334 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b9810ddf435a..ec3c32932620 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -852,6 +852,8 @@ | |||
852 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 | 852 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 |
853 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 | 853 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 |
854 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 | 854 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 |
855 | #define PCI_DEVICE_ID_QLOGIC_ISP5422 0x5422 | ||
856 | #define PCI_DEVICE_ID_QLOGIC_ISP5432 0x5432 | ||
855 | 857 | ||
856 | #define PCI_VENDOR_ID_CYRIX 0x1078 | 858 | #define PCI_VENDOR_ID_CYRIX 0x1078 |
857 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 | 859 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 0b2ba67ff13c..b739ac1f7ca0 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #ifndef _LINUX_RTC_H_ | 11 | #ifndef _LINUX_RTC_H_ |
12 | #define _LINUX_RTC_H_ | 12 | #define _LINUX_RTC_H_ |
13 | 13 | ||
14 | #include <linux/interrupt.h> | ||
15 | |||
16 | /* | 14 | /* |
17 | * The struct used to pass data via the following ioctl. Similar to the | 15 | * The struct used to pass data via the following ioctl. Similar to the |
18 | * struct tm in <time.h>, but it needs to be here so that the kernel | 16 | * struct tm in <time.h>, but it needs to be here so that the kernel |
@@ -95,6 +93,8 @@ struct rtc_pll_info { | |||
95 | 93 | ||
96 | #ifdef __KERNEL__ | 94 | #ifdef __KERNEL__ |
97 | 95 | ||
96 | #include <linux/interrupt.h> | ||
97 | |||
98 | typedef struct rtc_task { | 98 | typedef struct rtc_task { |
99 | void (*func)(void *private_data); | 99 | void (*func)(void *private_data); |
100 | void *private_data; | 100 | void *private_data; |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 57abcea1cb5d..c32e60e79dea 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -369,6 +369,9 @@ void uart_parse_options(char *options, int *baud, int *parity, int *bits, | |||
369 | int uart_set_options(struct uart_port *port, struct console *co, int baud, | 369 | int uart_set_options(struct uart_port *port, struct console *co, int baud, |
370 | int parity, int bits, int flow); | 370 | int parity, int bits, int flow); |
371 | struct tty_driver *uart_console_device(struct console *co, int *index); | 371 | struct tty_driver *uart_console_device(struct console *co, int *index); |
372 | void uart_console_write(struct uart_port *port, const char *s, | ||
373 | unsigned int count, | ||
374 | void (*putchar)(struct uart_port *, int)); | ||
372 | 375 | ||
373 | /* | 376 | /* |
374 | * Port/driver registration/removal | 377 | * Port/driver registration/removal |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 8cf52939d0ab..2b28c849d75a 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -38,7 +38,6 @@ typedef struct kmem_cache kmem_cache_t; | |||
38 | #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ | 38 | #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ |
39 | #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ | 39 | #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ |
40 | #define SLAB_POISON 0x00000800UL /* Poison objects */ | 40 | #define SLAB_POISON 0x00000800UL /* Poison objects */ |
41 | #define SLAB_NO_REAP 0x00001000UL /* never reap from the cache */ | ||
42 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ | 41 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ |
43 | #define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ | 42 | #define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ |
44 | #define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ | 43 | #define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ |
@@ -118,7 +117,7 @@ extern void *kzalloc(size_t, gfp_t); | |||
118 | */ | 117 | */ |
119 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | 118 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
120 | { | 119 | { |
121 | if (n != 0 && size > INT_MAX / n) | 120 | if (n != 0 && size > ULONG_MAX / n) |
122 | return NULL; | 121 | return NULL; |
123 | return kzalloc(n * size, flags); | 122 | return kzalloc(n * size, flags); |
124 | } | 123 | } |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 44153fdf73fc..d699a16b0cb2 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -52,23 +52,12 @@ extern void smp_cpus_done(unsigned int max_cpus); | |||
52 | /* | 52 | /* |
53 | * Call a function on all other processors | 53 | * Call a function on all other processors |
54 | */ | 54 | */ |
55 | extern int smp_call_function (void (*func) (void *info), void *info, | 55 | int smp_call_function(void(*func)(void *info), void *info, int retry, int wait); |
56 | int retry, int wait); | ||
57 | 56 | ||
58 | /* | 57 | /* |
59 | * Call a function on all processors | 58 | * Call a function on all processors |
60 | */ | 59 | */ |
61 | static inline int on_each_cpu(void (*func) (void *info), void *info, | 60 | int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait); |
62 | int retry, int wait) | ||
63 | { | ||
64 | int ret = 0; | ||
65 | |||
66 | preempt_disable(); | ||
67 | ret = smp_call_function(func, info, retry, wait); | ||
68 | func(info); | ||
69 | preempt_enable(); | ||
70 | return ret; | ||
71 | } | ||
72 | 61 | ||
73 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ | 62 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ |
74 | #define MSG_ALL 0x8001 | 63 | #define MSG_ALL 0x8001 |
@@ -94,7 +83,13 @@ void smp_prepare_boot_cpu(void); | |||
94 | #define raw_smp_processor_id() 0 | 83 | #define raw_smp_processor_id() 0 |
95 | #define hard_smp_processor_id() 0 | 84 | #define hard_smp_processor_id() 0 |
96 | #define smp_call_function(func,info,retry,wait) ({ 0; }) | 85 | #define smp_call_function(func,info,retry,wait) ({ 0; }) |
97 | #define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) | 86 | #define on_each_cpu(func,info,retry,wait) \ |
87 | ({ \ | ||
88 | local_irq_disable(); \ | ||
89 | func(info); \ | ||
90 | local_irq_enable(); \ | ||
91 | 0; \ | ||
92 | }) | ||
98 | static inline void smp_send_reschedule(int cpu) { } | 93 | static inline void smp_send_reschedule(int cpu) { } |
99 | #define num_booting_cpus() 1 | 94 | #define num_booting_cpus() 1 |
100 | #define smp_prepare_boot_cpu() do {} while (0) | 95 | #define smp_prepare_boot_cpu() do {} while (0) |
diff --git a/include/linux/swap.h b/include/linux/swap.h index d572b19afb7d..12415dd94451 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -172,9 +172,24 @@ 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 **, gfp_t); | 175 | extern unsigned long try_to_free_pages(struct zone **, gfp_t); |
176 | extern int shrink_all_memory(int); | 176 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
177 | extern int vm_swappiness; | 177 | extern int vm_swappiness; |
178 | extern int remove_mapping(struct address_space *mapping, struct page *page); | ||
179 | |||
180 | /* possible outcome of pageout() */ | ||
181 | typedef enum { | ||
182 | /* failed to write page out, page is locked */ | ||
183 | PAGE_KEEP, | ||
184 | /* move page to the active list, page is locked */ | ||
185 | PAGE_ACTIVATE, | ||
186 | /* page has been sent to the disk successfully, page is unlocked */ | ||
187 | PAGE_SUCCESS, | ||
188 | /* page is clean and locked */ | ||
189 | PAGE_CLEAN, | ||
190 | } pageout_t; | ||
191 | |||
192 | extern pageout_t pageout(struct page *page, struct address_space *mapping); | ||
178 | 193 | ||
179 | #ifdef CONFIG_NUMA | 194 | #ifdef CONFIG_NUMA |
180 | extern int zone_reclaim_mode; | 195 | extern int zone_reclaim_mode; |
@@ -188,25 +203,6 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
188 | } | 203 | } |
189 | #endif | 204 | #endif |
190 | 205 | ||
191 | #ifdef CONFIG_MIGRATION | ||
192 | extern int isolate_lru_page(struct page *p); | ||
193 | extern int putback_lru_pages(struct list_head *l); | ||
194 | extern int migrate_page(struct page *, struct page *); | ||
195 | extern void migrate_page_copy(struct page *, struct page *); | ||
196 | extern int migrate_page_remove_references(struct page *, struct page *, int); | ||
197 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
198 | struct list_head *moved, struct list_head *failed); | ||
199 | extern int fail_migrate_page(struct page *, struct page *); | ||
200 | #else | ||
201 | static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } | ||
202 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | ||
203 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | ||
204 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | ||
205 | /* Possible settings for the migrate_page() method in address_operations */ | ||
206 | #define migrate_page NULL | ||
207 | #define fail_migrate_page NULL | ||
208 | #endif | ||
209 | |||
210 | #ifdef CONFIG_MMU | 206 | #ifdef CONFIG_MMU |
211 | /* linux/mm/shmem.c */ | 207 | /* linux/mm/shmem.c */ |
212 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 208 | extern int shmem_unuse(swp_entry_t entry, struct page *page); |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 86b111300231..957c21c16d62 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -20,6 +20,10 @@ struct work_struct { | |||
20 | struct timer_list timer; | 20 | struct timer_list timer; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | struct execute_work { | ||
24 | struct work_struct work; | ||
25 | }; | ||
26 | |||
23 | #define __WORK_INITIALIZER(n, f, d) { \ | 27 | #define __WORK_INITIALIZER(n, f, d) { \ |
24 | .entry = { &(n).entry, &(n).entry }, \ | 28 | .entry = { &(n).entry, &(n).entry }, \ |
25 | .func = (f), \ | 29 | .func = (f), \ |
@@ -74,6 +78,8 @@ extern void init_workqueues(void); | |||
74 | void cancel_rearming_delayed_work(struct work_struct *work); | 78 | void cancel_rearming_delayed_work(struct work_struct *work); |
75 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, | 79 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, |
76 | struct work_struct *); | 80 | struct work_struct *); |
81 | int execute_in_process_context(void (*fn)(void *), void *, | ||
82 | struct execute_work *); | ||
77 | 83 | ||
78 | /* | 84 | /* |
79 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 85 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
diff --git a/include/linux/x25.h b/include/linux/x25.h index 16d44931afa0..d035e4e87d07 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef X25_KERNEL_H | 11 | #ifndef X25_KERNEL_H |
12 | #define X25_KERNEL_H | 12 | #define X25_KERNEL_H |
13 | 13 | ||
14 | #include <linux/types.h> | ||
15 | |||
14 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) | 16 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) |
15 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) | 17 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) |
16 | #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) | 18 | #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) |
@@ -21,6 +23,8 @@ | |||
21 | #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) | 23 | #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) |
22 | #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) | 24 | #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) |
23 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) | 25 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) |
26 | #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) | ||
27 | #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) | ||
24 | 28 | ||
25 | /* | 29 | /* |
26 | * Values for {get,set}sockopt. | 30 | * Values for {get,set}sockopt. |
@@ -77,6 +81,8 @@ struct x25_subscrip_struct { | |||
77 | #define X25_MASK_PACKET_SIZE 0x04 | 81 | #define X25_MASK_PACKET_SIZE 0x04 |
78 | #define X25_MASK_WINDOW_SIZE 0x08 | 82 | #define X25_MASK_WINDOW_SIZE 0x08 |
79 | 83 | ||
84 | #define X25_MASK_CALLING_AE 0x10 | ||
85 | #define X25_MASK_CALLED_AE 0x20 | ||
80 | 86 | ||
81 | 87 | ||
82 | /* | 88 | /* |
@@ -99,6 +105,26 @@ struct x25_facilities { | |||
99 | }; | 105 | }; |
100 | 106 | ||
101 | /* | 107 | /* |
108 | * ITU DTE facilities | ||
109 | * Only the called and calling address | ||
110 | * extension are currently implemented. | ||
111 | * The rest are in place to avoid the struct | ||
112 | * changing size if someone needs them later | ||
113 | */ | ||
114 | |||
115 | struct x25_dte_facilities { | ||
116 | __u16 delay_cumul; | ||
117 | __u16 delay_target; | ||
118 | __u16 delay_max; | ||
119 | __u8 min_throughput; | ||
120 | __u8 expedited; | ||
121 | __u8 calling_len; | ||
122 | __u8 called_len; | ||
123 | __u8 calling_ae[20]; | ||
124 | __u8 called_ae[20]; | ||
125 | }; | ||
126 | |||
127 | /* | ||
102 | * Call User Data structure. | 128 | * Call User Data structure. |
103 | */ | 129 | */ |
104 | struct x25_calluserdata { | 130 | struct x25_calluserdata { |