diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-07-23 05:20:10 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-07-23 05:20:10 -0400 |
commit | 39fe5434cb9de5da40510028b17b96bc4eb312b3 (patch) | |
tree | 7a02a317b9ad57da51ca99887c119e779ccf3f13 /include/linux | |
parent | 0fc72b81d3111d114ab378935b1cf07680ca1289 (diff) | |
parent | f695baf2df9e0413d3521661070103711545207a (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux')
237 files changed, 3653 insertions, 1532 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index afae306b177c..bcf875e844fe 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -91,7 +91,6 @@ header-y += in6.h | |||
91 | header-y += in_route.h | 91 | header-y += in_route.h |
92 | header-y += ioctl.h | 92 | header-y += ioctl.h |
93 | header-y += ipmi_msgdefs.h | 93 | header-y += ipmi_msgdefs.h |
94 | header-y += ip_mp_alg.h | ||
95 | header-y += ipsec.h | 94 | header-y += ipsec.h |
96 | header-y += ipx.h | 95 | header-y += ipx.h |
97 | header-y += irda.h | 96 | header-y += irda.h |
@@ -226,6 +225,7 @@ unifdef-y += if_fddi.h | |||
226 | unifdef-y += if_frad.h | 225 | unifdef-y += if_frad.h |
227 | unifdef-y += if_ltalk.h | 226 | unifdef-y += if_ltalk.h |
228 | unifdef-y += if_link.h | 227 | unifdef-y += if_link.h |
228 | unifdef-y += if_pppol2tp.h | ||
229 | unifdef-y += if_pppox.h | 229 | unifdef-y += if_pppox.h |
230 | unifdef-y += if_shaper.h | 230 | unifdef-y += if_shaper.h |
231 | unifdef-y += if_tr.h | 231 | unifdef-y += if_tr.h |
@@ -247,7 +247,6 @@ unifdef-y += isdn.h | |||
247 | unifdef-y += isdnif.h | 247 | unifdef-y += isdnif.h |
248 | unifdef-y += isdn_divertif.h | 248 | unifdef-y += isdn_divertif.h |
249 | unifdef-y += isdn_ppp.h | 249 | unifdef-y += isdn_ppp.h |
250 | unifdef-y += isicom.h | ||
251 | unifdef-y += jbd.h | 250 | unifdef-y += jbd.h |
252 | unifdef-y += joystick.h | 251 | unifdef-y += joystick.h |
253 | unifdef-y += kdev_t.h | 252 | unifdef-y += kdev_t.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index fccd8b548d93..d5680cd7746a 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -88,10 +88,8 @@ int acpi_table_parse (char *id, acpi_table_handler handler); | |||
88 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, | 88 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, |
89 | int entry_id, acpi_table_entry_handler handler, unsigned int max_entries); | 89 | int entry_id, acpi_table_entry_handler handler, unsigned int max_entries); |
90 | int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries); | 90 | int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries); |
91 | int acpi_table_parse_srat (enum acpi_srat_type id, acpi_table_entry_handler handler, unsigned int max_entries); | ||
92 | int acpi_parse_mcfg (struct acpi_table_header *header); | 91 | int acpi_parse_mcfg (struct acpi_table_header *header); |
93 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); | 92 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); |
94 | void acpi_table_print_srat_entry (struct acpi_subtable_header *srat); | ||
95 | 93 | ||
96 | /* the following four functions are architecture-dependent */ | 94 | /* the following four functions are architecture-dependent */ |
97 | #ifdef CONFIG_HAVE_ARCH_PARSE_SRAT | 95 | #ifdef CONFIG_HAVE_ARCH_PARSE_SRAT |
@@ -122,7 +120,7 @@ extern struct acpi_mcfg_allocation *pci_mmcfg_config; | |||
122 | extern int pci_mmcfg_config_num; | 120 | extern int pci_mmcfg_config_num; |
123 | 121 | ||
124 | extern int sbf_port; | 122 | extern int sbf_port; |
125 | extern unsigned long acpi_video_flags; | 123 | extern unsigned long acpi_realmode_flags; |
126 | 124 | ||
127 | #else /* !CONFIG_ACPI */ | 125 | #else /* !CONFIG_ACPI */ |
128 | 126 | ||
@@ -233,6 +231,9 @@ extern int acpi_paddr_to_node(u64 start_addr, u64 size); | |||
233 | 231 | ||
234 | extern int pnpacpi_disabled; | 232 | extern int pnpacpi_disabled; |
235 | 233 | ||
234 | #define PXM_INVAL (-1) | ||
235 | #define NID_INVAL (-1) | ||
236 | |||
236 | #else /* CONFIG_ACPI */ | 237 | #else /* CONFIG_ACPI */ |
237 | 238 | ||
238 | static inline int acpi_boot_init(void) | 239 | static inline int acpi_boot_init(void) |
diff --git a/include/linux/aer.h b/include/linux/aer.h index 402e178b38eb..509656286e53 100644 --- a/include/linux/aer.h +++ b/include/linux/aer.h | |||
@@ -13,11 +13,13 @@ extern int pci_enable_pcie_error_reporting(struct pci_dev *dev); | |||
13 | extern int pci_find_aer_capability(struct pci_dev *dev); | 13 | extern int pci_find_aer_capability(struct pci_dev *dev); |
14 | extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); | 14 | extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); |
15 | extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); | 15 | extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); |
16 | extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev); | ||
16 | #else | 17 | #else |
17 | #define pci_enable_pcie_error_reporting(dev) do { } while (0) | 18 | #define pci_enable_pcie_error_reporting(dev) (-EINVAL) |
18 | #define pci_find_aer_capability(dev) do { } while (0) | 19 | #define pci_find_aer_capability(dev) (0) |
19 | #define pci_disable_pcie_error_reporting(dev) do { } while (0) | 20 | #define pci_disable_pcie_error_reporting(dev) (-EINVAL) |
20 | #define pci_cleanup_aer_uncorrect_error_status(dev) do { } while (0) | 21 | #define pci_cleanup_aer_uncorrect_error_status(dev) (-EINVAL) |
22 | #define pci_cleanup_aer_correct_error_status(dev) (-EINVAL) | ||
21 | #endif | 23 | #endif |
22 | 24 | ||
23 | #endif //_AER_H_ | 25 | #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 | */ |
87 | struct kiocb { | 87 | struct 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/async_tx.h b/include/linux/async_tx.h new file mode 100644 index 000000000000..bdca3f1b3213 --- /dev/null +++ b/include/linux/async_tx.h | |||
@@ -0,0 +1,150 @@ | |||
1 | /* | ||
2 | * Copyright © 2006, Intel Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
16 | * | ||
17 | */ | ||
18 | #ifndef _ASYNC_TX_H_ | ||
19 | #define _ASYNC_TX_H_ | ||
20 | #include <linux/dmaengine.h> | ||
21 | #include <linux/spinlock.h> | ||
22 | #include <linux/interrupt.h> | ||
23 | |||
24 | /** | ||
25 | * dma_chan_ref - object used to manage dma channels received from the | ||
26 | * dmaengine core. | ||
27 | * @chan - the channel being tracked | ||
28 | * @node - node for the channel to be placed on async_tx_master_list | ||
29 | * @rcu - for list_del_rcu | ||
30 | * @count - number of times this channel is listed in the pool | ||
31 | * (for channels with multiple capabiities) | ||
32 | */ | ||
33 | struct dma_chan_ref { | ||
34 | struct dma_chan *chan; | ||
35 | struct list_head node; | ||
36 | struct rcu_head rcu; | ||
37 | atomic_t count; | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * async_tx_flags - modifiers for the async_* calls | ||
42 | * @ASYNC_TX_XOR_ZERO_DST: this flag must be used for xor operations where the | ||
43 | * the destination address is not a source. The asynchronous case handles this | ||
44 | * implicitly, the synchronous case needs to zero the destination block. | ||
45 | * @ASYNC_TX_XOR_DROP_DST: this flag must be used if the destination address is | ||
46 | * also one of the source addresses. In the synchronous case the destination | ||
47 | * address is an implied source, whereas the asynchronous case it must be listed | ||
48 | * as a source. The destination address must be the first address in the source | ||
49 | * array. | ||
50 | * @ASYNC_TX_ASSUME_COHERENT: skip cache maintenance operations | ||
51 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a | ||
52 | * dependency chain | ||
53 | * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. | ||
54 | */ | ||
55 | enum async_tx_flags { | ||
56 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), | ||
57 | ASYNC_TX_XOR_DROP_DST = (1 << 1), | ||
58 | ASYNC_TX_ASSUME_COHERENT = (1 << 2), | ||
59 | ASYNC_TX_ACK = (1 << 3), | ||
60 | ASYNC_TX_DEP_ACK = (1 << 4), | ||
61 | }; | ||
62 | |||
63 | #ifdef CONFIG_DMA_ENGINE | ||
64 | void async_tx_issue_pending_all(void); | ||
65 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | ||
66 | void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx); | ||
67 | struct dma_chan * | ||
68 | async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | ||
69 | enum dma_transaction_type tx_type); | ||
70 | #else | ||
71 | static inline void async_tx_issue_pending_all(void) | ||
72 | { | ||
73 | do { } while (0); | ||
74 | } | ||
75 | |||
76 | static inline enum dma_status | ||
77 | dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) | ||
78 | { | ||
79 | return DMA_SUCCESS; | ||
80 | } | ||
81 | |||
82 | static inline void | ||
83 | async_tx_run_dependencies(struct dma_async_tx_descriptor *tx, | ||
84 | struct dma_chan *host_chan) | ||
85 | { | ||
86 | do { } while (0); | ||
87 | } | ||
88 | |||
89 | static inline struct dma_chan * | ||
90 | async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | ||
91 | enum dma_transaction_type tx_type) | ||
92 | { | ||
93 | return NULL; | ||
94 | } | ||
95 | #endif | ||
96 | |||
97 | /** | ||
98 | * async_tx_sync_epilog - actions to take if an operation is run synchronously | ||
99 | * @flags: async_tx flags | ||
100 | * @depend_tx: transaction depends on depend_tx | ||
101 | * @cb_fn: function to call when the transaction completes | ||
102 | * @cb_fn_param: parameter to pass to the callback routine | ||
103 | */ | ||
104 | static inline void | ||
105 | async_tx_sync_epilog(unsigned long flags, | ||
106 | struct dma_async_tx_descriptor *depend_tx, | ||
107 | dma_async_tx_callback cb_fn, void *cb_fn_param) | ||
108 | { | ||
109 | if (cb_fn) | ||
110 | cb_fn(cb_fn_param); | ||
111 | |||
112 | if (depend_tx && (flags & ASYNC_TX_DEP_ACK)) | ||
113 | async_tx_ack(depend_tx); | ||
114 | } | ||
115 | |||
116 | void | ||
117 | async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx, | ||
118 | enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx, | ||
119 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
120 | |||
121 | struct dma_async_tx_descriptor * | ||
122 | async_xor(struct page *dest, struct page **src_list, unsigned int offset, | ||
123 | int src_cnt, size_t len, enum async_tx_flags flags, | ||
124 | struct dma_async_tx_descriptor *depend_tx, | ||
125 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
126 | |||
127 | struct dma_async_tx_descriptor * | ||
128 | async_xor_zero_sum(struct page *dest, struct page **src_list, | ||
129 | unsigned int offset, int src_cnt, size_t len, | ||
130 | u32 *result, enum async_tx_flags flags, | ||
131 | struct dma_async_tx_descriptor *depend_tx, | ||
132 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
133 | |||
134 | struct dma_async_tx_descriptor * | ||
135 | async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset, | ||
136 | unsigned int src_offset, size_t len, enum async_tx_flags flags, | ||
137 | struct dma_async_tx_descriptor *depend_tx, | ||
138 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
139 | |||
140 | struct dma_async_tx_descriptor * | ||
141 | async_memset(struct page *dest, int val, unsigned int offset, | ||
142 | size_t len, enum async_tx_flags flags, | ||
143 | struct dma_async_tx_descriptor *depend_tx, | ||
144 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
145 | |||
146 | struct dma_async_tx_descriptor * | ||
147 | async_trigger_callback(enum async_tx_flags flags, | ||
148 | struct dma_async_tx_descriptor *depend_tx, | ||
149 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
150 | #endif /* _ASYNC_TX_H_ */ | ||
diff --git a/include/linux/ata.h b/include/linux/ata.h index 407dc7e098bc..23a22df039d8 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -64,6 +64,15 @@ 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 | |||
67 | ATA_UDMA0 = (1 << 0), | 76 | ATA_UDMA0 = (1 << 0), |
68 | ATA_UDMA1 = ATA_UDMA0 | (1 << 1), | 77 | ATA_UDMA1 = ATA_UDMA0 | (1 << 1), |
69 | ATA_UDMA2 = ATA_UDMA1 | (1 << 2), | 78 | ATA_UDMA2 = ATA_UDMA1 | (1 << 2), |
@@ -164,6 +173,8 @@ enum { | |||
164 | ATA_CMD_SET_MAX = 0xF9, | 173 | ATA_CMD_SET_MAX = 0xF9, |
165 | ATA_CMD_SET_MAX_EXT = 0x37, | 174 | ATA_CMD_SET_MAX_EXT = 0x37, |
166 | ATA_CMD_READ_LOG_EXT = 0x2f, | 175 | ATA_CMD_READ_LOG_EXT = 0x2f, |
176 | ATA_CMD_PMP_READ = 0xE4, | ||
177 | ATA_CMD_PMP_WRITE = 0xE8, | ||
167 | 178 | ||
168 | /* READ_LOG_EXT pages */ | 179 | /* READ_LOG_EXT pages */ |
169 | ATA_LOG_SATA_NCQ = 0x10, | 180 | ATA_LOG_SATA_NCQ = 0x10, |
@@ -212,6 +223,28 @@ enum { | |||
212 | 0=to device, 1=to host */ | 223 | 0=to device, 1=to host */ |
213 | ATAPI_CDB_LEN = 16, | 224 | ATAPI_CDB_LEN = 16, |
214 | 225 | ||
226 | /* PMP stuff */ | ||
227 | SATA_PMP_MAX_PORTS = 15, | ||
228 | SATA_PMP_CTRL_PORT = 15, | ||
229 | |||
230 | SATA_PMP_GSCR_DWORDS = 128, | ||
231 | SATA_PMP_GSCR_PROD_ID = 0, | ||
232 | SATA_PMP_GSCR_REV = 1, | ||
233 | SATA_PMP_GSCR_PORT_INFO = 2, | ||
234 | SATA_PMP_GSCR_ERROR = 32, | ||
235 | SATA_PMP_GSCR_ERROR_EN = 33, | ||
236 | SATA_PMP_GSCR_FEAT = 64, | ||
237 | SATA_PMP_GSCR_FEAT_EN = 96, | ||
238 | |||
239 | SATA_PMP_PSCR_STATUS = 0, | ||
240 | SATA_PMP_PSCR_ERROR = 1, | ||
241 | SATA_PMP_PSCR_CONTROL = 2, | ||
242 | |||
243 | SATA_PMP_FEAT_BIST = (1 << 0), | ||
244 | SATA_PMP_FEAT_PMREQ = (1 << 1), | ||
245 | SATA_PMP_FEAT_DYNSSC = (1 << 2), | ||
246 | SATA_PMP_FEAT_NOTIFY = (1 << 3), | ||
247 | |||
215 | /* cable types */ | 248 | /* cable types */ |
216 | ATA_CBL_NONE = 0, | 249 | ATA_CBL_NONE = 0, |
217 | ATA_CBL_PATA40 = 1, | 250 | ATA_CBL_PATA40 = 1, |
@@ -418,4 +451,9 @@ static inline int lba_48_ok(u64 block, u32 n_block) | |||
418 | return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536); | 451 | return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536); |
419 | } | 452 | } |
420 | 453 | ||
454 | #define sata_pmp_gscr_vendor(gscr) ((gscr)[SATA_PMP_GSCR_PROD_ID] & 0xffff) | ||
455 | #define sata_pmp_gscr_devid(gscr) ((gscr)[SATA_PMP_GSCR_PROD_ID] >> 16) | ||
456 | #define sata_pmp_gscr_rev(gscr) (((gscr)[SATA_PMP_GSCR_REV] >> 8) & 0xff) | ||
457 | #define sata_pmp_gscr_ports(gscr) ((gscr)[SATA_PMP_GSCR_PORT_INFO] & 0xf) | ||
458 | |||
421 | #endif /* __LINUX_ATA_H__ */ | 459 | #endif /* __LINUX_ATA_H__ */ |
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h index 93bfb0beb62a..8ff274933948 100644 --- a/include/linux/attribute_container.h +++ b/include/linux/attribute_container.h | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/klist.h> | 14 | #include <linux/klist.h> |
15 | #include <linux/spinlock.h> | ||
16 | 15 | ||
17 | struct attribute_container { | 16 | struct attribute_container { |
18 | struct list_head node; | 17 | struct list_head node; |
diff --git a/include/linux/audit.h b/include/linux/audit.h index fccc6e50298a..4bbd8601b8f0 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -63,9 +63,12 @@ | |||
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 */ | ||
67 | #define AUDIT_TTY_SET 1015 /* Set TTY auditing status */ | ||
66 | 68 | ||
67 | #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 */ |
68 | #define AUDIT_USER_AVC 1107 /* We filter this differently */ | 70 | #define AUDIT_USER_AVC 1107 /* We filter this differently */ |
71 | #define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */ | ||
69 | #define AUDIT_LAST_USER_MSG 1199 | 72 | #define AUDIT_LAST_USER_MSG 1199 |
70 | #define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */ | 73 | #define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */ |
71 | #define AUDIT_LAST_USER_MSG2 2999 | 74 | #define AUDIT_LAST_USER_MSG2 2999 |
@@ -92,6 +95,7 @@ | |||
92 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ | 95 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ |
93 | #define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ | 96 | #define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ |
94 | #define AUDIT_OBJ_PID 1318 /* ptrace target */ | 97 | #define AUDIT_OBJ_PID 1318 /* ptrace target */ |
98 | #define AUDIT_TTY 1319 /* Input on an administrative TTY */ | ||
95 | 99 | ||
96 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 100 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
97 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 101 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
@@ -157,7 +161,7 @@ | |||
157 | * 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. |
158 | * 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 |
159 | * AUDIT_UNUSED_BITS is updated if need be. */ | 163 | * AUDIT_UNUSED_BITS is updated if need be. */ |
160 | #define AUDIT_UNUSED_BITS 0x0FFFFC00 | 164 | #define AUDIT_UNUSED_BITS 0x07FFFC00 |
161 | 165 | ||
162 | 166 | ||
163 | /* Rule fields */ | 167 | /* Rule fields */ |
@@ -209,25 +213,29 @@ | |||
209 | #define AUDIT_NEGATE 0x80000000 | 213 | #define AUDIT_NEGATE 0x80000000 |
210 | 214 | ||
211 | /* These are the supported operators. | 215 | /* These are the supported operators. |
212 | * 4 2 1 | 216 | * 4 2 1 8 |
213 | * = > < | 217 | * = > < ? |
214 | * ------- | 218 | * ---------- |
215 | * 0 0 0 0 nonsense | 219 | * 0 0 0 0 00 nonsense |
216 | * 0 0 1 1 < | 220 | * 0 0 0 1 08 & bit mask |
217 | * 0 1 0 2 > | 221 | * 0 0 1 0 10 < |
218 | * 0 1 1 3 != | 222 | * 0 1 0 0 20 > |
219 | * 1 0 0 4 = | 223 | * 0 1 1 0 30 != |
220 | * 1 0 1 5 <= | 224 | * 1 0 0 0 40 = |
221 | * 1 1 0 6 >= | 225 | * 1 0 0 1 48 &= bit test |
222 | * 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 | ||
223 | */ | 229 | */ |
230 | #define AUDIT_BIT_MASK 0x08000000 | ||
224 | #define AUDIT_LESS_THAN 0x10000000 | 231 | #define AUDIT_LESS_THAN 0x10000000 |
225 | #define AUDIT_GREATER_THAN 0x20000000 | 232 | #define AUDIT_GREATER_THAN 0x20000000 |
226 | #define AUDIT_NOT_EQUAL 0x30000000 | 233 | #define AUDIT_NOT_EQUAL 0x30000000 |
227 | #define AUDIT_EQUAL 0x40000000 | 234 | #define AUDIT_EQUAL 0x40000000 |
235 | #define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL) | ||
228 | #define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL) | 236 | #define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL) |
229 | #define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) | 237 | #define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) |
230 | #define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL) | 238 | #define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK) |
231 | 239 | ||
232 | /* Status symbols */ | 240 | /* Status symbols */ |
233 | /* Mask values */ | 241 | /* Mask values */ |
@@ -289,6 +297,10 @@ struct audit_status { | |||
289 | __u32 backlog; /* messages waiting in queue */ | 297 | __u32 backlog; /* messages waiting in queue */ |
290 | }; | 298 | }; |
291 | 299 | ||
300 | struct audit_tty_status { | ||
301 | __u32 enabled; /* 1 = enabled, 0 = disabled */ | ||
302 | }; | ||
303 | |||
292 | /* audit_rule_data supports filter rules with both integer and string | 304 | /* audit_rule_data supports filter rules with both integer and string |
293 | * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and | 305 | * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and |
294 | * AUDIT_LIST_RULES requests. | 306 | * AUDIT_LIST_RULES requests. |
@@ -399,7 +411,6 @@ extern int audit_bprm(struct linux_binprm *bprm); | |||
399 | extern int audit_socketcall(int nargs, unsigned long *args); | 411 | extern int audit_socketcall(int nargs, unsigned long *args); |
400 | extern int audit_sockaddr(int len, void *addr); | 412 | extern int audit_sockaddr(int len, void *addr); |
401 | extern int __audit_fd_pair(int fd1, int fd2); | 413 | extern int __audit_fd_pair(int fd1, int fd2); |
402 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | ||
403 | extern int audit_set_macxattr(const char *name); | 414 | extern int audit_set_macxattr(const char *name); |
404 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); | 415 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); |
405 | extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout); | 416 | extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout); |
@@ -479,7 +490,6 @@ extern int audit_signals; | |||
479 | #define audit_socketcall(n,a) ({ 0; }) | 490 | #define audit_socketcall(n,a) ({ 0; }) |
480 | #define audit_fd_pair(n,a) ({ 0; }) | 491 | #define audit_fd_pair(n,a) ({ 0; }) |
481 | #define audit_sockaddr(len, addr) ({ 0; }) | 492 | #define audit_sockaddr(len, addr) ({ 0; }) |
482 | #define audit_avc_path(dentry, mnt) ({ 0; }) | ||
483 | #define audit_set_macxattr(n) do { ; } while (0) | 493 | #define audit_set_macxattr(n) do { ; } while (0) |
484 | #define audit_mq_open(o,m,a) ({ 0; }) | 494 | #define audit_mq_open(o,m,a) ({ 0; }) |
485 | #define audit_mq_timedsend(d,l,p,t) ({ 0; }) | 495 | #define audit_mq_timedsend(d,l,p,t) ({ 0; }) |
@@ -515,11 +525,13 @@ extern void audit_log_d_path(struct audit_buffer *ab, | |||
515 | const char *prefix, | 525 | const char *prefix, |
516 | struct dentry *dentry, | 526 | struct dentry *dentry, |
517 | struct vfsmount *vfsmnt); | 527 | struct vfsmount *vfsmnt); |
528 | extern void audit_log_lost(const char *message); | ||
518 | /* Private API (for audit.c only) */ | 529 | /* Private API (for audit.c only) */ |
519 | extern int audit_filter_user(struct netlink_skb_parms *cb, int type); | 530 | extern int audit_filter_user(struct netlink_skb_parms *cb, int type); |
520 | extern int audit_filter_type(int type); | 531 | extern int audit_filter_type(int type); |
521 | extern int audit_receive_filter(int type, int pid, int uid, int seq, | 532 | extern int audit_receive_filter(int type, int pid, int uid, int seq, |
522 | void *data, size_t datasz, uid_t loginuid, u32 sid); | 533 | void *data, size_t datasz, uid_t loginuid, u32 sid); |
534 | extern int audit_enabled; | ||
523 | #else | 535 | #else |
524 | #define audit_log(c,g,t,f,...) do { ; } while (0) | 536 | #define audit_log(c,g,t,f,...) do { ; } while (0) |
525 | #define audit_log_start(c,g,t) ({ NULL; }) | 537 | #define audit_log_start(c,g,t) ({ NULL; }) |
@@ -530,6 +542,7 @@ extern int audit_receive_filter(int type, int pid, int uid, int seq, | |||
530 | #define audit_log_untrustedstring(a,s) do { ; } while (0) | 542 | #define audit_log_untrustedstring(a,s) do { ; } while (0) |
531 | #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) | 543 | #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) |
532 | #define audit_log_d_path(b,p,d,v) do { ; } while (0) | 544 | #define audit_log_d_path(b,p,d,v) do { ; } while (0) |
545 | #define audit_enabled 0 | ||
533 | #endif | 546 | #endif |
534 | #endif | 547 | #endif |
535 | #endif | 548 | #endif |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index f2542c24b328..7011d6255593 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -93,7 +93,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) | |||
93 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); | 93 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); |
94 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); | 94 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); |
95 | long congestion_wait(int rw, long timeout); | 95 | long congestion_wait(int rw, long timeout); |
96 | long congestion_wait_interruptible(int rw, long timeout); | ||
97 | void congestion_end(int rw); | 96 | void congestion_end(int rw); |
98 | 97 | ||
99 | #define bdi_cap_writeback_dirty(bdi) \ | 98 | #define bdi_cap_writeback_dirty(bdi) \ |
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 | ||
76 | static inline void backlight_update_status(struct backlight_device *bd) | 76 | static 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); |
86 | extern void backlight_device_unregister(struct backlight_device *bd); | 86 | extern 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 | |||
90 | static 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 @@ | |||
6 | struct pt_regs; | 6 | struct 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 | */ |
25 | struct linux_binprm{ | 27 | struct 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 *); | |||
68 | extern int unregister_binfmt(struct linux_binfmt *); | 76 | extern int unregister_binfmt(struct linux_binfmt *); |
69 | 77 | ||
70 | extern int prepare_binprm(struct linux_binprm *); | 78 | extern int prepare_binprm(struct linux_binprm *); |
71 | extern void remove_arg_zero(struct linux_binprm *); | 79 | extern int __must_check remove_arg_zero(struct linux_binprm *); |
72 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); | 80 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); |
73 | extern int flush_old_exec(struct linux_binprm * bprm); | 81 | extern int flush_old_exec(struct linux_binprm * bprm); |
74 | 82 | ||
@@ -85,6 +93,7 @@ extern int suid_dumpable; | |||
85 | extern int setup_arg_pages(struct linux_binprm * bprm, | 93 | extern 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); |
96 | extern int bprm_mm_init(struct linux_binprm *bprm); | ||
88 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | 97 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); |
89 | extern void compute_creds(struct linux_binprm *binprm); | 98 | extern void compute_creds(struct linux_binprm *binprm); |
90 | extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); | 99 | extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index fae138bd2207..695e34964cb7 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/bio.h> | 14 | #include <linux/bio.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/stringify.h> | 16 | #include <linux/stringify.h> |
17 | #include <linux/bsg.h> | ||
17 | 18 | ||
18 | #include <asm/scatterlist.h> | 19 | #include <asm/scatterlist.h> |
19 | 20 | ||
@@ -41,6 +42,8 @@ struct elevator_queue; | |||
41 | typedef struct elevator_queue elevator_t; | 42 | typedef struct elevator_queue elevator_t; |
42 | struct request_pm_state; | 43 | struct request_pm_state; |
43 | struct blk_trace; | 44 | struct blk_trace; |
45 | struct request; | ||
46 | struct sg_io_hdr; | ||
44 | 47 | ||
45 | #define BLKDEV_MIN_RQ 4 | 48 | #define BLKDEV_MIN_RQ 4 |
46 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ | 49 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ |
@@ -314,6 +317,9 @@ struct request { | |||
314 | */ | 317 | */ |
315 | rq_end_io_fn *end_io; | 318 | rq_end_io_fn *end_io; |
316 | void *end_io_data; | 319 | void *end_io_data; |
320 | |||
321 | /* for bidi */ | ||
322 | struct request *next_rq; | ||
317 | }; | 323 | }; |
318 | 324 | ||
319 | /* | 325 | /* |
@@ -468,6 +474,10 @@ struct request_queue | |||
468 | unsigned int bi_size; | 474 | unsigned int bi_size; |
469 | 475 | ||
470 | struct mutex sysfs_lock; | 476 | struct mutex sysfs_lock; |
477 | |||
478 | #if defined(CONFIG_BLK_DEV_BSG) | ||
479 | struct bsg_class_device bsg_dev; | ||
480 | #endif | ||
471 | }; | 481 | }; |
472 | 482 | ||
473 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 483 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
@@ -479,6 +489,7 @@ struct request_queue | |||
479 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ | 489 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ |
480 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ | 490 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ |
481 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ | 491 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ |
492 | #define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ | ||
482 | 493 | ||
483 | enum { | 494 | enum { |
484 | /* | 495 | /* |
@@ -543,6 +554,7 @@ enum { | |||
543 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) | 554 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) |
544 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) | 555 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) |
545 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 556 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
557 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | ||
546 | 558 | ||
547 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) | 559 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) |
548 | 560 | ||
@@ -607,7 +619,12 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn; | |||
607 | #define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) | 619 | #define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) |
608 | #define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) | 620 | #define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) |
609 | 621 | ||
610 | #ifdef CONFIG_MMU | 622 | /* |
623 | * default timeout for SG_IO if none specified | ||
624 | */ | ||
625 | #define BLK_DEFAULT_SG_TIMEOUT (60 * HZ) | ||
626 | |||
627 | #ifdef CONFIG_BOUNCE | ||
611 | extern int init_emergency_isa_pool(void); | 628 | extern int init_emergency_isa_pool(void); |
612 | extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); | 629 | extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); |
613 | #else | 630 | #else |
@@ -637,7 +654,8 @@ extern void blk_requeue_request(request_queue_t *, struct request *); | |||
637 | extern void blk_plug_device(request_queue_t *); | 654 | extern void blk_plug_device(request_queue_t *); |
638 | extern int blk_remove_plug(request_queue_t *); | 655 | extern int blk_remove_plug(request_queue_t *); |
639 | extern void blk_recount_segments(request_queue_t *, struct bio *); | 656 | extern void blk_recount_segments(request_queue_t *, struct bio *); |
640 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); | 657 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, |
658 | struct gendisk *, unsigned int, void __user *); | ||
641 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, | 659 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, |
642 | struct gendisk *, struct scsi_ioctl_command __user *); | 660 | struct gendisk *, struct scsi_ioctl_command __user *); |
643 | 661 | ||
@@ -680,6 +698,7 @@ extern int blk_execute_rq(request_queue_t *, struct gendisk *, | |||
680 | struct request *, int); | 698 | struct request *, int); |
681 | extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, | 699 | extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, |
682 | struct request *, int, rq_end_io_fn *); | 700 | struct request *, int, rq_end_io_fn *); |
701 | extern int blk_verify_command(unsigned char *, int); | ||
683 | 702 | ||
684 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) | 703 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) |
685 | { | 704 | { |
diff --git a/include/linux/bsg.h b/include/linux/bsg.h new file mode 100644 index 000000000000..f415f89e0ac8 --- /dev/null +++ b/include/linux/bsg.h | |||
@@ -0,0 +1,69 @@ | |||
1 | #ifndef BSG_H | ||
2 | #define BSG_H | ||
3 | |||
4 | #define BSG_PROTOCOL_SCSI 0 | ||
5 | |||
6 | #define BSG_SUB_PROTOCOL_SCSI_CMD 0 | ||
7 | #define BSG_SUB_PROTOCOL_SCSI_TMF 1 | ||
8 | #define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2 | ||
9 | |||
10 | struct sg_io_v4 { | ||
11 | __s32 guard; /* [i] 'Q' to differentiate from v3 */ | ||
12 | __u32 protocol; /* [i] 0 -> SCSI , .... */ | ||
13 | __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task | ||
14 | management function, .... */ | ||
15 | |||
16 | __u32 request_len; /* [i] in bytes */ | ||
17 | __u64 request; /* [i], [*i] {SCSI: cdb} */ | ||
18 | __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} */ | ||
21 | __u32 max_response_len; /* [i] in bytes */ | ||
22 | __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */ | ||
23 | |||
24 | /* "din_" for data in (from device); "dout_" for data out (to device) */ | ||
25 | __u32 dout_xfer_len; /* [i] bytes to be transferred to device */ | ||
26 | __u32 din_xfer_len; /* [i] bytes to be transferred from device */ | ||
27 | __u64 dout_xferp; /* [i], [*i] */ | ||
28 | __u64 din_xferp; /* [i], [*o] */ | ||
29 | |||
30 | __u32 timeout; /* [i] units: millisecond */ | ||
31 | __u32 flags; /* [i] bit mask */ | ||
32 | __u64 usr_ptr; /* [i->o] unused internally */ | ||
33 | __u32 spare_in; /* [i] */ | ||
34 | |||
35 | __u32 driver_status; /* [o] 0 -> ok */ | ||
36 | __u32 transport_status; /* [o] 0 -> ok */ | ||
37 | __u32 device_status; /* [o] {SCSI: command completion status} */ | ||
38 | __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */ | ||
39 | __u32 info; /* [o] additional information */ | ||
40 | __u32 duration; /* [o] time to complete, in milliseconds */ | ||
41 | __u32 response_len; /* [o] bytes of response actually written */ | ||
42 | __s32 din_resid; /* [o] actual_din_xfer_len - din_xfer_len */ | ||
43 | __u32 generated_tag; /* [o] {SCSI: task tag that transport chose} */ | ||
44 | __u32 spare_out; /* [o] */ | ||
45 | |||
46 | __u32 padding; | ||
47 | }; | ||
48 | |||
49 | #ifdef __KERNEL__ | ||
50 | |||
51 | #if defined(CONFIG_BLK_DEV_BSG) | ||
52 | struct bsg_class_device { | ||
53 | struct class_device *class_dev; | ||
54 | struct device *dev; | ||
55 | int minor; | ||
56 | struct list_head list; | ||
57 | struct request_queue *queue; | ||
58 | }; | ||
59 | |||
60 | extern int bsg_register_queue(struct request_queue *, struct device *, const char *); | ||
61 | extern void bsg_unregister_queue(struct request_queue *); | ||
62 | #else | ||
63 | #define bsg_register_queue(disk, dev, name) (0) | ||
64 | #define bsg_unregister_queue(disk) do { } while (0) | ||
65 | #endif | ||
66 | |||
67 | #endif /* __KERNEL__ */ | ||
68 | |||
69 | #endif | ||
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*, | |||
209 | int generic_cont_expand(struct inode *inode, loff_t size); | 209 | int generic_cont_expand(struct inode *inode, loff_t size); |
210 | int generic_cont_expand_simple(struct inode *inode, loff_t size); | 210 | int generic_cont_expand_simple(struct inode *inode, loff_t size); |
211 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 211 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
212 | int block_page_mkwrite(struct vm_area_struct *vma, struct page *page, | ||
213 | get_block_t get_block); | ||
212 | void block_sync_page(struct page *); | 214 | void block_sync_page(struct page *); |
213 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 215 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
214 | int generic_commit_write(struct file *, struct page *, unsigned, unsigned); | 216 | int generic_commit_write(struct file *, struct page *, unsigned, unsigned); |
diff --git a/include/linux/bug.h b/include/linux/bug.h index 42aa0a54b6f4..54398d2c6d8d 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h | |||
@@ -10,6 +10,8 @@ enum bug_trap_type { | |||
10 | BUG_TRAP_TYPE_BUG = 2, | 10 | BUG_TRAP_TYPE_BUG = 2, |
11 | }; | 11 | }; |
12 | 12 | ||
13 | struct pt_regs; | ||
14 | |||
13 | #ifdef CONFIG_GENERIC_BUG | 15 | #ifdef CONFIG_GENERIC_BUG |
14 | #include <asm-generic/bug.h> | 16 | #include <asm-generic/bug.h> |
15 | 17 | ||
@@ -20,7 +22,7 @@ static inline int is_warning_bug(const struct bug_entry *bug) | |||
20 | 22 | ||
21 | const struct bug_entry *find_bug(unsigned long bugaddr); | 23 | const struct bug_entry *find_bug(unsigned long bugaddr); |
22 | 24 | ||
23 | enum bug_trap_type report_bug(unsigned long bug_addr); | 25 | enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs); |
24 | 26 | ||
25 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | 27 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, |
26 | struct module *); | 28 | struct module *); |
@@ -31,7 +33,8 @@ int is_valid_bugaddr(unsigned long addr); | |||
31 | 33 | ||
32 | #else /* !CONFIG_GENERIC_BUG */ | 34 | #else /* !CONFIG_GENERIC_BUG */ |
33 | 35 | ||
34 | static inline enum bug_trap_type report_bug(unsigned long bug_addr) | 36 | static inline enum bug_trap_type report_bug(unsigned long bug_addr, |
37 | struct pt_regs *regs) | ||
35 | { | 38 | { |
36 | return BUG_TRAP_TYPE_BUG; | 39 | return BUG_TRAP_TYPE_BUG; |
37 | } | 40 | } |
diff --git a/include/linux/capability.h b/include/linux/capability.h index bbf8df7de28f..2dfa58555934 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -44,7 +44,6 @@ typedef struct __user_cap_data_struct { | |||
44 | 44 | ||
45 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
46 | 46 | ||
47 | #include <linux/spinlock.h> | ||
48 | #include <asm/current.h> | 47 | #include <asm/current.h> |
49 | 48 | ||
50 | /* #define STRICT_CAP_T_TYPECHECKS */ | 49 | /* #define STRICT_CAP_T_TYPECHECKS */ |
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index f50f04bdbc16..2b641b176e7f 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -414,8 +414,8 @@ struct cdrom_generic_command | |||
414 | #define CDO_CHECK_TYPE 0x10 /* check type on open for data */ | 414 | #define CDO_CHECK_TYPE 0x10 /* check type on open for data */ |
415 | 415 | ||
416 | /* Special codes used when specifying changer slots. */ | 416 | /* Special codes used when specifying changer slots. */ |
417 | #define CDSL_NONE ((int) (~0U>>1)-1) | 417 | #define CDSL_NONE (INT_MAX-1) |
418 | #define CDSL_CURRENT ((int) (~0U>>1)) | 418 | #define CDSL_CURRENT INT_MAX |
419 | 419 | ||
420 | /* For partition based multisession access. IDE can handle 64 partitions | 420 | /* For partition based multisession access. IDE can handle 64 partitions |
421 | * per drive - SCSI CD-ROM's use minors to differentiate between the | 421 | * per drive - SCSI CD-ROM's use minors to differentiate between the |
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 8486e78f7335..e0bd46eb2414 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,10 +120,6 @@ extern void clockevents_register_device(struct clock_event_device *dev); | |||
119 | 120 | ||
120 | extern void clockevents_exchange_device(struct clock_event_device *old, | 121 | extern void clockevents_exchange_device(struct clock_event_device *old, |
121 | struct clock_event_device *new); | 122 | struct clock_event_device *new); |
122 | extern | ||
123 | struct clock_event_device *clockevents_request_device(unsigned int features, | ||
124 | cpumask_t cpumask); | ||
125 | extern void clockevents_release_device(struct clock_event_device *dev); | ||
126 | extern void clockevents_set_mode(struct clock_event_device *dev, | 123 | extern void clockevents_set_mode(struct clock_event_device *dev, |
127 | enum clock_event_mode mode); | 124 | enum clock_event_mode mode); |
128 | extern int clockevents_register_notifier(struct notifier_block *nb); | 125 | extern int clockevents_register_notifier(struct notifier_block *nb); |
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/cobalt-nvram.h b/include/linux/cobalt-nvram.h deleted file mode 100644 index ea429562ff36..000000000000 --- a/include/linux/cobalt-nvram.h +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | /* | ||
2 | * $Id: cobalt-nvram.h,v 1.20 2001/10/17 23:16:55 thockin Exp $ | ||
3 | * cobalt-nvram.h : defines for the various fields in the cobalt NVRAM | ||
4 | * | ||
5 | * Copyright 2001,2002 Sun Microsystems, Inc. | ||
6 | */ | ||
7 | |||
8 | #ifndef COBALT_NVRAM_H | ||
9 | #define COBALT_NVRAM_H | ||
10 | |||
11 | #include <linux/nvram.h> | ||
12 | |||
13 | #define COBT_CMOS_INFO_MAX 0x7f /* top address allowed */ | ||
14 | #define COBT_CMOS_BIOS_DRIVE_INFO 0x12 /* drive info would go here */ | ||
15 | |||
16 | #define COBT_CMOS_CKS_START NVRAM_OFFSET(0x0e) | ||
17 | #define COBT_CMOS_CKS_END NVRAM_OFFSET(0x7f) | ||
18 | |||
19 | /* flag bytes - 16 flags for now, leave room for more */ | ||
20 | #define COBT_CMOS_FLAG_BYTE_0 NVRAM_OFFSET(0x10) | ||
21 | #define COBT_CMOS_FLAG_BYTE_1 NVRAM_OFFSET(0x11) | ||
22 | |||
23 | /* flags in flag bytes - up to 16 */ | ||
24 | #define COBT_CMOS_FLAG_MIN 0x0001 | ||
25 | #define COBT_CMOS_CONSOLE_FLAG 0x0001 /* console on/off */ | ||
26 | #define COBT_CMOS_DEBUG_FLAG 0x0002 /* ROM debug messages */ | ||
27 | #define COBT_CMOS_AUTO_PROMPT_FLAG 0x0004 /* boot to ROM prompt? */ | ||
28 | #define COBT_CMOS_CLEAN_BOOT_FLAG 0x0008 /* set by a clean shutdown */ | ||
29 | #define COBT_CMOS_HW_NOPROBE_FLAG 0x0010 /* go easy on the probing */ | ||
30 | #define COBT_CMOS_SYSFAULT_FLAG 0x0020 /* system fault detected */ | ||
31 | #define COBT_CMOS_OOPSPANIC_FLAG 0x0040 /* panic on oops */ | ||
32 | #define COBT_CMOS_DELAY_CACHE_FLAG 0x0080 /* delay cache initialization */ | ||
33 | #define COBT_CMOS_NOLOGO_FLAG 0x0100 /* hide "C" logo @ boot */ | ||
34 | #define COBT_CMOS_VERSION_FLAG 0x0200 /* the version field is valid */ | ||
35 | #define COBT_CMOS_FLAG_MAX 0x0200 | ||
36 | |||
37 | /* leave byte 0x12 blank - Linux looks for drive info here */ | ||
38 | |||
39 | /* CMOS structure version, valid if COBT_CMOS_VERSION_FLAG is true */ | ||
40 | #define COBT_CMOS_VERSION NVRAM_OFFSET(0x13) | ||
41 | #define COBT_CMOS_VER_BTOCODE 1 /* min. version needed for btocode */ | ||
42 | |||
43 | /* index of default boot method */ | ||
44 | #define COBT_CMOS_BOOT_METHOD NVRAM_OFFSET(0x20) | ||
45 | #define COBT_CMOS_BOOT_METHOD_DISK 0 | ||
46 | #define COBT_CMOS_BOOT_METHOD_ROM 1 | ||
47 | #define COBT_CMOS_BOOT_METHOD_NET 2 | ||
48 | |||
49 | #define COBT_CMOS_BOOT_DEV_MIN NVRAM_OFFSET(0x21) | ||
50 | /* major #, minor # of first through fourth boot device */ | ||
51 | #define COBT_CMOS_BOOT_DEV0_MAJ NVRAM_OFFSET(0x21) | ||
52 | #define COBT_CMOS_BOOT_DEV0_MIN NVRAM_OFFSET(0x22) | ||
53 | #define COBT_CMOS_BOOT_DEV1_MAJ NVRAM_OFFSET(0x23) | ||
54 | #define COBT_CMOS_BOOT_DEV1_MIN NVRAM_OFFSET(0x24) | ||
55 | #define COBT_CMOS_BOOT_DEV2_MAJ NVRAM_OFFSET(0x25) | ||
56 | #define COBT_CMOS_BOOT_DEV2_MIN NVRAM_OFFSET(0x26) | ||
57 | #define COBT_CMOS_BOOT_DEV3_MAJ NVRAM_OFFSET(0x27) | ||
58 | #define COBT_CMOS_BOOT_DEV3_MIN NVRAM_OFFSET(0x28) | ||
59 | #define COBT_CMOS_BOOT_DEV_MAX NVRAM_OFFSET(0x28) | ||
60 | |||
61 | /* checksum of bytes 0xe-0x7f */ | ||
62 | #define COBT_CMOS_CHECKSUM NVRAM_OFFSET(0x2e) | ||
63 | |||
64 | /* running uptime counter, units of 5 minutes (32 bits =~ 41000 years) */ | ||
65 | #define COBT_CMOS_UPTIME_0 NVRAM_OFFSET(0x30) | ||
66 | #define COBT_CMOS_UPTIME_1 NVRAM_OFFSET(0x31) | ||
67 | #define COBT_CMOS_UPTIME_2 NVRAM_OFFSET(0x32) | ||
68 | #define COBT_CMOS_UPTIME_3 NVRAM_OFFSET(0x33) | ||
69 | |||
70 | /* count of successful boots (32 bits) */ | ||
71 | #define COBT_CMOS_BOOTCOUNT_0 NVRAM_OFFSET(0x38) | ||
72 | #define COBT_CMOS_BOOTCOUNT_1 NVRAM_OFFSET(0x39) | ||
73 | #define COBT_CMOS_BOOTCOUNT_2 NVRAM_OFFSET(0x3a) | ||
74 | #define COBT_CMOS_BOOTCOUNT_3 NVRAM_OFFSET(0x3b) | ||
75 | |||
76 | /* 13 bytes: system serial number, same as on the back of the system */ | ||
77 | #define COBT_CMOS_SYS_SERNUM_LEN 13 | ||
78 | #define COBT_CMOS_SYS_SERNUM_0 NVRAM_OFFSET(0x40) | ||
79 | #define COBT_CMOS_SYS_SERNUM_1 NVRAM_OFFSET(0x41) | ||
80 | #define COBT_CMOS_SYS_SERNUM_2 NVRAM_OFFSET(0x42) | ||
81 | #define COBT_CMOS_SYS_SERNUM_3 NVRAM_OFFSET(0x43) | ||
82 | #define COBT_CMOS_SYS_SERNUM_4 NVRAM_OFFSET(0x44) | ||
83 | #define COBT_CMOS_SYS_SERNUM_5 NVRAM_OFFSET(0x45) | ||
84 | #define COBT_CMOS_SYS_SERNUM_6 NVRAM_OFFSET(0x46) | ||
85 | #define COBT_CMOS_SYS_SERNUM_7 NVRAM_OFFSET(0x47) | ||
86 | #define COBT_CMOS_SYS_SERNUM_8 NVRAM_OFFSET(0x48) | ||
87 | #define COBT_CMOS_SYS_SERNUM_9 NVRAM_OFFSET(0x49) | ||
88 | #define COBT_CMOS_SYS_SERNUM_10 NVRAM_OFFSET(0x4a) | ||
89 | #define COBT_CMOS_SYS_SERNUM_11 NVRAM_OFFSET(0x4b) | ||
90 | #define COBT_CMOS_SYS_SERNUM_12 NVRAM_OFFSET(0x4c) | ||
91 | /* checksum for serial num - 1 byte */ | ||
92 | #define COBT_CMOS_SYS_SERNUM_CSUM NVRAM_OFFSET(0x4f) | ||
93 | |||
94 | #define COBT_CMOS_ROM_REV_MAJ NVRAM_OFFSET(0x50) | ||
95 | #define COBT_CMOS_ROM_REV_MIN NVRAM_OFFSET(0x51) | ||
96 | #define COBT_CMOS_ROM_REV_REV NVRAM_OFFSET(0x52) | ||
97 | |||
98 | #define COBT_CMOS_BTO_CODE_0 NVRAM_OFFSET(0x53) | ||
99 | #define COBT_CMOS_BTO_CODE_1 NVRAM_OFFSET(0x54) | ||
100 | #define COBT_CMOS_BTO_CODE_2 NVRAM_OFFSET(0x55) | ||
101 | #define COBT_CMOS_BTO_CODE_3 NVRAM_OFFSET(0x56) | ||
102 | |||
103 | #define COBT_CMOS_BTO_IP_CSUM NVRAM_OFFSET(0x57) | ||
104 | #define COBT_CMOS_BTO_IP_0 NVRAM_OFFSET(0x58) | ||
105 | #define COBT_CMOS_BTO_IP_1 NVRAM_OFFSET(0x59) | ||
106 | #define COBT_CMOS_BTO_IP_2 NVRAM_OFFSET(0x5a) | ||
107 | #define COBT_CMOS_BTO_IP_3 NVRAM_OFFSET(0x5b) | ||
108 | |||
109 | #endif /* COBALT_NVRAM_H */ | ||
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 */ |
38 | int coda_open(struct inode *i, struct file *f); | 38 | int coda_open(struct inode *i, struct file *f); |
39 | int coda_flush(struct file *f, fl_owner_t id); | ||
40 | int coda_release(struct inode *i, struct file *f); | 39 | int coda_release(struct inode *i, struct file *f); |
41 | int coda_permission(struct inode *inode, int mask, struct nameidata *nd); | 40 | int coda_permission(struct inode *inode, int mask, struct nameidata *nd); |
42 | int coda_revalidate_inode(struct dentry *); | 41 | int coda_revalidate_inode(struct dentry *); |
43 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 42 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
44 | int coda_setattr(struct dentry *, struct iattr *); | 43 | int coda_setattr(struct dentry *, struct iattr *); |
45 | 44 | ||
46 | /* global variables */ | ||
47 | extern int coda_fake_statfs; | ||
48 | |||
49 | /* this file: heloers */ | 45 | /* this file: heloers */ |
50 | static __inline__ struct CodaFid *coda_i2f(struct inode *); | 46 | static __inline__ struct CodaFid *coda_i2f(struct inode *); |
51 | static __inline__ char *coda_i2s(struct inode *); | 47 | static __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 | |||
15 | void coda_sysctl_init(void); | ||
16 | void 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 */ | ||
34 | struct 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 */ | ||
62 | struct 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 */ | ||
74 | extern 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 | ||
9 | struct kstatfs; | 9 | struct kstatfs; |
10 | 10 | ||
11 | struct coda_sb_info | ||
12 | { | ||
13 | struct venus_comm *sbi_vcomm; | ||
14 | }; | ||
15 | |||
16 | /* communication pending/processing queues */ | 11 | /* communication pending/processing queues */ |
17 | struct venus_comm { | 12 | struct 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 | ||
27 | static inline struct coda_sb_info *coda_sbp(struct super_block *sb) | 22 | static 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 *); | |||
38 | int venus_lookup(struct super_block *sb, struct CodaFid *fid, | 33 | int 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); |
41 | int venus_store(struct super_block *sb, struct CodaFid *fid, int flags, | ||
42 | vuid_t uid); | ||
43 | int venus_release(struct super_block *sb, struct CodaFid *fid, int flags); | ||
44 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, | 36 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, |
45 | vuid_t uid); | 37 | vuid_t uid); |
46 | int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, | 38 | int 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 */ |
77 | extern int coda_hard; | ||
78 | extern unsigned long coda_timeout; | ||
79 | struct upc_req { | 69 | struct 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..12a1291855e2 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -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/configfs.h b/include/linux/configfs.h index fef6f3d0a4a7..8c6967f3fb11 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h | |||
@@ -40,9 +40,9 @@ | |||
40 | #include <linux/types.h> | 40 | #include <linux/types.h> |
41 | #include <linux/list.h> | 41 | #include <linux/list.h> |
42 | #include <linux/kref.h> | 42 | #include <linux/kref.h> |
43 | #include <linux/mutex.h> | ||
43 | 44 | ||
44 | #include <asm/atomic.h> | 45 | #include <asm/atomic.h> |
45 | #include <asm/semaphore.h> | ||
46 | 46 | ||
47 | #define CONFIGFS_ITEM_NAME_LEN 20 | 47 | #define CONFIGFS_ITEM_NAME_LEN 20 |
48 | 48 | ||
@@ -75,7 +75,6 @@ extern void config_item_init(struct config_item *); | |||
75 | extern void config_item_init_type_name(struct config_item *item, | 75 | extern void config_item_init_type_name(struct config_item *item, |
76 | const char *name, | 76 | const char *name, |
77 | struct config_item_type *type); | 77 | struct config_item_type *type); |
78 | extern void config_item_cleanup(struct config_item *); | ||
79 | 78 | ||
80 | extern struct config_item * config_item_get(struct config_item *); | 79 | extern struct config_item * config_item_get(struct config_item *); |
81 | extern void config_item_put(struct config_item *); | 80 | extern void config_item_put(struct config_item *); |
@@ -87,12 +86,10 @@ struct config_item_type { | |||
87 | struct configfs_attribute **ct_attrs; | 86 | struct configfs_attribute **ct_attrs; |
88 | }; | 87 | }; |
89 | 88 | ||
90 | |||
91 | /** | 89 | /** |
92 | * group - a group of config_items of a specific type, belonging | 90 | * group - a group of config_items of a specific type, belonging |
93 | * to a specific subsystem. | 91 | * to a specific subsystem. |
94 | */ | 92 | */ |
95 | |||
96 | struct config_group { | 93 | struct config_group { |
97 | struct config_item cg_item; | 94 | struct config_item cg_item; |
98 | struct list_head cg_children; | 95 | struct list_head cg_children; |
@@ -100,13 +97,11 @@ struct config_group { | |||
100 | struct config_group **default_groups; | 97 | struct config_group **default_groups; |
101 | }; | 98 | }; |
102 | 99 | ||
103 | |||
104 | extern void config_group_init(struct config_group *group); | 100 | extern void config_group_init(struct config_group *group); |
105 | extern void config_group_init_type_name(struct config_group *group, | 101 | extern void config_group_init_type_name(struct config_group *group, |
106 | const char *name, | 102 | const char *name, |
107 | struct config_item_type *type); | 103 | struct config_item_type *type); |
108 | 104 | ||
109 | |||
110 | static inline struct config_group *to_config_group(struct config_item *item) | 105 | static inline struct config_group *to_config_group(struct config_item *item) |
111 | { | 106 | { |
112 | return item ? container_of(item,struct config_group,cg_item) : NULL; | 107 | return item ? container_of(item,struct config_group,cg_item) : NULL; |
@@ -122,7 +117,8 @@ static inline void config_group_put(struct config_group *group) | |||
122 | config_item_put(&group->cg_item); | 117 | config_item_put(&group->cg_item); |
123 | } | 118 | } |
124 | 119 | ||
125 | extern struct config_item *config_group_find_obj(struct config_group *, const char *); | 120 | extern struct config_item *config_group_find_item(struct config_group *, |
121 | const char *); | ||
126 | 122 | ||
127 | 123 | ||
128 | struct configfs_attribute { | 124 | struct configfs_attribute { |
@@ -131,6 +127,22 @@ struct configfs_attribute { | |||
131 | mode_t ca_mode; | 127 | mode_t ca_mode; |
132 | }; | 128 | }; |
133 | 129 | ||
130 | /* | ||
131 | * Users often need to create attribute structures for their configurable | ||
132 | * attributes, containing a configfs_attribute member and function pointers | ||
133 | * for the show() and store() operations on that attribute. They can use | ||
134 | * this macro (similar to sysfs' __ATTR) to make defining attributes easier. | ||
135 | */ | ||
136 | #define __CONFIGFS_ATTR(_name, _mode, _show, _store) \ | ||
137 | { \ | ||
138 | .attr = { \ | ||
139 | .ca_name = __stringify(_name), \ | ||
140 | .ca_mode = _mode, \ | ||
141 | .ca_owner = THIS_MODULE, \ | ||
142 | }, \ | ||
143 | .show = _show, \ | ||
144 | .store = _store, \ | ||
145 | } | ||
134 | 146 | ||
135 | /* | 147 | /* |
136 | * If allow_link() exists, the item can symlink(2) out to other | 148 | * If allow_link() exists, the item can symlink(2) out to other |
@@ -157,12 +169,13 @@ struct configfs_group_operations { | |||
157 | struct config_item *(*make_item)(struct config_group *group, const char *name); | 169 | struct config_item *(*make_item)(struct config_group *group, const char *name); |
158 | struct config_group *(*make_group)(struct config_group *group, const char *name); | 170 | struct config_group *(*make_group)(struct config_group *group, const char *name); |
159 | int (*commit_item)(struct config_item *item); | 171 | int (*commit_item)(struct config_item *item); |
172 | void (*disconnect_notify)(struct config_group *group, struct config_item *item); | ||
160 | void (*drop_item)(struct config_group *group, struct config_item *item); | 173 | void (*drop_item)(struct config_group *group, struct config_item *item); |
161 | }; | 174 | }; |
162 | 175 | ||
163 | struct configfs_subsystem { | 176 | struct configfs_subsystem { |
164 | struct config_group su_group; | 177 | struct config_group su_group; |
165 | struct semaphore su_sem; | 178 | struct mutex su_mutex; |
166 | }; | 179 | }; |
167 | 180 | ||
168 | static inline struct configfs_subsystem *to_configfs_subsystem(struct config_group *group) | 181 | static inline struct configfs_subsystem *to_configfs_subsystem(struct config_group *group) |
@@ -175,6 +188,11 @@ static inline struct configfs_subsystem *to_configfs_subsystem(struct config_gro | |||
175 | int configfs_register_subsystem(struct configfs_subsystem *subsys); | 188 | int configfs_register_subsystem(struct configfs_subsystem *subsys); |
176 | void configfs_unregister_subsystem(struct configfs_subsystem *subsys); | 189 | void configfs_unregister_subsystem(struct configfs_subsystem *subsys); |
177 | 190 | ||
191 | /* These functions can sleep and can alloc with GFP_KERNEL */ | ||
192 | /* WARNING: These cannot be called underneath configfs callbacks!! */ | ||
193 | int configfs_depend_item(struct configfs_subsystem *subsys, struct config_item *target); | ||
194 | void configfs_undepend_item(struct configfs_subsystem *subsys, struct config_item *target); | ||
195 | |||
178 | #endif /* __KERNEL__ */ | 196 | #endif /* __KERNEL__ */ |
179 | 197 | ||
180 | #endif /* _CONFIGFS_H_ */ | 198 | #endif /* _CONFIGFS_H_ */ |
diff --git a/include/linux/console.h b/include/linux/console.h index 62ef6e11d0d2..56a7bcda49cb 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -15,7 +15,6 @@ | |||
15 | #define _LINUX_CONSOLE_H_ 1 | 15 | #define _LINUX_CONSOLE_H_ 1 |
16 | 16 | ||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <linux/spinlock.h> | ||
19 | 18 | ||
20 | struct vc_data; | 19 | struct vc_data; |
21 | struct console_font_op; | 20 | struct console_font_op; |
@@ -99,6 +98,7 @@ struct console { | |||
99 | struct tty_driver *(*device)(struct console *, int *); | 98 | struct tty_driver *(*device)(struct console *, int *); |
100 | void (*unblank)(void); | 99 | void (*unblank)(void); |
101 | int (*setup)(struct console *, char *); | 100 | int (*setup)(struct console *, char *); |
101 | int (*early_setup)(void); | ||
102 | short flags; | 102 | short flags; |
103 | short index; | 103 | short index; |
104 | int cflag; | 104 | int cflag; |
@@ -107,6 +107,7 @@ struct console { | |||
107 | }; | 107 | }; |
108 | 108 | ||
109 | extern int add_preferred_console(char *name, int idx, char *options); | 109 | extern int add_preferred_console(char *name, int idx, char *options); |
110 | extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); | ||
110 | extern void register_console(struct console *); | 111 | extern void register_console(struct console *); |
111 | extern int unregister_console(struct console *); | 112 | extern int unregister_console(struct console *); |
112 | extern struct console *console_drivers; | 113 | extern struct console *console_drivers; |
diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h index 82c9a1f11020..06b2768c603f 100644 --- a/include/linux/consolemap.h +++ b/include/linux/consolemap.h | |||
@@ -8,9 +8,12 @@ | |||
8 | #define IBMPC_MAP 2 | 8 | #define IBMPC_MAP 2 |
9 | #define USER_MAP 3 | 9 | #define USER_MAP 3 |
10 | 10 | ||
11 | #include <linux/types.h> | ||
12 | |||
11 | struct vc_data; | 13 | struct vc_data; |
12 | 14 | ||
13 | extern unsigned char inverse_translate(struct vc_data *conp, int glyph); | 15 | extern u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode); |
14 | extern unsigned short *set_translate(int m, struct vc_data *vc); | 16 | extern unsigned short *set_translate(int m, struct vc_data *vc); |
15 | extern int conv_uni_to_pc(struct vc_data *conp, long ucs); | 17 | extern int conv_uni_to_pc(struct vc_data *conp, long ucs); |
18 | extern u32 conv_8bit_to_uni(unsigned char c); | ||
16 | void console_map_init(void); | 19 | void console_map_init(void); |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 3b2df2523f1d..c2236bbff412 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -120,7 +120,6 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex) | |||
120 | 120 | ||
121 | #define lock_cpu_hotplug() do { } while (0) | 121 | #define lock_cpu_hotplug() do { } while (0) |
122 | #define unlock_cpu_hotplug() do { } while (0) | 122 | #define unlock_cpu_hotplug() do { } while (0) |
123 | #define lock_cpu_hotplug_interruptible() 0 | ||
124 | #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) | 123 | #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) |
125 | #define register_hotcpu_notifier(nb) do { (void)(nb); } while (0) | 124 | #define register_hotcpu_notifier(nb) do { (void)(nb); } while (0) |
126 | #define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0) | 125 | #define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0) |
diff --git a/include/linux/crc7.h b/include/linux/crc7.h new file mode 100644 index 000000000000..1786e772d5c6 --- /dev/null +++ b/include/linux/crc7.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _LINUX_CRC7_H | ||
2 | #define _LINUX_CRC7_H | ||
3 | #include <linux/types.h> | ||
4 | |||
5 | extern const u8 crc7_syndrome_table[256]; | ||
6 | |||
7 | static inline u8 crc7_byte(u8 crc, u8 data) | ||
8 | { | ||
9 | return crc7_syndrome_table[(crc << 1) ^ data]; | ||
10 | } | ||
11 | |||
12 | extern u8 crc7(u8 crc, const u8 *buffer, size_t len); | ||
13 | |||
14 | #endif | ||
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 0de7e2ace822..357e8cfedc37 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -295,28 +295,8 @@ struct blkcipher_tfm { | |||
295 | }; | 295 | }; |
296 | 296 | ||
297 | struct cipher_tfm { | 297 | struct cipher_tfm { |
298 | void *cit_iv; | ||
299 | unsigned int cit_ivsize; | ||
300 | u32 cit_mode; | ||
301 | int (*cit_setkey)(struct crypto_tfm *tfm, | 298 | int (*cit_setkey)(struct crypto_tfm *tfm, |
302 | const u8 *key, unsigned int keylen); | 299 | const u8 *key, unsigned int keylen); |
303 | int (*cit_encrypt)(struct crypto_tfm *tfm, | ||
304 | struct scatterlist *dst, | ||
305 | struct scatterlist *src, | ||
306 | unsigned int nbytes); | ||
307 | int (*cit_encrypt_iv)(struct crypto_tfm *tfm, | ||
308 | struct scatterlist *dst, | ||
309 | struct scatterlist *src, | ||
310 | unsigned int nbytes, u8 *iv); | ||
311 | int (*cit_decrypt)(struct crypto_tfm *tfm, | ||
312 | struct scatterlist *dst, | ||
313 | struct scatterlist *src, | ||
314 | unsigned int nbytes); | ||
315 | int (*cit_decrypt_iv)(struct crypto_tfm *tfm, | ||
316 | struct scatterlist *dst, | ||
317 | struct scatterlist *src, | ||
318 | unsigned int nbytes, u8 *iv); | ||
319 | void (*cit_xor_block)(u8 *dst, const u8 *src); | ||
320 | void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); | 300 | void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
321 | void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); | 301 | void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
322 | }; | 302 | }; |
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 | ||
17 | struct dcookie_user; | 18 | struct dcookie_user; |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 5a9c49534d08..104e51e20e14 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -38,6 +38,9 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, | |||
38 | 38 | ||
39 | void debugfs_remove(struct dentry *dentry); | 39 | void debugfs_remove(struct dentry *dentry); |
40 | 40 | ||
41 | struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, | ||
42 | struct dentry *new_dir, const char *new_name); | ||
43 | |||
41 | struct dentry *debugfs_create_u8(const char *name, mode_t mode, | 44 | struct dentry *debugfs_create_u8(const char *name, mode_t mode, |
42 | struct dentry *parent, u8 *value); | 45 | struct dentry *parent, u8 *value); |
43 | struct dentry *debugfs_create_u16(const char *name, mode_t mode, | 46 | struct dentry *debugfs_create_u16(const char *name, mode_t mode, |
@@ -85,6 +88,12 @@ static inline struct dentry *debugfs_create_symlink(const char *name, | |||
85 | static inline void debugfs_remove(struct dentry *dentry) | 88 | static inline void debugfs_remove(struct dentry *dentry) |
86 | { } | 89 | { } |
87 | 90 | ||
91 | static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, | ||
92 | struct dentry *new_dir, char *new_name) | ||
93 | { | ||
94 | return ERR_PTR(-ENODEV); | ||
95 | } | ||
96 | |||
88 | static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, | 97 | static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, |
89 | struct dentry *parent, | 98 | struct dentry *parent, |
90 | u8 *value) | 99 | u8 *value) |
diff --git a/include/linux/device.h b/include/linux/device.h index 2e1a2988b7e1..d9f0a57f5a2f 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -238,7 +238,6 @@ extern int __must_check class_device_create_file(struct class_device *, | |||
238 | * @devt: for internal use by the driver core only. | 238 | * @devt: for internal use by the driver core only. |
239 | * @node: for internal use by the driver core only. | 239 | * @node: for internal use by the driver core only. |
240 | * @kobj: for internal use by the driver core only. | 240 | * @kobj: for internal use by the driver core only. |
241 | * @devt_attr: for internal use by the driver core only. | ||
242 | * @groups: optional additional groups to be created | 241 | * @groups: optional additional groups to be created |
243 | * @dev: if set, a symlink to the struct device is created in the sysfs | 242 | * @dev: if set, a symlink to the struct device is created in the sysfs |
244 | * directory for this struct class device. | 243 | * directory for this struct class device. |
@@ -263,8 +262,6 @@ struct class_device { | |||
263 | struct kobject kobj; | 262 | struct kobject kobj; |
264 | struct class * class; /* required */ | 263 | struct class * class; /* required */ |
265 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 264 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
266 | struct class_device_attribute *devt_attr; | ||
267 | struct class_device_attribute uevent_attr; | ||
268 | struct device * dev; /* not necessary, but nice to have */ | 265 | struct device * dev; /* not necessary, but nice to have */ |
269 | void * class_data; /* class-specific data */ | 266 | void * class_data; /* class-specific data */ |
270 | struct class_device *parent; /* parent of this child device, if there is one */ | 267 | struct class_device *parent; /* parent of this child device, if there is one */ |
@@ -419,8 +416,6 @@ struct device { | |||
419 | struct device_type *type; | 416 | struct device_type *type; |
420 | unsigned is_registered:1; | 417 | unsigned is_registered:1; |
421 | unsigned uevent_suppress:1; | 418 | unsigned uevent_suppress:1; |
422 | struct device_attribute uevent_attr; | ||
423 | struct device_attribute *devt_attr; | ||
424 | 419 | ||
425 | struct semaphore sem; /* semaphore to synchronize calls to | 420 | struct semaphore sem; /* semaphore to synchronize calls to |
426 | * its driver. | 421 | * its driver. |
@@ -577,6 +572,16 @@ dev_dbg(struct device * dev, const char * fmt, ...) | |||
577 | } | 572 | } |
578 | #endif | 573 | #endif |
579 | 574 | ||
575 | #ifdef VERBOSE_DEBUG | ||
576 | #define dev_vdbg dev_dbg | ||
577 | #else | ||
578 | static inline int __attribute__ ((format (printf, 2, 3))) | ||
579 | dev_vdbg(struct device * dev, const char * fmt, ...) | ||
580 | { | ||
581 | return 0; | ||
582 | } | ||
583 | #endif | ||
584 | |||
580 | #define dev_err(dev, format, arg...) \ | 585 | #define dev_err(dev, format, arg...) \ |
581 | dev_printk(KERN_ERR , dev , format , ## arg) | 586 | dev_printk(KERN_ERR , dev , format , ## arg) |
582 | #define dev_info(dev, format, arg...) \ | 587 | #define dev_info(dev, format, arg...) \ |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 9a663c6db16a..2dc21cbeb304 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -31,7 +31,11 @@ static inline int valid_dma_direction(int dma_direction) | |||
31 | (dma_direction == DMA_FROM_DEVICE)); | 31 | (dma_direction == DMA_FROM_DEVICE)); |
32 | } | 32 | } |
33 | 33 | ||
34 | #ifdef CONFIG_HAS_DMA | ||
34 | #include <asm/dma-mapping.h> | 35 | #include <asm/dma-mapping.h> |
36 | #else | ||
37 | #include <asm-generic/dma-mapping-broken.h> | ||
38 | #endif | ||
35 | 39 | ||
36 | /* Backwards compat, remove in 2.7.x */ | 40 | /* Backwards compat, remove in 2.7.x */ |
37 | #define dma_sync_single dma_sync_single_for_cpu | 41 | #define dma_sync_single dma_sync_single_for_cpu |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index c94d8f1d62e5..a3b6035b6c86 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -21,29 +21,40 @@ | |||
21 | #ifndef DMAENGINE_H | 21 | #ifndef DMAENGINE_H |
22 | #define DMAENGINE_H | 22 | #define DMAENGINE_H |
23 | 23 | ||
24 | #ifdef CONFIG_DMA_ENGINE | ||
25 | |||
26 | #include <linux/device.h> | 24 | #include <linux/device.h> |
27 | #include <linux/uio.h> | 25 | #include <linux/uio.h> |
28 | #include <linux/kref.h> | 26 | #include <linux/kref.h> |
29 | #include <linux/completion.h> | 27 | #include <linux/completion.h> |
30 | #include <linux/rcupdate.h> | 28 | #include <linux/rcupdate.h> |
29 | #include <linux/dma-mapping.h> | ||
31 | 30 | ||
32 | /** | 31 | /** |
33 | * enum dma_event - resource PNP/power managment events | 32 | * enum dma_state - resource PNP/power managment state |
34 | * @DMA_RESOURCE_SUSPEND: DMA device going into low power state | 33 | * @DMA_RESOURCE_SUSPEND: DMA device going into low power state |
35 | * @DMA_RESOURCE_RESUME: DMA device returning to full power | 34 | * @DMA_RESOURCE_RESUME: DMA device returning to full power |
36 | * @DMA_RESOURCE_ADDED: DMA device added to the system | 35 | * @DMA_RESOURCE_AVAILABLE: DMA device available to the system |
37 | * @DMA_RESOURCE_REMOVED: DMA device removed from the system | 36 | * @DMA_RESOURCE_REMOVED: DMA device removed from the system |
38 | */ | 37 | */ |
39 | enum dma_event { | 38 | enum dma_state { |
40 | DMA_RESOURCE_SUSPEND, | 39 | DMA_RESOURCE_SUSPEND, |
41 | DMA_RESOURCE_RESUME, | 40 | DMA_RESOURCE_RESUME, |
42 | DMA_RESOURCE_ADDED, | 41 | DMA_RESOURCE_AVAILABLE, |
43 | DMA_RESOURCE_REMOVED, | 42 | DMA_RESOURCE_REMOVED, |
44 | }; | 43 | }; |
45 | 44 | ||
46 | /** | 45 | /** |
46 | * enum dma_state_client - state of the channel in the client | ||
47 | * @DMA_ACK: client would like to use, or was using this channel | ||
48 | * @DMA_DUP: client has already seen this channel, or is not using this channel | ||
49 | * @DMA_NAK: client does not want to see any more channels | ||
50 | */ | ||
51 | enum dma_state_client { | ||
52 | DMA_ACK, | ||
53 | DMA_DUP, | ||
54 | DMA_NAK, | ||
55 | }; | ||
56 | |||
57 | /** | ||
47 | * typedef dma_cookie_t - an opaque DMA cookie | 58 | * typedef dma_cookie_t - an opaque DMA cookie |
48 | * | 59 | * |
49 | * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code | 60 | * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code |
@@ -65,6 +76,31 @@ enum dma_status { | |||
65 | }; | 76 | }; |
66 | 77 | ||
67 | /** | 78 | /** |
79 | * enum dma_transaction_type - DMA transaction types/indexes | ||
80 | */ | ||
81 | enum dma_transaction_type { | ||
82 | DMA_MEMCPY, | ||
83 | DMA_XOR, | ||
84 | DMA_PQ_XOR, | ||
85 | DMA_DUAL_XOR, | ||
86 | DMA_PQ_UPDATE, | ||
87 | DMA_ZERO_SUM, | ||
88 | DMA_PQ_ZERO_SUM, | ||
89 | DMA_MEMSET, | ||
90 | DMA_MEMCPY_CRC32C, | ||
91 | DMA_INTERRUPT, | ||
92 | }; | ||
93 | |||
94 | /* last transaction type for creation of the capabilities mask */ | ||
95 | #define DMA_TX_TYPE_END (DMA_INTERRUPT + 1) | ||
96 | |||
97 | /** | ||
98 | * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. | ||
99 | * See linux/cpumask.h | ||
100 | */ | ||
101 | typedef struct { DECLARE_BITMAP(bits, DMA_TX_TYPE_END); } dma_cap_mask_t; | ||
102 | |||
103 | /** | ||
68 | * struct dma_chan_percpu - the per-CPU part of struct dma_chan | 104 | * struct dma_chan_percpu - the per-CPU part of struct dma_chan |
69 | * @refcount: local_t used for open-coded "bigref" counting | 105 | * @refcount: local_t used for open-coded "bigref" counting |
70 | * @memcpy_count: transaction counter | 106 | * @memcpy_count: transaction counter |
@@ -80,7 +116,6 @@ struct dma_chan_percpu { | |||
80 | 116 | ||
81 | /** | 117 | /** |
82 | * struct dma_chan - devices supply DMA channels, clients use them | 118 | * struct dma_chan - devices supply DMA channels, clients use them |
83 | * @client: ptr to the client user of this chan, will be %NULL when unused | ||
84 | * @device: ptr to the dma device who supplies this channel, always !%NULL | 119 | * @device: ptr to the dma device who supplies this channel, always !%NULL |
85 | * @cookie: last cookie value returned to client | 120 | * @cookie: last cookie value returned to client |
86 | * @chan_id: channel ID for sysfs | 121 | * @chan_id: channel ID for sysfs |
@@ -88,12 +123,10 @@ struct dma_chan_percpu { | |||
88 | * @refcount: kref, used in "bigref" slow-mode | 123 | * @refcount: kref, used in "bigref" slow-mode |
89 | * @slow_ref: indicates that the DMA channel is free | 124 | * @slow_ref: indicates that the DMA channel is free |
90 | * @rcu: the DMA channel's RCU head | 125 | * @rcu: the DMA channel's RCU head |
91 | * @client_node: used to add this to the client chan list | ||
92 | * @device_node: used to add this to the device chan list | 126 | * @device_node: used to add this to the device chan list |
93 | * @local: per-cpu pointer to a struct dma_chan_percpu | 127 | * @local: per-cpu pointer to a struct dma_chan_percpu |
94 | */ | 128 | */ |
95 | struct dma_chan { | 129 | struct dma_chan { |
96 | struct dma_client *client; | ||
97 | struct dma_device *device; | 130 | struct dma_device *device; |
98 | dma_cookie_t cookie; | 131 | dma_cookie_t cookie; |
99 | 132 | ||
@@ -105,11 +138,11 @@ struct dma_chan { | |||
105 | int slow_ref; | 138 | int slow_ref; |
106 | struct rcu_head rcu; | 139 | struct rcu_head rcu; |
107 | 140 | ||
108 | struct list_head client_node; | ||
109 | struct list_head device_node; | 141 | struct list_head device_node; |
110 | struct dma_chan_percpu *local; | 142 | struct dma_chan_percpu *local; |
111 | }; | 143 | }; |
112 | 144 | ||
145 | |||
113 | void dma_chan_cleanup(struct kref *kref); | 146 | void dma_chan_cleanup(struct kref *kref); |
114 | 147 | ||
115 | static inline void dma_chan_get(struct dma_chan *chan) | 148 | static inline void dma_chan_get(struct dma_chan *chan) |
@@ -134,169 +167,206 @@ static inline void dma_chan_put(struct dma_chan *chan) | |||
134 | 167 | ||
135 | /* | 168 | /* |
136 | * typedef dma_event_callback - function pointer to a DMA event callback | 169 | * typedef dma_event_callback - function pointer to a DMA event callback |
170 | * For each channel added to the system this routine is called for each client. | ||
171 | * If the client would like to use the channel it returns '1' to signal (ack) | ||
172 | * the dmaengine core to take out a reference on the channel and its | ||
173 | * corresponding device. A client must not 'ack' an available channel more | ||
174 | * than once. When a channel is removed all clients are notified. If a client | ||
175 | * is using the channel it must 'ack' the removal. A client must not 'ack' a | ||
176 | * removed channel more than once. | ||
177 | * @client - 'this' pointer for the client context | ||
178 | * @chan - channel to be acted upon | ||
179 | * @state - available or removed | ||
137 | */ | 180 | */ |
138 | typedef void (*dma_event_callback) (struct dma_client *client, | 181 | struct dma_client; |
139 | struct dma_chan *chan, enum dma_event event); | 182 | typedef enum dma_state_client (*dma_event_callback) (struct dma_client *client, |
183 | struct dma_chan *chan, enum dma_state state); | ||
140 | 184 | ||
141 | /** | 185 | /** |
142 | * struct dma_client - info on the entity making use of DMA services | 186 | * struct dma_client - info on the entity making use of DMA services |
143 | * @event_callback: func ptr to call when something happens | 187 | * @event_callback: func ptr to call when something happens |
144 | * @chan_count: number of chans allocated | 188 | * @cap_mask: only return channels that satisfy the requested capabilities |
145 | * @chans_desired: number of chans requested. Can be +/- chan_count | 189 | * a value of zero corresponds to any capability |
146 | * @lock: protects access to the channels list | ||
147 | * @channels: the list of DMA channels allocated | ||
148 | * @global_node: list_head for global dma_client_list | 190 | * @global_node: list_head for global dma_client_list |
149 | */ | 191 | */ |
150 | struct dma_client { | 192 | struct dma_client { |
151 | dma_event_callback event_callback; | 193 | dma_event_callback event_callback; |
152 | unsigned int chan_count; | 194 | dma_cap_mask_t cap_mask; |
153 | unsigned int chans_desired; | ||
154 | |||
155 | spinlock_t lock; | ||
156 | struct list_head channels; | ||
157 | struct list_head global_node; | 195 | struct list_head global_node; |
158 | }; | 196 | }; |
159 | 197 | ||
198 | typedef void (*dma_async_tx_callback)(void *dma_async_param); | ||
199 | /** | ||
200 | * struct dma_async_tx_descriptor - async transaction descriptor | ||
201 | * ---dma generic offload fields--- | ||
202 | * @cookie: tracking cookie for this transaction, set to -EBUSY if | ||
203 | * this tx is sitting on a dependency list | ||
204 | * @ack: the descriptor can not be reused until the client acknowledges | ||
205 | * receipt, i.e. has has a chance to establish any dependency chains | ||
206 | * @phys: physical address of the descriptor | ||
207 | * @tx_list: driver common field for operations that require multiple | ||
208 | * descriptors | ||
209 | * @chan: target channel for this operation | ||
210 | * @tx_submit: set the prepared descriptor(s) to be executed by the engine | ||
211 | * @tx_set_dest: set a destination address in a hardware descriptor | ||
212 | * @tx_set_src: set a source address in a hardware descriptor | ||
213 | * @callback: routine to call after this operation is complete | ||
214 | * @callback_param: general parameter to pass to the callback routine | ||
215 | * ---async_tx api specific fields--- | ||
216 | * @depend_list: at completion this list of transactions are submitted | ||
217 | * @depend_node: allow this transaction to be executed after another | ||
218 | * transaction has completed, possibly on another channel | ||
219 | * @parent: pointer to the next level up in the dependency chain | ||
220 | * @lock: protect the dependency list | ||
221 | */ | ||
222 | struct dma_async_tx_descriptor { | ||
223 | dma_cookie_t cookie; | ||
224 | int ack; | ||
225 | dma_addr_t phys; | ||
226 | struct list_head tx_list; | ||
227 | struct dma_chan *chan; | ||
228 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); | ||
229 | void (*tx_set_dest)(dma_addr_t addr, | ||
230 | struct dma_async_tx_descriptor *tx, int index); | ||
231 | void (*tx_set_src)(dma_addr_t addr, | ||
232 | struct dma_async_tx_descriptor *tx, int index); | ||
233 | dma_async_tx_callback callback; | ||
234 | void *callback_param; | ||
235 | struct list_head depend_list; | ||
236 | struct list_head depend_node; | ||
237 | struct dma_async_tx_descriptor *parent; | ||
238 | spinlock_t lock; | ||
239 | }; | ||
240 | |||
160 | /** | 241 | /** |
161 | * struct dma_device - info on the entity supplying DMA services | 242 | * struct dma_device - info on the entity supplying DMA services |
162 | * @chancnt: how many DMA channels are supported | 243 | * @chancnt: how many DMA channels are supported |
163 | * @channels: the list of struct dma_chan | 244 | * @channels: the list of struct dma_chan |
164 | * @global_node: list_head for global dma_device_list | 245 | * @global_node: list_head for global dma_device_list |
246 | * @cap_mask: one or more dma_capability flags | ||
247 | * @max_xor: maximum number of xor sources, 0 if no capability | ||
165 | * @refcount: reference count | 248 | * @refcount: reference count |
166 | * @done: IO completion struct | 249 | * @done: IO completion struct |
167 | * @dev_id: unique device ID | 250 | * @dev_id: unique device ID |
251 | * @dev: struct device reference for dma mapping api | ||
168 | * @device_alloc_chan_resources: allocate resources and return the | 252 | * @device_alloc_chan_resources: allocate resources and return the |
169 | * number of allocated descriptors | 253 | * number of allocated descriptors |
170 | * @device_free_chan_resources: release DMA channel's resources | 254 | * @device_free_chan_resources: release DMA channel's resources |
171 | * @device_memcpy_buf_to_buf: memcpy buf pointer to buf pointer | 255 | * @device_prep_dma_memcpy: prepares a memcpy operation |
172 | * @device_memcpy_buf_to_pg: memcpy buf pointer to struct page | 256 | * @device_prep_dma_xor: prepares a xor operation |
173 | * @device_memcpy_pg_to_pg: memcpy struct page/offset to struct page/offset | 257 | * @device_prep_dma_zero_sum: prepares a zero_sum operation |
174 | * @device_memcpy_complete: poll the status of an IOAT DMA transaction | 258 | * @device_prep_dma_memset: prepares a memset operation |
175 | * @device_memcpy_issue_pending: push appended descriptors to hardware | 259 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation |
260 | * @device_dependency_added: async_tx notifies the channel about new deps | ||
261 | * @device_issue_pending: push pending transactions to hardware | ||
176 | */ | 262 | */ |
177 | struct dma_device { | 263 | struct dma_device { |
178 | 264 | ||
179 | unsigned int chancnt; | 265 | unsigned int chancnt; |
180 | struct list_head channels; | 266 | struct list_head channels; |
181 | struct list_head global_node; | 267 | struct list_head global_node; |
268 | dma_cap_mask_t cap_mask; | ||
269 | int max_xor; | ||
182 | 270 | ||
183 | struct kref refcount; | 271 | struct kref refcount; |
184 | struct completion done; | 272 | struct completion done; |
185 | 273 | ||
186 | int dev_id; | 274 | int dev_id; |
275 | struct device *dev; | ||
187 | 276 | ||
188 | int (*device_alloc_chan_resources)(struct dma_chan *chan); | 277 | int (*device_alloc_chan_resources)(struct dma_chan *chan); |
189 | void (*device_free_chan_resources)(struct dma_chan *chan); | 278 | void (*device_free_chan_resources)(struct dma_chan *chan); |
190 | dma_cookie_t (*device_memcpy_buf_to_buf)(struct dma_chan *chan, | 279 | |
191 | void *dest, void *src, size_t len); | 280 | struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( |
192 | dma_cookie_t (*device_memcpy_buf_to_pg)(struct dma_chan *chan, | 281 | struct dma_chan *chan, size_t len, int int_en); |
193 | struct page *page, unsigned int offset, void *kdata, | 282 | struct dma_async_tx_descriptor *(*device_prep_dma_xor)( |
194 | size_t len); | 283 | struct dma_chan *chan, unsigned int src_cnt, size_t len, |
195 | dma_cookie_t (*device_memcpy_pg_to_pg)(struct dma_chan *chan, | 284 | int int_en); |
196 | struct page *dest_pg, unsigned int dest_off, | 285 | struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( |
197 | struct page *src_pg, unsigned int src_off, size_t len); | 286 | struct dma_chan *chan, unsigned int src_cnt, size_t len, |
198 | enum dma_status (*device_memcpy_complete)(struct dma_chan *chan, | 287 | u32 *result, int int_en); |
288 | struct dma_async_tx_descriptor *(*device_prep_dma_memset)( | ||
289 | struct dma_chan *chan, int value, size_t len, int int_en); | ||
290 | struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( | ||
291 | struct dma_chan *chan); | ||
292 | |||
293 | void (*device_dependency_added)(struct dma_chan *chan); | ||
294 | enum dma_status (*device_is_tx_complete)(struct dma_chan *chan, | ||
199 | dma_cookie_t cookie, dma_cookie_t *last, | 295 | dma_cookie_t cookie, dma_cookie_t *last, |
200 | dma_cookie_t *used); | 296 | dma_cookie_t *used); |
201 | void (*device_memcpy_issue_pending)(struct dma_chan *chan); | 297 | void (*device_issue_pending)(struct dma_chan *chan); |
202 | }; | 298 | }; |
203 | 299 | ||
204 | /* --- public DMA engine API --- */ | 300 | /* --- public DMA engine API --- */ |
205 | 301 | ||
206 | struct dma_client *dma_async_client_register(dma_event_callback event_callback); | 302 | void dma_async_client_register(struct dma_client *client); |
207 | void dma_async_client_unregister(struct dma_client *client); | 303 | void dma_async_client_unregister(struct dma_client *client); |
208 | void dma_async_client_chan_request(struct dma_client *client, | 304 | void dma_async_client_chan_request(struct dma_client *client); |
209 | unsigned int number); | 305 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, |
306 | void *dest, void *src, size_t len); | ||
307 | dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, | ||
308 | struct page *page, unsigned int offset, void *kdata, size_t len); | ||
309 | dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan, | ||
310 | struct page *dest_pg, unsigned int dest_off, struct page *src_pg, | ||
311 | unsigned int src_off, size_t len); | ||
312 | void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx, | ||
313 | struct dma_chan *chan); | ||
210 | 314 | ||
211 | /** | 315 | static inline void |
212 | * dma_async_memcpy_buf_to_buf - offloaded copy between virtual addresses | 316 | async_tx_ack(struct dma_async_tx_descriptor *tx) |
213 | * @chan: DMA channel to offload copy to | ||
214 | * @dest: destination address (virtual) | ||
215 | * @src: source address (virtual) | ||
216 | * @len: length | ||
217 | * | ||
218 | * Both @dest and @src must be mappable to a bus address according to the | ||
219 | * DMA mapping API rules for streaming mappings. | ||
220 | * Both @dest and @src must stay memory resident (kernel memory or locked | ||
221 | * user space pages). | ||
222 | */ | ||
223 | static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, | ||
224 | void *dest, void *src, size_t len) | ||
225 | { | 317 | { |
226 | int cpu = get_cpu(); | 318 | tx->ack = 1; |
227 | per_cpu_ptr(chan->local, cpu)->bytes_transferred += len; | ||
228 | per_cpu_ptr(chan->local, cpu)->memcpy_count++; | ||
229 | put_cpu(); | ||
230 | |||
231 | return chan->device->device_memcpy_buf_to_buf(chan, dest, src, len); | ||
232 | } | 319 | } |
233 | 320 | ||
234 | /** | 321 | #define first_dma_cap(mask) __first_dma_cap(&(mask)) |
235 | * dma_async_memcpy_buf_to_pg - offloaded copy from address to page | 322 | static inline int __first_dma_cap(const dma_cap_mask_t *srcp) |
236 | * @chan: DMA channel to offload copy to | ||
237 | * @page: destination page | ||
238 | * @offset: offset in page to copy to | ||
239 | * @kdata: source address (virtual) | ||
240 | * @len: length | ||
241 | * | ||
242 | * Both @page/@offset and @kdata must be mappable to a bus address according | ||
243 | * to the DMA mapping API rules for streaming mappings. | ||
244 | * Both @page/@offset and @kdata must stay memory resident (kernel memory or | ||
245 | * locked user space pages) | ||
246 | */ | ||
247 | static inline dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, | ||
248 | struct page *page, unsigned int offset, void *kdata, size_t len) | ||
249 | { | 323 | { |
250 | int cpu = get_cpu(); | 324 | return min_t(int, DMA_TX_TYPE_END, |
251 | per_cpu_ptr(chan->local, cpu)->bytes_transferred += len; | 325 | find_first_bit(srcp->bits, DMA_TX_TYPE_END)); |
252 | per_cpu_ptr(chan->local, cpu)->memcpy_count++; | 326 | } |
253 | put_cpu(); | ||
254 | 327 | ||
255 | return chan->device->device_memcpy_buf_to_pg(chan, page, offset, | 328 | #define next_dma_cap(n, mask) __next_dma_cap((n), &(mask)) |
256 | kdata, len); | 329 | static inline int __next_dma_cap(int n, const dma_cap_mask_t *srcp) |
330 | { | ||
331 | return min_t(int, DMA_TX_TYPE_END, | ||
332 | find_next_bit(srcp->bits, DMA_TX_TYPE_END, n+1)); | ||
257 | } | 333 | } |
258 | 334 | ||
259 | /** | 335 | #define dma_cap_set(tx, mask) __dma_cap_set((tx), &(mask)) |
260 | * dma_async_memcpy_pg_to_pg - offloaded copy from page to page | 336 | static inline void |
261 | * @chan: DMA channel to offload copy to | 337 | __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) |
262 | * @dest_pg: destination page | ||
263 | * @dest_off: offset in page to copy to | ||
264 | * @src_pg: source page | ||
265 | * @src_off: offset in page to copy from | ||
266 | * @len: length | ||
267 | * | ||
268 | * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus | ||
269 | * address according to the DMA mapping API rules for streaming mappings. | ||
270 | * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident | ||
271 | * (kernel memory or locked user space pages). | ||
272 | */ | ||
273 | static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan, | ||
274 | struct page *dest_pg, unsigned int dest_off, struct page *src_pg, | ||
275 | unsigned int src_off, size_t len) | ||
276 | { | 338 | { |
277 | int cpu = get_cpu(); | 339 | set_bit(tx_type, dstp->bits); |
278 | per_cpu_ptr(chan->local, cpu)->bytes_transferred += len; | 340 | } |
279 | per_cpu_ptr(chan->local, cpu)->memcpy_count++; | ||
280 | put_cpu(); | ||
281 | 341 | ||
282 | return chan->device->device_memcpy_pg_to_pg(chan, dest_pg, dest_off, | 342 | #define dma_has_cap(tx, mask) __dma_has_cap((tx), &(mask)) |
283 | src_pg, src_off, len); | 343 | static inline int |
344 | __dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp) | ||
345 | { | ||
346 | return test_bit(tx_type, srcp->bits); | ||
284 | } | 347 | } |
285 | 348 | ||
349 | #define for_each_dma_cap_mask(cap, mask) \ | ||
350 | for ((cap) = first_dma_cap(mask); \ | ||
351 | (cap) < DMA_TX_TYPE_END; \ | ||
352 | (cap) = next_dma_cap((cap), (mask))) | ||
353 | |||
286 | /** | 354 | /** |
287 | * dma_async_memcpy_issue_pending - flush pending copies to HW | 355 | * dma_async_issue_pending - flush pending transactions to HW |
288 | * @chan: target DMA channel | 356 | * @chan: target DMA channel |
289 | * | 357 | * |
290 | * This allows drivers to push copies to HW in batches, | 358 | * This allows drivers to push copies to HW in batches, |
291 | * reducing MMIO writes where possible. | 359 | * reducing MMIO writes where possible. |
292 | */ | 360 | */ |
293 | static inline void dma_async_memcpy_issue_pending(struct dma_chan *chan) | 361 | static inline void dma_async_issue_pending(struct dma_chan *chan) |
294 | { | 362 | { |
295 | return chan->device->device_memcpy_issue_pending(chan); | 363 | return chan->device->device_issue_pending(chan); |
296 | } | 364 | } |
297 | 365 | ||
366 | #define dma_async_memcpy_issue_pending(chan) dma_async_issue_pending(chan) | ||
367 | |||
298 | /** | 368 | /** |
299 | * dma_async_memcpy_complete - poll for transaction completion | 369 | * dma_async_is_tx_complete - poll for transaction completion |
300 | * @chan: DMA channel | 370 | * @chan: DMA channel |
301 | * @cookie: transaction identifier to check status of | 371 | * @cookie: transaction identifier to check status of |
302 | * @last: returns last completed cookie, can be NULL | 372 | * @last: returns last completed cookie, can be NULL |
@@ -306,12 +376,15 @@ static inline void dma_async_memcpy_issue_pending(struct dma_chan *chan) | |||
306 | * internal state and can be used with dma_async_is_complete() to check | 376 | * internal state and can be used with dma_async_is_complete() to check |
307 | * the status of multiple cookies without re-checking hardware state. | 377 | * the status of multiple cookies without re-checking hardware state. |
308 | */ | 378 | */ |
309 | static inline enum dma_status dma_async_memcpy_complete(struct dma_chan *chan, | 379 | static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan, |
310 | dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used) | 380 | dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used) |
311 | { | 381 | { |
312 | return chan->device->device_memcpy_complete(chan, cookie, last, used); | 382 | return chan->device->device_is_tx_complete(chan, cookie, last, used); |
313 | } | 383 | } |
314 | 384 | ||
385 | #define dma_async_memcpy_complete(chan, cookie, last, used)\ | ||
386 | dma_async_is_tx_complete(chan, cookie, last, used) | ||
387 | |||
315 | /** | 388 | /** |
316 | * dma_async_is_complete - test a cookie against chan state | 389 | * dma_async_is_complete - test a cookie against chan state |
317 | * @cookie: transaction identifier to test status of | 390 | * @cookie: transaction identifier to test status of |
@@ -334,6 +407,7 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, | |||
334 | return DMA_IN_PROGRESS; | 407 | return DMA_IN_PROGRESS; |
335 | } | 408 | } |
336 | 409 | ||
410 | enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); | ||
337 | 411 | ||
338 | /* --- DMA device --- */ | 412 | /* --- DMA device --- */ |
339 | 413 | ||
@@ -362,5 +436,4 @@ dma_cookie_t dma_memcpy_pg_to_iovec(struct dma_chan *chan, struct iovec *iov, | |||
362 | struct dma_pinned_list *pinned_list, struct page *page, | 436 | struct dma_pinned_list *pinned_list, struct page *page, |
363 | unsigned int offset, size_t len); | 437 | unsigned int offset, size_t len); |
364 | 438 | ||
365 | #endif /* CONFIG_DMA_ENGINE */ | ||
366 | #endif /* DMAENGINE_H */ | 439 | #endif /* DMAENGINE_H */ |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 904bf3d2d90b..b8ac7b01c45e 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -12,9 +12,17 @@ enum dmi_field { | |||
12 | DMI_PRODUCT_NAME, | 12 | DMI_PRODUCT_NAME, |
13 | DMI_PRODUCT_VERSION, | 13 | DMI_PRODUCT_VERSION, |
14 | DMI_PRODUCT_SERIAL, | 14 | DMI_PRODUCT_SERIAL, |
15 | DMI_PRODUCT_UUID, | ||
15 | DMI_BOARD_VENDOR, | 16 | DMI_BOARD_VENDOR, |
16 | DMI_BOARD_NAME, | 17 | DMI_BOARD_NAME, |
17 | DMI_BOARD_VERSION, | 18 | DMI_BOARD_VERSION, |
19 | DMI_BOARD_SERIAL, | ||
20 | DMI_BOARD_ASSET_TAG, | ||
21 | DMI_CHASSIS_VENDOR, | ||
22 | DMI_CHASSIS_TYPE, | ||
23 | DMI_CHASSIS_VERSION, | ||
24 | DMI_CHASSIS_SERIAL, | ||
25 | DMI_CHASSIS_ASSET_TAG, | ||
18 | DMI_STRING_MAX, | 26 | DMI_STRING_MAX, |
19 | }; | 27 | }; |
20 | 28 | ||
diff --git a/include/linux/ds17287rtc.h b/include/linux/ds17287rtc.h index c281ba42e28f..d85d3f497b96 100644 --- a/include/linux/ds17287rtc.h +++ b/include/linux/ds17287rtc.h | |||
@@ -11,7 +11,6 @@ | |||
11 | #define __LINUX_DS17287RTC_H | 11 | #define __LINUX_DS17287RTC_H |
12 | 12 | ||
13 | #include <linux/rtc.h> /* get the user-level API */ | 13 | #include <linux/rtc.h> /* get the user-level API */ |
14 | #include <linux/spinlock.h> /* spinlock_t */ | ||
15 | #include <linux/mc146818rtc.h> | 14 | #include <linux/mc146818rtc.h> |
16 | 15 | ||
17 | /* Register A */ | 16 | /* Register A */ |
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 | |||
22 | extern int edac_op_state; | ||
23 | extern int edac_err_assert; | ||
24 | extern atomic_t edac_handlers; | ||
25 | |||
26 | extern int edac_handler_set(void); | ||
27 | extern void edac_atomic_assert_error(void); | ||
28 | |||
29 | #endif | ||
diff --git a/include/linux/edd.h b/include/linux/edd.h index b2b3e68aa512..7b647822d6dc 100644 --- a/include/linux/edd.h +++ b/include/linux/edd.h | |||
@@ -49,10 +49,6 @@ | |||
49 | #define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */ | 49 | #define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */ |
50 | #define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF | 50 | #define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF |
51 | in boot_params - treat this as 1 byte */ | 51 | in boot_params - treat this as 1 byte */ |
52 | #define EDD_CL_EQUALS 0x3d646465 /* "edd=" */ | ||
53 | #define EDD_CL_OFF 0x666f /* "of" for off */ | ||
54 | #define EDD_CL_SKIP 0x6b73 /* "sk" for skipmbr */ | ||
55 | #define EDD_CL_ON 0x6e6f /* "on" for on */ | ||
56 | 52 | ||
57 | #ifndef __ASSEMBLY__ | 53 | #ifndef __ASSEMBLY__ |
58 | 54 | ||
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index dfed8009ebff..16cb25cbf7c5 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h | |||
@@ -45,6 +45,7 @@ extern efs_block_t efs_map_block(struct inode *, efs_block_t); | |||
45 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); | 45 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); |
46 | 46 | ||
47 | extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); | 47 | extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); |
48 | extern struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp); | ||
48 | extern struct dentry *efs_get_parent(struct dentry *); | 49 | extern struct dentry *efs_get_parent(struct dentry *); |
49 | extern int efs_bmap(struct inode *, int); | 50 | extern int efs_bmap(struct inode *, int); |
50 | 51 | ||
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 ; \ |
47 | 1:.asciz #name ; \ | 47 | 1:.asciz #name ; \ |
48 | 2:.align 4 ; \ | 48 | 2:.balign 4 ; \ |
49 | 3:desctype descdata ; \ | 49 | 3: |
50 | 4:.align 4 ; \ | 50 | |
51 | #define ELFNOTE_END \ | ||
52 | 4484:.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/etherdevice.h b/include/linux/etherdevice.h index 071c67abed86..6cdb97365e47 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -39,13 +39,8 @@ extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev | |||
39 | extern int eth_header_cache(struct neighbour *neigh, | 39 | extern int eth_header_cache(struct neighbour *neigh, |
40 | struct hh_cache *hh); | 40 | struct hh_cache *hh); |
41 | 41 | ||
42 | extern struct net_device *alloc_etherdev(int sizeof_priv); | 42 | extern struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count); |
43 | static inline void eth_copy_and_sum (struct sk_buff *dest, | 43 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) |
44 | const unsigned char *src, | ||
45 | int len, int base) | ||
46 | { | ||
47 | memcpy (dest->data, src, len); | ||
48 | } | ||
49 | 44 | ||
50 | /** | 45 | /** |
51 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. | 46 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index f2d248f8cc92..3a632244f31b 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -265,6 +265,7 @@ u32 ethtool_op_get_link(struct net_device *dev); | |||
265 | u32 ethtool_op_get_tx_csum(struct net_device *dev); | 265 | u32 ethtool_op_get_tx_csum(struct net_device *dev); |
266 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); | 266 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); |
267 | int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); | 267 | int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); |
268 | int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data); | ||
268 | u32 ethtool_op_get_sg(struct net_device *dev); | 269 | u32 ethtool_op_get_sg(struct net_device *dev); |
269 | int ethtool_op_set_sg(struct net_device *dev, u32 data); | 270 | int ethtool_op_set_sg(struct net_device *dev, u32 data); |
270 | u32 ethtool_op_get_tso(struct net_device *dev); | 271 | u32 ethtool_op_get_tso(struct net_device *dev); |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h new file mode 100644 index 000000000000..8872fe8392d6 --- /dev/null +++ b/include/linux/exportfs.h | |||
@@ -0,0 +1,126 @@ | |||
1 | #ifndef LINUX_EXPORTFS_H | ||
2 | #define LINUX_EXPORTFS_H 1 | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct dentry; | ||
7 | struct super_block; | ||
8 | struct vfsmount; | ||
9 | |||
10 | |||
11 | /** | ||
12 | * struct export_operations - for nfsd to communicate with file systems | ||
13 | * @decode_fh: decode a file handle fragment and return a &struct dentry | ||
14 | * @encode_fh: encode a file handle fragment from a dentry | ||
15 | * @get_name: find the name for a given inode in a given directory | ||
16 | * @get_parent: find the parent of a given directory | ||
17 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment | ||
18 | * @find_exported_dentry: | ||
19 | * set by the exporting module to a standard helper function. | ||
20 | * | ||
21 | * Description: | ||
22 | * The export_operations structure provides a means for nfsd to communicate | ||
23 | * with a particular exported file system - particularly enabling nfsd and | ||
24 | * the filesystem to co-operate when dealing with file handles. | ||
25 | * | ||
26 | * export_operations contains two basic operation for dealing with file | ||
27 | * handles, decode_fh() and encode_fh(), and allows for some other | ||
28 | * operations to be defined which standard helper routines use to get | ||
29 | * specific information from the filesystem. | ||
30 | * | ||
31 | * nfsd encodes information use to determine which filesystem a filehandle | ||
32 | * applies to in the initial part of the file handle. The remainder, termed | ||
33 | * a file handle fragment, is controlled completely by the filesystem. The | ||
34 | * standard helper routines assume that this fragment will contain one or | ||
35 | * two sub-fragments, one which identifies the file, and one which may be | ||
36 | * used to identify the (a) directory containing the file. | ||
37 | * | ||
38 | * In some situations, nfsd needs to get a dentry which is connected into a | ||
39 | * specific part of the file tree. To allow for this, it passes the | ||
40 | * function acceptable() together with a @context which can be used to see | ||
41 | * if the dentry is acceptable. As there can be multiple dentrys for a | ||
42 | * given file, the filesystem should check each one for acceptability before | ||
43 | * looking for the next. As soon as an acceptable one is found, it should | ||
44 | * be returned. | ||
45 | * | ||
46 | * decode_fh: | ||
47 | * @decode_fh is given a &struct super_block (@sb), a file handle fragment | ||
48 | * (@fh, @fh_len) and an acceptability testing function (@acceptable, | ||
49 | * @context). It should return a &struct dentry which refers to the same | ||
50 | * file that the file handle fragment refers to, and which passes the | ||
51 | * acceptability test. If it cannot, it should return a %NULL pointer if | ||
52 | * the file was found but no acceptable &dentries were available, or a | ||
53 | * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or | ||
54 | * %ENOMEM). | ||
55 | * | ||
56 | * encode_fh: | ||
57 | * @encode_fh should store in the file handle fragment @fh (using at most | ||
58 | * @max_len bytes) information that can be used by @decode_fh to recover the | ||
59 | * file refered to by the &struct dentry @de. If the @connectable flag is | ||
60 | * set, the encode_fh() should store sufficient information so that a good | ||
61 | * attempt can be made to find not only the file but also it's place in the | ||
62 | * filesystem. This typically means storing a reference to de->d_parent in | ||
63 | * the filehandle fragment. encode_fh() should return the number of bytes | ||
64 | * stored or a negative error code such as %-ENOSPC | ||
65 | * | ||
66 | * get_name: | ||
67 | * @get_name should find a name for the given @child in the given @parent | ||
68 | * directory. The name should be stored in the @name (with the | ||
69 | * understanding that it is already pointing to a a %NAME_MAX+1 sized | ||
70 | * buffer. get_name() should return %0 on success, a negative error code | ||
71 | * or error. @get_name will be called without @parent->i_mutex held. | ||
72 | * | ||
73 | * get_parent: | ||
74 | * @get_parent should find the parent directory for the given @child which | ||
75 | * is also a directory. In the event that it cannot be found, or storage | ||
76 | * space cannot be allocated, a %ERR_PTR should be returned. | ||
77 | * | ||
78 | * get_dentry: | ||
79 | * Given a &super_block (@sb) and a pointer to a file-system specific inode | ||
80 | * identifier, possibly an inode number, (@inump) get_dentry() should find | ||
81 | * the identified inode and return a dentry for that inode. Any suitable | ||
82 | * dentry can be returned including, if necessary, a new dentry created with | ||
83 | * d_alloc_root. The caller can then find any other extant dentrys by | ||
84 | * following the d_alias links. If a new dentry was created using | ||
85 | * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry | ||
86 | * should be d_rehash()ed. | ||
87 | * | ||
88 | * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code | ||
89 | * can be returned. The @inump will be whatever was passed to | ||
90 | * nfsd_find_fh_dentry() in either the @obj or @parent parameters. | ||
91 | * | ||
92 | * Locking rules: | ||
93 | * get_parent is called with child->d_inode->i_mutex down | ||
94 | * get_name is not (which is possibly inconsistent) | ||
95 | */ | ||
96 | |||
97 | struct export_operations { | ||
98 | struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, | ||
99 | int fh_len, int fh_type, | ||
100 | int (*acceptable)(void *context, struct dentry *de), | ||
101 | void *context); | ||
102 | int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, | ||
103 | int connectable); | ||
104 | int (*get_name)(struct dentry *parent, char *name, | ||
105 | struct dentry *child); | ||
106 | struct dentry * (*get_parent)(struct dentry *child); | ||
107 | struct dentry * (*get_dentry)(struct super_block *sb, void *inump); | ||
108 | |||
109 | /* This is set by the exporting module to a standard helper */ | ||
110 | struct dentry * (*find_exported_dentry)( | ||
111 | struct super_block *sb, void *obj, void *parent, | ||
112 | int (*acceptable)(void *context, struct dentry *de), | ||
113 | void *context); | ||
114 | }; | ||
115 | |||
116 | extern struct dentry *find_exported_dentry(struct super_block *sb, void *obj, | ||
117 | void *parent, int (*acceptable)(void *context, struct dentry *de), | ||
118 | void *context); | ||
119 | |||
120 | extern int exportfs_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len, | ||
121 | int connectable); | ||
122 | extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, __u32 *fh, | ||
123 | int fh_len, int fileid_type, int (*acceptable)(void *, struct dentry *), | ||
124 | void *context); | ||
125 | |||
126 | #endif /* LINUX_EXPORTFS_H */ | ||
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index 4eda0ed76a48..d149f2959e67 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h | |||
@@ -33,6 +33,8 @@ struct ext2_sb_info { | |||
33 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ | 33 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ |
34 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ | 34 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ |
35 | unsigned long s_groups_count; /* Number of groups in the fs */ | 35 | unsigned long s_groups_count; /* Number of groups in the fs */ |
36 | unsigned long s_overhead_last; /* Last calculated overhead */ | ||
37 | unsigned long s_blocks_last; /* Last seen block count */ | ||
36 | struct buffer_head * s_sbh; /* Buffer containing the super block */ | 38 | struct buffer_head * s_sbh; /* Buffer containing the super block */ |
37 | struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ | 39 | struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ |
38 | struct buffer_head ** s_group_desc; | 40 | struct buffer_head ** s_group_desc; |
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index f61309c81cc4..d3c08353edf6 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h | |||
@@ -38,6 +38,8 @@ struct ext3_sb_info { | |||
38 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ | 38 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ |
39 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ | 39 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ |
40 | unsigned long s_groups_count; /* Number of groups in the fs */ | 40 | unsigned long s_groups_count; /* Number of groups in the fs */ |
41 | unsigned long s_overhead_last; /* Last calculated overhead */ | ||
42 | unsigned long s_blocks_last; /* Last seen block count */ | ||
41 | struct buffer_head * s_sbh; /* Buffer containing the super block */ | 43 | struct buffer_head * s_sbh; /* Buffer containing the super block */ |
42 | struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ | 44 | struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ |
43 | struct buffer_head ** s_group_desc; | 45 | struct buffer_head ** s_group_desc; |
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 */ |
206 | struct ext4_new_group_input { | 208 | struct 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 | |||
370 | static 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 | |||
377 | static 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) \ | ||
386 | do { \ | ||
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) \ | ||
394 | do { \ | ||
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) \ | ||
403 | do { \ | ||
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) \ | ||
411 | do { \ | ||
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 | ||
618 | static 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 | |||
536 | static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) | 625 | static 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); | |||
862 | extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); | 955 | extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); |
863 | extern void ext4_truncate (struct inode *); | 956 | extern void ext4_truncate (struct inode *); |
864 | extern void ext4_set_inode_flags(struct inode *); | 957 | extern void ext4_set_inode_flags(struct inode *); |
958 | extern void ext4_get_inode_flags(struct ext4_inode_info *); | ||
865 | extern void ext4_set_aops(struct inode *inode); | 959 | extern void ext4_set_aops(struct inode *inode); |
866 | extern int ext4_writepage_trans_blocks(struct inode *); | 960 | extern int ext4_writepage_trans_blocks(struct inode *); |
867 | extern int ext4_block_truncate_page(handle_t *handle, struct page *page, | 961 | extern 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, | |||
983 | extern void ext4_ext_truncate(struct inode *, struct page *); | 1077 | extern void ext4_ext_truncate(struct inode *, struct page *); |
984 | extern void ext4_ext_init(struct super_block *); | 1078 | extern void ext4_ext_init(struct super_block *); |
985 | extern void ext4_ext_release(struct super_block *); | 1079 | extern void ext4_ext_release(struct super_block *); |
1080 | extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset, | ||
1081 | loff_t len); | ||
986 | static inline int | 1082 | static inline int |
987 | ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, | 1083 | ext4_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 | ||
209 | static 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 | |||
216 | static 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 | |||
222 | static 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 | |||
191 | extern int ext4_extent_tree_init(handle_t *, struct inode *); | 229 | extern int ext4_extent_tree_init(handle_t *, struct inode *); |
192 | extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); | 230 | extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); |
231 | extern int ext4_ext_try_to_merge(struct inode *inode, | ||
232 | struct ext4_ext_path *path, | ||
233 | struct ext4_extent *); | ||
193 | extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *); | 234 | extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *); |
194 | extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); | 235 | extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); |
195 | extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *); | 236 | extern 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 691a713139ce..1b2ffee12be9 100644 --- a/include/linux/ext4_fs_sb.h +++ b/include/linux/ext4_fs_sb.h | |||
@@ -39,6 +39,8 @@ struct ext4_sb_info { | |||
39 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ | 39 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ |
40 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ | 40 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ |
41 | unsigned long s_groups_count; /* Number of groups in the fs */ | 41 | unsigned long s_groups_count; /* Number of groups in the fs */ |
42 | unsigned long s_overhead_last; /* Last calculated overhead */ | ||
43 | unsigned long s_blocks_last; /* Last seen block count */ | ||
42 | struct buffer_head * s_sbh; /* Buffer containing the super block */ | 44 | struct buffer_head * s_sbh; /* Buffer containing the super block */ |
43 | struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ | 45 | struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ |
44 | struct buffer_head ** s_group_desc; | 46 | struct buffer_head ** s_group_desc; |
@@ -71,7 +73,7 @@ struct ext4_sb_info { | |||
71 | struct list_head s_orphan; | 73 | struct list_head s_orphan; |
72 | unsigned long s_commit_interval; | 74 | unsigned long s_commit_interval; |
73 | struct block_device *journal_bdev; | 75 | struct block_device *journal_bdev; |
74 | #ifdef CONFIG_JBD_DEBUG | 76 | #ifdef CONFIG_JBD2_DEBUG |
75 | 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) */ |
76 | 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 */ |
77 | #endif | 79 | #endif |
@@ -79,6 +81,7 @@ struct ext4_sb_info { | |||
79 | 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 */ |
80 | int s_jquota_fmt; /* Format of quota to use */ | 82 | int s_jquota_fmt; /* Format of quota to use */ |
81 | #endif | 83 | #endif |
84 | unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */ | ||
82 | 85 | ||
83 | #ifdef EXTENTS_STATS | 86 | #ifdef EXTENTS_STATS |
84 | /* 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/fb.h b/include/linux/fb.h index 66226824ab68..cec54106aa87 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -119,6 +119,7 @@ struct dentry; | |||
119 | #define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */ | 119 | #define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */ |
120 | #define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ | 120 | #define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ |
121 | #define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ | 121 | #define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ |
122 | #define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */ | ||
122 | #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ | 123 | #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ |
123 | #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ | 124 | #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ |
124 | #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ | 125 | #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ |
@@ -529,6 +530,8 @@ struct fb_cursor_user { | |||
529 | #define FB_EVENT_CONBLANK 0x0C | 530 | #define FB_EVENT_CONBLANK 0x0C |
530 | /* Get drawing requirements */ | 531 | /* Get drawing requirements */ |
531 | #define FB_EVENT_GET_REQ 0x0D | 532 | #define FB_EVENT_GET_REQ 0x0D |
533 | /* Unbind from the console if possible */ | ||
534 | #define FB_EVENT_FB_UNBIND 0x0E | ||
532 | 535 | ||
533 | struct fb_event { | 536 | struct fb_event { |
534 | struct fb_info *info; | 537 | struct fb_info *info; |
diff --git a/include/linux/file.h b/include/linux/file.h index a59001e9ea58..0114fbc78061 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -73,6 +73,7 @@ extern struct file * FASTCALL(fget_light(unsigned int fd, int *fput_needed)); | |||
73 | extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag)); | 73 | extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag)); |
74 | extern void put_filp(struct file *); | 74 | extern void put_filp(struct file *); |
75 | extern int get_unused_fd(void); | 75 | extern int get_unused_fd(void); |
76 | extern int get_unused_fd_flags(int flags); | ||
76 | extern void FASTCALL(put_unused_fd(unsigned int fd)); | 77 | extern void FASTCALL(put_unused_fd(unsigned int fd)); |
77 | struct kmem_cache; | 78 | struct kmem_cache; |
78 | 79 | ||
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 4631086f5060..c8e02de737f6 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -1,5 +1,8 @@ | |||
1 | /* Freezer declarations */ | 1 | /* Freezer declarations */ |
2 | 2 | ||
3 | #ifndef FREEZER_H_INCLUDED | ||
4 | #define FREEZER_H_INCLUDED | ||
5 | |||
3 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
4 | 7 | ||
5 | #ifdef CONFIG_PM | 8 | #ifdef CONFIG_PM |
@@ -22,7 +25,7 @@ static inline int freezing(struct task_struct *p) | |||
22 | /* | 25 | /* |
23 | * Request that a process be frozen | 26 | * Request that a process be frozen |
24 | */ | 27 | */ |
25 | static inline void freeze(struct task_struct *p) | 28 | static inline void set_freeze_flag(struct task_struct *p) |
26 | { | 29 | { |
27 | set_tsk_thread_flag(p, TIF_FREEZE); | 30 | set_tsk_thread_flag(p, TIF_FREEZE); |
28 | } | 31 | } |
@@ -30,7 +33,7 @@ static inline void freeze(struct task_struct *p) | |||
30 | /* | 33 | /* |
31 | * Sometimes we may need to cancel the previous 'freeze' request | 34 | * Sometimes we may need to cancel the previous 'freeze' request |
32 | */ | 35 | */ |
33 | static inline void do_not_freeze(struct task_struct *p) | 36 | static inline void clear_freeze_flag(struct task_struct *p) |
34 | { | 37 | { |
35 | clear_tsk_thread_flag(p, TIF_FREEZE); | 38 | clear_tsk_thread_flag(p, TIF_FREEZE); |
36 | } | 39 | } |
@@ -53,7 +56,7 @@ static inline int thaw_process(struct task_struct *p) | |||
53 | wake_up_process(p); | 56 | wake_up_process(p); |
54 | return 1; | 57 | return 1; |
55 | } | 58 | } |
56 | clear_tsk_thread_flag(p, TIF_FREEZE); | 59 | clear_freeze_flag(p); |
57 | task_unlock(p); | 60 | task_unlock(p); |
58 | return 0; | 61 | return 0; |
59 | } | 62 | } |
@@ -115,10 +118,19 @@ static inline int freezer_should_skip(struct task_struct *p) | |||
115 | return !!(p->flags & PF_FREEZER_SKIP); | 118 | return !!(p->flags & PF_FREEZER_SKIP); |
116 | } | 119 | } |
117 | 120 | ||
121 | /* | ||
122 | * Tell the freezer that the current task should be frozen by it | ||
123 | */ | ||
124 | static inline void set_freezable(void) | ||
125 | { | ||
126 | current->flags &= ~PF_NOFREEZE; | ||
127 | } | ||
128 | |||
118 | #else | 129 | #else |
119 | static inline int frozen(struct task_struct *p) { return 0; } | 130 | static inline int frozen(struct task_struct *p) { return 0; } |
120 | static inline int freezing(struct task_struct *p) { return 0; } | 131 | static inline int freezing(struct task_struct *p) { return 0; } |
121 | static inline void freeze(struct task_struct *p) { BUG(); } | 132 | static inline void set_freeze_flag(struct task_struct *p) {} |
133 | static inline void clear_freeze_flag(struct task_struct *p) {} | ||
122 | static inline int thaw_process(struct task_struct *p) { return 1; } | 134 | static inline int thaw_process(struct task_struct *p) { return 1; } |
123 | 135 | ||
124 | static inline void refrigerator(void) {} | 136 | static inline void refrigerator(void) {} |
@@ -130,4 +142,7 @@ static inline int try_to_freeze(void) { return 0; } | |||
130 | static inline void freezer_do_not_count(void) {} | 142 | static inline void freezer_do_not_count(void) {} |
131 | static inline void freezer_count(void) {} | 143 | static inline void freezer_count(void) {} |
132 | static inline int freezer_should_skip(struct task_struct *p) { return 0; } | 144 | static inline int freezer_should_skip(struct task_struct *p) { return 0; } |
145 | static inline void set_freezable(void) {} | ||
133 | #endif | 146 | #endif |
147 | |||
148 | #endif /* FREEZER_H_INCLUDED */ | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4f0b3bf5983c..d33beadd9a43 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -44,7 +44,7 @@ extern int get_max_files(void); | |||
44 | struct inodes_stat_t { | 44 | struct inodes_stat_t { |
45 | int nr_inodes; | 45 | int nr_inodes; |
46 | int nr_unused; | 46 | int nr_unused; |
47 | int dummy[5]; | 47 | int dummy[5]; /* padding for sysctl ABI compatibility */ |
48 | }; | 48 | }; |
49 | extern struct inodes_stat_t inodes_stat; | 49 | extern struct inodes_stat_t inodes_stat; |
50 | 50 | ||
@@ -283,11 +283,14 @@ extern int dir_notify_enable; | |||
283 | #include <linux/init.h> | 283 | #include <linux/init.h> |
284 | #include <linux/pid.h> | 284 | #include <linux/pid.h> |
285 | #include <linux/mutex.h> | 285 | #include <linux/mutex.h> |
286 | #include <linux/sysctl.h> | ||
287 | #include <linux/capability.h> | ||
286 | 288 | ||
287 | #include <asm/atomic.h> | 289 | #include <asm/atomic.h> |
288 | #include <asm/semaphore.h> | 290 | #include <asm/semaphore.h> |
289 | #include <asm/byteorder.h> | 291 | #include <asm/byteorder.h> |
290 | 292 | ||
293 | struct export_operations; | ||
291 | struct hd_geometry; | 294 | struct hd_geometry; |
292 | struct iovec; | 295 | struct iovec; |
293 | struct nameidata; | 296 | struct nameidata; |
@@ -694,20 +697,26 @@ struct fown_struct { | |||
694 | * Track a single file's readahead state | 697 | * Track a single file's readahead state |
695 | */ | 698 | */ |
696 | struct file_ra_state { | 699 | struct file_ra_state { |
697 | unsigned long start; /* Current window */ | 700 | pgoff_t start; /* where readahead started */ |
698 | unsigned long size; | 701 | unsigned long size; /* # of readahead pages */ |
699 | unsigned long flags; /* ra flags RA_FLAG_xxx*/ | 702 | unsigned long async_size; /* do asynchronous readahead when |
700 | unsigned long cache_hit; /* cache hit count*/ | 703 | there are only # of pages ahead */ |
701 | unsigned long prev_index; /* Cache last read() position */ | 704 | |
702 | unsigned long ahead_start; /* Ahead window */ | ||
703 | unsigned long ahead_size; | ||
704 | unsigned long ra_pages; /* Maximum readahead window */ | 705 | unsigned long ra_pages; /* Maximum readahead window */ |
705 | unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ | 706 | unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ |
706 | 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 */ | ||
707 | 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 */ |
708 | }; | 710 | }; |
709 | #define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */ | 711 | |
710 | #define RA_FLAG_INCACHE 0x02 /* file is already in cache */ | 712 | /* |
713 | * Check if @index falls in the readahead windows. | ||
714 | */ | ||
715 | static 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 | } | ||
711 | 720 | ||
712 | struct file { | 721 | struct file { |
713 | /* | 722 | /* |
@@ -820,6 +829,10 @@ struct file_lock { | |||
820 | union { | 829 | union { |
821 | struct nfs_lock_info nfs_fl; | 830 | struct nfs_lock_info nfs_fl; |
822 | struct nfs4_lock_info nfs4_fl; | 831 | struct nfs4_lock_info nfs4_fl; |
832 | struct { | ||
833 | struct list_head link; /* link in AFS vnode's pending_locks list */ | ||
834 | int state; /* state of grant or error if -ve */ | ||
835 | } afs; | ||
823 | } fl_u; | 836 | } fl_u; |
824 | }; | 837 | }; |
825 | 838 | ||
@@ -855,7 +868,7 @@ extern void locks_init_lock(struct file_lock *); | |||
855 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | 868 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); |
856 | extern void locks_remove_posix(struct file *, fl_owner_t); | 869 | extern void locks_remove_posix(struct file *, fl_owner_t); |
857 | extern void locks_remove_flock(struct file *); | 870 | extern void locks_remove_flock(struct file *); |
858 | extern int posix_test_lock(struct file *, struct file_lock *); | 871 | extern void posix_test_lock(struct file *, struct file_lock *); |
859 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); | 872 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); |
860 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 873 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
861 | extern int posix_unblock_lock(struct file *, struct file_lock *); | 874 | extern int posix_unblock_lock(struct file *, struct file_lock *); |
@@ -866,6 +879,7 @@ extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | |||
866 | extern int __break_lease(struct inode *inode, unsigned int flags); | 879 | extern int __break_lease(struct inode *inode, unsigned int flags); |
867 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 880 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
868 | extern int setlease(struct file *, long, struct file_lock **); | 881 | extern int setlease(struct file *, long, struct file_lock **); |
882 | extern int vfs_setlease(struct file *, long, struct file_lock **); | ||
869 | extern int lease_modify(struct file_lock **, int); | 883 | extern int lease_modify(struct file_lock **, int); |
870 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | 884 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); |
871 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | 885 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); |
@@ -984,6 +998,9 @@ enum { | |||
984 | #define put_fs_excl() atomic_dec(¤t->fs_excl) | 998 | #define put_fs_excl() atomic_dec(¤t->fs_excl) |
985 | #define has_fs_excl() atomic_read(¤t->fs_excl) | 999 | #define has_fs_excl() atomic_read(¤t->fs_excl) |
986 | 1000 | ||
1001 | #define is_owner_or_cap(inode) \ | ||
1002 | ((current->fsuid == (inode)->i_uid) || capable(CAP_FOWNER)) | ||
1003 | |||
987 | /* not quite ready to be deprecated, but... */ | 1004 | /* not quite ready to be deprecated, but... */ |
988 | extern void lock_super(struct super_block *); | 1005 | extern void lock_super(struct super_block *); |
989 | extern void unlock_super(struct super_block *); | 1006 | extern void unlock_super(struct super_block *); |
@@ -1112,6 +1129,7 @@ struct file_operations { | |||
1112 | int (*flock) (struct file *, int, struct file_lock *); | 1129 | int (*flock) (struct file *, int, struct file_lock *); |
1113 | 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); |
1114 | 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 **); | ||
1115 | }; | 1133 | }; |
1116 | 1134 | ||
1117 | struct inode_operations { | 1135 | struct inode_operations { |
@@ -1137,6 +1155,8 @@ struct inode_operations { | |||
1137 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 1155 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
1138 | int (*removexattr) (struct dentry *, const char *); | 1156 | int (*removexattr) (struct dentry *, const char *); |
1139 | 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); | ||
1140 | }; | 1160 | }; |
1141 | 1161 | ||
1142 | struct seq_file; | 1162 | struct seq_file; |
@@ -1273,119 +1293,6 @@ static inline void file_accessed(struct file *file) | |||
1273 | 1293 | ||
1274 | int sync_inode(struct inode *inode, struct writeback_control *wbc); | 1294 | int sync_inode(struct inode *inode, struct writeback_control *wbc); |
1275 | 1295 | ||
1276 | /** | ||
1277 | * struct export_operations - for nfsd to communicate with file systems | ||
1278 | * @decode_fh: decode a file handle fragment and return a &struct dentry | ||
1279 | * @encode_fh: encode a file handle fragment from a dentry | ||
1280 | * @get_name: find the name for a given inode in a given directory | ||
1281 | * @get_parent: find the parent of a given directory | ||
1282 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment | ||
1283 | * @find_exported_dentry: | ||
1284 | * set by the exporting module to a standard helper function. | ||
1285 | * | ||
1286 | * Description: | ||
1287 | * The export_operations structure provides a means for nfsd to communicate | ||
1288 | * with a particular exported file system - particularly enabling nfsd and | ||
1289 | * the filesystem to co-operate when dealing with file handles. | ||
1290 | * | ||
1291 | * export_operations contains two basic operation for dealing with file | ||
1292 | * handles, decode_fh() and encode_fh(), and allows for some other | ||
1293 | * operations to be defined which standard helper routines use to get | ||
1294 | * specific information from the filesystem. | ||
1295 | * | ||
1296 | * nfsd encodes information use to determine which filesystem a filehandle | ||
1297 | * applies to in the initial part of the file handle. The remainder, termed | ||
1298 | * a file handle fragment, is controlled completely by the filesystem. The | ||
1299 | * standard helper routines assume that this fragment will contain one or | ||
1300 | * two sub-fragments, one which identifies the file, and one which may be | ||
1301 | * used to identify the (a) directory containing the file. | ||
1302 | * | ||
1303 | * In some situations, nfsd needs to get a dentry which is connected into a | ||
1304 | * specific part of the file tree. To allow for this, it passes the | ||
1305 | * function acceptable() together with a @context which can be used to see | ||
1306 | * if the dentry is acceptable. As there can be multiple dentrys for a | ||
1307 | * given file, the filesystem should check each one for acceptability before | ||
1308 | * looking for the next. As soon as an acceptable one is found, it should | ||
1309 | * be returned. | ||
1310 | * | ||
1311 | * decode_fh: | ||
1312 | * @decode_fh is given a &struct super_block (@sb), a file handle fragment | ||
1313 | * (@fh, @fh_len) and an acceptability testing function (@acceptable, | ||
1314 | * @context). It should return a &struct dentry which refers to the same | ||
1315 | * file that the file handle fragment refers to, and which passes the | ||
1316 | * acceptability test. If it cannot, it should return a %NULL pointer if | ||
1317 | * the file was found but no acceptable &dentries were available, or a | ||
1318 | * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or | ||
1319 | * %ENOMEM). | ||
1320 | * | ||
1321 | * encode_fh: | ||
1322 | * @encode_fh should store in the file handle fragment @fh (using at most | ||
1323 | * @max_len bytes) information that can be used by @decode_fh to recover the | ||
1324 | * file refered to by the &struct dentry @de. If the @connectable flag is | ||
1325 | * set, the encode_fh() should store sufficient information so that a good | ||
1326 | * attempt can be made to find not only the file but also it's place in the | ||
1327 | * filesystem. This typically means storing a reference to de->d_parent in | ||
1328 | * the filehandle fragment. encode_fh() should return the number of bytes | ||
1329 | * stored or a negative error code such as %-ENOSPC | ||
1330 | * | ||
1331 | * get_name: | ||
1332 | * @get_name should find a name for the given @child in the given @parent | ||
1333 | * directory. The name should be stored in the @name (with the | ||
1334 | * understanding that it is already pointing to a a %NAME_MAX+1 sized | ||
1335 | * buffer. get_name() should return %0 on success, a negative error code | ||
1336 | * or error. @get_name will be called without @parent->i_mutex held. | ||
1337 | * | ||
1338 | * get_parent: | ||
1339 | * @get_parent should find the parent directory for the given @child which | ||
1340 | * is also a directory. In the event that it cannot be found, or storage | ||
1341 | * space cannot be allocated, a %ERR_PTR should be returned. | ||
1342 | * | ||
1343 | * get_dentry: | ||
1344 | * Given a &super_block (@sb) and a pointer to a file-system specific inode | ||
1345 | * identifier, possibly an inode number, (@inump) get_dentry() should find | ||
1346 | * the identified inode and return a dentry for that inode. Any suitable | ||
1347 | * dentry can be returned including, if necessary, a new dentry created with | ||
1348 | * d_alloc_root. The caller can then find any other extant dentrys by | ||
1349 | * following the d_alias links. If a new dentry was created using | ||
1350 | * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry | ||
1351 | * should be d_rehash()ed. | ||
1352 | * | ||
1353 | * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code | ||
1354 | * can be returned. The @inump will be whatever was passed to | ||
1355 | * nfsd_find_fh_dentry() in either the @obj or @parent parameters. | ||
1356 | * | ||
1357 | * Locking rules: | ||
1358 | * get_parent is called with child->d_inode->i_mutex down | ||
1359 | * get_name is not (which is possibly inconsistent) | ||
1360 | */ | ||
1361 | |||
1362 | struct export_operations { | ||
1363 | struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, int fh_len, int fh_type, | ||
1364 | int (*acceptable)(void *context, struct dentry *de), | ||
1365 | void *context); | ||
1366 | int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, | ||
1367 | int connectable); | ||
1368 | |||
1369 | /* the following are only called from the filesystem itself */ | ||
1370 | int (*get_name)(struct dentry *parent, char *name, | ||
1371 | struct dentry *child); | ||
1372 | struct dentry * (*get_parent)(struct dentry *child); | ||
1373 | struct dentry * (*get_dentry)(struct super_block *sb, void *inump); | ||
1374 | |||
1375 | /* This is set by the exporting module to a standard helper */ | ||
1376 | struct dentry * (*find_exported_dentry)( | ||
1377 | struct super_block *sb, void *obj, void *parent, | ||
1378 | int (*acceptable)(void *context, struct dentry *de), | ||
1379 | void *context); | ||
1380 | |||
1381 | |||
1382 | }; | ||
1383 | |||
1384 | extern struct dentry * | ||
1385 | find_exported_dentry(struct super_block *sb, void *obj, void *parent, | ||
1386 | int (*acceptable)(void *context, struct dentry *de), | ||
1387 | void *context); | ||
1388 | |||
1389 | struct file_system_type { | 1296 | struct file_system_type { |
1390 | const char *name; | 1297 | const char *name; |
1391 | int fs_flags; | 1298 | int fs_flags; |
@@ -1522,7 +1429,7 @@ extern void putname(const char *name); | |||
1522 | 1429 | ||
1523 | #ifdef CONFIG_BLOCK | 1430 | #ifdef CONFIG_BLOCK |
1524 | extern int register_blkdev(unsigned int, const char *); | 1431 | extern int register_blkdev(unsigned int, const char *); |
1525 | extern int unregister_blkdev(unsigned int, const char *); | 1432 | extern void unregister_blkdev(unsigned int, const char *); |
1526 | extern struct block_device *bdget(dev_t); | 1433 | extern struct block_device *bdget(dev_t); |
1527 | extern void bd_set_size(struct block_device *, loff_t size); | 1434 | extern void bd_set_size(struct block_device *, loff_t size); |
1528 | extern void bd_forget(struct inode *inode); | 1435 | extern void bd_forget(struct inode *inode); |
@@ -1562,7 +1469,7 @@ extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | |||
1562 | extern int register_chrdev_region(dev_t, unsigned, const char *); | 1469 | extern int register_chrdev_region(dev_t, unsigned, const char *); |
1563 | extern int register_chrdev(unsigned int, const char *, | 1470 | extern int register_chrdev(unsigned int, const char *, |
1564 | const struct file_operations *); | 1471 | const struct file_operations *); |
1565 | extern int unregister_chrdev(unsigned int, const char *); | 1472 | extern void unregister_chrdev(unsigned int, const char *); |
1566 | extern void unregister_chrdev_region(dev_t, unsigned); | 1473 | extern void unregister_chrdev_region(dev_t, unsigned); |
1567 | extern int chrdev_open(struct inode *, struct file *); | 1474 | extern int chrdev_open(struct inode *, struct file *); |
1568 | extern void chrdev_show(struct seq_file *,off_t); | 1475 | extern void chrdev_show(struct seq_file *,off_t); |
@@ -1610,6 +1517,9 @@ extern int __invalidate_device(struct block_device *); | |||
1610 | extern int invalidate_partition(struct gendisk *, int); | 1517 | extern int invalidate_partition(struct gendisk *, int); |
1611 | #endif | 1518 | #endif |
1612 | extern int invalidate_inodes(struct super_block *); | 1519 | extern int invalidate_inodes(struct super_block *); |
1520 | unsigned long __invalidate_mapping_pages(struct address_space *mapping, | ||
1521 | pgoff_t start, pgoff_t end, | ||
1522 | bool be_atomic); | ||
1613 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 1523 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
1614 | pgoff_t start, pgoff_t end); | 1524 | pgoff_t start, pgoff_t end); |
1615 | 1525 | ||
@@ -2043,5 +1953,9 @@ static inline void free_secdata(void *secdata) | |||
2043 | { } | 1953 | { } |
2044 | #endif /* CONFIG_SECURITY */ | 1954 | #endif /* CONFIG_SECURITY */ |
2045 | 1955 | ||
1956 | int proc_nr_files(ctl_table *table, int write, struct file *filp, | ||
1957 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
1958 | |||
1959 | |||
2046 | #endif /* __KERNEL__ */ | 1960 | #endif /* __KERNEL__ */ |
2047 | #endif /* _LINUX_FS_H */ | 1961 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 73710d617775..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 | ||
58 | struct gianfar_mdio_data { | 59 | struct gianfar_mdio_data { |
@@ -112,7 +113,7 @@ struct fsl_usb2_platform_data { | |||
112 | struct fsl_spi_platform_data { | 113 | struct fsl_spi_platform_data { |
113 | u32 initial_spmode; /* initial SPMODE value */ | 114 | u32 initial_spmode; /* initial SPMODE value */ |
114 | u16 bus_num; | 115 | u16 bus_num; |
115 | 116 | bool qe_mode; | |
116 | /* board specific information */ | 117 | /* board specific information */ |
117 | u16 max_chipselect; | 118 | u16 max_chipselect; |
118 | void (*activate_cs)(u8 cs, u8 polarity); | 119 | void (*activate_cs)(u8 cs, u8 polarity); |
@@ -120,5 +121,10 @@ struct fsl_spi_platform_data { | |||
120 | u32 sysclk; | 121 | u32 sysclk; |
121 | }; | 122 | }; |
122 | 123 | ||
124 | struct mpc8xx_pcmcia_ops { | ||
125 | void(*hw_ctrl)(int slot, int enable); | ||
126 | int(*voltage_set)(int slot, int vcc, int vpp); | ||
127 | }; | ||
128 | |||
123 | #endif /* _FSL_DEVICE_H_ */ | 129 | #endif /* _FSL_DEVICE_H_ */ |
124 | #endif /* __KERNEL__ */ | 130 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 534744efe30d..9fbe9d258e22 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -339,7 +339,7 @@ struct fuse_dirent { | |||
339 | char name[0]; | 339 | char name[0]; |
340 | }; | 340 | }; |
341 | 341 | ||
342 | #define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name) | 342 | #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) |
343 | #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) | 343 | #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) |
344 | #define FUSE_DIRENT_SIZE(d) \ | 344 | #define FUSE_DIRENT_SIZE(d) \ |
345 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) | 345 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) |
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 | ||
73 | enum { | ||
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/gfp.h b/include/linux/gfp.h index 0d2ef0b082a6..bc68dd9a6d41 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -30,6 +30,9 @@ struct vm_area_struct; | |||
30 | * cannot handle allocation failures. | 30 | * cannot handle allocation failures. |
31 | * | 31 | * |
32 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. | 32 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. |
33 | * | ||
34 | * __GFP_MOVABLE: Flag that this page will be movable by the page migration | ||
35 | * mechanism or reclaimed | ||
33 | */ | 36 | */ |
34 | #define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ | 37 | #define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ |
35 | #define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ | 38 | #define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ |
@@ -45,6 +48,7 @@ struct vm_area_struct; | |||
45 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ | 48 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ |
46 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ | 49 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ |
47 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ | 50 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ |
51 | #define __GFP_MOVABLE ((__force gfp_t)0x80000u) /* Page is movable */ | ||
48 | 52 | ||
49 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 53 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ |
50 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 54 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
@@ -53,7 +57,8 @@ struct vm_area_struct; | |||
53 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | 57 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ |
54 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ | 58 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ |
55 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \ | 59 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \ |
56 | __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE) | 60 | __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE| \ |
61 | __GFP_MOVABLE) | ||
57 | 62 | ||
58 | /* This equals 0, but use constants in case they ever change */ | 63 | /* This equals 0, but use constants in case they ever change */ |
59 | #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) | 64 | #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) |
@@ -65,6 +70,15 @@ struct vm_area_struct; | |||
65 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) | 70 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) |
66 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ | 71 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ |
67 | __GFP_HIGHMEM) | 72 | __GFP_HIGHMEM) |
73 | #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
74 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | ||
75 | __GFP_MOVABLE) | ||
76 | #define GFP_NOFS_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_MOVABLE) | ||
77 | #define GFP_USER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
78 | __GFP_HARDWALL | __GFP_MOVABLE) | ||
79 | #define GFP_HIGHUSER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
80 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | ||
81 | __GFP_MOVABLE) | ||
68 | 82 | ||
69 | #ifdef CONFIG_NUMA | 83 | #ifdef CONFIG_NUMA |
70 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 84 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
@@ -92,6 +106,9 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
92 | if (flags & __GFP_DMA32) | 106 | if (flags & __GFP_DMA32) |
93 | return ZONE_DMA32; | 107 | return ZONE_DMA32; |
94 | #endif | 108 | #endif |
109 | if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) == | ||
110 | (__GFP_HIGHMEM | __GFP_MOVABLE)) | ||
111 | return ZONE_MOVABLE; | ||
95 | #ifdef CONFIG_HIGHMEM | 112 | #ifdef CONFIG_HIGHMEM |
96 | if (flags & __GFP_HIGHMEM) | 113 | if (flags & __GFP_HIGHMEM) |
97 | return ZONE_HIGHMEM; | 114 | return ZONE_HIGHMEM; |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 98e2cce996a4..1fcb0033179e 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -73,10 +73,27 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 75 | #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
76 | /** | ||
77 | * __alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA with caller-specified movable GFP flags | ||
78 | * @movableflags: The GFP flags related to the pages future ability to move like __GFP_MOVABLE | ||
79 | * @vma: The VMA the page is to be allocated for | ||
80 | * @vaddr: The virtual address the page will be inserted into | ||
81 | * | ||
82 | * This function will allocate a page for a VMA but the caller is expected | ||
83 | * to specify via movableflags whether the page will be movable in the | ||
84 | * future or not | ||
85 | * | ||
86 | * An architecture may override this function by defining | ||
87 | * __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE and providing their own | ||
88 | * implementation. | ||
89 | */ | ||
76 | static inline struct page * | 90 | static inline struct page * |
77 | alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr) | 91 | __alloc_zeroed_user_highpage(gfp_t movableflags, |
92 | struct vm_area_struct *vma, | ||
93 | unsigned long vaddr) | ||
78 | { | 94 | { |
79 | struct page *page = alloc_page_vma(GFP_HIGHUSER, vma, vaddr); | 95 | struct page *page = alloc_page_vma(GFP_HIGHUSER | movableflags, |
96 | vma, vaddr); | ||
80 | 97 | ||
81 | if (page) | 98 | if (page) |
82 | clear_user_highpage(page, vaddr); | 99 | clear_user_highpage(page, vaddr); |
@@ -85,6 +102,21 @@ alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr) | |||
85 | } | 102 | } |
86 | #endif | 103 | #endif |
87 | 104 | ||
105 | /** | ||
106 | * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move | ||
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 | * be able to migrate in the future using move_pages() or reclaimed | ||
112 | */ | ||
113 | static inline struct page * | ||
114 | alloc_zeroed_user_highpage_movable(struct vm_area_struct *vma, | ||
115 | unsigned long vaddr) | ||
116 | { | ||
117 | return __alloc_zeroed_user_highpage(__GFP_MOVABLE, vma, vaddr); | ||
118 | } | ||
119 | |||
88 | static inline void clear_highpage(struct page *page) | 120 | static inline void clear_highpage(struct page *page) |
89 | { | 121 | { |
90 | void *kaddr = kmap_atomic(page, KM_USER0); | 122 | void *kaddr = kmap_atomic(page, KM_USER0); |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 17c29dca8354..540799bc85f8 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -329,12 +329,13 @@ extern void sysrq_timer_list_show(void); | |||
329 | #ifdef CONFIG_TIMER_STATS | 329 | #ifdef CONFIG_TIMER_STATS |
330 | 330 | ||
331 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | 331 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, |
332 | void *timerf, char * comm); | 332 | void *timerf, char *comm, |
333 | unsigned int timer_flag); | ||
333 | 334 | ||
334 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | 335 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) |
335 | { | 336 | { |
336 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | 337 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, |
337 | timer->function, timer->start_comm); | 338 | timer->function, timer->start_comm, 0); |
338 | } | 339 | } |
339 | 340 | ||
340 | extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, | 341 | extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 2c13715e9dde..49b7053043ad 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -15,6 +15,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
15 | } | 15 | } |
16 | 16 | ||
17 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 17 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
18 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | ||
18 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 19 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
19 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); | 20 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); |
20 | void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); | 21 | void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); |
@@ -29,6 +30,7 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to); | |||
29 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | 30 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); |
30 | 31 | ||
31 | extern unsigned long max_huge_pages; | 32 | extern unsigned long max_huge_pages; |
33 | extern unsigned long hugepages_treat_as_movable; | ||
32 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 34 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
33 | extern int sysctl_hugetlb_shm_group; | 35 | extern int sysctl_hugetlb_shm_group; |
34 | 36 | ||
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 | |||
26 | extern int i2c_isa_add_driver(struct i2c_driver *driver); | ||
27 | extern 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 cae7d618030c..0c37a737a2b2 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -90,7 +90,7 @@ extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | |||
90 | const u8 *values); | 90 | const u8 *values); |
91 | /* Returns the number of read bytes */ | 91 | /* Returns the number of read bytes */ |
92 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | 92 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, |
93 | u8 command, u8 *values); | 93 | u8 command, u8 length, u8 *values); |
94 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, | 94 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, |
95 | u8 command, u8 length, | 95 | u8 command, u8 length, |
96 | const u8 *values); | 96 | const u8 *values); |
@@ -150,15 +150,20 @@ struct i2c_driver { | |||
150 | 150 | ||
151 | /** | 151 | /** |
152 | * struct i2c_client - represent an I2C slave device | 152 | * struct i2c_client - represent an I2C slave device |
153 | * @flags: I2C_CLIENT_TEN indicates the device uses a ten bit chip address; | ||
154 | * I2C_CLIENT_PEC indicates it uses SMBus Packet Error Checking | ||
153 | * @addr: Address used on the I2C bus connected to the parent adapter. | 155 | * @addr: Address used on the I2C bus connected to the parent adapter. |
154 | * @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 |
155 | * 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 | ||
156 | * @dev: Driver model device node for the slave. | 159 | * @dev: Driver model device node for the slave. |
160 | * @irq: indicates the IRQ generated by this device (if any) | ||
157 | * @driver_name: Identifies new-style driver used with this device; also | 161 | * @driver_name: Identifies new-style driver used with this device; also |
158 | * used as the module name for hotplug/coldplug modprobe support. | 162 | * used as the module name for hotplug/coldplug modprobe support. |
159 | * | 163 | * |
160 | * An i2c_client identifies a single device (i.e. chip) connected to an | 164 | * An i2c_client identifies a single device (i.e. chip) connected to an |
161 | * i2c bus. The behaviour is defined by the routines of the driver. | 165 | * i2c bus. The behaviour exposed to Linux is defined by the driver |
166 | * managing the device. | ||
162 | */ | 167 | */ |
163 | struct i2c_client { | 168 | struct i2c_client { |
164 | unsigned short flags; /* div., see below */ | 169 | unsigned short flags; /* div., see below */ |
@@ -180,7 +185,8 @@ struct i2c_client { | |||
180 | 185 | ||
181 | static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) | 186 | static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) |
182 | { | 187 | { |
183 | return to_i2c_client(container_of(kobj, struct device, kobj)); | 188 | struct device * const dev = container_of(kobj, struct device, kobj); |
189 | return to_i2c_client(dev); | ||
184 | } | 190 | } |
185 | 191 | ||
186 | static inline void *i2c_get_clientdata (struct i2c_client *dev) | 192 | static inline void *i2c_get_clientdata (struct i2c_client *dev) |
@@ -201,7 +207,7 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) | |||
201 | * @addr: stored in i2c_client.addr | 207 | * @addr: stored in i2c_client.addr |
202 | * @platform_data: stored in i2c_client.dev.platform_data | 208 | * @platform_data: stored in i2c_client.dev.platform_data |
203 | * @irq: stored in i2c_client.irq | 209 | * @irq: stored in i2c_client.irq |
204 | 210 | * | |
205 | * I2C doesn't actually support hardware probing, although controllers and | 211 | * I2C doesn't actually support hardware probing, although controllers and |
206 | * devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's | 212 | * devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's |
207 | * a device at a given address. Drivers commonly need more information than | 213 | * a device at a given address. Drivers commonly need more information than |
@@ -210,7 +216,7 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) | |||
210 | * i2c_board_info is used to build tables of information listing I2C devices | 216 | * i2c_board_info is used to build tables of information listing I2C devices |
211 | * that are present. This information is used to grow the driver model tree | 217 | * that are present. This information is used to grow the driver model tree |
212 | * for "new style" I2C drivers. For mainboards this is done statically using | 218 | * for "new style" I2C drivers. For mainboards this is done statically using |
213 | * i2c_register_board_info(), where @bus_num represents an adapter that isn't | 219 | * i2c_register_board_info(); bus numbers identify adapters that aren't |
214 | * yet available. For add-on boards, i2c_new_device() does this dynamically | 220 | * yet available. For add-on boards, i2c_new_device() does this dynamically |
215 | * with the adapter already known. | 221 | * with the adapter already known. |
216 | */ | 222 | */ |
@@ -362,7 +368,6 @@ struct i2c_client_address_data { | |||
362 | 368 | ||
363 | /* The numbers to use to set I2C bus address */ | 369 | /* The numbers to use to set I2C bus address */ |
364 | #define ANY_I2C_BUS 0xffff | 370 | #define ANY_I2C_BUS 0xffff |
365 | #define ANY_I2C_ISA_BUS 9191 | ||
366 | 371 | ||
367 | 372 | ||
368 | /* ----- functions exported by i2c.o */ | 373 | /* ----- functions exported by i2c.o */ |
@@ -518,8 +523,9 @@ union i2c_smbus_data { | |||
518 | #define I2C_SMBUS_WORD_DATA 3 | 523 | #define I2C_SMBUS_WORD_DATA 3 |
519 | #define I2C_SMBUS_PROC_CALL 4 | 524 | #define I2C_SMBUS_PROC_CALL 4 |
520 | #define I2C_SMBUS_BLOCK_DATA 5 | 525 | #define I2C_SMBUS_BLOCK_DATA 5 |
521 | #define I2C_SMBUS_I2C_BLOCK_DATA 6 | 526 | #define I2C_SMBUS_I2C_BLOCK_BROKEN 6 |
522 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ | 527 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ |
528 | #define I2C_SMBUS_I2C_BLOCK_DATA 8 | ||
523 | 529 | ||
524 | 530 | ||
525 | /* ----- commands for the ioctl like i2c_command call: | 531 | /* ----- commands for the ioctl like i2c_command call: |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 52f53e2e70c3..9752307d16ba 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/workqueue.h> /* work_struct */ | 32 | #include <linux/workqueue.h> /* work_struct */ |
33 | #include <linux/mempool.h> | 33 | #include <linux/mempool.h> |
34 | #include <linux/mutex.h> | ||
34 | 35 | ||
35 | #include <asm/io.h> | 36 | #include <asm/io.h> |
36 | #include <asm/semaphore.h> /* Needed for MUTEX init macros */ | 37 | #include <asm/semaphore.h> /* Needed for MUTEX init macros */ |
@@ -425,7 +426,7 @@ struct i2o_device { | |||
425 | 426 | ||
426 | struct device device; | 427 | struct device device; |
427 | 428 | ||
428 | struct semaphore lock; /* device lock */ | 429 | struct mutex lock; /* device lock */ |
429 | }; | 430 | }; |
430 | 431 | ||
431 | /* | 432 | /* |
@@ -544,7 +545,7 @@ struct i2o_controller { | |||
544 | struct i2o_dma hrt; /* HW Resource Table */ | 545 | struct i2o_dma hrt; /* HW Resource Table */ |
545 | i2o_lct *lct; /* Logical Config Table */ | 546 | i2o_lct *lct; /* Logical Config Table */ |
546 | struct i2o_dma dlct; /* Temp LCT */ | 547 | struct i2o_dma dlct; /* Temp LCT */ |
547 | struct semaphore lct_lock; /* Lock for LCT updates */ | 548 | struct mutex lct_lock; /* Lock for LCT updates */ |
548 | struct i2o_dma status_block; /* IOP status block */ | 549 | struct i2o_dma status_block; /* IOP status block */ |
549 | 550 | ||
550 | struct i2o_io base; /* controller messaging unit */ | 551 | struct i2o_io base; /* controller messaging unit */ |
@@ -945,8 +946,7 @@ static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name, | |||
945 | strcpy(pool->name, name); | 946 | strcpy(pool->name, name); |
946 | 947 | ||
947 | pool->slab = | 948 | pool->slab = |
948 | kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL, | 949 | kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL); |
949 | NULL); | ||
950 | if (!pool->slab) | 950 | if (!pool->slab) |
951 | goto free_name; | 951 | goto free_name; |
952 | 952 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 19ab25804056..5f5daad8bc54 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -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; |
@@ -1244,7 +1248,13 @@ typedef struct ide_pci_enablebit_s { | |||
1244 | 1248 | ||
1245 | enum { | 1249 | enum { |
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 | ||
1250 | typedef struct ide_pci_device_s { | 1260 | typedef 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 | ||
@@ -1363,6 +1373,11 @@ extern void ide_toggle_bounce(ide_drive_t *drive, int on); | |||
1363 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | 1373 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); |
1364 | int ide_use_fast_pio(ide_drive_t *); | 1374 | int ide_use_fast_pio(ide_drive_t *); |
1365 | 1375 | ||
1376 | static inline int ide_dev_has_iordy(struct hd_driveid *id) | ||
1377 | { | ||
1378 | return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0; | ||
1379 | } | ||
1380 | |||
1366 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1381 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
1367 | 1382 | ||
1368 | typedef struct ide_pio_timings_s { | 1383 | typedef struct ide_pio_timings_s { |
@@ -1372,14 +1387,8 @@ typedef struct ide_pio_timings_s { | |||
1372 | /* active + recovery (+ setup for some chips) */ | 1387 | /* active + recovery (+ setup for some chips) */ |
1373 | } ide_pio_timings_t; | 1388 | } ide_pio_timings_t; |
1374 | 1389 | ||
1375 | typedef struct ide_pio_data_s { | 1390 | unsigned int ide_pio_cycle_time(ide_drive_t *, u8); |
1376 | u8 pio_mode; | 1391 | u8 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 | |||
1382 | extern u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d); | ||
1383 | extern const ide_pio_timings_t ide_pio_timings[6]; | 1392 | extern const ide_pio_timings_t ide_pio_timings[6]; |
1384 | 1393 | ||
1385 | 1394 | ||
diff --git a/include/linux/idr.h b/include/linux/idr.h index 826803449db7..0edda411959c 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -78,9 +78,41 @@ void *idr_find(struct idr *idp, int id); | |||
78 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); | 78 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); |
79 | int idr_get_new(struct idr *idp, void *ptr, int *id); | 79 | int idr_get_new(struct idr *idp, void *ptr, int *id); |
80 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | 80 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); |
81 | int idr_for_each(struct idr *idp, | ||
82 | int (*fn)(int id, void *p, void *data), void *data); | ||
81 | void *idr_replace(struct idr *idp, void *ptr, int id); | 83 | void *idr_replace(struct idr *idp, void *ptr, int id); |
82 | void idr_remove(struct idr *idp, int id); | 84 | void idr_remove(struct idr *idp, int id); |
85 | void idr_remove_all(struct idr *idp); | ||
83 | void idr_destroy(struct idr *idp); | 86 | void idr_destroy(struct idr *idp); |
84 | void idr_init(struct idr *idp); | 87 | void idr_init(struct idr *idp); |
85 | 88 | ||
89 | |||
90 | /* | ||
91 | * IDA - IDR based id allocator, use when translation from id to | ||
92 | * pointer isn't necessary. | ||
93 | */ | ||
94 | #define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */ | ||
95 | #define IDA_BITMAP_LONGS (128 / sizeof(long) - 1) | ||
96 | #define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8) | ||
97 | |||
98 | struct ida_bitmap { | ||
99 | long nr_busy; | ||
100 | unsigned long bitmap[IDA_BITMAP_LONGS]; | ||
101 | }; | ||
102 | |||
103 | struct ida { | ||
104 | struct idr idr; | ||
105 | struct ida_bitmap *free_bitmap; | ||
106 | }; | ||
107 | |||
108 | #define IDA_INIT(name) { .idr = IDR_INIT(name), .free_bitmap = NULL, } | ||
109 | #define DEFINE_IDA(name) struct ida name = IDA_INIT(name) | ||
110 | |||
111 | int ida_pre_get(struct ida *ida, gfp_t gfp_mask); | ||
112 | int ida_get_new_above(struct ida *ida, int starting_id, int *p_id); | ||
113 | int ida_get_new(struct ida *ida, int *p_id); | ||
114 | void ida_remove(struct ida *ida, int id); | ||
115 | void ida_destroy(struct ida *ida); | ||
116 | void ida_init(struct ida *ida); | ||
117 | |||
86 | #endif /* __IDR_H__ */ | 118 | #endif /* __IDR_H__ */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index ecd61e8438a5..272f8c8c90da 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -227,6 +227,17 @@ struct ieee80211_cts { | |||
227 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) | 227 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) |
228 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) | 228 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) |
229 | 229 | ||
230 | /* 802.11g ERP information element */ | ||
231 | #define WLAN_ERP_NON_ERP_PRESENT (1<<0) | ||
232 | #define WLAN_ERP_USE_PROTECTION (1<<1) | ||
233 | #define WLAN_ERP_BARKER_PREAMBLE (1<<2) | ||
234 | |||
235 | /* WLAN_ERP_BARKER_PREAMBLE values */ | ||
236 | enum { | ||
237 | WLAN_ERP_PREAMBLE_SHORT = 0, | ||
238 | WLAN_ERP_PREAMBLE_LONG = 1, | ||
239 | }; | ||
240 | |||
230 | /* Status codes */ | 241 | /* Status codes */ |
231 | enum ieee80211_statuscode { | 242 | enum ieee80211_statuscode { |
232 | WLAN_STATUS_SUCCESS = 0, | 243 | WLAN_STATUS_SUCCESS = 0, |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 604c2434f71c..422084d18ce1 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -76,6 +76,8 @@ enum | |||
76 | #define IFLA_WEIGHT IFLA_WEIGHT | 76 | #define IFLA_WEIGHT IFLA_WEIGHT |
77 | IFLA_OPERSTATE, | 77 | IFLA_OPERSTATE, |
78 | IFLA_LINKMODE, | 78 | IFLA_LINKMODE, |
79 | IFLA_LINKINFO, | ||
80 | #define IFLA_LINKINFO IFLA_LINKINFO | ||
79 | __IFLA_MAX | 81 | __IFLA_MAX |
80 | }; | 82 | }; |
81 | 83 | ||
@@ -140,4 +142,49 @@ struct ifla_cacheinfo | |||
140 | __u32 retrans_time; | 142 | __u32 retrans_time; |
141 | }; | 143 | }; |
142 | 144 | ||
145 | enum | ||
146 | { | ||
147 | IFLA_INFO_UNSPEC, | ||
148 | IFLA_INFO_KIND, | ||
149 | IFLA_INFO_DATA, | ||
150 | IFLA_INFO_XSTATS, | ||
151 | __IFLA_INFO_MAX, | ||
152 | }; | ||
153 | |||
154 | #define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1) | ||
155 | |||
156 | /* VLAN section */ | ||
157 | |||
158 | enum | ||
159 | { | ||
160 | IFLA_VLAN_UNSPEC, | ||
161 | IFLA_VLAN_ID, | ||
162 | IFLA_VLAN_FLAGS, | ||
163 | IFLA_VLAN_EGRESS_QOS, | ||
164 | IFLA_VLAN_INGRESS_QOS, | ||
165 | __IFLA_VLAN_MAX, | ||
166 | }; | ||
167 | |||
168 | #define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1) | ||
169 | |||
170 | struct ifla_vlan_flags { | ||
171 | __u32 flags; | ||
172 | __u32 mask; | ||
173 | }; | ||
174 | |||
175 | enum | ||
176 | { | ||
177 | IFLA_VLAN_QOS_UNSPEC, | ||
178 | IFLA_VLAN_QOS_MAPPING, | ||
179 | __IFLA_VLAN_QOS_MAX | ||
180 | }; | ||
181 | |||
182 | #define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1) | ||
183 | |||
184 | struct ifla_vlan_qos_mapping | ||
185 | { | ||
186 | __u32 from; | ||
187 | __u32 to; | ||
188 | }; | ||
189 | |||
143 | #endif /* _LINUX_IF_LINK_H */ | 190 | #endif /* _LINUX_IF_LINK_H */ |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h new file mode 100644 index 000000000000..0d9d7ea2c1cc --- /dev/null +++ b/include/linux/if_macvlan.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _LINUX_IF_MACVLAN_H | ||
2 | #define _LINUX_IF_MACVLAN_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); | ||
7 | |||
8 | #endif /* __KERNEL__ */ | ||
9 | #endif /* _LINUX_IF_MACVLAN_H */ | ||
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h index 768372f07caa..0f2f70d4e48c 100644 --- a/include/linux/if_ppp.h +++ b/include/linux/if_ppp.h | |||
@@ -110,6 +110,21 @@ struct ifpppcstatsreq { | |||
110 | struct ppp_comp_stats stats; | 110 | struct ppp_comp_stats stats; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | /* For PPPIOCGL2TPSTATS */ | ||
114 | struct pppol2tp_ioc_stats { | ||
115 | __u16 tunnel_id; /* redundant */ | ||
116 | __u16 session_id; /* if zero, get tunnel stats */ | ||
117 | __u32 using_ipsec:1; /* valid only for session_id == 0 */ | ||
118 | aligned_u64 tx_packets; | ||
119 | aligned_u64 tx_bytes; | ||
120 | aligned_u64 tx_errors; | ||
121 | aligned_u64 rx_packets; | ||
122 | aligned_u64 rx_bytes; | ||
123 | aligned_u64 rx_seq_discards; | ||
124 | aligned_u64 rx_oos_packets; | ||
125 | aligned_u64 rx_errors; | ||
126 | }; | ||
127 | |||
113 | #define ifr__name b.ifr_ifrn.ifrn_name | 128 | #define ifr__name b.ifr_ifrn.ifrn_name |
114 | #define stats_ptr b.ifr_ifru.ifru_data | 129 | #define stats_ptr b.ifr_ifru.ifru_data |
115 | 130 | ||
@@ -146,6 +161,7 @@ struct ifpppcstatsreq { | |||
146 | #define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */ | 161 | #define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */ |
147 | #define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */ | 162 | #define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */ |
148 | #define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */ | 163 | #define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */ |
164 | #define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats) | ||
149 | 165 | ||
150 | #define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0) | 166 | #define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0) |
151 | #define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */ | 167 | #define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */ |
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h new file mode 100644 index 000000000000..516203b6fdeb --- /dev/null +++ b/include/linux/if_pppol2tp.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /*************************************************************************** | ||
2 | * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661) | ||
3 | * | ||
4 | * This file supplies definitions required by the PPP over L2TP driver | ||
5 | * (pppol2tp.c). All version information wrt this file is located in pppol2tp.c | ||
6 | * | ||
7 | * License: | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __LINUX_IF_PPPOL2TP_H | ||
16 | #define __LINUX_IF_PPPOL2TP_H | ||
17 | |||
18 | #include <asm/types.h> | ||
19 | |||
20 | #ifdef __KERNEL__ | ||
21 | #include <linux/in.h> | ||
22 | #endif | ||
23 | |||
24 | /* Structure used to connect() the socket to a particular tunnel UDP | ||
25 | * socket. | ||
26 | */ | ||
27 | struct pppol2tp_addr | ||
28 | { | ||
29 | pid_t pid; /* pid that owns the fd. | ||
30 | * 0 => current */ | ||
31 | int fd; /* FD of UDP socket to use */ | ||
32 | |||
33 | struct sockaddr_in addr; /* IP address and port to send to */ | ||
34 | |||
35 | __be16 s_tunnel, s_session; /* For matching incoming packets */ | ||
36 | __be16 d_tunnel, d_session; /* For sending outgoing packets */ | ||
37 | }; | ||
38 | |||
39 | /* Socket options: | ||
40 | * DEBUG - bitmask of debug message categories | ||
41 | * SENDSEQ - 0 => don't send packets with sequence numbers | ||
42 | * 1 => send packets with sequence numbers | ||
43 | * RECVSEQ - 0 => receive packet sequence numbers are optional | ||
44 | * 1 => drop receive packets without sequence numbers | ||
45 | * LNSMODE - 0 => act as LAC. | ||
46 | * 1 => act as LNS. | ||
47 | * REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder. | ||
48 | */ | ||
49 | enum { | ||
50 | PPPOL2TP_SO_DEBUG = 1, | ||
51 | PPPOL2TP_SO_RECVSEQ = 2, | ||
52 | PPPOL2TP_SO_SENDSEQ = 3, | ||
53 | PPPOL2TP_SO_LNSMODE = 4, | ||
54 | PPPOL2TP_SO_REORDERTO = 5, | ||
55 | }; | ||
56 | |||
57 | /* Debug message categories for the DEBUG socket option */ | ||
58 | enum { | ||
59 | PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if | ||
60 | * compiled in) */ | ||
61 | PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel | ||
62 | * interface */ | ||
63 | PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */ | ||
64 | PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */ | ||
65 | }; | ||
66 | |||
67 | |||
68 | |||
69 | #endif | ||
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index 6f987be60fe2..25652545ba6e 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/semaphore.h> | 27 | #include <asm/semaphore.h> |
28 | #include <linux/ppp_channel.h> | 28 | #include <linux/ppp_channel.h> |
29 | #endif /* __KERNEL__ */ | 29 | #endif /* __KERNEL__ */ |
30 | #include <linux/if_pppol2tp.h> | ||
30 | 31 | ||
31 | /* For user-space programs to pick up these definitions | 32 | /* For user-space programs to pick up these definitions |
32 | * which they wouldn't get otherwise without defining __KERNEL__ | 33 | * which they wouldn't get otherwise without defining __KERNEL__ |
@@ -50,8 +51,9 @@ struct pppoe_addr{ | |||
50 | * Protocols supported by AF_PPPOX | 51 | * Protocols supported by AF_PPPOX |
51 | */ | 52 | */ |
52 | #define PX_PROTO_OE 0 /* Currently just PPPoE */ | 53 | #define PX_PROTO_OE 0 /* Currently just PPPoE */ |
53 | #define PX_MAX_PROTO 1 | 54 | #define PX_PROTO_OL2TP 1 /* Now L2TP also */ |
54 | 55 | #define PX_MAX_PROTO 2 | |
56 | |||
55 | struct sockaddr_pppox { | 57 | struct sockaddr_pppox { |
56 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 58 | sa_family_t sa_family; /* address family, AF_PPPOX */ |
57 | unsigned int sa_protocol; /* protocol identifier */ | 59 | unsigned int sa_protocol; /* protocol identifier */ |
@@ -60,6 +62,16 @@ struct sockaddr_pppox { | |||
60 | }sa_addr; | 62 | }sa_addr; |
61 | }__attribute__ ((packed)); | 63 | }__attribute__ ((packed)); |
62 | 64 | ||
65 | /* The use of the above union isn't viable because the size of this | ||
66 | * struct must stay fixed over time -- applications use sizeof(struct | ||
67 | * sockaddr_pppox) to fill it. We use a protocol specific sockaddr | ||
68 | * type instead. | ||
69 | */ | ||
70 | struct sockaddr_pppol2tp { | ||
71 | sa_family_t sa_family; /* address family, AF_PPPOX */ | ||
72 | unsigned int sa_protocol; /* protocol identifier */ | ||
73 | struct pppol2tp_addr pppol2tp; | ||
74 | }__attribute__ ((packed)); | ||
63 | 75 | ||
64 | /********************************************************************* | 76 | /********************************************************************* |
65 | * | 77 | * |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 88aef7b86ef4..42eb6945b93e 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -36,6 +36,7 @@ struct tun_struct { | |||
36 | unsigned long flags; | 36 | unsigned long flags; |
37 | int attached; | 37 | int attached; |
38 | uid_t owner; | 38 | uid_t owner; |
39 | gid_t group; | ||
39 | 40 | ||
40 | wait_queue_head_t read_wait; | 41 | wait_queue_head_t read_wait; |
41 | struct sk_buff_head readq; | 42 | struct sk_buff_head readq; |
@@ -78,6 +79,7 @@ struct tun_struct { | |||
78 | #define TUNSETPERSIST _IOW('T', 203, int) | 79 | #define TUNSETPERSIST _IOW('T', 203, int) |
79 | #define TUNSETOWNER _IOW('T', 204, int) | 80 | #define TUNSETOWNER _IOW('T', 204, int) |
80 | #define TUNSETLINK _IOW('T', 205, int) | 81 | #define TUNSETLINK _IOW('T', 205, int) |
82 | #define TUNSETGROUP _IOW('T', 206, int) | ||
81 | 83 | ||
82 | /* TUNSETIFF ifr flags */ | 84 | /* TUNSETIFF ifr flags */ |
83 | #define IFF_TUN 0x0001 | 85 | #define IFF_TUN 0x0001 |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 81e9bc93569b..f8443fdb124a 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -99,7 +99,7 @@ static inline void vlan_group_set_device(struct vlan_group *vg, int vlan_id, | |||
99 | } | 99 | } |
100 | 100 | ||
101 | struct vlan_priority_tci_mapping { | 101 | struct vlan_priority_tci_mapping { |
102 | unsigned long priority; | 102 | u32 priority; |
103 | unsigned short vlan_qos; /* This should be shifted when first set, so we only do it | 103 | unsigned short vlan_qos; /* This should be shifted when first set, so we only do it |
104 | * at provisioning time. | 104 | * at provisioning time. |
105 | * ((skb->priority << 13) & 0xE000) | 105 | * ((skb->priority << 13) & 0xE000) |
@@ -112,7 +112,10 @@ struct vlan_dev_info { | |||
112 | /** This will be the mapping that correlates skb->priority to | 112 | /** This will be the mapping that correlates skb->priority to |
113 | * 3 bits of VLAN QOS tags... | 113 | * 3 bits of VLAN QOS tags... |
114 | */ | 114 | */ |
115 | unsigned long ingress_priority_map[8]; | 115 | unsigned int nr_ingress_mappings; |
116 | u32 ingress_priority_map[8]; | ||
117 | |||
118 | unsigned int nr_egress_mappings; | ||
116 | struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */ | 119 | struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */ |
117 | 120 | ||
118 | unsigned short vlan_id; /* The VLAN Identifier for this interface. */ | 121 | unsigned short vlan_id; /* The VLAN Identifier for this interface. */ |
@@ -124,14 +127,8 @@ struct vlan_dev_info { | |||
124 | * like DHCP that use packet-filtering and don't understand | 127 | * like DHCP that use packet-filtering and don't understand |
125 | * 802.1Q | 128 | * 802.1Q |
126 | */ | 129 | */ |
127 | struct dev_mc_list *old_mc_list; /* old multi-cast list for the VLAN interface.. | ||
128 | * we save this so we can tell what changes were | ||
129 | * made, in order to feed the right changes down | ||
130 | * to the real hardware... | ||
131 | */ | ||
132 | int old_allmulti; /* similar to above. */ | ||
133 | int old_promiscuity; /* similar to above. */ | ||
134 | struct net_device *real_dev; /* the underlying device/interface */ | 130 | struct net_device *real_dev; /* the underlying device/interface */ |
131 | unsigned char real_dev_addr[ETH_ALEN]; | ||
135 | struct proc_dir_entry *dent; /* Holds the proc data */ | 132 | struct proc_dir_entry *dent; /* Holds the proc data */ |
136 | unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */ | 133 | unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */ |
137 | unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */ | 134 | unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */ |
@@ -395,6 +392,10 @@ enum vlan_ioctl_cmds { | |||
395 | GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */ | 392 | GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */ |
396 | }; | 393 | }; |
397 | 394 | ||
395 | enum vlan_flags { | ||
396 | VLAN_FLAG_REORDER_HDR = 0x1, | ||
397 | }; | ||
398 | |||
398 | enum vlan_name_types { | 399 | enum vlan_name_types { |
399 | VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */ | 400 | VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */ |
400 | VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */ | 401 | VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */ |
diff --git a/include/linux/init.h b/include/linux/init.h index 56ec4c62eee0..f0d0e3295a9b 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -40,10 +40,10 @@ | |||
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"))) __cold |
47 | 47 | ||
48 | /* modpost check for section mismatches during the kernel build. | 48 | /* modpost check for section mismatches during the kernel build. |
49 | * A section mismatch happens when there are references from a | 49 | * A section mismatch happens when there are references from a |
@@ -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 */ |
@@ -171,9 +171,6 @@ struct obs_kernel_param { | |||
171 | #define __setup(str, fn) \ | 171 | #define __setup(str, fn) \ |
172 | __setup_param(str, fn, fn, 0) | 172 | __setup_param(str, fn, fn, 0) |
173 | 173 | ||
174 | #define __obsolete_setup(str) \ | ||
175 | __setup_null_param(str, __LINE__) | ||
176 | |||
177 | /* NOTE: fn is as per module_param, not __setup! Emits warning if fn | 174 | /* NOTE: fn is as per module_param, not __setup! Emits warning if fn |
178 | * returns non-zero. */ | 175 | * returns non-zero. */ |
179 | #define early_param(str, fn) \ | 176 | #define early_param(str, fn) \ |
@@ -239,7 +236,6 @@ void __init parse_early_param(void); | |||
239 | #define __setup_param(str, unique_id, fn) /* nothing */ | 236 | #define __setup_param(str, unique_id, fn) /* nothing */ |
240 | #define __setup_null_param(str, unique_id) /* nothing */ | 237 | #define __setup_null_param(str, unique_id) /* nothing */ |
241 | #define __setup(str, func) /* nothing */ | 238 | #define __setup(str, func) /* nothing */ |
242 | #define __obsolete_setup(str) /* nothing */ | ||
243 | #endif | 239 | #endif |
244 | 240 | ||
245 | /* Data marked not to be saved by software suspend */ | 241 | /* Data marked not to be saved by software suspend */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 276ccaa2670c..cab741c2d603 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/lockdep.h> | 8 | #include <linux/lockdep.h> |
9 | #include <linux/ipc.h> | 9 | #include <linux/ipc.h> |
10 | #include <linux/pid_namespace.h> | 10 | #include <linux/pid_namespace.h> |
11 | #include <linux/user_namespace.h> | ||
11 | 12 | ||
12 | #define INIT_FDTABLE \ | 13 | #define INIT_FDTABLE \ |
13 | { \ | 14 | { \ |
@@ -78,6 +79,7 @@ extern struct nsproxy init_nsproxy; | |||
78 | .uts_ns = &init_uts_ns, \ | 79 | .uts_ns = &init_uts_ns, \ |
79 | .mnt_ns = NULL, \ | 80 | .mnt_ns = NULL, \ |
80 | INIT_IPC_NS(ipc_ns) \ | 81 | INIT_IPC_NS(ipc_ns) \ |
82 | .user_ns = &init_user_ns, \ | ||
81 | } | 83 | } |
82 | 84 | ||
83 | #define INIT_SIGHAND(sighand) { \ | 85 | #define INIT_SIGHAND(sighand) { \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 18c98b543030..e02c6a66b2ba 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -344,7 +344,8 @@ struct input_absinfo { | |||
344 | #define KEY_BRIGHTNESSUP 225 | 344 | #define KEY_BRIGHTNESSUP 225 |
345 | #define KEY_MEDIA 226 | 345 | #define KEY_MEDIA 226 |
346 | 346 | ||
347 | #define KEY_SWITCHVIDEOMODE 227 | 347 | #define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video |
348 | outputs (Monitor/LCD/TV-out/etc) */ | ||
348 | #define KEY_KBDILLUMTOGGLE 228 | 349 | #define KEY_KBDILLUMTOGGLE 228 |
349 | #define KEY_KBDILLUMDOWN 229 | 350 | #define KEY_KBDILLUMDOWN 229 |
350 | #define KEY_KBDILLUMUP 230 | 351 | #define KEY_KBDILLUMUP 230 |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 5323f6275854..0a3c2ebf2008 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -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 | ||
124 | extern void disable_irq_nosync(unsigned int irq); | 123 | extern void disable_irq_nosync(unsigned int irq); |
125 | extern void disable_irq(unsigned int irq); | 124 | extern void disable_irq(unsigned int irq); |
126 | extern void enable_irq(unsigned int irq); | 125 | extern 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/io.h b/include/linux/io.h index 8423dd376514..e3b2dda6c8eb 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
@@ -63,32 +63,7 @@ void __iomem * devm_ioremap(struct device *dev, unsigned long offset, | |||
63 | void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset, | 63 | void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset, |
64 | unsigned long size); | 64 | unsigned long size); |
65 | void devm_iounmap(struct device *dev, void __iomem *addr); | 65 | void devm_iounmap(struct device *dev, void __iomem *addr); |
66 | 66 | int check_signature(const volatile void __iomem *io_addr, | |
67 | /** | 67 | const unsigned char *signature, int length); |
68 | * check_signature - find BIOS signatures | ||
69 | * @io_addr: mmio address to check | ||
70 | * @signature: signature block | ||
71 | * @length: length of signature | ||
72 | * | ||
73 | * Perform a signature comparison with the mmio address io_addr. This | ||
74 | * address should have been obtained by ioremap. | ||
75 | * Returns 1 on a match. | ||
76 | */ | ||
77 | |||
78 | static inline int check_signature(const volatile void __iomem *io_addr, | ||
79 | const unsigned char *signature, int length) | ||
80 | { | ||
81 | int retval = 0; | ||
82 | do { | ||
83 | if (readb(io_addr) != *signature) | ||
84 | goto out; | ||
85 | io_addr++; | ||
86 | signature++; | ||
87 | length--; | ||
88 | } while (length); | ||
89 | retval = 1; | ||
90 | out: | ||
91 | return retval; | ||
92 | } | ||
93 | 68 | ||
94 | #endif /* _LINUX_IO_H */ | 69 | #endif /* _LINUX_IO_H */ |
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 | ||
56 | static 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 | |||
56 | static inline int task_nice_ioprio(struct task_struct *task) | 64 | static 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/ip_mp_alg.h b/include/linux/ip_mp_alg.h deleted file mode 100644 index e234e2008f5d..000000000000 --- a/include/linux/ip_mp_alg.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* ip_mp_alg.h: IPV4 multipath algorithm support, user-visible values. | ||
2 | * | ||
3 | * Copyright (C) 2004, 2005 Einar Lueck <elueck@de.ibm.com> | ||
4 | * Copyright (C) 2005 David S. Miller <davem@davemloft.net> | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_IP_MP_ALG_H | ||
8 | #define _LINUX_IP_MP_ALG_H | ||
9 | |||
10 | enum ip_mp_alg { | ||
11 | IP_MP_ALG_NONE, | ||
12 | IP_MP_ALG_RR, | ||
13 | IP_MP_ALG_DRR, | ||
14 | IP_MP_ALG_RANDOM, | ||
15 | IP_MP_ALG_WRANDOM, | ||
16 | __IP_MP_ALG_MAX | ||
17 | }; | ||
18 | |||
19 | #define IP_MP_ALG_MAX (__IP_MP_ALG_MAX - 1) | ||
20 | |||
21 | #endif /* _LINUX_IP_MP_ALG_H */ | ||
22 | |||
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index 1980867a64a4..3fd3ddd5f0d9 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
@@ -52,6 +52,7 @@ struct ipc_perm | |||
52 | #ifdef __KERNEL__ | 52 | #ifdef __KERNEL__ |
53 | 53 | ||
54 | #include <linux/kref.h> | 54 | #include <linux/kref.h> |
55 | #include <linux/spinlock.h> | ||
55 | 56 | ||
56 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ | 57 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ |
57 | 58 | ||
@@ -92,6 +93,7 @@ extern struct ipc_namespace init_ipc_ns; | |||
92 | 93 | ||
93 | #ifdef CONFIG_SYSVIPC | 94 | #ifdef CONFIG_SYSVIPC |
94 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | 95 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, |
96 | extern void free_ipc_ns(struct kref *kref); | ||
95 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | 97 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, |
96 | struct ipc_namespace *ns); | 98 | struct ipc_namespace *ns); |
97 | #else | 99 | #else |
@@ -103,13 +105,9 @@ static inline struct ipc_namespace *copy_ipcs(unsigned long flags, | |||
103 | } | 105 | } |
104 | #endif | 106 | #endif |
105 | 107 | ||
106 | #ifdef CONFIG_IPC_NS | ||
107 | extern void free_ipc_ns(struct kref *kref); | ||
108 | #endif | ||
109 | |||
110 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 108 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
111 | { | 109 | { |
112 | #ifdef CONFIG_IPC_NS | 110 | #ifdef CONFIG_SYSVIPC |
113 | if (ns) | 111 | if (ns) |
114 | kref_get(&ns->kref); | 112 | kref_get(&ns->kref); |
115 | #endif | 113 | #endif |
@@ -118,7 +116,7 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | |||
118 | 116 | ||
119 | static inline void put_ipc_ns(struct ipc_namespace *ns) | 117 | static inline void put_ipc_ns(struct ipc_namespace *ns) |
120 | { | 118 | { |
121 | #ifdef CONFIG_IPC_NS | 119 | #ifdef CONFIG_SYSVIPC |
122 | kref_put(&ns->kref, free_ipc_ns); | 120 | kref_put(&ns->kref, free_ipc_ns); |
123 | #endif | 121 | #endif |
124 | } | 122 | } |
@@ -126,5 +124,3 @@ static inline void put_ipc_ns(struct ipc_namespace *ns) | |||
126 | #endif /* __KERNEL__ */ | 124 | #endif /* __KERNEL__ */ |
127 | 125 | ||
128 | #endif /* _LINUX_IPC_H */ | 126 | #endif /* _LINUX_IPC_H */ |
129 | |||
130 | |||
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 648bd1f0912d..97983dc9df13 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -27,8 +27,8 @@ struct in6_ifreq { | |||
27 | int ifr6_ifindex; | 27 | int ifr6_ifindex; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | #define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */ | 30 | #define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */ |
31 | #define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */ | 31 | #define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */ |
32 | #define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */ | 32 | #define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */ |
33 | 33 | ||
34 | /* | 34 | /* |
@@ -247,7 +247,7 @@ struct inet6_skb_parm { | |||
247 | __u16 lastopt; | 247 | __u16 lastopt; |
248 | __u32 nhoff; | 248 | __u32 nhoff; |
249 | __u16 flags; | 249 | __u16 flags; |
250 | #ifdef CONFIG_IPV6_MIP6 | 250 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
251 | __u16 dsthao; | 251 | __u16 dsthao; |
252 | #endif | 252 | #endif |
253 | 253 | ||
@@ -299,8 +299,8 @@ struct ipv6_pinfo { | |||
299 | /* pktoption flags */ | 299 | /* pktoption flags */ |
300 | union { | 300 | union { |
301 | struct { | 301 | struct { |
302 | __u16 srcrt:2, | 302 | __u16 srcrt:1, |
303 | osrcrt:2, | 303 | osrcrt:1, |
304 | rxinfo:1, | 304 | rxinfo:1, |
305 | rxoinfo:1, | 305 | rxoinfo:1, |
306 | rxhlim:1, | 306 | rxhlim:1, |
diff --git a/include/linux/irda.h b/include/linux/irda.h index 945ba3110874..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 */ |
@@ -216,6 +217,34 @@ struct if_irda_req { | |||
216 | #define ifr_dtr ifr_ifru.ifru_line.dtr | 217 | #define ifr_dtr ifr_ifru.ifru_line.dtr |
217 | #define ifr_rts ifr_ifru.ifru_line.rts | 218 | #define ifr_rts ifr_ifru.ifru_line.rts |
218 | 219 | ||
220 | |||
221 | /* IrDA netlink definitions */ | ||
222 | #define IRDA_NL_NAME "irda" | ||
223 | #define IRDA_NL_VERSION 1 | ||
224 | |||
225 | enum irda_nl_commands { | ||
226 | IRDA_NL_CMD_UNSPEC, | ||
227 | IRDA_NL_CMD_SET_MODE, | ||
228 | IRDA_NL_CMD_GET_MODE, | ||
229 | |||
230 | __IRDA_NL_CMD_AFTER_LAST | ||
231 | }; | ||
232 | #define IRDA_NL_CMD_MAX (__IRDA_NL_CMD_AFTER_LAST - 1) | ||
233 | |||
234 | enum nl80211_attrs { | ||
235 | IRDA_NL_ATTR_UNSPEC, | ||
236 | IRDA_NL_ATTR_IFNAME, | ||
237 | IRDA_NL_ATTR_MODE, | ||
238 | |||
239 | __IRDA_NL_ATTR_AFTER_LAST | ||
240 | }; | ||
241 | #define IRDA_NL_ATTR_MAX (__IRDA_NL_ATTR_AFTER_LAST - 1) | ||
242 | |||
243 | /* IrDA modes */ | ||
244 | #define IRDA_MODE_PRIMARY 0x1 | ||
245 | #define IRDA_MODE_SECONDARY 0x2 | ||
246 | #define IRDA_MODE_MONITOR 0x4 | ||
247 | |||
219 | #endif /* KERNEL_IRDA_H */ | 248 | #endif /* KERNEL_IRDA_H */ |
220 | 249 | ||
221 | 250 | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index 1695054e8c63..44657197fcb0 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -161,6 +161,7 @@ struct irq_desc { | |||
161 | unsigned int wake_depth; /* nested wake enables */ | 161 | unsigned int wake_depth; /* nested wake enables */ |
162 | unsigned int irq_count; /* For detecting broken IRQs */ | 162 | unsigned int irq_count; /* For detecting broken IRQs */ |
163 | unsigned int irqs_unhandled; | 163 | unsigned int irqs_unhandled; |
164 | unsigned long last_unhandled; /* Aging timer for unhandled count */ | ||
164 | spinlock_t lock; | 165 | spinlock_t lock; |
165 | #ifdef CONFIG_SMP | 166 | #ifdef CONFIG_SMP |
166 | cpumask_t affinity; | 167 | cpumask_t affinity; |
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 |
60 | extern int jbd2_journal_enable_debug; | 60 | extern 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/kallsyms.h b/include/linux/kallsyms.h index 5f06527dca21..f73de6fb5c68 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -7,9 +7,9 @@ | |||
7 | 7 | ||
8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
9 | 9 | ||
10 | #define KSYM_NAME_LEN 127 | 10 | #define KSYM_NAME_LEN 128 |
11 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ | 11 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \ |
12 | 2*(BITS_PER_LONG*3/10) + MODULE_NAME_LEN + 1) | 12 | 2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1) |
13 | 13 | ||
14 | #ifdef CONFIG_KALLSYMS | 14 | #ifdef CONFIG_KALLSYMS |
15 | /* Lookup the address for a symbol. Returns 0 if not found. */ | 15 | /* Lookup the address for a symbol. Returns 0 if not found. */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 7a4852505914..4300bb462d29 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -106,7 +106,7 @@ extern int cond_resched(void); | |||
106 | extern struct atomic_notifier_head panic_notifier_list; | 106 | extern struct atomic_notifier_head panic_notifier_list; |
107 | extern long (*panic_blink)(long time); | 107 | extern long (*panic_blink)(long time); |
108 | NORET_TYPE void panic(const char * fmt, ...) | 108 | NORET_TYPE void panic(const char * fmt, ...) |
109 | __attribute__ ((NORET_AND format (printf, 1, 2))); | 109 | __attribute__ ((NORET_AND format (printf, 1, 2))) __cold; |
110 | extern void oops_enter(void); | 110 | extern void oops_enter(void); |
111 | extern void oops_exit(void); | 111 | extern void oops_exit(void); |
112 | extern int oops_may_print(void); | 112 | extern int oops_may_print(void); |
@@ -155,14 +155,14 @@ extern void dump_thread(struct pt_regs *regs, struct user *dump); | |||
155 | asmlinkage int vprintk(const char *fmt, va_list args) | 155 | asmlinkage int vprintk(const char *fmt, va_list args) |
156 | __attribute__ ((format (printf, 1, 0))); | 156 | __attribute__ ((format (printf, 1, 0))); |
157 | asmlinkage int printk(const char * fmt, ...) | 157 | asmlinkage int printk(const char * fmt, ...) |
158 | __attribute__ ((format (printf, 1, 2))); | 158 | __attribute__ ((format (printf, 1, 2))) __cold; |
159 | #else | 159 | #else |
160 | static inline int vprintk(const char *s, va_list args) | 160 | static inline int vprintk(const char *s, va_list args) |
161 | __attribute__ ((format (printf, 1, 0))); | 161 | __attribute__ ((format (printf, 1, 0))); |
162 | static inline int vprintk(const char *s, va_list args) { return 0; } | 162 | static inline int vprintk(const char *s, va_list args) { return 0; } |
163 | static inline int printk(const char *s, ...) | 163 | static inline int printk(const char *s, ...) |
164 | __attribute__ ((format (printf, 1, 2))); | 164 | __attribute__ ((format (printf, 1, 2))); |
165 | static inline int printk(const char *s, ...) { return 0; } | 165 | static inline int __cold printk(const char *s, ...) { return 0; } |
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | unsigned long int_sqrt(unsigned long); | 168 | unsigned long int_sqrt(unsigned long); |
@@ -210,8 +210,9 @@ extern enum system_states { | |||
210 | #define TAINT_MACHINE_CHECK (1<<4) | 210 | #define TAINT_MACHINE_CHECK (1<<4) |
211 | #define TAINT_BAD_PAGE (1<<5) | 211 | #define TAINT_BAD_PAGE (1<<5) |
212 | #define TAINT_USER (1<<6) | 212 | #define TAINT_USER (1<<6) |
213 | #define TAINT_DIE (1<<7) | ||
213 | 214 | ||
214 | extern void dump_stack(void); | 215 | extern void dump_stack(void) __cold; |
215 | 216 | ||
216 | enum { | 217 | enum { |
217 | DUMP_PREFIX_NONE, | 218 | DUMP_PREFIX_NONE, |
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index aea34e74c496..8c4350a9ed87 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h | |||
@@ -64,7 +64,7 @@ struct capi20_appl { | |||
64 | unsigned long nrecvdatapkt; | 64 | unsigned long nrecvdatapkt; |
65 | unsigned long nsentctlpkt; | 65 | unsigned long nsentctlpkt; |
66 | unsigned long nsentdatapkt; | 66 | unsigned long nsentdatapkt; |
67 | struct semaphore recv_sem; | 67 | struct mutex recv_mtx; |
68 | struct sk_buff_head recv_queue; | 68 | struct sk_buff_head recv_queue; |
69 | struct work_struct recv_work; | 69 | struct work_struct recv_work; |
70 | int release_in_progress; | 70 | int release_in_progress; |
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 | ||
38 | struct key; | 38 | struct key; |
39 | extern int call_usermodehelper_keys(char *path, char *argv[], char *envp[], | 39 | struct file; |
40 | struct key *session_keyring, int wait); | 40 | struct subprocess_info; |
41 | |||
42 | /* Allocate a subprocess_info structure */ | ||
43 | struct subprocess_info *call_usermodehelper_setup(char *path, | ||
44 | char **argv, char **envp); | ||
45 | |||
46 | /* Set various pieces of state into the subprocess_info structure */ | ||
47 | void call_usermodehelper_setkeys(struct subprocess_info *info, | ||
48 | struct key *session_keyring); | ||
49 | int call_usermodehelper_stdinpipe(struct subprocess_info *sub_info, | ||
50 | struct file **filp); | ||
51 | void call_usermodehelper_setcleanup(struct subprocess_info *info, | ||
52 | void (*cleanup)(char **argv, char **envp)); | ||
53 | |||
54 | enum 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 */ | ||
61 | int 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 */ | ||
65 | void call_usermodehelper_freeinfo(struct subprocess_info *info); | ||
41 | 66 | ||
42 | static inline int | 67 | static inline int |
43 | call_usermodehelper(char *path, char **argv, char **envp, int wait) | 68 | call_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 | |||
78 | static inline int | ||
79 | call_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 | ||
48 | extern void usermodehelper_init(void); | 92 | extern void usermodehelper_init(void); |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c288e41ba331..aa2fe22b1baa 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -36,15 +36,24 @@ 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 */ |
37 | extern u64 uevent_seqnum; | 37 | extern u64 uevent_seqnum; |
38 | 38 | ||
39 | /* the actions here must match the proper string in lib/kobject_uevent.c */ | 39 | /* |
40 | typedef 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 | */ | ||
41 | enum kobject_action { | 49 | enum 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 | ||
50 | struct kobject { | 59 | struct kobject { |
@@ -55,7 +64,7 @@ struct kobject { | |||
55 | struct kobject * parent; | 64 | struct kobject * parent; |
56 | struct kset * kset; | 65 | struct kset * kset; |
57 | struct kobj_type * ktype; | 66 | struct kobj_type * ktype; |
58 | struct dentry * dentry; | 67 | struct sysfs_dirent * sd; |
59 | wait_queue_head_t poll; | 68 | wait_queue_head_t poll; |
60 | }; | 69 | }; |
61 | 70 | ||
@@ -71,13 +80,14 @@ extern void kobject_init(struct kobject *); | |||
71 | extern void kobject_cleanup(struct kobject *); | 80 | extern void kobject_cleanup(struct kobject *); |
72 | 81 | ||
73 | extern int __must_check kobject_add(struct kobject *); | 82 | extern int __must_check kobject_add(struct kobject *); |
74 | extern int __must_check kobject_shadow_add(struct kobject *, struct dentry *); | 83 | extern int __must_check kobject_shadow_add(struct kobject *kobj, |
84 | struct sysfs_dirent *shadow_parent); | ||
75 | extern void kobject_del(struct kobject *); | 85 | extern void kobject_del(struct kobject *); |
76 | 86 | ||
77 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); | 87 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); |
78 | extern int __must_check kobject_shadow_rename(struct kobject *kobj, | 88 | extern int __must_check kobject_shadow_rename(struct kobject *kobj, |
79 | struct dentry *new_parent, | 89 | struct sysfs_dirent *new_parent, |
80 | const char *new_name); | 90 | const char *new_name); |
81 | extern int __must_check kobject_move(struct kobject *, struct kobject *); | 91 | extern int __must_check kobject_move(struct kobject *, struct kobject *); |
82 | 92 | ||
83 | extern int __must_check kobject_register(struct kobject *); | 93 | extern int __must_check kobject_register(struct kobject *); |
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 | */ |
117 | struct jprobe { | 117 | struct 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 | |||
122 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); | 125 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); |
123 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 126 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
124 | 127 | ||
@@ -211,6 +214,7 @@ int longjmp_break_handler(struct kprobe *, struct pt_regs *); | |||
211 | int register_jprobe(struct jprobe *p); | 214 | int register_jprobe(struct jprobe *p); |
212 | void unregister_jprobe(struct jprobe *p); | 215 | void unregister_jprobe(struct jprobe *p); |
213 | void jprobe_return(void); | 216 | void jprobe_return(void); |
217 | unsigned long arch_deref_entry_point(void *); | ||
214 | 218 | ||
215 | int register_kretprobe(struct kretprobe *rp); | 219 | int register_kretprobe(struct kretprobe *rp); |
216 | void unregister_kretprobe(struct kretprobe *rp); | 220 | void unregister_kretprobe(struct kretprobe *rp); |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 2b139f66027f..dae7143644fe 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -279,6 +279,16 @@ static inline s64 ktime_to_us(const ktime_t kt) | |||
279 | return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; | 279 | return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; |
280 | } | 280 | } |
281 | 281 | ||
282 | static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) | ||
283 | { | ||
284 | return ktime_to_us(ktime_sub(later, earlier)); | ||
285 | } | ||
286 | |||
287 | static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec) | ||
288 | { | ||
289 | return ktime_add_ns(kt, usec * 1000); | ||
290 | } | ||
291 | |||
282 | /* | 292 | /* |
283 | * The resolution of the clocks. The resolution value is returned in | 293 | * The resolution of the clocks. The resolution value is returned in |
284 | * the clock_getres() system call to give application programmers an | 294 | * the clock_getres() system call to give application programmers an |
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 | ||
69 | static inline void lcd_set_power(struct lcd_device *ld, int power) | 69 | static 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 | ||
77 | extern struct lcd_device *lcd_device_register(const char *name, | 77 | extern 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); |
79 | extern void lcd_device_unregister(struct lcd_device *ld); | 79 | extern 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 | |||
83 | static 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 88afceffb7cb..421175092ee2 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -13,10 +13,8 @@ | |||
13 | #define __LINUX_LEDS_H_INCLUDED | 13 | #define __LINUX_LEDS_H_INCLUDED |
14 | 14 | ||
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/spinlock.h> | ||
17 | 16 | ||
18 | struct device; | 17 | struct device; |
19 | struct class_device; | ||
20 | /* | 18 | /* |
21 | * LED Core | 19 | * LED Core |
22 | */ | 20 | */ |
@@ -38,7 +36,7 @@ struct led_classdev { | |||
38 | void (*brightness_set)(struct led_classdev *led_cdev, | 36 | void (*brightness_set)(struct led_classdev *led_cdev, |
39 | enum led_brightness brightness); | 37 | enum led_brightness brightness); |
40 | 38 | ||
41 | struct class_device *class_dev; | 39 | struct device *dev; |
42 | struct list_head node; /* LED Device list */ | 40 | struct list_head node; /* LED Device list */ |
43 | char *default_trigger; /* Trigger to use */ | 41 | char *default_trigger; /* Trigger to use */ |
44 | 42 | ||
@@ -110,4 +108,18 @@ extern void ledtrig_ide_activity(void); | |||
110 | #define ledtrig_ide_activity() do {} while(0) | 108 | #define ledtrig_ide_activity() do {} while(0) |
111 | #endif | 109 | #endif |
112 | 110 | ||
111 | /* For the leds-gpio driver */ | ||
112 | struct gpio_led { | ||
113 | const char *name; | ||
114 | char *default_trigger; | ||
115 | unsigned gpio; | ||
116 | u8 active_low; | ||
117 | }; | ||
118 | |||
119 | struct gpio_led_platform_data { | ||
120 | int num_leds; | ||
121 | struct gpio_led *leds; | ||
122 | }; | ||
123 | |||
124 | |||
113 | #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..500aace21ca7 --- /dev/null +++ b/include/linux/lguest.h | |||
@@ -0,0 +1,85 @@ | |||
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_GET_WALLCLOCK 11 | ||
21 | #define LHCALL_BIND_DMA 12 | ||
22 | #define LHCALL_SEND_DMA 13 | ||
23 | #define LHCALL_SET_PTE 14 | ||
24 | #define LHCALL_SET_PMD 15 | ||
25 | #define LHCALL_LOAD_TLS 16 | ||
26 | |||
27 | #define LG_CLOCK_MIN_DELTA 100UL | ||
28 | #define LG_CLOCK_MAX_DELTA ULONG_MAX | ||
29 | |||
30 | #define LGUEST_TRAP_ENTRY 0x1F | ||
31 | |||
32 | static inline unsigned long | ||
33 | hcall(unsigned long call, | ||
34 | unsigned long arg1, unsigned long arg2, unsigned long arg3) | ||
35 | { | ||
36 | asm volatile("int $" __stringify(LGUEST_TRAP_ENTRY) | ||
37 | : "=a"(call) | ||
38 | : "a"(call), "d"(arg1), "b"(arg2), "c"(arg3) | ||
39 | : "memory"); | ||
40 | return call; | ||
41 | } | ||
42 | |||
43 | void async_hcall(unsigned long call, | ||
44 | unsigned long arg1, unsigned long arg2, unsigned long arg3); | ||
45 | |||
46 | /* Can't use our min() macro here: needs to be a constant */ | ||
47 | #define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32) | ||
48 | |||
49 | #define LHCALL_RING_SIZE 64 | ||
50 | struct hcall_ring | ||
51 | { | ||
52 | u32 eax, edx, ebx, ecx; | ||
53 | }; | ||
54 | |||
55 | /* All the good stuff happens here: guest registers it with LGUEST_INIT */ | ||
56 | struct lguest_data | ||
57 | { | ||
58 | /* Fields which change during running: */ | ||
59 | /* 512 == enabled (same as eflags) */ | ||
60 | unsigned int irq_enabled; | ||
61 | /* Interrupts blocked by guest. */ | ||
62 | DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); | ||
63 | |||
64 | /* Virtual address of page fault. */ | ||
65 | unsigned long cr2; | ||
66 | |||
67 | /* Async hypercall ring. 0xFF == done, 0 == pending. */ | ||
68 | u8 hcall_status[LHCALL_RING_SIZE]; | ||
69 | struct hcall_ring hcalls[LHCALL_RING_SIZE]; | ||
70 | |||
71 | /* Fields initialized by the hypervisor at boot: */ | ||
72 | /* Memory not to try to access */ | ||
73 | unsigned long reserve_mem; | ||
74 | /* ID of this guest (used by network driver to set ethernet address) */ | ||
75 | u16 guestid; | ||
76 | /* KHz for the TSC clock. */ | ||
77 | u32 tsc_khz; | ||
78 | |||
79 | /* Fields initialized by the guest at boot: */ | ||
80 | /* Instruction range to suppress interrupts even if enabled */ | ||
81 | unsigned long noirq_start, noirq_end; | ||
82 | }; | ||
83 | extern struct lguest_data lguest_data; | ||
84 | #endif /* __ASSEMBLY__ */ | ||
85 | #endif /* _ASM_LGUEST_H */ | ||
diff --git a/include/linux/lguest_bus.h b/include/linux/lguest_bus.h new file mode 100644 index 000000000000..c9b4e05fee49 --- /dev/null +++ b/include/linux/lguest_bus.h | |||
@@ -0,0 +1,48 @@ | |||
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 | |||
8 | struct 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 | /* By convention, each device can use irq index+1 if it wants to. */ | ||
19 | static inline int lgdev_irq(const struct lguest_device *dev) | ||
20 | { | ||
21 | return dev->index + 1; | ||
22 | } | ||
23 | |||
24 | /* dma args must not be vmalloced! */ | ||
25 | void lguest_send_dma(unsigned long key, struct lguest_dma *dma); | ||
26 | int lguest_bind_dma(unsigned long key, struct lguest_dma *dmas, | ||
27 | unsigned int num, u8 irq); | ||
28 | void lguest_unbind_dma(unsigned long key, struct lguest_dma *dmas); | ||
29 | |||
30 | /* Map the virtual device space */ | ||
31 | void *lguest_map(unsigned long phys_addr, unsigned long pages); | ||
32 | void lguest_unmap(void *); | ||
33 | |||
34 | struct lguest_driver { | ||
35 | const char *name; | ||
36 | struct module *owner; | ||
37 | u16 device_type; | ||
38 | int (*probe)(struct lguest_device *dev); | ||
39 | void (*remove)(struct lguest_device *dev); | ||
40 | |||
41 | struct device_driver drv; | ||
42 | }; | ||
43 | |||
44 | extern int register_lguest_driver(struct lguest_driver *drv); | ||
45 | extern void unregister_lguest_driver(struct lguest_driver *drv); | ||
46 | |||
47 | extern struct lguest_device_desc *lguest_devices; /* Just past max_pfn */ | ||
48 | #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..0ba414a40c80 --- /dev/null +++ b/include/linux/lguest_launcher.h | |||
@@ -0,0 +1,73 @@ | |||
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 | struct lguest_dma | ||
13 | { | ||
14 | /* 0 if free to be used, filled by hypervisor. */ | ||
15 | u32 used_len; | ||
16 | unsigned long addr[LGUEST_MAX_DMA_SECTIONS]; | ||
17 | u16 len[LGUEST_MAX_DMA_SECTIONS]; | ||
18 | }; | ||
19 | |||
20 | struct lguest_block_page | ||
21 | { | ||
22 | /* 0 is a read, 1 is a write. */ | ||
23 | int type; | ||
24 | u32 sector; /* Offset in device = sector * 512. */ | ||
25 | u32 bytes; /* Length expected to be read/written in bytes */ | ||
26 | /* 0 = pending, 1 = done, 2 = done, error */ | ||
27 | int result; | ||
28 | u32 num_sectors; /* Disk length = num_sectors * 512 */ | ||
29 | }; | ||
30 | |||
31 | /* There is a shared page of these. */ | ||
32 | struct lguest_net | ||
33 | { | ||
34 | /* Simply the mac address (with multicast bit meaning promisc). */ | ||
35 | unsigned char mac[6]; | ||
36 | }; | ||
37 | |||
38 | /* Where the Host expects the Guest to SEND_DMA console output to. */ | ||
39 | #define LGUEST_CONSOLE_DMA_KEY 0 | ||
40 | |||
41 | /* We have a page of these descriptors in the lguest_device page. */ | ||
42 | struct lguest_device_desc { | ||
43 | u16 type; | ||
44 | #define LGUEST_DEVICE_T_CONSOLE 1 | ||
45 | #define LGUEST_DEVICE_T_NET 2 | ||
46 | #define LGUEST_DEVICE_T_BLOCK 3 | ||
47 | |||
48 | u16 features; | ||
49 | #define LGUEST_NET_F_NOCSUM 0x4000 /* Don't bother checksumming */ | ||
50 | #define LGUEST_DEVICE_F_RANDOMNESS 0x8000 /* IRQ is fairly random */ | ||
51 | |||
52 | u16 status; | ||
53 | /* 256 and above are device specific. */ | ||
54 | #define LGUEST_DEVICE_S_ACKNOWLEDGE 1 /* We have seen device. */ | ||
55 | #define LGUEST_DEVICE_S_DRIVER 2 /* We have found a driver */ | ||
56 | #define LGUEST_DEVICE_S_DRIVER_OK 4 /* Driver says OK! */ | ||
57 | #define LGUEST_DEVICE_S_REMOVED 8 /* Device has gone away. */ | ||
58 | #define LGUEST_DEVICE_S_REMOVED_ACK 16 /* Driver has been told. */ | ||
59 | #define LGUEST_DEVICE_S_FAILED 128 /* Something actually failed */ | ||
60 | |||
61 | u16 num_pages; | ||
62 | u32 pfn; | ||
63 | }; | ||
64 | |||
65 | /* Write command first word is a request. */ | ||
66 | enum lguest_req | ||
67 | { | ||
68 | LHREQ_INITIALIZE, /* + pfnlimit, pgdir, start, pageoffset */ | ||
69 | LHREQ_GETDMA, /* + addr (returns &lguest_dma, irq in ->used_len) */ | ||
70 | LHREQ_IRQ, /* + irq */ | ||
71 | LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */ | ||
72 | }; | ||
73 | #endif /* _ASM_LGUEST_USER */ | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index a3df64677ac3..9aa6c10f7bb1 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -196,7 +196,6 @@ enum { | |||
196 | ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ | 196 | ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ |
197 | ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */ | 197 | ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */ |
198 | 198 | ||
199 | ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */ | ||
200 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ | 199 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ |
201 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ | 200 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ |
202 | ATA_PFLAG_GTM_VALID = (1 << 19), /* acpi_gtm data valid */ | 201 | ATA_PFLAG_GTM_VALID = (1 << 19), /* acpi_gtm data valid */ |
@@ -324,6 +323,7 @@ enum ata_completion_errors { | |||
324 | AC_ERR_INVALID = (1 << 7), /* invalid argument */ | 323 | AC_ERR_INVALID = (1 << 7), /* invalid argument */ |
325 | AC_ERR_OTHER = (1 << 8), /* unknown */ | 324 | AC_ERR_OTHER = (1 << 8), /* unknown */ |
326 | AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */ | 325 | AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */ |
326 | AC_ERR_NCQ = (1 << 10), /* marker for offending NCQ qc */ | ||
327 | }; | 327 | }; |
328 | 328 | ||
329 | /* forward declarations */ | 329 | /* forward declarations */ |
@@ -412,6 +412,7 @@ struct ata_queued_cmd { | |||
412 | ata_qc_cb_t complete_fn; | 412 | ata_qc_cb_t complete_fn; |
413 | 413 | ||
414 | void *private_data; | 414 | void *private_data; |
415 | void *lldd_task; | ||
415 | }; | 416 | }; |
416 | 417 | ||
417 | struct ata_port_stats { | 418 | struct ata_port_stats { |
@@ -435,6 +436,7 @@ struct ata_device { | |||
435 | struct ata_port *ap; | 436 | struct ata_port *ap; |
436 | unsigned int devno; /* 0 or 1 */ | 437 | unsigned int devno; /* 0 or 1 */ |
437 | unsigned long flags; /* ATA_DFLAG_xxx */ | 438 | unsigned long flags; /* ATA_DFLAG_xxx */ |
439 | unsigned int horkage; /* List of broken features */ | ||
438 | struct scsi_device *sdev; /* attached SCSI device */ | 440 | struct scsi_device *sdev; /* attached SCSI device */ |
439 | #ifdef CONFIG_ATA_ACPI | 441 | #ifdef CONFIG_ATA_ACPI |
440 | acpi_handle acpi_handle; | 442 | acpi_handle acpi_handle; |
@@ -466,7 +468,6 @@ struct ata_device { | |||
466 | /* error history */ | 468 | /* error history */ |
467 | struct ata_ering ering; | 469 | struct ata_ering ering; |
468 | int spdn_cnt; | 470 | int spdn_cnt; |
469 | unsigned int horkage; /* List of broken features */ | ||
470 | }; | 471 | }; |
471 | 472 | ||
472 | /* Offset into struct ata_device. Fields above it are maintained | 473 | /* Offset into struct ata_device. Fields above it are maintained |
@@ -531,6 +532,7 @@ struct ata_port { | |||
531 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ | 532 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ |
532 | unsigned int hw_sata_spd_limit; | 533 | unsigned int hw_sata_spd_limit; |
533 | unsigned int sata_spd_limit; /* SATA PHY speed limit */ | 534 | unsigned int sata_spd_limit; /* SATA PHY speed limit */ |
535 | unsigned int sata_spd; /* current SATA PHY speed */ | ||
534 | 536 | ||
535 | /* record runtime error info, protected by host lock */ | 537 | /* record runtime error info, protected by host lock */ |
536 | struct ata_eh_info eh_info; | 538 | struct ata_eh_info eh_info; |
@@ -564,6 +566,9 @@ struct ata_port { | |||
564 | pm_message_t pm_mesg; | 566 | pm_message_t pm_mesg; |
565 | int *pm_result; | 567 | int *pm_result; |
566 | 568 | ||
569 | struct timer_list fastdrain_timer; | ||
570 | unsigned long fastdrain_cnt; | ||
571 | |||
567 | void *private_data; | 572 | void *private_data; |
568 | 573 | ||
569 | #ifdef CONFIG_ATA_ACPI | 574 | #ifdef CONFIG_ATA_ACPI |
@@ -620,9 +625,8 @@ struct ata_port_operations { | |||
620 | u8 (*irq_on) (struct ata_port *); | 625 | u8 (*irq_on) (struct ata_port *); |
621 | u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq); | 626 | u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq); |
622 | 627 | ||
623 | u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); | 628 | int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val); |
624 | void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, | 629 | int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val); |
625 | u32 val); | ||
626 | 630 | ||
627 | int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); | 631 | int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); |
628 | int (*port_resume) (struct ata_port *ap); | 632 | int (*port_resume) (struct ata_port *ap); |
@@ -765,7 +769,8 @@ extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *); | |||
765 | */ | 769 | */ |
766 | extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); | 770 | extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); |
767 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); | 771 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); |
768 | extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp); | 772 | extern void ata_tf_to_fis(const struct ata_taskfile *tf, |
773 | u8 pmp, int is_cmd, u8 *fis); | ||
769 | extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); | 774 | extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); |
770 | extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); | 775 | extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); |
771 | extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); | 776 | extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); |
@@ -794,7 +799,6 @@ extern void ata_id_string(const u16 *id, unsigned char *s, | |||
794 | extern void ata_id_c_string(const u16 *id, unsigned char *s, | 799 | extern void ata_id_c_string(const u16 *id, unsigned char *s, |
795 | unsigned int ofs, unsigned int len); | 800 | unsigned int ofs, unsigned int len); |
796 | extern void ata_id_to_dma_mode(struct ata_device *dev, u8 unknown); | 801 | extern void ata_id_to_dma_mode(struct ata_device *dev, u8 unknown); |
797 | extern unsigned long ata_device_blacklisted(const struct ata_device *dev); | ||
798 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 802 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
799 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 803 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
800 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 804 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
@@ -871,11 +875,11 @@ struct pci_bits { | |||
871 | unsigned long val; | 875 | unsigned long val; |
872 | }; | 876 | }; |
873 | 877 | ||
874 | extern int ata_pci_init_native_host(struct ata_host *host); | 878 | extern int ata_pci_init_sff_host(struct ata_host *host); |
875 | extern int ata_pci_init_bmdma(struct ata_host *host); | 879 | extern int ata_pci_init_bmdma(struct ata_host *host); |
876 | extern int ata_pci_prepare_native_host(struct pci_dev *pdev, | 880 | extern int ata_pci_prepare_sff_host(struct pci_dev *pdev, |
877 | const struct ata_port_info * const * ppi, | 881 | const struct ata_port_info * const * ppi, |
878 | struct ata_host **r_host); | 882 | struct ata_host **r_host); |
879 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); | 883 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); |
880 | extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long); | 884 | extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long); |
881 | #endif /* CONFIG_PCI */ | 885 | #endif /* CONFIG_PCI */ |
@@ -911,27 +915,21 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
911 | /* | 915 | /* |
912 | * ata_eh_info helpers | 916 | * ata_eh_info helpers |
913 | */ | 917 | */ |
914 | #define ata_ehi_push_desc(ehi, fmt, args...) do { \ | 918 | extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...); |
915 | (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \ | 919 | extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...); |
916 | ATA_EH_DESC_LEN - (ehi)->desc_len, \ | 920 | extern void ata_ehi_clear_desc(struct ata_eh_info *ehi); |
917 | fmt , ##args); \ | 921 | |
918 | } while (0) | 922 | static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi) |
919 | |||
920 | #define ata_ehi_clear_desc(ehi) do { \ | ||
921 | (ehi)->desc[0] = '\0'; \ | ||
922 | (ehi)->desc_len = 0; \ | ||
923 | } while (0) | ||
924 | |||
925 | static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi) | ||
926 | { | 923 | { |
927 | ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK; | 924 | ehi->flags |= ATA_EHI_RESUME_LINK; |
928 | ehi->action |= ATA_EH_SOFTRESET; | 925 | ehi->action |= ATA_EH_SOFTRESET; |
929 | ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; | 926 | ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; |
930 | } | 927 | } |
931 | 928 | ||
932 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) | 929 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) |
933 | { | 930 | { |
934 | __ata_ehi_hotplugged(ehi); | 931 | ata_ehi_schedule_probe(ehi); |
932 | ehi->flags |= ATA_EHI_HOTPLUGGED; | ||
935 | ehi->err_mask |= AC_ERR_ATA_BUS; | 933 | ehi->err_mask |= AC_ERR_ATA_BUS; |
936 | } | 934 | } |
937 | 935 | ||
diff --git a/include/linux/limits.h b/include/linux/limits.h index eaf2e099f125..2d0f94162fb3 100644 --- a/include/linux/limits.h +++ b/include/linux/limits.h | |||
@@ -5,8 +5,6 @@ | |||
5 | 5 | ||
6 | #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ | 6 | #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ |
7 | #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ | 7 | #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ |
8 | #define CHILD_MAX 999 /* no limit :-) */ | ||
9 | #define OPEN_MAX 256 /* # open files a process may have */ | ||
10 | #define LINK_MAX 127 /* # links a file may have */ | 8 | #define LINK_MAX 127 /* # links a file may have */ |
11 | #define MAX_CANON 255 /* size of the canonical input queue */ | 9 | #define MAX_CANON 255 /* size of the canonical input queue */ |
12 | #define MAX_INPUT 255 /* size of the type-ahead buffer */ | 10 | #define MAX_INPUT 255 /* size of the type-ahead buffer */ |
diff --git a/include/linux/linux_logo.h b/include/linux/linux_logo.h index 9c01bde5bf1b..08a92969c76e 100644 --- a/include/linux/linux_logo.h +++ b/include/linux/linux_logo.h | |||
@@ -33,5 +33,13 @@ struct linux_logo { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | extern const struct linux_logo *fb_find_logo(int depth); | 35 | extern const struct linux_logo *fb_find_logo(int depth); |
36 | #ifdef CONFIG_FB_LOGO_EXTRA | ||
37 | extern void fb_append_extra_logo(const struct linux_logo *logo, | ||
38 | unsigned int n); | ||
39 | #else | ||
40 | static inline void fb_append_extra_logo(const struct linux_logo *logo, | ||
41 | unsigned int n) | ||
42 | {} | ||
43 | #endif | ||
36 | 44 | ||
37 | #endif /* _LINUX_LINUX_LOGO_H */ | 45 | #endif /* _LINUX_LINUX_LOGO_H */ |
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index 246de1d84a26..6f1637c61e10 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h | |||
@@ -27,6 +27,7 @@ struct nlmsvc_binding { | |||
27 | struct nfs_fh *, | 27 | struct nfs_fh *, |
28 | struct file **); | 28 | struct file **); |
29 | void (*fclose)(struct file *); | 29 | void (*fclose)(struct file *); |
30 | unsigned long (*get_grace_period)(void); | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | extern struct nlmsvc_binding * nlmsvc_ops; | 33 | extern struct nlmsvc_binding * nlmsvc_ops; |
@@ -38,4 +39,12 @@ extern int nlmclnt_proc(struct inode *, int, struct file_lock *); | |||
38 | extern int lockd_up(int proto); | 39 | extern int lockd_up(int proto); |
39 | extern void lockd_down(void); | 40 | extern void lockd_down(void); |
40 | 41 | ||
42 | unsigned long get_nfs_grace_period(void); | ||
43 | |||
44 | #ifdef CONFIG_NFSD_V4 | ||
45 | unsigned long get_nfs4_grace_period(void); | ||
46 | #else | ||
47 | static inline unsigned long get_nfs4_grace_period(void) {return 0;} | ||
48 | #endif | ||
49 | |||
41 | #endif /* LINUX_LOCKD_BIND_H */ | 50 | #endif /* LINUX_LOCKD_BIND_H */ |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 05707e2fccae..e2d1ce36b367 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -39,6 +39,7 @@ | |||
39 | struct nlm_host { | 39 | struct nlm_host { |
40 | struct hlist_node h_hash; /* doubly linked list */ | 40 | struct hlist_node h_hash; /* doubly linked list */ |
41 | struct sockaddr_in h_addr; /* peer address */ | 41 | struct sockaddr_in h_addr; /* peer address */ |
42 | struct sockaddr_in h_saddr; /* our address (optional) */ | ||
42 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ | 43 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ |
43 | char * h_name; /* remote hostname */ | 44 | char * h_name; /* remote hostname */ |
44 | u32 h_version; /* interface version */ | 45 | u32 h_version; /* interface version */ |
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 | ||
11 | struct task_struct; | 12 | struct task_struct; |
13 | struct 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 | ||
126 | struct lock_time { | ||
127 | s64 min; | ||
128 | s64 max; | ||
129 | s64 total; | ||
130 | unsigned long nr; | ||
131 | }; | ||
132 | |||
133 | enum 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 | ||
144 | struct 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 | |||
153 | struct lock_class_stats lock_stats(struct lock_class *class); | ||
154 | void 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 | |||
331 | extern void lock_contended(struct lockdep_map *lock, unsigned long ip); | ||
332 | extern void lock_acquired(struct lockdep_map *lock); | ||
333 | |||
334 | #define LOCK_CONTENDED(_lock, try, lock) \ | ||
335 | do { \ | ||
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) |
285 | extern void early_init_irq_lock_class(void); | 354 | extern void early_init_irq_lock_class(void); |
286 | #else | 355 | #else |
diff --git a/include/linux/lzo.h b/include/linux/lzo.h index 582d8b711a13..d793497ec1ca 100644 --- a/include/linux/lzo.h +++ b/include/linux/lzo.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *)) | 17 | #define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *)) |
18 | #define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS | 18 | #define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS |
19 | 19 | ||
20 | #define lzo1x_worst_compress(x) (x + (x / 64) + 16 + 3) | 20 | #define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3) |
21 | 21 | ||
22 | /* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */ | 22 | /* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */ |
23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, | 23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 9d713c03e3da..36cc20dfd142 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #define HPFS_SUPER_MAGIC 0xf995e849 | 13 | #define HPFS_SUPER_MAGIC 0xf995e849 |
14 | #define ISOFS_SUPER_MAGIC 0x9660 | 14 | #define ISOFS_SUPER_MAGIC 0x9660 |
15 | #define JFFS2_SUPER_MAGIC 0x72b6 | 15 | #define JFFS2_SUPER_MAGIC 0x72b6 |
16 | #define KVMFS_SUPER_MAGIC 0x19700426 | ||
17 | #define ANON_INODE_FS_MAGIC 0x09041934 | 16 | #define ANON_INODE_FS_MAGIC 0x09041934 |
18 | 17 | ||
19 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | 18 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ |
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 daabb3aa1ec6..e147cf50529f 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -159,7 +159,7 @@ extern void mpol_fix_fork_child_flag(struct task_struct *p); | |||
159 | 159 | ||
160 | extern struct mempolicy default_policy; | 160 | extern struct mempolicy default_policy; |
161 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 161 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
162 | unsigned long addr); | 162 | unsigned long addr, gfp_t gfp_flags); |
163 | extern unsigned slab_node(struct mempolicy *policy); | 163 | extern unsigned slab_node(struct mempolicy *policy); |
164 | 164 | ||
165 | extern enum zone_type policy_zone; | 165 | extern enum zone_type policy_zone; |
@@ -256,9 +256,9 @@ static inline void mpol_fix_fork_child_flag(struct task_struct *p) | |||
256 | #define set_cpuset_being_rebound(x) do {} while (0) | 256 | #define set_cpuset_being_rebound(x) do {} while (0) |
257 | 257 | ||
258 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 258 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
259 | unsigned long addr) | 259 | unsigned long addr, gfp_t gfp_flags) |
260 | { | 260 | { |
261 | return NODE_DATA(0)->node_zonelists + gfp_zone(GFP_HIGHUSER); | 261 | return NODE_DATA(0)->node_zonelists + gfp_zone(gfp_flags); |
262 | } | 262 | } |
263 | 263 | ||
264 | static inline int do_migrate_pages(struct mm_struct *mm, | 264 | static inline int do_migrate_pages(struct mm_struct *mm, |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index b372f5910fc1..cfb78fb2c046 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -172,6 +172,7 @@ struct mlx4_caps { | |||
172 | int num_pds; | 172 | int num_pds; |
173 | int reserved_pds; | 173 | int reserved_pds; |
174 | int mtt_entry_sz; | 174 | int mtt_entry_sz; |
175 | u32 max_msg_sz; | ||
175 | u32 page_size_cap; | 176 | u32 page_size_cap; |
176 | u32 flags; | 177 | u32 flags; |
177 | u16 stat_rate_support; | 178 | u16 stat_rate_support; |
@@ -322,6 +323,7 @@ int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt, | |||
322 | u64 db_rec, struct mlx4_srq *srq); | 323 | u64 db_rec, struct mlx4_srq *srq); |
323 | void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); | 324 | void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); |
324 | int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); | 325 | int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); |
326 | int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark); | ||
325 | 327 | ||
326 | int mlx4_INIT_PORT(struct mlx4_dev *dev, int port); | 328 | int mlx4_INIT_PORT(struct mlx4_dev *dev, int port); |
327 | int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); | 329 | int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 10c57d279144..3968b943259a 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -282,6 +282,9 @@ int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | |||
282 | struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar, | 282 | struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar, |
283 | int sqd_event, struct mlx4_qp *qp); | 283 | int sqd_event, struct mlx4_qp *qp); |
284 | 284 | ||
285 | int mlx4_qp_query(struct mlx4_dev *dev, struct mlx4_qp *qp, | ||
286 | struct mlx4_qp_context *context); | ||
287 | |||
285 | static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn) | 288 | static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn) |
286 | { | 289 | { |
287 | return radix_tree_lookup(&dev->qp_table_tree, qpn & (dev->caps.num_qps - 1)); | 290 | return radix_tree_lookup(&dev->qp_table_tree, qpn & (dev->caps.num_qps - 1)); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 1c1207472bb4..c456c3a1c28e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _LINUX_MM_H | 2 | #define _LINUX_MM_H |
3 | 3 | ||
4 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
5 | #include <linux/capability.h> | ||
6 | 5 | ||
7 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
8 | 7 | ||
@@ -27,7 +26,6 @@ extern unsigned long max_mapnr; | |||
27 | 26 | ||
28 | extern unsigned long num_physpages; | 27 | extern unsigned long num_physpages; |
29 | extern void * high_memory; | 28 | extern void * high_memory; |
30 | extern unsigned long vmalloc_earlyreserve; | ||
31 | extern int page_cluster; | 29 | extern int page_cluster; |
32 | 30 | ||
33 | #ifdef CONFIG_SYSCTL | 31 | #ifdef CONFIG_SYSCTL |
@@ -170,6 +168,8 @@ extern unsigned int kobjsize(const void *objp); | |||
170 | #define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ | 168 | #define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ |
171 | #define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */ | 169 | #define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */ |
172 | 170 | ||
171 | #define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */ | ||
172 | |||
173 | #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ | 173 | #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ |
174 | #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS | 174 | #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS |
175 | #endif | 175 | #endif |
@@ -192,6 +192,30 @@ extern unsigned int kobjsize(const void *objp); | |||
192 | */ | 192 | */ |
193 | extern pgprot_t protection_map[16]; | 193 | extern pgprot_t protection_map[16]; |
194 | 194 | ||
195 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ | ||
196 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ | ||
197 | |||
198 | |||
199 | /* | ||
200 | * vm_fault is filled by the the pagefault handler and passed to the vma's | ||
201 | * ->fault function. The vma's ->fault is responsible for returning a bitmask | ||
202 | * of VM_FAULT_xxx flags that give details about how the fault was handled. | ||
203 | * | ||
204 | * pgoff should be used in favour of virtual_address, if possible. If pgoff | ||
205 | * is used, one may set VM_CAN_NONLINEAR in the vma->vm_flags to get nonlinear | ||
206 | * mapping support. | ||
207 | */ | ||
208 | struct vm_fault { | ||
209 | unsigned int flags; /* FAULT_FLAG_xxx flags */ | ||
210 | pgoff_t pgoff; /* Logical page offset based on vma */ | ||
211 | void __user *virtual_address; /* Faulting virtual address */ | ||
212 | |||
213 | struct page *page; /* ->fault handlers should return a | ||
214 | * page here, unless VM_FAULT_NOPAGE | ||
215 | * is set (which is also implied by | ||
216 | * VM_FAULT_ERROR). | ||
217 | */ | ||
218 | }; | ||
195 | 219 | ||
196 | /* | 220 | /* |
197 | * These are the virtual MM functions - opening of an area, closing and | 221 | * These are the virtual MM functions - opening of an area, closing and |
@@ -201,9 +225,11 @@ extern pgprot_t protection_map[16]; | |||
201 | struct vm_operations_struct { | 225 | struct vm_operations_struct { |
202 | void (*open)(struct vm_area_struct * area); | 226 | void (*open)(struct vm_area_struct * area); |
203 | void (*close)(struct vm_area_struct * area); | 227 | void (*close)(struct vm_area_struct * area); |
204 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); | 228 | int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf); |
205 | unsigned long (*nopfn)(struct vm_area_struct * area, unsigned long address); | 229 | struct page *(*nopage)(struct vm_area_struct *area, |
206 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); | 230 | unsigned long address, int *type); |
231 | unsigned long (*nopfn)(struct vm_area_struct *area, | ||
232 | unsigned long address); | ||
207 | 233 | ||
208 | /* notification that a previously read-only page is about to become | 234 | /* notification that a previously read-only page is about to become |
209 | * writable, if an error is returned it will cause a SIGBUS */ | 235 | * writable, if an error is returned it will cause a SIGBUS */ |
@@ -601,6 +627,7 @@ static inline struct address_space *page_mapping(struct page *page) | |||
601 | { | 627 | { |
602 | struct address_space *mapping = page->mapping; | 628 | struct address_space *mapping = page->mapping; |
603 | 629 | ||
630 | VM_BUG_ON(PageSlab(page)); | ||
604 | if (unlikely(PageSwapCache(page))) | 631 | if (unlikely(PageSwapCache(page))) |
605 | mapping = &swapper_space; | 632 | mapping = &swapper_space; |
606 | #ifdef CONFIG_SLUB | 633 | #ifdef CONFIG_SLUB |
@@ -656,7 +683,6 @@ static inline int page_mapped(struct page *page) | |||
656 | */ | 683 | */ |
657 | #define NOPAGE_SIGBUS (NULL) | 684 | #define NOPAGE_SIGBUS (NULL) |
658 | #define NOPAGE_OOM ((struct page *) (-1)) | 685 | #define NOPAGE_OOM ((struct page *) (-1)) |
659 | #define NOPAGE_REFAULT ((struct page *) (-2)) /* Return to userspace, rerun */ | ||
660 | 686 | ||
661 | /* | 687 | /* |
662 | * Error return values for the *_nopfn functions | 688 | * Error return values for the *_nopfn functions |
@@ -670,16 +696,18 @@ static inline int page_mapped(struct page *page) | |||
670 | * Used to decide whether a process gets delivered SIGBUS or | 696 | * Used to decide whether a process gets delivered SIGBUS or |
671 | * just gets major/minor fault counters bumped up. | 697 | * just gets major/minor fault counters bumped up. |
672 | */ | 698 | */ |
673 | #define VM_FAULT_OOM 0x00 | 699 | |
674 | #define VM_FAULT_SIGBUS 0x01 | 700 | #define VM_FAULT_MINOR 0 /* For backwards compat. Remove me quickly. */ |
675 | #define VM_FAULT_MINOR 0x02 | 701 | |
676 | #define VM_FAULT_MAJOR 0x03 | 702 | #define VM_FAULT_OOM 0x0001 |
677 | 703 | #define VM_FAULT_SIGBUS 0x0002 | |
678 | /* | 704 | #define VM_FAULT_MAJOR 0x0004 |
679 | * Special case for get_user_pages. | 705 | #define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ |
680 | * Must be in a distinct bit from the above VM_FAULT_ flags. | 706 | |
681 | */ | 707 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ |
682 | #define VM_FAULT_WRITE 0x10 | 708 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ |
709 | |||
710 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) | ||
683 | 711 | ||
684 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) | 712 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) |
685 | 713 | ||
@@ -763,20 +791,10 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, | |||
763 | 791 | ||
764 | extern int vmtruncate(struct inode * inode, loff_t offset); | 792 | extern int vmtruncate(struct inode * inode, loff_t offset); |
765 | extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); | 793 | extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); |
766 | extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); | ||
767 | extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); | ||
768 | 794 | ||
769 | #ifdef CONFIG_MMU | 795 | #ifdef CONFIG_MMU |
770 | extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, | 796 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
771 | unsigned long address, int write_access); | 797 | unsigned long address, int write_access); |
772 | |||
773 | static inline int handle_mm_fault(struct mm_struct *mm, | ||
774 | struct vm_area_struct *vma, unsigned long address, | ||
775 | int write_access) | ||
776 | { | ||
777 | return __handle_mm_fault(mm, vma, address, write_access) & | ||
778 | (~VM_FAULT_WRITE); | ||
779 | } | ||
780 | #else | 798 | #else |
781 | static inline int handle_mm_fault(struct mm_struct *mm, | 799 | static inline int handle_mm_fault(struct mm_struct *mm, |
782 | struct vm_area_struct *vma, unsigned long address, | 800 | struct vm_area_struct *vma, unsigned long address, |
@@ -790,7 +808,6 @@ static inline int handle_mm_fault(struct mm_struct *mm, | |||
790 | 808 | ||
791 | extern int make_pages_present(unsigned long addr, unsigned long end); | 809 | extern int make_pages_present(unsigned long addr, unsigned long end); |
792 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | 810 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); |
793 | void install_arg_page(struct vm_area_struct *, struct page *, unsigned long); | ||
794 | 811 | ||
795 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, | 812 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, |
796 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); | 813 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); |
@@ -807,32 +824,42 @@ int FASTCALL(set_page_dirty(struct page *page)); | |||
807 | int set_page_dirty_lock(struct page *page); | 824 | int set_page_dirty_lock(struct page *page); |
808 | int clear_page_dirty_for_io(struct page *page); | 825 | int clear_page_dirty_for_io(struct page *page); |
809 | 826 | ||
827 | extern unsigned long move_page_tables(struct vm_area_struct *vma, | ||
828 | unsigned long old_addr, struct vm_area_struct *new_vma, | ||
829 | unsigned long new_addr, unsigned long len); | ||
810 | extern unsigned long do_mremap(unsigned long addr, | 830 | extern unsigned long do_mremap(unsigned long addr, |
811 | unsigned long old_len, unsigned long new_len, | 831 | unsigned long old_len, unsigned long new_len, |
812 | unsigned long flags, unsigned long new_addr); | 832 | unsigned long flags, unsigned long new_addr); |
833 | extern int mprotect_fixup(struct vm_area_struct *vma, | ||
834 | struct vm_area_struct **pprev, unsigned long start, | ||
835 | unsigned long end, unsigned long newflags); | ||
813 | 836 | ||
814 | /* | 837 | /* |
815 | * Prototype to add a shrinker callback for ageable caches. | 838 | * A callback you can register to apply pressure to ageable caches. |
816 | * | ||
817 | * These functions are passed a count `nr_to_scan' and a gfpmask. They should | ||
818 | * scan `nr_to_scan' objects, attempting to free them. | ||
819 | * | 839 | * |
820 | * The callback must return the number of objects which remain in the cache. | 840 | * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should |
841 | * look through the least-recently-used 'nr_to_scan' entries and | ||
842 | * attempt to free them up. It should return the number of objects | ||
843 | * which remain in the cache. If it returns -1, it means it cannot do | ||
844 | * any scanning at this time (eg. there is a risk of deadlock). | ||
821 | * | 845 | * |
822 | * The callback will be passed nr_to_scan == 0 when the VM is querying the | 846 | * The 'gfpmask' refers to the allocation we are currently trying to |
823 | * cache size, so a fastpath for that case is appropriate. | 847 | * fulfil. |
824 | */ | 848 | * |
825 | typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask); | 849 | * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is |
826 | 850 | * querying the cache size, so a fastpath for that case is appropriate. | |
827 | /* | ||
828 | * Add an aging callback. The int is the number of 'seeks' it takes | ||
829 | * to recreate one of the objects that these functions age. | ||
830 | */ | 851 | */ |
852 | struct shrinker { | ||
853 | int (*shrink)(int nr_to_scan, gfp_t gfp_mask); | ||
854 | int seeks; /* seeks to recreate an obj */ | ||
831 | 855 | ||
832 | #define DEFAULT_SEEKS 2 | 856 | /* These are for internal use */ |
833 | struct shrinker; | 857 | struct list_head list; |
834 | extern struct shrinker *set_shrinker(int, shrinker_t); | 858 | long nr; /* objs pending delete */ |
835 | extern void remove_shrinker(struct shrinker *shrinker); | 859 | }; |
860 | #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ | ||
861 | extern void register_shrinker(struct shrinker *); | ||
862 | extern void unregister_shrinker(struct shrinker *); | ||
836 | 863 | ||
837 | /* | 864 | /* |
838 | * Some shared mappigns will want the pages marked read-only | 865 | * Some shared mappigns will want the pages marked read-only |
@@ -1072,6 +1099,10 @@ extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned lo | |||
1072 | extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | 1099 | extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, |
1073 | unsigned long len, unsigned long prot, | 1100 | unsigned long len, unsigned long prot, |
1074 | unsigned long flag, unsigned long pgoff); | 1101 | unsigned long flag, unsigned long pgoff); |
1102 | extern unsigned long mmap_region(struct file *file, unsigned long addr, | ||
1103 | unsigned long len, unsigned long flags, | ||
1104 | unsigned int vm_flags, unsigned long pgoff, | ||
1105 | int accountable); | ||
1075 | 1106 | ||
1076 | static inline unsigned long do_mmap(struct file *file, unsigned long addr, | 1107 | static inline unsigned long do_mmap(struct file *file, unsigned long addr, |
1077 | unsigned long len, unsigned long prot, | 1108 | unsigned long len, unsigned long prot, |
@@ -1097,9 +1128,7 @@ extern void truncate_inode_pages_range(struct address_space *, | |||
1097 | loff_t lstart, loff_t lend); | 1128 | loff_t lstart, loff_t lend); |
1098 | 1129 | ||
1099 | /* generic vm_area_ops exported for stackable file systems */ | 1130 | /* generic vm_area_ops exported for stackable file systems */ |
1100 | extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); | 1131 | extern int filemap_fault(struct vm_area_struct *, struct vm_fault *); |
1101 | extern int filemap_populate(struct vm_area_struct *, unsigned long, | ||
1102 | unsigned long, pgprot_t, unsigned long, int); | ||
1103 | 1132 | ||
1104 | /* mm/page-writeback.c */ | 1133 | /* mm/page-writeback.c */ |
1105 | int write_one_page(struct page *page, int wait); | 1134 | int write_one_page(struct page *page, int wait); |
@@ -1114,13 +1143,20 @@ int do_page_cache_readahead(struct address_space *mapping, struct file *filp, | |||
1114 | pgoff_t offset, unsigned long nr_to_read); | 1143 | pgoff_t offset, unsigned long nr_to_read); |
1115 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, | 1144 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, |
1116 | pgoff_t offset, unsigned long nr_to_read); | 1145 | pgoff_t offset, unsigned long nr_to_read); |
1117 | unsigned long page_cache_readahead(struct address_space *mapping, | 1146 | |
1118 | struct file_ra_state *ra, | 1147 | void page_cache_sync_readahead(struct address_space *mapping, |
1119 | struct file *filp, | 1148 | struct file_ra_state *ra, |
1120 | pgoff_t offset, | 1149 | struct file *filp, |
1121 | unsigned long size); | 1150 | pgoff_t offset, |
1122 | void handle_ra_miss(struct address_space *mapping, | 1151 | unsigned long size); |
1123 | struct file_ra_state *ra, pgoff_t offset); | 1152 | |
1153 | void page_cache_async_readahead(struct address_space *mapping, | ||
1154 | struct file_ra_state *ra, | ||
1155 | struct file *filp, | ||
1156 | struct page *pg, | ||
1157 | pgoff_t offset, | ||
1158 | unsigned long size); | ||
1159 | |||
1124 | unsigned long max_sane_readahead(unsigned long nr); | 1160 | unsigned long max_sane_readahead(unsigned long nr); |
1125 | 1161 | ||
1126 | /* Do stack extension */ | 1162 | /* Do stack extension */ |
@@ -1128,6 +1164,8 @@ extern int expand_stack(struct vm_area_struct *vma, unsigned long address); | |||
1128 | #ifdef CONFIG_IA64 | 1164 | #ifdef CONFIG_IA64 |
1129 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); | 1165 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); |
1130 | #endif | 1166 | #endif |
1167 | extern int expand_stack_downwards(struct vm_area_struct *vma, | ||
1168 | unsigned long address); | ||
1131 | 1169 | ||
1132 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ | 1170 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ |
1133 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); | 1171 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d09b1345a3a1..da8eb8ad9e9b 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -24,6 +24,14 @@ | |||
24 | #endif | 24 | #endif |
25 | #define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) | 25 | #define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) |
26 | 26 | ||
27 | /* | ||
28 | * PAGE_ALLOC_COSTLY_ORDER is the order at which allocations are deemed | ||
29 | * costly to service. That is between allocation orders which should | ||
30 | * coelesce naturally under reasonable reclaim pressure and those which | ||
31 | * will not. | ||
32 | */ | ||
33 | #define PAGE_ALLOC_COSTLY_ORDER 3 | ||
34 | |||
27 | struct free_area { | 35 | struct free_area { |
28 | struct list_head free_list; | 36 | struct list_head free_list; |
29 | unsigned long nr_free; | 37 | unsigned long nr_free; |
@@ -146,6 +154,7 @@ enum zone_type { | |||
146 | */ | 154 | */ |
147 | ZONE_HIGHMEM, | 155 | ZONE_HIGHMEM, |
148 | #endif | 156 | #endif |
157 | ZONE_MOVABLE, | ||
149 | MAX_NR_ZONES | 158 | MAX_NR_ZONES |
150 | }; | 159 | }; |
151 | 160 | ||
@@ -167,6 +176,7 @@ enum zone_type { | |||
167 | + defined(CONFIG_ZONE_DMA32) \ | 176 | + defined(CONFIG_ZONE_DMA32) \ |
168 | + 1 \ | 177 | + 1 \ |
169 | + defined(CONFIG_HIGHMEM) \ | 178 | + defined(CONFIG_HIGHMEM) \ |
179 | + 1 \ | ||
170 | ) | 180 | ) |
171 | #if __ZONE_COUNT < 2 | 181 | #if __ZONE_COUNT < 2 |
172 | #define ZONES_SHIFT 0 | 182 | #define ZONES_SHIFT 0 |
@@ -499,10 +509,22 @@ static inline int populated_zone(struct zone *zone) | |||
499 | return (!!zone->present_pages); | 509 | return (!!zone->present_pages); |
500 | } | 510 | } |
501 | 511 | ||
512 | extern int movable_zone; | ||
513 | |||
514 | static inline int zone_movable_is_highmem(void) | ||
515 | { | ||
516 | #if defined(CONFIG_HIGHMEM) && defined(CONFIG_ARCH_POPULATES_NODE_MAP) | ||
517 | return movable_zone == ZONE_HIGHMEM; | ||
518 | #else | ||
519 | return 0; | ||
520 | #endif | ||
521 | } | ||
522 | |||
502 | static inline int is_highmem_idx(enum zone_type idx) | 523 | static inline int is_highmem_idx(enum zone_type idx) |
503 | { | 524 | { |
504 | #ifdef CONFIG_HIGHMEM | 525 | #ifdef CONFIG_HIGHMEM |
505 | return (idx == ZONE_HIGHMEM); | 526 | return (idx == ZONE_HIGHMEM || |
527 | (idx == ZONE_MOVABLE && zone_movable_is_highmem())); | ||
506 | #else | 528 | #else |
507 | return 0; | 529 | return 0; |
508 | #endif | 530 | #endif |
@@ -522,7 +544,9 @@ static inline int is_normal_idx(enum zone_type idx) | |||
522 | static inline int is_highmem(struct zone *zone) | 544 | static inline int is_highmem(struct zone *zone) |
523 | { | 545 | { |
524 | #ifdef CONFIG_HIGHMEM | 546 | #ifdef CONFIG_HIGHMEM |
525 | return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; | 547 | int zone_idx = zone - zone->zone_pgdat->node_zones; |
548 | return zone_idx == ZONE_HIGHMEM || | ||
549 | (zone_idx == ZONE_MOVABLE && zone_movable_is_highmem()); | ||
526 | #else | 550 | #else |
527 | return 0; | 551 | return 0; |
528 | #endif | 552 | #endif |
@@ -566,6 +590,11 @@ int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, | |||
566 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, | 590 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, |
567 | struct file *, void __user *, size_t *, loff_t *); | 591 | struct file *, void __user *, size_t *, loff_t *); |
568 | 592 | ||
593 | extern int numa_zonelist_order_handler(struct ctl_table *, int, | ||
594 | struct file *, void __user *, size_t *, loff_t *); | ||
595 | extern char numa_zonelist_order[]; | ||
596 | #define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */ | ||
597 | |||
569 | #include <linux/topology.h> | 598 | #include <linux/topology.h> |
570 | /* Returns the number of the current Node. */ | 599 | /* Returns the number of the current Node. */ |
571 | #ifndef numa_node_id | 600 | #ifndef numa_node_id |
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h index 1fa4d9813b31..8eed44f8ca73 100644 --- a/include/linux/mnt_namespace.h +++ b/include/linux/mnt_namespace.h | |||
@@ -14,7 +14,7 @@ struct mnt_namespace { | |||
14 | int event; | 14 | int event; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | extern struct mnt_namespace *copy_mnt_ns(int, struct mnt_namespace *, | 17 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, |
18 | struct fs_struct *); | 18 | struct fs_struct *); |
19 | extern void __put_mnt_ns(struct mnt_namespace *ns); | 19 | extern void __put_mnt_ns(struct mnt_namespace *ns); |
20 | 20 | ||
diff --git a/include/linux/module.h b/include/linux/module.h index e6e0f86ef5fc..b6a646cea1cb 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -6,7 +6,6 @@ | |||
6 | * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 | 6 | * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 |
7 | * Rewritten again by Rusty Russell, 2002 | 7 | * Rewritten again by Rusty Russell, 2002 |
8 | */ | 8 | */ |
9 | #include <linux/spinlock.h> | ||
10 | #include <linux/list.h> | 9 | #include <linux/list.h> |
11 | #include <linux/stat.h> | 10 | #include <linux/stat.h> |
12 | #include <linux/compiler.h> | 11 | #include <linux/compiler.h> |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 0e09c005dda8..f950921523f5 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
@@ -146,7 +146,7 @@ struct fat_boot_fsinfo { | |||
146 | }; | 146 | }; |
147 | 147 | ||
148 | struct msdos_dir_entry { | 148 | struct msdos_dir_entry { |
149 | __u8 name[8],ext[3]; /* name and extension */ | 149 | __u8 name[MSDOS_NAME];/* name and extension */ |
150 | __u8 attr; /* attribute bits */ | 150 | __u8 attr; /* attribute bits */ |
151 | __u8 lcase; /* Case for base and extension */ | 151 | __u8 lcase; /* Case for base and extension */ |
152 | __u8 ctime_cs; /* Creation time, centiseconds (0-199) */ | 152 | __u8 ctime_cs; /* Creation time, centiseconds (0-199) */ |
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) |
71 | extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); | 71 | extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); |
72 | extern int FASTCALL(path_walk(const char *, struct nameidata *)); | 72 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, |
73 | extern int FASTCALL(link_path_walk(const char *, struct nameidata *)); | 73 | const char *, unsigned int, struct nameidata *); |
74 | extern void path_release(struct nameidata *); | 74 | extern void path_release(struct nameidata *); |
75 | extern void path_release_on_umount(struct nameidata *); | 75 | extern void path_release_on_umount(struct nameidata *); |
76 | 76 | ||
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index 83e39eb054d3..88766e43e121 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -148,8 +148,6 @@ struct ncp_nls_ioctl | |||
148 | #include <linux/ncp_fs_i.h> | 148 | #include <linux/ncp_fs_i.h> |
149 | #include <linux/ncp_fs_sb.h> | 149 | #include <linux/ncp_fs_sb.h> |
150 | 150 | ||
151 | /* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */ | ||
152 | #undef PRINTK | ||
153 | /* define because it is easy to change PRINTK to {*}PRINTK */ | 151 | /* define because it is easy to change PRINTK to {*}PRINTK */ |
154 | #define PRINTK(format, args...) printk(KERN_DEBUG format , ## args) | 152 | #define PRINTK(format, args...) printk(KERN_DEBUG format , ## args) |
155 | 153 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3a70f553b28f..4a616d73cc25 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -108,6 +108,14 @@ struct wireless_dev; | |||
108 | #define MAX_HEADER (LL_MAX_HEADER + 48) | 108 | #define MAX_HEADER (LL_MAX_HEADER + 48) |
109 | #endif | 109 | #endif |
110 | 110 | ||
111 | struct net_device_subqueue | ||
112 | { | ||
113 | /* Give a control state for each queue. This struct may contain | ||
114 | * per-queue locks in the future. | ||
115 | */ | ||
116 | unsigned long state; | ||
117 | }; | ||
118 | |||
111 | /* | 119 | /* |
112 | * Network device statistics. Akin to the 2.0 ether stats but | 120 | * Network device statistics. Akin to the 2.0 ether stats but |
113 | * with byte counters. | 121 | * with byte counters. |
@@ -177,19 +185,25 @@ struct netif_rx_stats | |||
177 | 185 | ||
178 | DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); | 186 | DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); |
179 | 187 | ||
188 | struct dev_addr_list | ||
189 | { | ||
190 | struct dev_addr_list *next; | ||
191 | u8 da_addr[MAX_ADDR_LEN]; | ||
192 | u8 da_addrlen; | ||
193 | u8 da_synced; | ||
194 | int da_users; | ||
195 | int da_gusers; | ||
196 | }; | ||
180 | 197 | ||
181 | /* | 198 | /* |
182 | * We tag multicasts with these structures. | 199 | * We tag multicasts with these structures. |
183 | */ | 200 | */ |
184 | 201 | ||
185 | struct dev_mc_list | 202 | #define dev_mc_list dev_addr_list |
186 | { | 203 | #define dmi_addr da_addr |
187 | struct dev_mc_list *next; | 204 | #define dmi_addrlen da_addrlen |
188 | __u8 dmi_addr[MAX_ADDR_LEN]; | 205 | #define dmi_users da_users |
189 | unsigned char dmi_addrlen; | 206 | #define dmi_gusers da_gusers |
190 | int dmi_users; | ||
191 | int dmi_gusers; | ||
192 | }; | ||
193 | 207 | ||
194 | struct hh_cache | 208 | struct hh_cache |
195 | { | 209 | { |
@@ -314,9 +328,10 @@ struct net_device | |||
314 | /* Net device features */ | 328 | /* Net device features */ |
315 | unsigned long features; | 329 | unsigned long features; |
316 | #define NETIF_F_SG 1 /* Scatter/gather IO. */ | 330 | #define NETIF_F_SG 1 /* Scatter/gather IO. */ |
317 | #define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ | 331 | #define NETIF_F_IP_CSUM 2 /* Can checksum TCP/UDP over IPv4. */ |
318 | #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ | 332 | #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ |
319 | #define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ | 333 | #define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ |
334 | #define NETIF_F_IPV6_CSUM 16 /* Can checksum TCP/UDP over IPV6 */ | ||
320 | #define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ | 335 | #define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ |
321 | #define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */ | 336 | #define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */ |
322 | #define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */ | 337 | #define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */ |
@@ -325,6 +340,7 @@ struct net_device | |||
325 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ | 340 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ |
326 | #define NETIF_F_GSO 2048 /* Enable software GSO. */ | 341 | #define NETIF_F_GSO 2048 /* Enable software GSO. */ |
327 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | 342 | #define NETIF_F_LLTX 4096 /* LockLess TX */ |
343 | #define NETIF_F_MULTI_QUEUE 16384 /* Has multiple TX/RX queues */ | ||
328 | 344 | ||
329 | /* Segmentation offload features */ | 345 | /* Segmentation offload features */ |
330 | #define NETIF_F_GSO_SHIFT 16 | 346 | #define NETIF_F_GSO_SHIFT 16 |
@@ -338,8 +354,11 @@ struct net_device | |||
338 | /* List of features with software fallbacks. */ | 354 | /* List of features with software fallbacks. */ |
339 | #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6) | 355 | #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6) |
340 | 356 | ||
357 | |||
341 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) | 358 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) |
342 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) | 359 | #define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM) |
360 | #define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) | ||
361 | #define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM) | ||
343 | 362 | ||
344 | struct net_device *next_sched; | 363 | struct net_device *next_sched; |
345 | 364 | ||
@@ -388,7 +407,10 @@ struct net_device | |||
388 | unsigned char addr_len; /* hardware address length */ | 407 | unsigned char addr_len; /* hardware address length */ |
389 | unsigned short dev_id; /* for shared network cards */ | 408 | unsigned short dev_id; /* for shared network cards */ |
390 | 409 | ||
391 | struct dev_mc_list *mc_list; /* Multicast mac addresses */ | 410 | struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */ |
411 | int uc_count; /* Number of installed ucasts */ | ||
412 | int uc_promisc; | ||
413 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ | ||
392 | int mc_count; /* Number of installed mcasts */ | 414 | int mc_count; /* Number of installed mcasts */ |
393 | int promiscuity; | 415 | int promiscuity; |
394 | int allmulti; | 416 | int allmulti; |
@@ -493,6 +515,11 @@ struct net_device | |||
493 | void *saddr, | 515 | void *saddr, |
494 | unsigned len); | 516 | unsigned len); |
495 | int (*rebuild_header)(struct sk_buff *skb); | 517 | int (*rebuild_header)(struct sk_buff *skb); |
518 | #define HAVE_CHANGE_RX_FLAGS | ||
519 | void (*change_rx_flags)(struct net_device *dev, | ||
520 | int flags); | ||
521 | #define HAVE_SET_RX_MODE | ||
522 | void (*set_rx_mode)(struct net_device *dev); | ||
496 | #define HAVE_MULTICAST | 523 | #define HAVE_MULTICAST |
497 | void (*set_multicast_list)(struct net_device *dev); | 524 | void (*set_multicast_list)(struct net_device *dev); |
498 | #define HAVE_SET_MAC_ADDR | 525 | #define HAVE_SET_MAC_ADDR |
@@ -535,22 +562,29 @@ struct net_device | |||
535 | 562 | ||
536 | /* bridge stuff */ | 563 | /* bridge stuff */ |
537 | struct net_bridge_port *br_port; | 564 | struct net_bridge_port *br_port; |
565 | /* macvlan */ | ||
566 | struct macvlan_port *macvlan_port; | ||
538 | 567 | ||
539 | /* class/net/name entry */ | 568 | /* class/net/name entry */ |
540 | struct device dev; | 569 | struct device dev; |
541 | /* space for optional statistics and wireless sysfs groups */ | 570 | /* space for optional statistics and wireless sysfs groups */ |
542 | struct attribute_group *sysfs_groups[3]; | 571 | struct attribute_group *sysfs_groups[3]; |
572 | |||
573 | /* rtnetlink link ops */ | ||
574 | const struct rtnl_link_ops *rtnl_link_ops; | ||
575 | |||
576 | /* The TX queue control structures */ | ||
577 | unsigned int egress_subqueue_count; | ||
578 | struct net_device_subqueue egress_subqueue[1]; | ||
543 | }; | 579 | }; |
544 | #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) |
545 | 581 | ||
546 | #define NETDEV_ALIGN 32 | 582 | #define NETDEV_ALIGN 32 |
547 | #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) | 583 | #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) |
548 | 584 | ||
549 | static inline void *netdev_priv(struct net_device *dev) | 585 | static inline void *netdev_priv(const struct net_device *dev) |
550 | { | 586 | { |
551 | return (char *)dev + ((sizeof(struct net_device) | 587 | return dev->priv; |
552 | + NETDEV_ALIGN_CONST) | ||
553 | & ~NETDEV_ALIGN_CONST); | ||
554 | } | 588 | } |
555 | 589 | ||
556 | #define SET_MODULE_OWNER(dev) do { } while (0) | 590 | #define SET_MODULE_OWNER(dev) do { } while (0) |
@@ -702,6 +736,62 @@ static inline int netif_running(const struct net_device *dev) | |||
702 | return test_bit(__LINK_STATE_START, &dev->state); | 736 | return test_bit(__LINK_STATE_START, &dev->state); |
703 | } | 737 | } |
704 | 738 | ||
739 | /* | ||
740 | * Routines to manage the subqueues on a device. We only need start | ||
741 | * stop, and a check if it's stopped. All other device management is | ||
742 | * done at the overall netdevice level. | ||
743 | * Also test the device if we're multiqueue. | ||
744 | */ | ||
745 | static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) | ||
746 | { | ||
747 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
748 | clear_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state); | ||
749 | #endif | ||
750 | } | ||
751 | |||
752 | static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) | ||
753 | { | ||
754 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
755 | #ifdef CONFIG_NETPOLL_TRAP | ||
756 | if (netpoll_trap()) | ||
757 | return; | ||
758 | #endif | ||
759 | set_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state); | ||
760 | #endif | ||
761 | } | ||
762 | |||
763 | static inline int netif_subqueue_stopped(const struct net_device *dev, | ||
764 | u16 queue_index) | ||
765 | { | ||
766 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
767 | return test_bit(__LINK_STATE_XOFF, | ||
768 | &dev->egress_subqueue[queue_index].state); | ||
769 | #else | ||
770 | return 0; | ||
771 | #endif | ||
772 | } | ||
773 | |||
774 | static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) | ||
775 | { | ||
776 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
777 | #ifdef CONFIG_NETPOLL_TRAP | ||
778 | if (netpoll_trap()) | ||
779 | return; | ||
780 | #endif | ||
781 | if (test_and_clear_bit(__LINK_STATE_XOFF, | ||
782 | &dev->egress_subqueue[queue_index].state)) | ||
783 | __netif_schedule(dev); | ||
784 | #endif | ||
785 | } | ||
786 | |||
787 | static inline int netif_is_multiqueue(const struct net_device *dev) | ||
788 | { | ||
789 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
790 | return (!!(NETIF_F_MULTI_QUEUE & dev->features)); | ||
791 | #else | ||
792 | return 0; | ||
793 | #endif | ||
794 | } | ||
705 | 795 | ||
706 | /* Use this variant when it is known for sure that it | 796 | /* Use this variant when it is known for sure that it |
707 | * is executing from interrupt context. | 797 | * is executing from interrupt context. |
@@ -992,15 +1082,24 @@ static inline void netif_tx_disable(struct net_device *dev) | |||
992 | extern void ether_setup(struct net_device *dev); | 1082 | extern void ether_setup(struct net_device *dev); |
993 | 1083 | ||
994 | /* Support for loadable net-drivers */ | 1084 | /* Support for loadable net-drivers */ |
995 | extern struct net_device *alloc_netdev(int sizeof_priv, const char *name, | 1085 | extern struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, |
996 | void (*setup)(struct net_device *)); | 1086 | void (*setup)(struct net_device *), |
1087 | unsigned int queue_count); | ||
1088 | #define alloc_netdev(sizeof_priv, name, setup) \ | ||
1089 | alloc_netdev_mq(sizeof_priv, name, setup, 1) | ||
997 | extern int register_netdev(struct net_device *dev); | 1090 | extern int register_netdev(struct net_device *dev); |
998 | extern void unregister_netdev(struct net_device *dev); | 1091 | extern void unregister_netdev(struct net_device *dev); |
999 | /* Functions used for multicast support */ | 1092 | /* Functions used for secondary unicast and multicast support */ |
1000 | extern void dev_mc_upload(struct net_device *dev); | 1093 | extern void dev_set_rx_mode(struct net_device *dev); |
1094 | extern void __dev_set_rx_mode(struct net_device *dev); | ||
1095 | extern int dev_unicast_delete(struct net_device *dev, void *addr, int alen); | ||
1096 | extern int dev_unicast_add(struct net_device *dev, void *addr, int alen); | ||
1001 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); | 1097 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); |
1002 | extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); | 1098 | extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); |
1003 | extern void dev_mc_discard(struct net_device *dev); | 1099 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); |
1100 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | ||
1101 | extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); | ||
1102 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); | ||
1004 | extern void dev_set_promiscuity(struct net_device *dev, int inc); | 1103 | extern void dev_set_promiscuity(struct net_device *dev, int inc); |
1005 | extern void dev_set_allmulti(struct net_device *dev, int inc); | 1104 | extern void dev_set_allmulti(struct net_device *dev, int inc); |
1006 | extern void netdev_state_change(struct net_device *dev); | 1105 | extern void netdev_state_change(struct net_device *dev); |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 10b5c6275706..0eed0b7ab2df 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -275,7 +275,8 @@ struct nf_queue_handler { | |||
275 | }; | 275 | }; |
276 | extern int nf_register_queue_handler(int pf, | 276 | extern int nf_register_queue_handler(int pf, |
277 | struct nf_queue_handler *qh); | 277 | struct nf_queue_handler *qh); |
278 | extern int nf_unregister_queue_handler(int pf); | 278 | extern int nf_unregister_queue_handler(int pf, |
279 | struct nf_queue_handler *qh); | ||
279 | extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh); | 280 | extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh); |
280 | extern void nf_reinject(struct sk_buff *skb, | 281 | extern void nf_reinject(struct sk_buff *skb, |
281 | struct nf_info *info, | 282 | struct nf_info *info, |
diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h index 9d8144a488cd..c93061f33144 100644 --- a/include/linux/netfilter/nf_conntrack_pptp.h +++ b/include/linux/netfilter/nf_conntrack_pptp.h | |||
@@ -4,6 +4,8 @@ | |||
4 | 4 | ||
5 | #include <linux/netfilter/nf_conntrack_common.h> | 5 | #include <linux/netfilter/nf_conntrack_common.h> |
6 | 6 | ||
7 | extern const char *pptp_msg_name[]; | ||
8 | |||
7 | /* state of the control session */ | 9 | /* state of the control session */ |
8 | enum pptp_ctrlsess_state { | 10 | enum pptp_ctrlsess_state { |
9 | PPTP_SESSION_NONE, /* no session present */ | 11 | PPTP_SESSION_NONE, /* no session present */ |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 7e733a6ba4f6..64f425a855bb 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -141,22 +141,22 @@ struct xt_match | |||
141 | /* Arguments changed since 2.6.9, as this must now handle | 141 | /* Arguments changed since 2.6.9, as this must now handle |
142 | non-linear skb, using skb_header_pointer and | 142 | non-linear skb, using skb_header_pointer and |
143 | skb_ip_make_writable. */ | 143 | skb_ip_make_writable. */ |
144 | int (*match)(const struct sk_buff *skb, | 144 | bool (*match)(const struct sk_buff *skb, |
145 | const struct net_device *in, | 145 | const struct net_device *in, |
146 | const struct net_device *out, | 146 | const struct net_device *out, |
147 | const struct xt_match *match, | 147 | const struct xt_match *match, |
148 | const void *matchinfo, | 148 | const void *matchinfo, |
149 | int offset, | 149 | int offset, |
150 | unsigned int protoff, | 150 | unsigned int protoff, |
151 | int *hotdrop); | 151 | bool *hotdrop); |
152 | 152 | ||
153 | /* Called when user tries to insert an entry of this type. */ | 153 | /* Called when user tries to insert an entry of this type. */ |
154 | /* Should return true or false. */ | 154 | /* Should return true or false. */ |
155 | int (*checkentry)(const char *tablename, | 155 | bool (*checkentry)(const char *tablename, |
156 | const void *ip, | 156 | const void *ip, |
157 | const struct xt_match *match, | 157 | const struct xt_match *match, |
158 | void *matchinfo, | 158 | void *matchinfo, |
159 | unsigned int hook_mask); | 159 | unsigned int hook_mask); |
160 | 160 | ||
161 | /* Called when entry of this type deleted. */ | 161 | /* Called when entry of this type deleted. */ |
162 | void (*destroy)(const struct xt_match *match, void *matchinfo); | 162 | void (*destroy)(const struct xt_match *match, void *matchinfo); |
@@ -202,11 +202,11 @@ struct xt_target | |||
202 | hook_mask is a bitmask of hooks from which it can be | 202 | hook_mask is a bitmask of hooks from which it can be |
203 | called. */ | 203 | called. */ |
204 | /* Should return true or false. */ | 204 | /* Should return true or false. */ |
205 | int (*checkentry)(const char *tablename, | 205 | bool (*checkentry)(const char *tablename, |
206 | const void *entry, | 206 | const void *entry, |
207 | const struct xt_target *target, | 207 | const struct xt_target *target, |
208 | void *targinfo, | 208 | void *targinfo, |
209 | unsigned int hook_mask); | 209 | unsigned int hook_mask); |
210 | 210 | ||
211 | /* Called when entry of this type deleted. */ | 211 | /* Called when entry of this type deleted. */ |
212 | void (*destroy)(const struct xt_target *target, void *targinfo); | 212 | void (*destroy)(const struct xt_target *target, void *targinfo); |
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h new file mode 100644 index 000000000000..90ae8b474cb8 --- /dev/null +++ b/include/linux/netfilter/xt_connlimit.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _XT_CONNLIMIT_H | ||
2 | #define _XT_CONNLIMIT_H | ||
3 | |||
4 | struct xt_connlimit_data; | ||
5 | |||
6 | struct xt_connlimit_info { | ||
7 | union { | ||
8 | u_int32_t v4_mask; | ||
9 | u_int32_t v6_mask[4]; | ||
10 | }; | ||
11 | unsigned int limit, inverse; | ||
12 | |||
13 | /* this needs to be at the end */ | ||
14 | struct xt_connlimit_data *data __attribute__((aligned(8))); | ||
15 | }; | ||
16 | |||
17 | #endif /* _XT_CONNLIMIT_H */ | ||
diff --git a/include/linux/netfilter/xt_u32.h b/include/linux/netfilter/xt_u32.h new file mode 100644 index 000000000000..9947f56cdbdd --- /dev/null +++ b/include/linux/netfilter/xt_u32.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #ifndef _XT_U32_H | ||
2 | #define _XT_U32_H 1 | ||
3 | |||
4 | enum xt_u32_ops { | ||
5 | XT_U32_AND, | ||
6 | XT_U32_LEFTSH, | ||
7 | XT_U32_RIGHTSH, | ||
8 | XT_U32_AT, | ||
9 | }; | ||
10 | |||
11 | struct xt_u32_location_element { | ||
12 | u_int32_t number; | ||
13 | u_int8_t nextop; | ||
14 | }; | ||
15 | |||
16 | struct xt_u32_value_element { | ||
17 | u_int32_t min; | ||
18 | u_int32_t max; | ||
19 | }; | ||
20 | |||
21 | /* | ||
22 | * Any way to allow for an arbitrary number of elements? | ||
23 | * For now, I settle with a limit of 10 each. | ||
24 | */ | ||
25 | #define XT_U32_MAXSIZE 10 | ||
26 | |||
27 | struct xt_u32_test { | ||
28 | struct xt_u32_location_element location[XT_U32_MAXSIZE+1]; | ||
29 | struct xt_u32_value_element value[XT_U32_MAXSIZE+1]; | ||
30 | u_int8_t nnums; | ||
31 | u_int8_t nvalues; | ||
32 | }; | ||
33 | |||
34 | struct xt_u32 { | ||
35 | struct xt_u32_test tests[XT_U32_MAXSIZE+1]; | ||
36 | u_int8_t ntests; | ||
37 | u_int8_t invert; | ||
38 | }; | ||
39 | |||
40 | #endif /* _XT_U32_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h index d9bceedfb3dc..daf50be22c9d 100644 --- a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h +++ b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h | |||
@@ -18,13 +18,13 @@ struct clusterip_config; | |||
18 | struct ipt_clusterip_tgt_info { | 18 | struct ipt_clusterip_tgt_info { |
19 | 19 | ||
20 | u_int32_t flags; | 20 | u_int32_t flags; |
21 | 21 | ||
22 | /* only relevant for new ones */ | 22 | /* only relevant for new ones */ |
23 | u_int8_t clustermac[6]; | 23 | u_int8_t clustermac[6]; |
24 | u_int16_t num_total_nodes; | 24 | u_int16_t num_total_nodes; |
25 | u_int16_t num_local_nodes; | 25 | u_int16_t num_local_nodes; |
26 | u_int16_t local_nodes[CLUSTERIP_MAX_NODES]; | 26 | u_int16_t local_nodes[CLUSTERIP_MAX_NODES]; |
27 | enum clusterip_hashmode hash_mode; | 27 | u_int32_t hash_mode; |
28 | u_int32_t hash_initval; | 28 | u_int32_t hash_initval; |
29 | 29 | ||
30 | struct clusterip_config *config; | 30 | struct clusterip_config *config; |
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/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index 4686f8342cbd..9a720f05888f 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -44,8 +44,14 @@ struct ip6t_ip6 { | |||
44 | char iniface[IFNAMSIZ], outiface[IFNAMSIZ]; | 44 | char iniface[IFNAMSIZ], outiface[IFNAMSIZ]; |
45 | unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; | 45 | unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; |
46 | 46 | ||
47 | /* ARGH, HopByHop uses 0, so can't do 0 = ANY, | 47 | /* Upper protocol number |
48 | instead IP6T_F_NOPROTO must be set */ | 48 | * - The allowed value is 0 (any) or protocol number of last parsable |
49 | * header, which is 50 (ESP), 59 (No Next Header), 135 (MH), or | ||
50 | * the non IPv6 extension headers. | ||
51 | * - The protocol numbers of IPv6 extension headers except of ESP and | ||
52 | * MH do not match any packets. | ||
53 | * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol. | ||
54 | */ | ||
49 | u_int16_t proto; | 55 | u_int16_t proto; |
50 | /* TOS to match iff flags & IP6T_F_TOS */ | 56 | /* TOS to match iff flags & IP6T_F_TOS */ |
51 | u_int8_t tos; | 57 | u_int8_t tos; |
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); |
164 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); | ||
165 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); | ||
164 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 166 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
165 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | 167 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); |
166 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 168 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 7e7f33a38fc0..8726491de154 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | 17 | ||
18 | #define NFS4_BITMAP_SIZE 2 | ||
18 | #define NFS4_VERIFIER_SIZE 8 | 19 | #define NFS4_VERIFIER_SIZE 8 |
19 | #define NFS4_STATEID_SIZE 16 | 20 | #define NFS4_STATEID_SIZE 16 |
20 | #define NFS4_FHSIZE 128 | 21 | #define NFS4_FHSIZE 128 |
diff --git a/include/linux/nfs4_mount.h b/include/linux/nfs4_mount.h index 26b4c83f831d..a0dcf6655657 100644 --- a/include/linux/nfs4_mount.h +++ b/include/linux/nfs4_mount.h | |||
@@ -65,6 +65,7 @@ struct nfs4_mount_data { | |||
65 | #define NFS4_MOUNT_NOCTO 0x0010 /* 1 */ | 65 | #define NFS4_MOUNT_NOCTO 0x0010 /* 1 */ |
66 | #define NFS4_MOUNT_NOAC 0x0020 /* 1 */ | 66 | #define NFS4_MOUNT_NOAC 0x0020 /* 1 */ |
67 | #define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */ | 67 | #define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */ |
68 | #define NFS4_MOUNT_FLAGMASK 0xFFFF | 68 | #define NFS4_MOUNT_UNSHARED 0x8000 /* 1 */ |
69 | #define NFS4_MOUNT_FLAGMASK 0x9033 | ||
69 | 70 | ||
70 | #endif | 71 | #endif |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 0543439a97af..9ba4aec37c50 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -30,7 +30,9 @@ | |||
30 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
31 | 31 | ||
32 | #include <linux/in.h> | 32 | #include <linux/in.h> |
33 | #include <linux/kref.h> | ||
33 | #include <linux/mm.h> | 34 | #include <linux/mm.h> |
35 | #include <linux/namei.h> | ||
34 | #include <linux/pagemap.h> | 36 | #include <linux/pagemap.h> |
35 | #include <linux/rbtree.h> | 37 | #include <linux/rbtree.h> |
36 | #include <linux/rwsem.h> | 38 | #include <linux/rwsem.h> |
@@ -69,9 +71,8 @@ struct nfs_access_entry { | |||
69 | 71 | ||
70 | struct nfs4_state; | 72 | struct nfs4_state; |
71 | struct nfs_open_context { | 73 | struct nfs_open_context { |
72 | atomic_t count; | 74 | struct kref kref; |
73 | struct vfsmount *vfsmnt; | 75 | struct path path; |
74 | struct dentry *dentry; | ||
75 | struct rpc_cred *cred; | 76 | struct rpc_cred *cred; |
76 | struct nfs4_state *state; | 77 | struct nfs4_state *state; |
77 | fl_owner_t lockowner; | 78 | fl_owner_t lockowner; |
@@ -155,13 +156,9 @@ struct nfs_inode { | |||
155 | /* | 156 | /* |
156 | * This is the list of dirty unwritten pages. | 157 | * This is the list of dirty unwritten pages. |
157 | */ | 158 | */ |
158 | spinlock_t req_lock; | ||
159 | struct list_head dirty; | ||
160 | struct list_head commit; | ||
161 | struct radix_tree_root nfs_page_tree; | 159 | struct radix_tree_root nfs_page_tree; |
162 | 160 | ||
163 | unsigned int ndirty, | 161 | unsigned long ncommit, |
164 | ncommit, | ||
165 | npages; | 162 | npages; |
166 | 163 | ||
167 | /* Open contexts for shared mmap writes */ | 164 | /* Open contexts for shared mmap writes */ |
@@ -187,6 +184,7 @@ struct nfs_inode { | |||
187 | #define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */ | 184 | #define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */ |
188 | #define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ | 185 | #define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ |
189 | #define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ | 186 | #define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ |
187 | #define NFS_INO_REVAL_FORCED 0x0040 /* force revalidation ignoring a delegation */ | ||
190 | 188 | ||
191 | /* | 189 | /* |
192 | * Bit offsets in flags field | 190 | * Bit offsets in flags field |
@@ -409,8 +407,8 @@ extern void nfs_release_automount_timer(void); | |||
409 | /* | 407 | /* |
410 | * linux/fs/nfs/unlink.c | 408 | * linux/fs/nfs/unlink.c |
411 | */ | 409 | */ |
412 | extern int nfs_async_unlink(struct dentry *); | 410 | extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry); |
413 | extern void nfs_complete_unlink(struct dentry *); | 411 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
414 | 412 | ||
415 | /* | 413 | /* |
416 | * linux/fs/nfs/write.c | 414 | * linux/fs/nfs/write.c |
@@ -496,21 +494,18 @@ static inline void nfs3_forget_cached_acls(struct inode *inode) | |||
496 | 494 | ||
497 | /* | 495 | /* |
498 | * linux/fs/mount_clnt.c | 496 | * linux/fs/mount_clnt.c |
499 | * (Used only by nfsroot module) | ||
500 | */ | 497 | */ |
501 | extern int nfsroot_mount(struct sockaddr_in *, char *, struct nfs_fh *, | 498 | extern int nfs_mount(struct sockaddr *, size_t, char *, char *, |
502 | int, int); | 499 | int, int, struct nfs_fh *); |
503 | 500 | ||
504 | /* | 501 | /* |
505 | * inline functions | 502 | * inline functions |
506 | */ | 503 | */ |
507 | 504 | ||
508 | static inline loff_t | 505 | static inline loff_t nfs_size_to_loff_t(__u64 size) |
509 | nfs_size_to_loff_t(__u64 size) | ||
510 | { | 506 | { |
511 | loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; | 507 | if (size > (__u64) OFFSET_MAX - 1) |
512 | if (size > maxsz) | 508 | return OFFSET_MAX - 1; |
513 | return maxsz; | ||
514 | return (loff_t) size; | 509 | return (loff_t) size; |
515 | } | 510 | } |
516 | 511 | ||
@@ -557,6 +552,7 @@ extern void * nfs_root_data(void); | |||
557 | #define NFSDBG_ROOT 0x0080 | 552 | #define NFSDBG_ROOT 0x0080 |
558 | #define NFSDBG_CALLBACK 0x0100 | 553 | #define NFSDBG_CALLBACK 0x0100 |
559 | #define NFSDBG_CLIENT 0x0200 | 554 | #define NFSDBG_CLIENT 0x0200 |
555 | #define NFSDBG_MOUNT 0x0400 | ||
560 | #define NFSDBG_ALL 0xFFFF | 556 | #define NFSDBG_ALL 0xFFFF |
561 | 557 | ||
562 | #ifdef __KERNEL__ | 558 | #ifdef __KERNEL__ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 52b4378311c8..0cac49bc0955 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -16,7 +16,6 @@ struct nfs_client { | |||
16 | #define NFS_CS_INITING 1 /* busy initialising */ | 16 | #define NFS_CS_INITING 1 /* busy initialising */ |
17 | int cl_nfsversion; /* NFS protocol version */ | 17 | int cl_nfsversion; /* NFS protocol version */ |
18 | unsigned long cl_res_state; /* NFS resources state */ | 18 | unsigned long cl_res_state; /* NFS resources state */ |
19 | #define NFS_CS_RPCIOD 0 /* - rpciod started */ | ||
20 | #define NFS_CS_CALLBACK 1 /* - callback started */ | 19 | #define NFS_CS_CALLBACK 1 /* - callback started */ |
21 | #define NFS_CS_IDMAP 2 /* - idmap started */ | 20 | #define NFS_CS_IDMAP 2 /* - idmap started */ |
22 | #define NFS_CS_RENEWD 3 /* - renewd started */ | 21 | #define NFS_CS_RENEWD 3 /* - renewd started */ |
@@ -35,7 +34,8 @@ struct nfs_client { | |||
35 | nfs4_verifier cl_confirm; | 34 | nfs4_verifier cl_confirm; |
36 | unsigned long cl_state; | 35 | unsigned long cl_state; |
37 | 36 | ||
38 | u32 cl_lockowner_id; | 37 | struct rb_root cl_openowner_id; |
38 | struct rb_root cl_lockowner_id; | ||
39 | 39 | ||
40 | /* | 40 | /* |
41 | * The following rwsem ensures exclusive access to the server | 41 | * The following rwsem ensures exclusive access to the server |
@@ -44,9 +44,7 @@ struct nfs_client { | |||
44 | struct rw_semaphore cl_sem; | 44 | struct rw_semaphore cl_sem; |
45 | 45 | ||
46 | struct list_head cl_delegations; | 46 | struct list_head cl_delegations; |
47 | struct list_head cl_state_owners; | 47 | struct rb_root cl_state_owners; |
48 | struct list_head cl_unused; | ||
49 | int cl_nunused; | ||
50 | spinlock_t cl_lock; | 48 | spinlock_t cl_lock; |
51 | 49 | ||
52 | unsigned long cl_lease_time; | 50 | unsigned long cl_lease_time; |
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index cc8b9c59acb8..a3ade89a64d2 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h | |||
@@ -37,7 +37,7 @@ struct nfs_mount_data { | |||
37 | int acdirmin; /* 1 */ | 37 | int acdirmin; /* 1 */ |
38 | int acdirmax; /* 1 */ | 38 | int acdirmax; /* 1 */ |
39 | struct sockaddr_in addr; /* 1 */ | 39 | struct sockaddr_in addr; /* 1 */ |
40 | char hostname[256]; /* 1 */ | 40 | char hostname[NFS_MAXNAMLEN + 1]; /* 1 */ |
41 | int namlen; /* 2 */ | 41 | int namlen; /* 2 */ |
42 | unsigned int bsize; /* 3 */ | 42 | unsigned int bsize; /* 3 */ |
43 | struct nfs3_fh root; /* 4 */ | 43 | struct nfs3_fh root; /* 4 */ |
@@ -62,6 +62,7 @@ struct nfs_mount_data { | |||
62 | #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ | 62 | #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ |
63 | #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ | 63 | #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ |
64 | #define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */ | 64 | #define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */ |
65 | #define NFS_MOUNT_UNSHARED 0x8000 /* 5 */ | ||
65 | #define NFS_MOUNT_FLAGMASK 0xFFFF | 66 | #define NFS_MOUNT_FLAGMASK 0xFFFF |
66 | 67 | ||
67 | #endif | 68 | #endif |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index bd193af80162..78e60798d10e 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -16,12 +16,13 @@ | |||
16 | #include <linux/sunrpc/auth.h> | 16 | #include <linux/sunrpc/auth.h> |
17 | #include <linux/nfs_xdr.h> | 17 | #include <linux/nfs_xdr.h> |
18 | 18 | ||
19 | #include <asm/atomic.h> | 19 | #include <linux/kref.h> |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * Valid flags for the radix tree | 22 | * Valid flags for the radix tree |
23 | */ | 23 | */ |
24 | #define NFS_PAGE_TAG_WRITEBACK 0 | 24 | #define NFS_PAGE_TAG_LOCKED 0 |
25 | #define NFS_PAGE_TAG_COMMIT 1 | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * Valid flags for a dirty buffer | 28 | * Valid flags for a dirty buffer |
@@ -33,8 +34,7 @@ | |||
33 | 34 | ||
34 | struct nfs_inode; | 35 | struct nfs_inode; |
35 | struct nfs_page { | 36 | struct nfs_page { |
36 | struct list_head wb_list, /* Defines state of page: */ | 37 | struct list_head wb_list; /* Defines state of page: */ |
37 | *wb_list_head; /* read/write/commit */ | ||
38 | struct page *wb_page; /* page to read in/write out */ | 38 | struct page *wb_page; /* page to read in/write out */ |
39 | struct nfs_open_context *wb_context; /* File state context info */ | 39 | struct nfs_open_context *wb_context; /* File state context info */ |
40 | atomic_t wb_complete; /* i/os we're waiting for */ | 40 | atomic_t wb_complete; /* i/os we're waiting for */ |
@@ -42,7 +42,7 @@ struct nfs_page { | |||
42 | unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ | 42 | unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ |
43 | wb_pgbase, /* Start of page data */ | 43 | wb_pgbase, /* Start of page data */ |
44 | wb_bytes; /* Length of request */ | 44 | wb_bytes; /* Length of request */ |
45 | atomic_t wb_count; /* reference count */ | 45 | struct kref wb_kref; /* reference count */ |
46 | unsigned long wb_flags; | 46 | unsigned long wb_flags; |
47 | struct nfs_writeverf wb_verf; /* Commit cookie */ | 47 | struct nfs_writeverf wb_verf; /* Commit cookie */ |
48 | }; | 48 | }; |
@@ -71,8 +71,8 @@ extern void nfs_clear_request(struct nfs_page *req); | |||
71 | extern void nfs_release_request(struct nfs_page *req); | 71 | extern void nfs_release_request(struct nfs_page *req); |
72 | 72 | ||
73 | 73 | ||
74 | extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst, | 74 | extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst, |
75 | pgoff_t idx_start, unsigned int npages); | 75 | pgoff_t idx_start, unsigned int npages, int tag); |
76 | extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, | 76 | extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, |
77 | struct inode *inode, | 77 | struct inode *inode, |
78 | int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int), | 78 | int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int), |
@@ -84,12 +84,11 @@ extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc); | |||
84 | extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t); | 84 | extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t); |
85 | extern int nfs_wait_on_request(struct nfs_page *); | 85 | extern int nfs_wait_on_request(struct nfs_page *); |
86 | extern void nfs_unlock_request(struct nfs_page *req); | 86 | extern void nfs_unlock_request(struct nfs_page *req); |
87 | extern int nfs_set_page_writeback_locked(struct nfs_page *req); | 87 | extern void nfs_clear_page_tag_locked(struct nfs_page *req); |
88 | extern void nfs_clear_page_writeback(struct nfs_page *req); | ||
89 | 88 | ||
90 | 89 | ||
91 | /* | 90 | /* |
92 | * Lock the page of an asynchronous request without incrementing the wb_count | 91 | * Lock the page of an asynchronous request without getting a new reference |
93 | */ | 92 | */ |
94 | static inline int | 93 | static inline int |
95 | nfs_lock_request_dontget(struct nfs_page *req) | 94 | nfs_lock_request_dontget(struct nfs_page *req) |
@@ -98,14 +97,14 @@ nfs_lock_request_dontget(struct nfs_page *req) | |||
98 | } | 97 | } |
99 | 98 | ||
100 | /* | 99 | /* |
101 | * Lock the page of an asynchronous request | 100 | * Lock the page of an asynchronous request and take a reference |
102 | */ | 101 | */ |
103 | static inline int | 102 | static inline int |
104 | nfs_lock_request(struct nfs_page *req) | 103 | nfs_lock_request(struct nfs_page *req) |
105 | { | 104 | { |
106 | if (test_and_set_bit(PG_BUSY, &req->wb_flags)) | 105 | if (test_and_set_bit(PG_BUSY, &req->wb_flags)) |
107 | return 0; | 106 | return 0; |
108 | atomic_inc(&req->wb_count); | 107 | kref_get(&req->wb_kref); |
109 | return 1; | 108 | return 1; |
110 | } | 109 | } |
111 | 110 | ||
@@ -118,7 +117,6 @@ static inline void | |||
118 | nfs_list_add_request(struct nfs_page *req, struct list_head *head) | 117 | nfs_list_add_request(struct nfs_page *req, struct list_head *head) |
119 | { | 118 | { |
120 | list_add_tail(&req->wb_list, head); | 119 | list_add_tail(&req->wb_list, head); |
121 | req->wb_list_head = head; | ||
122 | } | 120 | } |
123 | 121 | ||
124 | 122 | ||
@@ -132,7 +130,6 @@ nfs_list_remove_request(struct nfs_page *req) | |||
132 | if (list_empty(&req->wb_list)) | 130 | if (list_empty(&req->wb_list)) |
133 | return; | 131 | return; |
134 | list_del_init(&req->wb_list); | 132 | list_del_init(&req->wb_list); |
135 | req->wb_list_head = NULL; | ||
136 | } | 133 | } |
137 | 134 | ||
138 | static inline struct nfs_page * | 135 | static inline struct nfs_page * |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 10c26ed0db71..cf74a4db84a5 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -119,7 +119,7 @@ struct nfs_openargs { | |||
119 | struct nfs_seqid * seqid; | 119 | struct nfs_seqid * seqid; |
120 | int open_flags; | 120 | int open_flags; |
121 | __u64 clientid; | 121 | __u64 clientid; |
122 | __u32 id; | 122 | __u64 id; |
123 | union { | 123 | union { |
124 | struct iattr * attrs; /* UNCHECKED, GUARDED */ | 124 | struct iattr * attrs; /* UNCHECKED, GUARDED */ |
125 | nfs4_verifier verifier; /* EXCLUSIVE */ | 125 | nfs4_verifier verifier; /* EXCLUSIVE */ |
@@ -144,6 +144,7 @@ struct nfs_openres { | |||
144 | nfs4_stateid delegation; | 144 | nfs4_stateid delegation; |
145 | __u32 do_recall; | 145 | __u32 do_recall; |
146 | __u64 maxsize; | 146 | __u64 maxsize; |
147 | __u32 attrset[NFS4_BITMAP_SIZE]; | ||
147 | }; | 148 | }; |
148 | 149 | ||
149 | /* | 150 | /* |
@@ -180,7 +181,7 @@ struct nfs_closeres { | |||
180 | * */ | 181 | * */ |
181 | struct nfs_lowner { | 182 | struct nfs_lowner { |
182 | __u64 clientid; | 183 | __u64 clientid; |
183 | u32 id; | 184 | __u64 id; |
184 | }; | 185 | }; |
185 | 186 | ||
186 | struct nfs_lock_args { | 187 | struct nfs_lock_args { |
@@ -277,6 +278,21 @@ struct nfs_writeres { | |||
277 | }; | 278 | }; |
278 | 279 | ||
279 | /* | 280 | /* |
281 | * Common arguments to the unlink call | ||
282 | */ | ||
283 | struct nfs_removeargs { | ||
284 | const struct nfs_fh *fh; | ||
285 | struct qstr name; | ||
286 | const u32 * bitmask; | ||
287 | }; | ||
288 | |||
289 | struct nfs_removeres { | ||
290 | const struct nfs_server *server; | ||
291 | struct nfs4_change_info cinfo; | ||
292 | struct nfs_fattr dir_attr; | ||
293 | }; | ||
294 | |||
295 | /* | ||
280 | * Argument struct for decode_entry function | 296 | * Argument struct for decode_entry function |
281 | */ | 297 | */ |
282 | struct nfs_entry { | 298 | struct nfs_entry { |
@@ -630,18 +646,6 @@ struct nfs4_readlink { | |||
630 | struct page ** pages; /* zero-copy data */ | 646 | struct page ** pages; /* zero-copy data */ |
631 | }; | 647 | }; |
632 | 648 | ||
633 | struct nfs4_remove_arg { | ||
634 | const struct nfs_fh * fh; | ||
635 | const struct qstr * name; | ||
636 | const u32 * bitmask; | ||
637 | }; | ||
638 | |||
639 | struct nfs4_remove_res { | ||
640 | const struct nfs_server * server; | ||
641 | struct nfs4_change_info cinfo; | ||
642 | struct nfs_fattr * dir_attr; | ||
643 | }; | ||
644 | |||
645 | struct nfs4_rename_arg { | 649 | struct nfs4_rename_arg { |
646 | const struct nfs_fh * old_dir; | 650 | const struct nfs_fh * old_dir; |
647 | const struct nfs_fh * new_dir; | 651 | const struct nfs_fh * new_dir; |
@@ -787,9 +791,8 @@ struct nfs_rpc_ops { | |||
787 | int (*create) (struct inode *, struct dentry *, | 791 | int (*create) (struct inode *, struct dentry *, |
788 | struct iattr *, int, struct nameidata *); | 792 | struct iattr *, int, struct nameidata *); |
789 | int (*remove) (struct inode *, struct qstr *); | 793 | int (*remove) (struct inode *, struct qstr *); |
790 | int (*unlink_setup) (struct rpc_message *, | 794 | void (*unlink_setup) (struct rpc_message *, struct inode *dir); |
791 | struct dentry *, struct qstr *); | 795 | int (*unlink_done) (struct rpc_task *, struct inode *); |
792 | int (*unlink_done) (struct dentry *, struct rpc_task *); | ||
793 | int (*rename) (struct inode *, struct qstr *, | 796 | int (*rename) (struct inode *, struct qstr *, |
794 | struct inode *, struct qstr *); | 797 | struct inode *, struct qstr *); |
795 | 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 9f62d6182d32..5cd192469096 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -42,6 +42,9 @@ | |||
42 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ | 42 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ |
43 | #define NFSEXP_ALLFLAGS 0xFE3F | 43 | #define NFSEXP_ALLFLAGS 0xFE3F |
44 | 44 | ||
45 | /* The flags that may vary depending on security flavor: */ | ||
46 | #define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ | ||
47 | | NFSEXP_ALLSQUASH) | ||
45 | 48 | ||
46 | #ifdef __KERNEL__ | 49 | #ifdef __KERNEL__ |
47 | 50 | ||
@@ -64,6 +67,19 @@ struct nfsd4_fs_locations { | |||
64 | int migrated; | 67 | int migrated; |
65 | }; | 68 | }; |
66 | 69 | ||
70 | /* | ||
71 | * We keep an array of pseudoflavors with the export, in order from most | ||
72 | * to least preferred. For the forseeable future, we don't expect more | ||
73 | * than the eight pseudoflavors null, unix, krb5, krb5i, krb5p, skpm3, | ||
74 | * spkm3i, and spkm3p (and using all 8 at once should be rare). | ||
75 | */ | ||
76 | #define MAX_SECINFO_LIST 8 | ||
77 | |||
78 | struct exp_flavor_info { | ||
79 | u32 pseudoflavor; | ||
80 | u32 flags; | ||
81 | }; | ||
82 | |||
67 | struct svc_export { | 83 | struct svc_export { |
68 | struct cache_head h; | 84 | struct cache_head h; |
69 | struct auth_domain * ex_client; | 85 | struct auth_domain * ex_client; |
@@ -76,6 +92,8 @@ struct svc_export { | |||
76 | int ex_fsid; | 92 | int ex_fsid; |
77 | unsigned char * ex_uuid; /* 16 byte fsid */ | 93 | unsigned char * ex_uuid; /* 16 byte fsid */ |
78 | struct nfsd4_fs_locations ex_fslocs; | 94 | struct nfsd4_fs_locations ex_fslocs; |
95 | int ex_nflavors; | ||
96 | struct exp_flavor_info ex_flavors[MAX_SECINFO_LIST]; | ||
79 | }; | 97 | }; |
80 | 98 | ||
81 | /* an "export key" (expkey) maps a filehandlefragement to an | 99 | /* an "export key" (expkey) maps a filehandlefragement to an |
@@ -95,10 +113,11 @@ struct svc_expkey { | |||
95 | 113 | ||
96 | #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) | 114 | #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) |
97 | #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) | 115 | #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) |
98 | #define EX_RDONLY(exp) ((exp)->ex_flags & NFSEXP_READONLY) | ||
99 | #define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) | 116 | #define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) |
100 | #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) | 117 | #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) |
101 | 118 | ||
119 | int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp); | ||
120 | __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp); | ||
102 | 121 | ||
103 | /* | 122 | /* |
104 | * Function declarations | 123 | * Function declarations |
@@ -112,13 +131,19 @@ struct svc_export * exp_get_by_name(struct auth_domain *clp, | |||
112 | struct vfsmount *mnt, | 131 | struct vfsmount *mnt, |
113 | struct dentry *dentry, | 132 | struct dentry *dentry, |
114 | struct cache_req *reqp); | 133 | struct cache_req *reqp); |
134 | struct svc_export * rqst_exp_get_by_name(struct svc_rqst *, | ||
135 | struct vfsmount *, | ||
136 | struct dentry *); | ||
115 | struct svc_export * exp_parent(struct auth_domain *clp, | 137 | struct svc_export * exp_parent(struct auth_domain *clp, |
116 | struct vfsmount *mnt, | 138 | struct vfsmount *mnt, |
117 | struct dentry *dentry, | 139 | struct dentry *dentry, |
118 | struct cache_req *reqp); | 140 | struct cache_req *reqp); |
141 | struct svc_export * rqst_exp_parent(struct svc_rqst *, | ||
142 | struct vfsmount *mnt, | ||
143 | struct dentry *dentry); | ||
119 | int exp_rootfh(struct auth_domain *, | 144 | int exp_rootfh(struct auth_domain *, |
120 | char *path, struct knfsd_fh *, int maxsize); | 145 | char *path, struct knfsd_fh *, int maxsize); |
121 | __be32 exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq); | 146 | __be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *); |
122 | __be32 nfserrno(int errno); | 147 | __be32 nfserrno(int errno); |
123 | 148 | ||
124 | extern struct cache_detail svc_export_cache; | 149 | extern struct cache_detail svc_export_cache; |
@@ -135,6 +160,7 @@ static inline void exp_get(struct svc_export *exp) | |||
135 | extern struct svc_export * | 160 | extern struct svc_export * |
136 | exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv, | 161 | exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv, |
137 | struct cache_req *reqp); | 162 | struct cache_req *reqp); |
163 | struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *); | ||
138 | 164 | ||
139 | #endif /* __KERNEL__ */ | 165 | #endif /* __KERNEL__ */ |
140 | 166 | ||
diff --git a/include/linux/nfsd/interface.h b/include/linux/nfsd/interface.h deleted file mode 100644 index af0979704afb..000000000000 --- a/include/linux/nfsd/interface.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/nfsd/interface.h | ||
3 | * | ||
4 | * defines interface between nfsd and other bits of | ||
5 | * the kernel. Particularly filesystems (eventually). | ||
6 | * | ||
7 | * Copyright (C) 2000 Neil Brown <neilb@cse.unsw.edu.au> | ||
8 | */ | ||
9 | |||
10 | #ifndef LINUX_NFSD_INTERFACE_H | ||
11 | #define LINUX_NFSD_INTERFACE_H | ||
12 | |||
13 | #endif /* LINUX_NFSD_INTERFACE_H */ | ||
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 72feac581aa3..e452256d3f72 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/nfsd/export.h> | 22 | #include <linux/nfsd/export.h> |
23 | #include <linux/nfsd/auth.h> | 23 | #include <linux/nfsd/auth.h> |
24 | #include <linux/nfsd/stats.h> | 24 | #include <linux/nfsd/stats.h> |
25 | #include <linux/nfsd/interface.h> | ||
26 | /* | 25 | /* |
27 | * nfsd version | 26 | * nfsd version |
28 | */ | 27 | */ |
@@ -72,6 +71,9 @@ int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, | |||
72 | struct svc_export **expp); | 71 | struct svc_export **expp); |
73 | __be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, | 72 | __be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, |
74 | const char *, int, struct svc_fh *); | 73 | const char *, int, struct svc_fh *); |
74 | __be32 nfsd_lookup_dentry(struct svc_rqst *, struct svc_fh *, | ||
75 | const char *, int, | ||
76 | struct svc_export **, struct dentry **); | ||
75 | __be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, | 77 | __be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, |
76 | struct iattr *, int, time_t); | 78 | struct iattr *, int, time_t); |
77 | #ifdef CONFIG_NFSD_V4 | 79 | #ifdef CONFIG_NFSD_V4 |
@@ -120,7 +122,8 @@ __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, | |||
120 | struct kstatfs *); | 122 | struct kstatfs *); |
121 | 123 | ||
122 | int nfsd_notify_change(struct inode *, struct iattr *); | 124 | int nfsd_notify_change(struct inode *, struct iattr *); |
123 | __be32 nfsd_permission(struct svc_export *, struct dentry *, int); | 125 | __be32 nfsd_permission(struct svc_rqst *, struct svc_export *, |
126 | struct dentry *, int); | ||
124 | int nfsd_sync_dir(struct dentry *dp); | 127 | int nfsd_sync_dir(struct dentry *dp); |
125 | 128 | ||
126 | #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) | 129 | #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) |
@@ -149,6 +152,7 @@ extern int nfsd_max_blksize; | |||
149 | * NFSv4 State | 152 | * NFSv4 State |
150 | */ | 153 | */ |
151 | #ifdef CONFIG_NFSD_V4 | 154 | #ifdef CONFIG_NFSD_V4 |
155 | extern unsigned int max_delegations; | ||
152 | void nfs4_state_init(void); | 156 | void nfs4_state_init(void); |
153 | int nfs4_state_start(void); | 157 | int nfs4_state_start(void); |
154 | void nfs4_state_shutdown(void); | 158 | void nfs4_state_shutdown(void); |
@@ -236,6 +240,7 @@ void nfsd_lockd_shutdown(void); | |||
236 | #define nfserr_badname __constant_htonl(NFSERR_BADNAME) | 240 | #define nfserr_badname __constant_htonl(NFSERR_BADNAME) |
237 | #define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) | 241 | #define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) |
238 | #define nfserr_locked __constant_htonl(NFSERR_LOCKED) | 242 | #define nfserr_locked __constant_htonl(NFSERR_LOCKED) |
243 | #define nfserr_wrongsec __constant_htonl(NFSERR_WRONGSEC) | ||
239 | #define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME) | 244 | #define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME) |
240 | 245 | ||
241 | /* error codes for internal use */ | 246 | /* error codes for internal use */ |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index ab5c236bd9a7..db348f749376 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -67,7 +67,7 @@ struct nfs4_cb_recall { | |||
67 | int cbr_trunc; | 67 | int cbr_trunc; |
68 | stateid_t cbr_stateid; | 68 | stateid_t cbr_stateid; |
69 | u32 cbr_fhlen; | 69 | u32 cbr_fhlen; |
70 | u32 cbr_fhval[NFS4_FHSIZE]; | 70 | char cbr_fhval[NFS4_FHSIZE]; |
71 | struct nfs4_delegation *cbr_dp; | 71 | struct nfs4_delegation *cbr_dp; |
72 | }; | 72 | }; |
73 | 73 | ||
@@ -224,6 +224,7 @@ struct nfs4_file { | |||
224 | struct inode *fi_inode; | 224 | struct inode *fi_inode; |
225 | u32 fi_id; /* used with stateowner->so_id | 225 | u32 fi_id; /* used with stateowner->so_id |
226 | * for stateid_hashtbl hash */ | 226 | * for stateid_hashtbl hash */ |
227 | bool fi_had_conflict; | ||
227 | }; | 228 | }; |
228 | 229 | ||
229 | /* | 230 | /* |
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index 09799bcee0ac..1b653267133a 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
@@ -293,6 +293,12 @@ struct nfsd4_rename { | |||
293 | struct nfsd4_change_info rn_tinfo; /* response */ | 293 | struct nfsd4_change_info rn_tinfo; /* response */ |
294 | }; | 294 | }; |
295 | 295 | ||
296 | struct nfsd4_secinfo { | ||
297 | u32 si_namelen; /* request */ | ||
298 | char *si_name; /* request */ | ||
299 | struct svc_export *si_exp; /* response */ | ||
300 | }; | ||
301 | |||
296 | struct nfsd4_setattr { | 302 | struct nfsd4_setattr { |
297 | stateid_t sa_stateid; /* request */ | 303 | stateid_t sa_stateid; /* request */ |
298 | u32 sa_bmval[2]; /* request */ | 304 | u32 sa_bmval[2]; /* request */ |
@@ -365,6 +371,7 @@ struct nfsd4_op { | |||
365 | struct nfsd4_remove remove; | 371 | struct nfsd4_remove remove; |
366 | struct nfsd4_rename rename; | 372 | struct nfsd4_rename rename; |
367 | clientid_t renew; | 373 | clientid_t renew; |
374 | struct nfsd4_secinfo secinfo; | ||
368 | struct nfsd4_setattr setattr; | 375 | struct nfsd4_setattr setattr; |
369 | struct nfsd4_setclientid setclientid; | 376 | struct nfsd4_setclientid setclientid; |
370 | struct nfsd4_setclientid_confirm setclientid_confirm; | 377 | struct nfsd4_setclientid_confirm setclientid_confirm; |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 9431101bf876..be3f2bb6fcf3 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -196,6 +196,8 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh, | |||
196 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | 196 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ |
197 | #define CPU_LOCK_ACQUIRE 0x0008 /* Acquire all hotcpu locks */ | 197 | #define CPU_LOCK_ACQUIRE 0x0008 /* Acquire all hotcpu locks */ |
198 | #define CPU_LOCK_RELEASE 0x0009 /* Release all hotcpu locks */ | 198 | #define CPU_LOCK_RELEASE 0x0009 /* Release all hotcpu locks */ |
199 | #define CPU_DYING 0x000A /* CPU (unsigned)v not running any task, | ||
200 | * not handling interrupts, soon dead */ | ||
199 | 201 | ||
200 | /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend | 202 | /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend |
201 | * operation in progress | 203 | * operation in progress |
@@ -208,6 +210,13 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh, | |||
208 | #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) | 210 | #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) |
209 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) | 211 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) |
210 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) | 212 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) |
213 | #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) | ||
214 | |||
215 | /* Hibernation and suspend events */ | ||
216 | #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ | ||
217 | #define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */ | ||
218 | #define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */ | ||
219 | #define PM_POST_SUSPEND 0x0004 /* Suspend finished */ | ||
211 | 220 | ||
212 | #endif /* __KERNEL__ */ | 221 | #endif /* __KERNEL__ */ |
213 | #endif /* _LINUX_NOTIFIER_H */ | 222 | #endif /* _LINUX_NOTIFIER_H */ |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 189e0dc993ab..ce06188b7a56 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -28,10 +28,11 @@ struct nsproxy { | |||
28 | struct ipc_namespace *ipc_ns; | 28 | struct ipc_namespace *ipc_ns; |
29 | struct mnt_namespace *mnt_ns; | 29 | struct mnt_namespace *mnt_ns; |
30 | struct pid_namespace *pid_ns; | 30 | struct pid_namespace *pid_ns; |
31 | struct user_namespace *user_ns; | ||
31 | }; | 32 | }; |
32 | extern struct nsproxy init_nsproxy; | 33 | extern struct nsproxy init_nsproxy; |
33 | 34 | ||
34 | int copy_namespaces(int flags, struct task_struct *tsk); | 35 | int copy_namespaces(unsigned long flags, struct task_struct *tsk); |
35 | void get_task_namespaces(struct task_struct *tsk); | 36 | void get_task_namespaces(struct task_struct *tsk); |
36 | void free_nsproxy(struct nsproxy *ns); | 37 | void free_nsproxy(struct nsproxy *ns); |
37 | int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, | 38 | int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, |
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 | |||
29 | extern 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)) | ||
34 | extern 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)) | ||
39 | extern 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)) | ||
44 | extern struct device_node *of_find_node_by_path(const char *path); | ||
45 | extern struct device_node *of_find_node_by_phandle(phandle handle); | ||
46 | extern struct device_node *of_get_parent(const struct device_node *node); | ||
47 | extern struct device_node *of_get_next_child(const struct device_node *node, | ||
48 | struct device_node *prev); | ||
49 | extern struct property *of_find_property(const struct device_node *np, | ||
50 | const char *name, | ||
51 | int *lenp); | ||
52 | extern int of_device_is_compatible(const struct device_node *device, | ||
53 | const char *); | ||
54 | extern 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)) | ||
58 | extern int of_n_addr_cells(struct device_node *np); | ||
59 | extern 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 | |||
13 | extern const struct of_device_id *of_match_node( | ||
14 | const struct of_device_id *matches, const struct device_node *node); | ||
15 | extern const struct of_device_id *of_match_device( | ||
16 | const struct of_device_id *matches, const struct of_device *dev); | ||
17 | |||
18 | extern struct of_device *of_dev_get(struct of_device *dev); | ||
19 | extern void of_dev_put(struct of_device *dev); | ||
20 | |||
21 | extern int of_device_register(struct of_device *ofdev); | ||
22 | extern void of_device_unregister(struct of_device *ofdev); | ||
23 | extern 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 | */ | ||
25 | extern 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 | */ | ||
32 | struct 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 | |||
53 | extern struct of_device *of_find_device_by_node(struct device_node *np); | ||
54 | |||
55 | extern 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 | |||
20 | struct super_block; | 40 | struct super_block; |
21 | struct dentry; | 41 | struct dentry; |
22 | struct file_operations; | 42 | struct 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); | |||
56 | void oprofile_arch_exit(void); | 84 | void 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 | */ | ||
91 | void 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 086a0e5a6318..5e84f2e8d54c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -111,7 +111,8 @@ enum pcie_reset_state { | |||
111 | 111 | ||
112 | typedef unsigned short __bitwise pci_bus_flags_t; | 112 | typedef unsigned short __bitwise pci_bus_flags_t; |
113 | enum pci_bus_flags { | 113 | enum pci_bus_flags { |
114 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, | 114 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, |
115 | PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, | ||
115 | }; | 116 | }; |
116 | 117 | ||
117 | struct pci_cap_saved_state { | 118 | struct pci_cap_saved_state { |
@@ -138,6 +139,7 @@ struct pci_dev { | |||
138 | unsigned short subsystem_vendor; | 139 | unsigned short subsystem_vendor; |
139 | unsigned short subsystem_device; | 140 | unsigned short subsystem_device; |
140 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ | 141 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ |
142 | u8 revision; /* PCI revision, low byte of class word */ | ||
141 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 143 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
142 | u8 rom_base_reg; /* which config register controls the ROM */ | 144 | u8 rom_base_reg; /* which config register controls the ROM */ |
143 | u8 pin; /* which interrupt pin this device uses */ | 145 | u8 pin; /* which interrupt pin this device uses */ |
@@ -313,7 +315,7 @@ struct pci_dynids { | |||
313 | 315 | ||
314 | /* ---------------------------------------------------------------- */ | 316 | /* ---------------------------------------------------------------- */ |
315 | /** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides | 317 | /** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides |
316 | * a set fof callbacks in struct pci_error_handlers, then that device driver | 318 | * a set of callbacks in struct pci_error_handlers, then that device driver |
317 | * will be notified of PCI bus errors, and will be driven to recovery | 319 | * will be notified of PCI bus errors, and will be driven to recovery |
318 | * when an error occurs. | 320 | * when an error occurs. |
319 | */ | 321 | */ |
@@ -370,7 +372,6 @@ struct pci_driver { | |||
370 | int (*suspend_late) (struct pci_dev *dev, pm_message_t state); | 372 | int (*suspend_late) (struct pci_dev *dev, pm_message_t state); |
371 | int (*resume_early) (struct pci_dev *dev); | 373 | int (*resume_early) (struct pci_dev *dev); |
372 | int (*resume) (struct pci_dev *dev); /* Device woken up */ | 374 | int (*resume) (struct pci_dev *dev); /* Device woken up */ |
373 | int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ | ||
374 | void (*shutdown) (struct pci_dev *dev); | 375 | void (*shutdown) (struct pci_dev *dev); |
375 | 376 | ||
376 | struct pci_error_handlers *err_handler; | 377 | struct pci_error_handlers *err_handler; |
@@ -431,6 +432,8 @@ extern struct bus_type pci_bus_type; | |||
431 | * code, or pci core code. */ | 432 | * code, or pci core code. */ |
432 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ | 433 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ |
433 | extern struct list_head pci_devices; /* list of all devices */ | 434 | extern struct list_head pci_devices; /* list of all devices */ |
435 | /* Some device drivers need know if pci is initiated */ | ||
436 | extern int no_pci_devices(void); | ||
434 | 437 | ||
435 | void pcibios_fixup_bus(struct pci_bus *); | 438 | void pcibios_fixup_bus(struct pci_bus *); |
436 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); | 439 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
@@ -475,7 +478,7 @@ extern void pci_sort_breadthfirst(void); | |||
475 | /* Generic PCI functions exported to card drivers */ | 478 | /* Generic PCI functions exported to card drivers */ |
476 | 479 | ||
477 | struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); | 480 | struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); |
478 | struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); | 481 | struct pci_dev __deprecated *pci_find_slot (unsigned int bus, unsigned int devfn); |
479 | int pci_find_capability (struct pci_dev *dev, int cap); | 482 | int pci_find_capability (struct pci_dev *dev, int cap); |
480 | int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); | 483 | int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); |
481 | int pci_find_ext_capability (struct pci_dev *dev, int cap); | 484 | int pci_find_ext_capability (struct pci_dev *dev, int cap); |
@@ -544,11 +547,16 @@ void pci_set_master(struct pci_dev *dev); | |||
544 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | 547 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); |
545 | #define HAVE_PCI_SET_MWI | 548 | #define HAVE_PCI_SET_MWI |
546 | int __must_check pci_set_mwi(struct pci_dev *dev); | 549 | int __must_check pci_set_mwi(struct pci_dev *dev); |
550 | int pci_try_set_mwi(struct pci_dev *dev); | ||
547 | void pci_clear_mwi(struct pci_dev *dev); | 551 | void pci_clear_mwi(struct pci_dev *dev); |
548 | void pci_intx(struct pci_dev *dev, int enable); | 552 | void pci_intx(struct pci_dev *dev, int enable); |
549 | void pci_msi_off(struct pci_dev *dev); | 553 | void pci_msi_off(struct pci_dev *dev); |
550 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | 554 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); |
551 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | 555 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); |
556 | int pcix_get_max_mmrbc(struct pci_dev *dev); | ||
557 | int pcix_get_mmrbc(struct pci_dev *dev); | ||
558 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); | ||
559 | int pcie_set_readrq(struct pci_dev *dev, int rq); | ||
552 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); | 560 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); |
553 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 561 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
554 | int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); | 562 | int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); |
@@ -560,6 +568,7 @@ void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); | |||
560 | void __iomem __must_check *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); | 568 | void __iomem __must_check *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); |
561 | void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); | 569 | void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); |
562 | void pci_remove_rom(struct pci_dev *pdev); | 570 | void pci_remove_rom(struct pci_dev *pdev); |
571 | size_t pci_get_rom_size(void __iomem *rom, size_t size); | ||
563 | 572 | ||
564 | /* Power management related routines */ | 573 | /* Power management related routines */ |
565 | int pci_save_state(struct pci_dev *dev); | 574 | int pci_save_state(struct pci_dev *dev); |
@@ -717,6 +726,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, struct pci_dev * | |||
717 | { return NULL; } | 726 | { return NULL; } |
718 | 727 | ||
719 | #define pci_dev_present(ids) (0) | 728 | #define pci_dev_present(ids) (0) |
729 | #define no_pci_devices() (1) | ||
720 | #define pci_find_present(ids) (NULL) | 730 | #define pci_find_present(ids) (NULL) |
721 | #define pci_dev_put(dev) do { } while (0) | 731 | #define pci_dev_put(dev) do { } while (0) |
722 | 732 | ||
@@ -876,5 +886,7 @@ extern int pci_pci_problems; | |||
876 | extern unsigned long pci_cardbus_io_size; | 886 | extern unsigned long pci_cardbus_io_size; |
877 | extern unsigned long pci_cardbus_mem_size; | 887 | extern unsigned long pci_cardbus_mem_size; |
878 | 888 | ||
889 | extern int pcibios_add_platform_entries(struct pci_dev *dev); | ||
890 | |||
879 | #endif /* __KERNEL__ */ | 891 | #endif /* __KERNEL__ */ |
880 | #endif /* LINUX_PCI_H */ | 892 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 75c4d4d06892..cbabb9c675c9 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -133,6 +133,9 @@ | |||
133 | 133 | ||
134 | /* Vendors and devices. Sort key: vendor first, device next. */ | 134 | /* Vendors and devices. Sort key: vendor first, device next. */ |
135 | 135 | ||
136 | #define PCI_VENDOR_ID_TTTECH 0x0357 | ||
137 | #define PCI_DEVICE_ID_TTTECH_MC322 0x000a | ||
138 | |||
136 | #define PCI_VENDOR_ID_DYNALINK 0x0675 | 139 | #define PCI_VENDOR_ID_DYNALINK 0x0675 |
137 | #define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702 | 140 | #define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702 |
138 | 141 | ||
@@ -371,6 +374,7 @@ | |||
371 | #define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 | 374 | #define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 |
372 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c | 375 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c |
373 | #define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 | 376 | #define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 |
377 | #define PCI_DEVICE_ID_ATI_IXP700_SMBUS 0x4395 | ||
374 | #define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c | 378 | #define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c |
375 | 379 | ||
376 | #define PCI_VENDOR_ID_VLSI 0x1004 | 380 | #define PCI_VENDOR_ID_VLSI 0x1004 |
@@ -475,6 +479,9 @@ | |||
475 | #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361 | 479 | #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361 |
476 | #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 | 480 | #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 |
477 | 481 | ||
482 | #define PCI_VENDOR_ID_UNISYS 0x1018 | ||
483 | #define PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR 0x001C | ||
484 | |||
478 | #define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */ | 485 | #define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */ |
479 | #define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 | 486 | #define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 |
480 | 487 | ||
@@ -488,6 +495,8 @@ | |||
488 | 495 | ||
489 | #define PCI_VENDOR_ID_AMD 0x1022 | 496 | #define PCI_VENDOR_ID_AMD 0x1022 |
490 | #define PCI_DEVICE_ID_AMD_K8_NB 0x1100 | 497 | #define PCI_DEVICE_ID_AMD_K8_NB 0x1100 |
498 | #define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101 | ||
499 | #define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102 | ||
491 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 | 500 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 |
492 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 501 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
493 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 502 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
@@ -732,7 +741,6 @@ | |||
732 | #define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 | 741 | #define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 |
733 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 | 742 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 |
734 | 743 | ||
735 | |||
736 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B | 744 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B |
737 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 | 745 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 |
738 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 | 746 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 |
@@ -778,7 +786,6 @@ | |||
778 | 786 | ||
779 | #define PCI_VENDOR_ID_SONY 0x104d | 787 | #define PCI_VENDOR_ID_SONY 0x104d |
780 | 788 | ||
781 | |||
782 | /* Winbond have two vendor IDs! See 0x10ad as well */ | 789 | /* Winbond have two vendor IDs! See 0x10ad as well */ |
783 | #define PCI_VENDOR_ID_WINBOND2 0x1050 | 790 | #define PCI_VENDOR_ID_WINBOND2 0x1050 |
784 | #define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a | 791 | #define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a |
@@ -816,7 +823,6 @@ | |||
816 | #define PCI_DEVICE_ID_PROMISE_20276 0x5275 | 823 | #define PCI_DEVICE_ID_PROMISE_20276 0x5275 |
817 | #define PCI_DEVICE_ID_PROMISE_20277 0x7275 | 824 | #define PCI_DEVICE_ID_PROMISE_20277 0x7275 |
818 | 825 | ||
819 | |||
820 | #define PCI_VENDOR_ID_UMC 0x1060 | 826 | #define PCI_VENDOR_ID_UMC 0x1060 |
821 | #define PCI_DEVICE_ID_UMC_UM8673F 0x0101 | 827 | #define PCI_DEVICE_ID_UMC_UM8673F 0x0101 |
822 | #define PCI_DEVICE_ID_UMC_UM8886BF 0x673a | 828 | #define PCI_DEVICE_ID_UMC_UM8886BF 0x673a |
@@ -832,7 +838,6 @@ | |||
832 | #define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 | 838 | #define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 |
833 | #define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166 | 839 | #define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166 |
834 | 840 | ||
835 | |||
836 | #define PCI_VENDOR_ID_APPLE 0x106b | 841 | #define PCI_VENDOR_ID_APPLE 0x106b |
837 | #define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 | 842 | #define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 |
838 | #define PCI_DEVICE_ID_APPLE_HYDRA 0x000e | 843 | #define PCI_DEVICE_ID_APPLE_HYDRA 0x000e |
@@ -868,7 +873,6 @@ | |||
868 | #define PCI_DEVICE_ID_YAMAHA_744 0x0010 | 873 | #define PCI_DEVICE_ID_YAMAHA_744 0x0010 |
869 | #define PCI_DEVICE_ID_YAMAHA_754 0x0012 | 874 | #define PCI_DEVICE_ID_YAMAHA_754 0x0012 |
870 | 875 | ||
871 | |||
872 | #define PCI_VENDOR_ID_QLOGIC 0x1077 | 876 | #define PCI_VENDOR_ID_QLOGIC 0x1077 |
873 | #define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016 | 877 | #define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016 |
874 | #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 | 878 | #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 |
@@ -899,12 +903,9 @@ | |||
899 | #define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103 | 903 | #define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103 |
900 | #define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104 | 904 | #define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104 |
901 | 905 | ||
902 | |||
903 | |||
904 | #define PCI_VENDOR_ID_CONTAQ 0x1080 | 906 | #define PCI_VENDOR_ID_CONTAQ 0x1080 |
905 | #define PCI_DEVICE_ID_CONTAQ_82C693 0xc693 | 907 | #define PCI_DEVICE_ID_CONTAQ_82C693 0xc693 |
906 | 908 | ||
907 | |||
908 | #define PCI_VENDOR_ID_OLICOM 0x108d | 909 | #define PCI_VENDOR_ID_OLICOM 0x108d |
909 | #define PCI_DEVICE_ID_OLICOM_OC2325 0x0012 | 910 | #define PCI_DEVICE_ID_OLICOM_OC2325 0x0012 |
910 | #define PCI_DEVICE_ID_OLICOM_OC2183 0x0013 | 911 | #define PCI_DEVICE_ID_OLICOM_OC2183 0x0013 |
@@ -936,23 +937,19 @@ | |||
936 | #define PCI_DEVICE_ID_SII_3112 0x3112 | 937 | #define PCI_DEVICE_ID_SII_3112 0x3112 |
937 | #define PCI_DEVICE_ID_SII_1210SA 0x0240 | 938 | #define PCI_DEVICE_ID_SII_1210SA 0x0240 |
938 | 939 | ||
939 | |||
940 | #define PCI_VENDOR_ID_BROOKTREE 0x109e | 940 | #define PCI_VENDOR_ID_BROOKTREE 0x109e |
941 | #define PCI_DEVICE_ID_BROOKTREE_878 0x0878 | 941 | #define PCI_DEVICE_ID_BROOKTREE_878 0x0878 |
942 | #define PCI_DEVICE_ID_BROOKTREE_879 0x0879 | 942 | #define PCI_DEVICE_ID_BROOKTREE_879 0x0879 |
943 | 943 | ||
944 | |||
945 | #define PCI_VENDOR_ID_SGI 0x10a9 | 944 | #define PCI_VENDOR_ID_SGI 0x10a9 |
946 | #define PCI_DEVICE_ID_SGI_IOC3 0x0003 | 945 | #define PCI_DEVICE_ID_SGI_IOC3 0x0003 |
946 | #define PCI_DEVICE_ID_SGI_LITHIUM 0x1002 | ||
947 | #define PCI_DEVICE_ID_SGI_IOC4 0x100a | 947 | #define PCI_DEVICE_ID_SGI_IOC4 0x100a |
948 | #define PCI_VENDOR_ID_SGI_LITHIUM 0x1002 | ||
949 | |||
950 | 948 | ||
951 | #define PCI_VENDOR_ID_WINBOND 0x10ad | 949 | #define PCI_VENDOR_ID_WINBOND 0x10ad |
952 | #define PCI_DEVICE_ID_WINBOND_82C105 0x0105 | 950 | #define PCI_DEVICE_ID_WINBOND_82C105 0x0105 |
953 | #define PCI_DEVICE_ID_WINBOND_83C553 0x0565 | 951 | #define PCI_DEVICE_ID_WINBOND_83C553 0x0565 |
954 | 952 | ||
955 | |||
956 | #define PCI_VENDOR_ID_PLX 0x10b5 | 953 | #define PCI_VENDOR_ID_PLX 0x10b5 |
957 | #define PCI_DEVICE_ID_PLX_R685 0x1030 | 954 | #define PCI_DEVICE_ID_PLX_R685 0x1030 |
958 | #define PCI_DEVICE_ID_PLX_ROMULUS 0x106a | 955 | #define PCI_DEVICE_ID_PLX_ROMULUS 0x106a |
@@ -986,7 +983,6 @@ | |||
986 | #define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909 | 983 | #define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909 |
987 | #define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a | 984 | #define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a |
988 | 985 | ||
989 | |||
990 | #define PCI_VENDOR_ID_AL 0x10b9 | 986 | #define PCI_VENDOR_ID_AL 0x10b9 |
991 | #define PCI_DEVICE_ID_AL_M1533 0x1533 | 987 | #define PCI_DEVICE_ID_AL_M1533 0x1533 |
992 | #define PCI_DEVICE_ID_AL_M1535 0x1535 | 988 | #define PCI_DEVICE_ID_AL_M1535 0x1535 |
@@ -1009,18 +1005,14 @@ | |||
1009 | #define PCI_DEVICE_ID_AL_M5451 0x5451 | 1005 | #define PCI_DEVICE_ID_AL_M5451 0x5451 |
1010 | #define PCI_DEVICE_ID_AL_M7101 0x7101 | 1006 | #define PCI_DEVICE_ID_AL_M7101 0x7101 |
1011 | 1007 | ||
1012 | |||
1013 | |||
1014 | #define PCI_VENDOR_ID_NEOMAGIC 0x10c8 | 1008 | #define PCI_VENDOR_ID_NEOMAGIC 0x10c8 |
1015 | #define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005 | 1009 | #define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005 |
1016 | #define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006 | 1010 | #define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006 |
1017 | #define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016 | 1011 | #define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016 |
1018 | 1012 | ||
1019 | |||
1020 | #define PCI_VENDOR_ID_TCONRAD 0x10da | 1013 | #define PCI_VENDOR_ID_TCONRAD 0x10da |
1021 | #define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508 | 1014 | #define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508 |
1022 | 1015 | ||
1023 | |||
1024 | #define PCI_VENDOR_ID_NVIDIA 0x10de | 1016 | #define PCI_VENDOR_ID_NVIDIA 0x10de |
1025 | #define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 | 1017 | #define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 |
1026 | #define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028 | 1018 | #define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028 |
@@ -1241,9 +1233,6 @@ | |||
1241 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 | 1233 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 |
1242 | #define PCI_DEVICE_ID_IMS_TT3D 0x9135 | 1234 | #define PCI_DEVICE_ID_IMS_TT3D 0x9135 |
1243 | 1235 | ||
1244 | |||
1245 | |||
1246 | |||
1247 | #define PCI_VENDOR_ID_INTERG 0x10ea | 1236 | #define PCI_VENDOR_ID_INTERG 0x10ea |
1248 | #define PCI_DEVICE_ID_INTERG_1682 0x1682 | 1237 | #define PCI_DEVICE_ID_INTERG_1682 0x1682 |
1249 | #define PCI_DEVICE_ID_INTERG_2000 0x2000 | 1238 | #define PCI_DEVICE_ID_INTERG_2000 0x2000 |
@@ -1262,7 +1251,6 @@ | |||
1262 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 | 1251 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 |
1263 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 | 1252 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 |
1264 | 1253 | ||
1265 | |||
1266 | #define PCI_VENDOR_ID_INIT 0x1101 | 1254 | #define PCI_VENDOR_ID_INIT 0x1101 |
1267 | 1255 | ||
1268 | #define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ | 1256 | #define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ |
@@ -1357,7 +1345,6 @@ | |||
1357 | #define PCI_VENDOR_ID_SIEMENS 0x110A | 1345 | #define PCI_VENDOR_ID_SIEMENS 0x110A |
1358 | #define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 | 1346 | #define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 |
1359 | 1347 | ||
1360 | |||
1361 | #define PCI_VENDOR_ID_VORTEX 0x1119 | 1348 | #define PCI_VENDOR_ID_VORTEX 0x1119 |
1362 | #define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 | 1349 | #define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 |
1363 | #define PCI_DEVICE_ID_VORTEX_GDT6000B 0x0001 | 1350 | #define PCI_DEVICE_ID_VORTEX_GDT6000B 0x0001 |
@@ -1383,8 +1370,8 @@ | |||
1383 | #define PCI_VENDOR_ID_EF 0x111a | 1370 | #define PCI_VENDOR_ID_EF 0x111a |
1384 | #define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 | 1371 | #define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 |
1385 | #define PCI_DEVICE_ID_EF_ATM_ASIC 0x0002 | 1372 | #define PCI_DEVICE_ID_EF_ATM_ASIC 0x0002 |
1386 | #define PCI_VENDOR_ID_EF_ATM_LANAI2 0x0003 | 1373 | #define PCI_DEVICE_ID_EF_ATM_LANAI2 0x0003 |
1387 | #define PCI_VENDOR_ID_EF_ATM_LANAIHB 0x0005 | 1374 | #define PCI_DEVICE_ID_EF_ATM_LANAIHB 0x0005 |
1388 | 1375 | ||
1389 | #define PCI_VENDOR_ID_IDT 0x111d | 1376 | #define PCI_VENDOR_ID_IDT 0x111d |
1390 | #define PCI_DEVICE_ID_IDT_IDT77201 0x0001 | 1377 | #define PCI_DEVICE_ID_IDT_IDT77201 0x0001 |
@@ -1392,7 +1379,6 @@ | |||
1392 | #define PCI_VENDOR_ID_FORE 0x1127 | 1379 | #define PCI_VENDOR_ID_FORE 0x1127 |
1393 | #define PCI_DEVICE_ID_FORE_PCA200E 0x0300 | 1380 | #define PCI_DEVICE_ID_FORE_PCA200E 0x0300 |
1394 | 1381 | ||
1395 | |||
1396 | #define PCI_VENDOR_ID_PHILIPS 0x1131 | 1382 | #define PCI_VENDOR_ID_PHILIPS 0x1131 |
1397 | #define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 | 1383 | #define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 |
1398 | #define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 | 1384 | #define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 |
@@ -1411,7 +1397,6 @@ | |||
1411 | #define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 | 1397 | #define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 |
1412 | 1398 | ||
1413 | 1399 | ||
1414 | |||
1415 | #define PCI_VENDOR_ID_SYSKONNECT 0x1148 | 1400 | #define PCI_VENDOR_ID_SYSKONNECT 0x1148 |
1416 | #define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 | 1401 | #define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 |
1417 | #define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300 | 1402 | #define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300 |
@@ -1419,7 +1404,6 @@ | |||
1419 | #define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400 | 1404 | #define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400 |
1420 | #define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500 | 1405 | #define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500 |
1421 | 1406 | ||
1422 | |||
1423 | #define PCI_VENDOR_ID_DIGI 0x114f | 1407 | #define PCI_VENDOR_ID_DIGI 0x114f |
1424 | #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070 | 1408 | #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070 |
1425 | #define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071 | 1409 | #define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071 |
@@ -1430,12 +1414,10 @@ | |||
1430 | #define PCI_DEVICE_ID_NEO_2RJ45 0x00CA | 1414 | #define PCI_DEVICE_ID_NEO_2RJ45 0x00CA |
1431 | #define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB | 1415 | #define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB |
1432 | 1416 | ||
1433 | |||
1434 | #define PCI_VENDOR_ID_XIRCOM 0x115d | 1417 | #define PCI_VENDOR_ID_XIRCOM 0x115d |
1435 | #define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101 | 1418 | #define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101 |
1436 | #define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103 | 1419 | #define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103 |
1437 | 1420 | ||
1438 | |||
1439 | #define PCI_VENDOR_ID_SERVERWORKS 0x1166 | 1421 | #define PCI_VENDOR_ID_SERVERWORKS 0x1166 |
1440 | #define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 | 1422 | #define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 |
1441 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 | 1423 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 |
@@ -1504,7 +1486,6 @@ | |||
1504 | #define PCI_DEVICE_ID_ZEITNET_1221 0x0001 | 1486 | #define PCI_DEVICE_ID_ZEITNET_1221 0x0001 |
1505 | #define PCI_DEVICE_ID_ZEITNET_1225 0x0002 | 1487 | #define PCI_DEVICE_ID_ZEITNET_1225 0x0002 |
1506 | 1488 | ||
1507 | |||
1508 | #define PCI_VENDOR_ID_FUJITSU_ME 0x119e | 1489 | #define PCI_VENDOR_ID_FUJITSU_ME 0x119e |
1509 | #define PCI_DEVICE_ID_FUJITSU_FS155 0x0001 | 1490 | #define PCI_DEVICE_ID_FUJITSU_FS155 0x0001 |
1510 | #define PCI_DEVICE_ID_FUJITSU_FS50 0x0003 | 1491 | #define PCI_DEVICE_ID_FUJITSU_FS50 0x0003 |
@@ -1522,28 +1503,23 @@ | |||
1522 | #define PCI_DEVICE_ID_V3_V960 0x0001 | 1503 | #define PCI_DEVICE_ID_V3_V960 0x0001 |
1523 | #define PCI_DEVICE_ID_V3_V351 0x0002 | 1504 | #define PCI_DEVICE_ID_V3_V351 0x0002 |
1524 | 1505 | ||
1525 | |||
1526 | #define PCI_VENDOR_ID_ATT 0x11c1 | 1506 | #define PCI_VENDOR_ID_ATT 0x11c1 |
1527 | #define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 | 1507 | #define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 |
1528 | 1508 | ||
1529 | |||
1530 | #define PCI_VENDOR_ID_SPECIALIX 0x11cb | 1509 | #define PCI_VENDOR_ID_SPECIALIX 0x11cb |
1531 | #define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 | 1510 | #define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 |
1532 | #define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 | 1511 | #define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 |
1533 | #define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 | 1512 | #define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 |
1534 | 1513 | ||
1535 | |||
1536 | #define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 | 1514 | #define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 |
1537 | #define PCI_DEVICE_ID_AD1889JS 0x1889 | 1515 | #define PCI_DEVICE_ID_AD1889JS 0x1889 |
1538 | 1516 | ||
1539 | |||
1540 | #define PCI_DEVICE_ID_SEGA_BBA 0x1234 | 1517 | #define PCI_DEVICE_ID_SEGA_BBA 0x1234 |
1541 | 1518 | ||
1542 | #define PCI_VENDOR_ID_ZORAN 0x11de | 1519 | #define PCI_VENDOR_ID_ZORAN 0x11de |
1543 | #define PCI_DEVICE_ID_ZORAN_36057 0x6057 | 1520 | #define PCI_DEVICE_ID_ZORAN_36057 0x6057 |
1544 | #define PCI_DEVICE_ID_ZORAN_36120 0x6120 | 1521 | #define PCI_DEVICE_ID_ZORAN_36120 0x6120 |
1545 | 1522 | ||
1546 | |||
1547 | #define PCI_VENDOR_ID_COMPEX 0x11f6 | 1523 | #define PCI_VENDOR_ID_COMPEX 0x11f6 |
1548 | #define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 | 1524 | #define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 |
1549 | 1525 | ||
@@ -1602,8 +1578,6 @@ | |||
1602 | #define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 | 1578 | #define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 |
1603 | #define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009 | 1579 | #define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009 |
1604 | 1580 | ||
1605 | |||
1606 | |||
1607 | #define PCI_VENDOR_ID_AVM 0x1244 | 1581 | #define PCI_VENDOR_ID_AVM 0x1244 |
1608 | #define PCI_DEVICE_ID_AVM_B1 0x0700 | 1582 | #define PCI_DEVICE_ID_AVM_B1 0x0700 |
1609 | #define PCI_DEVICE_ID_AVM_C4 0x0800 | 1583 | #define PCI_DEVICE_ID_AVM_C4 0x0800 |
@@ -1612,7 +1586,6 @@ | |||
1612 | #define PCI_DEVICE_ID_AVM_C2 0x1100 | 1586 | #define PCI_DEVICE_ID_AVM_C2 0x1100 |
1613 | #define PCI_DEVICE_ID_AVM_T1 0x1200 | 1587 | #define PCI_DEVICE_ID_AVM_T1 0x1200 |
1614 | 1588 | ||
1615 | |||
1616 | #define PCI_VENDOR_ID_STALLION 0x124d | 1589 | #define PCI_VENDOR_ID_STALLION 0x124d |
1617 | 1590 | ||
1618 | /* Allied Telesyn */ | 1591 | /* Allied Telesyn */ |
@@ -1635,7 +1608,6 @@ | |||
1635 | #define PCI_VENDOR_ID_SATSAGEM 0x1267 | 1608 | #define PCI_VENDOR_ID_SATSAGEM 0x1267 |
1636 | #define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016 | 1609 | #define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016 |
1637 | 1610 | ||
1638 | |||
1639 | #define PCI_VENDOR_ID_ENSONIQ 0x1274 | 1611 | #define PCI_VENDOR_ID_ENSONIQ 0x1274 |
1640 | #define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880 | 1612 | #define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880 |
1641 | #define PCI_DEVICE_ID_ENSONIQ_ES1370 0x5000 | 1613 | #define PCI_DEVICE_ID_ENSONIQ_ES1370 0x5000 |
@@ -1658,7 +1630,6 @@ | |||
1658 | 1630 | ||
1659 | #define PCI_VENDOR_ID_ALTEON 0x12ae | 1631 | #define PCI_VENDOR_ID_ALTEON 0x12ae |
1660 | 1632 | ||
1661 | |||
1662 | #define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4 | 1633 | #define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4 |
1663 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001 | 1634 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001 |
1664 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002 | 1635 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002 |
@@ -1689,7 +1660,6 @@ | |||
1689 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485 0x0331 | 1660 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485 0x0331 |
1690 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485 0x0332 | 1661 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485 0x0332 |
1691 | 1662 | ||
1692 | |||
1693 | #define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 | 1663 | #define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 |
1694 | #define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 | 1664 | #define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 |
1695 | 1665 | ||
@@ -1799,7 +1769,6 @@ | |||
1799 | #define PCI_DEVICE_ID_LMC_SSI 0x0005 | 1769 | #define PCI_DEVICE_ID_LMC_SSI 0x0005 |
1800 | #define PCI_DEVICE_ID_LMC_T1 0x0006 | 1770 | #define PCI_DEVICE_ID_LMC_T1 0x0006 |
1801 | 1771 | ||
1802 | |||
1803 | #define PCI_VENDOR_ID_NETGEAR 0x1385 | 1772 | #define PCI_VENDOR_ID_NETGEAR 0x1385 |
1804 | #define PCI_DEVICE_ID_NETGEAR_GA620 0x620a | 1773 | #define PCI_DEVICE_ID_NETGEAR_GA620 0x620a |
1805 | 1774 | ||
@@ -1902,6 +1871,8 @@ | |||
1902 | #define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521 | 1871 | #define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521 |
1903 | #define PCI_DEVICE_ID_OXSEMI_16PCI952PP 0x9523 | 1872 | #define PCI_DEVICE_ID_OXSEMI_16PCI952PP 0x9523 |
1904 | 1873 | ||
1874 | #define PCI_VENDOR_ID_CHELSIO 0x1425 | ||
1875 | |||
1905 | #define PCI_VENDOR_ID_SAMSUNG 0x144d | 1876 | #define PCI_VENDOR_ID_SAMSUNG 0x144d |
1906 | 1877 | ||
1907 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 | 1878 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 |
@@ -2010,13 +1981,10 @@ | |||
2010 | #define PCI_DEVICE_ID_ENE_720 0x1421 | 1981 | #define PCI_DEVICE_ID_ENE_720 0x1421 |
2011 | #define PCI_DEVICE_ID_ENE_722 0x1422 | 1982 | #define PCI_DEVICE_ID_ENE_722 0x1422 |
2012 | 1983 | ||
2013 | #define PCI_VENDOR_ID_CHELSIO 0x1425 | ||
2014 | |||
2015 | #define PCI_SUBVENDOR_ID_PERLE 0x155f | 1984 | #define PCI_SUBVENDOR_ID_PERLE 0x155f |
2016 | #define PCI_SUBDEVICE_ID_PCI_RAS4 0xf001 | 1985 | #define PCI_SUBDEVICE_ID_PCI_RAS4 0xf001 |
2017 | #define PCI_SUBDEVICE_ID_PCI_RAS8 0xf010 | 1986 | #define PCI_SUBDEVICE_ID_PCI_RAS8 0xf010 |
2018 | 1987 | ||
2019 | |||
2020 | #define PCI_VENDOR_ID_SYBA 0x1592 | 1988 | #define PCI_VENDOR_ID_SYBA 0x1592 |
2021 | #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 | 1989 | #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 |
2022 | #define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783 | 1990 | #define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783 |
@@ -2035,8 +2003,10 @@ | |||
2035 | #define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c | 2003 | #define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c |
2036 | #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 | 2004 | #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 |
2037 | 2005 | ||
2038 | #define PCI_VENDOR_ID_PDC 0x15e9 | 2006 | #define PCI_VENDOR_ID_QUICKNET 0x15e2 |
2007 | #define PCI_DEVICE_ID_QUICKNET_XJ 0x0500 | ||
2039 | 2008 | ||
2009 | #define PCI_VENDOR_ID_PDC 0x15e9 | ||
2040 | 2010 | ||
2041 | #define PCI_VENDOR_ID_FARSITE 0x1619 | 2011 | #define PCI_VENDOR_ID_FARSITE 0x1619 |
2042 | #define PCI_DEVICE_ID_FARSITE_T2P 0x0400 | 2012 | #define PCI_DEVICE_ID_FARSITE_T2P 0x0400 |
@@ -2049,10 +2019,14 @@ | |||
2049 | 2019 | ||
2050 | #define PCI_VENDOR_ID_ARIMA 0x161f | 2020 | #define PCI_VENDOR_ID_ARIMA 0x161f |
2051 | 2021 | ||
2022 | #define PCI_VENDOR_ID_BROCADE 0x1657 | ||
2023 | |||
2052 | #define PCI_VENDOR_ID_SIBYTE 0x166d | 2024 | #define PCI_VENDOR_ID_SIBYTE 0x166d |
2053 | #define PCI_DEVICE_ID_BCM1250_PCI 0x0001 | 2025 | #define PCI_DEVICE_ID_BCM1250_PCI 0x0001 |
2054 | #define PCI_DEVICE_ID_BCM1250_HT 0x0002 | 2026 | #define PCI_DEVICE_ID_BCM1250_HT 0x0002 |
2055 | 2027 | ||
2028 | #define PCI_VENDOR_ID_ATHEROS 0x168c | ||
2029 | |||
2056 | #define PCI_VENDOR_ID_NETCELL 0x169c | 2030 | #define PCI_VENDOR_ID_NETCELL 0x169c |
2057 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 | 2031 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 |
2058 | 2032 | ||
@@ -2068,6 +2042,8 @@ | |||
2068 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea | 2042 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea |
2069 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb | 2043 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb |
2070 | 2044 | ||
2045 | #define PCI_VENDOR_ID_LENOVO 0x17aa | ||
2046 | |||
2071 | #define PCI_VENDOR_ID_ARECA 0x17d3 | 2047 | #define PCI_VENDOR_ID_ARECA 0x17d3 |
2072 | #define PCI_DEVICE_ID_ARECA_1110 0x1110 | 2048 | #define PCI_DEVICE_ID_ARECA_1110 0x1110 |
2073 | #define PCI_DEVICE_ID_ARECA_1120 0x1120 | 2049 | #define PCI_DEVICE_ID_ARECA_1120 0x1120 |
@@ -2091,7 +2067,6 @@ | |||
2091 | #define PCI_DEVICE_ID_HERC_WIN 0x5732 | 2067 | #define PCI_DEVICE_ID_HERC_WIN 0x5732 |
2092 | #define PCI_DEVICE_ID_HERC_UNI 0x5832 | 2068 | #define PCI_DEVICE_ID_HERC_UNI 0x5832 |
2093 | 2069 | ||
2094 | |||
2095 | #define PCI_VENDOR_ID_SITECOM 0x182d | 2070 | #define PCI_VENDOR_ID_SITECOM 0x182d |
2096 | #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 | 2071 | #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 |
2097 | 2072 | ||
@@ -2127,12 +2102,9 @@ | |||
2127 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 | 2102 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 |
2128 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 | 2103 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 |
2129 | 2104 | ||
2130 | |||
2131 | #define PCI_VENDOR_ID_AKS 0x416c | 2105 | #define PCI_VENDOR_ID_AKS 0x416c |
2132 | #define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 | 2106 | #define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 |
2133 | 2107 | ||
2134 | |||
2135 | |||
2136 | #define PCI_VENDOR_ID_S3 0x5333 | 2108 | #define PCI_VENDOR_ID_S3 0x5333 |
2137 | #define PCI_DEVICE_ID_S3_TRIO 0x8811 | 2109 | #define PCI_DEVICE_ID_S3_TRIO 0x8811 |
2138 | #define PCI_DEVICE_ID_S3_868 0x8880 | 2110 | #define PCI_DEVICE_ID_S3_868 0x8880 |
@@ -2144,7 +2116,6 @@ | |||
2144 | #define PCI_VENDOR_ID_DUNORD 0x5544 | 2116 | #define PCI_VENDOR_ID_DUNORD 0x5544 |
2145 | #define PCI_DEVICE_ID_DUNORD_I3000 0x0001 | 2117 | #define PCI_DEVICE_ID_DUNORD_I3000 0x0001 |
2146 | 2118 | ||
2147 | |||
2148 | #define PCI_VENDOR_ID_DCI 0x6666 | 2119 | #define PCI_VENDOR_ID_DCI 0x6666 |
2149 | #define PCI_DEVICE_ID_DCI_PCCOM4 0x0001 | 2120 | #define PCI_DEVICE_ID_DCI_PCCOM4 0x0001 |
2150 | #define PCI_DEVICE_ID_DCI_PCCOM8 0x0002 | 2121 | #define PCI_DEVICE_ID_DCI_PCCOM8 0x0002 |
@@ -2244,6 +2215,7 @@ | |||
2244 | #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 | 2215 | #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 |
2245 | #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 | 2216 | #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 |
2246 | #define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 | 2217 | #define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 |
2218 | #define PCI_DEVICE_ID_INTEL_3000_HB 0x2778 | ||
2247 | #define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0 | 2219 | #define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0 |
2248 | #define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2 | 2220 | #define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2 |
2249 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 | 2221 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 |
@@ -2388,7 +2360,6 @@ | |||
2388 | #define PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN 0x0500 | 2360 | #define PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN 0x0500 |
2389 | #define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503 | 2361 | #define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503 |
2390 | 2362 | ||
2391 | |||
2392 | #define PCI_VENDOR_ID_HOLTEK 0x9412 | 2363 | #define PCI_VENDOR_ID_HOLTEK 0x9412 |
2393 | #define PCI_DEVICE_ID_HOLTEK_6565 0x6565 | 2364 | #define PCI_DEVICE_ID_HOLTEK_6565 0x6565 |
2394 | 2365 | ||
@@ -2404,6 +2375,8 @@ | |||
2404 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 | 2375 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 |
2405 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 | 2376 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 |
2406 | 2377 | ||
2378 | #define PCI_VENDOR_ID_3COM_2 0xa727 | ||
2379 | |||
2407 | #define PCI_SUBVENDOR_ID_EXSYS 0xd84d | 2380 | #define PCI_SUBVENDOR_ID_EXSYS 0xd84d |
2408 | #define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 | 2381 | #define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 |
2409 | #define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055 | 2382 | #define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055 |
@@ -2412,13 +2385,7 @@ | |||
2412 | #define PCI_DEVICE_ID_TIGERJET_300 0x0001 | 2385 | #define PCI_DEVICE_ID_TIGERJET_300 0x0001 |
2413 | #define PCI_DEVICE_ID_TIGERJET_100 0x0002 | 2386 | #define PCI_DEVICE_ID_TIGERJET_100 0x0002 |
2414 | 2387 | ||
2415 | #define PCI_VENDOR_ID_TTTECH 0x0357 | ||
2416 | #define PCI_DEVICE_ID_TTTECH_MC322 0x000A | ||
2417 | |||
2418 | #define PCI_VENDOR_ID_XILINX_RME 0xea60 | 2388 | #define PCI_VENDOR_ID_XILINX_RME 0xea60 |
2419 | #define PCI_DEVICE_ID_RME_DIGI32 0x9896 | 2389 | #define PCI_DEVICE_ID_RME_DIGI32 0x9896 |
2420 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 | 2390 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 |
2421 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 | 2391 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 |
2422 | |||
2423 | #define PCI_VENDOR_ID_QUICKNET 0x15E2 | ||
2424 | #define PCI_DEVICE_ID_QUICKNET_XJ 0x0500 | ||
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index b72be2f79e6a..926adaae0f96 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __LINUX_PERCPU_H | 1 | #ifndef __LINUX_PERCPU_H |
2 | #define __LINUX_PERCPU_H | 2 | #define __LINUX_PERCPU_H |
3 | 3 | ||
4 | #include <linux/spinlock.h> /* For preempt_disable() */ | 4 | #include <linux/preempt.h> |
5 | #include <linux/slab.h> /* For kmalloc() */ | 5 | #include <linux/slab.h> /* For kmalloc() */ |
6 | #include <linux/smp.h> | 6 | #include <linux/smp.h> |
7 | #include <linux/string.h> /* For memset() */ | 7 | #include <linux/string.h> /* For memset() */ |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index f5aa593ccf32..3d9f70972cdf 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
10 | #include <linux/smp.h> | 10 | #include <linux/smp.h> |
11 | #include <linux/list.h> | ||
11 | #include <linux/threads.h> | 12 | #include <linux/threads.h> |
12 | #include <linux/percpu.h> | 13 | #include <linux/percpu.h> |
13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
@@ -17,6 +18,9 @@ | |||
17 | struct percpu_counter { | 18 | struct percpu_counter { |
18 | spinlock_t lock; | 19 | spinlock_t lock; |
19 | s64 count; | 20 | s64 count; |
21 | #ifdef CONFIG_HOTPLUG_CPU | ||
22 | struct list_head list; /* All percpu_counters are on a list */ | ||
23 | #endif | ||
20 | s32 *counters; | 24 | s32 *counters; |
21 | }; | 25 | }; |
22 | 26 | ||
@@ -26,18 +30,8 @@ struct percpu_counter { | |||
26 | #define FBC_BATCH (NR_CPUS*4) | 30 | #define FBC_BATCH (NR_CPUS*4) |
27 | #endif | 31 | #endif |
28 | 32 | ||
29 | static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) | 33 | void percpu_counter_init(struct percpu_counter *fbc, s64 amount); |
30 | { | 34 | void percpu_counter_destroy(struct percpu_counter *fbc); |
31 | spin_lock_init(&fbc->lock); | ||
32 | fbc->count = amount; | ||
33 | fbc->counters = alloc_percpu(s32); | ||
34 | } | ||
35 | |||
36 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) | ||
37 | { | ||
38 | free_percpu(fbc->counters); | ||
39 | } | ||
40 | |||
41 | void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); | 35 | void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); |
42 | s64 percpu_counter_sum(struct percpu_counter *fbc); | 36 | s64 percpu_counter_sum(struct percpu_counter *fbc); |
43 | 37 | ||
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 169c6c24209b..b9a17e08ff0f 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
@@ -29,7 +29,7 @@ static inline void get_pid_ns(struct pid_namespace *ns) | |||
29 | kref_get(&ns->kref); | 29 | kref_get(&ns->kref); |
30 | } | 30 | } |
31 | 31 | ||
32 | extern struct pid_namespace *copy_pid_ns(int flags, struct pid_namespace *ns); | 32 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); |
33 | extern void free_pid_ns(struct kref *kref); | 33 | extern void free_pid_ns(struct kref *kref); |
34 | 34 | ||
35 | static inline void put_pid_ns(struct pid_namespace *ns) | 35 | static inline void put_pid_ns(struct pid_namespace *ns) |
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index c3f01b3085a4..30b8571e6b34 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h | |||
@@ -403,16 +403,13 @@ enum | |||
403 | * 1..32767 Reserved for ematches inside kernel tree | 403 | * 1..32767 Reserved for ematches inside kernel tree |
404 | * 32768..65535 Free to use, not reliable | 404 | * 32768..65535 Free to use, not reliable |
405 | */ | 405 | */ |
406 | enum | 406 | #define TCF_EM_CONTAINER 0 |
407 | { | 407 | #define TCF_EM_CMP 1 |
408 | TCF_EM_CONTAINER, | 408 | #define TCF_EM_NBYTE 2 |
409 | TCF_EM_CMP, | 409 | #define TCF_EM_U32 3 |
410 | TCF_EM_NBYTE, | 410 | #define TCF_EM_META 4 |
411 | TCF_EM_U32, | 411 | #define TCF_EM_TEXT 5 |
412 | TCF_EM_META, | 412 | #define TCF_EM_MAX 5 |
413 | TCF_EM_TEXT, | ||
414 | __TCF_EM_MAX | ||
415 | }; | ||
416 | 413 | ||
417 | enum | 414 | enum |
418 | { | 415 | { |
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index d10f35338507..268c51599eb8 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -101,6 +101,15 @@ struct tc_prio_qopt | |||
101 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ | 101 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ |
102 | }; | 102 | }; |
103 | 103 | ||
104 | enum | ||
105 | { | ||
106 | TCA_PRIO_UNSPEC, | ||
107 | TCA_PRIO_MQ, | ||
108 | __TCA_PRIO_MAX | ||
109 | }; | ||
110 | |||
111 | #define TCA_PRIO_MAX (__TCA_PRIO_MAX - 1) | ||
112 | |||
104 | /* TBF section */ | 113 | /* TBF section */ |
105 | 114 | ||
106 | struct tc_tbf_qopt | 115 | struct tc_tbf_qopt |
diff --git a/include/linux/pm.h b/include/linux/pm.h index b2c4fde4e994..ad3cc2eb0d34 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -101,6 +101,7 @@ struct pm_dev | |||
101 | */ | 101 | */ |
102 | extern void (*pm_idle)(void); | 102 | extern void (*pm_idle)(void); |
103 | extern void (*pm_power_off)(void); | 103 | extern void (*pm_power_off)(void); |
104 | extern void (*pm_power_off_prepare)(void); | ||
104 | 105 | ||
105 | typedef int __bitwise suspend_state_t; | 106 | typedef int __bitwise suspend_state_t; |
106 | 107 | ||
@@ -267,15 +268,10 @@ struct dev_pm_info { | |||
267 | unsigned can_wakeup:1; | 268 | unsigned can_wakeup:1; |
268 | #ifdef CONFIG_PM | 269 | #ifdef CONFIG_PM |
269 | unsigned should_wakeup:1; | 270 | unsigned should_wakeup:1; |
270 | pm_message_t prev_state; | ||
271 | void * saved_state; | ||
272 | struct device * pm_parent; | ||
273 | struct list_head entry; | 271 | struct list_head entry; |
274 | #endif | 272 | #endif |
275 | }; | 273 | }; |
276 | 274 | ||
277 | extern void device_pm_set_parent(struct device * dev, struct device * parent); | ||
278 | |||
279 | extern int device_power_down(pm_message_t state); | 275 | extern int device_power_down(pm_message_t state); |
280 | extern void device_power_up(void); | 276 | extern void device_power_up(void); |
281 | extern void device_resume(void); | 277 | extern void device_resume(void); |
@@ -289,8 +285,6 @@ extern int device_prepare_suspend(pm_message_t state); | |||
289 | #define device_may_wakeup(dev) \ | 285 | #define device_may_wakeup(dev) \ |
290 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | 286 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) |
291 | 287 | ||
292 | extern int dpm_runtime_suspend(struct device *, pm_message_t); | ||
293 | extern void dpm_runtime_resume(struct device *); | ||
294 | extern void __suspend_report_result(const char *function, void *fn, int ret); | 288 | extern void __suspend_report_result(const char *function, void *fn, int ret); |
295 | 289 | ||
296 | #define suspend_report_result(fn, ret) \ | 290 | #define suspend_report_result(fn, ret) \ |
@@ -322,15 +316,6 @@ static inline int device_suspend(pm_message_t state) | |||
322 | #define device_set_wakeup_enable(dev,val) do{}while(0) | 316 | #define device_set_wakeup_enable(dev,val) do{}while(0) |
323 | #define device_may_wakeup(dev) (0) | 317 | #define device_may_wakeup(dev) (0) |
324 | 318 | ||
325 | static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | ||
326 | { | ||
327 | return 0; | ||
328 | } | ||
329 | |||
330 | static inline void dpm_runtime_resume(struct device * dev) | ||
331 | { | ||
332 | } | ||
333 | |||
334 | #define suspend_report_result(fn, ret) do { } while (0) | 319 | #define suspend_report_result(fn, ret) do { } while (0) |
335 | 320 | ||
336 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | 321 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index 52a9be41250d..e2eff9079fe9 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
@@ -59,4 +59,8 @@ | |||
59 | # define PR_ENDIAN_LITTLE 1 /* True little endian mode */ | 59 | # define PR_ENDIAN_LITTLE 1 /* True little endian mode */ |
60 | # define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ | 60 | # define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ |
61 | 61 | ||
62 | /* Get/set process seccomp mode */ | ||
63 | #define PR_GET_SECCOMP 21 | ||
64 | #define PR_SET_SECCOMP 22 | ||
65 | |||
62 | #endif /* _LINUX_PRCTL_H */ | 66 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h index fc86f274147f..1adfe668d031 100644 --- a/include/linux/prefetch.h +++ b/include/linux/prefetch.h | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | prefetch(x) - prefetches the cacheline at "x" for read | 28 | prefetch(x) - prefetches the cacheline at "x" for read |
29 | prefetchw(x) - prefetches the cacheline at "x" for write | 29 | prefetchw(x) - prefetches the cacheline at "x" for write |
30 | spin_lock_prefetch(x) - prefectches the spinlock *x for taking | 30 | spin_lock_prefetch(x) - prefetches the spinlock *x for taking |
31 | 31 | ||
32 | there is also PREFETCH_STRIDE which is the architecure-prefered | 32 | there is also PREFETCH_STRIDE which is the architecure-prefered |
33 | "lookahead" size for prefetching streamed operations. | 33 | "lookahead" size for prefetching streamed operations. |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 3469f96bc8b2..28e3664fdf1b 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #include <linux/magic.h> | 7 | #include <linux/magic.h> |
8 | #include <asm/atomic.h> | 8 | #include <asm/atomic.h> |
9 | 9 | ||
10 | struct completion; | ||
11 | |||
10 | /* | 12 | /* |
11 | * The proc filesystem constants/structures | 13 | * The proc filesystem constants/structures |
12 | */ | 14 | */ |
@@ -56,6 +58,14 @@ struct proc_dir_entry { | |||
56 | gid_t gid; | 58 | gid_t gid; |
57 | loff_t size; | 59 | loff_t size; |
58 | const struct inode_operations *proc_iops; | 60 | const struct inode_operations *proc_iops; |
61 | /* | ||
62 | * NULL ->proc_fops means "PDE is going away RSN" or | ||
63 | * "PDE is just created". In either case, e.g. ->read_proc won't be | ||
64 | * called because it's too late or too early, respectively. | ||
65 | * | ||
66 | * If you're allocating ->proc_fops dynamically, save a pointer | ||
67 | * somewhere. | ||
68 | */ | ||
59 | const struct file_operations *proc_fops; | 69 | const struct file_operations *proc_fops; |
60 | get_info_t *get_info; | 70 | get_info_t *get_info; |
61 | struct module *owner; | 71 | struct module *owner; |
@@ -66,6 +76,9 @@ struct proc_dir_entry { | |||
66 | atomic_t count; /* use count */ | 76 | atomic_t count; /* use count */ |
67 | int deleted; /* delete flag */ | 77 | int deleted; /* delete flag */ |
68 | void *set; | 78 | void *set; |
79 | int pde_users; /* number of callers into module in progress */ | ||
80 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ | ||
81 | struct completion *pde_unload_completion; | ||
69 | }; | 82 | }; |
70 | 83 | ||
71 | struct kcore_list { | 84 | struct kcore_list { |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index eeb1976ef7bf..ae8146abd746 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -110,6 +110,8 @@ static inline void ptrace_unlink(struct task_struct *child) | |||
110 | __ptrace_unlink(child); | 110 | __ptrace_unlink(child); |
111 | } | 111 | } |
112 | 112 | ||
113 | int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data); | ||
114 | int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data); | ||
113 | 115 | ||
114 | #ifndef force_successful_syscall_return | 116 | #ifndef force_successful_syscall_return |
115 | /* | 117 | /* |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index dd5a05d03d4f..75e17a05540e 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -262,7 +262,7 @@ int bitmap_active(struct bitmap *bitmap); | |||
262 | 262 | ||
263 | char *file_path(struct file *file, char *buf, int count); | 263 | char *file_path(struct file *file, char *buf, int count); |
264 | void bitmap_print_sb(struct bitmap *bitmap); | 264 | void bitmap_print_sb(struct bitmap *bitmap); |
265 | int bitmap_update_sb(struct bitmap *bitmap); | 265 | void bitmap_update_sb(struct bitmap *bitmap); |
266 | 266 | ||
267 | int bitmap_setallbits(struct bitmap *bitmap); | 267 | int bitmap_setallbits(struct bitmap *bitmap); |
268 | void bitmap_write_all(struct bitmap *bitmap); | 268 | void bitmap_write_all(struct bitmap *bitmap); |
@@ -278,8 +278,8 @@ int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int d | |||
278 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); | 278 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); |
279 | void bitmap_close_sync(struct bitmap *bitmap); | 279 | void bitmap_close_sync(struct bitmap *bitmap); |
280 | 280 | ||
281 | int bitmap_unplug(struct bitmap *bitmap); | 281 | void bitmap_unplug(struct bitmap *bitmap); |
282 | int bitmap_daemon_work(struct bitmap *bitmap); | 282 | void bitmap_daemon_work(struct bitmap *bitmap); |
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | #endif | 285 | #endif |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index de72c49747c8..28ac632b42dd 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -51,7 +51,7 @@ struct mdk_rdev_s | |||
51 | 51 | ||
52 | sector_t size; /* Device size (in blocks) */ | 52 | sector_t size; /* Device size (in blocks) */ |
53 | mddev_t *mddev; /* RAID array if running */ | 53 | mddev_t *mddev; /* RAID array if running */ |
54 | unsigned long last_events; /* IO event timestamp */ | 54 | long last_events; /* IO event timestamp */ |
55 | 55 | ||
56 | struct block_device *bdev; /* block device handle */ | 56 | struct block_device *bdev; /* block device handle */ |
57 | 57 | ||
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index d8286db60b96..93678f57ccbe 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
@@ -116,13 +116,46 @@ | |||
116 | * attach a request to an active stripe (add_stripe_bh()) | 116 | * attach a request to an active stripe (add_stripe_bh()) |
117 | * lockdev attach-buffer unlockdev | 117 | * lockdev attach-buffer unlockdev |
118 | * handle a stripe (handle_stripe()) | 118 | * handle a stripe (handle_stripe()) |
119 | * lockstripe clrSTRIPE_HANDLE ... (lockdev check-buffers unlockdev) .. change-state .. record io needed unlockstripe schedule io | 119 | * lockstripe clrSTRIPE_HANDLE ... |
120 | * (lockdev check-buffers unlockdev) .. | ||
121 | * change-state .. | ||
122 | * record io/ops needed unlockstripe schedule io/ops | ||
120 | * release an active stripe (release_stripe()) | 123 | * release an active stripe (release_stripe()) |
121 | * lockdev if (!--cnt) { if STRIPE_HANDLE, add to handle_list else add to inactive-list } unlockdev | 124 | * lockdev if (!--cnt) { if STRIPE_HANDLE, add to handle_list else add to inactive-list } unlockdev |
122 | * | 125 | * |
123 | * The refcount counts each thread that have activated the stripe, | 126 | * The refcount counts each thread that have activated the stripe, |
124 | * plus raid5d if it is handling it, plus one for each active request | 127 | * plus raid5d if it is handling it, plus one for each active request |
125 | * on a cached buffer. | 128 | * on a cached buffer, and plus one if the stripe is undergoing stripe |
129 | * operations. | ||
130 | * | ||
131 | * Stripe operations are performed outside the stripe lock, | ||
132 | * the stripe operations are: | ||
133 | * -copying data between the stripe cache and user application buffers | ||
134 | * -computing blocks to save a disk access, or to recover a missing block | ||
135 | * -updating the parity on a write operation (reconstruct write and | ||
136 | * read-modify-write) | ||
137 | * -checking parity correctness | ||
138 | * -running i/o to disk | ||
139 | * These operations are carried out by raid5_run_ops which uses the async_tx | ||
140 | * api to (optionally) offload operations to dedicated hardware engines. | ||
141 | * When requesting an operation handle_stripe sets the pending bit for the | ||
142 | * operation and increments the count. raid5_run_ops is then run whenever | ||
143 | * the count is non-zero. | ||
144 | * There are some critical dependencies between the operations that prevent some | ||
145 | * from being requested while another is in flight. | ||
146 | * 1/ Parity check operations destroy the in cache version of the parity block, | ||
147 | * so we prevent parity dependent operations like writes and compute_blocks | ||
148 | * from starting while a check is in progress. Some dma engines can perform | ||
149 | * the check without damaging the parity block, in these cases the parity | ||
150 | * block is re-marked up to date (assuming the check was successful) and is | ||
151 | * not re-read from disk. | ||
152 | * 2/ When a write operation is requested we immediately lock the affected | ||
153 | * blocks, and mark them as not up to date. This causes new read requests | ||
154 | * to be held off, as well as parity checks and compute block operations. | ||
155 | * 3/ Once a compute block operation has been requested handle_stripe treats | ||
156 | * that block as if it is up to date. raid5_run_ops guaruntees that any | ||
157 | * operation that is dependent on the compute block result is initiated after | ||
158 | * the compute block completes. | ||
126 | */ | 159 | */ |
127 | 160 | ||
128 | struct stripe_head { | 161 | struct stripe_head { |
@@ -136,15 +169,46 @@ struct stripe_head { | |||
136 | spinlock_t lock; | 169 | spinlock_t lock; |
137 | int bm_seq; /* sequence number for bitmap flushes */ | 170 | int bm_seq; /* sequence number for bitmap flushes */ |
138 | int disks; /* disks in stripe */ | 171 | int disks; /* disks in stripe */ |
172 | /* stripe_operations | ||
173 | * @pending - pending ops flags (set for request->issue->complete) | ||
174 | * @ack - submitted ops flags (set for issue->complete) | ||
175 | * @complete - completed ops flags (set for complete) | ||
176 | * @target - STRIPE_OP_COMPUTE_BLK target | ||
177 | * @count - raid5_runs_ops is set to run when this is non-zero | ||
178 | */ | ||
179 | struct stripe_operations { | ||
180 | unsigned long pending; | ||
181 | unsigned long ack; | ||
182 | unsigned long complete; | ||
183 | int target; | ||
184 | int count; | ||
185 | u32 zero_sum_result; | ||
186 | } ops; | ||
139 | struct r5dev { | 187 | struct r5dev { |
140 | struct bio req; | 188 | struct bio req; |
141 | struct bio_vec vec; | 189 | struct bio_vec vec; |
142 | struct page *page; | 190 | struct page *page; |
143 | struct bio *toread, *towrite, *written; | 191 | struct bio *toread, *read, *towrite, *written; |
144 | sector_t sector; /* sector of this page */ | 192 | sector_t sector; /* sector of this page */ |
145 | unsigned long flags; | 193 | unsigned long flags; |
146 | } dev[1]; /* allocated with extra space depending of RAID geometry */ | 194 | } dev[1]; /* allocated with extra space depending of RAID geometry */ |
147 | }; | 195 | }; |
196 | |||
197 | /* stripe_head_state - collects and tracks the dynamic state of a stripe_head | ||
198 | * for handle_stripe. It is only valid under spin_lock(sh->lock); | ||
199 | */ | ||
200 | struct stripe_head_state { | ||
201 | int syncing, expanding, expanded; | ||
202 | int locked, uptodate, to_read, to_write, failed, written; | ||
203 | int to_fill, compute, req_compute, non_overwrite; | ||
204 | int failed_num; | ||
205 | }; | ||
206 | |||
207 | /* r6_state - extra state data only relevant to r6 */ | ||
208 | struct r6_state { | ||
209 | int p_failed, q_failed, qd_idx, failed_num[2]; | ||
210 | }; | ||
211 | |||
148 | /* Flags */ | 212 | /* Flags */ |
149 | #define R5_UPTODATE 0 /* page contains current data */ | 213 | #define R5_UPTODATE 0 /* page contains current data */ |
150 | #define R5_LOCKED 1 /* IO has been submitted on "req" */ | 214 | #define R5_LOCKED 1 /* IO has been submitted on "req" */ |
@@ -158,6 +222,15 @@ struct stripe_head { | |||
158 | #define R5_ReWrite 9 /* have tried to over-write the readerror */ | 222 | #define R5_ReWrite 9 /* have tried to over-write the readerror */ |
159 | 223 | ||
160 | #define R5_Expanded 10 /* This block now has post-expand data */ | 224 | #define R5_Expanded 10 /* This block now has post-expand data */ |
225 | #define R5_Wantcompute 11 /* compute_block in progress treat as | ||
226 | * uptodate | ||
227 | */ | ||
228 | #define R5_Wantfill 12 /* dev->toread contains a bio that needs | ||
229 | * filling | ||
230 | */ | ||
231 | #define R5_Wantprexor 13 /* distinguish blocks ready for rmw from | ||
232 | * other "towrites" | ||
233 | */ | ||
161 | /* | 234 | /* |
162 | * Write method | 235 | * Write method |
163 | */ | 236 | */ |
@@ -180,6 +253,24 @@ struct stripe_head { | |||
180 | #define STRIPE_EXPAND_SOURCE 10 | 253 | #define STRIPE_EXPAND_SOURCE 10 |
181 | #define STRIPE_EXPAND_READY 11 | 254 | #define STRIPE_EXPAND_READY 11 |
182 | /* | 255 | /* |
256 | * Operations flags (in issue order) | ||
257 | */ | ||
258 | #define STRIPE_OP_BIOFILL 0 | ||
259 | #define STRIPE_OP_COMPUTE_BLK 1 | ||
260 | #define STRIPE_OP_PREXOR 2 | ||
261 | #define STRIPE_OP_BIODRAIN 3 | ||
262 | #define STRIPE_OP_POSTXOR 4 | ||
263 | #define STRIPE_OP_CHECK 5 | ||
264 | #define STRIPE_OP_IO 6 | ||
265 | |||
266 | /* modifiers to the base operations | ||
267 | * STRIPE_OP_MOD_REPAIR_PD - compute the parity block and write it back | ||
268 | * STRIPE_OP_MOD_DMA_CHECK - parity is not corrupted by the check | ||
269 | */ | ||
270 | #define STRIPE_OP_MOD_REPAIR_PD 7 | ||
271 | #define STRIPE_OP_MOD_DMA_CHECK 8 | ||
272 | |||
273 | /* | ||
183 | * Plugging: | 274 | * Plugging: |
184 | * | 275 | * |
185 | * To improve write throughput, we need to delay the handling of some | 276 | * To improve write throughput, we need to delay the handling of some |
diff --git a/include/linux/raid/xor.h b/include/linux/raid/xor.h index f0d67cbdea40..3e120587eada 100644 --- a/include/linux/raid/xor.h +++ b/include/linux/raid/xor.h | |||
@@ -3,9 +3,10 @@ | |||
3 | 3 | ||
4 | #include <linux/raid/md.h> | 4 | #include <linux/raid/md.h> |
5 | 5 | ||
6 | #define MAX_XOR_BLOCKS 5 | 6 | #define MAX_XOR_BLOCKS 4 |
7 | 7 | ||
8 | extern void xor_block(unsigned int count, unsigned int bytes, void **ptr); | 8 | extern void xor_blocks(unsigned int count, unsigned int bytes, |
9 | void *dest, void **srcs); | ||
9 | 10 | ||
10 | struct xor_block_template { | 11 | struct xor_block_template { |
11 | struct xor_block_template *next; | 12 | struct xor_block_template *next; |
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 | ||
68 | void ctrl_alt_del(void); | 68 | void ctrl_alt_del(void); |
69 | 69 | ||
70 | #define POWEROFF_CMD_PATH_LEN 256 | ||
71 | extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN]; | ||
72 | |||
73 | extern 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/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 | ||
6 | extern int pm_trace_enabled; | 7 | extern int pm_trace_enabled; |
7 | 8 | ||
@@ -9,20 +10,10 @@ struct device; | |||
9 | extern void set_trace_device(struct device *); | 10 | extern void set_trace_device(struct device *); |
10 | extern void generate_resume_trace(void *tracedata, unsigned int user); | 11 | extern 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/rtc/m48t59.h b/include/linux/rtc/m48t59.h new file mode 100644 index 000000000000..e8c7c21ceb1f --- /dev/null +++ b/include/linux/rtc/m48t59.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * include/linux/rtc/m48t59.h | ||
3 | * | ||
4 | * Definitions for the platform data of m48t59 RTC chip driver. | ||
5 | * | ||
6 | * Copyright (c) 2007 Wind River Systems, Inc. | ||
7 | * | ||
8 | * Mark Zhan <rongkai.zhan@windriver.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #ifndef _LINUX_RTC_M48T59_H_ | ||
16 | #define _LINUX_RTC_M48T59_H_ | ||
17 | |||
18 | /* | ||
19 | * M48T59 Register Offset | ||
20 | */ | ||
21 | #define M48T59_YEAR 0x1fff | ||
22 | #define M48T59_MONTH 0x1ffe | ||
23 | #define M48T59_MDAY 0x1ffd /* Day of Month */ | ||
24 | #define M48T59_WDAY 0x1ffc /* Day of Week */ | ||
25 | #define M48T59_WDAY_CB 0x20 /* Century Bit */ | ||
26 | #define M48T59_WDAY_CEB 0x10 /* Century Enable Bit */ | ||
27 | #define M48T59_HOUR 0x1ffb | ||
28 | #define M48T59_MIN 0x1ffa | ||
29 | #define M48T59_SEC 0x1ff9 | ||
30 | #define M48T59_CNTL 0x1ff8 | ||
31 | #define M48T59_CNTL_READ 0x40 | ||
32 | #define M48T59_CNTL_WRITE 0x80 | ||
33 | #define M48T59_WATCHDOG 0x1ff7 | ||
34 | #define M48T59_INTR 0x1ff6 | ||
35 | #define M48T59_INTR_AFE 0x80 /* Alarm Interrupt Enable */ | ||
36 | #define M48T59_INTR_ABE 0x20 | ||
37 | #define M48T59_ALARM_DATE 0x1ff5 | ||
38 | #define M48T59_ALARM_HOUR 0x1ff4 | ||
39 | #define M48T59_ALARM_MIN 0x1ff3 | ||
40 | #define M48T59_ALARM_SEC 0x1ff2 | ||
41 | #define M48T59_UNUSED 0x1ff1 | ||
42 | #define M48T59_FLAGS 0x1ff0 | ||
43 | #define M48T59_FLAGS_WDT 0x80 /* watchdog timer expired */ | ||
44 | #define M48T59_FLAGS_AF 0x40 /* alarm */ | ||
45 | #define M48T59_FLAGS_BF 0x10 /* low battery */ | ||
46 | |||
47 | #define M48T59_NVRAM_SIZE 0x1ff0 | ||
48 | |||
49 | struct m48t59_plat_data { | ||
50 | /* The method to access M48T59 registers, | ||
51 | * NOTE: The 'ofs' should be 0x00~0x1fff | ||
52 | */ | ||
53 | void (*write_byte)(struct device *dev, u32 ofs, u8 val); | ||
54 | unsigned char (*read_byte)(struct device *dev, u32 ofs); | ||
55 | }; | ||
56 | |||
57 | #endif /* _LINUX_RTC_M48T59_H_ */ | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 1fae30af91f3..c91476ce314a 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -261,7 +261,7 @@ enum rtattr_type_t | |||
261 | RTA_FLOW, | 261 | RTA_FLOW, |
262 | RTA_CACHEINFO, | 262 | RTA_CACHEINFO, |
263 | RTA_SESSION, | 263 | RTA_SESSION, |
264 | RTA_MP_ALGO, | 264 | RTA_MP_ALGO, /* no longer used */ |
265 | RTA_TABLE, | 265 | RTA_TABLE, |
266 | __RTA_MAX | 266 | __RTA_MAX |
267 | }; | 267 | }; |
@@ -570,10 +570,16 @@ static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) | |||
570 | } | 570 | } |
571 | 571 | ||
572 | extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); | 572 | extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); |
573 | extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr, | ||
574 | struct rtattr *rta, int len); | ||
573 | 575 | ||
574 | #define rtattr_parse_nested(tb, max, rta) \ | 576 | #define rtattr_parse_nested(tb, max, rta) \ |
575 | rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) | 577 | rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) |
576 | 578 | ||
579 | #define rtattr_parse_nested_compat(tb, max, rta, data, len) \ | ||
580 | ({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \ | ||
581 | __rtattr_parse_nested_compat(tb, max, rta, len); }) | ||
582 | |||
577 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); | 583 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); |
578 | extern int rtnl_unicast(struct sk_buff *skb, u32 pid); | 584 | extern int rtnl_unicast(struct sk_buff *skb, u32 pid); |
579 | extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, | 585 | extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, |
@@ -638,6 +644,18 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi | |||
638 | ({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ | 644 | ({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ |
639 | (skb)->len; }) | 645 | (skb)->len; }) |
640 | 646 | ||
647 | #define RTA_NEST_COMPAT(skb, type, attrlen, data) \ | ||
648 | ({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \ | ||
649 | RTA_PUT(skb, type, attrlen, data); \ | ||
650 | RTA_NEST(skb, type); \ | ||
651 | __start; }) | ||
652 | |||
653 | #define RTA_NEST_COMPAT_END(skb, start) \ | ||
654 | ({ struct rtattr *__nest = (void *)(start) + NLMSG_ALIGN((start)->rta_len); \ | ||
655 | (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ | ||
656 | RTA_NEST_END(skb, __nest); \ | ||
657 | (skb)->len; }) | ||
658 | |||
641 | #define RTA_NEST_CANCEL(skb, start) \ | 659 | #define RTA_NEST_CANCEL(skb, start) \ |
642 | ({ if (start) \ | 660 | ({ if (start) \ |
643 | skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ | 661 | skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index cfb680585ab8..33b9b4841ee7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ | 26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ |
27 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ | 27 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ |
28 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ | 28 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ |
29 | #define CLONE_NEWUSER 0x10000000 /* New user namespace */ | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * Scheduling policies | 32 | * Scheduling policies |
@@ -287,6 +288,7 @@ extern signed long schedule_timeout_uninterruptible(signed long timeout); | |||
287 | asmlinkage void schedule(void); | 288 | asmlinkage void schedule(void); |
288 | 289 | ||
289 | struct nsproxy; | 290 | struct nsproxy; |
291 | struct user_namespace; | ||
290 | 292 | ||
291 | /* Maximum number of active map areas.. This is a random (large) number */ | 293 | /* Maximum number of active map areas.. This is a random (large) number */ |
292 | #define DEFAULT_MAX_MAP_COUNT 65536 | 294 | #define DEFAULT_MAX_MAP_COUNT 65536 |
@@ -343,6 +345,27 @@ typedef unsigned long mm_counter_t; | |||
343 | (mm)->hiwater_vm = (mm)->total_vm; \ | 345 | (mm)->hiwater_vm = (mm)->total_vm; \ |
344 | } while (0) | 346 | } while (0) |
345 | 347 | ||
348 | extern void set_dumpable(struct mm_struct *mm, int value); | ||
349 | extern 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 | |||
346 | struct mm_struct { | 369 | struct mm_struct { |
347 | struct vm_area_struct * mmap; /* list of VMAs */ | 370 | struct vm_area_struct * mmap; /* list of VMAs */ |
348 | struct rb_root mm_rb; | 371 | struct rb_root mm_rb; |
@@ -400,7 +423,7 @@ struct mm_struct { | |||
400 | unsigned int token_priority; | 423 | unsigned int token_priority; |
401 | unsigned int last_interval; | 424 | unsigned int last_interval; |
402 | 425 | ||
403 | unsigned char dumpable:2; | 426 | unsigned long flags; /* Must use atomic bitops to access the bits */ |
404 | 427 | ||
405 | /* coredumping support */ | 428 | /* coredumping support */ |
406 | int core_waiters; | 429 | int core_waiters; |
@@ -529,6 +552,10 @@ struct signal_struct { | |||
529 | #ifdef CONFIG_TASKSTATS | 552 | #ifdef CONFIG_TASKSTATS |
530 | struct taskstats *stats; | 553 | struct taskstats *stats; |
531 | #endif | 554 | #endif |
555 | #ifdef CONFIG_AUDIT | ||
556 | unsigned audit_tty; | ||
557 | struct tty_audit_buf *tty_audit_buf; | ||
558 | #endif | ||
532 | }; | 559 | }; |
533 | 560 | ||
534 | /* Context switch must be unlocked if interrupts are to be enabled */ | 561 | /* Context switch must be unlocked if interrupts are to be enabled */ |
@@ -972,7 +999,8 @@ struct task_struct { | |||
972 | unsigned int rt_priority; | 999 | unsigned int rt_priority; |
973 | cputime_t utime, stime; | 1000 | cputime_t utime, stime; |
974 | unsigned long nvcsw, nivcsw; /* context switch counts */ | 1001 | unsigned long nvcsw, nivcsw; /* context switch counts */ |
975 | struct timespec start_time; | 1002 | struct timespec start_time; /* monotonic time */ |
1003 | struct timespec real_start_time; /* boot based time */ | ||
976 | /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ | 1004 | /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ |
977 | unsigned long min_flt, maj_flt; | 1005 | unsigned long min_flt, maj_flt; |
978 | 1006 | ||
@@ -1320,6 +1348,13 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
1320 | #endif | 1348 | #endif |
1321 | 1349 | ||
1322 | extern unsigned long long sched_clock(void); | 1350 | extern unsigned long long sched_clock(void); |
1351 | |||
1352 | /* | ||
1353 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu | ||
1354 | * clock constructed from sched_clock(): | ||
1355 | */ | ||
1356 | extern unsigned long long cpu_clock(int cpu); | ||
1357 | |||
1323 | extern unsigned long long | 1358 | extern unsigned long long |
1324 | task_sched_runtime(struct task_struct *task); | 1359 | task_sched_runtime(struct task_struct *task); |
1325 | 1360 | ||
@@ -1403,7 +1438,7 @@ extern struct task_struct *find_task_by_pid_type(int type, int pid); | |||
1403 | extern void __set_special_pids(pid_t session, pid_t pgrp); | 1438 | extern void __set_special_pids(pid_t session, pid_t pgrp); |
1404 | 1439 | ||
1405 | /* per-UID process charging. */ | 1440 | /* per-UID process charging. */ |
1406 | extern struct user_struct * alloc_uid(uid_t); | 1441 | extern struct user_struct * alloc_uid(struct user_namespace *, uid_t); |
1407 | static inline struct user_struct *get_uid(struct user_struct *u) | 1442 | static inline struct user_struct *get_uid(struct user_struct *u) |
1408 | { | 1443 | { |
1409 | atomic_inc(&u->__count); | 1444 | atomic_inc(&u->__count); |
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index b02308ee7667..3ee412bc00ec 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h | |||
@@ -10,7 +10,7 @@ | |||
10 | struct screen_info { | 10 | struct screen_info { |
11 | u8 orig_x; /* 0x00 */ | 11 | u8 orig_x; /* 0x00 */ |
12 | u8 orig_y; /* 0x01 */ | 12 | u8 orig_y; /* 0x01 */ |
13 | u16 dontuse1; /* 0x02 -- EXT_MEM_K sits here */ | 13 | u16 ext_mem_k; /* 0x02 */ |
14 | u16 orig_video_page; /* 0x04 */ | 14 | u16 orig_video_page; /* 0x04 */ |
15 | u8 orig_video_mode; /* 0x06 */ | 15 | u8 orig_video_mode; /* 0x06 */ |
16 | u8 orig_video_cols; /* 0x07 */ | 16 | u8 orig_video_cols; /* 0x07 */ |
@@ -27,7 +27,7 @@ struct screen_info { | |||
27 | u16 lfb_depth; /* 0x16 */ | 27 | u16 lfb_depth; /* 0x16 */ |
28 | u32 lfb_base; /* 0x18 */ | 28 | u32 lfb_base; /* 0x18 */ |
29 | u32 lfb_size; /* 0x1c */ | 29 | u32 lfb_size; /* 0x1c */ |
30 | u16 dontuse2, dontuse3; /* 0x20 -- CL_MAGIC and CL_OFFSET here */ | 30 | u16 cl_magic, cl_offset; /* 0x20 */ |
31 | u16 lfb_linelength; /* 0x24 */ | 31 | u16 lfb_linelength; /* 0x24 */ |
32 | u8 red_size; /* 0x26 */ | 32 | u8 red_size; /* 0x26 */ |
33 | u8 red_pos; /* 0x27 */ | 33 | u8 red_pos; /* 0x27 */ |
@@ -42,9 +42,8 @@ struct screen_info { | |||
42 | u16 pages; /* 0x32 */ | 42 | u16 pages; /* 0x32 */ |
43 | u16 vesa_attributes; /* 0x34 */ | 43 | u16 vesa_attributes; /* 0x34 */ |
44 | u32 capabilities; /* 0x36 */ | 44 | u32 capabilities; /* 0x36 */ |
45 | /* 0x3a -- 0x3b reserved for future expansion */ | 45 | u8 _reserved[6]; /* 0x3a */ |
46 | /* 0x3c -- 0x3f micro stack for relocatable kernels */ | 46 | } __attribute__((packed)); |
47 | }; | ||
48 | 47 | ||
49 | extern struct screen_info screen_info; | 48 | extern struct screen_info screen_info; |
50 | 49 | ||
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h index 1a82d30c4b17..d2b058130eb1 100644 --- a/include/linux/scx200_gpio.h +++ b/include/linux/scx200_gpio.h | |||
@@ -1,5 +1,3 @@ | |||
1 | #include <linux/spinlock.h> | ||
2 | |||
3 | u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); | 1 | u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); |
4 | 2 | ||
5 | extern unsigned scx200_gpio_base; | 3 | extern unsigned scx200_gpio_base; |
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index 3e8b1cf54303..262a8dccfa81 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h | |||
@@ -4,8 +4,6 @@ | |||
4 | 4 | ||
5 | #ifdef CONFIG_SECCOMP | 5 | #ifdef CONFIG_SECCOMP |
6 | 6 | ||
7 | #define NR_SECCOMP_MODES 1 | ||
8 | |||
9 | #include <linux/thread_info.h> | 7 | #include <linux/thread_info.h> |
10 | #include <asm/seccomp.h> | 8 | #include <asm/seccomp.h> |
11 | 9 | ||
@@ -18,20 +16,23 @@ static inline void secure_computing(int this_syscall) | |||
18 | __secure_computing(this_syscall); | 16 | __secure_computing(this_syscall); |
19 | } | 17 | } |
20 | 18 | ||
21 | static inline int has_secure_computing(struct thread_info *ti) | 19 | extern long prctl_get_seccomp(void); |
22 | { | 20 | extern long prctl_set_seccomp(unsigned long); |
23 | return unlikely(test_ti_thread_flag(ti, TIF_SECCOMP)); | ||
24 | } | ||
25 | 21 | ||
26 | #else /* CONFIG_SECCOMP */ | 22 | #else /* CONFIG_SECCOMP */ |
27 | 23 | ||
28 | typedef struct { } seccomp_t; | 24 | typedef struct { } seccomp_t; |
29 | 25 | ||
30 | #define secure_computing(x) do { } while (0) | 26 | #define secure_computing(x) do { } while (0) |
31 | /* static inline to preserve typechecking */ | 27 | |
32 | static inline int has_secure_computing(struct thread_info *ti) | 28 | static inline long prctl_get_seccomp(void) |
29 | { | ||
30 | return -EINVAL; | ||
31 | } | ||
32 | |||
33 | static inline long prctl_set_seccomp(unsigned long arg2) | ||
33 | { | 34 | { |
34 | return 0; | 35 | return -EINVAL; |
35 | } | 36 | } |
36 | 37 | ||
37 | #endif /* CONFIG_SECCOMP */ | 38 | #endif /* CONFIG_SECCOMP */ |
diff --git a/include/linux/security.h b/include/linux/security.h index 9eb9e0fe0331..c11dc8aa0351 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -71,6 +71,7 @@ struct xfrm_user_sec_ctx; | |||
71 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | 71 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); |
72 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); | 72 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); |
73 | 73 | ||
74 | extern unsigned long mmap_min_addr; | ||
74 | /* | 75 | /* |
75 | * Values used in the task_security_ops calls | 76 | * Values used in the task_security_ops calls |
76 | */ | 77 | */ |
@@ -1241,8 +1242,9 @@ struct security_operations { | |||
1241 | int (*file_ioctl) (struct file * file, unsigned int cmd, | 1242 | int (*file_ioctl) (struct file * file, unsigned int cmd, |
1242 | unsigned long arg); | 1243 | unsigned long arg); |
1243 | int (*file_mmap) (struct file * file, | 1244 | int (*file_mmap) (struct file * file, |
1244 | unsigned long reqprot, | 1245 | unsigned long reqprot, unsigned long prot, |
1245 | unsigned long prot, unsigned long flags); | 1246 | unsigned long flags, unsigned long addr, |
1247 | unsigned long addr_only); | ||
1246 | int (*file_mprotect) (struct vm_area_struct * vma, | 1248 | int (*file_mprotect) (struct vm_area_struct * vma, |
1247 | unsigned long reqprot, | 1249 | unsigned long reqprot, |
1248 | unsigned long prot); | 1250 | unsigned long prot); |
@@ -1814,9 +1816,12 @@ static inline int security_file_ioctl (struct file *file, unsigned int cmd, | |||
1814 | 1816 | ||
1815 | static inline int security_file_mmap (struct file *file, unsigned long reqprot, | 1817 | static inline int security_file_mmap (struct file *file, unsigned long reqprot, |
1816 | unsigned long prot, | 1818 | unsigned long prot, |
1817 | unsigned long flags) | 1819 | unsigned long flags, |
1820 | unsigned long addr, | ||
1821 | unsigned long addr_only) | ||
1818 | { | 1822 | { |
1819 | return security_ops->file_mmap (file, reqprot, prot, flags); | 1823 | return security_ops->file_mmap (file, reqprot, prot, flags, addr, |
1824 | addr_only); | ||
1820 | } | 1825 | } |
1821 | 1826 | ||
1822 | static inline int security_file_mprotect (struct vm_area_struct *vma, | 1827 | static inline int security_file_mprotect (struct vm_area_struct *vma, |
@@ -2489,7 +2494,9 @@ static inline int security_file_ioctl (struct file *file, unsigned int cmd, | |||
2489 | 2494 | ||
2490 | static inline int security_file_mmap (struct file *file, unsigned long reqprot, | 2495 | static inline int security_file_mmap (struct file *file, unsigned long reqprot, |
2491 | unsigned long prot, | 2496 | unsigned long prot, |
2492 | unsigned long flags) | 2497 | unsigned long flags, |
2498 | unsigned long addr, | ||
2499 | unsigned long addr_only) | ||
2493 | { | 2500 | { |
2494 | return 0; | 2501 | return 0; |
2495 | } | 2502 | } |
diff --git a/include/linux/serial.h b/include/linux/serial.h index 33fc8cb8ddfb..deb714314fb1 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -177,11 +177,5 @@ struct serial_icounter_struct { | |||
177 | #ifdef __KERNEL__ | 177 | #ifdef __KERNEL__ |
178 | #include <linux/compiler.h> | 178 | #include <linux/compiler.h> |
179 | 179 | ||
180 | /* Allow architectures to override entries in serial8250_ports[] at run time: */ | ||
181 | struct uart_port; /* forward declaration */ | ||
182 | extern int early_serial_setup(struct uart_port *port); | ||
183 | extern int early_serial_console_init(char *options); | ||
184 | extern int serial8250_start_console(struct uart_port *port, char *options); | ||
185 | |||
186 | #endif /* __KERNEL__ */ | 180 | #endif /* __KERNEL__ */ |
187 | #endif /* _LINUX_SERIAL_H */ | 181 | #endif /* _LINUX_SERIAL_H */ |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 71310d80c09a..8518fa2a6f89 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -60,4 +60,10 @@ void serial8250_unregister_port(int line); | |||
60 | void serial8250_suspend_port(int line); | 60 | void serial8250_suspend_port(int line); |
61 | void serial8250_resume_port(int line); | 61 | void serial8250_resume_port(int line); |
62 | 62 | ||
63 | extern int early_serial_setup(struct uart_port *port); | ||
64 | |||
65 | extern int serial8250_find_port(struct uart_port *p); | ||
66 | extern int serial8250_find_port_for_earlycon(void); | ||
67 | extern int setup_early_serial8250_console(char *cmdline); | ||
68 | |||
63 | #endif | 69 | #endif |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 7f2c99d66e9d..773d8d8828ad 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 |
@@ -142,6 +143,9 @@ | |||
142 | /* Micrel KS8695 */ | 143 | /* Micrel KS8695 */ |
143 | #define PORT_KS8695 76 | 144 | #define PORT_KS8695 76 |
144 | 145 | ||
146 | /* Broadcom SB1250, etc. SOC */ | ||
147 | #define PORT_SB1250_DUART 77 | ||
148 | |||
145 | 149 | ||
146 | #ifdef __KERNEL__ | 150 | #ifdef __KERNEL__ |
147 | 151 | ||
diff --git a/include/linux/serio.h b/include/linux/serio.h index 1ebf0455e224..9f3825014674 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -209,5 +209,7 @@ static inline void serio_unpin_driver(struct serio *serio) | |||
209 | #define SERIO_PENMOUNT 0x31 | 209 | #define SERIO_PENMOUNT 0x31 |
210 | #define SERIO_TOUCHRIGHT 0x32 | 210 | #define SERIO_TOUCHRIGHT 0x32 |
211 | #define SERIO_TOUCHWIN 0x33 | 211 | #define SERIO_TOUCHWIN 0x33 |
212 | #define SERIO_TAOSEVM 0x34 | ||
213 | #define SERIO_FUJITSU 0x35 | ||
212 | 214 | ||
213 | #endif | 215 | #endif |
diff --git a/include/linux/signal.h b/include/linux/signal.h index 9a5eac508e5e..0ae338866240 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -6,7 +6,6 @@ | |||
6 | 6 | ||
7 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
9 | #include <linux/spinlock.h> | ||
10 | 9 | ||
11 | /* | 10 | /* |
12 | * Real Time signals may be queued. | 11 | * Real Time signals may be queued. |
@@ -238,12 +237,15 @@ extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct | |||
238 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | 237 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); |
239 | extern long do_sigpending(void __user *, unsigned long); | 238 | extern long do_sigpending(void __user *, unsigned long); |
240 | extern int sigprocmask(int, sigset_t *, sigset_t *); | 239 | extern int sigprocmask(int, sigset_t *, sigset_t *); |
240 | extern int show_unhandled_signals; | ||
241 | 241 | ||
242 | struct pt_regs; | 242 | struct pt_regs; |
243 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 243 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
244 | 244 | ||
245 | extern struct kmem_cache *sighand_cachep; | 245 | extern struct kmem_cache *sighand_cachep; |
246 | 246 | ||
247 | int unhandled_signal(struct task_struct *tsk, int sig); | ||
248 | |||
247 | /* | 249 | /* |
248 | * 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) |
249 | * 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 6f0b2f7d0010..ce256438e619 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -65,13 +65,20 @@ | |||
65 | * is able to produce some skb->csum, it MUST use COMPLETE, | 65 | * is able to produce some skb->csum, it MUST use COMPLETE, |
66 | * not UNNECESSARY. | 66 | * not UNNECESSARY. |
67 | * | 67 | * |
68 | * PARTIAL: identical to the case for output below. This may occur | ||
69 | * on a packet received directly from another Linux OS, e.g., | ||
70 | * a virtualised Linux kernel on the same host. The packet can | ||
71 | * be treated in the same way as UNNECESSARY except that on | ||
72 | * output (i.e., forwarding) the checksum must be filled in | ||
73 | * by the OS or the hardware. | ||
74 | * | ||
68 | * B. Checksumming on output. | 75 | * B. Checksumming on output. |
69 | * | 76 | * |
70 | * NONE: skb is checksummed by protocol or csum is not required. | 77 | * NONE: skb is checksummed by protocol or csum is not required. |
71 | * | 78 | * |
72 | * PARTIAL: device is required to csum packet as seen by hard_start_xmit | 79 | * PARTIAL: device is required to csum packet as seen by hard_start_xmit |
73 | * from skb->transport_header to the end and to record the checksum | 80 | * from skb->csum_start to the end and to record the checksum |
74 | * at skb->transport_header + skb->csum. | 81 | * at skb->csum_start + skb->csum_offset. |
75 | * | 82 | * |
76 | * Device must show its capabilities in dev->features, set | 83 | * Device must show its capabilities in dev->features, set |
77 | * at device setup time. | 84 | * at device setup time. |
@@ -82,6 +89,7 @@ | |||
82 | * TCP/UDP over IPv4. Sigh. Vendors like this | 89 | * TCP/UDP over IPv4. Sigh. Vendors like this |
83 | * way by an unknown reason. Though, see comment above | 90 | * way by an unknown reason. Though, see comment above |
84 | * about CHECKSUM_UNNECESSARY. 8) | 91 | * about CHECKSUM_UNNECESSARY. 8) |
92 | * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead. | ||
85 | * | 93 | * |
86 | * Any questions? No questions, good. --ANK | 94 | * Any questions? No questions, good. --ANK |
87 | */ | 95 | */ |
@@ -147,8 +155,8 @@ struct skb_shared_info { | |||
147 | 155 | ||
148 | /* We divide dataref into two halves. The higher 16 bits hold references | 156 | /* We divide dataref into two halves. The higher 16 bits hold references |
149 | * to the payload part of skb->data. The lower 16 bits hold references to | 157 | * to the payload part of skb->data. The lower 16 bits hold references to |
150 | * the entire skb->data. It is up to the users of the skb to agree on | 158 | * the entire skb->data. A clone of a headerless skb holds the length of |
151 | * where the payload starts. | 159 | * the header in skb->hdr_len. |
152 | * | 160 | * |
153 | * All users must obey the rule that the skb->data reference count must be | 161 | * All users must obey the rule that the skb->data reference count must be |
154 | * greater than or equal to the payload reference count. | 162 | * greater than or equal to the payload reference count. |
@@ -196,7 +204,6 @@ typedef unsigned char *sk_buff_data_t; | |||
196 | * @sk: Socket we are owned by | 204 | * @sk: Socket we are owned by |
197 | * @tstamp: Time we arrived | 205 | * @tstamp: Time we arrived |
198 | * @dev: Device we arrived on/are leaving by | 206 | * @dev: Device we arrived on/are leaving by |
199 | * @iif: ifindex of device we arrived on | ||
200 | * @transport_header: Transport layer header | 207 | * @transport_header: Transport layer header |
201 | * @network_header: Network layer header | 208 | * @network_header: Network layer header |
202 | * @mac_header: Link layer header | 209 | * @mac_header: Link layer header |
@@ -206,6 +213,7 @@ typedef unsigned char *sk_buff_data_t; | |||
206 | * @len: Length of actual data | 213 | * @len: Length of actual data |
207 | * @data_len: Data length | 214 | * @data_len: Data length |
208 | * @mac_len: Length of link layer header | 215 | * @mac_len: Length of link layer header |
216 | * @hdr_len: writable header length of cloned skb | ||
209 | * @csum: Checksum (must include start/offset pair) | 217 | * @csum: Checksum (must include start/offset pair) |
210 | * @csum_start: Offset from skb->head where checksumming should start | 218 | * @csum_start: Offset from skb->head where checksumming should start |
211 | * @csum_offset: Offset from csum_start where checksum should be stored | 219 | * @csum_offset: Offset from csum_start where checksum should be stored |
@@ -227,9 +235,12 @@ typedef unsigned char *sk_buff_data_t; | |||
227 | * @mark: Generic packet mark | 235 | * @mark: Generic packet mark |
228 | * @nfct: Associated connection, if any | 236 | * @nfct: Associated connection, if any |
229 | * @ipvs_property: skbuff is owned by ipvs | 237 | * @ipvs_property: skbuff is owned by ipvs |
238 | * @nf_trace: netfilter packet trace flag | ||
230 | * @nfctinfo: Relationship of this skb to the connection | 239 | * @nfctinfo: Relationship of this skb to the connection |
231 | * @nfct_reasm: netfilter conntrack re-assembly pointer | 240 | * @nfct_reasm: netfilter conntrack re-assembly pointer |
232 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 241 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
242 | * @iif: ifindex of device we arrived on | ||
243 | * @queue_mapping: Queue mapping for multiqueue devices | ||
233 | * @tc_index: Traffic control index | 244 | * @tc_index: Traffic control index |
234 | * @tc_verd: traffic control verdict | 245 | * @tc_verd: traffic control verdict |
235 | * @dma_cookie: a cookie to one of several possible DMA operations | 246 | * @dma_cookie: a cookie to one of several possible DMA operations |
@@ -245,8 +256,6 @@ struct sk_buff { | |||
245 | struct sock *sk; | 256 | struct sock *sk; |
246 | ktime_t tstamp; | 257 | ktime_t tstamp; |
247 | struct net_device *dev; | 258 | struct net_device *dev; |
248 | int iif; | ||
249 | /* 4 byte hole on 64 bit*/ | ||
250 | 259 | ||
251 | struct dst_entry *dst; | 260 | struct dst_entry *dst; |
252 | struct sec_path *sp; | 261 | struct sec_path *sp; |
@@ -260,8 +269,9 @@ struct sk_buff { | |||
260 | char cb[48]; | 269 | char cb[48]; |
261 | 270 | ||
262 | unsigned int len, | 271 | unsigned int len, |
263 | data_len, | 272 | data_len; |
264 | mac_len; | 273 | __u16 mac_len, |
274 | hdr_len; | ||
265 | union { | 275 | union { |
266 | __wsum csum; | 276 | __wsum csum; |
267 | struct { | 277 | struct { |
@@ -277,7 +287,8 @@ struct sk_buff { | |||
277 | nfctinfo:3; | 287 | nfctinfo:3; |
278 | __u8 pkt_type:3, | 288 | __u8 pkt_type:3, |
279 | fclone:2, | 289 | fclone:2, |
280 | ipvs_property:1; | 290 | ipvs_property:1, |
291 | nf_trace:1; | ||
281 | __be16 protocol; | 292 | __be16 protocol; |
282 | 293 | ||
283 | void (*destructor)(struct sk_buff *skb); | 294 | void (*destructor)(struct sk_buff *skb); |
@@ -288,12 +299,18 @@ struct sk_buff { | |||
288 | #ifdef CONFIG_BRIDGE_NETFILTER | 299 | #ifdef CONFIG_BRIDGE_NETFILTER |
289 | struct nf_bridge_info *nf_bridge; | 300 | struct nf_bridge_info *nf_bridge; |
290 | #endif | 301 | #endif |
302 | |||
303 | int iif; | ||
304 | __u16 queue_mapping; | ||
305 | |||
291 | #ifdef CONFIG_NET_SCHED | 306 | #ifdef CONFIG_NET_SCHED |
292 | __u16 tc_index; /* traffic control index */ | 307 | __u16 tc_index; /* traffic control index */ |
293 | #ifdef CONFIG_NET_CLS_ACT | 308 | #ifdef CONFIG_NET_CLS_ACT |
294 | __u16 tc_verd; /* traffic control verdict */ | 309 | __u16 tc_verd; /* traffic control verdict */ |
295 | #endif | 310 | #endif |
296 | #endif | 311 | #endif |
312 | /* 2 byte hole */ | ||
313 | |||
297 | #ifdef CONFIG_NET_DMA | 314 | #ifdef CONFIG_NET_DMA |
298 | dma_cookie_t dma_cookie; | 315 | dma_cookie_t dma_cookie; |
299 | #endif | 316 | #endif |
@@ -1322,6 +1339,20 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, | |||
1322 | } | 1339 | } |
1323 | 1340 | ||
1324 | /** | 1341 | /** |
1342 | * skb_clone_writable - is the header of a clone writable | ||
1343 | * @skb: buffer to check | ||
1344 | * @len: length up to which to write | ||
1345 | * | ||
1346 | * Returns true if modifying the header part of the cloned buffer | ||
1347 | * does not requires the data to be copied. | ||
1348 | */ | ||
1349 | static inline int skb_clone_writable(struct sk_buff *skb, int len) | ||
1350 | { | ||
1351 | return !skb_header_cloned(skb) && | ||
1352 | skb_headroom(skb) + len <= skb->hdr_len; | ||
1353 | } | ||
1354 | |||
1355 | /** | ||
1325 | * skb_cow - copy header of skb when it is required | 1356 | * skb_cow - copy header of skb when it is required |
1326 | * @skb: buffer to cow | 1357 | * @skb: buffer to cow |
1327 | * @headroom: needed headroom | 1358 | * @headroom: needed headroom |
@@ -1608,7 +1639,7 @@ static inline int skb_csum_unnecessary(const struct sk_buff *skb) | |||
1608 | * if skb->ip_summed is CHECKSUM_UNNECESSARY which indicates that the | 1639 | * if skb->ip_summed is CHECKSUM_UNNECESSARY which indicates that the |
1609 | * hardware has already verified the correctness of the checksum. | 1640 | * hardware has already verified the correctness of the checksum. |
1610 | */ | 1641 | */ |
1611 | static inline unsigned int skb_checksum_complete(struct sk_buff *skb) | 1642 | static inline __sum16 skb_checksum_complete(struct sk_buff *skb) |
1612 | { | 1643 | { |
1613 | return skb_csum_unnecessary(skb) ? | 1644 | return skb_csum_unnecessary(skb) ? |
1614 | 0 : __skb_checksum_complete(skb); | 1645 | 0 : __skb_checksum_complete(skb); |
@@ -1709,6 +1740,20 @@ static inline void skb_init_secmark(struct sk_buff *skb) | |||
1709 | { } | 1740 | { } |
1710 | #endif | 1741 | #endif |
1711 | 1742 | ||
1743 | static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping) | ||
1744 | { | ||
1745 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
1746 | skb->queue_mapping = queue_mapping; | ||
1747 | #endif | ||
1748 | } | ||
1749 | |||
1750 | static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from) | ||
1751 | { | ||
1752 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
1753 | to->queue_mapping = from->queue_mapping; | ||
1754 | #endif | ||
1755 | } | ||
1756 | |||
1712 | static inline int skb_is_gso(const struct sk_buff *skb) | 1757 | static inline int skb_is_gso(const struct sk_buff *skb) |
1713 | { | 1758 | { |
1714 | return skb_shinfo(skb)->gso_size; | 1759 | return skb_shinfo(skb)->gso_size; |
diff --git a/include/linux/slab.h b/include/linux/slab.h index cebcd3833c76..d859354b9e51 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -14,8 +14,6 @@ | |||
14 | #include <linux/gfp.h> | 14 | #include <linux/gfp.h> |
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | 16 | ||
17 | typedef struct kmem_cache kmem_cache_t __deprecated; | ||
18 | |||
19 | /* | 17 | /* |
20 | * Flags to pass to kmem_cache_create(). | 18 | * Flags to pass to kmem_cache_create(). |
21 | * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set. | 19 | * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set. |
@@ -33,6 +31,19 @@ typedef struct kmem_cache kmem_cache_t __deprecated; | |||
33 | #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ | 31 | #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ |
34 | 32 | ||
35 | /* | 33 | /* |
34 | * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. | ||
35 | * | ||
36 | * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault. | ||
37 | * | ||
38 | * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can. | ||
39 | * Both make kfree a no-op. | ||
40 | */ | ||
41 | #define ZERO_SIZE_PTR ((void *)16) | ||
42 | |||
43 | #define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \ | ||
44 | (unsigned long)ZERO_SIZE_PTR) | ||
45 | |||
46 | /* | ||
36 | * struct kmem_cache related prototypes | 47 | * struct kmem_cache related prototypes |
37 | */ | 48 | */ |
38 | void __init kmem_cache_init(void); | 49 | void __init kmem_cache_init(void); |
@@ -40,12 +51,9 @@ int slab_is_available(void); | |||
40 | 51 | ||
41 | struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, | 52 | struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, |
42 | unsigned long, | 53 | unsigned long, |
43 | void (*)(void *, struct kmem_cache *, unsigned long), | ||
44 | void (*)(void *, struct kmem_cache *, unsigned long)); | 54 | void (*)(void *, struct kmem_cache *, unsigned long)); |
45 | void kmem_cache_destroy(struct kmem_cache *); | 55 | void kmem_cache_destroy(struct kmem_cache *); |
46 | int kmem_cache_shrink(struct kmem_cache *); | 56 | int kmem_cache_shrink(struct kmem_cache *); |
47 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | ||
48 | void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | ||
49 | void kmem_cache_free(struct kmem_cache *, void *); | 57 | void kmem_cache_free(struct kmem_cache *, void *); |
50 | unsigned int kmem_cache_size(struct kmem_cache *); | 58 | unsigned int kmem_cache_size(struct kmem_cache *); |
51 | const char *kmem_cache_name(struct kmem_cache *); | 59 | const char *kmem_cache_name(struct kmem_cache *); |
@@ -61,17 +69,7 @@ int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); | |||
61 | */ | 69 | */ |
62 | #define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\ | 70 | #define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\ |
63 | sizeof(struct __struct), __alignof__(struct __struct),\ | 71 | sizeof(struct __struct), __alignof__(struct __struct),\ |
64 | (__flags), NULL, NULL) | 72 | (__flags), NULL) |
65 | |||
66 | #ifdef CONFIG_NUMA | ||
67 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | ||
68 | #else | ||
69 | static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | ||
70 | gfp_t flags, int node) | ||
71 | { | ||
72 | return kmem_cache_alloc(cachep, flags); | ||
73 | } | ||
74 | #endif | ||
75 | 73 | ||
76 | /* | 74 | /* |
77 | * The largest kmalloc size supported by the slab allocators is | 75 | * The largest kmalloc size supported by the slab allocators is |
@@ -91,59 +89,50 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | |||
91 | /* | 89 | /* |
92 | * Common kmalloc functions provided by all allocators | 90 | * Common kmalloc functions provided by all allocators |
93 | */ | 91 | */ |
94 | void *__kmalloc(size_t, gfp_t); | ||
95 | void *__kzalloc(size_t, gfp_t); | ||
96 | void * __must_check krealloc(const void *, size_t, gfp_t); | 92 | void * __must_check krealloc(const void *, size_t, gfp_t); |
97 | void kfree(const void *); | 93 | void kfree(const void *); |
98 | size_t ksize(const void *); | 94 | size_t ksize(const void *); |
99 | 95 | ||
100 | /** | ||
101 | * kcalloc - allocate memory for an array. The memory is set to zero. | ||
102 | * @n: number of elements. | ||
103 | * @size: element size. | ||
104 | * @flags: the type of memory to allocate. | ||
105 | */ | ||
106 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | ||
107 | { | ||
108 | if (n != 0 && size > ULONG_MAX / n) | ||
109 | return NULL; | ||
110 | return __kzalloc(n * size, flags); | ||
111 | } | ||
112 | |||
113 | /* | 96 | /* |
114 | * Allocator specific definitions. These are mainly used to establish optimized | 97 | * Allocator specific definitions. These are mainly used to establish optimized |
115 | * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by selecting | 98 | * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by |
116 | * the appropriate general cache at compile time. | 99 | * selecting the appropriate general cache at compile time. |
100 | * | ||
101 | * Allocators must define at least: | ||
102 | * | ||
103 | * kmem_cache_alloc() | ||
104 | * __kmalloc() | ||
105 | * kmalloc() | ||
106 | * | ||
107 | * Those wishing to support NUMA must also define: | ||
108 | * | ||
109 | * kmem_cache_alloc_node() | ||
110 | * kmalloc_node() | ||
111 | * | ||
112 | * See each allocator definition file for additional comments and | ||
113 | * implementation notes. | ||
117 | */ | 114 | */ |
118 | |||
119 | #if defined(CONFIG_SLAB) || defined(CONFIG_SLUB) | ||
120 | #ifdef CONFIG_SLUB | 115 | #ifdef CONFIG_SLUB |
121 | #include <linux/slub_def.h> | 116 | #include <linux/slub_def.h> |
117 | #elif defined(CONFIG_SLOB) | ||
118 | #include <linux/slob_def.h> | ||
122 | #else | 119 | #else |
123 | #include <linux/slab_def.h> | 120 | #include <linux/slab_def.h> |
124 | #endif /* !CONFIG_SLUB */ | 121 | #endif |
125 | #else | ||
126 | |||
127 | /* | ||
128 | * Fallback definitions for an allocator not wanting to provide | ||
129 | * its own optimized kmalloc definitions (like SLOB). | ||
130 | */ | ||
131 | 122 | ||
132 | /** | 123 | /** |
133 | * kmalloc - allocate memory | 124 | * kcalloc - allocate memory for an array. The memory is set to zero. |
134 | * @size: how many bytes of memory are required. | 125 | * @n: number of elements. |
126 | * @size: element size. | ||
135 | * @flags: the type of memory to allocate. | 127 | * @flags: the type of memory to allocate. |
136 | * | 128 | * |
137 | * kmalloc is the normal method of allocating memory | ||
138 | * in the kernel. | ||
139 | * | ||
140 | * The @flags argument may be one of: | 129 | * The @flags argument may be one of: |
141 | * | 130 | * |
142 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | 131 | * %GFP_USER - Allocate memory on behalf of user. May sleep. |
143 | * | 132 | * |
144 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | 133 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. |
145 | * | 134 | * |
146 | * %GFP_ATOMIC - Allocation will not sleep. | 135 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. |
147 | * For example, use this inside interrupt handlers. | 136 | * For example, use this inside interrupt handlers. |
148 | * | 137 | * |
149 | * %GFP_HIGHUSER - Allocate pages from high memory. | 138 | * %GFP_HIGHUSER - Allocate pages from high memory. |
@@ -152,18 +141,22 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
152 | * | 141 | * |
153 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | 142 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. |
154 | * | 143 | * |
144 | * %GFP_NOWAIT - Allocation will not sleep. | ||
145 | * | ||
146 | * %GFP_THISNODE - Allocate node-local memory only. | ||
147 | * | ||
148 | * %GFP_DMA - Allocation suitable for DMA. | ||
149 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
150 | * slab created with SLAB_DMA. | ||
151 | * | ||
155 | * Also it is possible to set different flags by OR'ing | 152 | * Also it is possible to set different flags by OR'ing |
156 | * in one or more of the following additional @flags: | 153 | * in one or more of the following additional @flags: |
157 | * | 154 | * |
158 | * %__GFP_COLD - Request cache-cold pages instead of | 155 | * %__GFP_COLD - Request cache-cold pages instead of |
159 | * trying to return cache-warm pages. | 156 | * trying to return cache-warm pages. |
160 | * | 157 | * |
161 | * %__GFP_DMA - Request memory from the DMA-capable zone. | ||
162 | * | ||
163 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | 158 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. |
164 | * | 159 | * |
165 | * %__GFP_HIGHMEM - Allocated memory may be from highmem. | ||
166 | * | ||
167 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | 160 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail |
168 | * (think twice before using). | 161 | * (think twice before using). |
169 | * | 162 | * |
@@ -173,24 +166,29 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
173 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | 166 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. |
174 | * | 167 | * |
175 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | 168 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. |
169 | * | ||
170 | * There are other flags available as well, but these are not intended | ||
171 | * for general use, and so are not documented here. For a full list of | ||
172 | * potential flags, always refer to linux/gfp.h. | ||
176 | */ | 173 | */ |
177 | static inline void *kmalloc(size_t size, gfp_t flags) | 174 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
178 | { | 175 | { |
179 | return __kmalloc(size, flags); | 176 | if (n != 0 && size > ULONG_MAX / n) |
177 | return NULL; | ||
178 | return __kmalloc(n * size, flags | __GFP_ZERO); | ||
180 | } | 179 | } |
181 | 180 | ||
181 | #if !defined(CONFIG_NUMA) && !defined(CONFIG_SLOB) | ||
182 | /** | 182 | /** |
183 | * kzalloc - allocate memory. The memory is set to zero. | 183 | * kmalloc_node - allocate memory from a specific node |
184 | * @size: how many bytes of memory are required. | 184 | * @size: how many bytes of memory are required. |
185 | * @flags: the type of memory to allocate (see kmalloc). | 185 | * @flags: the type of memory to allocate (see kcalloc). |
186 | * @node: node to allocate from. | ||
187 | * | ||
188 | * kmalloc() for non-local nodes, used to allocate from a specific node | ||
189 | * if available. Equivalent to kmalloc() in the non-NUMA single-node | ||
190 | * case. | ||
186 | */ | 191 | */ |
187 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
188 | { | ||
189 | return __kzalloc(size, flags); | ||
190 | } | ||
191 | #endif | ||
192 | |||
193 | #ifndef CONFIG_NUMA | ||
194 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 192 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
195 | { | 193 | { |
196 | return kmalloc(size, flags); | 194 | return kmalloc(size, flags); |
@@ -200,7 +198,15 @@ static inline void *__kmalloc_node(size_t size, gfp_t flags, int node) | |||
200 | { | 198 | { |
201 | return __kmalloc(size, flags); | 199 | return __kmalloc(size, flags); |
202 | } | 200 | } |
203 | #endif /* !CONFIG_NUMA */ | 201 | |
202 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | ||
203 | |||
204 | static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | ||
205 | gfp_t flags, int node) | ||
206 | { | ||
207 | return kmem_cache_alloc(cachep, flags); | ||
208 | } | ||
209 | #endif /* !CONFIG_NUMA && !CONFIG_SLOB */ | ||
204 | 210 | ||
205 | /* | 211 | /* |
206 | * kmalloc_track_caller is a special version of kmalloc that records the | 212 | * kmalloc_track_caller is a special version of kmalloc that records the |
@@ -245,6 +251,23 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); | |||
245 | 251 | ||
246 | #endif /* DEBUG_SLAB */ | 252 | #endif /* DEBUG_SLAB */ |
247 | 253 | ||
254 | /* | ||
255 | * Shortcuts | ||
256 | */ | ||
257 | static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags) | ||
258 | { | ||
259 | return kmem_cache_alloc(k, flags | __GFP_ZERO); | ||
260 | } | ||
261 | |||
262 | /** | ||
263 | * kzalloc - allocate memory. The memory is set to zero. | ||
264 | * @size: how many bytes of memory are required. | ||
265 | * @flags: the type of memory to allocate (see kmalloc). | ||
266 | */ | ||
267 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
268 | { | ||
269 | return kmalloc(size, flags | __GFP_ZERO); | ||
270 | } | ||
271 | |||
248 | #endif /* __KERNEL__ */ | 272 | #endif /* __KERNEL__ */ |
249 | #endif /* _LINUX_SLAB_H */ | 273 | #endif /* _LINUX_SLAB_H */ |
250 | |||
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 8d81a60518e4..32bdc2ffd715 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -25,10 +25,17 @@ struct cache_sizes { | |||
25 | }; | 25 | }; |
26 | extern struct cache_sizes malloc_sizes[]; | 26 | extern struct cache_sizes malloc_sizes[]; |
27 | 27 | ||
28 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | ||
29 | void *__kmalloc(size_t size, gfp_t flags); | ||
30 | |||
28 | static inline void *kmalloc(size_t size, gfp_t flags) | 31 | static inline void *kmalloc(size_t size, gfp_t flags) |
29 | { | 32 | { |
30 | if (__builtin_constant_p(size)) { | 33 | if (__builtin_constant_p(size)) { |
31 | int i = 0; | 34 | int i = 0; |
35 | |||
36 | if (!size) | ||
37 | return ZERO_SIZE_PTR; | ||
38 | |||
32 | #define CACHE(x) \ | 39 | #define CACHE(x) \ |
33 | if (size <= x) \ | 40 | if (size <= x) \ |
34 | goto found; \ | 41 | goto found; \ |
@@ -51,39 +58,18 @@ found: | |||
51 | return __kmalloc(size, flags); | 58 | return __kmalloc(size, flags); |
52 | } | 59 | } |
53 | 60 | ||
54 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
55 | { | ||
56 | if (__builtin_constant_p(size)) { | ||
57 | int i = 0; | ||
58 | #define CACHE(x) \ | ||
59 | if (size <= x) \ | ||
60 | goto found; \ | ||
61 | else \ | ||
62 | i++; | ||
63 | #include "kmalloc_sizes.h" | ||
64 | #undef CACHE | ||
65 | { | ||
66 | extern void __you_cannot_kzalloc_that_much(void); | ||
67 | __you_cannot_kzalloc_that_much(); | ||
68 | } | ||
69 | found: | ||
70 | #ifdef CONFIG_ZONE_DMA | ||
71 | if (flags & GFP_DMA) | ||
72 | return kmem_cache_zalloc(malloc_sizes[i].cs_dmacachep, | ||
73 | flags); | ||
74 | #endif | ||
75 | return kmem_cache_zalloc(malloc_sizes[i].cs_cachep, flags); | ||
76 | } | ||
77 | return __kzalloc(size, flags); | ||
78 | } | ||
79 | |||
80 | #ifdef CONFIG_NUMA | 61 | #ifdef CONFIG_NUMA |
81 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); | 62 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); |
63 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | ||
82 | 64 | ||
83 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 65 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
84 | { | 66 | { |
85 | if (__builtin_constant_p(size)) { | 67 | if (__builtin_constant_p(size)) { |
86 | int i = 0; | 68 | int i = 0; |
69 | |||
70 | if (!size) | ||
71 | return ZERO_SIZE_PTR; | ||
72 | |||
87 | #define CACHE(x) \ | 73 | #define CACHE(x) \ |
88 | if (size <= x) \ | 74 | if (size <= x) \ |
89 | goto found; \ | 75 | goto found; \ |
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h new file mode 100644 index 000000000000..59a3fa476ab9 --- /dev/null +++ b/include/linux/slob_def.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef __LINUX_SLOB_DEF_H | ||
2 | #define __LINUX_SLOB_DEF_H | ||
3 | |||
4 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | ||
5 | |||
6 | static inline void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags) | ||
7 | { | ||
8 | return kmem_cache_alloc_node(cachep, flags, -1); | ||
9 | } | ||
10 | |||
11 | void *__kmalloc_node(size_t size, gfp_t flags, int node); | ||
12 | |||
13 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | ||
14 | { | ||
15 | return __kmalloc_node(size, flags, node); | ||
16 | } | ||
17 | |||
18 | /** | ||
19 | * kmalloc - allocate memory | ||
20 | * @size: how many bytes of memory are required. | ||
21 | * @flags: the type of memory to allocate (see kcalloc). | ||
22 | * | ||
23 | * kmalloc is the normal method of allocating memory | ||
24 | * in the kernel. | ||
25 | */ | ||
26 | static inline void *kmalloc(size_t size, gfp_t flags) | ||
27 | { | ||
28 | return __kmalloc_node(size, flags, -1); | ||
29 | } | ||
30 | |||
31 | static inline void *__kmalloc(size_t size, gfp_t flags) | ||
32 | { | ||
33 | return kmalloc(size, flags); | ||
34 | } | ||
35 | |||
36 | #endif /* __LINUX_SLOB_DEF_H */ | ||
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 6207a3d8da71..124270df8734 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -16,7 +16,9 @@ struct kmem_cache_node { | |||
16 | unsigned long nr_partial; | 16 | unsigned long nr_partial; |
17 | atomic_long_t nr_slabs; | 17 | atomic_long_t nr_slabs; |
18 | struct list_head partial; | 18 | struct list_head partial; |
19 | #ifdef CONFIG_SLUB_DEBUG | ||
19 | struct list_head full; | 20 | struct list_head full; |
21 | #endif | ||
20 | }; | 22 | }; |
21 | 23 | ||
22 | /* | 24 | /* |
@@ -44,7 +46,9 @@ struct kmem_cache { | |||
44 | int align; /* Alignment */ | 46 | int align; /* Alignment */ |
45 | const char *name; /* Name (only for display!) */ | 47 | const char *name; /* Name (only for display!) */ |
46 | struct list_head list; /* List of slab caches */ | 48 | struct list_head list; /* List of slab caches */ |
49 | #ifdef CONFIG_SLUB_DEBUG | ||
47 | struct kobject kobj; /* For sysfs */ | 50 | struct kobject kobj; /* For sysfs */ |
51 | #endif | ||
48 | 52 | ||
49 | #ifdef CONFIG_NUMA | 53 | #ifdef CONFIG_NUMA |
50 | int defrag_ratio; | 54 | int defrag_ratio; |
@@ -156,20 +160,11 @@ static inline struct kmem_cache *kmalloc_slab(size_t size) | |||
156 | #define SLUB_DMA __GFP_DMA | 160 | #define SLUB_DMA __GFP_DMA |
157 | #else | 161 | #else |
158 | /* Disable DMA functionality */ | 162 | /* Disable DMA functionality */ |
159 | #define SLUB_DMA 0 | 163 | #define SLUB_DMA (__force gfp_t)0 |
160 | #endif | 164 | #endif |
161 | 165 | ||
162 | 166 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | |
163 | /* | 167 | void *__kmalloc(size_t size, gfp_t flags); |
164 | * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. | ||
165 | * | ||
166 | * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault. | ||
167 | * | ||
168 | * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can. | ||
169 | * Both make kfree a no-op. | ||
170 | */ | ||
171 | #define ZERO_SIZE_PTR ((void *)16) | ||
172 | |||
173 | 168 | ||
174 | static inline void *kmalloc(size_t size, gfp_t flags) | 169 | static inline void *kmalloc(size_t size, gfp_t flags) |
175 | { | 170 | { |
@@ -184,21 +179,9 @@ static inline void *kmalloc(size_t size, gfp_t flags) | |||
184 | return __kmalloc(size, flags); | 179 | return __kmalloc(size, flags); |
185 | } | 180 | } |
186 | 181 | ||
187 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
188 | { | ||
189 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | ||
190 | struct kmem_cache *s = kmalloc_slab(size); | ||
191 | |||
192 | if (!s) | ||
193 | return ZERO_SIZE_PTR; | ||
194 | |||
195 | return kmem_cache_zalloc(s, flags); | ||
196 | } else | ||
197 | return __kzalloc(size, flags); | ||
198 | } | ||
199 | |||
200 | #ifdef CONFIG_NUMA | 182 | #ifdef CONFIG_NUMA |
201 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); | 183 | void *__kmalloc_node(size_t size, gfp_t flags, int node); |
184 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | ||
202 | 185 | ||
203 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 186 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
204 | { | 187 | { |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 96ac21f8dd73..259a13c3bd98 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -99,11 +99,14 @@ static inline int up_smp_call_function(void) | |||
99 | static inline void smp_send_reschedule(int cpu) { } | 99 | static inline void smp_send_reschedule(int cpu) { } |
100 | #define num_booting_cpus() 1 | 100 | #define num_booting_cpus() 1 |
101 | #define smp_prepare_boot_cpu() do {} while (0) | 101 | #define smp_prepare_boot_cpu() do {} while (0) |
102 | static inline int smp_call_function_single(int cpuid, void (*func) (void *info), | 102 | #define smp_call_function_single(cpuid, func, info, retry, wait) \ |
103 | void *info, int retry, int wait) | 103 | ({ \ |
104 | { | 104 | WARN_ON(cpuid != 0); \ |
105 | return -EBUSY; | 105 | local_irq_disable(); \ |
106 | } | 106 | (func)(info); \ |
107 | local_irq_enable(); \ | ||
108 | 0; \ | ||
109 | }) | ||
107 | 110 | ||
108 | #endif /* !SMP */ | 111 | #endif /* !SMP */ |
109 | 112 | ||
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index cf715a40d833..58962c51dee1 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #ifdef CONFIG_LOCK_KERNEL | 4 | #ifdef CONFIG_LOCK_KERNEL |
5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
6 | #include <linux/spinlock.h> | ||
7 | 6 | ||
8 | #define kernel_locked() (current->lock_depth >= 0) | 7 | #define kernel_locked() (current->lock_depth >= 0) |
9 | 8 | ||
diff --git a/include/linux/socket.h b/include/linux/socket.h index 6e7c9483a6a6..f852e1afd65a 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -253,6 +253,9 @@ struct ucred { | |||
253 | 253 | ||
254 | #define MSG_EOF MSG_FIN | 254 | #define MSG_EOF MSG_FIN |
255 | 255 | ||
256 | #define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file | ||
257 | descriptor received through | ||
258 | SCM_RIGHTS */ | ||
256 | #if defined(CONFIG_COMPAT) | 259 | #if defined(CONFIG_COMPAT) |
257 | #define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */ | 260 | #define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */ |
258 | #else | 261 | #else |
@@ -287,6 +290,7 @@ struct ucred { | |||
287 | #define SOL_NETLINK 270 | 290 | #define SOL_NETLINK 270 |
288 | #define SOL_TIPC 271 | 291 | #define SOL_TIPC 271 |
289 | #define SOL_RXRPC 272 | 292 | #define SOL_RXRPC 272 |
293 | #define SOL_PPPOL2TP 273 | ||
290 | 294 | ||
291 | /* IPX options */ | 295 | /* IPX options */ |
292 | #define IPX_TYPE 1 | 296 | #define IPX_TYPE 1 |
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 34d4b075f7b8..40c7b5d993b9 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h | |||
@@ -153,8 +153,6 @@ | |||
153 | #define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */ | 153 | #define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */ |
154 | #define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */ | 154 | #define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */ |
155 | 155 | ||
156 | int sonypi_camera_command(int command, u8 value); | ||
157 | |||
158 | #endif /* __KERNEL__ */ | 156 | #endif /* __KERNEL__ */ |
159 | 157 | ||
160 | #endif /* _SONYPI_H_ */ | 158 | #endif /* _SONYPI_H_ */ |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 3387e44dfd13..334d31411629 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -16,6 +16,20 @@ struct ads7846_platform_data { | |||
16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ | 16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ |
17 | int keep_vref_on:1; /* set to keep vref on for differential | 17 | int keep_vref_on:1; /* set to keep vref on for differential |
18 | * measurements as well */ | 18 | * measurements as well */ |
19 | |||
20 | /* Settling time of the analog signals; a function of Vcc and the | ||
21 | * capacitance on the X/Y drivers. If set to non-zero, two samples | ||
22 | * are taken with settle_delay us apart, and the second one is used. | ||
23 | * ~150 uSec with 0.01uF caps. | ||
24 | */ | ||
25 | u16 settle_delay_usecs; | ||
26 | |||
27 | /* If set to non-zero, after samples are taken this delay is applied | ||
28 | * and penirq is rechecked, to help avoid false events. This value | ||
29 | * is affected by the material used to build the touch layer. | ||
30 | */ | ||
31 | u16 penirq_recheck_delay_usecs; | ||
32 | |||
19 | u16 x_plate_ohms; | 33 | u16 x_plate_ohms; |
20 | u16 y_plate_ohms; | 34 | u16 y_plate_ohms; |
21 | 35 | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 1be5ea059477..302b81d1d117 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -76,6 +76,7 @@ struct spi_device { | |||
76 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) | 76 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) |
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 | u8 bits_per_word; | 80 | u8 bits_per_word; |
80 | int irq; | 81 | int irq; |
81 | void *controller_state; | 82 | void *controller_state; |
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index 9dbca629dcfb..b8db32cea1de 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
@@ -26,6 +26,7 @@ struct spi_bitbang { | |||
26 | struct list_head queue; | 26 | struct list_head queue; |
27 | u8 busy; | 27 | u8 busy; |
28 | u8 use_dma; | 28 | u8 use_dma; |
29 | u8 flags; /* extra spi->mode support */ | ||
29 | 30 | ||
30 | struct spi_master *master; | 31 | struct spi_master *master; |
31 | 32 | ||
diff --git a/include/linux/spi/tle62x0.h b/include/linux/spi/tle62x0.h new file mode 100644 index 000000000000..60b59187e590 --- /dev/null +++ b/include/linux/spi/tle62x0.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * tle62x0.h - platform glue to Infineon TLE62x0 driver chips | ||
3 | * | ||
4 | * Copyright 2007 Simtec Electronics | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | struct tle62x0_pdata { | ||
22 | unsigned int init_state; | ||
23 | unsigned int gpio_count; | ||
24 | }; | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index a946176db638..c376f3b36c89 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -282,6 +282,13 @@ do { \ | |||
282 | 1 : ({ local_irq_restore(flags); 0; }); \ | 282 | 1 : ({ local_irq_restore(flags); 0; }); \ |
283 | }) | 283 | }) |
284 | 284 | ||
285 | #define write_trylock_irqsave(lock, flags) \ | ||
286 | ({ \ | ||
287 | local_irq_save(flags); \ | ||
288 | write_trylock(lock) ? \ | ||
289 | 1 : ({ local_irq_restore(flags); 0; }); \ | ||
290 | }) | ||
291 | |||
285 | /* | 292 | /* |
286 | * Locks two spinlocks l1 and l2. | 293 | * Locks two spinlocks l1 and l2. |
287 | * l1_first indicates if spinlock l1 should be taken first. | 294 | * l1_first indicates if spinlock l1 should be taken first. |
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 | |||
20 | typedef struct { | 20 | typedef 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 | ||
18 | typedef struct { | 17 | typedef 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 | ||
35 | typedef struct { | 31 | typedef 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); | |||
13 | extern void print_stack_trace(struct stack_trace *trace, int spaces); | 13 | extern 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 | ||
107 | extern char *kstrdup(const char *s, gfp_t gfp); | 107 | extern char *kstrdup(const char *s, gfp_t gfp); |
108 | extern char *kstrndup(const char *s, size_t len, gfp_t gfp); | ||
108 | extern void *kmemdup(const void *src, size_t len, gfp_t gfp); | 109 | extern void *kmemdup(const void *src, size_t len, gfp_t gfp); |
109 | 110 | ||
111 | extern char **argv_split(gfp_t gfp, const char *str, int *argcp); | ||
112 | extern void argv_free(char **argv); | ||
113 | |||
110 | #ifdef __cplusplus | 114 | #ifdef __cplusplus |
111 | } | 115 | } |
112 | #endif | 116 | #endif |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 534cdc7be58d..7a69ca3bebaf 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/sunrpc/xdr.h> | 16 | #include <linux/sunrpc/xdr.h> |
17 | 17 | ||
18 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
19 | #include <linux/rcupdate.h> | ||
19 | 20 | ||
20 | /* size of the nodename buffer */ | 21 | /* size of the nodename buffer */ |
21 | #define UNX_MAXNODENAME 32 | 22 | #define UNX_MAXNODENAME 32 |
@@ -30,22 +31,28 @@ struct auth_cred { | |||
30 | /* | 31 | /* |
31 | * Client user credentials | 32 | * Client user credentials |
32 | */ | 33 | */ |
34 | struct rpc_auth; | ||
35 | struct rpc_credops; | ||
33 | struct rpc_cred { | 36 | struct rpc_cred { |
34 | struct hlist_node cr_hash; /* hash chain */ | 37 | struct hlist_node cr_hash; /* hash chain */ |
35 | struct rpc_credops * cr_ops; | 38 | struct list_head cr_lru; /* lru garbage collection */ |
36 | unsigned long cr_expire; /* when to gc */ | 39 | struct rcu_head cr_rcu; |
37 | atomic_t cr_count; /* ref count */ | 40 | struct rpc_auth * cr_auth; |
38 | unsigned short cr_flags; /* various flags */ | 41 | const struct rpc_credops *cr_ops; |
39 | #ifdef RPC_DEBUG | 42 | #ifdef RPC_DEBUG |
40 | unsigned long cr_magic; /* 0x0f4aa4f0 */ | 43 | unsigned long cr_magic; /* 0x0f4aa4f0 */ |
41 | #endif | 44 | #endif |
45 | unsigned long cr_expire; /* when to gc */ | ||
46 | unsigned long cr_flags; /* various flags */ | ||
47 | atomic_t cr_count; /* ref count */ | ||
42 | 48 | ||
43 | uid_t cr_uid; | 49 | uid_t cr_uid; |
44 | 50 | ||
45 | /* per-flavor data */ | 51 | /* per-flavor data */ |
46 | }; | 52 | }; |
47 | #define RPCAUTH_CRED_NEW 0x0001 | 53 | #define RPCAUTH_CRED_NEW 0 |
48 | #define RPCAUTH_CRED_UPTODATE 0x0002 | 54 | #define RPCAUTH_CRED_UPTODATE 1 |
55 | #define RPCAUTH_CRED_HASHED 2 | ||
49 | 56 | ||
50 | #define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 | 57 | #define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 |
51 | 58 | ||
@@ -56,10 +63,10 @@ struct rpc_cred { | |||
56 | #define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1) | 63 | #define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1) |
57 | struct rpc_cred_cache { | 64 | struct rpc_cred_cache { |
58 | struct hlist_head hashtable[RPC_CREDCACHE_NR]; | 65 | struct hlist_head hashtable[RPC_CREDCACHE_NR]; |
59 | unsigned long nextgc; /* next garbage collection */ | 66 | spinlock_t lock; |
60 | unsigned long expire; /* cache expiry interval */ | ||
61 | }; | 67 | }; |
62 | 68 | ||
69 | struct rpc_authops; | ||
63 | struct rpc_auth { | 70 | struct rpc_auth { |
64 | unsigned int au_cslack; /* call cred size estimate */ | 71 | unsigned int au_cslack; /* call cred size estimate */ |
65 | /* guess at number of u32's auth adds before | 72 | /* guess at number of u32's auth adds before |
@@ -69,7 +76,7 @@ struct rpc_auth { | |||
69 | unsigned int au_verfsize; | 76 | unsigned int au_verfsize; |
70 | 77 | ||
71 | unsigned int au_flags; /* various flags */ | 78 | unsigned int au_flags; /* various flags */ |
72 | struct rpc_authops * au_ops; /* operations */ | 79 | const struct rpc_authops *au_ops; /* operations */ |
73 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may | 80 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may |
74 | * differ from the flavor in | 81 | * differ from the flavor in |
75 | * au_ops->au_flavor in gss | 82 | * au_ops->au_flavor in gss |
@@ -115,17 +122,19 @@ struct rpc_credops { | |||
115 | void *, __be32 *, void *); | 122 | void *, __be32 *, void *); |
116 | }; | 123 | }; |
117 | 124 | ||
118 | extern struct rpc_authops authunix_ops; | 125 | extern const struct rpc_authops authunix_ops; |
119 | extern struct rpc_authops authnull_ops; | 126 | extern const struct rpc_authops authnull_ops; |
120 | #ifdef CONFIG_SUNRPC_SECURE | 127 | |
121 | extern struct rpc_authops authdes_ops; | 128 | void __init rpc_init_authunix(void); |
122 | #endif | 129 | void __init rpcauth_init_module(void); |
130 | void __exit rpcauth_remove_module(void); | ||
123 | 131 | ||
124 | int rpcauth_register(struct rpc_authops *); | 132 | int rpcauth_register(const struct rpc_authops *); |
125 | int rpcauth_unregister(struct rpc_authops *); | 133 | int rpcauth_unregister(const struct rpc_authops *); |
126 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); | 134 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); |
127 | void rpcauth_destroy(struct rpc_auth *); | 135 | void rpcauth_release(struct rpc_auth *); |
128 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); | 136 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); |
137 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | ||
129 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); | 138 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); |
130 | struct rpc_cred * rpcauth_bindcred(struct rpc_task *); | 139 | struct rpc_cred * rpcauth_bindcred(struct rpc_task *); |
131 | void rpcauth_holdcred(struct rpc_task *); | 140 | void rpcauth_holdcred(struct rpc_task *); |
@@ -138,8 +147,9 @@ int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, | |||
138 | int rpcauth_refreshcred(struct rpc_task *); | 147 | int rpcauth_refreshcred(struct rpc_task *); |
139 | void rpcauth_invalcred(struct rpc_task *); | 148 | void rpcauth_invalcred(struct rpc_task *); |
140 | int rpcauth_uptodatecred(struct rpc_task *); | 149 | int rpcauth_uptodatecred(struct rpc_task *); |
141 | int rpcauth_init_credcache(struct rpc_auth *, unsigned long); | 150 | int rpcauth_init_credcache(struct rpc_auth *); |
142 | void rpcauth_free_credcache(struct rpc_auth *); | 151 | void rpcauth_destroy_credcache(struct rpc_auth *); |
152 | void rpcauth_clear_credcache(struct rpc_cred_cache *); | ||
143 | 153 | ||
144 | static inline | 154 | static inline |
145 | struct rpc_cred * get_rpccred(struct rpc_cred *cred) | 155 | struct rpc_cred * get_rpccred(struct rpc_cred *cred) |
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h index 2db2fbf34947..67658e17a375 100644 --- a/include/linux/sunrpc/auth_gss.h +++ b/include/linux/sunrpc/auth_gss.h | |||
@@ -75,6 +75,7 @@ struct gss_cl_ctx { | |||
75 | struct xdr_netobj gc_wire_ctx; | 75 | struct xdr_netobj gc_wire_ctx; |
76 | u32 gc_win; | 76 | u32 gc_win; |
77 | unsigned long gc_expiry; | 77 | unsigned long gc_expiry; |
78 | struct rcu_head gc_rcu; | ||
78 | }; | 79 | }; |
79 | 80 | ||
80 | struct gss_upcall_msg; | 81 | struct gss_upcall_msg; |
@@ -85,11 +86,6 @@ struct gss_cred { | |||
85 | struct gss_upcall_msg *gc_upcall; | 86 | struct gss_upcall_msg *gc_upcall; |
86 | }; | 87 | }; |
87 | 88 | ||
88 | #define gc_uid gc_base.cr_uid | ||
89 | #define gc_count gc_base.cr_count | ||
90 | #define gc_flags gc_base.cr_flags | ||
91 | #define gc_expire gc_base.cr_expire | ||
92 | |||
93 | #endif /* __KERNEL__ */ | 89 | #endif /* __KERNEL__ */ |
94 | #endif /* _LINUX_SUNRPC_AUTH_GSS_H */ | 90 | #endif /* _LINUX_SUNRPC_AUTH_GSS_H */ |
95 | 91 | ||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 66611423c8ee..c0d9d14983b3 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -24,8 +24,10 @@ struct rpc_inode; | |||
24 | * The high-level client handle | 24 | * The high-level client handle |
25 | */ | 25 | */ |
26 | struct rpc_clnt { | 26 | struct rpc_clnt { |
27 | atomic_t cl_count; /* Number of clones */ | 27 | struct kref cl_kref; /* Number of references */ |
28 | atomic_t cl_users; /* number of references */ | 28 | struct list_head cl_clients; /* Global list of clients */ |
29 | struct list_head cl_tasks; /* List of tasks */ | ||
30 | spinlock_t cl_lock; /* spinlock */ | ||
29 | struct rpc_xprt * cl_xprt; /* transport */ | 31 | struct rpc_xprt * cl_xprt; /* transport */ |
30 | struct rpc_procinfo * cl_procinfo; /* procedure info */ | 32 | struct rpc_procinfo * cl_procinfo; /* procedure info */ |
31 | u32 cl_prog, /* RPC program number */ | 33 | u32 cl_prog, /* RPC program number */ |
@@ -41,9 +43,7 @@ struct rpc_clnt { | |||
41 | unsigned int cl_softrtry : 1,/* soft timeouts */ | 43 | unsigned int cl_softrtry : 1,/* soft timeouts */ |
42 | cl_intr : 1,/* interruptible */ | 44 | cl_intr : 1,/* interruptible */ |
43 | cl_discrtry : 1,/* disconnect before retry */ | 45 | cl_discrtry : 1,/* disconnect before retry */ |
44 | cl_autobind : 1,/* use getport() */ | 46 | cl_autobind : 1;/* use getport() */ |
45 | cl_oneshot : 1,/* dispose after use */ | ||
46 | cl_dead : 1;/* abandoned */ | ||
47 | 47 | ||
48 | struct rpc_rtt * cl_rtt; /* RTO estimator data */ | 48 | struct rpc_rtt * cl_rtt; /* RTO estimator data */ |
49 | 49 | ||
@@ -98,6 +98,7 @@ struct rpc_create_args { | |||
98 | int protocol; | 98 | int protocol; |
99 | struct sockaddr *address; | 99 | struct sockaddr *address; |
100 | size_t addrsize; | 100 | size_t addrsize; |
101 | struct sockaddr *saddress; | ||
101 | struct rpc_timeout *timeout; | 102 | struct rpc_timeout *timeout; |
102 | char *servername; | 103 | char *servername; |
103 | struct rpc_program *program; | 104 | struct rpc_program *program; |
@@ -110,20 +111,20 @@ struct rpc_create_args { | |||
110 | #define RPC_CLNT_CREATE_HARDRTRY (1UL << 0) | 111 | #define RPC_CLNT_CREATE_HARDRTRY (1UL << 0) |
111 | #define RPC_CLNT_CREATE_INTR (1UL << 1) | 112 | #define RPC_CLNT_CREATE_INTR (1UL << 1) |
112 | #define RPC_CLNT_CREATE_AUTOBIND (1UL << 2) | 113 | #define RPC_CLNT_CREATE_AUTOBIND (1UL << 2) |
113 | #define RPC_CLNT_CREATE_ONESHOT (1UL << 3) | 114 | #define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3) |
114 | #define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 4) | 115 | #define RPC_CLNT_CREATE_NOPING (1UL << 4) |
115 | #define RPC_CLNT_CREATE_NOPING (1UL << 5) | 116 | #define RPC_CLNT_CREATE_DISCRTRY (1UL << 5) |
116 | #define RPC_CLNT_CREATE_DISCRTRY (1UL << 6) | ||
117 | 117 | ||
118 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | 118 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
119 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 119 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
120 | struct rpc_program *, int); | 120 | struct rpc_program *, int); |
121 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 121 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
122 | int rpc_shutdown_client(struct rpc_clnt *); | 122 | void rpc_shutdown_client(struct rpc_clnt *); |
123 | int rpc_destroy_client(struct rpc_clnt *); | ||
124 | void rpc_release_client(struct rpc_clnt *); | 123 | void rpc_release_client(struct rpc_clnt *); |
124 | |||
125 | int rpcb_register(u32, u32, int, unsigned short, int *); | 125 | int rpcb_register(u32, u32, int, unsigned short, int *); |
126 | void rpcb_getport(struct rpc_task *); | 126 | int rpcb_getport_sync(struct sockaddr_in *, __u32, __u32, int); |
127 | void rpcb_getport_async(struct rpc_task *); | ||
127 | 128 | ||
128 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); | 129 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); |
129 | 130 | ||
@@ -132,20 +133,16 @@ int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, | |||
132 | void *calldata); | 133 | void *calldata); |
133 | int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, | 134 | int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, |
134 | int flags); | 135 | int flags); |
136 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, | ||
137 | int flags); | ||
135 | void rpc_restart_call(struct rpc_task *); | 138 | void rpc_restart_call(struct rpc_task *); |
136 | void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset); | 139 | void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset); |
137 | void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); | 140 | void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); |
138 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 141 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
139 | size_t rpc_max_payload(struct rpc_clnt *); | 142 | size_t rpc_max_payload(struct rpc_clnt *); |
140 | void rpc_force_rebind(struct rpc_clnt *); | 143 | void rpc_force_rebind(struct rpc_clnt *); |
141 | int rpc_ping(struct rpc_clnt *clnt, int flags); | ||
142 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | 144 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
143 | char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 145 | char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
144 | 146 | ||
145 | /* | ||
146 | * Helper function for NFSroot support | ||
147 | */ | ||
148 | int rpcb_getport_external(struct sockaddr_in *, __u32, __u32, int); | ||
149 | |||
150 | #endif /* __KERNEL__ */ | 147 | #endif /* __KERNEL__ */ |
151 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 148 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 5eca9e442051..459c5fc11d51 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -58,6 +58,7 @@ u32 gss_unwrap( | |||
58 | u32 gss_delete_sec_context( | 58 | u32 gss_delete_sec_context( |
59 | struct gss_ctx **ctx_id); | 59 | struct gss_ctx **ctx_id); |
60 | 60 | ||
61 | u32 gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 service); | ||
61 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); | 62 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); |
62 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); | 63 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); |
63 | 64 | ||
@@ -77,7 +78,7 @@ struct gss_api_mech { | |||
77 | struct module *gm_owner; | 78 | struct module *gm_owner; |
78 | struct xdr_netobj gm_oid; | 79 | struct xdr_netobj gm_oid; |
79 | char *gm_name; | 80 | char *gm_name; |
80 | struct gss_api_ops *gm_ops; | 81 | const struct gss_api_ops *gm_ops; |
81 | /* pseudoflavors supported by this mechanism: */ | 82 | /* pseudoflavors supported by this mechanism: */ |
82 | int gm_pf_num; | 83 | int gm_pf_num; |
83 | struct pf_desc * gm_pfs; | 84 | struct pf_desc * gm_pfs; |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index ad293760f6eb..51b977a4ca20 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
@@ -23,9 +23,11 @@ struct rpc_inode { | |||
23 | void *private; | 23 | void *private; |
24 | struct list_head pipe; | 24 | struct list_head pipe; |
25 | struct list_head in_upcall; | 25 | struct list_head in_upcall; |
26 | struct list_head in_downcall; | ||
26 | int pipelen; | 27 | int pipelen; |
27 | int nreaders; | 28 | int nreaders; |
28 | int nwriters; | 29 | int nwriters; |
30 | int nkern_readwriters; | ||
29 | wait_queue_head_t waitq; | 31 | wait_queue_head_t waitq; |
30 | #define RPC_PIPE_WAIT_FOR_OPEN 1 | 32 | #define RPC_PIPE_WAIT_FOR_OPEN 1 |
31 | int flags; | 33 | int flags; |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 2047fb202a13..8ea077db0099 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -98,7 +98,6 @@ struct rpc_task { | |||
98 | unsigned short tk_pid; /* debugging aid */ | 98 | unsigned short tk_pid; /* debugging aid */ |
99 | #endif | 99 | #endif |
100 | }; | 100 | }; |
101 | #define tk_auth tk_client->cl_auth | ||
102 | #define tk_xprt tk_client->cl_xprt | 101 | #define tk_xprt tk_client->cl_xprt |
103 | 102 | ||
104 | /* support walking a list of tasks on a wait queue */ | 103 | /* support walking a list of tasks on a wait queue */ |
@@ -110,11 +109,6 @@ struct rpc_task { | |||
110 | if (!list_empty(head) && \ | 109 | if (!list_empty(head) && \ |
111 | ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1)) | 110 | ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1)) |
112 | 111 | ||
113 | /* .. and walking list of all tasks */ | ||
114 | #define alltask_for_each(task, pos, head) \ | ||
115 | list_for_each(pos, head) \ | ||
116 | if ((task=list_entry(pos, struct rpc_task, tk_task)),1) | ||
117 | |||
118 | typedef void (*rpc_action)(struct rpc_task *); | 112 | typedef void (*rpc_action)(struct rpc_task *); |
119 | 113 | ||
120 | struct rpc_call_ops { | 114 | struct rpc_call_ops { |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 129d50f2225c..8531a70da73d 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -212,6 +212,7 @@ struct svc_rqst { | |||
212 | struct svc_pool * rq_pool; /* thread pool */ | 212 | struct svc_pool * rq_pool; /* thread pool */ |
213 | struct svc_procedure * rq_procinfo; /* procedure info */ | 213 | struct svc_procedure * rq_procinfo; /* procedure info */ |
214 | struct auth_ops * rq_authop; /* authentication flavour */ | 214 | struct auth_ops * rq_authop; /* authentication flavour */ |
215 | u32 rq_flavor; /* pseudoflavor */ | ||
215 | struct svc_cred rq_cred; /* auth info */ | 216 | struct svc_cred rq_cred; /* auth info */ |
216 | struct sk_buff * rq_skbuff; /* fast recv inet buffer */ | 217 | struct sk_buff * rq_skbuff; /* fast recv inet buffer */ |
217 | struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ | 218 | struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ |
@@ -248,6 +249,7 @@ struct svc_rqst { | |||
248 | */ | 249 | */ |
249 | /* Catering to nfsd */ | 250 | /* Catering to nfsd */ |
250 | struct auth_domain * rq_client; /* RPC peer info */ | 251 | struct auth_domain * rq_client; /* RPC peer info */ |
252 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ | ||
251 | struct svc_cacherep * rq_cacherep; /* cache info */ | 253 | struct svc_cacherep * rq_cacherep; /* cache info */ |
252 | struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to | 254 | struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to |
253 | * determine what device number | 255 | * determine what device number |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index de92619b0826..22e1ef8e200e 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -127,6 +127,7 @@ extern struct auth_domain *auth_unix_lookup(struct in_addr addr); | |||
127 | extern int auth_unix_forget_old(struct auth_domain *dom); | 127 | extern int auth_unix_forget_old(struct auth_domain *dom); |
128 | extern void svcauth_unix_purge(void); | 128 | extern void svcauth_unix_purge(void); |
129 | extern void svcauth_unix_info_release(void *); | 129 | extern void svcauth_unix_info_release(void *); |
130 | extern int svcauth_unix_set_client(struct svc_rqst *rqstp); | ||
130 | 131 | ||
131 | static inline unsigned long hash_str(char *name, int bits) | 132 | static inline unsigned long hash_str(char *name, int bits) |
132 | { | 133 | { |
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h index 5a5db16ab660..417a1def56db 100644 --- a/include/linux/sunrpc/svcauth_gss.h +++ b/include/linux/sunrpc/svcauth_gss.h | |||
@@ -22,6 +22,7 @@ | |||
22 | int gss_svc_init(void); | 22 | int gss_svc_init(void); |
23 | void gss_svc_shutdown(void); | 23 | void gss_svc_shutdown(void); |
24 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); | 24 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); |
25 | u32 svcauth_gss_flavor(struct auth_domain *dom); | ||
25 | 26 | ||
26 | #endif /* __KERNEL__ */ | 27 | #endif /* __KERNEL__ */ |
27 | #endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */ | 28 | #endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */ |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index e21dd93ac4b7..a53e0fa855d2 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -59,6 +59,7 @@ struct svc_sock { | |||
59 | /* cache of various info for TCP sockets */ | 59 | /* cache of various info for TCP sockets */ |
60 | void *sk_info_authunix; | 60 | void *sk_info_authunix; |
61 | 61 | ||
62 | struct sockaddr_storage sk_local; /* local address */ | ||
62 | struct sockaddr_storage sk_remote; /* remote peer's address */ | 63 | struct sockaddr_storage sk_remote; /* remote peer's address */ |
63 | int sk_remotelen; /* length of address */ | 64 | int sk_remotelen; /* length of address */ |
64 | }; | 65 | }; |
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 { | |||
36 | typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); | 37 | typedef 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 | */ | ||
44 | static 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/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 34f7590506fa..d11cedd14f0f 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/sunrpc/xdr.h> | 17 | #include <linux/sunrpc/xdr.h> |
18 | #include <linux/sunrpc/msg_prot.h> | 18 | #include <linux/sunrpc/msg_prot.h> |
19 | 19 | ||
20 | #ifdef __KERNEL__ | ||
21 | |||
20 | extern unsigned int xprt_udp_slot_table_entries; | 22 | extern unsigned int xprt_udp_slot_table_entries; |
21 | extern unsigned int xprt_tcp_slot_table_entries; | 23 | extern unsigned int xprt_tcp_slot_table_entries; |
22 | 24 | ||
@@ -194,7 +196,13 @@ struct rpc_xprt { | |||
194 | char * address_strings[RPC_DISPLAY_MAX]; | 196 | char * address_strings[RPC_DISPLAY_MAX]; |
195 | }; | 197 | }; |
196 | 198 | ||
197 | #ifdef __KERNEL__ | 199 | struct rpc_xprtsock_create { |
200 | int proto; /* IPPROTO_UDP or IPPROTO_TCP */ | ||
201 | struct sockaddr * srcaddr; /* optional local address */ | ||
202 | struct sockaddr * dstaddr; /* remote peer address */ | ||
203 | size_t addrlen; | ||
204 | struct rpc_timeout * timeout; /* optional timeout parameters */ | ||
205 | }; | ||
198 | 206 | ||
199 | /* | 207 | /* |
200 | * Transport operations used by ULPs | 208 | * Transport operations used by ULPs |
@@ -204,7 +212,7 @@ void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long | |||
204 | /* | 212 | /* |
205 | * Generic internal transport functions | 213 | * Generic internal transport functions |
206 | */ | 214 | */ |
207 | struct rpc_xprt * xprt_create_transport(int proto, struct sockaddr *addr, size_t size, struct rpc_timeout *toparms); | 215 | struct rpc_xprt * xprt_create_transport(struct rpc_xprtsock_create *args); |
208 | void xprt_connect(struct rpc_task *task); | 216 | void xprt_connect(struct rpc_task *task); |
209 | void xprt_reserve(struct rpc_task *task); | 217 | void xprt_reserve(struct rpc_task *task); |
210 | int xprt_reserve_xprt(struct rpc_task *task); | 218 | int xprt_reserve_xprt(struct rpc_task *task); |
@@ -242,8 +250,8 @@ void xprt_disconnect(struct rpc_xprt *xprt); | |||
242 | /* | 250 | /* |
243 | * Socket transport setup operations | 251 | * Socket transport setup operations |
244 | */ | 252 | */ |
245 | struct rpc_xprt * xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); | 253 | struct rpc_xprt * xs_setup_udp(struct rpc_xprtsock_create *args); |
246 | struct rpc_xprt * xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); | 254 | struct rpc_xprt * xs_setup_tcp(struct rpc_xprtsock_create *args); |
247 | int init_socket_xprt(void); | 255 | int init_socket_xprt(void); |
248 | void cleanup_socket_xprt(void); | 256 | void cleanup_socket_xprt(void); |
249 | 257 | ||
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 9c7cb6430666..e8e6da394c92 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -43,14 +43,19 @@ 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 | */ |
47 | struct hibernation_ops { | 49 | struct 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_PM |
58 | #ifdef CONFIG_SOFTWARE_SUSPEND | ||
54 | /* kernel/power/snapshot.c */ | 59 | /* kernel/power/snapshot.c */ |
55 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); | 60 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); |
56 | static inline void register_nosave_region(unsigned long b, unsigned long e) | 61 | static inline void register_nosave_region(unsigned long b, unsigned long e) |
@@ -68,16 +73,14 @@ extern unsigned long get_safe_page(gfp_t gfp_mask); | |||
68 | 73 | ||
69 | extern void hibernation_set_ops(struct hibernation_ops *ops); | 74 | extern void hibernation_set_ops(struct hibernation_ops *ops); |
70 | extern int hibernate(void); | 75 | extern int hibernate(void); |
71 | #else | 76 | #else /* CONFIG_SOFTWARE_SUSPEND */ |
72 | static inline void register_nosave_region(unsigned long b, unsigned long e) {} | ||
73 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) {} | ||
74 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | 77 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } |
75 | static inline void swsusp_set_page_free(struct page *p) {} | 78 | static inline void swsusp_set_page_free(struct page *p) {} |
76 | static inline void swsusp_unset_page_free(struct page *p) {} | 79 | static inline void swsusp_unset_page_free(struct page *p) {} |
77 | 80 | ||
78 | static inline void hibernation_set_ops(struct hibernation_ops *ops) {} | 81 | static inline void hibernation_set_ops(struct hibernation_ops *ops) {} |
79 | static inline int hibernate(void) { return -ENOSYS; } | 82 | static inline int hibernate(void) { return -ENOSYS; } |
80 | #endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ | 83 | #endif /* CONFIG_SOFTWARE_SUSPEND */ |
81 | 84 | ||
82 | void save_processor_state(void); | 85 | void save_processor_state(void); |
83 | void restore_processor_state(void); | 86 | void restore_processor_state(void); |
@@ -85,4 +88,43 @@ struct saved_context; | |||
85 | void __save_processor_state(struct saved_context *ctxt); | 88 | void __save_processor_state(struct saved_context *ctxt); |
86 | void __restore_processor_state(struct saved_context *ctxt); | 89 | void __restore_processor_state(struct saved_context *ctxt); |
87 | 90 | ||
91 | /* kernel/power/main.c */ | ||
92 | extern struct blocking_notifier_head pm_chain_head; | ||
93 | |||
94 | static inline int register_pm_notifier(struct notifier_block *nb) | ||
95 | { | ||
96 | return blocking_notifier_chain_register(&pm_chain_head, nb); | ||
97 | } | ||
98 | |||
99 | static 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 */ | ||
110 | |||
111 | static inline int register_pm_notifier(struct notifier_block *nb) | ||
112 | { | ||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | static 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 */ | ||
123 | |||
124 | #if !defined CONFIG_SOFTWARE_SUSPEND || !defined(CONFIG_PM) | ||
125 | static inline void register_nosave_region(unsigned long b, unsigned long e) | ||
126 | { | ||
127 | } | ||
128 | #endif | ||
129 | |||
88 | #endif /* _LINUX_SWSUSP_H */ | 130 | #endif /* _LINUX_SWSUSP_H */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 006868881346..665f85f2a3af 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -188,7 +188,8 @@ extern int rotate_reclaimable_page(struct page *page); | |||
188 | extern void swap_setup(void); | 188 | extern void swap_setup(void); |
189 | 189 | ||
190 | /* linux/mm/vmscan.c */ | 190 | /* linux/mm/vmscan.c */ |
191 | extern unsigned long try_to_free_pages(struct zone **, gfp_t); | 191 | extern unsigned long try_to_free_pages(struct zone **zones, int order, |
192 | gfp_t gfp_mask); | ||
192 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 193 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
193 | extern int vm_swappiness; | 194 | extern int vm_swappiness; |
194 | extern int remove_mapping(struct address_space *mapping, struct page *page); | 195 | extern int remove_mapping(struct address_space *mapping, struct page *page); |
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); | |||
549 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, | 549 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, |
550 | __u32 __user *ustatus); | 550 | __u32 __user *ustatus); |
551 | asmlinkage long sys_spu_create(const char __user *name, | 551 | asmlinkage 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 | ||
554 | asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode, | 554 | asmlinkage 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 | |||
610 | asmlinkage long sys_timerfd(int ufd, int clockid, int flags, | 610 | asmlinkage long sys_timerfd(int ufd, int clockid, int flags, |
611 | const struct itimerspec __user *utmr); | 611 | const struct itimerspec __user *utmr); |
612 | asmlinkage long sys_eventfd(unsigned int count); | 612 | asmlinkage long sys_eventfd(unsigned int count); |
613 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); | ||
613 | 614 | ||
614 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 615 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
615 | 616 | ||
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index e699ab279c2c..e285746588d6 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h | |||
@@ -101,8 +101,7 @@ struct sysdev_attribute { | |||
101 | 101 | ||
102 | #define _SYSDEV_ATTR(_name,_mode,_show,_store) \ | 102 | #define _SYSDEV_ATTR(_name,_mode,_show,_store) \ |
103 | { \ | 103 | { \ |
104 | .attr = { .name = __stringify(_name), .mode = _mode, \ | 104 | .attr = { .name = __stringify(_name), .mode = _mode }, \ |
105 | .owner = THIS_MODULE }, \ | ||
106 | .show = _show, \ | 105 | .show = _show, \ |
107 | .store = _store, \ | 106 | .store = _store, \ |
108 | } | 107 | } |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 7d5d1ec95c2e..be8228e50a27 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -19,10 +19,15 @@ struct kobject; | |||
19 | struct module; | 19 | struct module; |
20 | struct nameidata; | 20 | struct nameidata; |
21 | struct dentry; | 21 | struct dentry; |
22 | struct sysfs_dirent; | ||
22 | 23 | ||
24 | /* FIXME | ||
25 | * The *owner field is no longer used, but leave around | ||
26 | * until the tree gets cleaned up fully. | ||
27 | */ | ||
23 | struct attribute { | 28 | struct attribute { |
24 | const char * name; | 29 | const char * name; |
25 | struct module * owner; | 30 | struct module * owner; |
26 | mode_t mode; | 31 | mode_t mode; |
27 | }; | 32 | }; |
28 | 33 | ||
@@ -39,14 +44,14 @@ struct attribute_group { | |||
39 | */ | 44 | */ |
40 | 45 | ||
41 | #define __ATTR(_name,_mode,_show,_store) { \ | 46 | #define __ATTR(_name,_mode,_show,_store) { \ |
42 | .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \ | 47 | .attr = {.name = __stringify(_name), .mode = _mode }, \ |
43 | .show = _show, \ | 48 | .show = _show, \ |
44 | .store = _store, \ | 49 | .store = _store, \ |
45 | } | 50 | } |
46 | 51 | ||
47 | #define __ATTR_RO(_name) { \ | 52 | #define __ATTR_RO(_name) { \ |
48 | .attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \ | 53 | .attr = { .name = __stringify(_name), .mode = 0444 }, \ |
49 | .show = _name##_show, \ | 54 | .show = _name##_show, \ |
50 | } | 55 | } |
51 | 56 | ||
52 | #define __ATTR_NULL { .attr = { .name = NULL } } | 57 | #define __ATTR_NULL { .attr = { .name = NULL } } |
@@ -59,8 +64,10 @@ struct bin_attribute { | |||
59 | struct attribute attr; | 64 | struct attribute attr; |
60 | size_t size; | 65 | size_t size; |
61 | void *private; | 66 | void *private; |
62 | ssize_t (*read)(struct kobject *, char *, loff_t, size_t); | 67 | ssize_t (*read)(struct kobject *, struct bin_attribute *, |
63 | ssize_t (*write)(struct kobject *, char *, loff_t, size_t); | 68 | char *, loff_t, size_t); |
69 | ssize_t (*write)(struct kobject *, struct bin_attribute *, | ||
70 | char *, loff_t, size_t); | ||
64 | int (*mmap)(struct kobject *, struct bin_attribute *attr, | 71 | int (*mmap)(struct kobject *, struct bin_attribute *attr, |
65 | struct vm_area_struct *vma); | 72 | struct vm_area_struct *vma); |
66 | }; | 73 | }; |
@@ -70,12 +77,16 @@ struct sysfs_ops { | |||
70 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 77 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
71 | }; | 78 | }; |
72 | 79 | ||
80 | #define SYSFS_TYPE_MASK 0x00ff | ||
73 | #define SYSFS_ROOT 0x0001 | 81 | #define SYSFS_ROOT 0x0001 |
74 | #define SYSFS_DIR 0x0002 | 82 | #define SYSFS_DIR 0x0002 |
75 | #define SYSFS_KOBJ_ATTR 0x0004 | 83 | #define SYSFS_KOBJ_ATTR 0x0004 |
76 | #define SYSFS_KOBJ_BIN_ATTR 0x0008 | 84 | #define SYSFS_KOBJ_BIN_ATTR 0x0008 |
77 | #define SYSFS_KOBJ_LINK 0x0020 | 85 | #define SYSFS_KOBJ_LINK 0x0020 |
78 | #define SYSFS_NOT_PINNED (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR | SYSFS_KOBJ_LINK) | 86 | #define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) |
87 | |||
88 | #define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK | ||
89 | #define SYSFS_FLAG_REMOVED 0x0100 | ||
79 | 90 | ||
80 | #ifdef CONFIG_SYSFS | 91 | #ifdef CONFIG_SYSFS |
81 | 92 | ||
@@ -83,13 +94,14 @@ extern int sysfs_schedule_callback(struct kobject *kobj, | |||
83 | void (*func)(void *), void *data, struct module *owner); | 94 | void (*func)(void *), void *data, struct module *owner); |
84 | 95 | ||
85 | extern int __must_check | 96 | extern int __must_check |
86 | sysfs_create_dir(struct kobject *, struct dentry *); | 97 | sysfs_create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent_sd); |
87 | 98 | ||
88 | extern void | 99 | extern void |
89 | sysfs_remove_dir(struct kobject *); | 100 | sysfs_remove_dir(struct kobject *); |
90 | 101 | ||
91 | extern int __must_check | 102 | extern int __must_check |
92 | sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name); | 103 | sysfs_rename_dir(struct kobject *kobj, struct sysfs_dirent *new_parent_sd, |
104 | const char *new_name); | ||
93 | 105 | ||
94 | extern int __must_check | 106 | extern int __must_check |
95 | sysfs_move_dir(struct kobject *, struct kobject *); | 107 | sysfs_move_dir(struct kobject *, struct kobject *); |
@@ -129,8 +141,8 @@ void sysfs_notify(struct kobject * k, char *dir, char *attr); | |||
129 | 141 | ||
130 | extern int sysfs_make_shadowed_dir(struct kobject *kobj, | 142 | extern int sysfs_make_shadowed_dir(struct kobject *kobj, |
131 | void * (*follow_link)(struct dentry *, struct nameidata *)); | 143 | void * (*follow_link)(struct dentry *, struct nameidata *)); |
132 | extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj); | 144 | extern struct sysfs_dirent *sysfs_create_shadow_dir(struct kobject *kobj); |
133 | extern void sysfs_remove_shadow_dir(struct dentry *dir); | 145 | extern void sysfs_remove_shadow_dir(struct sysfs_dirent *shadow_sd); |
134 | 146 | ||
135 | extern int __must_check sysfs_init(void); | 147 | extern int __must_check sysfs_init(void); |
136 | 148 | ||
@@ -142,7 +154,8 @@ static inline int sysfs_schedule_callback(struct kobject *kobj, | |||
142 | return -ENOSYS; | 154 | return -ENOSYS; |
143 | } | 155 | } |
144 | 156 | ||
145 | static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow) | 157 | static inline int sysfs_create_dir(struct kobject *kobj, |
158 | struct sysfs_dirent *shadow_parent_sd) | ||
146 | { | 159 | { |
147 | return 0; | 160 | return 0; |
148 | } | 161 | } |
@@ -152,9 +165,9 @@ static inline void sysfs_remove_dir(struct kobject * k) | |||
152 | ; | 165 | ; |
153 | } | 166 | } |
154 | 167 | ||
155 | static inline int sysfs_rename_dir(struct kobject * k, | 168 | static inline int sysfs_rename_dir(struct kobject *kobj, |
156 | struct dentry *new_parent, | 169 | struct sysfs_dirent *new_parent_sd, |
157 | const char *new_name) | 170 | const char *new_name) |
158 | { | 171 | { |
159 | return 0; | 172 | return 0; |
160 | } | 173 | } |
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index a46104a28f66..dce1ed204972 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h | |||
@@ -31,7 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | 33 | ||
34 | #define TASKSTATS_VERSION 4 | 34 | #define TASKSTATS_VERSION 5 |
35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN | 35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN |
36 | * in linux/sched.h */ | 36 | * in linux/sched.h */ |
37 | 37 | ||
@@ -149,6 +149,9 @@ struct taskstats { | |||
149 | __u64 read_bytes; /* bytes of read I/O */ | 149 | __u64 read_bytes; /* bytes of read I/O */ |
150 | __u64 write_bytes; /* bytes of write I/O */ | 150 | __u64 write_bytes; /* bytes of write I/O */ |
151 | __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */ | 151 | __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */ |
152 | |||
153 | __u64 nvcsw; /* voluntary_ctxt_switches */ | ||
154 | __u64 nivcsw; /* nonvoluntary_ctxt_switches */ | ||
152 | }; | 155 | }; |
153 | 156 | ||
154 | 157 | ||
diff --git a/include/linux/time.h b/include/linux/time.h index dda9be685ab6..e6aea5146e5d 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 | ||
@@ -36,7 +37,8 @@ struct timezone { | |||
36 | #define NSEC_PER_SEC 1000000000L | 37 | #define NSEC_PER_SEC 1000000000L |
37 | #define FSEC_PER_SEC 1000000000000000L | 38 | #define FSEC_PER_SEC 1000000000000000L |
38 | 39 | ||
39 | static inline int timespec_equal(struct timespec *a, struct timespec *b) | 40 | static inline int timespec_equal(const struct timespec *a, |
41 | const struct timespec *b) | ||
40 | { | 42 | { |
41 | return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); | 43 | return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); |
42 | } | 44 | } |
@@ -93,6 +95,8 @@ extern struct timespec wall_to_monotonic; | |||
93 | extern seqlock_t xtime_lock __attribute__((weak)); | 95 | extern seqlock_t xtime_lock __attribute__((weak)); |
94 | 96 | ||
95 | extern unsigned long read_persistent_clock(void); | 97 | extern unsigned long read_persistent_clock(void); |
98 | extern int update_persistent_clock(struct timespec now); | ||
99 | extern int no_sync_cmos_clock __read_mostly; | ||
96 | void timekeeping_init(void); | 100 | void timekeeping_init(void); |
97 | 101 | ||
98 | static inline unsigned long get_seconds(void) | 102 | static inline unsigned long get_seconds(void) |
@@ -116,6 +120,8 @@ extern int do_setitimer(int which, struct itimerval *value, | |||
116 | extern unsigned int alarm_setitimer(unsigned int seconds); | 120 | extern unsigned int alarm_setitimer(unsigned int seconds); |
117 | extern int do_getitimer(int which, struct itimerval *value); | 121 | extern int do_getitimer(int which, struct itimerval *value); |
118 | extern void getnstimeofday(struct timespec *tv); | 122 | extern void getnstimeofday(struct timespec *tv); |
123 | extern void getboottime(struct timespec *ts); | ||
124 | extern void monotonic_to_bootbased(struct timespec *ts); | ||
119 | 125 | ||
120 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 126 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
121 | extern int timekeeping_is_continuous(void); | 127 | extern int timekeeping_is_continuous(void); |
diff --git a/include/linux/timer.h b/include/linux/timer.h index c661710d3627..78cf899b4409 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/ktime.h> | 5 | #include <linux/ktime.h> |
6 | #include <linux/spinlock.h> | ||
7 | #include <linux/stddef.h> | 6 | #include <linux/stddef.h> |
8 | 7 | ||
9 | struct tvec_t_base_s; | 8 | struct tvec_t_base_s; |
@@ -91,16 +90,13 @@ extern unsigned long get_next_timer_interrupt(unsigned long now); | |||
91 | */ | 90 | */ |
92 | #ifdef CONFIG_TIMER_STATS | 91 | #ifdef CONFIG_TIMER_STATS |
93 | 92 | ||
93 | #define TIMER_STATS_FLAG_DEFERRABLE 0x1 | ||
94 | |||
94 | extern void init_timer_stats(void); | 95 | extern void init_timer_stats(void); |
95 | 96 | ||
96 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | 97 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, |
97 | void *timerf, char * comm); | 98 | void *timerf, char *comm, |
98 | 99 | unsigned int timer_flag); | |
99 | static inline void timer_stats_account_timer(struct timer_list *timer) | ||
100 | { | ||
101 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | ||
102 | timer->function, timer->start_comm); | ||
103 | } | ||
104 | 100 | ||
105 | extern void __timer_stats_timer_set_start_info(struct timer_list *timer, | 101 | extern void __timer_stats_timer_set_start_info(struct timer_list *timer, |
106 | void *addr); | 102 | void *addr); |
@@ -119,10 +115,6 @@ static inline void init_timer_stats(void) | |||
119 | { | 115 | { |
120 | } | 116 | } |
121 | 117 | ||
122 | static inline void timer_stats_account_timer(struct timer_list *timer) | ||
123 | { | ||
124 | } | ||
125 | |||
126 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) | 118 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) |
127 | { | 119 | { |
128 | } | 120 | } |
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 | |||
251 | struct 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 | |||
269 | extern void register_time_interpolator(struct time_interpolator *); | ||
270 | extern void unregister_time_interpolator(struct time_interpolator *); | ||
271 | extern void time_interpolator_reset(void); | ||
272 | extern unsigned long time_interpolator_get_offset(void); | ||
273 | extern void time_interpolator_update(long delta_nsec); | ||
274 | |||
275 | #else /* !CONFIG_TIME_INTERPOLATION */ | ||
276 | |||
277 | static inline void time_interpolator_reset(void) | ||
278 | { | ||
279 | } | ||
280 | |||
281 | static 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 da6c39b2d051..d0890a7e5bab 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -50,10 +50,10 @@ | |||
50 | for_each_online_node(node) \ | 50 | for_each_online_node(node) \ |
51 | if (nr_cpus_node(node)) | 51 | if (nr_cpus_node(node)) |
52 | 52 | ||
53 | #ifndef node_distance | ||
54 | /* Conform to ACPI 2.0 SLIT distance definitions */ | 53 | /* Conform to ACPI 2.0 SLIT distance definitions */ |
55 | #define LOCAL_DISTANCE 10 | 54 | #define LOCAL_DISTANCE 10 |
56 | #define REMOTE_DISTANCE 20 | 55 | #define REMOTE_DISTANCE 20 |
56 | #ifndef node_distance | ||
57 | #define node_distance(from,to) ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE) | 57 | #define node_distance(from,to) ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE) |
58 | #endif | 58 | #endif |
59 | #ifndef RECLAIM_DISTANCE | 59 | #ifndef RECLAIM_DISTANCE |
diff --git a/include/linux/tty.h b/include/linux/tty.h index bb4576085203..691a1748d9d2 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -178,6 +178,7 @@ struct tty_bufhead { | |||
178 | #define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) | 178 | #define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) |
179 | 179 | ||
180 | struct device; | 180 | struct device; |
181 | struct signal_struct; | ||
181 | /* | 182 | /* |
182 | * Where all of the state associated with a tty is kept while the tty | 183 | * Where all of the state associated with a tty is kept while the tty |
183 | * is open. Since the termios state should be kept even if the tty | 184 | * is open. Since the termios state should be kept even if the tty |
@@ -310,6 +311,7 @@ extern void tty_hangup(struct tty_struct * tty); | |||
310 | extern void tty_vhangup(struct tty_struct * tty); | 311 | extern void tty_vhangup(struct tty_struct * tty); |
311 | extern void tty_unhangup(struct file *filp); | 312 | extern void tty_unhangup(struct file *filp); |
312 | extern int tty_hung_up_p(struct file * filp); | 313 | extern int tty_hung_up_p(struct file * filp); |
314 | extern int is_tty(struct file *filp); | ||
313 | extern void do_SAK(struct tty_struct *tty); | 315 | extern void do_SAK(struct tty_struct *tty); |
314 | extern void __do_SAK(struct tty_struct *tty); | 316 | extern void __do_SAK(struct tty_struct *tty); |
315 | extern void disassociate_ctty(int priv); | 317 | extern void disassociate_ctty(int priv); |
@@ -338,9 +340,46 @@ extern struct tty_struct *get_current_tty(void); | |||
338 | 340 | ||
339 | extern struct mutex tty_mutex; | 341 | extern struct mutex tty_mutex; |
340 | 342 | ||
343 | extern void tty_write_unlock(struct tty_struct *tty); | ||
344 | extern int tty_write_lock(struct tty_struct *tty, int ndelay); | ||
345 | #define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) | ||
346 | |||
347 | |||
348 | |||
341 | /* n_tty.c */ | 349 | /* n_tty.c */ |
342 | extern struct tty_ldisc tty_ldisc_N_TTY; | 350 | extern struct tty_ldisc tty_ldisc_N_TTY; |
343 | 351 | ||
352 | /* tty_audit.c */ | ||
353 | #ifdef CONFIG_AUDIT | ||
354 | extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | ||
355 | size_t size); | ||
356 | extern void tty_audit_exit(void); | ||
357 | extern void tty_audit_fork(struct signal_struct *sig); | ||
358 | extern void tty_audit_push(struct tty_struct *tty); | ||
359 | extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid); | ||
360 | extern void tty_audit_opening(void); | ||
361 | #else | ||
362 | static inline void tty_audit_add_data(struct tty_struct *tty, | ||
363 | unsigned char *data, size_t size) | ||
364 | { | ||
365 | } | ||
366 | static inline void tty_audit_exit(void) | ||
367 | { | ||
368 | } | ||
369 | static inline void tty_audit_fork(struct signal_struct *sig) | ||
370 | { | ||
371 | } | ||
372 | static inline void tty_audit_push(struct tty_struct *tty) | ||
373 | { | ||
374 | } | ||
375 | static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid) | ||
376 | { | ||
377 | } | ||
378 | static inline void tty_audit_opening(void) | ||
379 | { | ||
380 | } | ||
381 | #endif | ||
382 | |||
344 | /* tty_ioctl.c */ | 383 | /* tty_ioctl.c */ |
345 | extern int n_tty_ioctl(struct tty_struct * tty, struct file * file, | 384 | extern int n_tty_ioctl(struct tty_struct * tty, struct file * file, |
346 | unsigned int cmd, unsigned long arg); | 385 | unsigned int cmd, unsigned long arg); |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 6de445c31a64..8ec703f462da 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -42,6 +42,7 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | |||
42 | /* UDP encapsulation types */ | 42 | /* UDP encapsulation types */ |
43 | #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ | 43 | #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ |
44 | #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ | 44 | #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ |
45 | #define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */ | ||
45 | 46 | ||
46 | #ifdef __KERNEL__ | 47 | #ifdef __KERNEL__ |
47 | #include <linux/types.h> | 48 | #include <linux/types.h> |
@@ -70,6 +71,11 @@ struct udp_sock { | |||
70 | #define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */ | 71 | #define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */ |
71 | #define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */ | 72 | #define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */ |
72 | __u8 pcflag; /* marks socket as UDP-Lite if > 0 */ | 73 | __u8 pcflag; /* marks socket as UDP-Lite if > 0 */ |
74 | __u8 unused[3]; | ||
75 | /* | ||
76 | * For encapsulation sockets. | ||
77 | */ | ||
78 | int (*encap_rcv)(struct sock *sk, struct sk_buff *skb); | ||
73 | }; | 79 | }; |
74 | 80 | ||
75 | static inline struct udp_sock *udp_sk(const struct sock *sk) | 81 | static inline struct udp_sock *udp_sk(const struct sock *sk) |
diff --git a/include/linux/uio.h b/include/linux/uio.h index 9af8bbcd8963..b7fe13883bdb 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
@@ -13,10 +13,6 @@ | |||
13 | * 2 of the License, or (at your option) any later version. | 13 | * 2 of the License, or (at your option) any later version. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | |||
17 | /* A word of warning: Our uio structure will clash with the C library one (which is now obsolete). Remove the C | ||
18 | library one from sys/uio.h if you have a very old library set */ | ||
19 | |||
20 | struct iovec | 16 | struct iovec |
21 | { | 17 | { |
22 | void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ | 18 | void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ |
@@ -38,11 +34,6 @@ struct kvec { | |||
38 | 34 | ||
39 | #define UIO_FASTIOV 8 | 35 | #define UIO_FASTIOV 8 |
40 | #define UIO_MAXIOV 1024 | 36 | #define UIO_MAXIOV 1024 |
41 | #if 0 | ||
42 | #define UIO_MAXIOV 16 /* Maximum iovec's in one operation | ||
43 | 16 matches BSD */ | ||
44 | /* Beg pardon: BSD has 1024 --ANK */ | ||
45 | #endif | ||
46 | 37 | ||
47 | /* | 38 | /* |
48 | * Total number of bytes covered by an iovec. | 39 | * Total number of bytes covered by an iovec. |
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 | */ | ||
29 | struct 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 | |||
39 | struct 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 | */ | ||
55 | struct 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 | |||
69 | extern int __must_check | ||
70 | __uio_register_device(struct module *owner, | ||
71 | struct device *parent, | ||
72 | struct uio_info *info); | ||
73 | static 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 | } | ||
78 | extern void uio_unregister_device(struct uio_info *info); | ||
79 | extern 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 56aa2ee21f1b..7a60946df3b6 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -146,6 +146,10 @@ struct usb_interface { | |||
146 | * active alternate setting */ | 146 | * active alternate setting */ |
147 | unsigned num_altsetting; /* number of alternate settings */ | 147 | unsigned num_altsetting; /* number of alternate settings */ |
148 | 148 | ||
149 | /* If there is an interface association descriptor then it will list | ||
150 | * the associated interfaces */ | ||
151 | struct usb_interface_assoc_descriptor *intf_assoc; | ||
152 | |||
149 | int minor; /* minor number this interface is | 153 | int minor; /* minor number this interface is |
150 | * bound to */ | 154 | * bound to */ |
151 | enum usb_interface_condition condition; /* state of binding */ | 155 | enum usb_interface_condition condition; /* state of binding */ |
@@ -175,6 +179,7 @@ void usb_put_intf(struct usb_interface *intf); | |||
175 | 179 | ||
176 | /* this maximum is arbitrary */ | 180 | /* this maximum is arbitrary */ |
177 | #define USB_MAXINTERFACES 32 | 181 | #define USB_MAXINTERFACES 32 |
182 | #define USB_MAXIADS USB_MAXINTERFACES/2 | ||
178 | 183 | ||
179 | /** | 184 | /** |
180 | * struct usb_interface_cache - long-term representation of a device interface | 185 | * struct usb_interface_cache - long-term representation of a device interface |
@@ -245,6 +250,11 @@ struct usb_host_config { | |||
245 | struct usb_config_descriptor desc; | 250 | struct usb_config_descriptor desc; |
246 | 251 | ||
247 | char *string; /* iConfiguration string, if present */ | 252 | char *string; /* iConfiguration string, if present */ |
253 | |||
254 | /* List of any Interface Association Descriptors in this | ||
255 | * configuration. */ | ||
256 | struct usb_interface_assoc_descriptor *intf_assoc[USB_MAXIADS]; | ||
257 | |||
248 | /* the interfaces associated with this configuration, | 258 | /* the interfaces associated with this configuration, |
249 | * stored in no particular order */ | 259 | * stored in no particular order */ |
250 | struct usb_interface *interface[USB_MAXINTERFACES]; | 260 | struct usb_interface *interface[USB_MAXINTERFACES]; |
@@ -403,6 +413,8 @@ struct usb_device { | |||
403 | 413 | ||
404 | unsigned auto_pm:1; /* autosuspend/resume in progress */ | 414 | unsigned auto_pm:1; /* autosuspend/resume in progress */ |
405 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ | 415 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ |
416 | unsigned reset_resume:1; /* needs reset instead of resume */ | ||
417 | unsigned persist_enabled:1; /* USB_PERSIST enabled for this dev */ | ||
406 | unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ | 418 | unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ |
407 | unsigned autoresume_disabled:1; /* disabled by the user */ | 419 | unsigned autoresume_disabled:1; /* disabled by the user */ |
408 | #endif | 420 | #endif |
@@ -770,6 +782,28 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
770 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \ | 782 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \ |
771 | .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) | 783 | .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) |
772 | 784 | ||
785 | /** | ||
786 | * USB_DEVICE_AND_INTERFACE_INFO - macro used to describe a specific usb device | ||
787 | * with a class of usb interfaces | ||
788 | * @vend: the 16 bit USB Vendor ID | ||
789 | * @prod: the 16 bit USB Product ID | ||
790 | * @cl: bInterfaceClass value | ||
791 | * @sc: bInterfaceSubClass value | ||
792 | * @pr: bInterfaceProtocol value | ||
793 | * | ||
794 | * This macro is used to create a struct usb_device_id that matches a | ||
795 | * specific device with a specific class of interfaces. | ||
796 | * | ||
797 | * This is especially useful when explicitly matching devices that have | ||
798 | * vendor specific bDeviceClass values, but standards-compliant interfaces. | ||
799 | */ | ||
800 | #define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \ | ||
801 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ | ||
802 | | USB_DEVICE_ID_MATCH_DEVICE, \ | ||
803 | .idVendor = (vend), .idProduct = (prod), \ | ||
804 | .bInterfaceClass = (cl), \ | ||
805 | .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) | ||
806 | |||
773 | /* ----------------------------------------------------------------------- */ | 807 | /* ----------------------------------------------------------------------- */ |
774 | 808 | ||
775 | /* Stuff for dynamic usb ids */ | 809 | /* Stuff for dynamic usb ids */ |
@@ -816,10 +850,15 @@ struct usbdrv_wrap { | |||
816 | * do (or don't) show up otherwise in the filesystem. | 850 | * do (or don't) show up otherwise in the filesystem. |
817 | * @suspend: Called when the device is going to be suspended by the system. | 851 | * @suspend: Called when the device is going to be suspended by the system. |
818 | * @resume: Called when the device is being resumed by the system. | 852 | * @resume: Called when the device is being resumed by the system. |
853 | * @reset_resume: Called when the suspended device has been reset instead | ||
854 | * of being resumed. | ||
819 | * @pre_reset: Called by usb_reset_composite_device() when the device | 855 | * @pre_reset: Called by usb_reset_composite_device() when the device |
820 | * is about to be reset. | 856 | * is about to be reset. |
821 | * @post_reset: Called by usb_reset_composite_device() after the device | 857 | * @post_reset: Called by usb_reset_composite_device() after the device |
822 | * has been reset. | 858 | * has been reset, or in lieu of @resume following a reset-resume |
859 | * (i.e., the device is reset instead of being resumed, as might | ||
860 | * happen if power was lost). The second argument tells which is | ||
861 | * the reason. | ||
823 | * @id_table: USB drivers use ID table to support hotplugging. | 862 | * @id_table: USB drivers use ID table to support hotplugging. |
824 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set | 863 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set |
825 | * or your driver's probe function will never get called. | 864 | * or your driver's probe function will never get called. |
@@ -859,9 +898,10 @@ struct usb_driver { | |||
859 | 898 | ||
860 | int (*suspend) (struct usb_interface *intf, pm_message_t message); | 899 | int (*suspend) (struct usb_interface *intf, pm_message_t message); |
861 | int (*resume) (struct usb_interface *intf); | 900 | int (*resume) (struct usb_interface *intf); |
901 | int (*reset_resume)(struct usb_interface *intf); | ||
862 | 902 | ||
863 | void (*pre_reset) (struct usb_interface *intf); | 903 | int (*pre_reset)(struct usb_interface *intf); |
864 | void (*post_reset) (struct usb_interface *intf); | 904 | int (*post_reset)(struct usb_interface *intf); |
865 | 905 | ||
866 | const struct usb_device_id *id_table; | 906 | const struct usb_device_id *id_table; |
867 | 907 | ||
@@ -964,6 +1004,7 @@ extern int usb_disabled(void); | |||
964 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ | 1004 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ |
965 | #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt | 1005 | #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt |
966 | * needed */ | 1006 | * needed */ |
1007 | #define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */ | ||
967 | 1008 | ||
968 | struct usb_iso_packet_descriptor { | 1009 | struct usb_iso_packet_descriptor { |
969 | unsigned int offset; | 1010 | unsigned int offset; |
@@ -974,11 +1015,26 @@ struct usb_iso_packet_descriptor { | |||
974 | 1015 | ||
975 | struct urb; | 1016 | struct urb; |
976 | 1017 | ||
1018 | struct usb_anchor { | ||
1019 | struct list_head urb_list; | ||
1020 | wait_queue_head_t wait; | ||
1021 | spinlock_t lock; | ||
1022 | }; | ||
1023 | |||
1024 | static inline void init_usb_anchor(struct usb_anchor *anchor) | ||
1025 | { | ||
1026 | INIT_LIST_HEAD(&anchor->urb_list); | ||
1027 | init_waitqueue_head(&anchor->wait); | ||
1028 | spin_lock_init(&anchor->lock); | ||
1029 | } | ||
1030 | |||
977 | typedef void (*usb_complete_t)(struct urb *); | 1031 | typedef void (*usb_complete_t)(struct urb *); |
978 | 1032 | ||
979 | /** | 1033 | /** |
980 | * struct urb - USB Request Block | 1034 | * struct urb - USB Request Block |
981 | * @urb_list: For use by current owner of the URB. | 1035 | * @urb_list: For use by current owner of the URB. |
1036 | * @anchor_list: membership in the list of an anchor | ||
1037 | * @anchor: to anchor URBs to a common mooring | ||
982 | * @pipe: Holds endpoint number, direction, type, and more. | 1038 | * @pipe: Holds endpoint number, direction, type, and more. |
983 | * Create these values with the eight macros available; | 1039 | * Create these values with the eight macros available; |
984 | * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl" | 1040 | * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl" |
@@ -1151,6 +1207,8 @@ struct urb | |||
1151 | /* public: documented fields in the urb that can be used by drivers */ | 1207 | /* public: documented fields in the urb that can be used by drivers */ |
1152 | struct list_head urb_list; /* list head for use by the urb's | 1208 | struct list_head urb_list; /* list head for use by the urb's |
1153 | * current owner */ | 1209 | * current owner */ |
1210 | struct list_head anchor_list; /* the URB may be anchored by the driver */ | ||
1211 | struct usb_anchor *anchor; | ||
1154 | struct usb_device *dev; /* (in) pointer to associated device */ | 1212 | struct usb_device *dev; /* (in) pointer to associated device */ |
1155 | unsigned int pipe; /* (in) pipe information */ | 1213 | unsigned int pipe; /* (in) pipe information */ |
1156 | int status; /* (return) non-ISO status */ | 1214 | int status; /* (return) non-ISO status */ |
@@ -1286,6 +1344,11 @@ extern struct urb *usb_get_urb(struct urb *urb); | |||
1286 | extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); | 1344 | extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); |
1287 | extern int usb_unlink_urb(struct urb *urb); | 1345 | extern int usb_unlink_urb(struct urb *urb); |
1288 | extern void usb_kill_urb(struct urb *urb); | 1346 | extern void usb_kill_urb(struct urb *urb); |
1347 | extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); | ||
1348 | extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); | ||
1349 | extern void usb_unanchor_urb(struct urb *urb); | ||
1350 | extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor, | ||
1351 | unsigned int timeout); | ||
1289 | 1352 | ||
1290 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, | 1353 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, |
1291 | gfp_t mem_flags, dma_addr_t *dma); | 1354 | gfp_t mem_flags, dma_addr_t *dma); |
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild index 43f160cfe003..6ce42bf9f743 100644 --- a/include/linux/usb/Kbuild +++ b/include/linux/usb/Kbuild | |||
@@ -1,5 +1,6 @@ | |||
1 | unifdef-y += audio.h | 1 | unifdef-y += audio.h |
2 | unifdef-y += cdc.h | 2 | unifdef-y += cdc.h |
3 | unifdef-y += ch9.h | 3 | unifdef-y += ch9.h |
4 | unifdef-y += gadgetfs.h | ||
4 | unifdef-y += midi.h | 5 | unifdef-y += midi.h |
5 | 6 | ||
diff --git a/include/linux/usb_gadgetfs.h b/include/linux/usb/gadgetfs.h index 8086d5a9b94e..e8654c338729 100644 --- a/include/linux/usb_gadgetfs.h +++ b/include/linux/usb/gadgetfs.h | |||
@@ -1,3 +1,5 @@ | |||
1 | #ifndef __LINUX_USB_GADGETFS_H | ||
2 | #define __LINUX_USB_GADGETFS_H | ||
1 | 3 | ||
2 | #include <asm/types.h> | 4 | #include <asm/types.h> |
3 | #include <asm/ioctl.h> | 5 | #include <asm/ioctl.h> |
@@ -7,11 +9,12 @@ | |||
7 | /* | 9 | /* |
8 | * Filesystem based user-mode API to USB Gadget controller hardware | 10 | * Filesystem based user-mode API to USB Gadget controller hardware |
9 | * | 11 | * |
10 | * Almost everything can be done with only read and write operations, | 12 | * Other than ep0 operations, most things are done by read() and write() |
11 | * on endpoint files found in one directory. They are configured by | 13 | * on endpoint files found in one directory. They are configured by |
12 | * writing descriptors, and then may be used for normal stream style | 14 | * writing descriptors, and then may be used for normal stream style |
13 | * i/o requests. When ep0 is configured, the device can enumerate; | 15 | * i/o requests. When ep0 is configured, the device can enumerate; |
14 | * when it's closed, the device disconnects from usb. | 16 | * when it's closed, the device disconnects from usb. Operations on |
17 | * ep0 require ioctl() operations. | ||
15 | * | 18 | * |
16 | * Configuration and device descriptors get written to /dev/gadget/$CHIP, | 19 | * Configuration and device descriptors get written to /dev/gadget/$CHIP, |
17 | * which may then be used to read usb_gadgetfs_event structs. The driver | 20 | * which may then be used to read usb_gadgetfs_event structs. The driver |
@@ -21,9 +24,9 @@ | |||
21 | */ | 24 | */ |
22 | 25 | ||
23 | /* | 26 | /* |
24 | * Events are delivered on the ep0 file descriptor, if the user mode driver | 27 | * Events are delivered on the ep0 file descriptor, when the user mode driver |
25 | * reads from this file descriptor after writing the descriptors. Don't | 28 | * reads from this file descriptor after writing the descriptors. Don't |
26 | * stop polling this descriptor, if you write that kind of driver. | 29 | * stop polling this descriptor. |
27 | */ | 30 | */ |
28 | 31 | ||
29 | enum usb_gadgetfs_event_type { | 32 | enum usb_gadgetfs_event_type { |
@@ -36,8 +39,10 @@ enum usb_gadgetfs_event_type { | |||
36 | // and likely more ! | 39 | // and likely more ! |
37 | }; | 40 | }; |
38 | 41 | ||
42 | /* NOTE: this structure must stay the same size and layout on | ||
43 | * both 32-bit and 64-bit kernels. | ||
44 | */ | ||
39 | struct usb_gadgetfs_event { | 45 | struct usb_gadgetfs_event { |
40 | enum usb_gadgetfs_event_type type; | ||
41 | union { | 46 | union { |
42 | // NOP, DISCONNECT, SUSPEND: nothing | 47 | // NOP, DISCONNECT, SUSPEND: nothing |
43 | // ... some hardware can't report disconnection | 48 | // ... some hardware can't report disconnection |
@@ -46,19 +51,20 @@ struct usb_gadgetfs_event { | |||
46 | enum usb_device_speed speed; | 51 | enum usb_device_speed speed; |
47 | 52 | ||
48 | // SETUP: packet; DATA phase i/o precedes next event | 53 | // SETUP: packet; DATA phase i/o precedes next event |
49 | // (setup.bmRequestType & USB_DIR_IN) flags direction | 54 | // (setup.bmRequestType & USB_DIR_IN) flags direction |
50 | // ... includes SET_CONFIGURATION, SET_INTERFACE | 55 | // ... includes SET_CONFIGURATION, SET_INTERFACE |
51 | struct usb_ctrlrequest setup; | 56 | struct usb_ctrlrequest setup; |
52 | } u; | 57 | } u; |
58 | enum usb_gadgetfs_event_type type; | ||
53 | }; | 59 | }; |
54 | 60 | ||
55 | 61 | ||
56 | /* endpoint ioctls */ | 62 | /* endpoint ioctls */ |
57 | 63 | ||
58 | /* IN transfers may be reported to the gadget driver as complete | 64 | /* IN transfers may be reported to the gadget driver as complete |
59 | * when the fifo is loaded, before the host reads the data; | 65 | * when the fifo is loaded, before the host reads the data; |
60 | * OUT transfers may be reported to the host's "client" driver as | 66 | * OUT transfers may be reported to the host's "client" driver as |
61 | * complete when they're sitting in the FIFO unread. | 67 | * complete when they're sitting in the FIFO unread. |
62 | * THIS returns how many bytes are "unclaimed" in the endpoint fifo | 68 | * THIS returns how many bytes are "unclaimed" in the endpoint fifo |
63 | * (needed for precise fault handling, when the hardware allows it) | 69 | * (needed for precise fault handling, when the hardware allows it) |
64 | */ | 70 | */ |
@@ -72,4 +78,4 @@ struct usb_gadgetfs_event { | |||
72 | */ | 78 | */ |
73 | #define GADGETFS_CLEAR_HALT _IO('g',3) | 79 | #define GADGETFS_CLEAR_HALT _IO('g',3) |
74 | 80 | ||
75 | 81 | #endif /* __LINUX_USB_GADGETFS_H */ | |
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 6bac8faacbc6..8da374caf582 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
@@ -9,3 +9,6 @@ | |||
9 | 9 | ||
10 | /* string descriptors must not be fetched using a 255-byte read */ | 10 | /* string descriptors must not be fetched using a 255-byte read */ |
11 | #define USB_QUIRK_STRING_FETCH_255 0x00000002 | 11 | #define USB_QUIRK_STRING_FETCH_255 0x00000002 |
12 | |||
13 | /* device can't resume correctly so reset it instead */ | ||
14 | #define USB_QUIRK_RESET_RESUME 0x00000004 | ||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 32acbae28d24..e8b8928232c8 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -221,6 +221,9 @@ struct usb_serial_driver { | |||
221 | int (*port_probe) (struct usb_serial_port *port); | 221 | int (*port_probe) (struct usb_serial_port *port); |
222 | int (*port_remove) (struct usb_serial_port *port); | 222 | int (*port_remove) (struct usb_serial_port *port); |
223 | 223 | ||
224 | int (*suspend) (struct usb_serial *serial, pm_message_t message); | ||
225 | int (*resume) (struct usb_serial *serial); | ||
226 | |||
224 | /* serial function calls */ | 227 | /* serial function calls */ |
225 | int (*open) (struct usb_serial_port *port, struct file * filp); | 228 | int (*open) (struct usb_serial_port *port, struct file * filp); |
226 | void (*close) (struct usb_serial_port *port, struct file * filp); | 229 | void (*close) (struct usb_serial_port *port, struct file * filp); |
@@ -249,6 +252,9 @@ extern void usb_serial_port_softint(struct usb_serial_port *port); | |||
249 | extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); | 252 | extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); |
250 | extern void usb_serial_disconnect(struct usb_interface *iface); | 253 | extern void usb_serial_disconnect(struct usb_interface *iface); |
251 | 254 | ||
255 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); | ||
256 | extern int usb_serial_resume(struct usb_interface *intf); | ||
257 | |||
252 | extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); | 258 | extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); |
253 | extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); | 259 | extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); |
254 | 260 | ||
@@ -269,6 +275,7 @@ extern void usb_serial_put(struct usb_serial *serial); | |||
269 | extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); | 275 | extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); |
270 | extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); | 276 | extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); |
271 | extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); | 277 | extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); |
278 | extern int usb_serial_generic_resume (struct usb_serial *serial); | ||
272 | extern int usb_serial_generic_write_room (struct usb_serial_port *port); | 279 | extern int usb_serial_generic_write_room (struct usb_serial_port *port); |
273 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); | 280 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); |
274 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb); | 281 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb); |
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index e17186dbcdca..4f59b2aa8a9e 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h | |||
@@ -110,13 +110,6 @@ struct usb_ep_ops { | |||
110 | gfp_t gfp_flags); | 110 | gfp_t gfp_flags); |
111 | void (*free_request) (struct usb_ep *ep, struct usb_request *req); | 111 | void (*free_request) (struct usb_ep *ep, struct usb_request *req); |
112 | 112 | ||
113 | void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, | ||
114 | dma_addr_t *dma, gfp_t gfp_flags); | ||
115 | void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, | ||
116 | unsigned bytes); | ||
117 | // NOTE: on 2.6, drivers may also use dma_map() and | ||
118 | // dma_sync_single_*() to directly manage dma overhead. | ||
119 | |||
120 | int (*queue) (struct usb_ep *ep, struct usb_request *req, | 113 | int (*queue) (struct usb_ep *ep, struct usb_request *req, |
121 | gfp_t gfp_flags); | 114 | gfp_t gfp_flags); |
122 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); | 115 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); |
@@ -235,47 +228,6 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) | |||
235 | } | 228 | } |
236 | 229 | ||
237 | /** | 230 | /** |
238 | * usb_ep_alloc_buffer - allocate an I/O buffer | ||
239 | * @ep:the endpoint associated with the buffer | ||
240 | * @len:length of the desired buffer | ||
241 | * @dma:pointer to the buffer's DMA address; must be valid | ||
242 | * @gfp_flags:GFP_* flags to use | ||
243 | * | ||
244 | * Returns a new buffer, or null if one could not be allocated. | ||
245 | * The buffer is suitably aligned for dma, if that endpoint uses DMA, | ||
246 | * and the caller won't have to care about dma-inconsistency | ||
247 | * or any hidden "bounce buffer" mechanism. No additional per-request | ||
248 | * DMA mapping will be required for such buffers. | ||
249 | * Free it later with usb_ep_free_buffer(). | ||
250 | * | ||
251 | * You don't need to use this call to allocate I/O buffers unless you | ||
252 | * want to make sure drivers don't incur costs for such "bounce buffer" | ||
253 | * copies or per-request DMA mappings. | ||
254 | */ | ||
255 | static inline void * | ||
256 | usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, | ||
257 | gfp_t gfp_flags) | ||
258 | { | ||
259 | return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); | ||
260 | } | ||
261 | |||
262 | /** | ||
263 | * usb_ep_free_buffer - frees an i/o buffer | ||
264 | * @ep:the endpoint associated with the buffer | ||
265 | * @buf:CPU view address of the buffer | ||
266 | * @dma:the buffer's DMA address | ||
267 | * @len:length of the buffer | ||
268 | * | ||
269 | * reverses the effect of usb_ep_alloc_buffer(). | ||
270 | * caller guarantees the buffer will no longer be accessed | ||
271 | */ | ||
272 | static inline void | ||
273 | usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len) | ||
274 | { | ||
275 | ep->ops->free_buffer (ep, buf, dma, len); | ||
276 | } | ||
277 | |||
278 | /** | ||
279 | * usb_ep_queue - queues (submits) an I/O request to an endpoint. | 231 | * usb_ep_queue - queues (submits) an I/O request to an endpoint. |
280 | * @ep:the endpoint associated with the request | 232 | * @ep:the endpoint associated with the request |
281 | * @req:the request being submitted | 233 | * @req:the request being submitted |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h new file mode 100644 index 000000000000..1101b0ce878f --- /dev/null +++ b/include/linux/user_namespace.h | |||
@@ -0,0 +1,61 @@ | |||
1 | #ifndef _LINUX_USER_NAMESPACE_H | ||
2 | #define _LINUX_USER_NAMESPACE_H | ||
3 | |||
4 | #include <linux/kref.h> | ||
5 | #include <linux/nsproxy.h> | ||
6 | #include <linux/sched.h> | ||
7 | #include <linux/err.h> | ||
8 | |||
9 | #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8) | ||
10 | #define UIDHASH_SZ (1 << UIDHASH_BITS) | ||
11 | |||
12 | struct user_namespace { | ||
13 | struct kref kref; | ||
14 | struct list_head uidhash_table[UIDHASH_SZ]; | ||
15 | struct user_struct *root_user; | ||
16 | }; | ||
17 | |||
18 | extern struct user_namespace init_user_ns; | ||
19 | |||
20 | #ifdef CONFIG_USER_NS | ||
21 | |||
22 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | ||
23 | { | ||
24 | if (ns) | ||
25 | kref_get(&ns->kref); | ||
26 | return ns; | ||
27 | } | ||
28 | |||
29 | extern struct user_namespace *copy_user_ns(int flags, | ||
30 | struct user_namespace *old_ns); | ||
31 | extern void free_user_ns(struct kref *kref); | ||
32 | |||
33 | static inline void put_user_ns(struct user_namespace *ns) | ||
34 | { | ||
35 | if (ns) | ||
36 | kref_put(&ns->kref, free_user_ns); | ||
37 | } | ||
38 | |||
39 | #else | ||
40 | |||
41 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | ||
42 | { | ||
43 | return &init_user_ns; | ||
44 | } | ||
45 | |||
46 | static inline struct user_namespace *copy_user_ns(int flags, | ||
47 | struct user_namespace *old_ns) | ||
48 | { | ||
49 | if (flags & CLONE_NEWUSER) | ||
50 | return ERR_PTR(-EINVAL); | ||
51 | |||
52 | return old_ns; | ||
53 | } | ||
54 | |||
55 | static inline void put_user_ns(struct user_namespace *ns) | ||
56 | { | ||
57 | } | ||
58 | |||
59 | #endif | ||
60 | |||
61 | #endif /* _LINUX_USER_H */ | ||
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index f8d3b326e93a..923db99175f2 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -48,26 +48,14 @@ static inline void get_uts_ns(struct uts_namespace *ns) | |||
48 | kref_get(&ns->kref); | 48 | kref_get(&ns->kref); |
49 | } | 49 | } |
50 | 50 | ||
51 | #ifdef CONFIG_UTS_NS | 51 | extern struct uts_namespace *copy_utsname(unsigned long flags, |
52 | extern struct uts_namespace *copy_utsname(int flags, struct uts_namespace *ns); | 52 | struct uts_namespace *ns); |
53 | extern void free_uts_ns(struct kref *kref); | 53 | extern void free_uts_ns(struct kref *kref); |
54 | 54 | ||
55 | static inline void put_uts_ns(struct uts_namespace *ns) | 55 | static inline void put_uts_ns(struct uts_namespace *ns) |
56 | { | 56 | { |
57 | kref_put(&ns->kref, free_uts_ns); | 57 | kref_put(&ns->kref, free_uts_ns); |
58 | } | 58 | } |
59 | #else | ||
60 | static inline struct uts_namespace *copy_utsname(int flags, | ||
61 | struct uts_namespace *ns) | ||
62 | { | ||
63 | return ns; | ||
64 | } | ||
65 | |||
66 | static inline void put_uts_ns(struct uts_namespace *ns) | ||
67 | { | ||
68 | } | ||
69 | #endif | ||
70 | |||
71 | static inline struct new_utsname *utsname(void) | 59 | static inline struct new_utsname *utsname(void) |
72 | { | 60 | { |
73 | return ¤t->nsproxy->uts_ns->name; | 61 | return ¤t->nsproxy->uts_ns->name; |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d16a2b57dc81..c66c8a3410b9 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 | ||
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 4b7ee83787c1..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 | |||
62 | static 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 | |||
61 | extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); | 68 | extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); |
62 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | 69 | extern 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); |
@@ -65,9 +72,14 @@ extern struct vm_struct *get_vm_area_node(unsigned long size, | |||
65 | unsigned long flags, int node, | 72 | unsigned long flags, int node, |
66 | gfp_t gfp_mask); | 73 | gfp_t gfp_mask); |
67 | extern struct vm_struct *remove_vm_area(void *addr); | 74 | extern struct vm_struct *remove_vm_area(void *addr); |
75 | |||
68 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 76 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
69 | struct page ***pages); | 77 | struct page ***pages); |
70 | extern void unmap_vm_area(struct vm_struct *area); | 78 | extern void unmap_kernel_range(unsigned long addr, unsigned long size); |
79 | |||
80 | /* Allocate/destroy a 'vmalloc' VM area. */ | ||
81 | extern struct vm_struct *alloc_vm_area(size_t size); | ||
82 | extern void free_vm_area(struct vm_struct *area); | ||
71 | 83 | ||
72 | /* | 84 | /* |
73 | * Internals. Dont't use.. | 85 | * Internals. Dont't use.. |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index d9325cf8a134..75370ec0923e 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #define HIGHMEM_ZONE(xx) | 25 | #define HIGHMEM_ZONE(xx) |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) | 28 | #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) , xx##_MOVABLE |
29 | 29 | ||
30 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | 30 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, |
31 | FOR_ALL_ZONES(PGALLOC), | 31 | FOR_ALL_ZONES(PGALLOC), |
@@ -170,7 +170,8 @@ static inline unsigned long node_page_state(int node, | |||
170 | #ifdef CONFIG_HIGHMEM | 170 | #ifdef CONFIG_HIGHMEM |
171 | zone_page_state(&zones[ZONE_HIGHMEM], item) + | 171 | zone_page_state(&zones[ZONE_HIGHMEM], item) + |
172 | #endif | 172 | #endif |
173 | zone_page_state(&zones[ZONE_NORMAL], item); | 173 | zone_page_state(&zones[ZONE_NORMAL], item) + |
174 | zone_page_state(&zones[ZONE_MOVABLE], item); | ||
174 | } | 175 | } |
175 | 176 | ||
176 | extern void zone_statistics(struct zonelist *, struct zone *); | 177 | extern void zone_statistics(struct zonelist *, struct zone *); |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index d961635d0e61..699b7e9864fa 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -75,6 +75,8 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
75 | int vt_waitactive(int vt); | 75 | int vt_waitactive(int vt); |
76 | void change_console(struct vc_data *new_vc); | 76 | void change_console(struct vc_data *new_vc); |
77 | void reset_vc(struct vc_data *vc); | 77 | void reset_vc(struct vc_data *vc); |
78 | extern int unbind_con_driver(const struct consw *csw, int first, int last, | ||
79 | int deflt); | ||
78 | 80 | ||
79 | /* | 81 | /* |
80 | * vc_screen.c shares this temporary buffer with the console write code so that | 82 | * vc_screen.c shares this temporary buffer with the console write code so that |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index ce0719a2cfeb..ce6badc98f6d 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -148,7 +148,7 @@ extern int keventd_up(void); | |||
148 | extern void init_workqueues(void); | 148 | extern void init_workqueues(void); |
149 | int execute_in_process_context(work_func_t fn, struct execute_work *); | 149 | int execute_in_process_context(work_func_t fn, struct execute_work *); |
150 | 150 | ||
151 | extern void cancel_work_sync(struct work_struct *work); | 151 | extern int cancel_work_sync(struct work_struct *work); |
152 | 152 | ||
153 | /* | 153 | /* |
154 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 154 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
@@ -166,14 +166,21 @@ static inline int cancel_delayed_work(struct delayed_work *work) | |||
166 | return ret; | 166 | return ret; |
167 | } | 167 | } |
168 | 168 | ||
169 | extern void cancel_rearming_delayed_work(struct delayed_work *work); | 169 | extern int cancel_delayed_work_sync(struct delayed_work *work); |
170 | 170 | ||
171 | /* Obsolete. use cancel_rearming_delayed_work() */ | 171 | /* Obsolete. use cancel_delayed_work_sync() */ |
172 | static inline | 172 | static inline |
173 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | 173 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, |
174 | struct delayed_work *work) | 174 | struct delayed_work *work) |
175 | { | 175 | { |
176 | cancel_rearming_delayed_work(work); | 176 | cancel_delayed_work_sync(work); |
177 | } | ||
178 | |||
179 | /* Obsolete. use cancel_delayed_work_sync() */ | ||
180 | static inline | ||
181 | void cancel_rearming_delayed_work(struct delayed_work *work) | ||
182 | { | ||
183 | cancel_delayed_work_sync(work); | ||
177 | } | 184 | } |
178 | 185 | ||
179 | #endif | 186 | #endif |