aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/acpi.h8
-rw-r--r--include/linux/aer.h25
-rw-r--r--include/linux/aio.h2
-rw-r--r--include/linux/apm_bios.h20
-rw-r--r--include/linux/async_tx.h6
-rw-r--r--include/linux/ata.h22
-rw-r--r--include/linux/audit.h36
-rw-r--r--include/linux/backlight.h11
-rw-r--r--include/linux/binfmts.h19
-rw-r--r--include/linux/bio.h3
-rw-r--r--include/linux/blkdev.h150
-rw-r--r--include/linux/blktrace_api.h5
-rw-r--r--include/linux/bsg.h25
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/clockchips.h6
-rw-r--r--include/linux/clocksource.h6
-rw-r--r--include/linux/coda_linux.h4
-rw-r--r--include/linux/coda_proc.h76
-rw-r--r--include/linux/coda_psdev.h15
-rw-r--r--include/linux/compiler-gcc4.h18
-rw-r--r--include/linux/compiler.h13
-rw-r--r--include/linux/cpu.h8
-rw-r--r--include/linux/dcookies.h1
-rw-r--r--include/linux/device.h13
-rw-r--r--include/linux/dvb/video.h1
-rw-r--r--include/linux/edac.h29
-rw-r--r--include/linux/elevator.h76
-rw-r--r--include/linux/elf-em.h3
-rw-r--r--include/linux/elfnote.h22
-rw-r--r--include/linux/ethtool.h4
-rw-r--r--include/linux/ext4_fs.h104
-rw-r--r--include/linux/ext4_fs_extents.h43
-rw-r--r--include/linux/ext4_fs_i.h5
-rw-r--r--include/linux/ext4_fs_sb.h3
-rw-r--r--include/linux/falloc.h6
-rw-r--r--include/linux/freezer.h15
-rw-r--r--include/linux/fs.h35
-rw-r--r--include/linux/fsl_devices.h1
-rw-r--r--include/linux/genetlink.h13
-rw-r--r--include/linux/genhd.h2
-rw-r--r--include/linux/highmem.h15
-rw-r--r--include/linux/hugetlb.h12
-rw-r--r--include/linux/i2c-id.h7
-rw-r--r--include/linux/i2c-isa.h36
-rw-r--r--include/linux/i2c.h5
-rw-r--r--include/linux/i2o.h3
-rw-r--r--include/linux/ide.h52
-rw-r--r--include/linux/if_pppol2tp.h4
-rw-r--r--include/linux/init.h8
-rw-r--r--include/linux/input.h6
-rw-r--r--include/linux/interrupt.h6
-rw-r--r--include/linux/ioprio.h8
-rw-r--r--include/linux/ipv6.h5
-rw-r--r--include/linux/irda.h1
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/jbd2.h6
-rw-r--r--include/linux/kbd_kern.h3
-rw-r--r--include/linux/kdebug.h2
-rw-r--r--include/linux/kernel.h13
-rw-r--r--include/linux/kmod.h52
-rw-r--r--include/linux/kobject.h51
-rw-r--r--include/linux/kprobes.h6
-rw-r--r--include/linux/lcd.h14
-rw-r--r--include/linux/leds.h17
-rw-r--r--include/linux/lguest.h116
-rw-r--r--include/linux/lguest_bus.h51
-rw-r--r--include/linux/lguest_launcher.h127
-rw-r--r--include/linux/libata.h39
-rw-r--r--include/linux/lockdep.h71
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/major.h2
-rw-r--r--include/linux/mempolicy.h2
-rw-r--r--include/linux/mm.h143
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmzone.h19
-rw-r--r--include/linux/mod_devicetable.h7
-rw-r--r--include/linux/mv643xx.h8
-rw-r--r--include/linux/namei.h4
-rw-r--r--include/linux/netdevice.h6
-rw-r--r--include/linux/netfilter.h5
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/xt_connlimit.h4
-rw-r--r--include/linux/netfilter_ipv4/ipt_iprange.h2
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs_fs.h7
-rw-r--r--include/linux/nfs_xdr.h32
-rw-r--r--include/linux/nfsd/export.h13
-rw-r--r--include/linux/notifier.h19
-rw-r--r--include/linux/of.h61
-rw-r--r--include/linux/of_device.h26
-rw-r--r--include/linux/of_platform.h57
-rw-r--r--include/linux/oprofile.h35
-rw-r--r--include/linux/page-flags.h50
-rw-r--r--include/linux/pci.h5
-rw-r--r--include/linux/pci_ids.h43
-rw-r--r--include/linux/pm.h28
-rw-r--r--include/linux/pmu.h2
-rw-r--r--include/linux/pnp.h191
-rw-r--r--include/linux/pnpbios.h60
-rw-r--r--include/linux/poll.h2
-rw-r--r--include/linux/preempt.h44
-rw-r--r--include/linux/proc_fs.h1
-rw-r--r--include/linux/raid/md_k.h4
-rw-r--r--include/linux/rcupdate.h1
-rw-r--r--include/linux/reboot.h5
-rw-r--r--include/linux/reiserfs_fs.h8
-rw-r--r--include/linux/resume-trace.h19
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/sched.h100
-rw-r--r--include/linux/security.h20
-rw-r--r--include/linux/selection.h2
-rw-r--r--include/linux/serial_8250.h4
-rw-r--r--include/linux/serial_core.h7
-rw-r--r--include/linux/serial_reg.h1
-rw-r--r--include/linux/signal.h3
-rw-r--r--include/linux/skbuff.h4
-rw-r--r--include/linux/slab.h5
-rw-r--r--include/linux/slub_def.h10
-rw-r--r--include/linux/spi/spi.h59
-rw-r--r--include/linux/spi/spidev.h4
-rw-r--r--include/linux/spinlock_types.h4
-rw-r--r--include/linux/spinlock_types_up.h9
-rw-r--r--include/linux/stacktrace.h2
-rw-r--r--include/linux/string.h4
-rw-r--r--include/linux/sunrpc/xdr.h16
-rw-r--r--include/linux/suspend.h57
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--include/linux/time.h11
-rw-r--r--include/linux/timex.h60
-rw-r--r--include/linux/topology.h1
-rw-r--r--include/linux/tty.h2
-rw-r--r--include/linux/uio_driver.h91
-rw-r--r--include/linux/usb.h2
-rw-r--r--include/linux/user_namespace.h2
-rw-r--r--include/linux/videodev2.h3
-rw-r--r--include/linux/vmalloc.h11
138 files changed, 2107 insertions, 911 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index bcf875e844fe..818cc3a50e6b 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -7,6 +7,7 @@ header-y += raid/
7header-y += spi/ 7header-y += spi/
8header-y += sunrpc/ 8header-y += sunrpc/
9header-y += tc_act/ 9header-y += tc_act/
10header-y += tc_ematch/
10header-y += netfilter/ 11header-y += netfilter/
11header-y += netfilter_arp/ 12header-y += netfilter_arp/
12header-y += netfilter_bridge/ 13header-y += netfilter_bridge/
@@ -137,6 +138,7 @@ header-y += radeonfb.h
137header-y += raw.h 138header-y += raw.h
138header-y += resource.h 139header-y += resource.h
139header-y += rose.h 140header-y += rose.h
141header-y += serial_reg.h
140header-y += smbno.h 142header-y += smbno.h
141header-y += snmp.h 143header-y += snmp.h
142header-y += sockios.h 144header-y += sockios.h
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index fccd8b548d93..bf5e0009de75 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -33,6 +33,7 @@
33#endif 33#endif
34 34
35#include <linux/list.h> 35#include <linux/list.h>
36#include <linux/mod_devicetable.h>
36 37
37#include <acpi/acpi.h> 38#include <acpi/acpi.h>
38#include <acpi/acpi_bus.h> 39#include <acpi/acpi_bus.h>
@@ -88,10 +89,8 @@ int acpi_table_parse (char *id, acpi_table_handler handler);
88int __init acpi_table_parse_entries(char *id, unsigned long table_size, 89int __init acpi_table_parse_entries(char *id, unsigned long table_size,
89 int entry_id, acpi_table_entry_handler handler, unsigned int max_entries); 90 int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
90int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries); 91int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries);
91int acpi_table_parse_srat (enum acpi_srat_type id, acpi_table_entry_handler handler, unsigned int max_entries);
92int acpi_parse_mcfg (struct acpi_table_header *header); 92int acpi_parse_mcfg (struct acpi_table_header *header);
93void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); 93void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
94void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
95 94
96/* the following four functions are architecture-dependent */ 95/* the following four functions are architecture-dependent */
97#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT 96#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
@@ -122,7 +121,7 @@ extern struct acpi_mcfg_allocation *pci_mmcfg_config;
122extern int pci_mmcfg_config_num; 121extern int pci_mmcfg_config_num;
123 122
124extern int sbf_port; 123extern int sbf_port;
125extern unsigned long acpi_video_flags; 124extern unsigned long acpi_realmode_flags;
126 125
127#else /* !CONFIG_ACPI */ 126#else /* !CONFIG_ACPI */
128 127
@@ -233,6 +232,9 @@ extern int acpi_paddr_to_node(u64 start_addr, u64 size);
233 232
234extern int pnpacpi_disabled; 233extern int pnpacpi_disabled;
235 234
235#define PXM_INVAL (-1)
236#define NID_INVAL (-1)
237
236#else /* CONFIG_ACPI */ 238#else /* CONFIG_ACPI */
237 239
238static inline int acpi_boot_init(void) 240static inline int acpi_boot_init(void)
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 509656286e53..bcf236d825e8 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -15,11 +15,26 @@ extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev); 16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev);
17#else 17#else
18#define pci_enable_pcie_error_reporting(dev) (-EINVAL) 18static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
19#define pci_find_aer_capability(dev) (0) 19{
20#define pci_disable_pcie_error_reporting(dev) (-EINVAL) 20 return -EINVAL;
21#define pci_cleanup_aer_uncorrect_error_status(dev) (-EINVAL) 21}
22#define pci_cleanup_aer_correct_error_status(dev) (-EINVAL) 22static inline int pci_find_aer_capability(struct pci_dev *dev)
23{
24 return 0;
25}
26static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
27{
28 return -EINVAL;
29}
30static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
31{
32 return -EINVAL;
33}
34static inline int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
35{
36 return -EINVAL;
37}
23#endif 38#endif
24 39
25#endif //_AER_H_ 40#endif //_AER_H_
diff --git a/include/linux/aio.h b/include/linux/aio.h
index b903fc02bdb7..d10e608f232d 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -86,7 +86,7 @@ struct kioctx;
86 */ 86 */
87struct kiocb { 87struct kiocb {
88 struct list_head ki_run_list; 88 struct list_head ki_run_list;
89 long ki_flags; 89 unsigned long ki_flags;
90 int ki_users; 90 int ki_users;
91 unsigned ki_key; /* id of this request */ 91 unsigned ki_key; /* id of this request */
92 92
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h
index 290aef326812..5f921c84827a 100644
--- a/include/linux/apm_bios.h
+++ b/include/linux/apm_bios.h
@@ -21,20 +21,22 @@ typedef unsigned short apm_eventinfo_t;
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23 23
24#include <linux/types.h>
25
24#define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) 26#define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8)
25#define APM_CS_16 (APM_CS + 8) 27#define APM_CS_16 (APM_CS + 8)
26#define APM_DS (APM_CS_16 + 8) 28#define APM_DS (APM_CS_16 + 8)
27 29
28struct apm_bios_info { 30struct apm_bios_info {
29 unsigned short version; 31 u16 version;
30 unsigned short cseg; 32 u16 cseg;
31 unsigned long offset; 33 u32 offset;
32 unsigned short cseg_16; 34 u16 cseg_16;
33 unsigned short dseg; 35 u16 dseg;
34 unsigned short flags; 36 u16 flags;
35 unsigned short cseg_len; 37 u16 cseg_len;
36 unsigned short cseg_16_len; 38 u16 cseg_16_len;
37 unsigned short dseg_len; 39 u16 dseg_len;
38}; 40};
39 41
40/* Results of APM Installation Check */ 42/* Results of APM Installation Check */
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h
index ff1255079fa1..bdca3f1b3213 100644
--- a/include/linux/async_tx.h
+++ b/include/linux/async_tx.h
@@ -51,10 +51,6 @@ struct dma_chan_ref {
51 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a 51 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
52 * dependency chain 52 * dependency chain
53 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. 53 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
54 * @ASYNC_TX_KMAP_SRC: if the transaction is to be performed synchronously
55 * take an atomic mapping (KM_USER0) on the source page(s)
56 * @ASYNC_TX_KMAP_DST: if the transaction is to be performed synchronously
57 * take an atomic mapping (KM_USER0) on the dest page(s)
58 */ 54 */
59enum async_tx_flags { 55enum async_tx_flags {
60 ASYNC_TX_XOR_ZERO_DST = (1 << 0), 56 ASYNC_TX_XOR_ZERO_DST = (1 << 0),
@@ -62,8 +58,6 @@ enum async_tx_flags {
62 ASYNC_TX_ASSUME_COHERENT = (1 << 2), 58 ASYNC_TX_ASSUME_COHERENT = (1 << 2),
63 ASYNC_TX_ACK = (1 << 3), 59 ASYNC_TX_ACK = (1 << 3),
64 ASYNC_TX_DEP_ACK = (1 << 4), 60 ASYNC_TX_DEP_ACK = (1 << 4),
65 ASYNC_TX_KMAP_SRC = (1 << 5),
66 ASYNC_TX_KMAP_DST = (1 << 6),
67}; 61};
68 62
69#ifdef CONFIG_DMA_ENGINE 63#ifdef CONFIG_DMA_ENGINE
diff --git a/include/linux/ata.h b/include/linux/ata.h
index b5a20162af32..c043c1ccf1c5 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -64,6 +64,28 @@ enum {
64 ATA_ID_PROD_LEN = 40, 64 ATA_ID_PROD_LEN = 40,
65 65
66 ATA_PCI_CTL_OFS = 2, 66 ATA_PCI_CTL_OFS = 2,
67
68 ATA_PIO0 = (1 << 0),
69 ATA_PIO1 = ATA_PIO0 | (1 << 1),
70 ATA_PIO2 = ATA_PIO1 | (1 << 2),
71 ATA_PIO3 = ATA_PIO2 | (1 << 3),
72 ATA_PIO4 = ATA_PIO3 | (1 << 4),
73 ATA_PIO5 = ATA_PIO4 | (1 << 5),
74 ATA_PIO6 = ATA_PIO5 | (1 << 6),
75
76 ATA_SWDMA0 = (1 << 0),
77 ATA_SWDMA1 = ATA_SWDMA0 | (1 << 1),
78 ATA_SWDMA2 = ATA_SWDMA1 | (1 << 2),
79
80 ATA_SWDMA2_ONLY = (1 << 2),
81
82 ATA_MWDMA0 = (1 << 0),
83 ATA_MWDMA1 = ATA_MWDMA0 | (1 << 1),
84 ATA_MWDMA2 = ATA_MWDMA1 | (1 << 2),
85
86 ATA_MWDMA12_ONLY = (1 << 1) | (1 << 2),
87 ATA_MWDMA2_ONLY = (1 << 2),
88
67 ATA_UDMA0 = (1 << 0), 89 ATA_UDMA0 = (1 << 0),
68 ATA_UDMA1 = ATA_UDMA0 | (1 << 1), 90 ATA_UDMA1 = ATA_UDMA0 | (1 << 1),
69 ATA_UDMA2 = ATA_UDMA1 | (1 << 2), 91 ATA_UDMA2 = ATA_UDMA1 | (1 << 2),
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 8ca7ca0b47f0..d6579df8dadf 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -63,8 +63,8 @@
63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */ 63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */ 64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */ 65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
66#define AUDIT_TTY_GET 1014 /* Get TTY auditing status */ 66#define AUDIT_TTY_GET 1016 /* Get TTY auditing status */
67#define AUDIT_TTY_SET 1015 /* Set TTY auditing status */ 67#define AUDIT_TTY_SET 1017 /* Set TTY auditing status */
68 68
69#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ 69#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
70#define AUDIT_USER_AVC 1107 /* We filter this differently */ 70#define AUDIT_USER_AVC 1107 /* We filter this differently */
@@ -161,7 +161,7 @@
161 * are currently used in an audit field constant understood by the kernel. 161 * are currently used in an audit field constant understood by the kernel.
162 * If you are adding a new #define AUDIT_<whatever>, please ensure that 162 * If you are adding a new #define AUDIT_<whatever>, please ensure that
163 * AUDIT_UNUSED_BITS is updated if need be. */ 163 * AUDIT_UNUSED_BITS is updated if need be. */
164#define AUDIT_UNUSED_BITS 0x0FFFFC00 164#define AUDIT_UNUSED_BITS 0x07FFFC00
165 165
166 166
167/* Rule fields */ 167/* Rule fields */
@@ -213,25 +213,29 @@
213#define AUDIT_NEGATE 0x80000000 213#define AUDIT_NEGATE 0x80000000
214 214
215/* These are the supported operators. 215/* These are the supported operators.
216 * 4 2 1 216 * 4 2 1 8
217 * = > < 217 * = > < ?
218 * ------- 218 * ----------
219 * 0 0 0 0 nonsense 219 * 0 0 0 0 00 nonsense
220 * 0 0 1 1 < 220 * 0 0 0 1 08 & bit mask
221 * 0 1 0 2 > 221 * 0 0 1 0 10 <
222 * 0 1 1 3 != 222 * 0 1 0 0 20 >
223 * 1 0 0 4 = 223 * 0 1 1 0 30 !=
224 * 1 0 1 5 <= 224 * 1 0 0 0 40 =
225 * 1 1 0 6 >= 225 * 1 0 0 1 48 &= bit test
226 * 1 1 1 7 all operators 226 * 1 0 1 0 50 <=
227 * 1 1 0 0 60 >=
228 * 1 1 1 1 78 all operators
227 */ 229 */
230#define AUDIT_BIT_MASK 0x08000000
228#define AUDIT_LESS_THAN 0x10000000 231#define AUDIT_LESS_THAN 0x10000000
229#define AUDIT_GREATER_THAN 0x20000000 232#define AUDIT_GREATER_THAN 0x20000000
230#define AUDIT_NOT_EQUAL 0x30000000 233#define AUDIT_NOT_EQUAL 0x30000000
231#define AUDIT_EQUAL 0x40000000 234#define AUDIT_EQUAL 0x40000000
235#define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL)
232#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL) 236#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL)
233#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) 237#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL)
234#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL) 238#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
235 239
236/* Status symbols */ 240/* Status symbols */
237 /* Mask values */ 241 /* Mask values */
@@ -407,7 +411,6 @@ extern int audit_bprm(struct linux_binprm *bprm);
407extern int audit_socketcall(int nargs, unsigned long *args); 411extern int audit_socketcall(int nargs, unsigned long *args);
408extern int audit_sockaddr(int len, void *addr); 412extern int audit_sockaddr(int len, void *addr);
409extern int __audit_fd_pair(int fd1, int fd2); 413extern int __audit_fd_pair(int fd1, int fd2);
410extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt);
411extern int audit_set_macxattr(const char *name); 414extern int audit_set_macxattr(const char *name);
412extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); 415extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr);
413extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout); 416extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout);
@@ -487,7 +490,6 @@ extern int audit_signals;
487#define audit_socketcall(n,a) ({ 0; }) 490#define audit_socketcall(n,a) ({ 0; })
488#define audit_fd_pair(n,a) ({ 0; }) 491#define audit_fd_pair(n,a) ({ 0; })
489#define audit_sockaddr(len, addr) ({ 0; }) 492#define audit_sockaddr(len, addr) ({ 0; })
490#define audit_avc_path(dentry, mnt) ({ 0; })
491#define audit_set_macxattr(n) do { ; } while (0) 493#define audit_set_macxattr(n) do { ; } while (0)
492#define audit_mq_open(o,m,a) ({ 0; }) 494#define audit_mq_open(o,m,a) ({ 0; })
493#define audit_mq_timedsend(d,l,p,t) ({ 0; }) 495#define audit_mq_timedsend(d,l,p,t) ({ 0; })
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 1023ba0d6e55..c897c7b03858 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -69,8 +69,8 @@ struct backlight_device {
69 69
70 /* The framebuffer notifier block */ 70 /* The framebuffer notifier block */
71 struct notifier_block fb_notif; 71 struct notifier_block fb_notif;
72 /* The class device structure */ 72
73 struct class_device class_dev; 73 struct device dev;
74}; 74};
75 75
76static inline void backlight_update_status(struct backlight_device *bd) 76static inline void backlight_update_status(struct backlight_device *bd)
@@ -85,6 +85,11 @@ extern struct backlight_device *backlight_device_register(const char *name,
85 struct device *dev, void *devdata, struct backlight_ops *ops); 85 struct device *dev, void *devdata, struct backlight_ops *ops);
86extern void backlight_device_unregister(struct backlight_device *bd); 86extern void backlight_device_unregister(struct backlight_device *bd);
87 87
88#define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev) 88#define to_backlight_device(obj) container_of(obj, struct backlight_device, dev)
89
90static inline void * bl_get_data(struct backlight_device *bl_dev)
91{
92 return dev_get_drvdata(&bl_dev->dev);
93}
89 94
90#endif 95#endif
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index e1a708337be3..91c8c07fe8b7 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -6,11 +6,13 @@
6struct pt_regs; 6struct pt_regs;
7 7
8/* 8/*
9 * MAX_ARG_PAGES defines the number of pages allocated for arguments 9 * These are the maximum length and maximum number of strings passed to the
10 * and envelope for the new program. 32 should suffice, this gives 10 * execve() system call. MAX_ARG_STRLEN is essentially random but serves to
11 * a maximum env+arg of 128kB w/4KB pages! 11 * prevent the kernel from being unduly impacted by misaddressed pointers.
12 * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
12 */ 13 */
13#define MAX_ARG_PAGES 32 14#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
15#define MAX_ARG_STRINGS 0x7FFFFFFF
14 16
15/* sizeof(linux_binprm->buf) */ 17/* sizeof(linux_binprm->buf) */
16#define BINPRM_BUF_SIZE 128 18#define BINPRM_BUF_SIZE 128
@@ -24,7 +26,12 @@ struct pt_regs;
24 */ 26 */
25struct linux_binprm{ 27struct linux_binprm{
26 char buf[BINPRM_BUF_SIZE]; 28 char buf[BINPRM_BUF_SIZE];
29#ifdef CONFIG_MMU
30 struct vm_area_struct *vma;
31#else
32# define MAX_ARG_PAGES 32
27 struct page *page[MAX_ARG_PAGES]; 33 struct page *page[MAX_ARG_PAGES];
34#endif
28 struct mm_struct *mm; 35 struct mm_struct *mm;
29 unsigned long p; /* current top of mem */ 36 unsigned long p; /* current top of mem */
30 int sh_bang; 37 int sh_bang;
@@ -40,6 +47,7 @@ struct linux_binprm{
40 unsigned interp_flags; 47 unsigned interp_flags;
41 unsigned interp_data; 48 unsigned interp_data;
42 unsigned long loader, exec; 49 unsigned long loader, exec;
50 unsigned long argv_len;
43}; 51};
44 52
45#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 53#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0
@@ -68,7 +76,7 @@ extern int register_binfmt(struct linux_binfmt *);
68extern int unregister_binfmt(struct linux_binfmt *); 76extern int unregister_binfmt(struct linux_binfmt *);
69 77
70extern int prepare_binprm(struct linux_binprm *); 78extern int prepare_binprm(struct linux_binprm *);
71extern void remove_arg_zero(struct linux_binprm *); 79extern int __must_check remove_arg_zero(struct linux_binprm *);
72extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); 80extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
73extern int flush_old_exec(struct linux_binprm * bprm); 81extern int flush_old_exec(struct linux_binprm * bprm);
74 82
@@ -85,6 +93,7 @@ extern int suid_dumpable;
85extern int setup_arg_pages(struct linux_binprm * bprm, 93extern int setup_arg_pages(struct linux_binprm * bprm,
86 unsigned long stack_top, 94 unsigned long stack_top,
87 int executable_stack); 95 int executable_stack);
96extern int bprm_mm_init(struct linux_binprm *bprm);
88extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); 97extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
89extern void compute_creds(struct linux_binprm *binprm); 98extern void compute_creds(struct linux_binprm *binprm);
90extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); 99extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 4d85262b4fa4..1ddef34f43c3 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -24,6 +24,8 @@
24#include <linux/mempool.h> 24#include <linux/mempool.h>
25#include <linux/ioprio.h> 25#include <linux/ioprio.h>
26 26
27#ifdef CONFIG_BLOCK
28
27/* Platforms may set this to teach the BIO layer about IOMMU hardware. */ 29/* Platforms may set this to teach the BIO layer about IOMMU hardware. */
28#include <asm/io.h> 30#include <asm/io.h>
29 31
@@ -361,4 +363,5 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
361 __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) 363 __bio_kmap_irq((bio), (bio)->bi_idx, (flags))
362#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) 364#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
363 365
366#endif /* CONFIG_BLOCK */
364#endif /* __LINUX_BIO_H */ 367#endif /* __LINUX_BIO_H */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f78965fc6426..b126c6f68e27 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -37,7 +37,7 @@
37struct scsi_ioctl_command; 37struct scsi_ioctl_command;
38 38
39struct request_queue; 39struct request_queue;
40typedef struct request_queue request_queue_t; 40typedef struct request_queue request_queue_t __deprecated;
41struct elevator_queue; 41struct elevator_queue;
42typedef struct elevator_queue elevator_t; 42typedef struct elevator_queue elevator_t;
43struct request_pm_state; 43struct request_pm_state;
@@ -233,7 +233,7 @@ struct request {
233 struct list_head queuelist; 233 struct list_head queuelist;
234 struct list_head donelist; 234 struct list_head donelist;
235 235
236 request_queue_t *q; 236 struct request_queue *q;
237 237
238 unsigned int cmd_flags; 238 unsigned int cmd_flags;
239 enum rq_cmd_type_bits cmd_type; 239 enum rq_cmd_type_bits cmd_type;
@@ -337,15 +337,15 @@ struct request_pm_state
337 337
338#include <linux/elevator.h> 338#include <linux/elevator.h>
339 339
340typedef void (request_fn_proc) (request_queue_t *q); 340typedef void (request_fn_proc) (struct request_queue *q);
341typedef int (make_request_fn) (request_queue_t *q, struct bio *bio); 341typedef int (make_request_fn) (struct request_queue *q, struct bio *bio);
342typedef int (prep_rq_fn) (request_queue_t *, struct request *); 342typedef int (prep_rq_fn) (struct request_queue *, struct request *);
343typedef void (unplug_fn) (request_queue_t *); 343typedef void (unplug_fn) (struct request_queue *);
344 344
345struct bio_vec; 345struct bio_vec;
346typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); 346typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *);
347typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); 347typedef int (issue_flush_fn) (struct request_queue *, struct gendisk *, sector_t *);
348typedef void (prepare_flush_fn) (request_queue_t *, struct request *); 348typedef void (prepare_flush_fn) (struct request_queue *, struct request *);
349typedef void (softirq_done_fn)(struct request *); 349typedef void (softirq_done_fn)(struct request *);
350 350
351enum blk_queue_state { 351enum blk_queue_state {
@@ -483,8 +483,8 @@ struct request_queue
483#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 483#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
484#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ 484#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
485#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ 485#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */
486#define QUEUE_FLAG_READFULL 3 /* write queue has been filled */ 486#define QUEUE_FLAG_READFULL 3 /* read queue has been filled */
487#define QUEUE_FLAG_WRITEFULL 4 /* read queue has been filled */ 487#define QUEUE_FLAG_WRITEFULL 4 /* write queue has been filled */
488#define QUEUE_FLAG_DEAD 5 /* queue being torn down */ 488#define QUEUE_FLAG_DEAD 5 /* queue being torn down */
489#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ 489#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
490#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ 490#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
@@ -626,13 +626,13 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
626 626
627#ifdef CONFIG_BOUNCE 627#ifdef CONFIG_BOUNCE
628extern int init_emergency_isa_pool(void); 628extern int init_emergency_isa_pool(void);
629extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); 629extern void blk_queue_bounce(struct request_queue *q, struct bio **bio);
630#else 630#else
631static inline int init_emergency_isa_pool(void) 631static inline int init_emergency_isa_pool(void)
632{ 632{
633 return 0; 633 return 0;
634} 634}
635static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) 635static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio)
636{ 636{
637} 637}
638#endif /* CONFIG_MMU */ 638#endif /* CONFIG_MMU */
@@ -646,14 +646,14 @@ extern void blk_unregister_queue(struct gendisk *disk);
646extern void register_disk(struct gendisk *dev); 646extern void register_disk(struct gendisk *dev);
647extern void generic_make_request(struct bio *bio); 647extern void generic_make_request(struct bio *bio);
648extern void blk_put_request(struct request *); 648extern void blk_put_request(struct request *);
649extern void __blk_put_request(request_queue_t *, struct request *); 649extern void __blk_put_request(struct request_queue *, struct request *);
650extern void blk_end_sync_rq(struct request *rq, int error); 650extern void blk_end_sync_rq(struct request *rq, int error);
651extern struct request *blk_get_request(request_queue_t *, int, gfp_t); 651extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
652extern void blk_insert_request(request_queue_t *, struct request *, int, void *); 652extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
653extern void blk_requeue_request(request_queue_t *, struct request *); 653extern void blk_requeue_request(struct request_queue *, struct request *);
654extern void blk_plug_device(request_queue_t *); 654extern void blk_plug_device(struct request_queue *);
655extern int blk_remove_plug(request_queue_t *); 655extern int blk_remove_plug(struct request_queue *);
656extern void blk_recount_segments(request_queue_t *, struct bio *); 656extern void blk_recount_segments(struct request_queue *, struct bio *);
657extern int scsi_cmd_ioctl(struct file *, struct request_queue *, 657extern int scsi_cmd_ioctl(struct file *, struct request_queue *,
658 struct gendisk *, unsigned int, void __user *); 658 struct gendisk *, unsigned int, void __user *);
659extern int sg_scsi_ioctl(struct file *, struct request_queue *, 659extern int sg_scsi_ioctl(struct file *, struct request_queue *,
@@ -662,14 +662,15 @@ extern int sg_scsi_ioctl(struct file *, struct request_queue *,
662/* 662/*
663 * Temporary export, until SCSI gets fixed up. 663 * Temporary export, until SCSI gets fixed up.
664 */ 664 */
665extern int ll_back_merge_fn(request_queue_t *, struct request *, struct bio *); 665extern int ll_back_merge_fn(struct request_queue *, struct request *,
666 struct bio *);
666 667
667/* 668/*
668 * A queue has just exitted congestion. Note this in the global counter of 669 * A queue has just exitted congestion. Note this in the global counter of
669 * congested queues, and wake up anyone who was waiting for requests to be 670 * congested queues, and wake up anyone who was waiting for requests to be
670 * put back. 671 * put back.
671 */ 672 */
672static inline void blk_clear_queue_congested(request_queue_t *q, int rw) 673static inline void blk_clear_queue_congested(struct request_queue *q, int rw)
673{ 674{
674 clear_bdi_congested(&q->backing_dev_info, rw); 675 clear_bdi_congested(&q->backing_dev_info, rw);
675} 676}
@@ -678,34 +679,29 @@ static inline void blk_clear_queue_congested(request_queue_t *q, int rw)
678 * A queue has just entered congestion. Flag that in the queue's VM-visible 679 * A queue has just entered congestion. Flag that in the queue's VM-visible
679 * state flags and increment the global gounter of congested queues. 680 * state flags and increment the global gounter of congested queues.
680 */ 681 */
681static inline void blk_set_queue_congested(request_queue_t *q, int rw) 682static inline void blk_set_queue_congested(struct request_queue *q, int rw)
682{ 683{
683 set_bdi_congested(&q->backing_dev_info, rw); 684 set_bdi_congested(&q->backing_dev_info, rw);
684} 685}
685 686
686extern void blk_start_queue(request_queue_t *q); 687extern void blk_start_queue(struct request_queue *q);
687extern void blk_stop_queue(request_queue_t *q); 688extern void blk_stop_queue(struct request_queue *q);
688extern void blk_sync_queue(struct request_queue *q); 689extern void blk_sync_queue(struct request_queue *q);
689extern void __blk_stop_queue(request_queue_t *q); 690extern void __blk_stop_queue(struct request_queue *q);
690extern void blk_run_queue(request_queue_t *); 691extern void blk_run_queue(struct request_queue *);
691extern void blk_start_queueing(request_queue_t *); 692extern void blk_start_queueing(struct request_queue *);
692extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long); 693extern int blk_rq_map_user(struct request_queue *, struct request *, void __user *, unsigned long);
693extern int blk_rq_unmap_user(struct bio *); 694extern int blk_rq_unmap_user(struct bio *);
694extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); 695extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t);
695extern int blk_rq_map_user_iov(request_queue_t *, struct request *, 696extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
696 struct sg_iovec *, int, unsigned int); 697 struct sg_iovec *, int, unsigned int);
697extern int blk_execute_rq(request_queue_t *, struct gendisk *, 698extern int blk_execute_rq(struct request_queue *, struct gendisk *,
698 struct request *, int); 699 struct request *, int);
699extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, 700extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
700 struct request *, int, rq_end_io_fn *); 701 struct request *, int, rq_end_io_fn *);
701extern int blk_fill_sghdr_rq(request_queue_t *, struct request *,
702 struct sg_io_hdr *, int);
703extern int blk_unmap_sghdr_rq(struct request *, struct sg_io_hdr *);
704extern int blk_complete_sghdr_rq(struct request *, struct sg_io_hdr *,
705 struct bio *);
706extern int blk_verify_command(unsigned char *, int); 702extern int blk_verify_command(unsigned char *, int);
707 703
708static inline request_queue_t *bdev_get_queue(struct block_device *bdev) 704static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
709{ 705{
710 return bdev->bd_disk->queue; 706 return bdev->bd_disk->queue;
711} 707}
@@ -754,41 +750,41 @@ static inline void blkdev_dequeue_request(struct request *req)
754/* 750/*
755 * Access functions for manipulating queue properties 751 * Access functions for manipulating queue properties
756 */ 752 */
757extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, 753extern struct request_queue *blk_init_queue_node(request_fn_proc *rfn,
758 spinlock_t *lock, int node_id); 754 spinlock_t *lock, int node_id);
759extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *); 755extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
760extern void blk_cleanup_queue(request_queue_t *); 756extern void blk_cleanup_queue(struct request_queue *);
761extern void blk_queue_make_request(request_queue_t *, make_request_fn *); 757extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
762extern void blk_queue_bounce_limit(request_queue_t *, u64); 758extern void blk_queue_bounce_limit(struct request_queue *, u64);
763extern void blk_queue_max_sectors(request_queue_t *, unsigned int); 759extern void blk_queue_max_sectors(struct request_queue *, unsigned int);
764extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short); 760extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short);
765extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short); 761extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short);
766extern void blk_queue_max_segment_size(request_queue_t *, unsigned int); 762extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
767extern void blk_queue_hardsect_size(request_queue_t *, unsigned short); 763extern void blk_queue_hardsect_size(struct request_queue *, unsigned short);
768extern void blk_queue_stack_limits(request_queue_t *t, request_queue_t *b); 764extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
769extern void blk_queue_segment_boundary(request_queue_t *, unsigned long); 765extern void blk_queue_segment_boundary(struct request_queue *, unsigned long);
770extern void blk_queue_prep_rq(request_queue_t *, prep_rq_fn *pfn); 766extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn);
771extern void blk_queue_merge_bvec(request_queue_t *, merge_bvec_fn *); 767extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *);
772extern void blk_queue_dma_alignment(request_queue_t *, int); 768extern void blk_queue_dma_alignment(struct request_queue *, int);
773extern void blk_queue_softirq_done(request_queue_t *, softirq_done_fn *); 769extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *);
774extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 770extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
775extern int blk_queue_ordered(request_queue_t *, unsigned, prepare_flush_fn *); 771extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *);
776extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *); 772extern void blk_queue_issue_flush_fn(struct request_queue *, issue_flush_fn *);
777extern int blk_do_ordered(request_queue_t *, struct request **); 773extern int blk_do_ordered(struct request_queue *, struct request **);
778extern unsigned blk_ordered_cur_seq(request_queue_t *); 774extern unsigned blk_ordered_cur_seq(struct request_queue *);
779extern unsigned blk_ordered_req_seq(struct request *); 775extern unsigned blk_ordered_req_seq(struct request *);
780extern void blk_ordered_complete_seq(request_queue_t *, unsigned, int); 776extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int);
781 777
782extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *); 778extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
783extern void blk_dump_rq_flags(struct request *, char *); 779extern void blk_dump_rq_flags(struct request *, char *);
784extern void generic_unplug_device(request_queue_t *); 780extern void generic_unplug_device(struct request_queue *);
785extern void __generic_unplug_device(request_queue_t *); 781extern void __generic_unplug_device(struct request_queue *);
786extern long nr_blockdev_pages(void); 782extern long nr_blockdev_pages(void);
787 783
788int blk_get_queue(request_queue_t *); 784int blk_get_queue(struct request_queue *);
789request_queue_t *blk_alloc_queue(gfp_t); 785struct request_queue *blk_alloc_queue(gfp_t);
790request_queue_t *blk_alloc_queue_node(gfp_t, int); 786struct request_queue *blk_alloc_queue_node(gfp_t, int);
791extern void blk_put_queue(request_queue_t *); 787extern void blk_put_queue(struct request_queue *);
792 788
793/* 789/*
794 * tag stuff 790 * tag stuff
@@ -796,13 +792,13 @@ extern void blk_put_queue(request_queue_t *);
796#define blk_queue_tag_depth(q) ((q)->queue_tags->busy) 792#define blk_queue_tag_depth(q) ((q)->queue_tags->busy)
797#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) 793#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth)
798#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) 794#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED)
799extern int blk_queue_start_tag(request_queue_t *, struct request *); 795extern int blk_queue_start_tag(struct request_queue *, struct request *);
800extern struct request *blk_queue_find_tag(request_queue_t *, int); 796extern struct request *blk_queue_find_tag(struct request_queue *, int);
801extern void blk_queue_end_tag(request_queue_t *, struct request *); 797extern void blk_queue_end_tag(struct request_queue *, struct request *);
802extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *); 798extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *);
803extern void blk_queue_free_tags(request_queue_t *); 799extern void blk_queue_free_tags(struct request_queue *);
804extern int blk_queue_resize_tags(request_queue_t *, int); 800extern int blk_queue_resize_tags(struct request_queue *, int);
805extern void blk_queue_invalidate_tags(request_queue_t *); 801extern void blk_queue_invalidate_tags(struct request_queue *);
806extern struct blk_queue_tag *blk_init_tags(int); 802extern struct blk_queue_tag *blk_init_tags(int);
807extern void blk_free_tags(struct blk_queue_tag *); 803extern void blk_free_tags(struct blk_queue_tag *);
808 804
@@ -814,7 +810,7 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
814 return bqt->tag_index[tag]; 810 return bqt->tag_index[tag];
815} 811}
816 812
817extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); 813extern void blk_rq_bio_prep(struct request_queue *, struct request *, struct bio *);
818extern int blkdev_issue_flush(struct block_device *, sector_t *); 814extern int blkdev_issue_flush(struct block_device *, sector_t *);
819 815
820#define MAX_PHYS_SEGMENTS 128 816#define MAX_PHYS_SEGMENTS 128
@@ -826,7 +822,7 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *);
826 822
827#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) 823#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
828 824
829static inline int queue_hardsect_size(request_queue_t *q) 825static inline int queue_hardsect_size(struct request_queue *q)
830{ 826{
831 int retval = 512; 827 int retval = 512;
832 828
@@ -841,7 +837,7 @@ static inline int bdev_hardsect_size(struct block_device *bdev)
841 return queue_hardsect_size(bdev_get_queue(bdev)); 837 return queue_hardsect_size(bdev_get_queue(bdev));
842} 838}
843 839
844static inline int queue_dma_alignment(request_queue_t *q) 840static inline int queue_dma_alignment(struct request_queue *q)
845{ 841{
846 int retval = 511; 842 int retval = 511;
847 843
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 3680ff9a30ed..7b5d56b82b59 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -105,7 +105,7 @@ struct blk_io_trace {
105 */ 105 */
106struct blk_io_trace_remap { 106struct blk_io_trace_remap {
107 __be32 device; 107 __be32 device;
108 u32 __pad; 108 __be32 device_from;
109 __be64 sector; 109 __be64 sector;
110}; 110};
111 111
@@ -144,7 +144,7 @@ struct blk_user_trace_setup {
144 144
145#if defined(CONFIG_BLK_DEV_IO_TRACE) 145#if defined(CONFIG_BLK_DEV_IO_TRACE)
146extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); 146extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
147extern void blk_trace_shutdown(request_queue_t *); 147extern void blk_trace_shutdown(struct request_queue *);
148extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); 148extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *);
149 149
150/** 150/**
@@ -272,6 +272,7 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
272 return; 272 return;
273 273
274 r.device = cpu_to_be32(dev); 274 r.device = cpu_to_be32(dev);
275 r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev);
275 r.sector = cpu_to_be64(to); 276 r.sector = cpu_to_be64(to);
276 277
277 __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); 278 __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index 8547b10c388b..60e377b520f8 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -15,14 +15,18 @@ struct sg_io_v4 {
15 15
16 __u32 request_len; /* [i] in bytes */ 16 __u32 request_len; /* [i] in bytes */
17 __u64 request; /* [i], [*i] {SCSI: cdb} */ 17 __u64 request; /* [i], [*i] {SCSI: cdb} */
18 __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
18 __u32 request_attr; /* [i] {SCSI: task attribute} */ 19 __u32 request_attr; /* [i] {SCSI: task attribute} */
19 __u32 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
20 __u32 request_priority; /* [i] {SCSI: task priority} */ 20 __u32 request_priority; /* [i] {SCSI: task priority} */
21 __u32 request_extra; /* [i] {spare, for padding} */
21 __u32 max_response_len; /* [i] in bytes */ 22 __u32 max_response_len; /* [i] in bytes */
22 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */ 23 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
23 24
24 /* "din_" for data in (from device); "dout_" for data out (to device) */ 25 /* "dout_": data out (to device); "din_": data in (from device) */
26 __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else
27 dout_xfer points to array of iovec */
25 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */ 28 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */
29 __u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */
26 __u32 din_xfer_len; /* [i] bytes to be transferred from device */ 30 __u32 din_xfer_len; /* [i] bytes to be transferred from device */
27 __u64 dout_xferp; /* [i], [*i] */ 31 __u64 dout_xferp; /* [i], [*i] */
28 __u64 din_xferp; /* [i], [*o] */ 32 __u64 din_xferp; /* [i], [*o] */
@@ -39,8 +43,9 @@ struct sg_io_v4 {
39 __u32 info; /* [o] additional information */ 43 __u32 info; /* [o] additional information */
40 __u32 duration; /* [o] time to complete, in milliseconds */ 44 __u32 duration; /* [o] time to complete, in milliseconds */
41 __u32 response_len; /* [o] bytes of response actually written */ 45 __u32 response_len; /* [o] bytes of response actually written */
42 __s32 din_resid; /* [o] actual_din_xfer_len - din_xfer_len */ 46 __s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */
43 __u32 generated_tag; /* [o] {SCSI: task tag that transport chose} */ 47 __s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */
48 __u64 generated_tag; /* [o] {SCSI: transport generated task tag} */
44 __u32 spare_out; /* [o] */ 49 __u32 spare_out; /* [o] */
45 50
46 __u32 padding; 51 __u32 padding;
@@ -53,15 +58,19 @@ struct bsg_class_device {
53 struct class_device *class_dev; 58 struct class_device *class_dev;
54 struct device *dev; 59 struct device *dev;
55 int minor; 60 int minor;
56 struct list_head list;
57 struct request_queue *queue; 61 struct request_queue *queue;
58}; 62};
59 63
60extern int bsg_register_queue(struct request_queue *, const char *); 64extern int bsg_register_queue(struct request_queue *, struct device *, const char *);
61extern void bsg_unregister_queue(struct request_queue *); 65extern void bsg_unregister_queue(struct request_queue *);
62#else 66#else
63#define bsg_register_queue(disk, name) (0) 67static inline int bsg_register_queue(struct request_queue * rq, struct device *dev, const char *name)
64#define bsg_unregister_queue(disk) do { } while (0) 68{
69 return 0;
70}
71static inline void bsg_unregister_queue(struct request_queue *rq)
72{
73}
65#endif 74#endif
66 75
67#endif /* __KERNEL__ */ 76#endif /* __KERNEL__ */
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 5c6e12853a9b..35cadad84b14 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -209,6 +209,8 @@ int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*,
209int generic_cont_expand(struct inode *inode, loff_t size); 209int generic_cont_expand(struct inode *inode, loff_t size);
210int generic_cont_expand_simple(struct inode *inode, loff_t size); 210int generic_cont_expand_simple(struct inode *inode, loff_t size);
211int block_commit_write(struct page *page, unsigned from, unsigned to); 211int block_commit_write(struct page *page, unsigned from, unsigned to);
212int block_page_mkwrite(struct vm_area_struct *vma, struct page *page,
213 get_block_t get_block);
212void block_sync_page(struct page *); 214void block_sync_page(struct page *);
213sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); 215sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
214int generic_commit_write(struct file *, struct page *, unsigned, unsigned); 216int generic_commit_write(struct file *, struct page *, unsigned, unsigned);
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 8486e78f7335..def5a659b8a5 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -23,6 +23,7 @@ enum clock_event_mode {
23 CLOCK_EVT_MODE_SHUTDOWN, 23 CLOCK_EVT_MODE_SHUTDOWN,
24 CLOCK_EVT_MODE_PERIODIC, 24 CLOCK_EVT_MODE_PERIODIC,
25 CLOCK_EVT_MODE_ONESHOT, 25 CLOCK_EVT_MODE_ONESHOT,
26 CLOCK_EVT_MODE_RESUME,
26}; 27};
27 28
28/* Clock event notification values */ 29/* Clock event notification values */
@@ -119,14 +120,9 @@ extern void clockevents_register_device(struct clock_event_device *dev);
119 120
120extern void clockevents_exchange_device(struct clock_event_device *old, 121extern void clockevents_exchange_device(struct clock_event_device *old,
121 struct clock_event_device *new); 122 struct clock_event_device *new);
122extern
123struct clock_event_device *clockevents_request_device(unsigned int features,
124 cpumask_t cpumask);
125extern void clockevents_release_device(struct clock_event_device *dev);
126extern void clockevents_set_mode(struct clock_event_device *dev, 123extern void clockevents_set_mode(struct clock_event_device *dev,
127 enum clock_event_mode mode); 124 enum clock_event_mode mode);
128extern int clockevents_register_notifier(struct notifier_block *nb); 125extern int clockevents_register_notifier(struct notifier_block *nb);
129extern void clockevents_unregister_notifier(struct notifier_block *nb);
130extern int clockevents_program_event(struct clock_event_device *dev, 126extern int clockevents_program_event(struct clock_event_device *dev,
131 ktime_t expires, ktime_t now); 127 ktime_t expires, ktime_t now);
132 128
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index bf297b03a4e4..16ea3374dddf 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -67,6 +67,12 @@ struct clocksource {
67 unsigned long flags; 67 unsigned long flags;
68 cycle_t (*vread)(void); 68 cycle_t (*vread)(void);
69 void (*resume)(void); 69 void (*resume)(void);
70#ifdef CONFIG_IA64
71 void *fsys_mmio; /* used by fsyscall asm code */
72#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
73#else
74#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
75#endif
70 76
71 /* timekeeping specific data, ignore */ 77 /* timekeeping specific data, ignore */
72 cycle_t cycle_interval; 78 cycle_t cycle_interval;
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index e4ac016ad272..1c47a34aa794 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -36,16 +36,12 @@ extern const struct file_operations coda_ioctl_operations;
36 36
37/* operations shared over more than one file */ 37/* operations shared over more than one file */
38int coda_open(struct inode *i, struct file *f); 38int coda_open(struct inode *i, struct file *f);
39int coda_flush(struct file *f, fl_owner_t id);
40int coda_release(struct inode *i, struct file *f); 39int coda_release(struct inode *i, struct file *f);
41int coda_permission(struct inode *inode, int mask, struct nameidata *nd); 40int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
42int coda_revalidate_inode(struct dentry *); 41int coda_revalidate_inode(struct dentry *);
43int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); 42int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *);
44int coda_setattr(struct dentry *, struct iattr *); 43int coda_setattr(struct dentry *, struct iattr *);
45 44
46/* global variables */
47extern int coda_fake_statfs;
48
49/* this file: heloers */ 45/* this file: heloers */
50static __inline__ struct CodaFid *coda_i2f(struct inode *); 46static __inline__ struct CodaFid *coda_i2f(struct inode *);
51static __inline__ char *coda_i2s(struct inode *); 47static __inline__ char *coda_i2s(struct inode *);
diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h
deleted file mode 100644
index 0dc1b0458e75..000000000000
--- a/include/linux/coda_proc.h
+++ /dev/null
@@ -1,76 +0,0 @@
1/*
2 * coda_statis.h
3 *
4 * CODA operation statistics
5 *
6 * (c) March, 1998
7 * by Michihiro Kuramochi, Zhenyu Xia and Zhanyong Wan
8 * zhanyong.wan@yale.edu
9 *
10 */
11
12#ifndef _CODA_PROC_H
13#define _CODA_PROC_H
14
15void coda_sysctl_init(void);
16void coda_sysctl_clean(void);
17
18#include <linux/sysctl.h>
19#include <linux/coda_fs_i.h>
20#include <linux/coda.h>
21
22/* these four files are presented to show the result of the statistics:
23 *
24 * /proc/fs/coda/vfs_stats
25 * cache_inv_stats
26 *
27 * these four files are presented to reset the statistics to 0:
28 *
29 * /proc/sys/coda/vfs_stats
30 * cache_inv_stats
31 */
32
33/* VFS operation statistics */
34struct coda_vfs_stats
35{
36 /* file operations */
37 int open;
38 int flush;
39 int release;
40 int fsync;
41
42 /* dir operations */
43 int readdir;
44
45 /* inode operations */
46 int create;
47 int lookup;
48 int link;
49 int unlink;
50 int symlink;
51 int mkdir;
52 int rmdir;
53 int rename;
54 int permission;
55
56 /* symlink operatoins*/
57 int follow_link;
58 int readlink;
59};
60
61/* cache invalidation statistics */
62struct coda_cache_inv_stats
63{
64 int flush;
65 int purge_user;
66 int zap_dir;
67 int zap_file;
68 int zap_vnode;
69 int purge_fid;
70 int replace;
71};
72
73/* these global variables hold the actual statistics data */
74extern struct coda_vfs_stats coda_vfs_stat;
75
76#endif /* _CODA_PROC_H */
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index b541bb3d1f4b..07ae8f846055 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -8,11 +8,6 @@
8 8
9struct kstatfs; 9struct kstatfs;
10 10
11struct coda_sb_info
12{
13 struct venus_comm *sbi_vcomm;
14};
15
16/* communication pending/processing queues */ 11/* communication pending/processing queues */
17struct venus_comm { 12struct venus_comm {
18 u_long vc_seq; 13 u_long vc_seq;
@@ -24,9 +19,9 @@ struct venus_comm {
24}; 19};
25 20
26 21
27static inline struct coda_sb_info *coda_sbp(struct super_block *sb) 22static inline struct venus_comm *coda_vcp(struct super_block *sb)
28{ 23{
29 return ((struct coda_sb_info *)((sb)->s_fs_info)); 24 return (struct venus_comm *)((sb)->s_fs_info);
30} 25}
31 26
32 27
@@ -38,9 +33,6 @@ int venus_setattr(struct super_block *, struct CodaFid *, struct coda_vattr *);
38int venus_lookup(struct super_block *sb, struct CodaFid *fid, 33int venus_lookup(struct super_block *sb, struct CodaFid *fid,
39 const char *name, int length, int *type, 34 const char *name, int length, int *type,
40 struct CodaFid *resfid); 35 struct CodaFid *resfid);
41int venus_store(struct super_block *sb, struct CodaFid *fid, int flags,
42 vuid_t uid);
43int venus_release(struct super_block *sb, struct CodaFid *fid, int flags);
44int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, 36int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
45 vuid_t uid); 37 vuid_t uid);
46int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, 38int venus_open(struct super_block *sb, struct CodaFid *fid, int flags,
@@ -74,8 +66,6 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
74 66
75 67
76/* messages between coda filesystem in kernel and Venus */ 68/* messages between coda filesystem in kernel and Venus */
77extern int coda_hard;
78extern unsigned long coda_timeout;
79struct upc_req { 69struct upc_req {
80 struct list_head uc_chain; 70 struct list_head uc_chain;
81 caddr_t uc_data; 71 caddr_t uc_data;
@@ -85,7 +75,6 @@ struct upc_req {
85 u_short uc_opcode; /* copied from data to save lookup */ 75 u_short uc_opcode; /* copied from data to save lookup */
86 int uc_unique; 76 int uc_unique;
87 wait_queue_head_t uc_sleep; /* process' wait queue */ 77 wait_queue_head_t uc_sleep; /* process' wait queue */
88 unsigned long uc_posttime;
89}; 78};
90 79
91#define REQ_ASYNC 0x1 80#define REQ_ASYNC 0x1
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index a03e9398a6c2..14f7494280f0 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -23,3 +23,21 @@
23 * code 23 * code
24 */ 24 */
25#define uninitialized_var(x) x = x 25#define uninitialized_var(x) x = x
26
27#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3)
28/* Mark functions as cold. gcc will assume any path leading to a call
29 to them will be unlikely. This means a lot of manual unlikely()s
30 are unnecessary now for any paths leading to the usual suspects
31 like BUG(), printk(), panic() etc. [but let's keep them for now for
32 older compilers]
33
34 Early snapshots of gcc 4.3 don't support this and we can't detect this
35 in the preprocessor, but we can live with this because they're unreleased.
36 Maketime probing would be overkill here.
37
38 gcc also has a __attribute__((__hot__)) to move hot functions into
39 a special section, but I don't see any sense in this right now in
40 the kernel context */
41#define __cold __attribute__((__cold__))
42
43#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 8287a72bb6a9..86f9a3a6137d 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -15,8 +15,8 @@
15# define __acquire(x) __context__(x,1) 15# define __acquire(x) __context__(x,1)
16# define __release(x) __context__(x,-1) 16# define __release(x) __context__(x,-1)
17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) 17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
18extern void __chk_user_ptr(const void __user *); 18extern void __chk_user_ptr(const volatile void __user *);
19extern void __chk_io_ptr(const void __iomem *); 19extern void __chk_io_ptr(const volatile void __iomem *);
20#else 20#else
21# define __user 21# define __user
22# define __kernel 22# define __kernel
@@ -174,4 +174,13 @@ extern void __chk_io_ptr(const void __iomem *);
174# define __attribute_const__ /* unimplemented */ 174# define __attribute_const__ /* unimplemented */
175#endif 175#endif
176 176
177/*
178 * Tell gcc if a function is cold. The compiler will assume any path
179 * directly leading to the call is unlikely.
180 */
181
182#ifndef __cold
183#define __cold
184#endif
185
177#endif /* __LINUX_COMPILER_H */ 186#endif /* __LINUX_COMPILER_H */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index c2236bbff412..0ad72c4cf312 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -41,8 +41,6 @@ extern void cpu_remove_sysdev_attr(struct sysdev_attribute *attr);
41extern int cpu_add_sysdev_attr_group(struct attribute_group *attrs); 41extern int cpu_add_sysdev_attr_group(struct attribute_group *attrs);
42extern void cpu_remove_sysdev_attr_group(struct attribute_group *attrs); 42extern void cpu_remove_sysdev_attr_group(struct attribute_group *attrs);
43 43
44extern struct sysdev_attribute attr_sched_mc_power_savings;
45extern struct sysdev_attribute attr_sched_smt_power_savings;
46extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); 44extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
47 45
48#ifdef CONFIG_HOTPLUG_CPU 46#ifdef CONFIG_HOTPLUG_CPU
@@ -128,16 +126,16 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
128static inline int cpu_is_offline(int cpu) { return 0; } 126static inline int cpu_is_offline(int cpu) { return 0; }
129#endif /* CONFIG_HOTPLUG_CPU */ 127#endif /* CONFIG_HOTPLUG_CPU */
130 128
131#ifdef CONFIG_SUSPEND_SMP 129#ifdef CONFIG_PM_SLEEP_SMP
132extern int suspend_cpu_hotplug; 130extern int suspend_cpu_hotplug;
133 131
134extern int disable_nonboot_cpus(void); 132extern int disable_nonboot_cpus(void);
135extern void enable_nonboot_cpus(void); 133extern void enable_nonboot_cpus(void);
136#else 134#else /* !CONFIG_PM_SLEEP_SMP */
137#define suspend_cpu_hotplug 0 135#define suspend_cpu_hotplug 0
138 136
139static inline int disable_nonboot_cpus(void) { return 0; } 137static inline int disable_nonboot_cpus(void) { return 0; }
140static inline void enable_nonboot_cpus(void) {} 138static inline void enable_nonboot_cpus(void) {}
141#endif 139#endif /* !CONFIG_PM_SLEEP_SMP */
142 140
143#endif /* _LINUX_CPU_H_ */ 141#endif /* _LINUX_CPU_H_ */
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h
index 0fe7cdf326f7..98c69ab80c84 100644
--- a/include/linux/dcookies.h
+++ b/include/linux/dcookies.h
@@ -12,6 +12,7 @@
12 12
13#ifdef CONFIG_PROFILING 13#ifdef CONFIG_PROFILING
14 14
15#include <linux/dcache.h>
15#include <linux/types.h> 16#include <linux/types.h>
16 17
17struct dcookie_user; 18struct dcookie_user;
diff --git a/include/linux/device.h b/include/linux/device.h
index be2debed70d2..3a38d1f70cb7 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -551,6 +551,9 @@ extern void put_device(struct device * dev);
551/* drivers/base/power/shutdown.c */ 551/* drivers/base/power/shutdown.c */
552extern void device_shutdown(void); 552extern void device_shutdown(void);
553 553
554/* drivers/base/sys.c */
555extern void sysdev_shutdown(void);
556
554 557
555/* drivers/base/firmware.c */ 558/* drivers/base/firmware.c */
556extern int __must_check firmware_register(struct kset *); 559extern int __must_check firmware_register(struct kset *);
@@ -572,6 +575,16 @@ dev_dbg(struct device * dev, const char * fmt, ...)
572} 575}
573#endif 576#endif
574 577
578#ifdef VERBOSE_DEBUG
579#define dev_vdbg dev_dbg
580#else
581static inline int __attribute__ ((format (printf, 2, 3)))
582dev_vdbg(struct device * dev, const char * fmt, ...)
583{
584 return 0;
585}
586#endif
587
575#define dev_err(dev, format, arg...) \ 588#define dev_err(dev, format, arg...) \
576 dev_printk(KERN_ERR , dev , format , ## arg) 589 dev_printk(KERN_ERR , dev , format , ## arg)
577#define dev_info(dev, format, arg...) \ 590#define dev_info(dev, format, arg...) \
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h
index 93e4c3a6d190..50839fe9e39e 100644
--- a/include/linux/dvb/video.h
+++ b/include/linux/dvb/video.h
@@ -29,6 +29,7 @@
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30#include <linux/types.h> 30#include <linux/types.h>
31#else 31#else
32#include <asm/types.h>
32#include <stdint.h> 33#include <stdint.h>
33#include <time.h> 34#include <time.h>
34#endif 35#endif
diff --git a/include/linux/edac.h b/include/linux/edac.h
new file mode 100644
index 000000000000..eab451e69a91
--- /dev/null
+++ b/include/linux/edac.h
@@ -0,0 +1,29 @@
1/*
2 * Generic EDAC defs
3 *
4 * Author: Dave Jiang <djiang@mvista.com>
5 *
6 * 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12#ifndef _LINUX_EDAC_H_
13#define _LINUX_EDAC_H_
14
15#include <asm/atomic.h>
16
17#define EDAC_OPSTATE_INVAL -1
18#define EDAC_OPSTATE_POLL 0
19#define EDAC_OPSTATE_NMI 1
20#define EDAC_OPSTATE_INT 2
21
22extern int edac_op_state;
23extern int edac_err_assert;
24extern atomic_t edac_handlers;
25
26extern int edac_handler_set(void);
27extern void edac_atomic_assert_error(void);
28
29#endif
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index e88fcbc77f8f..e8f42133a616 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -5,29 +5,29 @@
5 5
6#ifdef CONFIG_BLOCK 6#ifdef CONFIG_BLOCK
7 7
8typedef int (elevator_merge_fn) (request_queue_t *, struct request **, 8typedef int (elevator_merge_fn) (struct request_queue *, struct request **,
9 struct bio *); 9 struct bio *);
10 10
11typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); 11typedef void (elevator_merge_req_fn) (struct request_queue *, struct request *, struct request *);
12 12
13typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); 13typedef void (elevator_merged_fn) (struct request_queue *, struct request *, int);
14 14
15typedef int (elevator_allow_merge_fn) (request_queue_t *, struct request *, struct bio *); 15typedef int (elevator_allow_merge_fn) (struct request_queue *, struct request *, struct bio *);
16 16
17typedef int (elevator_dispatch_fn) (request_queue_t *, int); 17typedef int (elevator_dispatch_fn) (struct request_queue *, int);
18 18
19typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); 19typedef void (elevator_add_req_fn) (struct request_queue *, struct request *);
20typedef int (elevator_queue_empty_fn) (request_queue_t *); 20typedef int (elevator_queue_empty_fn) (struct request_queue *);
21typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); 21typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *);
22typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); 22typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *);
23typedef int (elevator_may_queue_fn) (request_queue_t *, int); 23typedef int (elevator_may_queue_fn) (struct request_queue *, int);
24 24
25typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); 25typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t);
26typedef void (elevator_put_req_fn) (struct request *); 26typedef void (elevator_put_req_fn) (struct request *);
27typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); 27typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *);
28typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 28typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *);
29 29
30typedef void *(elevator_init_fn) (request_queue_t *); 30typedef void *(elevator_init_fn) (struct request_queue *);
31typedef void (elevator_exit_fn) (elevator_t *); 31typedef void (elevator_exit_fn) (elevator_t *);
32 32
33struct elevator_ops 33struct elevator_ops
@@ -94,27 +94,27 @@ struct elevator_queue
94/* 94/*
95 * block elevator interface 95 * block elevator interface
96 */ 96 */
97extern void elv_dispatch_sort(request_queue_t *, struct request *); 97extern void elv_dispatch_sort(struct request_queue *, struct request *);
98extern void elv_dispatch_add_tail(request_queue_t *, struct request *); 98extern void elv_dispatch_add_tail(struct request_queue *, struct request *);
99extern void elv_add_request(request_queue_t *, struct request *, int, int); 99extern void elv_add_request(struct request_queue *, struct request *, int, int);
100extern void __elv_add_request(request_queue_t *, struct request *, int, int); 100extern void __elv_add_request(struct request_queue *, struct request *, int, int);
101extern void elv_insert(request_queue_t *, struct request *, int); 101extern void elv_insert(struct request_queue *, struct request *, int);
102extern int elv_merge(request_queue_t *, struct request **, struct bio *); 102extern int elv_merge(struct request_queue *, struct request **, struct bio *);
103extern void elv_merge_requests(request_queue_t *, struct request *, 103extern void elv_merge_requests(struct request_queue *, struct request *,
104 struct request *); 104 struct request *);
105extern void elv_merged_request(request_queue_t *, struct request *, int); 105extern void elv_merged_request(struct request_queue *, struct request *, int);
106extern void elv_dequeue_request(request_queue_t *, struct request *); 106extern void elv_dequeue_request(struct request_queue *, struct request *);
107extern void elv_requeue_request(request_queue_t *, struct request *); 107extern void elv_requeue_request(struct request_queue *, struct request *);
108extern int elv_queue_empty(request_queue_t *); 108extern int elv_queue_empty(struct request_queue *);
109extern struct request *elv_next_request(struct request_queue *q); 109extern struct request *elv_next_request(struct request_queue *q);
110extern struct request *elv_former_request(request_queue_t *, struct request *); 110extern struct request *elv_former_request(struct request_queue *, struct request *);
111extern struct request *elv_latter_request(request_queue_t *, struct request *); 111extern struct request *elv_latter_request(struct request_queue *, struct request *);
112extern int elv_register_queue(request_queue_t *q); 112extern int elv_register_queue(struct request_queue *q);
113extern void elv_unregister_queue(request_queue_t *q); 113extern void elv_unregister_queue(struct request_queue *q);
114extern int elv_may_queue(request_queue_t *, int); 114extern int elv_may_queue(struct request_queue *, int);
115extern void elv_completed_request(request_queue_t *, struct request *); 115extern void elv_completed_request(struct request_queue *, struct request *);
116extern int elv_set_request(request_queue_t *, struct request *, gfp_t); 116extern int elv_set_request(struct request_queue *, struct request *, gfp_t);
117extern void elv_put_request(request_queue_t *, struct request *); 117extern void elv_put_request(struct request_queue *, struct request *);
118 118
119/* 119/*
120 * io scheduler registration 120 * io scheduler registration
@@ -125,18 +125,18 @@ extern void elv_unregister(struct elevator_type *);
125/* 125/*
126 * io scheduler sysfs switching 126 * io scheduler sysfs switching
127 */ 127 */
128extern ssize_t elv_iosched_show(request_queue_t *, char *); 128extern ssize_t elv_iosched_show(struct request_queue *, char *);
129extern ssize_t elv_iosched_store(request_queue_t *, const char *, size_t); 129extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t);
130 130
131extern int elevator_init(request_queue_t *, char *); 131extern int elevator_init(struct request_queue *, char *);
132extern void elevator_exit(elevator_t *); 132extern void elevator_exit(elevator_t *);
133extern int elv_rq_merge_ok(struct request *, struct bio *); 133extern int elv_rq_merge_ok(struct request *, struct bio *);
134 134
135/* 135/*
136 * Helper functions. 136 * Helper functions.
137 */ 137 */
138extern struct request *elv_rb_former_request(request_queue_t *, struct request *); 138extern struct request *elv_rb_former_request(struct request_queue *, struct request *);
139extern struct request *elv_rb_latter_request(request_queue_t *, struct request *); 139extern struct request *elv_rb_latter_request(struct request_queue *, struct request *);
140 140
141/* 141/*
142 * rb support functions. 142 * rb support functions.
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
index 0311bad838b1..5834e843a946 100644
--- a/include/linux/elf-em.h
+++ b/include/linux/elf-em.h
@@ -20,7 +20,8 @@
20#define EM_PARISC 15 /* HPPA */ 20#define EM_PARISC 15 /* HPPA */
21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ 21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
22#define EM_PPC 20 /* PowerPC */ 22#define EM_PPC 20 /* PowerPC */
23#define EM_PPC64 21 /* PowerPC64 */ 23#define EM_PPC64 21 /* PowerPC64 */
24#define EM_SPU 23 /* Cell BE SPU */
24#define EM_SH 42 /* SuperH */ 25#define EM_SH 42 /* SuperH */
25#define EM_SPARCV9 43 /* SPARC v9 64-bit */ 26#define EM_SPARCV9 43 /* SPARC v9 64-bit */
26#define EM_IA_64 50 /* HP/Intel IA-64 */ 27#define EM_IA_64 50 /* HP/Intel IA-64 */
diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h
index 9a1e0674e56c..e831759b2fb5 100644
--- a/include/linux/elfnote.h
+++ b/include/linux/elfnote.h
@@ -38,17 +38,25 @@
38 * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two") 38 * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
39 * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef) 39 * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
40 */ 40 */
41#define ELFNOTE(name, type, desctype, descdata) \ 41#define ELFNOTE_START(name, type, flags) \
42.pushsection .note.name, "",@note ; \ 42.pushsection .note.name, flags,@note ; \
43 .align 4 ; \ 43 .balign 4 ; \
44 .long 2f - 1f /* namesz */ ; \ 44 .long 2f - 1f /* namesz */ ; \
45 .long 4f - 3f /* descsz */ ; \ 45 .long 4484f - 3f /* descsz */ ; \
46 .long type ; \ 46 .long type ; \
471:.asciz #name ; \ 471:.asciz #name ; \
482:.align 4 ; \ 482:.balign 4 ; \
493:desctype descdata ; \ 493:
504:.align 4 ; \ 50
51#define ELFNOTE_END \
524484:.balign 4 ; \
51.popsection ; 53.popsection ;
54
55#define ELFNOTE(name, type, desc) \
56 ELFNOTE_START(name, type, "") \
57 desc ; \
58 ELFNOTE_END
59
52#else /* !__ASSEMBLER__ */ 60#else /* !__ASSEMBLER__ */
53#include <linux/elf.h> 61#include <linux/elf.h>
54/* 62/*
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 3a632244f31b..23ccea811297 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -270,8 +270,6 @@ u32 ethtool_op_get_sg(struct net_device *dev);
270int ethtool_op_set_sg(struct net_device *dev, u32 data); 270int ethtool_op_set_sg(struct net_device *dev, u32 data);
271u32 ethtool_op_get_tso(struct net_device *dev); 271u32 ethtool_op_get_tso(struct net_device *dev);
272int ethtool_op_set_tso(struct net_device *dev, u32 data); 272int ethtool_op_set_tso(struct net_device *dev, u32 data);
273int ethtool_op_get_perm_addr(struct net_device *dev,
274 struct ethtool_perm_addr *addr, u8 *data);
275u32 ethtool_op_get_ufo(struct net_device *dev); 273u32 ethtool_op_get_ufo(struct net_device *dev);
276int ethtool_op_set_ufo(struct net_device *dev, u32 data); 274int ethtool_op_set_ufo(struct net_device *dev, u32 data);
277 275
@@ -309,7 +307,6 @@ int ethtool_op_set_ufo(struct net_device *dev, u32 data);
309 * get_strings: Return a set of strings that describe the requested objects 307 * get_strings: Return a set of strings that describe the requested objects
310 * phys_id: Identify the device 308 * phys_id: Identify the device
311 * get_stats: Return statistics about the device 309 * get_stats: Return statistics about the device
312 * get_perm_addr: Gets the permanent hardware address
313 * 310 *
314 * Description: 311 * Description:
315 * 312 *
@@ -368,7 +365,6 @@ struct ethtool_ops {
368 int (*phys_id)(struct net_device *, u32); 365 int (*phys_id)(struct net_device *, u32);
369 int (*get_stats_count)(struct net_device *); 366 int (*get_stats_count)(struct net_device *);
370 void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); 367 void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
371 int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *);
372 int (*begin)(struct net_device *); 368 int (*begin)(struct net_device *);
373 void (*complete)(struct net_device *); 369 void (*complete)(struct net_device *);
374 u32 (*get_ufo)(struct net_device *); 370 u32 (*get_ufo)(struct net_device *);
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index de1f9f78625a..cdee7aaa57aa 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -71,7 +71,7 @@
71/* 71/*
72 * Maximal count of links to a file 72 * Maximal count of links to a file
73 */ 73 */
74#define EXT4_LINK_MAX 32000 74#define EXT4_LINK_MAX 65000
75 75
76/* 76/*
77 * Macro-instructions used to manage several block sizes 77 * Macro-instructions used to manage several block sizes
@@ -102,6 +102,7 @@
102 EXT4_GOOD_OLD_FIRST_INO : \ 102 EXT4_GOOD_OLD_FIRST_INO : \
103 (s)->s_first_ino) 103 (s)->s_first_ino)
104#endif 104#endif
105#define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits)))
105 106
106/* 107/*
107 * Macro-instructions used to manage fragments 108 * Macro-instructions used to manage fragments
@@ -201,6 +202,7 @@ struct ext4_group_desc
201#define EXT4_STATE_JDATA 0x00000001 /* journaled data exists */ 202#define EXT4_STATE_JDATA 0x00000001 /* journaled data exists */
202#define EXT4_STATE_NEW 0x00000002 /* inode is newly created */ 203#define EXT4_STATE_NEW 0x00000002 /* inode is newly created */
203#define EXT4_STATE_XATTR 0x00000004 /* has in-inode xattrs */ 204#define EXT4_STATE_XATTR 0x00000004 /* has in-inode xattrs */
205#define EXT4_STATE_NO_EXPAND 0x00000008 /* No space for expansion */
204 206
205/* Used to pass group descriptor data when online resize is done */ 207/* Used to pass group descriptor data when online resize is done */
206struct ext4_new_group_input { 208struct ext4_new_group_input {
@@ -225,6 +227,11 @@ struct ext4_new_group_data {
225 __u32 free_blocks_count; 227 __u32 free_blocks_count;
226}; 228};
227 229
230/*
231 * Following is used by preallocation code to tell get_blocks() that we
232 * want uninitialzed extents.
233 */
234#define EXT4_CREATE_UNINITIALIZED_EXT 2
228 235
229/* 236/*
230 * ioctl commands 237 * ioctl commands
@@ -237,7 +244,7 @@ struct ext4_new_group_data {
237#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input) 244#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input)
238#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION 245#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
239#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION 246#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
240#ifdef CONFIG_JBD_DEBUG 247#ifdef CONFIG_JBD2_DEBUG
241#define EXT4_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) 248#define EXT4_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
242#endif 249#endif
243#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long) 250#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
@@ -253,7 +260,7 @@ struct ext4_new_group_data {
253#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int) 260#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int)
254#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int) 261#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int)
255#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) 262#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
256#ifdef CONFIG_JBD_DEBUG 263#ifdef CONFIG_JBD2_DEBUG
257#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int) 264#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
258#endif 265#endif
259#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION 266#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
@@ -282,7 +289,7 @@ struct ext4_inode {
282 __le16 i_uid; /* Low 16 bits of Owner Uid */ 289 __le16 i_uid; /* Low 16 bits of Owner Uid */
283 __le32 i_size; /* Size in bytes */ 290 __le32 i_size; /* Size in bytes */
284 __le32 i_atime; /* Access time */ 291 __le32 i_atime; /* Access time */
285 __le32 i_ctime; /* Creation time */ 292 __le32 i_ctime; /* Inode Change time */
286 __le32 i_mtime; /* Modification time */ 293 __le32 i_mtime; /* Modification time */
287 __le32 i_dtime; /* Deletion Time */ 294 __le32 i_dtime; /* Deletion Time */
288 __le16 i_gid; /* Low 16 bits of Group Id */ 295 __le16 i_gid; /* Low 16 bits of Group Id */
@@ -331,10 +338,85 @@ struct ext4_inode {
331 } osd2; /* OS dependent 2 */ 338 } osd2; /* OS dependent 2 */
332 __le16 i_extra_isize; 339 __le16 i_extra_isize;
333 __le16 i_pad1; 340 __le16 i_pad1;
341 __le32 i_ctime_extra; /* extra Change time (nsec << 2 | epoch) */
342 __le32 i_mtime_extra; /* extra Modification time(nsec << 2 | epoch) */
343 __le32 i_atime_extra; /* extra Access time (nsec << 2 | epoch) */
344 __le32 i_crtime; /* File Creation time */
345 __le32 i_crtime_extra; /* extra FileCreationtime (nsec << 2 | epoch) */
334}; 346};
335 347
336#define i_size_high i_dir_acl 348#define i_size_high i_dir_acl
337 349
350#define EXT4_EPOCH_BITS 2
351#define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1)
352#define EXT4_NSEC_MASK (~0UL << EXT4_EPOCH_BITS)
353
354/*
355 * Extended fields will fit into an inode if the filesystem was formatted
356 * with large inodes (-I 256 or larger) and there are not currently any EAs
357 * consuming all of the available space. For new inodes we always reserve
358 * enough space for the kernel's known extended fields, but for inodes
359 * created with an old kernel this might not have been the case. None of
360 * the extended inode fields is critical for correct filesystem operation.
361 * This macro checks if a certain field fits in the inode. Note that
362 * inode-size = GOOD_OLD_INODE_SIZE + i_extra_isize
363 */
364#define EXT4_FITS_IN_INODE(ext4_inode, einode, field) \
365 ((offsetof(typeof(*ext4_inode), field) + \
366 sizeof((ext4_inode)->field)) \
367 <= (EXT4_GOOD_OLD_INODE_SIZE + \
368 (einode)->i_extra_isize)) \
369
370static inline __le32 ext4_encode_extra_time(struct timespec *time)
371{
372 return cpu_to_le32((sizeof(time->tv_sec) > 4 ?
373 time->tv_sec >> 32 : 0) |
374 ((time->tv_nsec << 2) & EXT4_NSEC_MASK));
375}
376
377static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra)
378{
379 if (sizeof(time->tv_sec) > 4)
380 time->tv_sec |= (__u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK)
381 << 32;
382 time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> 2;
383}
384
385#define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \
386do { \
387 (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \
388 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
389 (raw_inode)->xtime ## _extra = \
390 ext4_encode_extra_time(&(inode)->xtime); \
391} while (0)
392
393#define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \
394do { \
395 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
396 (raw_inode)->xtime = cpu_to_le32((einode)->xtime.tv_sec); \
397 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
398 (raw_inode)->xtime ## _extra = \
399 ext4_encode_extra_time(&(einode)->xtime); \
400} while (0)
401
402#define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \
403do { \
404 (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime); \
405 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
406 ext4_decode_extra_time(&(inode)->xtime, \
407 raw_inode->xtime ## _extra); \
408} while (0)
409
410#define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \
411do { \
412 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
413 (einode)->xtime.tv_sec = \
414 (signed)le32_to_cpu((raw_inode)->xtime); \
415 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
416 ext4_decode_extra_time(&(einode)->xtime, \
417 raw_inode->xtime ## _extra); \
418} while (0)
419
338#if defined(__KERNEL__) || defined(__linux__) 420#if defined(__KERNEL__) || defined(__linux__)
339#define i_reserved1 osd1.linux1.l_i_reserved1 421#define i_reserved1 osd1.linux1.l_i_reserved1
340#define i_frag osd2.linux2.l_i_frag 422#define i_frag osd2.linux2.l_i_frag
@@ -533,6 +615,13 @@ static inline struct ext4_inode_info *EXT4_I(struct inode *inode)
533 return container_of(inode, struct ext4_inode_info, vfs_inode); 615 return container_of(inode, struct ext4_inode_info, vfs_inode);
534} 616}
535 617
618static inline struct timespec ext4_current_time(struct inode *inode)
619{
620 return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ?
621 current_fs_time(inode->i_sb) : CURRENT_TIME_SEC;
622}
623
624
536static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) 625static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
537{ 626{
538 return ino == EXT4_ROOT_INO || 627 return ino == EXT4_ROOT_INO ||
@@ -603,6 +692,8 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
603#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 692#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
604#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 693#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
605#define EXT4_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 694#define EXT4_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
695#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
696#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
606 697
607#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001 698#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001
608#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002 699#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002
@@ -620,6 +711,8 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
620 EXT4_FEATURE_INCOMPAT_64BIT) 711 EXT4_FEATURE_INCOMPAT_64BIT)
621#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ 712#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
622 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ 713 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
714 EXT4_FEATURE_RO_COMPAT_DIR_NLINK | \
715 EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE | \
623 EXT4_FEATURE_RO_COMPAT_BTREE_DIR) 716 EXT4_FEATURE_RO_COMPAT_BTREE_DIR)
624 717
625/* 718/*
@@ -862,6 +955,7 @@ extern int ext4_change_inode_journal_flag(struct inode *, int);
862extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); 955extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *);
863extern void ext4_truncate (struct inode *); 956extern void ext4_truncate (struct inode *);
864extern void ext4_set_inode_flags(struct inode *); 957extern void ext4_set_inode_flags(struct inode *);
958extern void ext4_get_inode_flags(struct ext4_inode_info *);
865extern void ext4_set_aops(struct inode *inode); 959extern void ext4_set_aops(struct inode *inode);
866extern int ext4_writepage_trans_blocks(struct inode *); 960extern int ext4_writepage_trans_blocks(struct inode *);
867extern int ext4_block_truncate_page(handle_t *handle, struct page *page, 961extern int ext4_block_truncate_page(handle_t *handle, struct page *page,
@@ -983,6 +1077,8 @@ extern int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
983extern void ext4_ext_truncate(struct inode *, struct page *); 1077extern void ext4_ext_truncate(struct inode *, struct page *);
984extern void ext4_ext_init(struct super_block *); 1078extern void ext4_ext_init(struct super_block *);
985extern void ext4_ext_release(struct super_block *); 1079extern void ext4_ext_release(struct super_block *);
1080extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset,
1081 loff_t len);
986static inline int 1082static inline int
987ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, 1083ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
988 unsigned long max_blocks, struct buffer_head *bh, 1084 unsigned long max_blocks, struct buffer_head *bh,
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h
index acfe59740b03..81406f3655d4 100644
--- a/include/linux/ext4_fs_extents.h
+++ b/include/linux/ext4_fs_extents.h
@@ -141,7 +141,25 @@ typedef int (*ext_prepare_callback)(struct inode *, struct ext4_ext_path *,
141 141
142#define EXT_MAX_BLOCK 0xffffffff 142#define EXT_MAX_BLOCK 0xffffffff
143 143
144#define EXT_MAX_LEN ((1UL << 15) - 1) 144/*
145 * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an
146 * initialized extent. This is 2^15 and not (2^16 - 1), since we use the
147 * MSB of ee_len field in the extent datastructure to signify if this
148 * particular extent is an initialized extent or an uninitialized (i.e.
149 * preallocated).
150 * EXT_UNINIT_MAX_LEN is the maximum number of blocks we can have in an
151 * uninitialized extent.
152 * If ee_len is <= 0x8000, it is an initialized extent. Otherwise, it is an
153 * uninitialized one. In other words, if MSB of ee_len is set, it is an
154 * uninitialized extent with only one special scenario when ee_len = 0x8000.
155 * In this case we can not have an uninitialized extent of zero length and
156 * thus we make it as a special case of initialized extent with 0x8000 length.
157 * This way we get better extent-to-group alignment for initialized extents.
158 * Hence, the maximum number of blocks we can have in an *initialized*
159 * extent is 2^15 (32768) and in an *uninitialized* extent is 2^15-1 (32767).
160 */
161#define EXT_INIT_MAX_LEN (1UL << 15)
162#define EXT_UNINIT_MAX_LEN (EXT_INIT_MAX_LEN - 1)
145 163
146 164
147#define EXT_FIRST_EXTENT(__hdr__) \ 165#define EXT_FIRST_EXTENT(__hdr__) \
@@ -188,8 +206,31 @@ ext4_ext_invalidate_cache(struct inode *inode)
188 EXT4_I(inode)->i_cached_extent.ec_type = EXT4_EXT_CACHE_NO; 206 EXT4_I(inode)->i_cached_extent.ec_type = EXT4_EXT_CACHE_NO;
189} 207}
190 208
209static inline void ext4_ext_mark_uninitialized(struct ext4_extent *ext)
210{
211 /* We can not have an uninitialized extent of zero length! */
212 BUG_ON((le16_to_cpu(ext->ee_len) & ~EXT_INIT_MAX_LEN) == 0);
213 ext->ee_len |= cpu_to_le16(EXT_INIT_MAX_LEN);
214}
215
216static inline int ext4_ext_is_uninitialized(struct ext4_extent *ext)
217{
218 /* Extent with ee_len of 0x8000 is treated as an initialized extent */
219 return (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN);
220}
221
222static inline int ext4_ext_get_actual_len(struct ext4_extent *ext)
223{
224 return (le16_to_cpu(ext->ee_len) <= EXT_INIT_MAX_LEN ?
225 le16_to_cpu(ext->ee_len) :
226 (le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN));
227}
228
191extern int ext4_extent_tree_init(handle_t *, struct inode *); 229extern int ext4_extent_tree_init(handle_t *, struct inode *);
192extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); 230extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *);
231extern int ext4_ext_try_to_merge(struct inode *inode,
232 struct ext4_ext_path *path,
233 struct ext4_extent *);
193extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *); 234extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *);
194extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); 235extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *);
195extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *); 236extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *);
diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h
index 9de494406995..1a511e9905aa 100644
--- a/include/linux/ext4_fs_i.h
+++ b/include/linux/ext4_fs_i.h
@@ -153,6 +153,11 @@ struct ext4_inode_info {
153 153
154 unsigned long i_ext_generation; 154 unsigned long i_ext_generation;
155 struct ext4_ext_cache i_cached_extent; 155 struct ext4_ext_cache i_cached_extent;
156 /*
157 * File creation time. Its function is same as that of
158 * struct timespec i_{a,c,m}time in the generic inode.
159 */
160 struct timespec i_crtime;
156}; 161};
157 162
158#endif /* _LINUX_EXT4_FS_I */ 163#endif /* _LINUX_EXT4_FS_I */
diff --git a/include/linux/ext4_fs_sb.h b/include/linux/ext4_fs_sb.h
index 2347557a327a..1b2ffee12be9 100644
--- a/include/linux/ext4_fs_sb.h
+++ b/include/linux/ext4_fs_sb.h
@@ -73,7 +73,7 @@ struct ext4_sb_info {
73 struct list_head s_orphan; 73 struct list_head s_orphan;
74 unsigned long s_commit_interval; 74 unsigned long s_commit_interval;
75 struct block_device *journal_bdev; 75 struct block_device *journal_bdev;
76#ifdef CONFIG_JBD_DEBUG 76#ifdef CONFIG_JBD2_DEBUG
77 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */ 77 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
78 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */ 78 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
79#endif 79#endif
@@ -81,6 +81,7 @@ struct ext4_sb_info {
81 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ 81 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
82 int s_jquota_fmt; /* Format of quota to use */ 82 int s_jquota_fmt; /* Format of quota to use */
83#endif 83#endif
84 unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
84 85
85#ifdef EXTENTS_STATS 86#ifdef EXTENTS_STATS
86 /* ext4 extents stats */ 87 /* ext4 extents stats */
diff --git a/include/linux/falloc.h b/include/linux/falloc.h
new file mode 100644
index 000000000000..8e912ab6a072
--- /dev/null
+++ b/include/linux/falloc.h
@@ -0,0 +1,6 @@
1#ifndef _FALLOC_H_
2#define _FALLOC_H_
3
4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
5
6#endif /* _FALLOC_H_ */
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 2d38b1a74662..efded00ad08c 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -5,7 +5,7 @@
5 5
6#include <linux/sched.h> 6#include <linux/sched.h>
7 7
8#ifdef CONFIG_PM 8#ifdef CONFIG_PM_SLEEP
9/* 9/*
10 * Check if a process has been frozen 10 * Check if a process has been frozen
11 */ 11 */
@@ -25,7 +25,7 @@ static inline int freezing(struct task_struct *p)
25/* 25/*
26 * Request that a process be frozen 26 * Request that a process be frozen
27 */ 27 */
28static inline void freeze(struct task_struct *p) 28static inline void set_freeze_flag(struct task_struct *p)
29{ 29{
30 set_tsk_thread_flag(p, TIF_FREEZE); 30 set_tsk_thread_flag(p, TIF_FREEZE);
31} 31}
@@ -33,7 +33,7 @@ static inline void freeze(struct task_struct *p)
33/* 33/*
34 * Sometimes we may need to cancel the previous 'freeze' request 34 * Sometimes we may need to cancel the previous 'freeze' request
35 */ 35 */
36static inline void do_not_freeze(struct task_struct *p) 36static inline void clear_freeze_flag(struct task_struct *p)
37{ 37{
38 clear_tsk_thread_flag(p, TIF_FREEZE); 38 clear_tsk_thread_flag(p, TIF_FREEZE);
39} 39}
@@ -56,7 +56,7 @@ static inline int thaw_process(struct task_struct *p)
56 wake_up_process(p); 56 wake_up_process(p);
57 return 1; 57 return 1;
58 } 58 }
59 clear_tsk_thread_flag(p, TIF_FREEZE); 59 clear_freeze_flag(p);
60 task_unlock(p); 60 task_unlock(p);
61 return 0; 61 return 0;
62} 62}
@@ -126,10 +126,11 @@ static inline void set_freezable(void)
126 current->flags &= ~PF_NOFREEZE; 126 current->flags &= ~PF_NOFREEZE;
127} 127}
128 128
129#else 129#else /* !CONFIG_PM_SLEEP */
130static inline int frozen(struct task_struct *p) { return 0; } 130static inline int frozen(struct task_struct *p) { return 0; }
131static inline int freezing(struct task_struct *p) { return 0; } 131static inline int freezing(struct task_struct *p) { return 0; }
132static inline void freeze(struct task_struct *p) { BUG(); } 132static inline void set_freeze_flag(struct task_struct *p) {}
133static inline void clear_freeze_flag(struct task_struct *p) {}
133static inline int thaw_process(struct task_struct *p) { return 1; } 134static inline int thaw_process(struct task_struct *p) { return 1; }
134 135
135static inline void refrigerator(void) {} 136static inline void refrigerator(void) {}
@@ -142,6 +143,6 @@ static inline void freezer_do_not_count(void) {}
142static inline void freezer_count(void) {} 143static inline void freezer_count(void) {}
143static inline int freezer_should_skip(struct task_struct *p) { return 0; } 144static inline int freezer_should_skip(struct task_struct *p) { return 0; }
144static inline void set_freezable(void) {} 145static inline void set_freezable(void) {}
145#endif 146#endif /* !CONFIG_PM_SLEEP */
146 147
147#endif /* FREEZER_H_INCLUDED */ 148#endif /* FREEZER_H_INCLUDED */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 98205f680476..16421f662a7a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -697,20 +697,26 @@ struct fown_struct {
697 * Track a single file's readahead state 697 * Track a single file's readahead state
698 */ 698 */
699struct file_ra_state { 699struct file_ra_state {
700 unsigned long start; /* Current window */ 700 pgoff_t start; /* where readahead started */
701 unsigned long size; 701 unsigned long size; /* # of readahead pages */
702 unsigned long flags; /* ra flags RA_FLAG_xxx*/ 702 unsigned long async_size; /* do asynchronous readahead when
703 unsigned long cache_hit; /* cache hit count*/ 703 there are only # of pages ahead */
704 unsigned long prev_index; /* Cache last read() position */ 704
705 unsigned long ahead_start; /* Ahead window */
706 unsigned long ahead_size;
707 unsigned long ra_pages; /* Maximum readahead window */ 705 unsigned long ra_pages; /* Maximum readahead window */
708 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ 706 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */
709 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ 707 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */
708 unsigned long prev_index; /* Cache last read() position */
710 unsigned int prev_offset; /* Offset where last read() ended in a page */ 709 unsigned int prev_offset; /* Offset where last read() ended in a page */
711}; 710};
712#define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */ 711
713#define RA_FLAG_INCACHE 0x02 /* file is already in cache */ 712/*
713 * Check if @index falls in the readahead windows.
714 */
715static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
716{
717 return (index >= ra->start &&
718 index < ra->start + ra->size);
719}
714 720
715struct file { 721struct file {
716 /* 722 /*
@@ -862,7 +868,7 @@ extern void locks_init_lock(struct file_lock *);
862extern void locks_copy_lock(struct file_lock *, struct file_lock *); 868extern void locks_copy_lock(struct file_lock *, struct file_lock *);
863extern void locks_remove_posix(struct file *, fl_owner_t); 869extern void locks_remove_posix(struct file *, fl_owner_t);
864extern void locks_remove_flock(struct file *); 870extern void locks_remove_flock(struct file *);
865extern int posix_test_lock(struct file *, struct file_lock *); 871extern void posix_test_lock(struct file *, struct file_lock *);
866extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); 872extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
867extern int posix_lock_file_wait(struct file *, struct file_lock *); 873extern int posix_lock_file_wait(struct file *, struct file_lock *);
868extern int posix_unblock_lock(struct file *, struct file_lock *); 874extern int posix_unblock_lock(struct file *, struct file_lock *);
@@ -872,7 +878,8 @@ extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
872extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 878extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
873extern int __break_lease(struct inode *inode, unsigned int flags); 879extern int __break_lease(struct inode *inode, unsigned int flags);
874extern void lease_get_mtime(struct inode *, struct timespec *time); 880extern void lease_get_mtime(struct inode *, struct timespec *time);
875extern int setlease(struct file *, long, struct file_lock **); 881extern int generic_setlease(struct file *, long, struct file_lock **);
882extern int vfs_setlease(struct file *, long, struct file_lock **);
876extern int lease_modify(struct file_lock **, int); 883extern int lease_modify(struct file_lock **, int);
877extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 884extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
878extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 885extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
@@ -1122,6 +1129,7 @@ struct file_operations {
1122 int (*flock) (struct file *, int, struct file_lock *); 1129 int (*flock) (struct file *, int, struct file_lock *);
1123 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); 1130 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1124 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); 1131 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1132 int (*setlease)(struct file *, long, struct file_lock **);
1125}; 1133};
1126 1134
1127struct inode_operations { 1135struct inode_operations {
@@ -1147,6 +1155,8 @@ struct inode_operations {
1147 ssize_t (*listxattr) (struct dentry *, char *, size_t); 1155 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1148 int (*removexattr) (struct dentry *, const char *); 1156 int (*removexattr) (struct dentry *, const char *);
1149 void (*truncate_range)(struct inode *, loff_t, loff_t); 1157 void (*truncate_range)(struct inode *, loff_t, loff_t);
1158 long (*fallocate)(struct inode *inode, int mode, loff_t offset,
1159 loff_t len);
1150}; 1160};
1151 1161
1152struct seq_file; 1162struct seq_file;
@@ -1459,7 +1469,7 @@ extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
1459extern int register_chrdev_region(dev_t, unsigned, const char *); 1469extern int register_chrdev_region(dev_t, unsigned, const char *);
1460extern int register_chrdev(unsigned int, const char *, 1470extern int register_chrdev(unsigned int, const char *,
1461 const struct file_operations *); 1471 const struct file_operations *);
1462extern int unregister_chrdev(unsigned int, const char *); 1472extern void unregister_chrdev(unsigned int, const char *);
1463extern void unregister_chrdev_region(dev_t, unsigned); 1473extern void unregister_chrdev_region(dev_t, unsigned);
1464extern int chrdev_open(struct inode *, struct file *); 1474extern int chrdev_open(struct inode *, struct file *);
1465extern void chrdev_show(struct seq_file *,off_t); 1475extern void chrdev_show(struct seq_file *,off_t);
@@ -1649,7 +1659,6 @@ extern int sb_min_blocksize(struct super_block *, int);
1649extern int generic_file_mmap(struct file *, struct vm_area_struct *); 1659extern int generic_file_mmap(struct file *, struct vm_area_struct *);
1650extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); 1660extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
1651extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); 1661extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
1652extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
1653int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); 1662int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
1654extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); 1663extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
1655extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); 1664extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 695741b0e420..1831b196c70a 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -53,6 +53,7 @@ struct gianfar_platform_data {
53 u32 bus_id; 53 u32 bus_id;
54 u32 phy_id; 54 u32 phy_id;
55 u8 mac_addr[6]; 55 u8 mac_addr[6];
56 phy_interface_t interface;
56}; 57};
57 58
58struct gianfar_mdio_data { 59struct gianfar_mdio_data {
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index f7a93770e1be..7da02c93002b 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -39,6 +39,9 @@ enum {
39 CTRL_CMD_NEWOPS, 39 CTRL_CMD_NEWOPS,
40 CTRL_CMD_DELOPS, 40 CTRL_CMD_DELOPS,
41 CTRL_CMD_GETOPS, 41 CTRL_CMD_GETOPS,
42 CTRL_CMD_NEWMCAST_GRP,
43 CTRL_CMD_DELMCAST_GRP,
44 CTRL_CMD_GETMCAST_GRP, /* unused */
42 __CTRL_CMD_MAX, 45 __CTRL_CMD_MAX,
43}; 46};
44 47
@@ -52,6 +55,7 @@ enum {
52 CTRL_ATTR_HDRSIZE, 55 CTRL_ATTR_HDRSIZE,
53 CTRL_ATTR_MAXATTR, 56 CTRL_ATTR_MAXATTR,
54 CTRL_ATTR_OPS, 57 CTRL_ATTR_OPS,
58 CTRL_ATTR_MCAST_GROUPS,
55 __CTRL_ATTR_MAX, 59 __CTRL_ATTR_MAX,
56}; 60};
57 61
@@ -66,4 +70,13 @@ enum {
66 70
67#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1) 71#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
68 72
73enum {
74 CTRL_ATTR_MCAST_GRP_UNSPEC,
75 CTRL_ATTR_MCAST_GRP_NAME,
76 CTRL_ATTR_MCAST_GRP_ID,
77 __CTRL_ATTR_MCAST_GRP_MAX,
78};
79
80#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
81
69#endif /* __LINUX_GENERIC_NETLINK_H */ 82#endif /* __LINUX_GENERIC_NETLINK_H */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 9756fc102a83..a47b8025d399 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -264,7 +264,7 @@ static inline void set_capacity(struct gendisk *disk, sector_t size)
264 264
265#ifdef CONFIG_SOLARIS_X86_PARTITION 265#ifdef CONFIG_SOLARIS_X86_PARTITION
266 266
267#define SOLARIS_X86_NUMSLICE 8 267#define SOLARIS_X86_NUMSLICE 16
268#define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL) 268#define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL)
269 269
270struct solaris_x86_slice { 270struct solaris_x86_slice {
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 12c5e4e3135a..1fcb0033179e 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -103,21 +103,6 @@ __alloc_zeroed_user_highpage(gfp_t movableflags,
103#endif 103#endif
104 104
105/** 105/**
106 * alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA
107 * @vma: The VMA the page is to be allocated for
108 * @vaddr: The virtual address the page will be inserted into
109 *
110 * This function will allocate a page for a VMA that the caller knows will
111 * not be able to move in the future using move_pages() or reclaim. If it
112 * is known that the page can move, use alloc_zeroed_user_highpage_movable
113 */
114static inline struct page *
115alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr)
116{
117 return __alloc_zeroed_user_highpage(0, vma, vaddr);
118}
119
120/**
121 * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move 106 * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move
122 * @vma: The VMA the page is to be allocated for 107 * @vma: The VMA the page is to be allocated for
123 * @vaddr: The virtual address the page will be inserted into 108 * @vaddr: The virtual address the page will be inserted into
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 49b7053043ad..3a19b032c0eb 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_HUGETLB_H 1#ifndef _LINUX_HUGETLB_H
2#define _LINUX_HUGETLB_H 2#define _LINUX_HUGETLB_H
3 3
4#include <linux/fs.h>
5
4#ifdef CONFIG_HUGETLB_PAGE 6#ifdef CONFIG_HUGETLB_PAGE
5 7
6#include <linux/mempolicy.h> 8#include <linux/mempolicy.h>
@@ -64,11 +66,8 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr,
64 * If the arch doesn't supply something else, assume that hugepage 66 * If the arch doesn't supply something else, assume that hugepage
65 * size aligned regions are ok without further preparation. 67 * size aligned regions are ok without further preparation.
66 */ 68 */
67static inline int prepare_hugepage_range(unsigned long addr, unsigned long len, 69static inline int prepare_hugepage_range(unsigned long addr, unsigned long len)
68 pgoff_t pgoff)
69{ 70{
70 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
71 return -EINVAL;
72 if (len & ~HPAGE_MASK) 71 if (len & ~HPAGE_MASK)
73 return -EINVAL; 72 return -EINVAL;
74 if (addr & ~HPAGE_MASK) 73 if (addr & ~HPAGE_MASK)
@@ -76,8 +75,7 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len,
76 return 0; 75 return 0;
77} 76}
78#else 77#else
79int prepare_hugepage_range(unsigned long addr, unsigned long len, 78int prepare_hugepage_range(unsigned long addr, unsigned long len);
80 pgoff_t pgoff);
81#endif 79#endif
82 80
83#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE 81#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE
@@ -115,7 +113,7 @@ static inline unsigned long hugetlb_total_pages(void)
115#define hugetlb_report_meminfo(buf) 0 113#define hugetlb_report_meminfo(buf) 0
116#define hugetlb_report_node_meminfo(n, buf) 0 114#define hugetlb_report_node_meminfo(n, buf) 0
117#define follow_huge_pmd(mm, addr, pmd, write) NULL 115#define follow_huge_pmd(mm, addr, pmd, write) NULL
118#define prepare_hugepage_range(addr,len,pgoff) (-EINVAL) 116#define prepare_hugepage_range(addr,len) (-EINVAL)
119#define pmd_huge(x) 0 117#define pmd_huge(x) 0
120#define is_hugepage_only_range(mm, addr, len) 0 118#define is_hugepage_only_range(mm, addr, len) 0
121#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 119#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index aa83d4163096..b69014865714 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -115,9 +115,10 @@
115#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ 115#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
116#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ 116#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
117#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */ 117#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */
118#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */ 118#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
119#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */ 119#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */
120#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */ 120#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
121#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
121 122
122#define I2C_DRIVERID_I2CDEV 900 123#define I2C_DRIVERID_I2CDEV 900
123#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 124#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h
deleted file mode 100644
index 67e3598c4cec..000000000000
--- a/include/linux/i2c-isa.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * i2c-isa.h - definitions for the i2c-isa pseudo-i2c-adapter interface
3 *
4 * Copyright (C) 2005 Jean Delvare <khali@linux-fr.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _LINUX_I2C_ISA_H
22#define _LINUX_I2C_ISA_H
23
24#include <linux/i2c.h>
25
26extern int i2c_isa_add_driver(struct i2c_driver *driver);
27extern int i2c_isa_del_driver(struct i2c_driver *driver);
28
29/* Detect whether we are on the isa bus. This is only useful to hybrid
30 (i2c+isa) drivers. */
31#define i2c_is_isa_adapter(adapptr) \
32 ((adapptr)->id == I2C_HW_ISA)
33#define i2c_is_isa_client(clientptr) \
34 i2c_is_isa_adapter((clientptr)->adapter)
35
36#endif /* _LINUX_I2C_ISA_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 2eaba21b9b1a..2a32f2fd940d 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -156,10 +156,14 @@ struct i2c_driver {
156 * @name: Indicates the type of the device, usually a chip name that's 156 * @name: Indicates the type of the device, usually a chip name that's
157 * generic enough to hide second-sourcing and compatible revisions. 157 * generic enough to hide second-sourcing and compatible revisions.
158 * @adapter: manages the bus segment hosting this I2C device 158 * @adapter: manages the bus segment hosting this I2C device
159 * @driver: device's driver, hence pointer to access routines
160 * @usage_count: counts current number of users of this client
159 * @dev: Driver model device node for the slave. 161 * @dev: Driver model device node for the slave.
160 * @irq: indicates the IRQ generated by this device (if any) 162 * @irq: indicates the IRQ generated by this device (if any)
161 * @driver_name: Identifies new-style driver used with this device; also 163 * @driver_name: Identifies new-style driver used with this device; also
162 * used as the module name for hotplug/coldplug modprobe support. 164 * used as the module name for hotplug/coldplug modprobe support.
165 * @list: list of active/busy clients
166 * @released: used to synchronize client releases & detaches and references
163 * 167 *
164 * An i2c_client identifies a single device (i.e. chip) connected to an 168 * An i2c_client identifies a single device (i.e. chip) connected to an
165 * i2c bus. The behaviour exposed to Linux is defined by the driver 169 * i2c bus. The behaviour exposed to Linux is defined by the driver
@@ -368,7 +372,6 @@ struct i2c_client_address_data {
368 372
369/* The numbers to use to set I2C bus address */ 373/* The numbers to use to set I2C bus address */
370#define ANY_I2C_BUS 0xffff 374#define ANY_I2C_BUS 0xffff
371#define ANY_I2C_ISA_BUS 9191
372 375
373 376
374/* ----- functions exported by i2c.o */ 377/* ----- functions exported by i2c.o */
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 333a370a3bdc..9752307d16ba 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -946,8 +946,7 @@ static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
946 strcpy(pool->name, name); 946 strcpy(pool->name, name);
947 947
948 pool->slab = 948 pool->slab =
949 kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL, 949 kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL);
950 NULL);
951 if (!pool->slab) 950 if (!pool->slab)
952 goto free_name; 951 goto free_name;
953 952
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 19ab25804056..b9f66c10caa0 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -555,7 +555,7 @@ typedef struct ide_drive_s {
555 char name[4]; /* drive name, such as "hda" */ 555 char name[4]; /* drive name, such as "hda" */
556 char driver_req[10]; /* requests specific driver */ 556 char driver_req[10]; /* requests specific driver */
557 557
558 request_queue_t *queue; /* request queue */ 558 struct request_queue *queue; /* request queue */
559 559
560 struct request *rq; /* current request */ 560 struct request *rq; /* current request */
561 struct ide_drive_s *next; /* circular list of hwgroup drives */ 561 struct ide_drive_s *next; /* circular list of hwgroup drives */
@@ -681,6 +681,10 @@ typedef struct hwif_s {
681 u8 straight8; /* Alan's straight 8 check */ 681 u8 straight8; /* Alan's straight 8 check */
682 u8 bus_state; /* power state of the IDE bus */ 682 u8 bus_state; /* power state of the IDE bus */
683 683
684 u8 host_flags;
685
686 u8 pio_mask;
687
684 u8 atapi_dma; /* host supports atapi_dma */ 688 u8 atapi_dma; /* host supports atapi_dma */
685 u8 ultra_mask; 689 u8 ultra_mask;
686 u8 mwdma_mask; 690 u8 mwdma_mask;
@@ -1202,7 +1206,7 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
1202extern int ide_spin_wait_hwgroup(ide_drive_t *); 1206extern int ide_spin_wait_hwgroup(ide_drive_t *);
1203extern void ide_timer_expiry(unsigned long); 1207extern void ide_timer_expiry(unsigned long);
1204extern irqreturn_t ide_intr(int irq, void *dev_id); 1208extern irqreturn_t ide_intr(int irq, void *dev_id);
1205extern void do_ide_request(request_queue_t *); 1209extern void do_ide_request(struct request_queue *);
1206 1210
1207void ide_init_disk(struct gendisk *, ide_drive_t *); 1211void ide_init_disk(struct gendisk *, ide_drive_t *);
1208 1212
@@ -1244,7 +1248,13 @@ typedef struct ide_pci_enablebit_s {
1244 1248
1245enum { 1249enum {
1246 /* Uses ISA control ports not PCI ones. */ 1250 /* Uses ISA control ports not PCI ones. */
1247 IDEPCI_FLAG_ISA_PORTS = (1 << 0), 1251 IDE_HFLAG_ISA_PORTS = (1 << 0),
1252 /* single port device */
1253 IDE_HFLAG_SINGLE = (1 << 1),
1254 /* don't use legacy PIO blacklist */
1255 IDE_HFLAG_PIO_NO_BLACKLIST = (1 << 2),
1256 /* don't use conservative PIO "downgrade" */
1257 IDE_HFLAG_PIO_NO_DOWNGRADE = (1 << 3),
1248}; 1258};
1249 1259
1250typedef struct ide_pci_device_s { 1260typedef struct ide_pci_device_s {
@@ -1256,13 +1266,13 @@ typedef struct ide_pci_device_s {
1256 void (*init_hwif)(ide_hwif_t *); 1266 void (*init_hwif)(ide_hwif_t *);
1257 void (*init_dma)(ide_hwif_t *, unsigned long); 1267 void (*init_dma)(ide_hwif_t *, unsigned long);
1258 void (*fixup)(ide_hwif_t *); 1268 void (*fixup)(ide_hwif_t *);
1259 u8 channels;
1260 u8 autodma; 1269 u8 autodma;
1261 ide_pci_enablebit_t enablebits[2]; 1270 ide_pci_enablebit_t enablebits[2];
1262 u8 bootable; 1271 u8 bootable;
1263 unsigned int extra; 1272 unsigned int extra;
1264 struct ide_pci_device_s *next; 1273 struct ide_pci_device_s *next;
1265 u8 flags; 1274 u8 host_flags;
1275 u8 pio_mask;
1266 u8 udma_mask; 1276 u8 udma_mask;
1267} ide_pci_device_t; 1277} ide_pci_device_t;
1268 1278
@@ -1275,13 +1285,14 @@ void ide_init_sg_cmd(ide_drive_t *, struct request *);
1275#define BAD_DMA_DRIVE 0 1285#define BAD_DMA_DRIVE 0
1276#define GOOD_DMA_DRIVE 1 1286#define GOOD_DMA_DRIVE 1
1277 1287
1278#ifdef CONFIG_BLK_DEV_IDEDMA
1279struct drive_list_entry { 1288struct drive_list_entry {
1280 const char *id_model; 1289 const char *id_model;
1281 const char *id_firmware; 1290 const char *id_firmware;
1282}; 1291};
1283 1292
1284int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); 1293int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
1294
1295#ifdef CONFIG_BLK_DEV_IDEDMA
1285int __ide_dma_bad_drive(ide_drive_t *); 1296int __ide_dma_bad_drive(ide_drive_t *);
1286int __ide_dma_good_drive(ide_drive_t *); 1297int __ide_dma_good_drive(ide_drive_t *);
1287u8 ide_max_dma_mode(ide_drive_t *); 1298u8 ide_max_dma_mode(ide_drive_t *);
@@ -1302,7 +1313,6 @@ void ide_dma_host_off(ide_drive_t *);
1302void ide_dma_off_quietly(ide_drive_t *); 1313void ide_dma_off_quietly(ide_drive_t *);
1303void ide_dma_host_on(ide_drive_t *); 1314void ide_dma_host_on(ide_drive_t *);
1304extern int __ide_dma_on(ide_drive_t *); 1315extern int __ide_dma_on(ide_drive_t *);
1305extern int __ide_dma_check(ide_drive_t *);
1306extern int ide_dma_setup(ide_drive_t *); 1316extern int ide_dma_setup(ide_drive_t *);
1307extern void ide_dma_start(ide_drive_t *); 1317extern void ide_dma_start(ide_drive_t *);
1308extern int __ide_dma_end(ide_drive_t *); 1318extern int __ide_dma_end(ide_drive_t *);
@@ -1363,6 +1373,24 @@ extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1363extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); 1373extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
1364int ide_use_fast_pio(ide_drive_t *); 1374int ide_use_fast_pio(ide_drive_t *);
1365 1375
1376static inline int ide_dev_has_iordy(struct hd_driveid *id)
1377{
1378 return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0;
1379}
1380
1381static inline int ide_dev_is_sata(struct hd_driveid *id)
1382{
1383 /*
1384 * See if word 93 is 0 AND drive is at least ATA-5 compatible
1385 * verifying that word 80 by casting it to a signed type --
1386 * this trick allows us to filter out the reserved values of
1387 * 0x0000 and 0xffff along with the earlier ATA revisions...
1388 */
1389 if (id->hw_config == 0 && (short)id->major_rev_num >= 0x0020)
1390 return 1;
1391 return 0;
1392}
1393
1366u8 ide_dump_status(ide_drive_t *, const char *, u8); 1394u8 ide_dump_status(ide_drive_t *, const char *, u8);
1367 1395
1368typedef struct ide_pio_timings_s { 1396typedef struct ide_pio_timings_s {
@@ -1372,14 +1400,8 @@ typedef struct ide_pio_timings_s {
1372 /* active + recovery (+ setup for some chips) */ 1400 /* active + recovery (+ setup for some chips) */
1373} ide_pio_timings_t; 1401} ide_pio_timings_t;
1374 1402
1375typedef struct ide_pio_data_s { 1403unsigned int ide_pio_cycle_time(ide_drive_t *, u8);
1376 u8 pio_mode; 1404u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
1377 u8 use_iordy;
1378 u8 overridden;
1379 unsigned int cycle_time;
1380} ide_pio_data_t;
1381
1382extern u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d);
1383extern const ide_pio_timings_t ide_pio_timings[6]; 1405extern const ide_pio_timings_t ide_pio_timings[6];
1384 1406
1385 1407
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index 516203b6fdeb..a7d6a2234b31 100644
--- a/include/linux/if_pppol2tp.h
+++ b/include/linux/if_pppol2tp.h
@@ -32,8 +32,8 @@ struct pppol2tp_addr
32 32
33 struct sockaddr_in addr; /* IP address and port to send to */ 33 struct sockaddr_in addr; /* IP address and port to send to */
34 34
35 __be16 s_tunnel, s_session; /* For matching incoming packets */ 35 __u16 s_tunnel, s_session; /* For matching incoming packets */
36 __be16 d_tunnel, d_session; /* For sending outgoing packets */ 36 __u16 d_tunnel, d_session; /* For sending outgoing packets */
37}; 37};
38 38
39/* Socket options: 39/* Socket options:
diff --git a/include/linux/init.h b/include/linux/init.h
index 5b5285316339..74b1f43bf982 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -40,7 +40,7 @@
40 40
41/* These are for everybody (although not all archs will actually 41/* These are for everybody (although not all archs will actually
42 discard it in modules) */ 42 discard it in modules) */
43#define __init __attribute__ ((__section__ (".init.text"))) 43#define __init __attribute__ ((__section__ (".init.text"))) __cold
44#define __initdata __attribute__ ((__section__ (".init.data"))) 44#define __initdata __attribute__ ((__section__ (".init.data")))
45#define __exitdata __attribute__ ((__section__(".exit.data"))) 45#define __exitdata __attribute__ ((__section__(".exit.data")))
46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) 46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
@@ -59,9 +59,9 @@
59#define __initdata_refok __attribute__ ((__section__ (".data.init.refok"))) 59#define __initdata_refok __attribute__ ((__section__ (".data.init.refok")))
60 60
61#ifdef MODULE 61#ifdef MODULE
62#define __exit __attribute__ ((__section__(".exit.text"))) 62#define __exit __attribute__ ((__section__(".exit.text"))) __cold
63#else 63#else
64#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text"))) 64#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text"))) __cold
65#endif 65#endif
66 66
67/* For assembly routines */ 67/* For assembly routines */
@@ -114,7 +114,7 @@ void prepare_namespace(void);
114 * 114 *
115 * This only exists for built-in code, not for modules. 115 * This only exists for built-in code, not for modules.
116 */ 116 */
117#define pure_initcall(fn) __define_initcall("0",fn,1) 117#define pure_initcall(fn) __define_initcall("0",fn,0)
118 118
119#define core_initcall(fn) __define_initcall("1",fn,1) 119#define core_initcall(fn) __define_initcall("1",fn,1)
120#define core_initcall_sync(fn) __define_initcall("1s",fn,1s) 120#define core_initcall_sync(fn) __define_initcall("1s",fn,1s)
diff --git a/include/linux/input.h b/include/linux/input.h
index 17df5a7331c7..36e00aa6f03b 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -363,6 +363,12 @@ struct input_absinfo {
363 363
364#define KEY_UNKNOWN 240 364#define KEY_UNKNOWN 240
365 365
366#define KEY_VIDEO_NEXT 241 /* drive next video source */
367#define KEY_VIDEO_PREV 242 /* drive previous video source */
368#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */
369#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
370#define KEY_DISPLAY_OFF 245 /* display device to off state */
371
366#define BTN_MISC 0x100 372#define BTN_MISC 0x100
367#define BTN_0 0x100 373#define BTN_0 0x100
368#define BTN_1 0x101 374#define BTN_1 0x101
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 5323f6275854..5523f19d88d2 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -11,8 +11,6 @@
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/irqflags.h> 13#include <linux/irqflags.h>
14#include <linux/bottom_half.h>
15#include <linux/device.h>
16#include <asm/atomic.h> 14#include <asm/atomic.h>
17#include <asm/ptrace.h> 15#include <asm/ptrace.h>
18#include <asm/system.h> 16#include <asm/system.h>
@@ -97,6 +95,8 @@ extern int __must_check request_irq(unsigned int, irq_handler_t handler,
97 unsigned long, const char *, void *); 95 unsigned long, const char *, void *);
98extern void free_irq(unsigned int, void *); 96extern void free_irq(unsigned int, void *);
99 97
98struct device;
99
100extern int __must_check devm_request_irq(struct device *dev, unsigned int irq, 100extern int __must_check devm_request_irq(struct device *dev, unsigned int irq,
101 irq_handler_t handler, unsigned long irqflags, 101 irq_handler_t handler, unsigned long irqflags,
102 const char *devname, void *dev_id); 102 const char *devname, void *dev_id);
@@ -120,11 +120,11 @@ extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
120# define local_irq_enable_in_hardirq() local_irq_enable() 120# define local_irq_enable_in_hardirq() local_irq_enable()
121#endif 121#endif
122 122
123#ifdef CONFIG_GENERIC_HARDIRQS
124extern void disable_irq_nosync(unsigned int irq); 123extern void disable_irq_nosync(unsigned int irq);
125extern void disable_irq(unsigned int irq); 124extern void disable_irq(unsigned int irq);
126extern void enable_irq(unsigned int irq); 125extern void enable_irq(unsigned int irq);
127 126
127#ifdef CONFIG_GENERIC_HARDIRQS
128/* 128/*
129 * Special lockdep variants of irq disabling/enabling. 129 * Special lockdep variants of irq disabling/enabling.
130 * These should be used for locking constructs that 130 * These should be used for locking constructs that
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 2eaa142cd061..baf29387cab4 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -53,6 +53,14 @@ static inline int task_ioprio(struct task_struct *task)
53 return IOPRIO_NORM; 53 return IOPRIO_NORM;
54} 54}
55 55
56static inline int task_ioprio_class(struct task_struct *task)
57{
58 if (ioprio_valid(task->ioprio))
59 return IOPRIO_PRIO_CLASS(task->ioprio);
60
61 return IOPRIO_CLASS_BE;
62}
63
56static inline int task_nice_ioprio(struct task_struct *task) 64static inline int task_nice_ioprio(struct task_struct *task)
57{ 65{
58 return (task_nice(task) + 20) / 5; 66 return (task_nice(task) + 20) / 5;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 97983dc9df13..4ca60c3320fb 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -219,7 +219,6 @@ enum {
219#include <linux/tcp.h> 219#include <linux/tcp.h>
220#include <linux/udp.h> 220#include <linux/udp.h>
221 221
222#include <net/if_inet6.h> /* struct ipv6_mc_socklist */
223#include <net/inet_sock.h> 222#include <net/inet_sock.h>
224 223
225static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb) 224static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb)
@@ -273,6 +272,10 @@ struct tcp6_request_sock {
273 struct inet6_request_sock tcp6rsk_inet6; 272 struct inet6_request_sock tcp6rsk_inet6;
274}; 273};
275 274
275struct ipv6_mc_socklist;
276struct ipv6_ac_socklist;
277struct ipv6_fl_socklist;
278
276/** 279/**
277 * struct ipv6_pinfo - ipv6 private area 280 * struct ipv6_pinfo - ipv6 private area
278 * 281 *
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 8e3735714c1c..28f88ecba344 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -77,6 +77,7 @@ typedef enum {
77 IRDA_ACT200L_DONGLE = 10, 77 IRDA_ACT200L_DONGLE = 10,
78 IRDA_MA600_DONGLE = 11, 78 IRDA_MA600_DONGLE = 11,
79 IRDA_TOIM3232_DONGLE = 12, 79 IRDA_TOIM3232_DONGLE = 12,
80 IRDA_EP7211_DONGLE = 13,
80} IRDA_DONGLE; 81} IRDA_DONGLE;
81 82
82/* Protocol types to be used for SOCK_DGRAM */ 83/* Protocol types to be used for SOCK_DGRAM */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 44657197fcb0..efc88538b2ba 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -140,6 +140,7 @@ struct irq_chip {
140 * @wake_depth: enable depth, for multiple set_irq_wake() callers 140 * @wake_depth: enable depth, for multiple set_irq_wake() callers
141 * @irq_count: stats field to detect stalled irqs 141 * @irq_count: stats field to detect stalled irqs
142 * @irqs_unhandled: stats field for spurious unhandled interrupts 142 * @irqs_unhandled: stats field for spurious unhandled interrupts
143 * @last_unhandled: aging timer for unhandled count
143 * @lock: locking for SMP 144 * @lock: locking for SMP
144 * @affinity: IRQ affinity on SMP 145 * @affinity: IRQ affinity on SMP
145 * @cpu: cpu index useful for balancing 146 * @cpu: cpu index useful for balancing
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 0e0fedd2039a..260d6d76c5f3 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -50,14 +50,14 @@
50 */ 50 */
51#define JBD_DEFAULT_MAX_COMMIT_AGE 5 51#define JBD_DEFAULT_MAX_COMMIT_AGE 5
52 52
53#ifdef CONFIG_JBD_DEBUG 53#ifdef CONFIG_JBD2_DEBUG
54/* 54/*
55 * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal 55 * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
56 * consistency checks. By default we don't do this unless 56 * consistency checks. By default we don't do this unless
57 * CONFIG_JBD_DEBUG is on. 57 * CONFIG_JBD2_DEBUG is on.
58 */ 58 */
59#define JBD_EXPENSIVE_CHECKING 59#define JBD_EXPENSIVE_CHECKING
60extern int jbd2_journal_enable_debug; 60extern u8 jbd2_journal_enable_debug;
61 61
62#define jbd_debug(n, f, a...) \ 62#define jbd_debug(n, f, a...) \
63 do { \ 63 do { \
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index 506ad20c18f8..8bdb16bfe5fb 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -161,4 +161,7 @@ static inline void con_schedule_flip(struct tty_struct *t)
161 schedule_delayed_work(&t->buf.work, 0); 161 schedule_delayed_work(&t->buf.work, 0);
162} 162}
163 163
164/* mac_hid.c */
165extern int mac_hid_mouse_emulate_buttons(int, unsigned int, int);
166
164#endif 167#endif
diff --git a/include/linux/kdebug.h b/include/linux/kdebug.h
index 5db38d6d8b92..ed815090b3bc 100644
--- a/include/linux/kdebug.h
+++ b/include/linux/kdebug.h
@@ -3,6 +3,8 @@
3 3
4#include <asm/kdebug.h> 4#include <asm/kdebug.h>
5 5
6struct notifier_block;
7
6struct die_args { 8struct die_args {
7 struct pt_regs *regs; 9 struct pt_regs *regs;
8 const char *str; 10 const char *str;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 1eb9cde550c4..47160fe378c9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -34,6 +34,7 @@ extern const char linux_proc_banner[];
34 34
35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
37 38
38#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 39#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
39 40
@@ -106,7 +107,7 @@ extern int cond_resched(void);
106extern struct atomic_notifier_head panic_notifier_list; 107extern struct atomic_notifier_head panic_notifier_list;
107extern long (*panic_blink)(long time); 108extern long (*panic_blink)(long time);
108NORET_TYPE void panic(const char * fmt, ...) 109NORET_TYPE void panic(const char * fmt, ...)
109 __attribute__ ((NORET_AND format (printf, 1, 2))); 110 __attribute__ ((NORET_AND format (printf, 1, 2))) __cold;
110extern void oops_enter(void); 111extern void oops_enter(void);
111extern void oops_exit(void); 112extern void oops_exit(void);
112extern int oops_may_print(void); 113extern int oops_may_print(void);
@@ -155,14 +156,14 @@ extern void dump_thread(struct pt_regs *regs, struct user *dump);
155asmlinkage int vprintk(const char *fmt, va_list args) 156asmlinkage int vprintk(const char *fmt, va_list args)
156 __attribute__ ((format (printf, 1, 0))); 157 __attribute__ ((format (printf, 1, 0)));
157asmlinkage int printk(const char * fmt, ...) 158asmlinkage int printk(const char * fmt, ...)
158 __attribute__ ((format (printf, 1, 2))); 159 __attribute__ ((format (printf, 1, 2))) __cold;
159#else 160#else
160static inline int vprintk(const char *s, va_list args) 161static inline int vprintk(const char *s, va_list args)
161 __attribute__ ((format (printf, 1, 0))); 162 __attribute__ ((format (printf, 1, 0)));
162static inline int vprintk(const char *s, va_list args) { return 0; } 163static inline int vprintk(const char *s, va_list args) { return 0; }
163static inline int printk(const char *s, ...) 164static inline int printk(const char *s, ...)
164 __attribute__ ((format (printf, 1, 2))); 165 __attribute__ ((format (printf, 1, 2)));
165static inline int printk(const char *s, ...) { return 0; } 166static inline int __cold printk(const char *s, ...) { return 0; }
166#endif 167#endif
167 168
168unsigned long int_sqrt(unsigned long); 169unsigned long int_sqrt(unsigned long);
@@ -212,7 +213,7 @@ extern enum system_states {
212#define TAINT_USER (1<<6) 213#define TAINT_USER (1<<6)
213#define TAINT_DIE (1<<7) 214#define TAINT_DIE (1<<7)
214 215
215extern void dump_stack(void); 216extern void dump_stack(void) __cold;
216 217
217enum { 218enum {
218 DUMP_PREFIX_NONE, 219 DUMP_PREFIX_NONE,
@@ -224,9 +225,9 @@ extern void hex_dump_to_buffer(const void *buf, size_t len,
224 char *linebuf, size_t linebuflen, bool ascii); 225 char *linebuf, size_t linebuflen, bool ascii);
225extern void print_hex_dump(const char *level, const char *prefix_str, 226extern void print_hex_dump(const char *level, const char *prefix_str,
226 int prefix_type, int rowsize, int groupsize, 227 int prefix_type, int rowsize, int groupsize,
227 void *buf, size_t len, bool ascii); 228 const void *buf, size_t len, bool ascii);
228extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, 229extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
229 void *buf, size_t len); 230 const void *buf, size_t len);
230#define hex_asc(x) "0123456789abcdef"[x] 231#define hex_asc(x) "0123456789abcdef"[x]
231 232
232#ifdef DEBUG 233#ifdef DEBUG
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 10f505c8431d..5dc13848891b 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -36,13 +36,57 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; }
36#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) 36#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
37 37
38struct key; 38struct key;
39extern int call_usermodehelper_keys(char *path, char *argv[], char *envp[], 39struct file;
40 struct key *session_keyring, int wait); 40struct subprocess_info;
41
42/* Allocate a subprocess_info structure */
43struct subprocess_info *call_usermodehelper_setup(char *path,
44 char **argv, char **envp);
45
46/* Set various pieces of state into the subprocess_info structure */
47void call_usermodehelper_setkeys(struct subprocess_info *info,
48 struct key *session_keyring);
49int call_usermodehelper_stdinpipe(struct subprocess_info *sub_info,
50 struct file **filp);
51void call_usermodehelper_setcleanup(struct subprocess_info *info,
52 void (*cleanup)(char **argv, char **envp));
53
54enum umh_wait {
55 UMH_NO_WAIT = -1, /* don't wait at all */
56 UMH_WAIT_EXEC = 0, /* wait for the exec, but not the process */
57 UMH_WAIT_PROC = 1, /* wait for the process to complete */
58};
59
60/* Actually execute the sub-process */
61int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait);
62
63/* Free the subprocess_info. This is only needed if you're not going
64 to call call_usermodehelper_exec */
65void call_usermodehelper_freeinfo(struct subprocess_info *info);
41 66
42static inline int 67static inline int
43call_usermodehelper(char *path, char **argv, char **envp, int wait) 68call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait)
44{ 69{
45 return call_usermodehelper_keys(path, argv, envp, NULL, wait); 70 struct subprocess_info *info;
71
72 info = call_usermodehelper_setup(path, argv, envp);
73 if (info == NULL)
74 return -ENOMEM;
75 return call_usermodehelper_exec(info, wait);
76}
77
78static inline int
79call_usermodehelper_keys(char *path, char **argv, char **envp,
80 struct key *session_keyring, enum umh_wait wait)
81{
82 struct subprocess_info *info;
83
84 info = call_usermodehelper_setup(path, argv, envp);
85 if (info == NULL)
86 return -ENOMEM;
87
88 call_usermodehelper_setkeys(info, session_keyring);
89 return call_usermodehelper_exec(info, wait);
46} 90}
47 91
48extern void usermodehelper_init(void); 92extern void usermodehelper_init(void);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 06cbf41d32d2..949706c33622 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -36,17 +36,29 @@ extern char uevent_helper[];
36/* counter to tag the uevent, read only except for the kobject core */ 36/* counter to tag the uevent, read only except for the kobject core */
37extern u64 uevent_seqnum; 37extern u64 uevent_seqnum;
38 38
39/* the actions here must match the proper string in lib/kobject_uevent.c */ 39/*
40typedef int __bitwise kobject_action_t; 40 * The actions here must match the index to the string array
41 * in lib/kobject_uevent.c
42 *
43 * Do not add new actions here without checking with the driver-core
44 * maintainers. Action strings are not meant to express subsystem
45 * or device specific properties. In most cases you want to send a
46 * kobject_uevent_env(kobj, KOBJ_CHANGE, env) with additional event
47 * specific variables added to the event environment.
48 */
41enum kobject_action { 49enum kobject_action {
42 KOBJ_ADD = (__force kobject_action_t) 0x01, /* exclusive to core */ 50 KOBJ_ADD,
43 KOBJ_REMOVE = (__force kobject_action_t) 0x02, /* exclusive to core */ 51 KOBJ_REMOVE,
44 KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* device state change */ 52 KOBJ_CHANGE,
45 KOBJ_OFFLINE = (__force kobject_action_t) 0x04, /* device offline */ 53 KOBJ_MOVE,
46 KOBJ_ONLINE = (__force kobject_action_t) 0x05, /* device online */ 54 KOBJ_ONLINE,
47 KOBJ_MOVE = (__force kobject_action_t) 0x06, /* device move */ 55 KOBJ_OFFLINE,
56 KOBJ_MAX
48}; 57};
49 58
59/* The list of strings defining the valid kobject actions as specified above */
60extern const char *kobject_actions[];
61
50struct kobject { 62struct kobject {
51 const char * k_name; 63 const char * k_name;
52 char name[KOBJ_NAME_LEN]; 64 char name[KOBJ_NAME_LEN];
@@ -99,9 +111,15 @@ struct kobj_type {
99 struct attribute ** default_attrs; 111 struct attribute ** default_attrs;
100}; 112};
101 113
114struct kset_uevent_ops {
115 int (*filter)(struct kset *kset, struct kobject *kobj);
116 const char *(*name)(struct kset *kset, struct kobject *kobj);
117 int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp,
118 int num_envp, char *buffer, int buffer_size);
119};
102 120
103/** 121/*
104 * kset - a set of kobjects of a specific type, belonging 122 * struct kset - a set of kobjects of a specific type, belonging
105 * to a specific subsystem. 123 * to a specific subsystem.
106 * 124 *
107 * All kobjects of a kset should be embedded in an identical 125 * All kobjects of a kset should be embedded in an identical
@@ -117,13 +135,6 @@ struct kobj_type {
117 * supress the event generation or add subsystem specific 135 * supress the event generation or add subsystem specific
118 * variables carried with the event. 136 * variables carried with the event.
119 */ 137 */
120struct kset_uevent_ops {
121 int (*filter)(struct kset *kset, struct kobject *kobj);
122 const char *(*name)(struct kset *kset, struct kobject *kobj);
123 int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp,
124 int num_envp, char *buffer, int buffer_size);
125};
126
127struct kset { 138struct kset {
128 struct kobj_type * ktype; 139 struct kobj_type * ktype;
129 struct list_head list; 140 struct list_head list;
@@ -164,7 +175,7 @@ static inline struct kobj_type * get_ktype(struct kobject * k)
164extern struct kobject * kset_find_obj(struct kset *, const char *); 175extern struct kobject * kset_find_obj(struct kset *, const char *);
165 176
166 177
167/** 178/*
168 * Use this when initializing an embedded kset with no other 179 * Use this when initializing an embedded kset with no other
169 * fields to initialize. 180 * fields to initialize.
170 */ 181 */
@@ -189,7 +200,7 @@ extern struct kset kernel_subsys;
189/* The global /sys/hypervisor/ subsystem */ 200/* The global /sys/hypervisor/ subsystem */
190extern struct kset hypervisor_subsys; 201extern struct kset hypervisor_subsys;
191 202
192/** 203/*
193 * Helpers for setting the kset of registered objects. 204 * Helpers for setting the kset of registered objects.
194 * Often, a registered object belongs to a kset embedded in a 205 * Often, a registered object belongs to a kset embedded in a
195 * subsystem. These do no magic, just make the resulting code 206 * subsystem. These do no magic, just make the resulting code
@@ -224,7 +235,7 @@ extern struct kset hypervisor_subsys;
224/** 235/**
225 * subsys_set_kset(obj,subsys) - set kset for subsystem 236 * subsys_set_kset(obj,subsys) - set kset for subsystem
226 * @obj: ptr to some object type. 237 * @obj: ptr to some object type.
227 * @subsys: a subsystem object (not a ptr). 238 * @_subsys: a subsystem object (not a ptr).
228 * 239 *
229 * Can be used for any object type with an embedded ->subsys. 240 * Can be used for any object type with an embedded ->subsys.
230 * Sets the kset of @obj's kobject to @subsys.kset. This makes 241 * Sets the kset of @obj's kobject to @subsys.kset. This makes
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 23adf6075ae4..51464d12a4e5 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -116,9 +116,12 @@ struct kprobe {
116 */ 116 */
117struct jprobe { 117struct jprobe {
118 struct kprobe kp; 118 struct kprobe kp;
119 kprobe_opcode_t *entry; /* probe handling code to jump to */ 119 void *entry; /* probe handling code to jump to */
120}; 120};
121 121
122/* For backward compatibility with old code using JPROBE_ENTRY() */
123#define JPROBE_ENTRY(handler) (handler)
124
122DECLARE_PER_CPU(struct kprobe *, current_kprobe); 125DECLARE_PER_CPU(struct kprobe *, current_kprobe);
123DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 126DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
124 127
@@ -211,6 +214,7 @@ int longjmp_break_handler(struct kprobe *, struct pt_regs *);
211int register_jprobe(struct jprobe *p); 214int register_jprobe(struct jprobe *p);
212void unregister_jprobe(struct jprobe *p); 215void unregister_jprobe(struct jprobe *p);
213void jprobe_return(void); 216void jprobe_return(void);
217unsigned long arch_deref_entry_point(void *);
214 218
215int register_kretprobe(struct kretprobe *rp); 219int register_kretprobe(struct kretprobe *rp);
216void unregister_kretprobe(struct kretprobe *rp); 220void unregister_kretprobe(struct kretprobe *rp);
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index 598793c0745b..1d379787f2e7 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -62,8 +62,8 @@ struct lcd_device {
62 struct mutex update_lock; 62 struct mutex update_lock;
63 /* The framebuffer notifier block */ 63 /* The framebuffer notifier block */
64 struct notifier_block fb_notif; 64 struct notifier_block fb_notif;
65 /* The class device structure */ 65
66 struct class_device class_dev; 66 struct device dev;
67}; 67};
68 68
69static inline void lcd_set_power(struct lcd_device *ld, int power) 69static inline void lcd_set_power(struct lcd_device *ld, int power)
@@ -75,9 +75,15 @@ static inline void lcd_set_power(struct lcd_device *ld, int power)
75} 75}
76 76
77extern struct lcd_device *lcd_device_register(const char *name, 77extern struct lcd_device *lcd_device_register(const char *name,
78 void *devdata, struct lcd_ops *ops); 78 struct device *parent, void *devdata, struct lcd_ops *ops);
79extern void lcd_device_unregister(struct lcd_device *ld); 79extern void lcd_device_unregister(struct lcd_device *ld);
80 80
81#define to_lcd_device(obj) container_of(obj, struct lcd_device, class_dev) 81#define to_lcd_device(obj) container_of(obj, struct lcd_device, dev)
82
83static inline void * lcd_get_data(struct lcd_device *ld_dev)
84{
85 return dev_get_drvdata(&ld_dev->dev);
86}
87
82 88
83#endif 89#endif
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 494bed7c2fc1..421175092ee2 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -15,7 +15,6 @@
15#include <linux/list.h> 15#include <linux/list.h>
16 16
17struct device; 17struct device;
18struct class_device;
19/* 18/*
20 * LED Core 19 * LED Core
21 */ 20 */
@@ -37,7 +36,7 @@ struct led_classdev {
37 void (*brightness_set)(struct led_classdev *led_cdev, 36 void (*brightness_set)(struct led_classdev *led_cdev,
38 enum led_brightness brightness); 37 enum led_brightness brightness);
39 38
40 struct class_device *class_dev; 39 struct device *dev;
41 struct list_head node; /* LED Device list */ 40 struct list_head node; /* LED Device list */
42 char *default_trigger; /* Trigger to use */ 41 char *default_trigger; /* Trigger to use */
43 42
@@ -109,4 +108,18 @@ extern void ledtrig_ide_activity(void);
109#define ledtrig_ide_activity() do {} while(0) 108#define ledtrig_ide_activity() do {} while(0)
110#endif 109#endif
111 110
111/* For the leds-gpio driver */
112struct gpio_led {
113 const char *name;
114 char *default_trigger;
115 unsigned gpio;
116 u8 active_low;
117};
118
119struct gpio_led_platform_data {
120 int num_leds;
121 struct gpio_led *leds;
122};
123
124
112#endif /* __LINUX_LEDS_H_INCLUDED */ 125#endif /* __LINUX_LEDS_H_INCLUDED */
diff --git a/include/linux/lguest.h b/include/linux/lguest.h
new file mode 100644
index 000000000000..157ad64aa7ce
--- /dev/null
+++ b/include/linux/lguest.h
@@ -0,0 +1,116 @@
1/* Things the lguest guest needs to know. Note: like all lguest interfaces,
2 * this is subject to wild and random change between versions. */
3#ifndef _ASM_LGUEST_H
4#define _ASM_LGUEST_H
5
6#ifndef __ASSEMBLY__
7#include <asm/irq.h>
8
9#define LHCALL_FLUSH_ASYNC 0
10#define LHCALL_LGUEST_INIT 1
11#define LHCALL_CRASH 2
12#define LHCALL_LOAD_GDT 3
13#define LHCALL_NEW_PGTABLE 4
14#define LHCALL_FLUSH_TLB 5
15#define LHCALL_LOAD_IDT_ENTRY 6
16#define LHCALL_SET_STACK 7
17#define LHCALL_TS 8
18#define LHCALL_SET_CLOCKEVENT 9
19#define LHCALL_HALT 10
20#define LHCALL_BIND_DMA 12
21#define LHCALL_SEND_DMA 13
22#define LHCALL_SET_PTE 14
23#define LHCALL_SET_PMD 15
24#define LHCALL_LOAD_TLS 16
25
26#define LG_CLOCK_MIN_DELTA 100UL
27#define LG_CLOCK_MAX_DELTA ULONG_MAX
28
29/*G:031 First, how does our Guest contact the Host to ask for privileged
30 * operations? There are two ways: the direct way is to make a "hypercall",
31 * to make requests of the Host Itself.
32 *
33 * Our hypercall mechanism uses the highest unused trap code (traps 32 and
34 * above are used by real hardware interrupts). Seventeen hypercalls are
35 * available: the hypercall number is put in the %eax register, and the
36 * arguments (when required) are placed in %edx, %ebx and %ecx. If a return
37 * value makes sense, it's returned in %eax.
38 *
39 * Grossly invalid calls result in Sudden Death at the hands of the vengeful
40 * Host, rather than returning failure. This reflects Winston Churchill's
41 * definition of a gentleman: "someone who is only rude intentionally". */
42#define LGUEST_TRAP_ENTRY 0x1F
43
44static inline unsigned long
45hcall(unsigned long call,
46 unsigned long arg1, unsigned long arg2, unsigned long arg3)
47{
48 /* "int" is the Intel instruction to trigger a trap. */
49 asm volatile("int $" __stringify(LGUEST_TRAP_ENTRY)
50 /* The call is in %eax (aka "a"), and can be replaced */
51 : "=a"(call)
52 /* The other arguments are in %eax, %edx, %ebx & %ecx */
53 : "a"(call), "d"(arg1), "b"(arg2), "c"(arg3)
54 /* "memory" means this might write somewhere in memory.
55 * This isn't true for all calls, but it's safe to tell
56 * gcc that it might happen so it doesn't get clever. */
57 : "memory");
58 return call;
59}
60/*:*/
61
62void async_hcall(unsigned long call,
63 unsigned long arg1, unsigned long arg2, unsigned long arg3);
64
65/* Can't use our min() macro here: needs to be a constant */
66#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
67
68#define LHCALL_RING_SIZE 64
69struct hcall_ring
70{
71 u32 eax, edx, ebx, ecx;
72};
73
74/*G:032 The second method of communicating with the Host is to via "struct
75 * lguest_data". The Guest's very first hypercall is to tell the Host where
76 * this is, and then the Guest and Host both publish information in it. :*/
77struct lguest_data
78{
79 /* 512 == enabled (same as eflags in normal hardware). The Guest
80 * changes interrupts so often that a hypercall is too slow. */
81 unsigned int irq_enabled;
82 /* Fine-grained interrupt disabling by the Guest */
83 DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS);
84
85 /* The Host writes the virtual address of the last page fault here,
86 * which saves the Guest a hypercall. CR2 is the native register where
87 * this address would normally be found. */
88 unsigned long cr2;
89
90 /* Wallclock time set by the Host. */
91 struct timespec time;
92
93 /* Async hypercall ring. Instead of directly making hypercalls, we can
94 * place them in here for processing the next time the Host wants.
95 * This batching can be quite efficient. */
96
97 /* 0xFF == done (set by Host), 0 == pending (set by Guest). */
98 u8 hcall_status[LHCALL_RING_SIZE];
99 /* The actual registers for the hypercalls. */
100 struct hcall_ring hcalls[LHCALL_RING_SIZE];
101
102/* Fields initialized by the Host at boot: */
103 /* Memory not to try to access */
104 unsigned long reserve_mem;
105 /* ID of this Guest (used by network driver to set ethernet address) */
106 u16 guestid;
107 /* KHz for the TSC clock. */
108 u32 tsc_khz;
109
110/* Fields initialized by the Guest at boot: */
111 /* Instruction range to suppress interrupts even if enabled */
112 unsigned long noirq_start, noirq_end;
113};
114extern struct lguest_data lguest_data;
115#endif /* __ASSEMBLY__ */
116#endif /* _ASM_LGUEST_H */
diff --git a/include/linux/lguest_bus.h b/include/linux/lguest_bus.h
new file mode 100644
index 000000000000..d27853ddc644
--- /dev/null
+++ b/include/linux/lguest_bus.h
@@ -0,0 +1,51 @@
1#ifndef _ASM_LGUEST_DEVICE_H
2#define _ASM_LGUEST_DEVICE_H
3/* Everything you need to know about lguest devices. */
4#include <linux/device.h>
5#include <linux/lguest.h>
6#include <linux/lguest_launcher.h>
7
8struct lguest_device {
9 /* Unique busid, and index into lguest_page->devices[] */
10 unsigned int index;
11
12 struct device dev;
13
14 /* Driver can hang data off here. */
15 void *private;
16};
17
18/*D:380 Since interrupt numbers are arbitrary, we use a convention: each device
19 * can use the interrupt number corresponding to its index. The +1 is because
20 * interrupt 0 is not usable (it's actually the timer interrupt). */
21static inline int lgdev_irq(const struct lguest_device *dev)
22{
23 return dev->index + 1;
24}
25/*:*/
26
27/* dma args must not be vmalloced! */
28void lguest_send_dma(unsigned long key, struct lguest_dma *dma);
29int lguest_bind_dma(unsigned long key, struct lguest_dma *dmas,
30 unsigned int num, u8 irq);
31void lguest_unbind_dma(unsigned long key, struct lguest_dma *dmas);
32
33/* Map the virtual device space */
34void *lguest_map(unsigned long phys_addr, unsigned long pages);
35void lguest_unmap(void *);
36
37struct lguest_driver {
38 const char *name;
39 struct module *owner;
40 u16 device_type;
41 int (*probe)(struct lguest_device *dev);
42 void (*remove)(struct lguest_device *dev);
43
44 struct device_driver drv;
45};
46
47extern int register_lguest_driver(struct lguest_driver *drv);
48extern void unregister_lguest_driver(struct lguest_driver *drv);
49
50extern struct lguest_device_desc *lguest_devices; /* Just past max_pfn */
51#endif /* _ASM_LGUEST_DEVICE_H */
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h
new file mode 100644
index 000000000000..641670579446
--- /dev/null
+++ b/include/linux/lguest_launcher.h
@@ -0,0 +1,127 @@
1#ifndef _ASM_LGUEST_USER
2#define _ASM_LGUEST_USER
3/* Everything the "lguest" userspace program needs to know. */
4/* They can register up to 32 arrays of lguest_dma. */
5#define LGUEST_MAX_DMA 32
6/* At most we can dma 16 lguest_dma in one op. */
7#define LGUEST_MAX_DMA_SECTIONS 16
8
9/* How many devices? Assume each one wants up to two dma arrays per device. */
10#define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2)
11
12/*D:200
13 * Lguest I/O
14 *
15 * The lguest I/O mechanism is the only way Guests can talk to devices. There
16 * are two hypercalls involved: SEND_DMA for output and BIND_DMA for input. In
17 * each case, "struct lguest_dma" describes the buffer: this contains 16
18 * addr/len pairs, and if there are fewer buffer elements the len array is
19 * terminated with a 0.
20 *
21 * I/O is organized by keys: BIND_DMA attaches buffers to a particular key, and
22 * SEND_DMA transfers to buffers bound to particular key. By convention, keys
23 * correspond to a physical address within the device's page. This means that
24 * devices will never accidentally end up with the same keys, and allows the
25 * Host use The Futex Trick (as we'll see later in our journey).
26 *
27 * SEND_DMA simply indicates a key to send to, and the physical address of the
28 * "struct lguest_dma" to send. The Host will write the number of bytes
29 * transferred into the "struct lguest_dma"'s used_len member.
30 *
31 * BIND_DMA indicates a key to bind to, a pointer to an array of "struct
32 * lguest_dma"s ready for receiving, the size of that array, and an interrupt
33 * to trigger when data is received. The Host will only allow transfers into
34 * buffers with a used_len of zero: it then sets used_len to the number of
35 * bytes transferred and triggers the interrupt for the Guest to process the
36 * new input. */
37struct lguest_dma
38{
39 /* 0 if free to be used, filled by the Host. */
40 u32 used_len;
41 unsigned long addr[LGUEST_MAX_DMA_SECTIONS];
42 u16 len[LGUEST_MAX_DMA_SECTIONS];
43};
44/*:*/
45
46/*D:460 This is the layout of a block device memory page. The Launcher sets up
47 * the num_sectors initially to tell the Guest the size of the disk. The Guest
48 * puts the type, sector and length of the request in the first three fields,
49 * then DMAs to the Host. The Host processes the request, sets up the result,
50 * then DMAs back to the Guest. */
51struct lguest_block_page
52{
53 /* 0 is a read, 1 is a write. */
54 int type;
55 u32 sector; /* Offset in device = sector * 512. */
56 u32 bytes; /* Length expected to be read/written in bytes */
57 /* 0 = pending, 1 = done, 2 = done, error */
58 int result;
59 u32 num_sectors; /* Disk length = num_sectors * 512 */
60};
61
62/*D:520 The network device is basically a memory page where all the Guests on
63 * the network publish their MAC (ethernet) addresses: it's an array of "struct
64 * lguest_net": */
65struct lguest_net
66{
67 /* Simply the mac address (with multicast bit meaning promisc). */
68 unsigned char mac[6];
69};
70/*:*/
71
72/* Where the Host expects the Guest to SEND_DMA console output to. */
73#define LGUEST_CONSOLE_DMA_KEY 0
74
75/*D:010
76 * Drivers
77 *
78 * The Guest needs devices to do anything useful. Since we don't let it touch
79 * real devices (think of the damage it could do!) we provide virtual devices.
80 * We could emulate a PCI bus with various devices on it, but that is a fairly
81 * complex burden for the Host and suboptimal for the Guest, so we have our own
82 * "lguest" bus and simple drivers.
83 *
84 * Devices are described by an array of LGUEST_MAX_DEVICES of these structs,
85 * placed by the Launcher just above the top of physical memory:
86 */
87struct lguest_device_desc {
88 /* The device type: console, network, disk etc. */
89 u16 type;
90#define LGUEST_DEVICE_T_CONSOLE 1
91#define LGUEST_DEVICE_T_NET 2
92#define LGUEST_DEVICE_T_BLOCK 3
93
94 /* The specific features of this device: these depends on device type
95 * except for LGUEST_DEVICE_F_RANDOMNESS. */
96 u16 features;
97#define LGUEST_NET_F_NOCSUM 0x4000 /* Don't bother checksumming */
98#define LGUEST_DEVICE_F_RANDOMNESS 0x8000 /* IRQ is fairly random */
99
100 /* This is how the Guest reports status of the device: the Host can set
101 * LGUEST_DEVICE_S_REMOVED to indicate removal, but the rest are only
102 * ever manipulated by the Guest, and only ever set. */
103 u16 status;
104/* 256 and above are device specific. */
105#define LGUEST_DEVICE_S_ACKNOWLEDGE 1 /* We have seen device. */
106#define LGUEST_DEVICE_S_DRIVER 2 /* We have found a driver */
107#define LGUEST_DEVICE_S_DRIVER_OK 4 /* Driver says OK! */
108#define LGUEST_DEVICE_S_REMOVED 8 /* Device has gone away. */
109#define LGUEST_DEVICE_S_REMOVED_ACK 16 /* Driver has been told. */
110#define LGUEST_DEVICE_S_FAILED 128 /* Something actually failed */
111
112 /* Each device exists somewhere in Guest physical memory, over some
113 * number of pages. */
114 u16 num_pages;
115 u32 pfn;
116};
117/*:*/
118
119/* Write command first word is a request. */
120enum lguest_req
121{
122 LHREQ_INITIALIZE, /* + pfnlimit, pgdir, start, pageoffset */
123 LHREQ_GETDMA, /* + addr (returns &lguest_dma, irq in ->used_len) */
124 LHREQ_IRQ, /* + irq */
125 LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */
126};
127#endif /* _ASM_LGUEST_USER */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 47cd2a1c5544..a67bb9075e9b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -216,6 +216,8 @@ enum {
216 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ 216 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */
217 ATA_HOST_STARTED = (1 << 1), /* Host started */ 217 ATA_HOST_STARTED = (1 << 1), /* Host started */
218 218
219 /* bits 24:31 of host->flags are reserved for LLD specific flags */
220
219 /* various lengths of time */ 221 /* various lengths of time */
220 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 222 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
221 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 223 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
@@ -301,6 +303,7 @@ enum {
301 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ 303 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */
302 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ 304 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */
303 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ 305 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */
306 ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */
304}; 307};
305 308
306enum hsm_task_states { 309enum hsm_task_states {
@@ -323,6 +326,7 @@ enum ata_completion_errors {
323 AC_ERR_INVALID = (1 << 7), /* invalid argument */ 326 AC_ERR_INVALID = (1 << 7), /* invalid argument */
324 AC_ERR_OTHER = (1 << 8), /* unknown */ 327 AC_ERR_OTHER = (1 << 8), /* unknown */
325 AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */ 328 AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */
329 AC_ERR_NCQ = (1 << 10), /* marker for offending NCQ qc */
326}; 330};
327 331
328/* forward declarations */ 332/* forward declarations */
@@ -411,6 +415,7 @@ struct ata_queued_cmd {
411 ata_qc_cb_t complete_fn; 415 ata_qc_cb_t complete_fn;
412 416
413 void *private_data; 417 void *private_data;
418 void *lldd_task;
414}; 419};
415 420
416struct ata_port_stats { 421struct ata_port_stats {
@@ -530,6 +535,7 @@ struct ata_port {
530 unsigned int cbl; /* cable type; ATA_CBL_xxx */ 535 unsigned int cbl; /* cable type; ATA_CBL_xxx */
531 unsigned int hw_sata_spd_limit; 536 unsigned int hw_sata_spd_limit;
532 unsigned int sata_spd_limit; /* SATA PHY speed limit */ 537 unsigned int sata_spd_limit; /* SATA PHY speed limit */
538 unsigned int sata_spd; /* current SATA PHY speed */
533 539
534 /* record runtime error info, protected by host lock */ 540 /* record runtime error info, protected by host lock */
535 struct ata_eh_info eh_info; 541 struct ata_eh_info eh_info;
@@ -563,6 +569,9 @@ struct ata_port {
563 pm_message_t pm_mesg; 569 pm_message_t pm_mesg;
564 int *pm_result; 570 int *pm_result;
565 571
572 struct timer_list fastdrain_timer;
573 unsigned long fastdrain_cnt;
574
566 void *private_data; 575 void *private_data;
567 576
568#ifdef CONFIG_ATA_ACPI 577#ifdef CONFIG_ATA_ACPI
@@ -619,9 +628,8 @@ struct ata_port_operations {
619 u8 (*irq_on) (struct ata_port *); 628 u8 (*irq_on) (struct ata_port *);
620 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq); 629 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
621 630
622 u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); 631 int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val);
623 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 632 int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val);
624 u32 val);
625 633
626 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); 634 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg);
627 int (*port_resume) (struct ata_port *ap); 635 int (*port_resume) (struct ata_port *ap);
@@ -764,7 +772,8 @@ extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *);
764 */ 772 */
765extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); 773extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
766extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 774extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
767extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp); 775extern void ata_tf_to_fis(const struct ata_taskfile *tf,
776 u8 pmp, int is_cmd, u8 *fis);
768extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); 777extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
769extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); 778extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
770extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); 779extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
@@ -909,27 +918,21 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
909/* 918/*
910 * ata_eh_info helpers 919 * ata_eh_info helpers
911 */ 920 */
912#define ata_ehi_push_desc(ehi, fmt, args...) do { \ 921extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
913 (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \ 922extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
914 ATA_EH_DESC_LEN - (ehi)->desc_len, \ 923extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
915 fmt , ##args); \ 924
916} while (0) 925static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi)
917
918#define ata_ehi_clear_desc(ehi) do { \
919 (ehi)->desc[0] = '\0'; \
920 (ehi)->desc_len = 0; \
921} while (0)
922
923static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
924{ 926{
925 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK; 927 ehi->flags |= ATA_EHI_RESUME_LINK;
926 ehi->action |= ATA_EH_SOFTRESET; 928 ehi->action |= ATA_EH_SOFTRESET;
927 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; 929 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
928} 930}
929 931
930static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) 932static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
931{ 933{
932 __ata_ehi_hotplugged(ehi); 934 ata_ehi_schedule_probe(ehi);
935 ehi->flags |= ATA_EHI_HOTPLUGGED;
933 ehi->err_mask |= AC_ERR_ATA_BUS; 936 ehi->err_mask |= AC_ERR_ATA_BUS;
934} 937}
935 938
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 14c937d345cb..0e843bf65877 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * Runtime locking correctness validator 2 * Runtime locking correctness validator
3 * 3 *
4 * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> 4 * Copyright (C) 2006,2007 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
5 * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com>
5 * 6 *
6 * see Documentation/lockdep-design.txt for more details. 7 * see Documentation/lockdep-design.txt for more details.
7 */ 8 */
@@ -9,6 +10,7 @@
9#define __LINUX_LOCKDEP_H 10#define __LINUX_LOCKDEP_H
10 11
11struct task_struct; 12struct task_struct;
13struct lockdep_map;
12 14
13#ifdef CONFIG_LOCKDEP 15#ifdef CONFIG_LOCKDEP
14 16
@@ -114,8 +116,44 @@ struct lock_class {
114 116
115 const char *name; 117 const char *name;
116 int name_version; 118 int name_version;
119
120#ifdef CONFIG_LOCK_STAT
121 unsigned long contention_point[4];
122#endif
123};
124
125#ifdef CONFIG_LOCK_STAT
126struct lock_time {
127 s64 min;
128 s64 max;
129 s64 total;
130 unsigned long nr;
131};
132
133enum bounce_type {
134 bounce_acquired_write,
135 bounce_acquired_read,
136 bounce_contended_write,
137 bounce_contended_read,
138 nr_bounce_types,
139
140 bounce_acquired = bounce_acquired_write,
141 bounce_contended = bounce_contended_write,
117}; 142};
118 143
144struct lock_class_stats {
145 unsigned long contention_point[4];
146 struct lock_time read_waittime;
147 struct lock_time write_waittime;
148 struct lock_time read_holdtime;
149 struct lock_time write_holdtime;
150 unsigned long bounces[nr_bounce_types];
151};
152
153struct lock_class_stats lock_stats(struct lock_class *class);
154void clear_lock_stats(struct lock_class *class);
155#endif
156
119/* 157/*
120 * Map the lock object (the lock instance) to the lock-class object. 158 * Map the lock object (the lock instance) to the lock-class object.
121 * This is embedded into specific lock instances: 159 * This is embedded into specific lock instances:
@@ -124,6 +162,9 @@ struct lockdep_map {
124 struct lock_class_key *key; 162 struct lock_class_key *key;
125 struct lock_class *class_cache; 163 struct lock_class *class_cache;
126 const char *name; 164 const char *name;
165#ifdef CONFIG_LOCK_STAT
166 int cpu;
167#endif
127}; 168};
128 169
129/* 170/*
@@ -165,6 +206,10 @@ struct held_lock {
165 unsigned long acquire_ip; 206 unsigned long acquire_ip;
166 struct lockdep_map *instance; 207 struct lockdep_map *instance;
167 208
209#ifdef CONFIG_LOCK_STAT
210 u64 waittime_stamp;
211 u64 holdtime_stamp;
212#endif
168 /* 213 /*
169 * The lock-stack is unified in that the lock chains of interrupt 214 * The lock-stack is unified in that the lock chains of interrupt
170 * contexts nest ontop of process context chains, but we 'separate' 215 * contexts nest ontop of process context chains, but we 'separate'
@@ -281,6 +326,30 @@ struct lock_class_key { };
281 326
282#endif /* !LOCKDEP */ 327#endif /* !LOCKDEP */
283 328
329#ifdef CONFIG_LOCK_STAT
330
331extern void lock_contended(struct lockdep_map *lock, unsigned long ip);
332extern void lock_acquired(struct lockdep_map *lock);
333
334#define LOCK_CONTENDED(_lock, try, lock) \
335do { \
336 if (!try(_lock)) { \
337 lock_contended(&(_lock)->dep_map, _RET_IP_); \
338 lock(_lock); \
339 } \
340 lock_acquired(&(_lock)->dep_map); \
341} while (0)
342
343#else /* CONFIG_LOCK_STAT */
344
345#define lock_contended(lockdep_map, ip) do {} while (0)
346#define lock_acquired(lockdep_map) do {} while (0)
347
348#define LOCK_CONTENDED(_lock, try, lock) \
349 lock(_lock)
350
351#endif /* CONFIG_LOCK_STAT */
352
284#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS) 353#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
285extern void early_init_irq_lock_class(void); 354extern void early_init_irq_lock_class(void);
286#else 355#else
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 0b99b31f017b..26a0a103898f 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -63,7 +63,7 @@ struct loop_device {
63 struct task_struct *lo_thread; 63 struct task_struct *lo_thread;
64 wait_queue_head_t lo_event; 64 wait_queue_head_t lo_event;
65 65
66 request_queue_t *lo_queue; 66 struct request_queue *lo_queue;
67 struct gendisk *lo_disk; 67 struct gendisk *lo_disk;
68 struct list_head lo_list; 68 struct list_head lo_list;
69}; 69};
diff --git a/include/linux/major.h b/include/linux/major.h
index 7e7c9093919a..0cb98053537a 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -158,6 +158,8 @@
158#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */ 158#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */
159#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */ 159#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */
160 160
161#define XENVBD_MAJOR 202 /* Xen virtual block device */
162
161#define MSR_MAJOR 202 163#define MSR_MAJOR 202
162#define CPUID_MAJOR 203 164#define CPUID_MAJOR 203
163 165
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index e147cf50529f..5bdd656e88cf 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -166,7 +166,7 @@ extern enum zone_type policy_zone;
166 166
167static inline void check_highest_zone(enum zone_type k) 167static inline void check_highest_zone(enum zone_type k)
168{ 168{
169 if (k > policy_zone) 169 if (k > policy_zone && k != ZONE_MOVABLE)
170 policy_zone = k; 170 policy_zone = k;
171} 171}
172 172
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a5c451816fdc..1692dd6cb915 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -10,7 +10,6 @@
10#include <linux/mmzone.h> 10#include <linux/mmzone.h>
11#include <linux/rbtree.h> 11#include <linux/rbtree.h>
12#include <linux/prio_tree.h> 12#include <linux/prio_tree.h>
13#include <linux/fs.h>
14#include <linux/mutex.h> 13#include <linux/mutex.h>
15#include <linux/debug_locks.h> 14#include <linux/debug_locks.h>
16#include <linux/backing-dev.h> 15#include <linux/backing-dev.h>
@@ -18,7 +17,9 @@
18 17
19struct mempolicy; 18struct mempolicy;
20struct anon_vma; 19struct anon_vma;
20struct file_ra_state;
21struct user_struct; 21struct user_struct;
22struct writeback_control;
22 23
23#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ 24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */
24extern unsigned long max_mapnr; 25extern unsigned long max_mapnr;
@@ -168,6 +169,8 @@ extern unsigned int kobjsize(const void *objp);
168#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ 169#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
169#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */ 170#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */
170 171
172#define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */
173
171#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 174#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
172#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 175#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
173#endif 176#endif
@@ -190,6 +193,30 @@ extern unsigned int kobjsize(const void *objp);
190 */ 193 */
191extern pgprot_t protection_map[16]; 194extern pgprot_t protection_map[16];
192 195
196#define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */
197#define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */
198
199
200/*
201 * vm_fault is filled by the the pagefault handler and passed to the vma's
202 * ->fault function. The vma's ->fault is responsible for returning a bitmask
203 * of VM_FAULT_xxx flags that give details about how the fault was handled.
204 *
205 * pgoff should be used in favour of virtual_address, if possible. If pgoff
206 * is used, one may set VM_CAN_NONLINEAR in the vma->vm_flags to get nonlinear
207 * mapping support.
208 */
209struct vm_fault {
210 unsigned int flags; /* FAULT_FLAG_xxx flags */
211 pgoff_t pgoff; /* Logical page offset based on vma */
212 void __user *virtual_address; /* Faulting virtual address */
213
214 struct page *page; /* ->fault handlers should return a
215 * page here, unless VM_FAULT_NOPAGE
216 * is set (which is also implied by
217 * VM_FAULT_ERROR).
218 */
219};
193 220
194/* 221/*
195 * These are the virtual MM functions - opening of an area, closing and 222 * These are the virtual MM functions - opening of an area, closing and
@@ -199,9 +226,11 @@ extern pgprot_t protection_map[16];
199struct vm_operations_struct { 226struct vm_operations_struct {
200 void (*open)(struct vm_area_struct * area); 227 void (*open)(struct vm_area_struct * area);
201 void (*close)(struct vm_area_struct * area); 228 void (*close)(struct vm_area_struct * area);
202 struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); 229 int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
203 unsigned long (*nopfn)(struct vm_area_struct * area, unsigned long address); 230 struct page *(*nopage)(struct vm_area_struct *area,
204 int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); 231 unsigned long address, int *type);
232 unsigned long (*nopfn)(struct vm_area_struct *area,
233 unsigned long address);
205 234
206 /* notification that a previously read-only page is about to become 235 /* notification that a previously read-only page is about to become
207 * writable, if an error is returned it will cause a SIGBUS */ 236 * writable, if an error is returned it will cause a SIGBUS */
@@ -655,7 +684,6 @@ static inline int page_mapped(struct page *page)
655 */ 684 */
656#define NOPAGE_SIGBUS (NULL) 685#define NOPAGE_SIGBUS (NULL)
657#define NOPAGE_OOM ((struct page *) (-1)) 686#define NOPAGE_OOM ((struct page *) (-1))
658#define NOPAGE_REFAULT ((struct page *) (-2)) /* Return to userspace, rerun */
659 687
660/* 688/*
661 * Error return values for the *_nopfn functions 689 * Error return values for the *_nopfn functions
@@ -669,16 +697,18 @@ static inline int page_mapped(struct page *page)
669 * Used to decide whether a process gets delivered SIGBUS or 697 * Used to decide whether a process gets delivered SIGBUS or
670 * just gets major/minor fault counters bumped up. 698 * just gets major/minor fault counters bumped up.
671 */ 699 */
672#define VM_FAULT_OOM 0x00 700
673#define VM_FAULT_SIGBUS 0x01 701#define VM_FAULT_MINOR 0 /* For backwards compat. Remove me quickly. */
674#define VM_FAULT_MINOR 0x02 702
675#define VM_FAULT_MAJOR 0x03 703#define VM_FAULT_OOM 0x0001
676 704#define VM_FAULT_SIGBUS 0x0002
677/* 705#define VM_FAULT_MAJOR 0x0004
678 * Special case for get_user_pages. 706#define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */
679 * Must be in a distinct bit from the above VM_FAULT_ flags. 707
680 */ 708#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */
681#define VM_FAULT_WRITE 0x10 709#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */
710
711#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS)
682 712
683#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) 713#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
684 714
@@ -762,20 +792,10 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
762 792
763extern int vmtruncate(struct inode * inode, loff_t offset); 793extern int vmtruncate(struct inode * inode, loff_t offset);
764extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); 794extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end);
765extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
766extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
767 795
768#ifdef CONFIG_MMU 796#ifdef CONFIG_MMU
769extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, 797extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
770 unsigned long address, int write_access); 798 unsigned long address, int write_access);
771
772static inline int handle_mm_fault(struct mm_struct *mm,
773 struct vm_area_struct *vma, unsigned long address,
774 int write_access)
775{
776 return __handle_mm_fault(mm, vma, address, write_access) &
777 (~VM_FAULT_WRITE);
778}
779#else 799#else
780static inline int handle_mm_fault(struct mm_struct *mm, 800static inline int handle_mm_fault(struct mm_struct *mm,
781 struct vm_area_struct *vma, unsigned long address, 801 struct vm_area_struct *vma, unsigned long address,
@@ -789,7 +809,6 @@ static inline int handle_mm_fault(struct mm_struct *mm,
789 809
790extern int make_pages_present(unsigned long addr, unsigned long end); 810extern int make_pages_present(unsigned long addr, unsigned long end);
791extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); 811extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
792void install_arg_page(struct vm_area_struct *, struct page *, unsigned long);
793 812
794int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, 813int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
795 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); 814 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
@@ -806,9 +825,15 @@ int FASTCALL(set_page_dirty(struct page *page));
806int set_page_dirty_lock(struct page *page); 825int set_page_dirty_lock(struct page *page);
807int clear_page_dirty_for_io(struct page *page); 826int clear_page_dirty_for_io(struct page *page);
808 827
828extern unsigned long move_page_tables(struct vm_area_struct *vma,
829 unsigned long old_addr, struct vm_area_struct *new_vma,
830 unsigned long new_addr, unsigned long len);
809extern unsigned long do_mremap(unsigned long addr, 831extern unsigned long do_mremap(unsigned long addr,
810 unsigned long old_len, unsigned long new_len, 832 unsigned long old_len, unsigned long new_len,
811 unsigned long flags, unsigned long new_addr); 833 unsigned long flags, unsigned long new_addr);
834extern int mprotect_fixup(struct vm_area_struct *vma,
835 struct vm_area_struct **pprev, unsigned long start,
836 unsigned long end, unsigned long newflags);
812 837
813/* 838/*
814 * A callback you can register to apply pressure to ageable caches. 839 * A callback you can register to apply pressure to ageable caches.
@@ -837,38 +862,7 @@ struct shrinker {
837extern void register_shrinker(struct shrinker *); 862extern void register_shrinker(struct shrinker *);
838extern void unregister_shrinker(struct shrinker *); 863extern void unregister_shrinker(struct shrinker *);
839 864
840/* 865int vma_wants_writenotify(struct vm_area_struct *vma);
841 * Some shared mappigns will want the pages marked read-only
842 * to track write events. If so, we'll downgrade vm_page_prot
843 * to the private version (using protection_map[] without the
844 * VM_SHARED bit).
845 */
846static inline int vma_wants_writenotify(struct vm_area_struct *vma)
847{
848 unsigned int vm_flags = vma->vm_flags;
849
850 /* If it was private or non-writable, the write bit is already clear */
851 if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED)))
852 return 0;
853
854 /* The backer wishes to know when pages are first written to? */
855 if (vma->vm_ops && vma->vm_ops->page_mkwrite)
856 return 1;
857
858 /* The open routine did something to the protections already? */
859 if (pgprot_val(vma->vm_page_prot) !=
860 pgprot_val(protection_map[vm_flags &
861 (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]))
862 return 0;
863
864 /* Specialty mapping? */
865 if (vm_flags & (VM_PFNMAP|VM_INSERTPAGE))
866 return 0;
867
868 /* Can the mapping track the dirty pages? */
869 return vma->vm_file && vma->vm_file->f_mapping &&
870 mapping_cap_account_dirty(vma->vm_file->f_mapping);
871}
872 866
873extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); 867extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl));
874 868
@@ -1048,7 +1042,7 @@ static inline void vma_nonlinear_insert(struct vm_area_struct *vma,
1048} 1042}
1049 1043
1050/* mmap.c */ 1044/* mmap.c */
1051extern int __vm_enough_memory(long pages, int cap_sys_admin); 1045extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin);
1052extern void vma_adjust(struct vm_area_struct *vma, unsigned long start, 1046extern void vma_adjust(struct vm_area_struct *vma, unsigned long start,
1053 unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert); 1047 unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert);
1054extern struct vm_area_struct *vma_merge(struct mm_struct *, 1048extern struct vm_area_struct *vma_merge(struct mm_struct *,
@@ -1104,9 +1098,7 @@ extern void truncate_inode_pages_range(struct address_space *,
1104 loff_t lstart, loff_t lend); 1098 loff_t lstart, loff_t lend);
1105 1099
1106/* generic vm_area_ops exported for stackable file systems */ 1100/* generic vm_area_ops exported for stackable file systems */
1107extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); 1101extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
1108extern int filemap_populate(struct vm_area_struct *, unsigned long,
1109 unsigned long, pgprot_t, unsigned long, int);
1110 1102
1111/* mm/page-writeback.c */ 1103/* mm/page-writeback.c */
1112int write_one_page(struct page *page, int wait); 1104int write_one_page(struct page *page, int wait);
@@ -1121,13 +1113,20 @@ int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
1121 pgoff_t offset, unsigned long nr_to_read); 1113 pgoff_t offset, unsigned long nr_to_read);
1122int force_page_cache_readahead(struct address_space *mapping, struct file *filp, 1114int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
1123 pgoff_t offset, unsigned long nr_to_read); 1115 pgoff_t offset, unsigned long nr_to_read);
1124unsigned long page_cache_readahead(struct address_space *mapping, 1116
1125 struct file_ra_state *ra, 1117void page_cache_sync_readahead(struct address_space *mapping,
1126 struct file *filp, 1118 struct file_ra_state *ra,
1127 pgoff_t offset, 1119 struct file *filp,
1128 unsigned long size); 1120 pgoff_t offset,
1129void handle_ra_miss(struct address_space *mapping, 1121 unsigned long size);
1130 struct file_ra_state *ra, pgoff_t offset); 1122
1123void page_cache_async_readahead(struct address_space *mapping,
1124 struct file_ra_state *ra,
1125 struct file *filp,
1126 struct page *pg,
1127 pgoff_t offset,
1128 unsigned long size);
1129
1131unsigned long max_sane_readahead(unsigned long nr); 1130unsigned long max_sane_readahead(unsigned long nr);
1132 1131
1133/* Do stack extension */ 1132/* Do stack extension */
@@ -1135,6 +1134,8 @@ extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
1135#ifdef CONFIG_IA64 1134#ifdef CONFIG_IA64
1136extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); 1135extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);
1137#endif 1136#endif
1137extern int expand_stack_downwards(struct vm_area_struct *vma,
1138 unsigned long address);
1138 1139
1139/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ 1140/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
1140extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); 1141extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
@@ -1215,7 +1216,7 @@ void drop_slab(void);
1215extern int randomize_va_space; 1216extern int randomize_va_space;
1216#endif 1217#endif
1217 1218
1218__attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma); 1219const char * arch_vma_name(struct vm_area_struct *vma);
1219 1220
1220#endif /* __KERNEL__ */ 1221#endif /* __KERNEL__ */
1221#endif /* _LINUX_MM_H */ 1222#endif /* _LINUX_MM_H */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 04bbe12fae8d..63a80ea61124 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -99,7 +99,7 @@ struct mmc_request {
99struct mmc_host; 99struct mmc_host;
100struct mmc_card; 100struct mmc_card;
101 101
102extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); 102extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
103extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); 103extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
104extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, 104extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
105 struct mmc_command *, int); 105 struct mmc_command *, int);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index da8eb8ad9e9b..4e5627379b09 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -120,7 +120,6 @@ enum zone_type {
120 * --------------------------- 120 * ---------------------------
121 * parisc, ia64, sparc <4G 121 * parisc, ia64, sparc <4G
122 * s390 <2G 122 * s390 <2G
123 * arm26 <48M
124 * arm Various 123 * arm Various
125 * alpha Unlimited or 0-16MB. 124 * alpha Unlimited or 0-16MB.
126 * 125 *
@@ -411,6 +410,24 @@ struct zonelist {
411#endif 410#endif
412}; 411};
413 412
413#ifdef CONFIG_NUMA
414/*
415 * Only custom zonelists like MPOL_BIND need to be filtered as part of
416 * policies. As described in the comment for struct zonelist_cache, these
417 * zonelists will not have a zlcache so zlcache_ptr will not be set. Use
418 * that to determine if the zonelists needs to be filtered or not.
419 */
420static inline int alloc_should_filter_zonelist(struct zonelist *zonelist)
421{
422 return !zonelist->zlcache_ptr;
423}
424#else
425static inline int alloc_should_filter_zonelist(struct zonelist *zonelist)
426{
427 return 0;
428}
429#endif /* CONFIG_NUMA */
430
414#ifdef CONFIG_ARCH_POPULATES_NODE_MAP 431#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
415struct node_active_region { 432struct node_active_region {
416 unsigned long start_pfn; 433 unsigned long start_pfn;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index af04a555b52c..4dc5fa8be781 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -159,6 +159,13 @@ struct ap_device_id {
159 159
160#define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 160#define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01
161 161
162#define ACPI_ID_LEN 16 /* only 9 bytes needed here, 16 bytes are used */
163 /* to workaround crosscompile issues */
164
165struct acpi_device_id {
166 __u8 id[ACPI_ID_LEN];
167 kernel_ulong_t driver_data;
168};
162 169
163#define PNP_ID_LEN 8 170#define PNP_ID_LEN 8
164#define PNP_MAX_DEVICES 8 171#define PNP_MAX_DEVICES 8
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index b021b3a2b65a..9c8049005052 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -1302,4 +1302,12 @@ struct mv643xx_eth_platform_data {
1302 u8 mac_addr[6]; /* mac address if non-zero*/ 1302 u8 mac_addr[6]; /* mac address if non-zero*/
1303}; 1303};
1304 1304
1305/* Watchdog Platform Device, Driver Data */
1306#define MV64x60_WDT_NAME "mv64x60_wdt"
1307
1308struct mv64x60_wdt_pdata {
1309 int timeout; /* watchdog expiry in seconds, default 10 */
1310 int bus_clk; /* bus clock in MHz, default 133 */
1311};
1312
1305#endif /* __ASM_MV643XX_H */ 1313#endif /* __ASM_MV643XX_H */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index b7dd24917f0d..6c38efbd810f 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -69,8 +69,8 @@ extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struc
69#define user_path_walk_link(name,nd) \ 69#define user_path_walk_link(name,nd) \
70 __user_walk_fd(AT_FDCWD, name, 0, nd) 70 __user_walk_fd(AT_FDCWD, name, 0, nd)
71extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); 71extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
72extern int FASTCALL(path_walk(const char *, struct nameidata *)); 72extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
73extern int FASTCALL(link_path_walk(const char *, struct nameidata *)); 73 const char *, unsigned int, struct nameidata *);
74extern void path_release(struct nameidata *); 74extern void path_release(struct nameidata *);
75extern void path_release_on_umount(struct nameidata *); 75extern void path_release_on_umount(struct nameidata *);
76 76
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index da7a13c97eb8..e679b2751665 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -575,7 +575,7 @@ struct net_device
575 575
576 /* The TX queue control structures */ 576 /* The TX queue control structures */
577 unsigned int egress_subqueue_count; 577 unsigned int egress_subqueue_count;
578 struct net_device_subqueue egress_subqueue[0]; 578 struct net_device_subqueue egress_subqueue[1];
579}; 579};
580#define to_net_dev(d) container_of(d, struct net_device, dev) 580#define to_net_dev(d) container_of(d, struct net_device, dev)
581 581
@@ -1098,10 +1098,8 @@ extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all
1098extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); 1098extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
1099extern int dev_mc_sync(struct net_device *to, struct net_device *from); 1099extern int dev_mc_sync(struct net_device *to, struct net_device *from);
1100extern void dev_mc_unsync(struct net_device *to, struct net_device *from); 1100extern void dev_mc_unsync(struct net_device *to, struct net_device *from);
1101extern void dev_mc_discard(struct net_device *dev);
1102extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); 1101extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all);
1103extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); 1102extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
1104extern void __dev_addr_discard(struct dev_addr_list **list);
1105extern void dev_set_promiscuity(struct net_device *dev, int inc); 1103extern void dev_set_promiscuity(struct net_device *dev, int inc);
1106extern void dev_set_allmulti(struct net_device *dev, int inc); 1104extern void dev_set_allmulti(struct net_device *dev, int inc);
1107extern void netdev_state_change(struct net_device *dev); 1105extern void netdev_state_change(struct net_device *dev);
@@ -1133,6 +1131,8 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
1133 1131
1134extern void linkwatch_run_queue(void); 1132extern void linkwatch_run_queue(void);
1135 1133
1134extern int netdev_compute_features(unsigned long all, unsigned long one);
1135
1136static inline int net_gso_ok(int features, int gso_type) 1136static inline int net_gso_ok(int features, int gso_type)
1137{ 1137{
1138 int feature = gso_type << NETIF_F_GSO_SHIFT; 1138 int feature = gso_type << NETIF_F_GSO_SHIFT;
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 0eed0b7ab2df..1dd075eda595 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -88,9 +88,8 @@ struct nf_sockopt_ops
88 int (*compat_get)(struct sock *sk, int optval, 88 int (*compat_get)(struct sock *sk, int optval,
89 void __user *user, int *len); 89 void __user *user, int *len);
90 90
91 /* Number of users inside set() or get(). */ 91 /* Use the module struct to lock set/get code in place */
92 unsigned int use; 92 struct module *owner;
93 struct task_struct *cleanup_task;
94}; 93};
95 94
96/* Each queued (to userspace) skbuff has one of these. */ 95/* Each queued (to userspace) skbuff has one of these. */
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 43397a414cd6..ab57cb7d7c61 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -28,6 +28,7 @@ header-y += xt_policy.h
28header-y += xt_realm.h 28header-y += xt_realm.h
29header-y += xt_sctp.h 29header-y += xt_sctp.h
30header-y += xt_state.h 30header-y += xt_state.h
31header-y += xt_statistic.h
31header-y += xt_string.h 32header-y += xt_string.h
32header-y += xt_tcpmss.h 33header-y += xt_tcpmss.h
33header-y += xt_tcpudp.h 34header-y += xt_tcpudp.h
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h
index 90ae8b474cb8..37e933c9987d 100644
--- a/include/linux/netfilter/xt_connlimit.h
+++ b/include/linux/netfilter/xt_connlimit.h
@@ -5,8 +5,8 @@ struct xt_connlimit_data;
5 5
6struct xt_connlimit_info { 6struct xt_connlimit_info {
7 union { 7 union {
8 u_int32_t v4_mask; 8 __be32 v4_mask;
9 u_int32_t v6_mask[4]; 9 __be32 v6_mask[4];
10 }; 10 };
11 unsigned int limit, inverse; 11 unsigned int limit, inverse;
12 12
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h
index 34ab0fb736e2..a92fefc3c7ec 100644
--- a/include/linux/netfilter_ipv4/ipt_iprange.h
+++ b/include/linux/netfilter_ipv4/ipt_iprange.h
@@ -1,6 +1,8 @@
1#ifndef _IPT_IPRANGE_H 1#ifndef _IPT_IPRANGE_H
2#define _IPT_IPRANGE_H 2#define _IPT_IPRANGE_H
3 3
4#include <linux/types.h>
5
4#define IPRANGE_SRC 0x01 /* Match source IP address */ 6#define IPRANGE_SRC 0x01 /* Match source IP address */
5#define IPRANGE_DST 0x02 /* Match destination IP address */ 7#define IPRANGE_DST 0x02 /* Match destination IP address */
6#define IPRANGE_SRC_INV 0x10 /* Negate the condition */ 8#define IPRANGE_SRC_INV 0x10 /* Negate the condition */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 2e23353c28a5..83d8239f0cce 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -161,6 +161,8 @@ extern struct sock *netlink_kernel_create(int unit, unsigned int groups,
161 void (*input)(struct sock *sk, int len), 161 void (*input)(struct sock *sk, int len),
162 struct mutex *cb_mutex, 162 struct mutex *cb_mutex,
163 struct module *module); 163 struct module *module);
164extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
165extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
164extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 166extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
165extern int netlink_has_listeners(struct sock *sk, unsigned int group); 167extern int netlink_has_listeners(struct sock *sk, unsigned int group);
166extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); 168extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index c098ae194f79..7250eeadd7b5 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -71,7 +71,7 @@ struct nfs_access_entry {
71 71
72struct nfs4_state; 72struct nfs4_state;
73struct nfs_open_context { 73struct nfs_open_context {
74 struct kref kref; 74 atomic_t count;
75 struct path path; 75 struct path path;
76 struct rpc_cred *cred; 76 struct rpc_cred *cred;
77 struct nfs4_state *state; 77 struct nfs4_state *state;
@@ -407,8 +407,8 @@ extern void nfs_release_automount_timer(void);
407/* 407/*
408 * linux/fs/nfs/unlink.c 408 * linux/fs/nfs/unlink.c
409 */ 409 */
410extern int nfs_async_unlink(struct dentry *); 410extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry);
411extern void nfs_complete_unlink(struct dentry *); 411extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
412 412
413/* 413/*
414 * linux/fs/nfs/write.c 414 * linux/fs/nfs/write.c
@@ -431,6 +431,7 @@ extern int nfs_sync_mapping_range(struct address_space *, loff_t, loff_t, int);
431extern int nfs_wb_all(struct inode *inode); 431extern int nfs_wb_all(struct inode *inode);
432extern int nfs_wb_page(struct inode *inode, struct page* page); 432extern int nfs_wb_page(struct inode *inode, struct page* page);
433extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how); 433extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how);
434extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
434#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 435#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
435extern int nfs_commit_inode(struct inode *, int); 436extern int nfs_commit_inode(struct inode *, int);
436extern struct nfs_write_data *nfs_commit_alloc(void); 437extern struct nfs_write_data *nfs_commit_alloc(void);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 38d77681cf27..cf74a4db84a5 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -278,6 +278,21 @@ struct nfs_writeres {
278}; 278};
279 279
280/* 280/*
281 * Common arguments to the unlink call
282 */
283struct nfs_removeargs {
284 const struct nfs_fh *fh;
285 struct qstr name;
286 const u32 * bitmask;
287};
288
289struct nfs_removeres {
290 const struct nfs_server *server;
291 struct nfs4_change_info cinfo;
292 struct nfs_fattr dir_attr;
293};
294
295/*
281 * Argument struct for decode_entry function 296 * Argument struct for decode_entry function
282 */ 297 */
283struct nfs_entry { 298struct nfs_entry {
@@ -631,18 +646,6 @@ struct nfs4_readlink {
631 struct page ** pages; /* zero-copy data */ 646 struct page ** pages; /* zero-copy data */
632}; 647};
633 648
634struct nfs4_remove_arg {
635 const struct nfs_fh * fh;
636 const struct qstr * name;
637 const u32 * bitmask;
638};
639
640struct nfs4_remove_res {
641 const struct nfs_server * server;
642 struct nfs4_change_info cinfo;
643 struct nfs_fattr * dir_attr;
644};
645
646struct nfs4_rename_arg { 649struct nfs4_rename_arg {
647 const struct nfs_fh * old_dir; 650 const struct nfs_fh * old_dir;
648 const struct nfs_fh * new_dir; 651 const struct nfs_fh * new_dir;
@@ -788,9 +791,8 @@ struct nfs_rpc_ops {
788 int (*create) (struct inode *, struct dentry *, 791 int (*create) (struct inode *, struct dentry *,
789 struct iattr *, int, struct nameidata *); 792 struct iattr *, int, struct nameidata *);
790 int (*remove) (struct inode *, struct qstr *); 793 int (*remove) (struct inode *, struct qstr *);
791 int (*unlink_setup) (struct rpc_message *, 794 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
792 struct dentry *, struct qstr *); 795 int (*unlink_done) (struct rpc_task *, struct inode *);
793 int (*unlink_done) (struct dentry *, struct rpc_task *);
794 int (*rename) (struct inode *, struct qstr *, 796 int (*rename) (struct inode *, struct qstr *,
795 struct inode *, struct qstr *); 797 struct inode *, struct qstr *);
796 int (*link) (struct inode *, struct inode *, struct qstr *); 798 int (*link) (struct inode *, struct inode *, struct qstr *);
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 78feb7beff75..5cd192469096 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -116,18 +116,7 @@ struct svc_expkey {
116#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) 116#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE)
117#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) 117#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
118 118
119static inline int EX_RDONLY(struct svc_export *exp, struct svc_rqst *rqstp) 119int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp);
120{
121 struct exp_flavor_info *f;
122 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors;
123
124 for (f = exp->ex_flavors; f < end; f++) {
125 if (f->pseudoflavor == rqstp->rq_flavor)
126 return f->flags & NFSEXP_READONLY;
127 }
128 return exp->ex_flags & NFSEXP_READONLY;
129}
130
131__be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp); 120__be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp);
132 121
133/* 122/*
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 576f2bb34cc8..fad7ff17e468 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -157,6 +157,19 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
157 */ 157 */
158#define NOTIFY_STOP (NOTIFY_OK|NOTIFY_STOP_MASK) 158#define NOTIFY_STOP (NOTIFY_OK|NOTIFY_STOP_MASK)
159 159
160/* Encapsulate (negative) errno value (in particular, NOTIFY_BAD <=> EPERM). */
161static inline int notifier_from_errno(int err)
162{
163 return NOTIFY_STOP_MASK | (NOTIFY_OK - err);
164}
165
166/* Restore (negative) errno value from notify return value. */
167static inline int notifier_to_errno(int ret)
168{
169 ret &= ~NOTIFY_STOP_MASK;
170 return ret > NOTIFY_OK ? NOTIFY_OK - ret : 0;
171}
172
160/* 173/*
161 * Declared notifiers so far. I can imagine quite a few more chains 174 * Declared notifiers so far. I can imagine quite a few more chains
162 * over time (eg laptop power reset chains, reboot chain (to clean 175 * over time (eg laptop power reset chains, reboot chain (to clean
@@ -212,5 +225,11 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
212#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) 225#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
213#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) 226#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
214 227
228/* Hibernation and suspend events */
229#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
230#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
231#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
232#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
233
215#endif /* __KERNEL__ */ 234#endif /* __KERNEL__ */
216#endif /* _LINUX_NOTIFIER_H */ 235#endif /* _LINUX_NOTIFIER_H */
diff --git a/include/linux/of.h b/include/linux/of.h
new file mode 100644
index 000000000000..47734ffd9745
--- /dev/null
+++ b/include/linux/of.h
@@ -0,0 +1,61 @@
1#ifndef _LINUX_OF_H
2#define _LINUX_OF_H
3/*
4 * Definitions for talking to the Open Firmware PROM on
5 * Power Macintosh and other computers.
6 *
7 * Copyright (C) 1996-2005 Paul Mackerras.
8 *
9 * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
10 * Updates for SPARC64 by David S. Miller
11 * Derived from PowerPC and Sparc prom.h files by Stephen Rothwell, IBM Corp.
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
17 */
18#include <linux/types.h>
19
20#include <asm/bitops.h>
21#include <asm/prom.h>
22
23/* flag descriptions */
24#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
25#define OF_DETACHED 2 /* node has been detached from the device tree */
26
27#define OF_BAD_ADDR ((u64)-1)
28
29extern struct device_node *of_find_node_by_name(struct device_node *from,
30 const char *name);
31#define for_each_node_by_name(dn, name) \
32 for (dn = of_find_node_by_name(NULL, name); dn; \
33 dn = of_find_node_by_name(dn, name))
34extern struct device_node *of_find_node_by_type(struct device_node *from,
35 const char *type);
36#define for_each_node_by_type(dn, type) \
37 for (dn = of_find_node_by_type(NULL, type); dn; \
38 dn = of_find_node_by_type(dn, type))
39extern struct device_node *of_find_compatible_node(struct device_node *from,
40 const char *type, const char *compat);
41#define for_each_compatible_node(dn, type, compatible) \
42 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
43 dn = of_find_compatible_node(dn, type, compatible))
44extern struct device_node *of_find_node_by_path(const char *path);
45extern struct device_node *of_find_node_by_phandle(phandle handle);
46extern struct device_node *of_get_parent(const struct device_node *node);
47extern struct device_node *of_get_next_child(const struct device_node *node,
48 struct device_node *prev);
49extern struct property *of_find_property(const struct device_node *np,
50 const char *name,
51 int *lenp);
52extern int of_device_is_compatible(const struct device_node *device,
53 const char *);
54extern const void *of_get_property(const struct device_node *node,
55 const char *name,
56 int *lenp);
57#define get_property(a, b, c) of_get_property((a), (b), (c))
58extern int of_n_addr_cells(struct device_node *np);
59extern int of_n_size_cells(struct device_node *np);
60
61#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
new file mode 100644
index 000000000000..91bf84b9d144
--- /dev/null
+++ b/include/linux/of_device.h
@@ -0,0 +1,26 @@
1#ifndef _LINUX_OF_DEVICE_H
2#define _LINUX_OF_DEVICE_H
3#ifdef __KERNEL__
4
5#include <linux/device.h>
6#include <linux/of.h>
7#include <linux/mod_devicetable.h>
8
9#include <asm/of_device.h>
10
11#define to_of_device(d) container_of(d, struct of_device, dev)
12
13extern const struct of_device_id *of_match_node(
14 const struct of_device_id *matches, const struct device_node *node);
15extern const struct of_device_id *of_match_device(
16 const struct of_device_id *matches, const struct of_device *dev);
17
18extern struct of_device *of_dev_get(struct of_device *dev);
19extern void of_dev_put(struct of_device *dev);
20
21extern int of_device_register(struct of_device *ofdev);
22extern void of_device_unregister(struct of_device *ofdev);
23extern void of_release_dev(struct device *dev);
24
25#endif /* __KERNEL__ */
26#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
new file mode 100644
index 000000000000..448f70b30a0c
--- /dev/null
+++ b/include/linux/of_platform.h
@@ -0,0 +1,57 @@
1#ifndef _LINUX_OF_PLATFORM_H
2#define _LINUX_OF_PLATFORM_H
3/*
4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 *
12 */
13
14#include <linux/module.h>
15#include <linux/device.h>
16#include <linux/mod_devicetable.h>
17#include <linux/pm.h>
18#include <linux/of_device.h>
19
20/*
21 * The of_platform_bus_type is a bus type used by drivers that do not
22 * attach to a macio or similar bus but still use OF probing
23 * mechanism
24 */
25extern struct bus_type of_platform_bus_type;
26
27/*
28 * An of_platform_driver driver is attached to a basic of_device on
29 * the "platform bus" (of_platform_bus_type) (or ISA, EBUS and SBUS
30 * busses on sparc).
31 */
32struct of_platform_driver
33{
34 const char *name;
35 const struct of_device_id *match_table;
36 struct module *owner;
37
38 int (*probe)(struct of_device* dev,
39 const struct of_device_id *match);
40 int (*remove)(struct of_device* dev);
41
42 int (*suspend)(struct of_device* dev, pm_message_t state);
43 int (*resume)(struct of_device* dev);
44 int (*shutdown)(struct of_device* dev);
45
46 struct device_driver driver;
47};
48#define to_of_platform_driver(drv) \
49 container_of(drv,struct of_platform_driver, driver)
50
51#include <asm/of_platform.h>
52
53extern struct of_device *of_find_device_by_node(struct device_node *np);
54
55extern int of_bus_type_init(struct bus_type *bus, const char *name);
56
57#endif /* _LINUX_OF_PLATFORM_H */
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 0d514b252454..041bb31100f4 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -17,6 +17,26 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20/* Each escaped entry is prefixed by ESCAPE_CODE
21 * then one of the following codes, then the
22 * relevant data.
23 * These #defines live in this file so that arch-specific
24 * buffer sync'ing code can access them.
25 */
26#define ESCAPE_CODE ~0UL
27#define CTX_SWITCH_CODE 1
28#define CPU_SWITCH_CODE 2
29#define COOKIE_SWITCH_CODE 3
30#define KERNEL_ENTER_SWITCH_CODE 4
31#define KERNEL_EXIT_SWITCH_CODE 5
32#define MODULE_LOADED_CODE 6
33#define CTX_TGID_CODE 7
34#define TRACE_BEGIN_CODE 8
35#define TRACE_END_CODE 9
36#define XEN_ENTER_SWITCH_CODE 10
37#define SPU_PROFILING_CODE 11
38#define SPU_CTX_SWITCH_CODE 12
39
20struct super_block; 40struct super_block;
21struct dentry; 41struct dentry;
22struct file_operations; 42struct file_operations;
@@ -35,6 +55,14 @@ struct oprofile_operations {
35 int (*start)(void); 55 int (*start)(void);
36 /* Stop delivering interrupts. */ 56 /* Stop delivering interrupts. */
37 void (*stop)(void); 57 void (*stop)(void);
58 /* Arch-specific buffer sync functions.
59 * Return value = 0: Success
60 * Return value = -1: Failure
61 * Return value = 1: Run generic sync function
62 */
63 int (*sync_start)(void);
64 int (*sync_stop)(void);
65
38 /* Initiate a stack backtrace. Optional. */ 66 /* Initiate a stack backtrace. Optional. */
39 void (*backtrace)(struct pt_regs * const regs, unsigned int depth); 67 void (*backtrace)(struct pt_regs * const regs, unsigned int depth);
40 /* CPU identification string. */ 68 /* CPU identification string. */
@@ -56,6 +84,13 @@ int oprofile_arch_init(struct oprofile_operations * ops);
56void oprofile_arch_exit(void); 84void oprofile_arch_exit(void);
57 85
58/** 86/**
87 * Add data to the event buffer.
88 * The data passed is free-form, but typically consists of
89 * file offsets, dcookies, context information, and ESCAPE codes.
90 */
91void add_event_entry(unsigned long data);
92
93/**
59 * Add a sample. This may be called from any context. Pass 94 * Add a sample. This may be called from any context. Pass
60 * smp_processor_id() as cpu. 95 * smp_processor_id() as cpu.
61 */ 96 */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index ae2d79f2107e..209d3a47f50f 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -90,8 +90,12 @@
90#define PG_reclaim 17 /* To be reclaimed asap */ 90#define PG_reclaim 17 /* To be reclaimed asap */
91#define PG_buddy 19 /* Page is free, on buddy lists */ 91#define PG_buddy 19 /* Page is free, on buddy lists */
92 92
93/* PG_readahead is only used for file reads; PG_reclaim is only for writes */
94#define PG_readahead PG_reclaim /* Reminder to do async read-ahead */
95
93/* PG_owner_priv_1 users should have descriptive aliases */ 96/* PG_owner_priv_1 users should have descriptive aliases */
94#define PG_checked PG_owner_priv_1 /* Used by some filesystems */ 97#define PG_checked PG_owner_priv_1 /* Used by some filesystems */
98#define PG_pinned PG_owner_priv_1 /* Xen pinned pagetable */
95 99
96#if (BITS_PER_LONG > 32) 100#if (BITS_PER_LONG > 32)
97/* 101/*
@@ -170,6 +174,10 @@ static inline void SetPageUptodate(struct page *page)
170#define SetPageChecked(page) set_bit(PG_checked, &(page)->flags) 174#define SetPageChecked(page) set_bit(PG_checked, &(page)->flags)
171#define ClearPageChecked(page) clear_bit(PG_checked, &(page)->flags) 175#define ClearPageChecked(page) clear_bit(PG_checked, &(page)->flags)
172 176
177#define PagePinned(page) test_bit(PG_pinned, &(page)->flags)
178#define SetPagePinned(page) set_bit(PG_pinned, &(page)->flags)
179#define ClearPagePinned(page) clear_bit(PG_pinned, &(page)->flags)
180
173#define PageReserved(page) test_bit(PG_reserved, &(page)->flags) 181#define PageReserved(page) test_bit(PG_reserved, &(page)->flags)
174#define SetPageReserved(page) set_bit(PG_reserved, &(page)->flags) 182#define SetPageReserved(page) set_bit(PG_reserved, &(page)->flags)
175#define ClearPageReserved(page) clear_bit(PG_reserved, &(page)->flags) 183#define ClearPageReserved(page) clear_bit(PG_reserved, &(page)->flags)
@@ -181,37 +189,15 @@ static inline void SetPageUptodate(struct page *page)
181#define __SetPagePrivate(page) __set_bit(PG_private, &(page)->flags) 189#define __SetPagePrivate(page) __set_bit(PG_private, &(page)->flags)
182#define __ClearPagePrivate(page) __clear_bit(PG_private, &(page)->flags) 190#define __ClearPagePrivate(page) __clear_bit(PG_private, &(page)->flags)
183 191
192/*
193 * Only test-and-set exist for PG_writeback. The unconditional operators are
194 * risky: they bypass page accounting.
195 */
184#define PageWriteback(page) test_bit(PG_writeback, &(page)->flags) 196#define PageWriteback(page) test_bit(PG_writeback, &(page)->flags)
185#define SetPageWriteback(page) \ 197#define TestSetPageWriteback(page) test_and_set_bit(PG_writeback, \
186 do { \ 198 &(page)->flags)
187 if (!test_and_set_bit(PG_writeback, \ 199#define TestClearPageWriteback(page) test_and_clear_bit(PG_writeback, \
188 &(page)->flags)) \ 200 &(page)->flags)
189 inc_zone_page_state(page, NR_WRITEBACK); \
190 } while (0)
191#define TestSetPageWriteback(page) \
192 ({ \
193 int ret; \
194 ret = test_and_set_bit(PG_writeback, \
195 &(page)->flags); \
196 if (!ret) \
197 inc_zone_page_state(page, NR_WRITEBACK); \
198 ret; \
199 })
200#define ClearPageWriteback(page) \
201 do { \
202 if (test_and_clear_bit(PG_writeback, \
203 &(page)->flags)) \
204 dec_zone_page_state(page, NR_WRITEBACK); \
205 } while (0)
206#define TestClearPageWriteback(page) \
207 ({ \
208 int ret; \
209 ret = test_and_clear_bit(PG_writeback, \
210 &(page)->flags); \
211 if (ret) \
212 dec_zone_page_state(page, NR_WRITEBACK); \
213 ret; \
214 })
215 201
216#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) 202#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags)
217#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) 203#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags)
@@ -221,6 +207,10 @@ static inline void SetPageUptodate(struct page *page)
221#define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags) 207#define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags)
222#define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags) 208#define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags)
223 209
210#define PageReadahead(page) test_bit(PG_readahead, &(page)->flags)
211#define SetPageReadahead(page) set_bit(PG_readahead, &(page)->flags)
212#define ClearPageReadahead(page) clear_bit(PG_readahead, &(page)->flags)
213
224#define PageReclaim(page) test_bit(PG_reclaim, &(page)->flags) 214#define PageReclaim(page) test_bit(PG_reclaim, &(page)->flags)
225#define SetPageReclaim(page) set_bit(PG_reclaim, &(page)->flags) 215#define SetPageReclaim(page) set_bit(PG_reclaim, &(page)->flags)
226#define ClearPageReclaim(page) clear_bit(PG_reclaim, &(page)->flags) 216#define ClearPageReclaim(page) clear_bit(PG_reclaim, &(page)->flags)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5e84f2e8d54c..038a0dc7273a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -534,6 +534,7 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val
534 534
535int __must_check pci_enable_device(struct pci_dev *dev); 535int __must_check pci_enable_device(struct pci_dev *dev);
536int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); 536int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask);
537int __must_check pci_reenable_device(struct pci_dev *);
537int __must_check pcim_enable_device(struct pci_dev *pdev); 538int __must_check pcim_enable_device(struct pci_dev *pdev);
538void pcim_pin_device(struct pci_dev *pdev); 539void pcim_pin_device(struct pci_dev *pdev);
539 540
@@ -556,6 +557,7 @@ int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
556int pcix_get_max_mmrbc(struct pci_dev *dev); 557int pcix_get_max_mmrbc(struct pci_dev *dev);
557int pcix_get_mmrbc(struct pci_dev *dev); 558int pcix_get_mmrbc(struct pci_dev *dev);
558int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 559int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
560int pcie_get_readrq(struct pci_dev *dev);
559int pcie_set_readrq(struct pci_dev *dev, int rq); 561int pcie_set_readrq(struct pci_dev *dev, int rq);
560void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); 562void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
561int __must_check pci_assign_resource(struct pci_dev *dev, int i); 563int __must_check pci_assign_resource(struct pci_dev *dev, int i);
@@ -577,6 +579,9 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
577pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 579pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
578int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); 580int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable);
579 581
582/* Functions for PCI Hotplug drivers to use */
583int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
584
580/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ 585/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
581void pci_bus_assign_resources(struct pci_bus *bus); 586void pci_bus_assign_resources(struct pci_bus *bus);
582void pci_bus_size_bridges(struct pci_bus *bus); 587void pci_bus_size_bridges(struct pci_bus *bus);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 2c7add169539..55f307ffbf96 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -360,6 +360,9 @@
360#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32 360#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32
361#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33 361#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33
362#define PCI_DEVICE_ID_ATI_RS480 0x5950 362#define PCI_DEVICE_ID_ATI_RS480 0x5950
363#define PCI_DEVICE_ID_ATI_RD580 0x5952
364#define PCI_DEVICE_ID_ATI_RX790 0x5957
365#define PCI_DEVICE_ID_ATI_RS690 0x7910
363/* ATI IXP Chipset */ 366/* ATI IXP Chipset */
364#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 367#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
365#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353 368#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
@@ -371,10 +374,9 @@
371#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 374#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
372#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a 375#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
373#define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380 376#define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380
374#define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 377#define PCI_DEVICE_ID_ATI_SBX00_SMBUS 0x4385
375#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c 378#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c
376#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 379#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390
377#define PCI_DEVICE_ID_ATI_IXP700_SMBUS 0x4395
378#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c 380#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c
379 381
380#define PCI_VENDOR_ID_VLSI 0x1004 382#define PCI_VENDOR_ID_VLSI 0x1004
@@ -495,6 +497,8 @@
495 497
496#define PCI_VENDOR_ID_AMD 0x1022 498#define PCI_VENDOR_ID_AMD 0x1022
497#define PCI_DEVICE_ID_AMD_K8_NB 0x1100 499#define PCI_DEVICE_ID_AMD_K8_NB 0x1100
500#define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101
501#define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102
498#define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 502#define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103
499#define PCI_DEVICE_ID_AMD_LANCE 0x2000 503#define PCI_DEVICE_ID_AMD_LANCE 0x2000
500#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 504#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
@@ -609,7 +613,6 @@
609#define PCI_DEVICE_ID_NEC_CBUS_3 0x003b 613#define PCI_DEVICE_ID_NEC_CBUS_3 0x003b
610#define PCI_DEVICE_ID_NEC_NAPCCARD 0x003e 614#define PCI_DEVICE_ID_NEC_NAPCCARD 0x003e
611#define PCI_DEVICE_ID_NEC_PCX2 0x0046 /* PowerVR */ 615#define PCI_DEVICE_ID_NEC_PCX2 0x0046 /* PowerVR */
612#define PCI_DEVICE_ID_NEC_NILE4 0x005a
613#define PCI_DEVICE_ID_NEC_VRC5476 0x009b 616#define PCI_DEVICE_ID_NEC_VRC5476 0x009b
614#define PCI_DEVICE_ID_NEC_VRC4173 0x00a5 617#define PCI_DEVICE_ID_NEC_VRC4173 0x00a5
615#define PCI_DEVICE_ID_NEC_VRC5477_AC97 0x00a6 618#define PCI_DEVICE_ID_NEC_VRC5477_AC97 0x00a6
@@ -1223,6 +1226,10 @@
1223#define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D 1226#define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D
1224#define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E 1227#define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E
1225#define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F 1228#define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F
1229#define PCI_DEVICE_ID_NVIDIA_NVENET_28 0x07DC
1230#define PCI_DEVICE_ID_NVIDIA_NVENET_29 0x07DD
1231#define PCI_DEVICE_ID_NVIDIA_NVENET_30 0x07DE
1232#define PCI_DEVICE_ID_NVIDIA_NVENET_31 0x07DF
1226#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 1233#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560
1227#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C 1234#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C
1228#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759 1235#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759
@@ -1282,6 +1289,7 @@
1282#define PCI_DEVICE_ID_VIA_VT3324 0x0324 1289#define PCI_DEVICE_ID_VIA_VT3324 0x0324
1283#define PCI_DEVICE_ID_VIA_VT3336 0x0336 1290#define PCI_DEVICE_ID_VIA_VT3336 0x0336
1284#define PCI_DEVICE_ID_VIA_VT3351 0x0351 1291#define PCI_DEVICE_ID_VIA_VT3351 0x0351
1292#define PCI_DEVICE_ID_VIA_VT3364 0x0364
1285#define PCI_DEVICE_ID_VIA_8371_0 0x0391 1293#define PCI_DEVICE_ID_VIA_8371_0 0x0391
1286#define PCI_DEVICE_ID_VIA_8501_0 0x0501 1294#define PCI_DEVICE_ID_VIA_8501_0 0x0501
1287#define PCI_DEVICE_ID_VIA_82C561 0x0561 1295#define PCI_DEVICE_ID_VIA_82C561 0x0561
@@ -1335,6 +1343,7 @@
1335#define PCI_DEVICE_ID_VIA_8231_4 0x8235 1343#define PCI_DEVICE_ID_VIA_8231_4 0x8235
1336#define PCI_DEVICE_ID_VIA_8365_1 0x8305 1344#define PCI_DEVICE_ID_VIA_8365_1 0x8305
1337#define PCI_DEVICE_ID_VIA_CX700 0x8324 1345#define PCI_DEVICE_ID_VIA_CX700 0x8324
1346#define PCI_DEVICE_ID_VIA_VX800 0x8353
1338#define PCI_DEVICE_ID_VIA_8371_1 0x8391 1347#define PCI_DEVICE_ID_VIA_8371_1 0x8391
1339#define PCI_DEVICE_ID_VIA_82C598_1 0x8598 1348#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
1340#define PCI_DEVICE_ID_VIA_838X_1 0xB188 1349#define PCI_DEVICE_ID_VIA_838X_1 0xB188
@@ -1970,6 +1979,8 @@
1970#define PCI_VENDOR_ID_ENE 0x1524 1979#define PCI_VENDOR_ID_ENE 0x1524
1971#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 1980#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550
1972#define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 1981#define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551
1982#define PCI_DEVICE_ID_ENE_CB714_SD 0x0750
1983#define PCI_DEVICE_ID_ENE_CB714_SD_2 0x0751
1973#define PCI_DEVICE_ID_ENE_1211 0x1211 1984#define PCI_DEVICE_ID_ENE_1211 0x1211
1974#define PCI_DEVICE_ID_ENE_1225 0x1225 1985#define PCI_DEVICE_ID_ENE_1225 0x1225
1975#define PCI_DEVICE_ID_ENE_1410 0x1410 1986#define PCI_DEVICE_ID_ENE_1410 0x1410
@@ -2017,6 +2028,8 @@
2017 2028
2018#define PCI_VENDOR_ID_ARIMA 0x161f 2029#define PCI_VENDOR_ID_ARIMA 0x161f
2019 2030
2031#define PCI_VENDOR_ID_BROCADE 0x1657
2032
2020#define PCI_VENDOR_ID_SIBYTE 0x166d 2033#define PCI_VENDOR_ID_SIBYTE 0x166d
2021#define PCI_DEVICE_ID_BCM1250_PCI 0x0001 2034#define PCI_DEVICE_ID_BCM1250_PCI 0x0001
2022#define PCI_DEVICE_ID_BCM1250_HT 0x0002 2035#define PCI_DEVICE_ID_BCM1250_HT 0x0002
@@ -2038,6 +2051,8 @@
2038#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea 2051#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea
2039#define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb 2052#define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb
2040 2053
2054#define PCI_VENDOR_ID_LENOVO 0x17aa
2055
2041#define PCI_VENDOR_ID_ARECA 0x17d3 2056#define PCI_VENDOR_ID_ARECA 0x17d3
2042#define PCI_DEVICE_ID_ARECA_1110 0x1110 2057#define PCI_DEVICE_ID_ARECA_1110 0x1110
2043#define PCI_DEVICE_ID_ARECA_1120 0x1120 2058#define PCI_DEVICE_ID_ARECA_1120 0x1120
@@ -2069,6 +2084,25 @@
2069#define PCI_VENDOR_ID_TDI 0x192E 2084#define PCI_VENDOR_ID_TDI 0x192E
2070#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2085#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2071 2086
2087#define PCI_VENDOR_ID_FREESCALE 0x1957
2088#define PCI_DEVICE_ID_MPC8548E 0x0012
2089#define PCI_DEVICE_ID_MPC8548 0x0013
2090#define PCI_DEVICE_ID_MPC8543E 0x0014
2091#define PCI_DEVICE_ID_MPC8543 0x0015
2092#define PCI_DEVICE_ID_MPC8547E 0x0018
2093#define PCI_DEVICE_ID_MPC8545E 0x0019
2094#define PCI_DEVICE_ID_MPC8545 0x001a
2095#define PCI_DEVICE_ID_MPC8568E 0x0020
2096#define PCI_DEVICE_ID_MPC8568 0x0021
2097#define PCI_DEVICE_ID_MPC8567E 0x0022
2098#define PCI_DEVICE_ID_MPC8567 0x0023
2099#define PCI_DEVICE_ID_MPC8533E 0x0030
2100#define PCI_DEVICE_ID_MPC8533 0x0031
2101#define PCI_DEVICE_ID_MPC8544E 0x0032
2102#define PCI_DEVICE_ID_MPC8544 0x0033
2103#define PCI_DEVICE_ID_MPC8641 0x7010
2104#define PCI_DEVICE_ID_MPC8641D 0x7011
2105
2072#define PCI_VENDOR_ID_PASEMI 0x1959 2106#define PCI_VENDOR_ID_PASEMI 0x1959
2073 2107
2074#define PCI_VENDOR_ID_ATTANSIC 0x1969 2108#define PCI_VENDOR_ID_ATTANSIC 0x1969
@@ -2209,6 +2243,7 @@
2209#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 2243#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
2210#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 2244#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
2211#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 2245#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772
2246#define PCI_DEVICE_ID_INTEL_3000_HB 0x2778
2212#define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0 2247#define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0
2213#define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2 2248#define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2
2214#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 2249#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
@@ -2258,6 +2293,8 @@
2258#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 2293#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
2259#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a 2294#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
2260#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e 2295#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
2296#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031
2297#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032
2261#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 2298#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
2262#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 2299#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
2263#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 2300#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 273781c82e4d..48b71badfb4c 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -25,6 +25,7 @@
25 25
26#include <linux/list.h> 26#include <linux/list.h>
27#include <asm/atomic.h> 27#include <asm/atomic.h>
28#include <asm/errno.h>
28 29
29/* 30/*
30 * Power management requests... these are passed to pm_send_all() and friends. 31 * Power management requests... these are passed to pm_send_all() and friends.
@@ -101,6 +102,7 @@ struct pm_dev
101 */ 102 */
102extern void (*pm_idle)(void); 103extern void (*pm_idle)(void);
103extern void (*pm_power_off)(void); 104extern void (*pm_power_off)(void);
105extern void (*pm_power_off_prepare)(void);
104 106
105typedef int __bitwise suspend_state_t; 107typedef int __bitwise suspend_state_t;
106 108
@@ -164,6 +166,7 @@ struct pm_ops {
164 int (*finish)(suspend_state_t state); 166 int (*finish)(suspend_state_t state);
165}; 167};
166 168
169#ifdef CONFIG_SUSPEND
167extern struct pm_ops *pm_ops; 170extern struct pm_ops *pm_ops;
168 171
169/** 172/**
@@ -192,6 +195,12 @@ extern void arch_suspend_disable_irqs(void);
192extern void arch_suspend_enable_irqs(void); 195extern void arch_suspend_enable_irqs(void);
193 196
194extern int pm_suspend(suspend_state_t state); 197extern int pm_suspend(suspend_state_t state);
198#else /* !CONFIG_SUSPEND */
199#define suspend_valid_only_mem NULL
200
201static inline void pm_set_ops(struct pm_ops *pm_ops) {}
202static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
203#endif /* !CONFIG_SUSPEND */
195 204
196/* 205/*
197 * Device power management 206 * Device power management
@@ -265,7 +274,7 @@ typedef struct pm_message {
265struct dev_pm_info { 274struct dev_pm_info {
266 pm_message_t power_state; 275 pm_message_t power_state;
267 unsigned can_wakeup:1; 276 unsigned can_wakeup:1;
268#ifdef CONFIG_PM 277#ifdef CONFIG_PM_SLEEP
269 unsigned should_wakeup:1; 278 unsigned should_wakeup:1;
270 struct list_head entry; 279 struct list_head entry;
271#endif 280#endif
@@ -275,7 +284,7 @@ extern int device_power_down(pm_message_t state);
275extern void device_power_up(void); 284extern void device_power_up(void);
276extern void device_resume(void); 285extern void device_resume(void);
277 286
278#ifdef CONFIG_PM 287#ifdef CONFIG_PM_SLEEP
279extern int device_suspend(pm_message_t state); 288extern int device_suspend(pm_message_t state);
280extern int device_prepare_suspend(pm_message_t state); 289extern int device_prepare_suspend(pm_message_t state);
281 290
@@ -284,8 +293,6 @@ extern int device_prepare_suspend(pm_message_t state);
284#define device_may_wakeup(dev) \ 293#define device_may_wakeup(dev) \
285 (device_can_wakeup(dev) && (dev)->power.should_wakeup) 294 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
286 295
287extern int dpm_runtime_suspend(struct device *, pm_message_t);
288extern void dpm_runtime_resume(struct device *);
289extern void __suspend_report_result(const char *function, void *fn, int ret); 296extern void __suspend_report_result(const char *function, void *fn, int ret);
290 297
291#define suspend_report_result(fn, ret) \ 298#define suspend_report_result(fn, ret) \
@@ -307,7 +314,7 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
307 return 0; 314 return 0;
308} 315}
309 316
310#else /* !CONFIG_PM */ 317#else /* !CONFIG_PM_SLEEP */
311 318
312static inline int device_suspend(pm_message_t state) 319static inline int device_suspend(pm_message_t state)
313{ 320{
@@ -317,15 +324,6 @@ static inline int device_suspend(pm_message_t state)
317#define device_set_wakeup_enable(dev,val) do{}while(0) 324#define device_set_wakeup_enable(dev,val) do{}while(0)
318#define device_may_wakeup(dev) (0) 325#define device_may_wakeup(dev) (0)
319 326
320static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
321{
322 return 0;
323}
324
325static inline void dpm_runtime_resume(struct device * dev)
326{
327}
328
329#define suspend_report_result(fn, ret) do { } while (0) 327#define suspend_report_result(fn, ret) do { } while (0)
330 328
331static inline int call_platform_enable_wakeup(struct device *dev, int is_on) 329static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
@@ -333,7 +331,7 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
333 return 0; 331 return 0;
334} 332}
335 333
336#endif 334#endif /* !CONFIG_PM_SLEEP */
337 335
338/* changes to device_may_wakeup take effect on the next pm state change. 336/* changes to device_may_wakeup take effect on the next pm state change.
339 * by default, devices should wakeup if they can. 337 * by default, devices should wakeup if they can.
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index 5ad913ff02b2..b7824c215354 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -226,7 +226,7 @@ extern unsigned int pmu_power_flags;
226extern void pmu_backlight_init(void); 226extern void pmu_backlight_init(void);
227 227
228/* some code needs to know if the PMU was suspended for hibernation */ 228/* some code needs to know if the PMU was suspended for hibernation */
229#if defined(CONFIG_PM) && defined(CONFIG_PPC32) 229#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
230extern int pmu_sys_suspended; 230extern int pmu_sys_suspended;
231#else 231#else
232/* if power management is not configured it can't be suspended */ 232/* if power management is not configured it can't be suspended */
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 2a1897e6f937..16b46aace349 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -1,7 +1,6 @@
1/* 1/*
2 * Linux Plug and Play Support 2 * Linux Plug and Play Support
3 * Copyright by Adam Belay <ambx1@neo.rr.com> 3 * Copyright by Adam Belay <ambx1@neo.rr.com>
4 *
5 */ 4 */
6 5
7#ifndef _LINUX_PNP_H 6#ifndef _LINUX_PNP_H
@@ -23,7 +22,6 @@
23struct pnp_protocol; 22struct pnp_protocol;
24struct pnp_dev; 23struct pnp_dev;
25 24
26
27/* 25/*
28 * Resource Management 26 * Resource Management
29 */ 27 */
@@ -73,37 +71,37 @@ struct pnp_dev;
73#define PNP_PORT_FLAG_FIXED (1<<1) 71#define PNP_PORT_FLAG_FIXED (1<<1)
74 72
75struct pnp_port { 73struct pnp_port {
76 unsigned short min; /* min base number */ 74 unsigned short min; /* min base number */
77 unsigned short max; /* max base number */ 75 unsigned short max; /* max base number */
78 unsigned char align; /* align boundary */ 76 unsigned char align; /* align boundary */
79 unsigned char size; /* size of range */ 77 unsigned char size; /* size of range */
80 unsigned char flags; /* port flags */ 78 unsigned char flags; /* port flags */
81 unsigned char pad; /* pad */ 79 unsigned char pad; /* pad */
82 struct pnp_port *next; /* next port */ 80 struct pnp_port *next; /* next port */
83}; 81};
84 82
85#define PNP_IRQ_NR 256 83#define PNP_IRQ_NR 256
86struct pnp_irq { 84struct pnp_irq {
87 DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmaks for IRQ lines */ 85 DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmask for IRQ lines */
88 unsigned char flags; /* IRQ flags */ 86 unsigned char flags; /* IRQ flags */
89 unsigned char pad; /* pad */ 87 unsigned char pad; /* pad */
90 struct pnp_irq *next; /* next IRQ */ 88 struct pnp_irq *next; /* next IRQ */
91}; 89};
92 90
93struct pnp_dma { 91struct pnp_dma {
94 unsigned char map; /* bitmask for DMA channels */ 92 unsigned char map; /* bitmask for DMA channels */
95 unsigned char flags; /* DMA flags */ 93 unsigned char flags; /* DMA flags */
96 struct pnp_dma *next; /* next port */ 94 struct pnp_dma *next; /* next port */
97}; 95};
98 96
99struct pnp_mem { 97struct pnp_mem {
100 unsigned int min; /* min base number */ 98 unsigned int min; /* min base number */
101 unsigned int max; /* max base number */ 99 unsigned int max; /* max base number */
102 unsigned int align; /* align boundary */ 100 unsigned int align; /* align boundary */
103 unsigned int size; /* size of range */ 101 unsigned int size; /* size of range */
104 unsigned char flags; /* memory flags */ 102 unsigned char flags; /* memory flags */
105 unsigned char pad; /* pad */ 103 unsigned char pad; /* pad */
106 struct pnp_mem *next; /* next memory resource */ 104 struct pnp_mem *next; /* next memory resource */
107}; 105};
108 106
109#define PNP_RES_PRIORITY_PREFERRED 0 107#define PNP_RES_PRIORITY_PREFERRED 0
@@ -127,7 +125,6 @@ struct pnp_resource_table {
127 struct resource irq_resource[PNP_MAX_IRQ]; 125 struct resource irq_resource[PNP_MAX_IRQ];
128}; 126};
129 127
130
131/* 128/*
132 * Device Managemnt 129 * Device Managemnt
133 */ 130 */
@@ -139,14 +136,14 @@ struct pnp_card {
139 struct list_head protocol_list; /* node in protocol's list of cards */ 136 struct list_head protocol_list; /* node in protocol's list of cards */
140 struct list_head devices; /* devices attached to the card */ 137 struct list_head devices; /* devices attached to the card */
141 138
142 struct pnp_protocol * protocol; 139 struct pnp_protocol *protocol;
143 struct pnp_id * id; /* contains supported EISA IDs*/ 140 struct pnp_id *id; /* contains supported EISA IDs */
144 141
145 char name[PNP_NAME_LEN]; /* contains a human-readable name */ 142 char name[PNP_NAME_LEN]; /* contains a human-readable name */
146 unsigned char pnpver; /* Plug & Play version */ 143 unsigned char pnpver; /* Plug & Play version */
147 unsigned char productver; /* product version */ 144 unsigned char productver; /* product version */
148 unsigned int serial; /* serial number */ 145 unsigned int serial; /* serial number */
149 unsigned char checksum; /* if zero - checksum passed */ 146 unsigned char checksum; /* if zero - checksum passed */
150 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */ 147 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */
151}; 148};
152 149
@@ -159,18 +156,18 @@ struct pnp_card {
159 (card) = global_to_pnp_card((card)->global_list.next)) 156 (card) = global_to_pnp_card((card)->global_list.next))
160 157
161struct pnp_card_link { 158struct pnp_card_link {
162 struct pnp_card * card; 159 struct pnp_card *card;
163 struct pnp_card_driver * driver; 160 struct pnp_card_driver *driver;
164 void * driver_data; 161 void *driver_data;
165 pm_message_t pm_state; 162 pm_message_t pm_state;
166}; 163};
167 164
168static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard) 165static inline void *pnp_get_card_drvdata(struct pnp_card_link *pcard)
169{ 166{
170 return pcard->driver_data; 167 return pcard->driver_data;
171} 168}
172 169
173static inline void pnp_set_card_drvdata (struct pnp_card_link *pcard, void *data) 170static inline void pnp_set_card_drvdata(struct pnp_card_link *pcard, void *data)
174{ 171{
175 pcard->driver_data = data; 172 pcard->driver_data = data;
176} 173}
@@ -186,22 +183,22 @@ struct pnp_dev {
186 struct list_head card_list; /* node in card's list of devices */ 183 struct list_head card_list; /* node in card's list of devices */
187 struct list_head rdev_list; /* node in cards list of requested devices */ 184 struct list_head rdev_list; /* node in cards list of requested devices */
188 185
189 struct pnp_protocol * protocol; 186 struct pnp_protocol *protocol;
190 struct pnp_card * card; /* card the device is attached to, none if NULL */ 187 struct pnp_card *card; /* card the device is attached to, none if NULL */
191 struct pnp_driver * driver; 188 struct pnp_driver *driver;
192 struct pnp_card_link * card_link; 189 struct pnp_card_link *card_link;
193 190
194 struct pnp_id * id; /* supported EISA IDs*/ 191 struct pnp_id *id; /* supported EISA IDs */
195 192
196 int active; 193 int active;
197 int capabilities; 194 int capabilities;
198 struct pnp_option * independent; 195 struct pnp_option *independent;
199 struct pnp_option * dependent; 196 struct pnp_option *dependent;
200 struct pnp_resource_table res; 197 struct pnp_resource_table res;
201 198
202 char name[PNP_NAME_LEN]; /* contains a human-readable name */ 199 char name[PNP_NAME_LEN]; /* contains a human-readable name */
203 unsigned short regs; /* ISAPnP: supported registers */ 200 unsigned short regs; /* ISAPnP: supported registers */
204 int flags; /* used by protocols */ 201 int flags; /* used by protocols */
205 struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ 202 struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */
206 void *data; 203 void *data;
207}; 204};
@@ -220,19 +217,19 @@ struct pnp_dev {
220 (dev) = card_to_pnp_dev((dev)->card_list.next)) 217 (dev) = card_to_pnp_dev((dev)->card_list.next))
221#define pnp_dev_name(dev) (dev)->name 218#define pnp_dev_name(dev) (dev)->name
222 219
223static inline void *pnp_get_drvdata (struct pnp_dev *pdev) 220static inline void *pnp_get_drvdata(struct pnp_dev *pdev)
224{ 221{
225 return dev_get_drvdata(&pdev->dev); 222 return dev_get_drvdata(&pdev->dev);
226} 223}
227 224
228static inline void pnp_set_drvdata (struct pnp_dev *pdev, void *data) 225static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data)
229{ 226{
230 dev_set_drvdata(&pdev->dev, data); 227 dev_set_drvdata(&pdev->dev, data);
231} 228}
232 229
233struct pnp_fixup { 230struct pnp_fixup {
234 char id[7]; 231 char id[7];
235 void (*quirk_function)(struct pnp_dev *dev); /* fixup function */ 232 void (*quirk_function) (struct pnp_dev * dev); /* fixup function */
236}; 233};
237 234
238/* config parameters */ 235/* config parameters */
@@ -269,7 +266,6 @@ extern struct pnp_protocol pnpbios_protocol;
269#define pnp_device_is_pnpbios(dev) 0 266#define pnp_device_is_pnpbios(dev) 0
270#endif 267#endif
271 268
272
273/* status */ 269/* status */
274#define PNP_READY 0x0000 270#define PNP_READY 0x0000
275#define PNP_ATTACHED 0x0001 271#define PNP_ATTACHED 0x0001
@@ -287,17 +283,17 @@ extern struct pnp_protocol pnpbios_protocol;
287 283
288struct pnp_id { 284struct pnp_id {
289 char id[PNP_ID_LEN]; 285 char id[PNP_ID_LEN];
290 struct pnp_id * next; 286 struct pnp_id *next;
291}; 287};
292 288
293struct pnp_driver { 289struct pnp_driver {
294 char * name; 290 char *name;
295 const struct pnp_device_id *id_table; 291 const struct pnp_device_id *id_table;
296 unsigned int flags; 292 unsigned int flags;
297 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); 293 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id);
298 void (*remove) (struct pnp_dev *dev); 294 void (*remove) (struct pnp_dev *dev);
299 int (*suspend) (struct pnp_dev *dev, pm_message_t state); 295 int (*suspend) (struct pnp_dev *dev, pm_message_t state);
300 int (*resume) (struct pnp_dev *dev); 296 int (*resume) (struct pnp_dev *dev);
301 struct device_driver driver; 297 struct device_driver driver;
302}; 298};
303 299
@@ -305,13 +301,14 @@ struct pnp_driver {
305 301
306struct pnp_card_driver { 302struct pnp_card_driver {
307 struct list_head global_list; 303 struct list_head global_list;
308 char * name; 304 char *name;
309 const struct pnp_card_device_id *id_table; 305 const struct pnp_card_device_id *id_table;
310 unsigned int flags; 306 unsigned int flags;
311 int (*probe) (struct pnp_card_link *card, const struct pnp_card_device_id *card_id); 307 int (*probe) (struct pnp_card_link *card,
308 const struct pnp_card_device_id *card_id);
312 void (*remove) (struct pnp_card_link *card); 309 void (*remove) (struct pnp_card_link *card);
313 int (*suspend) (struct pnp_card_link *card, pm_message_t state); 310 int (*suspend) (struct pnp_card_link *card, pm_message_t state);
314 int (*resume) (struct pnp_card_link *card); 311 int (*resume) (struct pnp_card_link *card);
315 struct pnp_driver link; 312 struct pnp_driver link;
316}; 313};
317 314
@@ -321,25 +318,28 @@ struct pnp_card_driver {
321#define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */ 318#define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */
322#define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */ 319#define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */
323 320
324
325/* 321/*
326 * Protocol Management 322 * Protocol Management
327 */ 323 */
328 324
329struct pnp_protocol { 325struct pnp_protocol {
330 struct list_head protocol_list; 326 struct list_head protocol_list;
331 char * name; 327 char *name;
332 328
333 /* resource control functions */ 329 /* resource control functions */
334 int (*get)(struct pnp_dev *dev, struct pnp_resource_table *res); 330 int (*get) (struct pnp_dev *dev, struct pnp_resource_table *res);
335 int (*set)(struct pnp_dev *dev, struct pnp_resource_table *res); 331 int (*set) (struct pnp_dev *dev, struct pnp_resource_table *res);
336 int (*disable)(struct pnp_dev *dev); 332 int (*disable) (struct pnp_dev *dev);
333
334 /* protocol specific suspend/resume */
335 int (*suspend) (struct pnp_dev * dev, pm_message_t state);
336 int (*resume) (struct pnp_dev * dev);
337 337
338 /* used by pnp layer only (look but don't touch) */ 338 /* used by pnp layer only (look but don't touch) */
339 unsigned char number; /* protocol number*/ 339 unsigned char number; /* protocol number */
340 struct device dev; /* link to driver model */ 340 struct device dev; /* link to driver model */
341 struct list_head cards; 341 struct list_head cards;
342 struct list_head devices; 342 struct list_head devices;
343}; 343};
344 344
345#define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list) 345#define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list)
@@ -352,7 +352,6 @@ struct pnp_protocol {
352 (dev) != protocol_to_pnp_dev(&(protocol)->devices); \ 352 (dev) != protocol_to_pnp_dev(&(protocol)->devices); \
353 (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) 353 (dev) = protocol_to_pnp_dev((dev)->protocol_list.next))
354 354
355
356extern struct bus_type pnp_bus_type; 355extern struct bus_type pnp_bus_type;
357 356
358#if defined(CONFIG_PNP) 357#if defined(CONFIG_PNP)
@@ -372,21 +371,25 @@ void pnp_remove_card(struct pnp_card *card);
372int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); 371int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
373void pnp_remove_card_device(struct pnp_dev *dev); 372void pnp_remove_card_device(struct pnp_dev *dev);
374int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card); 373int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card);
375struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from); 374struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
376void pnp_release_card_device(struct pnp_dev * dev); 375 const char *id, struct pnp_dev *from);
377int pnp_register_card_driver(struct pnp_card_driver * drv); 376void pnp_release_card_device(struct pnp_dev *dev);
378void pnp_unregister_card_driver(struct pnp_card_driver * drv); 377int pnp_register_card_driver(struct pnp_card_driver *drv);
378void pnp_unregister_card_driver(struct pnp_card_driver *drv);
379extern struct list_head pnp_cards; 379extern struct list_head pnp_cards;
380 380
381/* resource management */ 381/* resource management */
382struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev); 382struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev);
383struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority); 383struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
384 int priority);
384int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data); 385int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data);
385int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data); 386int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data);
386int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data); 387int pnp_register_port_resource(struct pnp_option *option,
388 struct pnp_port *data);
387int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data); 389int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data);
388void pnp_init_resource_table(struct pnp_resource_table *table); 390void pnp_init_resource_table(struct pnp_resource_table *table);
389int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode); 391int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
392 int mode);
390int pnp_auto_config_dev(struct pnp_dev *dev); 393int pnp_auto_config_dev(struct pnp_dev *dev);
391int pnp_validate_config(struct pnp_dev *dev); 394int pnp_validate_config(struct pnp_dev *dev);
392int pnp_start_dev(struct pnp_dev *dev); 395int pnp_start_dev(struct pnp_dev *dev);
@@ -394,11 +397,11 @@ int pnp_stop_dev(struct pnp_dev *dev);
394int pnp_activate_dev(struct pnp_dev *dev); 397int pnp_activate_dev(struct pnp_dev *dev);
395int pnp_disable_dev(struct pnp_dev *dev); 398int pnp_disable_dev(struct pnp_dev *dev);
396void pnp_resource_change(struct resource *resource, resource_size_t start, 399void pnp_resource_change(struct resource *resource, resource_size_t start,
397 resource_size_t size); 400 resource_size_t size);
398 401
399/* protocol helpers */ 402/* protocol helpers */
400int pnp_is_active(struct pnp_dev * dev); 403int pnp_is_active(struct pnp_dev *dev);
401int compare_pnp_id(struct pnp_id * pos, const char * id); 404int compare_pnp_id(struct pnp_id *pos, const char *id);
402int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev); 405int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev);
403int pnp_register_driver(struct pnp_driver *drv); 406int pnp_register_driver(struct pnp_driver *drv);
404void pnp_unregister_driver(struct pnp_driver *drv); 407void pnp_unregister_driver(struct pnp_driver *drv);
@@ -411,23 +414,24 @@ static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { }
411static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } 414static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
412static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } 415static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
413static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } 416static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
414static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } 417static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { }
418
415#define pnp_platform_devices 0 419#define pnp_platform_devices 0
416 420
417/* multidevice card support */ 421/* multidevice card support */
418static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; } 422static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; }
419static inline void pnp_remove_card(struct pnp_card *card) { ; } 423static inline void pnp_remove_card(struct pnp_card *card) { }
420static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; } 424static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; }
421static inline void pnp_remove_card_device(struct pnp_dev *dev) { ; } 425static inline void pnp_remove_card_device(struct pnp_dev *dev) { }
422static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; } 426static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; }
423static inline struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from) { return NULL; } 427static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, const char *id, struct pnp_dev *from) { return NULL; }
424static inline void pnp_release_card_device(struct pnp_dev * dev) { ; } 428static inline void pnp_release_card_device(struct pnp_dev *dev) { }
425static inline int pnp_register_card_driver(struct pnp_card_driver * drv) { return -ENODEV; } 429static inline int pnp_register_card_driver(struct pnp_card_driver *drv) { return -ENODEV; }
426static inline void pnp_unregister_card_driver(struct pnp_card_driver * drv) { ; } 430static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { }
427 431
428/* resource management */ 432/* resource management */
429static inline struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev) { return NULL; } 433static inline struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev) { return NULL; }
430static inline struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; } 434static inline struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; }
431static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; } 435static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; }
432static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; } 436static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; }
433static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; } 437static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; }
@@ -440,20 +444,17 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
440static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } 444static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
441static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } 445static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
442static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } 446static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
443static inline void pnp_resource_change(struct resource *resource, 447static inline void pnp_resource_change(struct resource *resource, resource_size_t start, resource_size_t size) { }
444 resource_size_t start,
445 resource_size_t size) { }
446 448
447/* protocol helpers */ 449/* protocol helpers */
448static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } 450static inline int pnp_is_active(struct pnp_dev *dev) { return 0; }
449static inline int compare_pnp_id(struct pnp_id * pos, const char * id) { return -ENODEV; } 451static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -ENODEV; }
450static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; } 452static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; }
451static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } 453static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
452static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } 454static inline void pnp_unregister_driver(struct pnp_driver *drv) { }
453 455
454#endif /* CONFIG_PNP */ 456#endif /* CONFIG_PNP */
455 457
456
457#define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg) 458#define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg)
458#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) 459#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg)
459#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) 460#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg)
diff --git a/include/linux/pnpbios.h b/include/linux/pnpbios.h
index 0a282ac1f6b2..329192adc9dd 100644
--- a/include/linux/pnpbios.h
+++ b/include/linux/pnpbios.h
@@ -99,32 +99,32 @@
99 99
100#pragma pack(1) 100#pragma pack(1)
101struct pnp_dev_node_info { 101struct pnp_dev_node_info {
102 __u16 no_nodes; 102 __u16 no_nodes;
103 __u16 max_node_size; 103 __u16 max_node_size;
104}; 104};
105struct pnp_docking_station_info { 105struct pnp_docking_station_info {
106 __u32 location_id; 106 __u32 location_id;
107 __u32 serial; 107 __u32 serial;
108 __u16 capabilities; 108 __u16 capabilities;
109}; 109};
110struct pnp_isa_config_struc { 110struct pnp_isa_config_struc {
111 __u8 revision; 111 __u8 revision;
112 __u8 no_csns; 112 __u8 no_csns;
113 __u16 isa_rd_data_port; 113 __u16 isa_rd_data_port;
114 __u16 reserved; 114 __u16 reserved;
115}; 115};
116struct escd_info_struc { 116struct escd_info_struc {
117 __u16 min_escd_write_size; 117 __u16 min_escd_write_size;
118 __u16 escd_size; 118 __u16 escd_size;
119 __u32 nv_storage_base; 119 __u32 nv_storage_base;
120}; 120};
121struct pnp_bios_node { 121struct pnp_bios_node {
122 __u16 size; 122 __u16 size;
123 __u8 handle; 123 __u8 handle;
124 __u32 eisa_id; 124 __u32 eisa_id;
125 __u8 type_code[3]; 125 __u8 type_code[3];
126 __u16 flags; 126 __u16 flags;
127 __u8 data[0]; 127 __u8 data[0];
128}; 128};
129#pragma pack() 129#pragma pack()
130 130
@@ -133,22 +133,16 @@ struct pnp_bios_node {
133/* non-exported */ 133/* non-exported */
134extern struct pnp_dev_node_info node_info; 134extern struct pnp_dev_node_info node_info;
135 135
136extern int pnp_bios_dev_node_info (struct pnp_dev_node_info *data); 136extern int pnp_bios_dev_node_info(struct pnp_dev_node_info *data);
137extern int pnp_bios_get_dev_node (u8 *nodenum, char config, struct pnp_bios_node *data); 137extern int pnp_bios_get_dev_node(u8 *nodenum, char config,
138extern int pnp_bios_set_dev_node (u8 nodenum, char config, struct pnp_bios_node *data); 138 struct pnp_bios_node *data);
139extern int pnp_bios_get_stat_res (char *info); 139extern int pnp_bios_set_dev_node(u8 nodenum, char config,
140extern int pnp_bios_isapnp_config (struct pnp_isa_config_struc *data); 140 struct pnp_bios_node *data);
141extern int pnp_bios_escd_info (struct escd_info_struc *data); 141extern int pnp_bios_get_stat_res(char *info);
142extern int pnp_bios_read_escd (char *data, u32 nvram_base); 142extern int pnp_bios_isapnp_config(struct pnp_isa_config_struc *data);
143extern int pnp_bios_escd_info(struct escd_info_struc *data);
144extern int pnp_bios_read_escd(char *data, u32 nvram_base);
143extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data); 145extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data);
144#define needed 0
145#if needed
146extern int pnp_bios_get_event (u16 *message);
147extern int pnp_bios_send_message (u16 message);
148extern int pnp_bios_set_stat_res (char *info);
149extern int pnp_bios_apm_id_table (char *table, u16 *size);
150extern int pnp_bios_write_escd (char *data, u32 nvram_base);
151#endif
152 146
153#endif /* CONFIG_PNPBIOS */ 147#endif /* CONFIG_PNPBIOS */
154 148
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 27690798623f..16d813b364ef 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -21,6 +21,8 @@
21#define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC) 21#define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC)
22#define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry)) 22#define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry))
23 23
24#define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
25
24struct poll_table_struct; 26struct poll_table_struct;
25 27
26/* 28/*
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index d0926d63406c..484988ed301e 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -8,6 +8,7 @@
8 8
9#include <linux/thread_info.h> 9#include <linux/thread_info.h>
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <linux/list.h>
11 12
12#ifdef CONFIG_DEBUG_PREEMPT 13#ifdef CONFIG_DEBUG_PREEMPT
13 extern void fastcall add_preempt_count(int val); 14 extern void fastcall add_preempt_count(int val);
@@ -60,4 +61,47 @@ do { \
60 61
61#endif 62#endif
62 63
64#ifdef CONFIG_PREEMPT_NOTIFIERS
65
66struct preempt_notifier;
67
68/**
69 * preempt_ops - notifiers called when a task is preempted and rescheduled
70 * @sched_in: we're about to be rescheduled:
71 * notifier: struct preempt_notifier for the task being scheduled
72 * cpu: cpu we're scheduled on
73 * @sched_out: we've just been preempted
74 * notifier: struct preempt_notifier for the task being preempted
75 * next: the task that's kicking us out
76 */
77struct preempt_ops {
78 void (*sched_in)(struct preempt_notifier *notifier, int cpu);
79 void (*sched_out)(struct preempt_notifier *notifier,
80 struct task_struct *next);
81};
82
83/**
84 * preempt_notifier - key for installing preemption notifiers
85 * @link: internal use
86 * @ops: defines the notifier functions to be called
87 *
88 * Usually used in conjunction with container_of().
89 */
90struct preempt_notifier {
91 struct hlist_node link;
92 struct preempt_ops *ops;
93};
94
95void preempt_notifier_register(struct preempt_notifier *notifier);
96void preempt_notifier_unregister(struct preempt_notifier *notifier);
97
98static inline void preempt_notifier_init(struct preempt_notifier *notifier,
99 struct preempt_ops *ops)
100{
101 INIT_HLIST_NODE(&notifier->link);
102 notifier->ops = ops;
103}
104
105#endif
106
63#endif /* __LINUX_PREEMPT_H */ 107#endif /* __LINUX_PREEMPT_H */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 28e3664fdf1b..cd13a78c5db8 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -75,7 +75,6 @@ struct proc_dir_entry {
75 write_proc_t *write_proc; 75 write_proc_t *write_proc;
76 atomic_t count; /* use count */ 76 atomic_t count; /* use count */
77 int deleted; /* delete flag */ 77 int deleted; /* delete flag */
78 void *set;
79 int pde_users; /* number of callers into module in progress */ 78 int pde_users; /* number of callers into module in progress */
80 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ 79 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
81 struct completion *pde_unload_completion; 80 struct completion *pde_unload_completion;
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 28ac632b42dd..dcb729244f47 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -227,7 +227,7 @@ struct mddev_s
227 unsigned int safemode_delay; 227 unsigned int safemode_delay;
228 struct timer_list safemode_timer; 228 struct timer_list safemode_timer;
229 atomic_t writes_pending; 229 atomic_t writes_pending;
230 request_queue_t *queue; /* for plugging ... */ 230 struct request_queue *queue; /* for plugging ... */
231 231
232 atomic_t write_behind; /* outstanding async IO */ 232 atomic_t write_behind; /* outstanding async IO */
233 unsigned int max_write_behind; /* 0 = sync */ 233 unsigned int max_write_behind; /* 0 = sync */
@@ -265,7 +265,7 @@ struct mdk_personality
265 int level; 265 int level;
266 struct list_head list; 266 struct list_head list;
267 struct module *owner; 267 struct module *owner;
268 int (*make_request)(request_queue_t *q, struct bio *bio); 268 int (*make_request)(struct request_queue *q, struct bio *bio);
269 int (*run)(mddev_t *mddev); 269 int (*run)(mddev_t *mddev);
270 int (*stop)(mddev_t *mddev); 270 int (*stop)(mddev_t *mddev);
271 void (*status)(struct seq_file *seq, mddev_t *mddev); 271 void (*status)(struct seq_file *seq, mddev_t *mddev);
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index c6b7485eac7c..fe17d7d750c2 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -281,7 +281,6 @@ extern void FASTCALL(call_rcu(struct rcu_head *head,
281extern void FASTCALL(call_rcu_bh(struct rcu_head *head, 281extern void FASTCALL(call_rcu_bh(struct rcu_head *head,
282 void (*func)(struct rcu_head *head))); 282 void (*func)(struct rcu_head *head)));
283extern void synchronize_rcu(void); 283extern void synchronize_rcu(void);
284void synchronize_idle(void);
285extern void rcu_barrier(void); 284extern void rcu_barrier(void);
286 285
287#endif /* __KERNEL__ */ 286#endif /* __KERNEL__ */
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 1dd1c707311f..85ea63f462af 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -67,6 +67,11 @@ extern void kernel_power_off(void);
67 67
68void ctrl_alt_del(void); 68void ctrl_alt_del(void);
69 69
70#define POWEROFF_CMD_PATH_LEN 256
71extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN];
72
73extern int orderly_poweroff(bool force);
74
70/* 75/*
71 * Emergency restart, callable from an interrupt handler. 76 * Emergency restart, callable from an interrupt handler.
72 */ 77 */
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 965d5b3ea9eb..180a9d832dde 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -81,14 +81,16 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...);
81/* assertions handling */ 81/* assertions handling */
82 82
83/** always check a condition and panic if it's false. */ 83/** always check a condition and panic if it's false. */
84#define RASSERT( cond, format, args... ) \ 84#define __RASSERT( cond, scond, format, args... ) \
85if( !( cond ) ) \ 85if( !( cond ) ) \
86 reiserfs_panic( NULL, "reiserfs[%i]: assertion " #cond " failed at " \ 86 reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \
87 __FILE__ ":%i:%s: " format "\n", \ 87 __FILE__ ":%i:%s: " format "\n", \
88 in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args ) 88 in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args )
89 89
90#define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args)
91
90#if defined( CONFIG_REISERFS_CHECK ) 92#if defined( CONFIG_REISERFS_CHECK )
91#define RFALSE( cond, format, args... ) RASSERT( !( cond ), format, ##args ) 93#define RFALSE(cond, format, args...) __RASSERT(!(cond), "!(" #cond ")", format, ##args)
92#else 94#else
93#define RFALSE( cond, format, args... ) do {;} while( 0 ) 95#define RFALSE( cond, format, args... ) do {;} while( 0 )
94#endif 96#endif
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h
index 81e9299ca148..f3f4f28c6960 100644
--- a/include/linux/resume-trace.h
+++ b/include/linux/resume-trace.h
@@ -2,6 +2,7 @@
2#define RESUME_TRACE_H 2#define RESUME_TRACE_H
3 3
4#ifdef CONFIG_PM_TRACE 4#ifdef CONFIG_PM_TRACE
5#include <asm/resume-trace.h>
5 6
6extern int pm_trace_enabled; 7extern int pm_trace_enabled;
7 8
@@ -9,20 +10,10 @@ struct device;
9extern void set_trace_device(struct device *); 10extern void set_trace_device(struct device *);
10extern void generate_resume_trace(void *tracedata, unsigned int user); 11extern void generate_resume_trace(void *tracedata, unsigned int user);
11 12
12#define TRACE_DEVICE(dev) set_trace_device(dev) 13#define TRACE_DEVICE(dev) do { \
13#define TRACE_RESUME(user) do { \ 14 if (pm_trace_enabled) \
14 if (pm_trace_enabled) { \ 15 set_trace_device(dev); \
15 void *tracedata; \ 16 } while(0)
16 asm volatile("movl $1f,%0\n" \
17 ".section .tracedata,\"a\"\n" \
18 "1:\t.word %c1\n" \
19 "\t.long %c2\n" \
20 ".previous" \
21 :"=r" (tracedata) \
22 : "i" (__LINE__), "i" (__FILE__)); \
23 generate_resume_trace(tracedata, user); \
24 } \
25} while (0)
26 17
27#else 18#else
28 19
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index c91476ce314a..dff3192374f8 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -351,6 +351,8 @@ enum
351#define RTAX_INITCWND RTAX_INITCWND 351#define RTAX_INITCWND RTAX_INITCWND
352 RTAX_FEATURES, 352 RTAX_FEATURES,
353#define RTAX_FEATURES RTAX_FEATURES 353#define RTAX_FEATURES RTAX_FEATURES
354 RTAX_RTO_MIN,
355#define RTAX_RTO_MIN RTAX_RTO_MIN
354 __RTAX_MAX 356 __RTAX_MAX
355}; 357};
356 358
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 731edaca8ffd..f4e324ed2e44 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -139,7 +139,7 @@ struct cfs_rq;
139extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m); 139extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m);
140extern void proc_sched_set_task(struct task_struct *p); 140extern void proc_sched_set_task(struct task_struct *p);
141extern void 141extern void
142print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now); 142print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq);
143#else 143#else
144static inline void 144static inline void
145proc_sched_show_task(struct task_struct *p, struct seq_file *m) 145proc_sched_show_task(struct task_struct *p, struct seq_file *m)
@@ -149,7 +149,7 @@ static inline void proc_sched_set_task(struct task_struct *p)
149{ 149{
150} 150}
151static inline void 151static inline void
152print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now) 152print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
153{ 153{
154} 154}
155#endif 155#endif
@@ -345,6 +345,27 @@ typedef unsigned long mm_counter_t;
345 (mm)->hiwater_vm = (mm)->total_vm; \ 345 (mm)->hiwater_vm = (mm)->total_vm; \
346} while (0) 346} while (0)
347 347
348extern void set_dumpable(struct mm_struct *mm, int value);
349extern int get_dumpable(struct mm_struct *mm);
350
351/* mm flags */
352/* dumpable bits */
353#define MMF_DUMPABLE 0 /* core dump is permitted */
354#define MMF_DUMP_SECURELY 1 /* core file is readable only by root */
355#define MMF_DUMPABLE_BITS 2
356
357/* coredump filter bits */
358#define MMF_DUMP_ANON_PRIVATE 2
359#define MMF_DUMP_ANON_SHARED 3
360#define MMF_DUMP_MAPPED_PRIVATE 4
361#define MMF_DUMP_MAPPED_SHARED 5
362#define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS
363#define MMF_DUMP_FILTER_BITS 4
364#define MMF_DUMP_FILTER_MASK \
365 (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)
366#define MMF_DUMP_FILTER_DEFAULT \
367 ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED))
368
348struct mm_struct { 369struct mm_struct {
349 struct vm_area_struct * mmap; /* list of VMAs */ 370 struct vm_area_struct * mmap; /* list of VMAs */
350 struct rb_root mm_rb; 371 struct rb_root mm_rb;
@@ -402,7 +423,7 @@ struct mm_struct {
402 unsigned int token_priority; 423 unsigned int token_priority;
403 unsigned int last_interval; 424 unsigned int last_interval;
404 425
405 unsigned char dumpable:2; 426 unsigned long flags; /* Must use atomic bitops to access the bits */
406 427
407 /* coredumping support */ 428 /* coredumping support */
408 int core_waiters; 429 int core_waiters;
@@ -660,7 +681,7 @@ enum cpu_idle_type {
660#define SCHED_LOAD_SHIFT 10 681#define SCHED_LOAD_SHIFT 10
661#define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) 682#define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT)
662 683
663#define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 5) 684#define SCHED_LOAD_SCALE_FUZZ SCHED_LOAD_SCALE
664 685
665#ifdef CONFIG_SMP 686#ifdef CONFIG_SMP
666#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ 687#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */
@@ -713,7 +734,6 @@ struct sched_domain {
713 unsigned long max_interval; /* Maximum balance interval ms */ 734 unsigned long max_interval; /* Maximum balance interval ms */
714 unsigned int busy_factor; /* less balancing by factor if busy */ 735 unsigned int busy_factor; /* less balancing by factor if busy */
715 unsigned int imbalance_pct; /* No balance until over watermark */ 736 unsigned int imbalance_pct; /* No balance until over watermark */
716 unsigned long long cache_hot_time; /* Task considered cache hot (ns) */
717 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ 737 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */
718 unsigned int busy_idx; 738 unsigned int busy_idx;
719 unsigned int idle_idx; 739 unsigned int idle_idx;
@@ -765,6 +785,22 @@ extern int partition_sched_domains(cpumask_t *partition1,
765 785
766#endif /* CONFIG_SMP */ 786#endif /* CONFIG_SMP */
767 787
788/*
789 * A runqueue laden with a single nice 0 task scores a weighted_cpuload of
790 * SCHED_LOAD_SCALE. This function returns 1 if any cpu is laden with a
791 * task of nice 0 or enough lower priority tasks to bring up the
792 * weighted_cpuload
793 */
794static inline int above_background_load(void)
795{
796 unsigned long cpu;
797
798 for_each_online_cpu(cpu) {
799 if (weighted_cpuload(cpu) >= SCHED_LOAD_SCALE)
800 return 1;
801 }
802 return 0;
803}
768 804
769struct io_context; /* See blkdev.h */ 805struct io_context; /* See blkdev.h */
770struct cpuset; 806struct cpuset;
@@ -819,22 +855,20 @@ struct sched_domain;
819struct sched_class { 855struct sched_class {
820 struct sched_class *next; 856 struct sched_class *next;
821 857
822 void (*enqueue_task) (struct rq *rq, struct task_struct *p, 858 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup);
823 int wakeup, u64 now); 859 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
824 void (*dequeue_task) (struct rq *rq, struct task_struct *p,
825 int sleep, u64 now);
826 void (*yield_task) (struct rq *rq, struct task_struct *p); 860 void (*yield_task) (struct rq *rq, struct task_struct *p);
827 861
828 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); 862 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p);
829 863
830 struct task_struct * (*pick_next_task) (struct rq *rq, u64 now); 864 struct task_struct * (*pick_next_task) (struct rq *rq);
831 void (*put_prev_task) (struct rq *rq, struct task_struct *p, u64 now); 865 void (*put_prev_task) (struct rq *rq, struct task_struct *p);
832 866
833 int (*load_balance) (struct rq *this_rq, int this_cpu, 867 unsigned long (*load_balance) (struct rq *this_rq, int this_cpu,
834 struct rq *busiest, 868 struct rq *busiest,
835 unsigned long max_nr_move, unsigned long max_load_move, 869 unsigned long max_nr_move, unsigned long max_load_move,
836 struct sched_domain *sd, enum cpu_idle_type idle, 870 struct sched_domain *sd, enum cpu_idle_type idle,
837 int *all_pinned, unsigned long *total_load_moved); 871 int *all_pinned, int *this_best_prio);
838 872
839 void (*set_curr_task) (struct rq *rq); 873 void (*set_curr_task) (struct rq *rq);
840 void (*task_tick) (struct rq *rq, struct task_struct *p); 874 void (*task_tick) (struct rq *rq, struct task_struct *p);
@@ -868,23 +902,29 @@ struct sched_entity {
868 struct rb_node run_node; 902 struct rb_node run_node;
869 unsigned int on_rq; 903 unsigned int on_rq;
870 904
905 u64 exec_start;
906 u64 sum_exec_runtime;
907 u64 prev_sum_exec_runtime;
871 u64 wait_start_fair; 908 u64 wait_start_fair;
909 u64 sleep_start_fair;
910
911#ifdef CONFIG_SCHEDSTATS
872 u64 wait_start; 912 u64 wait_start;
873 u64 exec_start; 913 u64 wait_max;
914 s64 sum_wait_runtime;
915
874 u64 sleep_start; 916 u64 sleep_start;
875 u64 sleep_start_fair;
876 u64 block_start;
877 u64 sleep_max; 917 u64 sleep_max;
918 s64 sum_sleep_runtime;
919
920 u64 block_start;
878 u64 block_max; 921 u64 block_max;
879 u64 exec_max; 922 u64 exec_max;
880 u64 wait_max;
881 u64 last_ran;
882 923
883 u64 sum_exec_runtime;
884 s64 sum_wait_runtime;
885 s64 sum_sleep_runtime;
886 unsigned long wait_runtime_overruns; 924 unsigned long wait_runtime_overruns;
887 unsigned long wait_runtime_underruns; 925 unsigned long wait_runtime_underruns;
926#endif
927
888#ifdef CONFIG_FAIR_GROUP_SCHED 928#ifdef CONFIG_FAIR_GROUP_SCHED
889 struct sched_entity *parent; 929 struct sched_entity *parent;
890 /* rq on which this entity is (to be) queued: */ 930 /* rq on which this entity is (to be) queued: */
@@ -914,6 +954,11 @@ struct task_struct {
914 struct sched_class *sched_class; 954 struct sched_class *sched_class;
915 struct sched_entity se; 955 struct sched_entity se;
916 956
957#ifdef CONFIG_PREEMPT_NOTIFIERS
958 /* list of struct preempt_notifier: */
959 struct hlist_head preempt_notifiers;
960#endif
961
917 unsigned short ioprio; 962 unsigned short ioprio;
918#ifdef CONFIG_BLK_DEV_IO_TRACE 963#ifdef CONFIG_BLK_DEV_IO_TRACE
919 unsigned int btrace_seq; 964 unsigned int btrace_seq;
@@ -1327,6 +1372,13 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1327#endif 1372#endif
1328 1373
1329extern unsigned long long sched_clock(void); 1374extern unsigned long long sched_clock(void);
1375
1376/*
1377 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
1378 * clock constructed from sched_clock():
1379 */
1380extern unsigned long long cpu_clock(int cpu);
1381
1330extern unsigned long long 1382extern unsigned long long
1331task_sched_runtime(struct task_struct *task); 1383task_sched_runtime(struct task_struct *task);
1332 1384
@@ -1337,7 +1389,8 @@ extern void sched_exec(void);
1337#define sched_exec() {} 1389#define sched_exec() {}
1338#endif 1390#endif
1339 1391
1340extern void sched_clock_unstable_event(void); 1392extern void sched_clock_idle_sleep_event(void);
1393extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1341 1394
1342#ifdef CONFIG_HOTPLUG_CPU 1395#ifdef CONFIG_HOTPLUG_CPU
1343extern void idle_task_exit(void); 1396extern void idle_task_exit(void);
@@ -1347,7 +1400,8 @@ static inline void idle_task_exit(void) {}
1347 1400
1348extern void sched_idle_next(void); 1401extern void sched_idle_next(void);
1349 1402
1350extern unsigned int sysctl_sched_granularity; 1403extern unsigned int sysctl_sched_latency;
1404extern unsigned int sysctl_sched_min_granularity;
1351extern unsigned int sysctl_sched_wakeup_granularity; 1405extern unsigned int sysctl_sched_wakeup_granularity;
1352extern unsigned int sysctl_sched_batch_wakeup_granularity; 1406extern unsigned int sysctl_sched_batch_wakeup_granularity;
1353extern unsigned int sysctl_sched_stat_granularity; 1407extern unsigned int sysctl_sched_stat_granularity;
diff --git a/include/linux/security.h b/include/linux/security.h
index c11dc8aa0351..1a15526e9f67 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -54,7 +54,7 @@ extern int cap_inode_removexattr(struct dentry *dentry, char *name);
54extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); 54extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
55extern void cap_task_reparent_to_init (struct task_struct *p); 55extern void cap_task_reparent_to_init (struct task_struct *p);
56extern int cap_syslog (int type); 56extern int cap_syslog (int type);
57extern int cap_vm_enough_memory (long pages); 57extern int cap_vm_enough_memory (struct mm_struct *mm, long pages);
58 58
59struct msghdr; 59struct msghdr;
60struct sk_buff; 60struct sk_buff;
@@ -1125,6 +1125,7 @@ struct request_sock;
1125 * Return 0 if permission is granted. 1125 * Return 0 if permission is granted.
1126 * @vm_enough_memory: 1126 * @vm_enough_memory:
1127 * Check permissions for allocating a new virtual mapping. 1127 * Check permissions for allocating a new virtual mapping.
1128 * @mm contains the mm struct it is being added to.
1128 * @pages contains the number of pages. 1129 * @pages contains the number of pages.
1129 * Return 0 if permission is granted. 1130 * Return 0 if permission is granted.
1130 * 1131 *
@@ -1169,7 +1170,7 @@ struct security_operations {
1169 int (*quota_on) (struct dentry * dentry); 1170 int (*quota_on) (struct dentry * dentry);
1170 int (*syslog) (int type); 1171 int (*syslog) (int type);
1171 int (*settime) (struct timespec *ts, struct timezone *tz); 1172 int (*settime) (struct timespec *ts, struct timezone *tz);
1172 int (*vm_enough_memory) (long pages); 1173 int (*vm_enough_memory) (struct mm_struct *mm, long pages);
1173 1174
1174 int (*bprm_alloc_security) (struct linux_binprm * bprm); 1175 int (*bprm_alloc_security) (struct linux_binprm * bprm);
1175 void (*bprm_free_security) (struct linux_binprm * bprm); 1176 void (*bprm_free_security) (struct linux_binprm * bprm);
@@ -1469,10 +1470,14 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz)
1469 return security_ops->settime(ts, tz); 1470 return security_ops->settime(ts, tz);
1470} 1471}
1471 1472
1472
1473static inline int security_vm_enough_memory(long pages) 1473static inline int security_vm_enough_memory(long pages)
1474{ 1474{
1475 return security_ops->vm_enough_memory(pages); 1475 return security_ops->vm_enough_memory(current->mm, pages);
1476}
1477
1478static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
1479{
1480 return security_ops->vm_enough_memory(mm, pages);
1476} 1481}
1477 1482
1478static inline int security_bprm_alloc (struct linux_binprm *bprm) 1483static inline int security_bprm_alloc (struct linux_binprm *bprm)
@@ -2219,7 +2224,12 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz)
2219 2224
2220static inline int security_vm_enough_memory(long pages) 2225static inline int security_vm_enough_memory(long pages)
2221{ 2226{
2222 return cap_vm_enough_memory(pages); 2227 return cap_vm_enough_memory(current->mm, pages);
2228}
2229
2230static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
2231{
2232 return cap_vm_enough_memory(mm, pages);
2223} 2233}
2224 2234
2225static inline int security_bprm_alloc (struct linux_binprm *bprm) 2235static inline int security_bprm_alloc (struct linux_binprm *bprm)
diff --git a/include/linux/selection.h b/include/linux/selection.h
index ed3408b400f1..f9457861937c 100644
--- a/include/linux/selection.h
+++ b/include/linux/selection.h
@@ -10,6 +10,8 @@
10#include <linux/tiocl.h> 10#include <linux/tiocl.h>
11#include <linux/vt_buffer.h> 11#include <linux/vt_buffer.h>
12 12
13struct tty_struct;
14
13extern struct vc_data *sel_cons; 15extern struct vc_data *sel_cons;
14 16
15extern void clear_selection(void); 17extern void clear_selection(void);
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 706ee9a4c80c..afe0f6d9b9bc 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -20,7 +20,7 @@
20struct plat_serial8250_port { 20struct plat_serial8250_port {
21 unsigned long iobase; /* io base address */ 21 unsigned long iobase; /* io base address */
22 void __iomem *membase; /* ioremap cookie or NULL */ 22 void __iomem *membase; /* ioremap cookie or NULL */
23 unsigned long mapbase; /* resource base */ 23 resource_size_t mapbase; /* resource base */
24 unsigned int irq; /* interrupt number */ 24 unsigned int irq; /* interrupt number */
25 unsigned int uartclk; /* UART clock rate */ 25 unsigned int uartclk; /* UART clock rate */
26 unsigned char regshift; /* register shift */ 26 unsigned char regshift; /* register shift */
@@ -60,6 +60,8 @@ void serial8250_unregister_port(int line);
60void serial8250_suspend_port(int line); 60void serial8250_suspend_port(int line);
61void serial8250_resume_port(int line); 61void serial8250_resume_port(int line);
62 62
63extern int early_serial_setup(struct uart_port *port);
64
63extern int serial8250_find_port(struct uart_port *p); 65extern int serial8250_find_port(struct uart_port *p);
64extern int serial8250_find_port_for_earlycon(void); 66extern int serial8250_find_port_for_earlycon(void);
65extern int setup_early_serial8250_console(char *cmdline); 67extern int setup_early_serial8250_console(char *cmdline);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 9c721cd2c9d6..09d17b06bf02 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -62,8 +62,9 @@
62/* NEC v850. */ 62/* NEC v850. */
63#define PORT_V850E_UART 40 63#define PORT_V850E_UART 40
64 64
65/* DZ */ 65/* DEC */
66#define PORT_DZ 47 66#define PORT_DZ 46
67#define PORT_ZS 47
67 68
68/* Parisc type numbers. */ 69/* Parisc type numbers. */
69#define PORT_MUX 48 70#define PORT_MUX 48
@@ -287,7 +288,7 @@ struct uart_port {
287 const struct uart_ops *ops; 288 const struct uart_ops *ops;
288 unsigned int custom_divisor; 289 unsigned int custom_divisor;
289 unsigned int line; /* port index */ 290 unsigned int line; /* port index */
290 unsigned long mapbase; /* for ioremap */ 291 resource_size_t mapbase; /* for ioremap */
291 struct device *dev; /* parent device */ 292 struct device *dev; /* parent device */
292 unsigned char hub6; /* this should be in the 8250 driver */ 293 unsigned char hub6; /* this should be in the 8250 driver */
293 unsigned char unused[3]; 294 unsigned char unused[3];
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index 1c5ed7d92b0f..96c0d93fc2ca 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -118,6 +118,7 @@
118#define UART_LSR_PE 0x04 /* Parity error indicator */ 118#define UART_LSR_PE 0x04 /* Parity error indicator */
119#define UART_LSR_OE 0x02 /* Overrun error indicator */ 119#define UART_LSR_OE 0x02 /* Overrun error indicator */
120#define UART_LSR_DR 0x01 /* Receiver data ready */ 120#define UART_LSR_DR 0x01 /* Receiver data ready */
121#define UART_LSR_BRK_ERROR_BITS 0x1E /* BI, FE, PE, OE bits */
121 122
122#define UART_MSR 6 /* In: Modem Status Register */ 123#define UART_MSR 6 /* In: Modem Status Register */
123#define UART_MSR_DCD 0x80 /* Data Carrier Detect */ 124#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
diff --git a/include/linux/signal.h b/include/linux/signal.h
index ea91abe740da..0ae338866240 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -237,12 +237,15 @@ extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct
237extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); 237extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
238extern long do_sigpending(void __user *, unsigned long); 238extern long do_sigpending(void __user *, unsigned long);
239extern int sigprocmask(int, sigset_t *, sigset_t *); 239extern int sigprocmask(int, sigset_t *, sigset_t *);
240extern int show_unhandled_signals;
240 241
241struct pt_regs; 242struct pt_regs;
242extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); 243extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
243 244
244extern struct kmem_cache *sighand_cachep; 245extern struct kmem_cache *sighand_cachep;
245 246
247int unhandled_signal(struct task_struct *tsk, int sig);
248
246/* 249/*
247 * In POSIX a signal is sent either to a specific thread (Linux task) 250 * In POSIX a signal is sent either to a specific thread (Linux task)
248 * or to the process as a whole (Linux thread group). How the signal 251 * or to the process as a whole (Linux thread group). How the signal
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ce256438e619..93c27f71122a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -134,8 +134,8 @@ typedef struct skb_frag_struct skb_frag_t;
134 134
135struct skb_frag_struct { 135struct skb_frag_struct {
136 struct page *page; 136 struct page *page;
137 __u16 page_offset; 137 __u32 page_offset;
138 __u16 size; 138 __u32 size;
139}; 139};
140 140
141/* This data is invariant across clones and lives at 141/* This data is invariant across clones and lives at
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 0e1d0daef6a2..d859354b9e51 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -40,7 +40,7 @@
40 */ 40 */
41#define ZERO_SIZE_PTR ((void *)16) 41#define ZERO_SIZE_PTR ((void *)16)
42 42
43#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) < \ 43#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \
44 (unsigned long)ZERO_SIZE_PTR) 44 (unsigned long)ZERO_SIZE_PTR)
45 45
46/* 46/*
@@ -51,7 +51,6 @@ int slab_is_available(void);
51 51
52struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, 52struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
53 unsigned long, 53 unsigned long,
54 void (*)(void *, struct kmem_cache *, unsigned long),
55 void (*)(void *, struct kmem_cache *, unsigned long)); 54 void (*)(void *, struct kmem_cache *, unsigned long));
56void kmem_cache_destroy(struct kmem_cache *); 55void kmem_cache_destroy(struct kmem_cache *);
57int kmem_cache_shrink(struct kmem_cache *); 56int kmem_cache_shrink(struct kmem_cache *);
@@ -70,7 +69,7 @@ int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
70 */ 69 */
71#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\ 70#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\
72 sizeof(struct __struct), __alignof__(struct __struct),\ 71 sizeof(struct __struct), __alignof__(struct __struct),\
73 (__flags), NULL, NULL) 72 (__flags), NULL)
74 73
75/* 74/*
76 * The largest kmalloc size supported by the slab allocators is 75 * The largest kmalloc size supported by the slab allocators is
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 07f7e4cbcee3..74962077f632 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -78,7 +78,7 @@ extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
78 * Sorry that the following has to be that ugly but some versions of GCC 78 * Sorry that the following has to be that ugly but some versions of GCC
79 * have trouble with constant propagation and loops. 79 * have trouble with constant propagation and loops.
80 */ 80 */
81static inline int kmalloc_index(size_t size) 81static __always_inline int kmalloc_index(size_t size)
82{ 82{
83 if (!size) 83 if (!size)
84 return 0; 84 return 0;
@@ -133,7 +133,7 @@ static inline int kmalloc_index(size_t size)
133 * This ought to end up with a global pointer to the right cache 133 * This ought to end up with a global pointer to the right cache
134 * in kmalloc_caches. 134 * in kmalloc_caches.
135 */ 135 */
136static inline struct kmem_cache *kmalloc_slab(size_t size) 136static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
137{ 137{
138 int index = kmalloc_index(size); 138 int index = kmalloc_index(size);
139 139
@@ -160,13 +160,13 @@ static inline struct kmem_cache *kmalloc_slab(size_t size)
160#define SLUB_DMA __GFP_DMA 160#define SLUB_DMA __GFP_DMA
161#else 161#else
162/* Disable DMA functionality */ 162/* Disable DMA functionality */
163#define SLUB_DMA 0 163#define SLUB_DMA (__force gfp_t)0
164#endif 164#endif
165 165
166void *kmem_cache_alloc(struct kmem_cache *, gfp_t); 166void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
167void *__kmalloc(size_t size, gfp_t flags); 167void *__kmalloc(size_t size, gfp_t flags);
168 168
169static inline void *kmalloc(size_t size, gfp_t flags) 169static __always_inline void *kmalloc(size_t size, gfp_t flags)
170{ 170{
171 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 171 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
172 struct kmem_cache *s = kmalloc_slab(size); 172 struct kmem_cache *s = kmalloc_slab(size);
@@ -183,7 +183,7 @@ static inline void *kmalloc(size_t size, gfp_t flags)
183void *__kmalloc_node(size_t size, gfp_t flags, int node); 183void *__kmalloc_node(size_t size, gfp_t flags, int node);
184void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 184void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
185 185
186static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 186static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
187{ 187{
188 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 188 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
189 struct kmem_cache *s = kmalloc_slab(size); 189 struct kmem_cache *s = kmalloc_slab(size);
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 302b81d1d117..002a3cddbdd5 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -77,6 +77,7 @@ struct spi_device {
77#define SPI_CS_HIGH 0x04 /* chipselect active high? */ 77#define SPI_CS_HIGH 0x04 /* chipselect active high? */
78#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ 78#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */
79#define SPI_3WIRE 0x10 /* SI/SO signals shared */ 79#define SPI_3WIRE 0x10 /* SI/SO signals shared */
80#define SPI_LOOP 0x20 /* loopback mode */
80 u8 bits_per_word; 81 u8 bits_per_word;
81 int irq; 82 int irq;
82 void *controller_state; 83 void *controller_state;
@@ -138,6 +139,32 @@ struct spi_message;
138 139
139 140
140 141
142/**
143 * struct spi_driver - Host side "protocol" driver
144 * @probe: Binds this driver to the spi device. Drivers can verify
145 * that the device is actually present, and may need to configure
146 * characteristics (such as bits_per_word) which weren't needed for
147 * the initial configuration done during system setup.
148 * @remove: Unbinds this driver from the spi device
149 * @shutdown: Standard shutdown callback used during system state
150 * transitions such as powerdown/halt and kexec
151 * @suspend: Standard suspend callback used during system state transitions
152 * @resume: Standard resume callback used during system state transitions
153 * @driver: SPI device drivers should initialize the name and owner
154 * field of this structure.
155 *
156 * This represents the kind of device driver that uses SPI messages to
157 * interact with the hardware at the other end of a SPI link. It's called
158 * a "protocol" driver because it works through messages rather than talking
159 * directly to SPI hardware (which is what the underlying SPI controller
160 * driver does to pass those messages). These protocols are defined in the
161 * specification for the device(s) supported by the driver.
162 *
163 * As a rule, those device protocols represent the lowest level interface
164 * supported by a driver, and it will support upper level interfaces too.
165 * Examples of such upper levels include frameworks like MTD, networking,
166 * MMC, RTC, filesystem character device nodes, and hardware monitoring.
167 */
141struct spi_driver { 168struct spi_driver {
142 int (*probe)(struct spi_device *spi); 169 int (*probe)(struct spi_device *spi);
143 int (*remove)(struct spi_device *spi); 170 int (*remove)(struct spi_device *spi);
@@ -667,7 +694,37 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd)
667 * parport adapters, or microcontrollers acting as USB-to-SPI bridges. 694 * parport adapters, or microcontrollers acting as USB-to-SPI bridges.
668 */ 695 */
669 696
670/* board-specific information about each SPI device */ 697/**
698 * struct spi_board_info - board-specific template for a SPI device
699 * @modalias: Initializes spi_device.modalias; identifies the driver.
700 * @platform_data: Initializes spi_device.platform_data; the particular
701 * data stored there is driver-specific.
702 * @controller_data: Initializes spi_device.controller_data; some
703 * controllers need hints about hardware setup, e.g. for DMA.
704 * @irq: Initializes spi_device.irq; depends on how the board is wired.
705 * @max_speed_hz: Initializes spi_device.max_speed_hz; based on limits
706 * from the chip datasheet and board-specific signal quality issues.
707 * @bus_num: Identifies which spi_master parents the spi_device; unused
708 * by spi_new_device(), and otherwise depends on board wiring.
709 * @chip_select: Initializes spi_device.chip_select; depends on how
710 * the board is wired.
711 * @mode: Initializes spi_device.mode; based on the chip datasheet, board
712 * wiring (some devices support both 3WIRE and standard modes), and
713 * possibly presence of an inverter in the chipselect path.
714 *
715 * When adding new SPI devices to the device tree, these structures serve
716 * as a partial device template. They hold information which can't always
717 * be determined by drivers. Information that probe() can establish (such
718 * as the default transfer wordsize) is not included here.
719 *
720 * These structures are used in two places. Their primary role is to
721 * be stored in tables of board-specific device descriptors, which are
722 * declared early in board initialization and then used (much later) to
723 * populate a controller's device tree after the that controller's driver
724 * initializes. A secondary (and atypical) role is as a parameter to
725 * spi_new_device() call, which happens after those controller drivers
726 * are active in some dynamic board configuration models.
727 */
671struct spi_board_info { 728struct spi_board_info {
672 /* the device name and module name are coupled, like platform_bus; 729 /* the device name and module name are coupled, like platform_bus;
673 * "modalias" is normally the driver name. 730 * "modalias" is normally the driver name.
diff --git a/include/linux/spi/spidev.h b/include/linux/spi/spidev.h
index 7d700be57490..c93ef9d42a01 100644
--- a/include/linux/spi/spidev.h
+++ b/include/linux/spi/spidev.h
@@ -35,6 +35,10 @@
35#define SPI_MODE_2 (SPI_CPOL|0) 35#define SPI_MODE_2 (SPI_CPOL|0)
36#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) 36#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
37 37
38#define SPI_CS_HIGH 0x04
39#define SPI_LSB_FIRST 0x08
40#define SPI_3WIRE 0x10
41#define SPI_LOOP 0x20
38 42
39/*---------------------------------------------------------------------------*/ 43/*---------------------------------------------------------------------------*/
40 44
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h
index 210549ba4ef4..f6a3a951b79e 100644
--- a/include/linux/spinlock_types.h
+++ b/include/linux/spinlock_types.h
@@ -9,14 +9,14 @@
9 * Released under the General Public License (GPL). 9 * Released under the General Public License (GPL).
10 */ 10 */
11 11
12#include <linux/lockdep.h>
13
14#if defined(CONFIG_SMP) 12#if defined(CONFIG_SMP)
15# include <asm/spinlock_types.h> 13# include <asm/spinlock_types.h>
16#else 14#else
17# include <linux/spinlock_types_up.h> 15# include <linux/spinlock_types_up.h>
18#endif 16#endif
19 17
18#include <linux/lockdep.h>
19
20typedef struct { 20typedef struct {
21 raw_spinlock_t raw_lock; 21 raw_spinlock_t raw_lock;
22#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP) 22#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP)
diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h
index 27644af20b7c..04135b0e198e 100644
--- a/include/linux/spinlock_types_up.h
+++ b/include/linux/spinlock_types_up.h
@@ -12,14 +12,10 @@
12 * Released under the General Public License (GPL). 12 * Released under the General Public License (GPL).
13 */ 13 */
14 14
15#if defined(CONFIG_DEBUG_SPINLOCK) || \ 15#ifdef CONFIG_DEBUG_SPINLOCK
16 defined(CONFIG_DEBUG_LOCK_ALLOC)
17 16
18typedef struct { 17typedef struct {
19 volatile unsigned int slock; 18 volatile unsigned int slock;
20#ifdef CONFIG_DEBUG_LOCK_ALLOC
21 struct lockdep_map dep_map;
22#endif
23} raw_spinlock_t; 19} raw_spinlock_t;
24 20
25#define __RAW_SPIN_LOCK_UNLOCKED { 1 } 21#define __RAW_SPIN_LOCK_UNLOCKED { 1 }
@@ -34,9 +30,6 @@ typedef struct { } raw_spinlock_t;
34 30
35typedef struct { 31typedef struct {
36 /* no debug version on UP */ 32 /* no debug version on UP */
37#ifdef CONFIG_DEBUG_LOCK_ALLOC
38 struct lockdep_map dep_map;
39#endif
40} raw_rwlock_t; 33} raw_rwlock_t;
41 34
42#define __RAW_RW_LOCK_UNLOCKED { } 35#define __RAW_RW_LOCK_UNLOCKED { }
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 1d2b084c0185..e7fa657d0c49 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -13,7 +13,7 @@ extern void save_stack_trace(struct stack_trace *trace);
13extern void print_stack_trace(struct stack_trace *trace, int spaces); 13extern void print_stack_trace(struct stack_trace *trace, int spaces);
14#else 14#else
15# define save_stack_trace(trace) do { } while (0) 15# define save_stack_trace(trace) do { } while (0)
16# define print_stack_trace(trace) do { } while (0) 16# define print_stack_trace(trace, spaces) do { } while (0)
17#endif 17#endif
18 18
19#endif 19#endif
diff --git a/include/linux/string.h b/include/linux/string.h
index 7f2eb6a477f9..836062b7582a 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -105,8 +105,12 @@ extern void * memchr(const void *,int,__kernel_size_t);
105#endif 105#endif
106 106
107extern char *kstrdup(const char *s, gfp_t gfp); 107extern char *kstrdup(const char *s, gfp_t gfp);
108extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
108extern void *kmemdup(const void *src, size_t len, gfp_t gfp); 109extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
109 110
111extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
112extern void argv_free(char **argv);
113
110#ifdef __cplusplus 114#ifdef __cplusplus
111} 115}
112#endif 116#endif
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 9e340fa23c06..c6b53d181bfa 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -12,6 +12,7 @@
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <asm/byteorder.h> 13#include <asm/byteorder.h>
14#include <linux/scatterlist.h> 14#include <linux/scatterlist.h>
15#include <linux/smp_lock.h>
15 16
16/* 17/*
17 * Buffer adjustment 18 * Buffer adjustment
@@ -36,6 +37,21 @@ struct xdr_netobj {
36typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); 37typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj);
37 38
38/* 39/*
40 * We're still requiring the BKL in the xdr code until it's been
41 * more carefully audited, at which point this wrapper will become
42 * unnecessary.
43 */
44static inline int rpc_call_xdrproc(kxdrproc_t xdrproc, void *rqstp, __be32 *data, void *obj)
45{
46 int ret;
47
48 lock_kernel();
49 ret = xdrproc(rqstp, data, obj);
50 unlock_kernel();
51 return ret;
52}
53
54/*
39 * Basic structure for transmission/reception of a client XDR message. 55 * Basic structure for transmission/reception of a client XDR message.
40 * Features a header (for a linear buffer containing RPC headers 56 * Features a header (for a linear buffer containing RPC headers
41 * and the data payload for short messages), and then an array of 57 * and the data payload for short messages), and then an array of
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 9c7cb6430666..388cace9751f 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -24,7 +24,7 @@ struct pbe {
24extern void drain_local_pages(void); 24extern void drain_local_pages(void);
25extern void mark_free_pages(struct zone *zone); 25extern void mark_free_pages(struct zone *zone);
26 26
27#if defined(CONFIG_PM) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) 27#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
28extern int pm_prepare_console(void); 28extern int pm_prepare_console(void);
29extern void pm_restore_console(void); 29extern void pm_restore_console(void);
30#else 30#else
@@ -43,14 +43,18 @@ static inline void pm_restore_console(void) {}
43 * @prepare: prepare system for hibernation 43 * @prepare: prepare system for hibernation
44 * @enter: shut down system after state has been saved to disk 44 * @enter: shut down system after state has been saved to disk
45 * @finish: finish/clean up after state has been reloaded 45 * @finish: finish/clean up after state has been reloaded
46 * @pre_restore: prepare system for the restoration from a hibernation image
47 * @restore_cleanup: clean up after a failing image restoration
46 */ 48 */
47struct hibernation_ops { 49struct hibernation_ops {
48 int (*prepare)(void); 50 int (*prepare)(void);
49 int (*enter)(void); 51 int (*enter)(void);
50 void (*finish)(void); 52 void (*finish)(void);
53 int (*pre_restore)(void);
54 void (*restore_cleanup)(void);
51}; 55};
52 56
53#if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) 57#ifdef CONFIG_HIBERNATION
54/* kernel/power/snapshot.c */ 58/* kernel/power/snapshot.c */
55extern void __register_nosave_region(unsigned long b, unsigned long e, int km); 59extern void __register_nosave_region(unsigned long b, unsigned long e, int km);
56static inline void register_nosave_region(unsigned long b, unsigned long e) 60static inline void register_nosave_region(unsigned long b, unsigned long e)
@@ -68,21 +72,62 @@ extern unsigned long get_safe_page(gfp_t gfp_mask);
68 72
69extern void hibernation_set_ops(struct hibernation_ops *ops); 73extern void hibernation_set_ops(struct hibernation_ops *ops);
70extern int hibernate(void); 74extern int hibernate(void);
71#else 75#else /* CONFIG_HIBERNATION */
72static inline void register_nosave_region(unsigned long b, unsigned long e) {}
73static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}
74static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } 76static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
75static inline void swsusp_set_page_free(struct page *p) {} 77static inline void swsusp_set_page_free(struct page *p) {}
76static inline void swsusp_unset_page_free(struct page *p) {} 78static inline void swsusp_unset_page_free(struct page *p) {}
77 79
78static inline void hibernation_set_ops(struct hibernation_ops *ops) {} 80static inline void hibernation_set_ops(struct hibernation_ops *ops) {}
79static inline int hibernate(void) { return -ENOSYS; } 81static inline int hibernate(void) { return -ENOSYS; }
80#endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ 82#endif /* CONFIG_HIBERNATION */
81 83
84#ifdef CONFIG_PM_SLEEP
82void save_processor_state(void); 85void save_processor_state(void);
83void restore_processor_state(void); 86void restore_processor_state(void);
84struct saved_context; 87struct saved_context;
85void __save_processor_state(struct saved_context *ctxt); 88void __save_processor_state(struct saved_context *ctxt);
86void __restore_processor_state(struct saved_context *ctxt); 89void __restore_processor_state(struct saved_context *ctxt);
87 90
91/* kernel/power/main.c */
92extern struct blocking_notifier_head pm_chain_head;
93
94static inline int register_pm_notifier(struct notifier_block *nb)
95{
96 return blocking_notifier_chain_register(&pm_chain_head, nb);
97}
98
99static inline int unregister_pm_notifier(struct notifier_block *nb)
100{
101 return blocking_notifier_chain_unregister(&pm_chain_head, nb);
102}
103
104#define pm_notifier(fn, pri) { \
105 static struct notifier_block fn##_nb = \
106 { .notifier_call = fn, .priority = pri }; \
107 register_pm_notifier(&fn##_nb); \
108}
109#else /* !CONFIG_PM_SLEEP */
110
111static inline int register_pm_notifier(struct notifier_block *nb)
112{
113 return 0;
114}
115
116static inline int unregister_pm_notifier(struct notifier_block *nb)
117{
118 return 0;
119}
120
121#define pm_notifier(fn, pri) do { (void)(fn); } while (0)
122#endif /* !CONFIG_PM_SLEEP */
123
124#ifndef CONFIG_HIBERNATION
125static inline void register_nosave_region(unsigned long b, unsigned long e)
126{
127}
128static inline void register_nosave_region_late(unsigned long b, unsigned long e)
129{
130}
131#endif
132
88#endif /* _LINUX_SWSUSP_H */ 133#endif /* _LINUX_SWSUSP_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 83d0ec11235e..61def7c8fbb3 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -549,7 +549,7 @@ asmlinkage long sys_inotify_rm_watch(int fd, u32 wd);
549asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, 549asmlinkage long sys_spu_run(int fd, __u32 __user *unpc,
550 __u32 __user *ustatus); 550 __u32 __user *ustatus);
551asmlinkage long sys_spu_create(const char __user *name, 551asmlinkage long sys_spu_create(const char __user *name,
552 unsigned int flags, mode_t mode); 552 unsigned int flags, mode_t mode, int fd);
553 553
554asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode, 554asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode,
555 unsigned dev); 555 unsigned dev);
@@ -610,6 +610,7 @@ asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemas
610asmlinkage long sys_timerfd(int ufd, int clockid, int flags, 610asmlinkage long sys_timerfd(int ufd, int clockid, int flags,
611 const struct itimerspec __user *utmr); 611 const struct itimerspec __user *utmr);
612asmlinkage long sys_eventfd(unsigned int count); 612asmlinkage long sys_eventfd(unsigned int count);
613asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
613 614
614int kernel_execve(const char *filename, char *const argv[], char *const envp[]); 615int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
615 616
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 47f1c53332ce..483050c924c3 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -62,7 +62,7 @@ enum
62 CTL_KERN=1, /* General kernel info and control */ 62 CTL_KERN=1, /* General kernel info and control */
63 CTL_VM=2, /* VM management */ 63 CTL_VM=2, /* VM management */
64 CTL_NET=3, /* Networking */ 64 CTL_NET=3, /* Networking */
65 /* was CTL_PROC */ 65 CTL_PROC=4, /* removal breaks strace(1) compilation */
66 CTL_FS=5, /* Filesystems */ 66 CTL_FS=5, /* Filesystems */
67 CTL_DEBUG=6, /* Debugging */ 67 CTL_DEBUG=6, /* Debugging */
68 CTL_DEV=7, /* Devices */ 68 CTL_DEV=7, /* Devices */
diff --git a/include/linux/time.h b/include/linux/time.h
index ec3b0ced0afe..6a5f503b4f1d 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7# include <linux/cache.h>
7# include <linux/seqlock.h> 8# include <linux/seqlock.h>
8#endif 9#endif
9 10
@@ -94,17 +95,15 @@ extern struct timespec wall_to_monotonic;
94extern seqlock_t xtime_lock __attribute__((weak)); 95extern seqlock_t xtime_lock __attribute__((weak));
95 96
96extern unsigned long read_persistent_clock(void); 97extern unsigned long read_persistent_clock(void);
98extern int update_persistent_clock(struct timespec now);
99extern int no_sync_cmos_clock __read_mostly;
97void timekeeping_init(void); 100void timekeeping_init(void);
98 101
99static inline unsigned long get_seconds(void) 102unsigned long get_seconds(void);
100{
101 return xtime.tv_sec;
102}
103
104struct timespec current_kernel_time(void); 103struct timespec current_kernel_time(void);
105 104
106#define CURRENT_TIME (current_kernel_time()) 105#define CURRENT_TIME (current_kernel_time())
107#define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 }) 106#define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 })
108 107
109extern void do_gettimeofday(struct timeval *tv); 108extern void do_gettimeofday(struct timeval *tv);
110extern int do_settimeofday(struct timespec *tv); 109extern int do_settimeofday(struct timespec *tv);
diff --git a/include/linux/timex.h b/include/linux/timex.h
index da929dbbea2a..37ac3ff90faf 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -224,66 +224,6 @@ static inline int ntp_synced(void)
224 __x < 0 ? -(-__x >> __s) : __x >> __s; \ 224 __x < 0 ? -(-__x >> __s) : __x >> __s; \
225}) 225})
226 226
227
228#ifdef CONFIG_TIME_INTERPOLATION
229
230#define TIME_SOURCE_CPU 0
231#define TIME_SOURCE_MMIO64 1
232#define TIME_SOURCE_MMIO32 2
233#define TIME_SOURCE_FUNCTION 3
234
235/* For proper operations time_interpolator clocks must run slightly slower
236 * than the standard clock since the interpolator may only correct by having
237 * time jump forward during a tick. A slower clock is usually a side effect
238 * of the integer divide of the nanoseconds in a second by the frequency.
239 * The accuracy of the division can be increased by specifying a shift.
240 * However, this may cause the clock not to be slow enough.
241 * The interpolator will self-tune the clock by slowing down if no
242 * resets occur or speeding up if the time jumps per analysis cycle
243 * become too high.
244 *
245 * Setting jitter compensates for a fluctuating timesource by comparing
246 * to the last value read from the timesource to insure that an earlier value
247 * is not returned by a later call. The price to pay
248 * for the compensation is that the timer routines are not as scalable anymore.
249 */
250
251struct time_interpolator {
252 u16 source; /* time source flags */
253 u8 shift; /* increases accuracy of multiply by shifting. */
254 /* Note that bits may be lost if shift is set too high */
255 u8 jitter; /* if set compensate for fluctuations */
256 u32 nsec_per_cyc; /* set by register_time_interpolator() */
257 void *addr; /* address of counter or function */
258 cycles_t mask; /* mask the valid bits of the counter */
259 unsigned long offset; /* nsec offset at last update of interpolator */
260 u64 last_counter; /* counter value in units of the counter at last update */
261 cycles_t last_cycle; /* Last timer value if TIME_SOURCE_JITTER is set */
262 u64 frequency; /* frequency in counts/second */
263 long drift; /* drift in parts-per-million (or -1) */
264 unsigned long skips; /* skips forward */
265 unsigned long ns_skipped; /* nanoseconds skipped */
266 struct time_interpolator *next;
267};
268
269extern void register_time_interpolator(struct time_interpolator *);
270extern void unregister_time_interpolator(struct time_interpolator *);
271extern void time_interpolator_reset(void);
272extern unsigned long time_interpolator_get_offset(void);
273extern void time_interpolator_update(long delta_nsec);
274
275#else /* !CONFIG_TIME_INTERPOLATION */
276
277static inline void time_interpolator_reset(void)
278{
279}
280
281static inline void time_interpolator_update(long delta_nsec)
282{
283}
284
285#endif /* !CONFIG_TIME_INTERPOLATION */
286
287#define TICK_LENGTH_SHIFT 32 227#define TICK_LENGTH_SHIFT 32
288 228
289#ifdef CONFIG_NO_HZ 229#ifdef CONFIG_NO_HZ
diff --git a/include/linux/topology.h b/include/linux/topology.h
index d0890a7e5bab..525d437b1253 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -185,7 +185,6 @@
185 .max_interval = 64*num_online_cpus(), \ 185 .max_interval = 64*num_online_cpus(), \
186 .busy_factor = 128, \ 186 .busy_factor = 128, \
187 .imbalance_pct = 133, \ 187 .imbalance_pct = 133, \
188 .cache_hot_time = (10*1000000), \
189 .cache_nice_tries = 1, \ 188 .cache_nice_tries = 1, \
190 .busy_idx = 3, \ 189 .busy_idx = 3, \
191 .idle_idx = 3, \ 190 .idle_idx = 3, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 691a1748d9d2..6570719eafdf 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -274,6 +274,8 @@ struct tty_struct {
274#define TTY_PTY_LOCK 16 /* pty private */ 274#define TTY_PTY_LOCK 16 /* pty private */
275#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 275#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
276#define TTY_HUPPED 18 /* Post driver->hangup() */ 276#define TTY_HUPPED 18 /* Post driver->hangup() */
277#define TTY_FLUSHING 19 /* Flushing to ldisc in progress */
278#define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */
277 279
278#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) 280#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
279 281
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
new file mode 100644
index 000000000000..44c28e94df50
--- /dev/null
+++ b/include/linux/uio_driver.h
@@ -0,0 +1,91 @@
1/*
2 * include/linux/uio_driver.h
3 *
4 * Copyright(C) 2005, Benedikt Spranger <b.spranger@linutronix.de>
5 * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de>
6 * Copyright(C) 2006, Hans J. Koch <hjk@linutronix.de>
7 * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com>
8 *
9 * Userspace IO driver.
10 *
11 * Licensed under the GPLv2 only.
12 */
13
14#ifndef _UIO_DRIVER_H_
15#define _UIO_DRIVER_H_
16
17#include <linux/module.h>
18#include <linux/fs.h>
19#include <linux/interrupt.h>
20
21/**
22 * struct uio_mem - description of a UIO memory region
23 * @kobj: kobject for this mapping
24 * @addr: address of the device's memory
25 * @size: size of IO
26 * @memtype: type of memory addr points to
27 * @internal_addr: ioremap-ped version of addr, for driver internal use
28 */
29struct uio_mem {
30 struct kobject kobj;
31 unsigned long addr;
32 unsigned long size;
33 int memtype;
34 void __iomem *internal_addr;
35};
36
37#define MAX_UIO_MAPS 5
38
39struct uio_device;
40
41/**
42 * struct uio_info - UIO device capabilities
43 * @uio_dev: the UIO device this info belongs to
44 * @name: device name
45 * @version: device driver version
46 * @mem: list of mappable memory regions, size==0 for end of list
47 * @irq: interrupt number or UIO_IRQ_CUSTOM
48 * @irq_flags: flags for request_irq()
49 * @priv: optional private data
50 * @handler: the device's irq handler
51 * @mmap: mmap operation for this uio device
52 * @open: open operation for this uio device
53 * @release: release operation for this uio device
54 */
55struct uio_info {
56 struct uio_device *uio_dev;
57 char *name;
58 char *version;
59 struct uio_mem mem[MAX_UIO_MAPS];
60 long irq;
61 unsigned long irq_flags;
62 void *priv;
63 irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
64 int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
65 int (*open)(struct uio_info *info, struct inode *inode);
66 int (*release)(struct uio_info *info, struct inode *inode);
67};
68
69extern int __must_check
70 __uio_register_device(struct module *owner,
71 struct device *parent,
72 struct uio_info *info);
73static inline int __must_check
74 uio_register_device(struct device *parent, struct uio_info *info)
75{
76 return __uio_register_device(THIS_MODULE, parent, info);
77}
78extern void uio_unregister_device(struct uio_info *info);
79extern void uio_event_notify(struct uio_info *info);
80
81/* defines for uio_device->irq */
82#define UIO_IRQ_CUSTOM -1
83#define UIO_IRQ_NONE -2
84
85/* defines for uio_device->memtype */
86#define UIO_MEM_NONE 0
87#define UIO_MEM_PHYS 1
88#define UIO_MEM_LOGICAL 2
89#define UIO_MEM_VIRTUAL 3
90
91#endif /* _LINUX_UIO_DRIVER_H_ */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 7a60946df3b6..4f33a58fa9d1 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -94,6 +94,7 @@ enum usb_interface_condition {
94 * endpoint configurations. They will be in no particular order. 94 * endpoint configurations. They will be in no particular order.
95 * @num_altsetting: number of altsettings defined. 95 * @num_altsetting: number of altsettings defined.
96 * @cur_altsetting: the current altsetting. 96 * @cur_altsetting: the current altsetting.
97 * @intf_assoc: interface association descriptor
97 * @driver: the USB driver that is bound to this interface. 98 * @driver: the USB driver that is bound to this interface.
98 * @minor: the minor number assigned to this interface, if this 99 * @minor: the minor number assigned to this interface, if this
99 * interface is bound to a driver that uses the USB major number. 100 * interface is bound to a driver that uses the USB major number.
@@ -213,6 +214,7 @@ struct usb_interface_cache {
213 * @desc: the device's configuration descriptor. 214 * @desc: the device's configuration descriptor.
214 * @string: pointer to the cached version of the iConfiguration string, if 215 * @string: pointer to the cached version of the iConfiguration string, if
215 * present for this configuration. 216 * present for this configuration.
217 * @intf_assoc: list of any interface association descriptors in this config
216 * @interface: array of pointers to usb_interface structures, one for each 218 * @interface: array of pointers to usb_interface structures, one for each
217 * interface in the configuration. The number of interfaces is stored 219 * interface in the configuration. The number of interfaces is stored
218 * in desc.bNumInterfaces. These pointers are valid only while the 220 * in desc.bNumInterfaces. These pointers are valid only while the
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index bb320573bb9e..1101b0ce878f 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -49,7 +49,7 @@ static inline struct user_namespace *copy_user_ns(int flags,
49 if (flags & CLONE_NEWUSER) 49 if (flags & CLONE_NEWUSER)
50 return ERR_PTR(-EINVAL); 50 return ERR_PTR(-EINVAL);
51 51
52 return NULL; 52 return old_ns;
53} 53}
54 54
55static inline void put_user_ns(struct user_namespace *ns) 55static inline void put_user_ns(struct user_namespace *ns)
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index d16a2b57dc81..ae9b24c12f6a 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -60,6 +60,7 @@
60#include <linux/compiler.h> /* need __user */ 60#include <linux/compiler.h> /* need __user */
61#else 61#else
62#define __user 62#define __user
63#include <sys/time.h>
63#endif 64#endif
64#include <linux/types.h> 65#include <linux/types.h>
65 66
@@ -616,7 +617,6 @@ struct v4l2_framebuffer
616#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 617#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
617#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 618#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
618#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 619#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
619#define V4L2_FBUF_CAP_GLOBAL_INV_ALPHA 0x0080
620/* Flags for the 'flags' field. */ 620/* Flags for the 'flags' field. */
621#define V4L2_FBUF_FLAG_PRIMARY 0x0001 621#define V4L2_FBUF_FLAG_PRIMARY 0x0001
622#define V4L2_FBUF_FLAG_OVERLAY 0x0002 622#define V4L2_FBUF_FLAG_OVERLAY 0x0002
@@ -624,7 +624,6 @@ struct v4l2_framebuffer
624#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 624#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
625#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 625#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
626#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 626#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
627#define V4L2_FBUF_FLAG_GLOBAL_INV_ALPHA 0x0040
628 627
629struct v4l2_clip 628struct v4l2_clip
630{ 629{
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 132b260aef1e..89338b468d0d 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -58,6 +58,13 @@ void vmalloc_sync_all(void);
58/* 58/*
59 * Lowlevel-APIs (not for driver use!) 59 * Lowlevel-APIs (not for driver use!)
60 */ 60 */
61
62static inline size_t get_vm_area_size(const struct vm_struct *area)
63{
64 /* return actual size without guard page */
65 return area->size - PAGE_SIZE;
66}
67
61extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); 68extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
62extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 69extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
63 unsigned long start, unsigned long end); 70 unsigned long start, unsigned long end);
@@ -70,6 +77,10 @@ extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
70 struct page ***pages); 77 struct page ***pages);
71extern void unmap_kernel_range(unsigned long addr, unsigned long size); 78extern void unmap_kernel_range(unsigned long addr, unsigned long size);
72 79
80/* Allocate/destroy a 'vmalloc' VM area. */
81extern struct vm_struct *alloc_vm_area(size_t size);
82extern void free_vm_area(struct vm_struct *area);
83
73/* 84/*
74 * Internals. Dont't use.. 85 * Internals. Dont't use..
75 */ 86 */