diff options
Diffstat (limited to 'include/linux')
177 files changed, 2302 insertions, 1023 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 127d2d192b5a..bcf875e844fe 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -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/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 index ff1255079fa1..bdca3f1b3213 100644 --- a/include/linux/async_tx.h +++ b/include/linux/async_tx.h | |||
@@ -51,10 +51,6 @@ struct dma_chan_ref { | |||
51 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a | 51 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a |
52 | * dependency chain | 52 | * dependency chain |
53 | * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. | 53 | * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. |
54 | * @ASYNC_TX_KMAP_SRC: if the transaction is to be performed synchronously | ||
55 | * take an atomic mapping (KM_USER0) on the source page(s) | ||
56 | * @ASYNC_TX_KMAP_DST: if the transaction is to be performed synchronously | ||
57 | * take an atomic mapping (KM_USER0) on the dest page(s) | ||
58 | */ | 54 | */ |
59 | enum async_tx_flags { | 55 | enum async_tx_flags { |
60 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), | 56 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), |
@@ -62,8 +58,6 @@ enum async_tx_flags { | |||
62 | ASYNC_TX_ASSUME_COHERENT = (1 << 2), | 58 | ASYNC_TX_ASSUME_COHERENT = (1 << 2), |
63 | ASYNC_TX_ACK = (1 << 3), | 59 | ASYNC_TX_ACK = (1 << 3), |
64 | ASYNC_TX_DEP_ACK = (1 << 4), | 60 | ASYNC_TX_DEP_ACK = (1 << 4), |
65 | ASYNC_TX_KMAP_SRC = (1 << 5), | ||
66 | ASYNC_TX_KMAP_DST = (1 << 6), | ||
67 | }; | 61 | }; |
68 | 62 | ||
69 | #ifdef CONFIG_DMA_ENGINE | 63 | #ifdef CONFIG_DMA_ENGINE |
diff --git a/include/linux/ata.h b/include/linux/ata.h index b5a20162af32..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), |
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..f78965fc6426 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,12 @@ 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_fill_sghdr_rq(request_queue_t *, struct request *, | ||
702 | struct sg_io_hdr *, int); | ||
703 | extern int blk_unmap_sghdr_rq(struct request *, struct sg_io_hdr *); | ||
704 | extern int blk_complete_sghdr_rq(struct request *, struct sg_io_hdr *, | ||
705 | struct bio *); | ||
706 | extern int blk_verify_command(unsigned char *, int); | ||
683 | 707 | ||
684 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) | 708 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) |
685 | { | 709 | { |
diff --git a/include/linux/bsg.h b/include/linux/bsg.h new file mode 100644 index 000000000000..8547b10c388b --- /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 *, const char *); | ||
61 | extern void bsg_unregister_queue(struct request_queue *); | ||
62 | #else | ||
63 | #define bsg_register_queue(disk, 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/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/device.h b/include/linux/device.h index be2debed70d2..d9f0a57f5a2f 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -572,6 +572,16 @@ dev_dbg(struct device * dev, const char * fmt, ...) | |||
572 | } | 572 | } |
573 | #endif | 573 | #endif |
574 | 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 | |||
575 | #define dev_err(dev, format, arg...) \ | 585 | #define dev_err(dev, format, arg...) \ |
576 | dev_printk(KERN_ERR , dev , format , ## arg) | 586 | dev_printk(KERN_ERR , dev , format , ## arg) |
577 | #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/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/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/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 2eaba21b9b1a..0c37a737a2b2 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -368,7 +368,6 @@ struct i2c_client_address_data { | |||
368 | 368 | ||
369 | /* The numbers to use to set I2C bus address */ | 369 | /* The numbers to use to set I2C bus address */ |
370 | #define ANY_I2C_BUS 0xffff | 370 | #define ANY_I2C_BUS 0xffff |
371 | #define ANY_I2C_ISA_BUS 9191 | ||
372 | 371 | ||
373 | 372 | ||
374 | /* ----- functions exported by i2c.o */ | 373 | /* ----- functions exported by i2c.o */ |
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 915572fa030b..0edda411959c 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -78,8 +78,11 @@ 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 | ||
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/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/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/irda.h b/include/linux/irda.h index 8e3735714c1c..28f88ecba344 100644 --- a/include/linux/irda.h +++ b/include/linux/irda.h | |||
@@ -77,6 +77,7 @@ typedef enum { | |||
77 | IRDA_ACT200L_DONGLE = 10, | 77 | IRDA_ACT200L_DONGLE = 10, |
78 | IRDA_MA600_DONGLE = 11, | 78 | IRDA_MA600_DONGLE = 11, |
79 | IRDA_TOIM3232_DONGLE = 12, | 79 | IRDA_TOIM3232_DONGLE = 12, |
80 | IRDA_EP7211_DONGLE = 13, | ||
80 | } IRDA_DONGLE; | 81 | } IRDA_DONGLE; |
81 | 82 | ||
82 | /* Protocol types to be used for SOCK_DGRAM */ | 83 | /* Protocol types to be used for SOCK_DGRAM */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 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 06cbf41d32d2..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 { |
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/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 dc1178f6184b..421175092ee2 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -13,7 +13,6 @@ | |||
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 | /* | 18 | /* |
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 47cd2a1c5544..be5a43928c84 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -323,6 +323,7 @@ enum ata_completion_errors { | |||
323 | AC_ERR_INVALID = (1 << 7), /* invalid argument */ | 323 | AC_ERR_INVALID = (1 << 7), /* invalid argument */ |
324 | AC_ERR_OTHER = (1 << 8), /* unknown */ | 324 | AC_ERR_OTHER = (1 << 8), /* unknown */ |
325 | 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 */ | ||
326 | }; | 327 | }; |
327 | 328 | ||
328 | /* forward declarations */ | 329 | /* forward declarations */ |
@@ -530,6 +531,7 @@ struct ata_port { | |||
530 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ | 531 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ |
531 | unsigned int hw_sata_spd_limit; | 532 | unsigned int hw_sata_spd_limit; |
532 | unsigned int sata_spd_limit; /* SATA PHY speed limit */ | 533 | unsigned int sata_spd_limit; /* SATA PHY speed limit */ |
534 | unsigned int sata_spd; /* current SATA PHY speed */ | ||
533 | 535 | ||
534 | /* record runtime error info, protected by host lock */ | 536 | /* record runtime error info, protected by host lock */ |
535 | struct ata_eh_info eh_info; | 537 | struct ata_eh_info eh_info; |
@@ -563,6 +565,9 @@ struct ata_port { | |||
563 | pm_message_t pm_mesg; | 565 | pm_message_t pm_mesg; |
564 | int *pm_result; | 566 | int *pm_result; |
565 | 567 | ||
568 | struct timer_list fastdrain_timer; | ||
569 | unsigned long fastdrain_cnt; | ||
570 | |||
566 | void *private_data; | 571 | void *private_data; |
567 | 572 | ||
568 | #ifdef CONFIG_ATA_ACPI | 573 | #ifdef CONFIG_ATA_ACPI |
@@ -619,9 +624,8 @@ struct ata_port_operations { | |||
619 | u8 (*irq_on) (struct ata_port *); | 624 | u8 (*irq_on) (struct ata_port *); |
620 | u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq); | 625 | u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq); |
621 | 626 | ||
622 | u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); | 627 | int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val); |
623 | void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, | 628 | int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val); |
624 | u32 val); | ||
625 | 629 | ||
626 | int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); | 630 | int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); |
627 | int (*port_resume) (struct ata_port *ap); | 631 | int (*port_resume) (struct ata_port *ap); |
@@ -764,7 +768,8 @@ extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *); | |||
764 | */ | 768 | */ |
765 | extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); | 769 | extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); |
766 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); | 770 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); |
767 | extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp); | 771 | extern void ata_tf_to_fis(const struct ata_taskfile *tf, |
772 | u8 pmp, int is_cmd, u8 *fis); | ||
768 | extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); | 773 | extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); |
769 | extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); | 774 | extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); |
770 | extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); | 775 | extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); |
@@ -909,27 +914,21 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
909 | /* | 914 | /* |
910 | * ata_eh_info helpers | 915 | * ata_eh_info helpers |
911 | */ | 916 | */ |
912 | #define ata_ehi_push_desc(ehi, fmt, args...) do { \ | 917 | extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...); |
913 | (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \ | 918 | extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...); |
914 | ATA_EH_DESC_LEN - (ehi)->desc_len, \ | 919 | extern void ata_ehi_clear_desc(struct ata_eh_info *ehi); |
915 | fmt , ##args); \ | 920 | |
916 | } while (0) | 921 | static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi) |
917 | |||
918 | #define ata_ehi_clear_desc(ehi) do { \ | ||
919 | (ehi)->desc[0] = '\0'; \ | ||
920 | (ehi)->desc_len = 0; \ | ||
921 | } while (0) | ||
922 | |||
923 | static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi) | ||
924 | { | 922 | { |
925 | ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK; | 923 | ehi->flags |= ATA_EHI_RESUME_LINK; |
926 | ehi->action |= ATA_EH_SOFTRESET; | 924 | ehi->action |= ATA_EH_SOFTRESET; |
927 | ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; | 925 | ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; |
928 | } | 926 | } |
929 | 927 | ||
930 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) | 928 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) |
931 | { | 929 | { |
932 | __ata_ehi_hotplugged(ehi); | 930 | ata_ehi_schedule_probe(ehi); |
931 | ehi->flags |= ATA_EHI_HOTPLUGGED; | ||
933 | ehi->err_mask |= AC_ERR_ATA_BUS; | 932 | ehi->err_mask |= AC_ERR_ATA_BUS; |
934 | } | 933 | } |
935 | 934 | ||
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/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/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 322b5eae57dd..4a616d73cc25 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -262,8 +262,6 @@ enum netdev_state_t | |||
262 | __LINK_STATE_LINKWATCH_PENDING, | 262 | __LINK_STATE_LINKWATCH_PENDING, |
263 | __LINK_STATE_DORMANT, | 263 | __LINK_STATE_DORMANT, |
264 | __LINK_STATE_QDISC_RUNNING, | 264 | __LINK_STATE_QDISC_RUNNING, |
265 | /* Set by the netpoll NAPI code */ | ||
266 | __LINK_STATE_POLL_LIST_FROZEN, | ||
267 | }; | 265 | }; |
268 | 266 | ||
269 | 267 | ||
@@ -577,7 +575,7 @@ struct net_device | |||
577 | 575 | ||
578 | /* The TX queue control structures */ | 576 | /* The TX queue control structures */ |
579 | unsigned int egress_subqueue_count; | 577 | unsigned int egress_subqueue_count; |
580 | struct net_device_subqueue egress_subqueue[0]; | 578 | struct net_device_subqueue egress_subqueue[1]; |
581 | }; | 579 | }; |
582 | #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) |
583 | 581 | ||
@@ -1022,14 +1020,6 @@ static inline void netif_rx_complete(struct net_device *dev) | |||
1022 | { | 1020 | { |
1023 | unsigned long flags; | 1021 | unsigned long flags; |
1024 | 1022 | ||
1025 | #ifdef CONFIG_NETPOLL | ||
1026 | /* Prevent race with netpoll - yes, this is a kludge. | ||
1027 | * But at least it doesn't penalize the non-netpoll | ||
1028 | * code path. */ | ||
1029 | if (test_bit(__LINK_STATE_POLL_LIST_FROZEN, &dev->state)) | ||
1030 | return; | ||
1031 | #endif | ||
1032 | |||
1033 | local_irq_save(flags); | 1023 | local_irq_save(flags); |
1034 | __netif_rx_complete(dev); | 1024 | __netif_rx_complete(dev); |
1035 | local_irq_restore(flags); | 1025 | local_irq_restore(flags); |
@@ -1108,10 +1098,8 @@ extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all | |||
1108 | 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); |
1109 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); | 1099 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); |
1110 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | 1100 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); |
1111 | extern void dev_mc_discard(struct net_device *dev); | ||
1112 | extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); | 1101 | extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); |
1113 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); | 1102 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); |
1114 | extern void __dev_addr_discard(struct dev_addr_list **list); | ||
1115 | extern void dev_set_promiscuity(struct net_device *dev, int inc); | 1103 | extern void dev_set_promiscuity(struct net_device *dev, int inc); |
1116 | extern void dev_set_allmulti(struct net_device *dev, int inc); | 1104 | extern void dev_set_allmulti(struct net_device *dev, int inc); |
1117 | 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_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h index 34ab0fb736e2..a92fefc3c7ec 100644 --- a/include/linux/netfilter_ipv4/ipt_iprange.h +++ b/include/linux/netfilter_ipv4/ipt_iprange.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _IPT_IPRANGE_H | 1 | #ifndef _IPT_IPRANGE_H |
2 | #define _IPT_IPRANGE_H | 2 | #define _IPT_IPRANGE_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
4 | #define IPRANGE_SRC 0x01 /* Match source IP address */ | 6 | #define IPRANGE_SRC 0x01 /* Match source IP address */ |
5 | #define IPRANGE_DST 0x02 /* Match destination IP address */ | 7 | #define IPRANGE_DST 0x02 /* Match destination IP address */ |
6 | #define IPRANGE_SRC_INV 0x10 /* Negate the condition */ | 8 | #define IPRANGE_SRC_INV 0x10 /* Negate the condition */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 2e23353c28a5..83d8239f0cce 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -161,6 +161,8 @@ extern struct sock *netlink_kernel_create(int unit, unsigned int groups, | |||
161 | void (*input)(struct sock *sk, int len), | 161 | void (*input)(struct sock *sk, int len), |
162 | struct mutex *cb_mutex, | 162 | struct mutex *cb_mutex, |
163 | struct module *module); | 163 | struct module *module); |
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/nfs_fs.h b/include/linux/nfs_fs.h index c098ae194f79..9ba4aec37c50 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -407,8 +407,8 @@ extern void nfs_release_automount_timer(void); | |||
407 | /* | 407 | /* |
408 | * linux/fs/nfs/unlink.c | 408 | * linux/fs/nfs/unlink.c |
409 | */ | 409 | */ |
410 | extern int nfs_async_unlink(struct dentry *); | 410 | extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry); |
411 | extern void nfs_complete_unlink(struct dentry *); | 411 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
412 | 412 | ||
413 | /* | 413 | /* |
414 | * linux/fs/nfs/write.c | 414 | * linux/fs/nfs/write.c |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 38d77681cf27..cf74a4db84a5 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -278,6 +278,21 @@ struct nfs_writeres { | |||
278 | }; | 278 | }; |
279 | 279 | ||
280 | /* | 280 | /* |
281 | * Common arguments to the unlink call | ||
282 | */ | ||
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 | /* | ||
281 | * Argument struct for decode_entry function | 296 | * Argument struct for decode_entry function |
282 | */ | 297 | */ |
283 | struct nfs_entry { | 298 | struct nfs_entry { |
@@ -631,18 +646,6 @@ struct nfs4_readlink { | |||
631 | struct page ** pages; /* zero-copy data */ | 646 | struct page ** pages; /* zero-copy data */ |
632 | }; | 647 | }; |
633 | 648 | ||
634 | struct nfs4_remove_arg { | ||
635 | const struct nfs_fh * fh; | ||
636 | const struct qstr * name; | ||
637 | const u32 * bitmask; | ||
638 | }; | ||
639 | |||
640 | struct nfs4_remove_res { | ||
641 | const struct nfs_server * server; | ||
642 | struct nfs4_change_info cinfo; | ||
643 | struct nfs_fattr * dir_attr; | ||
644 | }; | ||
645 | |||
646 | struct nfs4_rename_arg { | 649 | struct nfs4_rename_arg { |
647 | const struct nfs_fh * old_dir; | 650 | const struct nfs_fh * old_dir; |
648 | const struct nfs_fh * new_dir; | 651 | const struct nfs_fh * new_dir; |
@@ -788,9 +791,8 @@ struct nfs_rpc_ops { | |||
788 | int (*create) (struct inode *, struct dentry *, | 791 | int (*create) (struct inode *, struct dentry *, |
789 | struct iattr *, int, struct nameidata *); | 792 | struct iattr *, int, struct nameidata *); |
790 | int (*remove) (struct inode *, struct qstr *); | 793 | int (*remove) (struct inode *, struct qstr *); |
791 | int (*unlink_setup) (struct rpc_message *, | 794 | void (*unlink_setup) (struct rpc_message *, struct inode *dir); |
792 | struct dentry *, struct qstr *); | 795 | int (*unlink_done) (struct rpc_task *, struct inode *); |
793 | int (*unlink_done) (struct dentry *, struct rpc_task *); | ||
794 | int (*rename) (struct inode *, struct qstr *, | 796 | int (*rename) (struct inode *, struct qstr *, |
795 | struct inode *, struct qstr *); | 797 | struct inode *, struct qstr *); |
796 | int (*link) (struct inode *, struct inode *, struct qstr *); | 798 | int (*link) (struct inode *, struct inode *, struct qstr *); |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 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 37a71580ad8a..5e84f2e8d54c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -432,6 +432,8 @@ extern struct bus_type pci_bus_type; | |||
432 | * code, or pci core code. */ | 432 | * code, or pci core code. */ |
433 | 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 */ |
434 | 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); | ||
435 | 437 | ||
436 | void pcibios_fixup_bus(struct pci_bus *); | 438 | void pcibios_fixup_bus(struct pci_bus *); |
437 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); | 439 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
@@ -724,6 +726,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, struct pci_dev * | |||
724 | { return NULL; } | 726 | { return NULL; } |
725 | 727 | ||
726 | #define pci_dev_present(ids) (0) | 728 | #define pci_dev_present(ids) (0) |
729 | #define no_pci_devices() (1) | ||
727 | #define pci_find_present(ids) (NULL) | 730 | #define pci_find_present(ids) (NULL) |
728 | #define pci_dev_put(dev) do { } while (0) | 731 | #define pci_dev_put(dev) do { } while (0) |
729 | 732 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 2c7add169539..ced4d3f76104 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -495,6 +495,8 @@ | |||
495 | 495 | ||
496 | #define PCI_VENDOR_ID_AMD 0x1022 | 496 | #define PCI_VENDOR_ID_AMD 0x1022 |
497 | #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 | ||
498 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 | 500 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 |
499 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 501 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
500 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 502 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
@@ -2038,6 +2040,8 @@ | |||
2038 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea | 2040 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea |
2039 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb | 2041 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb |
2040 | 2042 | ||
2043 | #define PCI_VENDOR_ID_LENOVO 0x17aa | ||
2044 | |||
2041 | #define PCI_VENDOR_ID_ARECA 0x17d3 | 2045 | #define PCI_VENDOR_ID_ARECA 0x17d3 |
2042 | #define PCI_DEVICE_ID_ARECA_1110 0x1110 | 2046 | #define PCI_DEVICE_ID_ARECA_1110 0x1110 |
2043 | #define PCI_DEVICE_ID_ARECA_1120 0x1120 | 2047 | #define PCI_DEVICE_ID_ARECA_1120 0x1120 |
@@ -2209,6 +2213,7 @@ | |||
2209 | #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 | 2213 | #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 |
2210 | #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 | 2214 | #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 |
2211 | #define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 | 2215 | #define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 |
2216 | #define PCI_DEVICE_ID_INTEL_3000_HB 0x2778 | ||
2212 | #define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0 | 2217 | #define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0 |
2213 | #define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2 | 2218 | #define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2 |
2214 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 | 2219 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 |
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/pm.h b/include/linux/pm.h index 273781c82e4d..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 | ||
@@ -284,8 +285,6 @@ extern int device_prepare_suspend(pm_message_t state); | |||
284 | #define device_may_wakeup(dev) \ | 285 | #define device_may_wakeup(dev) \ |
285 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | 286 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) |
286 | 287 | ||
287 | extern int dpm_runtime_suspend(struct device *, pm_message_t); | ||
288 | extern void dpm_runtime_resume(struct device *); | ||
289 | 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); |
290 | 289 | ||
291 | #define suspend_report_result(fn, ret) \ | 290 | #define suspend_report_result(fn, ret) \ |
@@ -317,15 +316,6 @@ static inline int device_suspend(pm_message_t state) | |||
317 | #define device_set_wakeup_enable(dev,val) do{}while(0) | 316 | #define device_set_wakeup_enable(dev,val) do{}while(0) |
318 | #define device_may_wakeup(dev) (0) | 317 | #define device_may_wakeup(dev) (0) |
319 | 318 | ||
320 | static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | ||
321 | { | ||
322 | return 0; | ||
323 | } | ||
324 | |||
325 | static inline void dpm_runtime_resume(struct device * dev) | ||
326 | { | ||
327 | } | ||
328 | |||
329 | #define suspend_report_result(fn, ret) do { } while (0) | 319 | #define suspend_report_result(fn, ret) do { } while (0) |
330 | 320 | ||
331 | 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/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/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/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/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 d9377ce9ffd1..9f3825014674 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -210,5 +210,6 @@ static inline void serio_unpin_driver(struct serio *serio) | |||
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 | 212 | #define SERIO_TAOSEVM 0x34 |
213 | #define SERIO_FUJITSU 0x35 | ||
213 | 214 | ||
214 | #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/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 fe195c97a89d..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 |
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/gss_api.h b/include/linux/sunrpc/gss_api.h index bbac101ac372..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 | ||
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/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/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/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/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/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/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 |