diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-24 04:11:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-24 04:11:23 -0400 |
commit | 416dfdcdb894432547ead4fcb9fa6a36b396059e (patch) | |
tree | 8033fdda07397a59c5fa98c88927040906ce6c1a /include/linux | |
parent | 56449f437add737a1e5e1cb7e00f63ac8ead1938 (diff) | |
parent | 091069740304c979f957ceacec39c461d0192158 (diff) |
Merge commit 'v2.6.30-rc3' into tracing/hw-branch-tracing
Conflicts:
arch/x86/kernel/ptrace.c
Merge reason: fix the conflict above, and also pick up the CONFIG_BROKEN
dependency change from upstream so that we can remove it
here.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux')
70 files changed, 2027 insertions, 302 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 6617c9f8f2ca..cb79b7a208e1 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -29,6 +29,8 @@ | |||
29 | #ifndef __LINUX_ATA_H__ | 29 | #ifndef __LINUX_ATA_H__ |
30 | #define __LINUX_ATA_H__ | 30 | #define __LINUX_ATA_H__ |
31 | 31 | ||
32 | #include <linux/kernel.h> | ||
33 | #include <linux/string.h> | ||
32 | #include <linux/types.h> | 34 | #include <linux/types.h> |
33 | #include <asm/byteorder.h> | 35 | #include <asm/byteorder.h> |
34 | 36 | ||
@@ -91,6 +93,7 @@ enum { | |||
91 | ATA_ID_CFA_POWER = 160, | 93 | ATA_ID_CFA_POWER = 160, |
92 | ATA_ID_CFA_KEY_MGMT = 162, | 94 | ATA_ID_CFA_KEY_MGMT = 162, |
93 | ATA_ID_CFA_MODES = 163, | 95 | ATA_ID_CFA_MODES = 163, |
96 | ATA_ID_DATA_SET_MGMT = 169, | ||
94 | ATA_ID_ROT_SPEED = 217, | 97 | ATA_ID_ROT_SPEED = 217, |
95 | ATA_ID_PIO4 = (1 << 1), | 98 | ATA_ID_PIO4 = (1 << 1), |
96 | 99 | ||
@@ -248,6 +251,7 @@ enum { | |||
248 | ATA_CMD_SMART = 0xB0, | 251 | ATA_CMD_SMART = 0xB0, |
249 | ATA_CMD_MEDIA_LOCK = 0xDE, | 252 | ATA_CMD_MEDIA_LOCK = 0xDE, |
250 | ATA_CMD_MEDIA_UNLOCK = 0xDF, | 253 | ATA_CMD_MEDIA_UNLOCK = 0xDF, |
254 | ATA_CMD_DSM = 0x06, | ||
251 | /* marked obsolete in the ATA/ATAPI-7 spec */ | 255 | /* marked obsolete in the ATA/ATAPI-7 spec */ |
252 | ATA_CMD_RESTORE = 0x10, | 256 | ATA_CMD_RESTORE = 0x10, |
253 | 257 | ||
@@ -321,6 +325,9 @@ enum { | |||
321 | ATA_SMART_READ_VALUES = 0xD0, | 325 | ATA_SMART_READ_VALUES = 0xD0, |
322 | ATA_SMART_READ_THRESHOLDS = 0xD1, | 326 | ATA_SMART_READ_THRESHOLDS = 0xD1, |
323 | 327 | ||
328 | /* feature values for Data Set Management */ | ||
329 | ATA_DSM_TRIM = 0x01, | ||
330 | |||
324 | /* password used in LBA Mid / LBA High for executing SMART commands */ | 331 | /* password used in LBA Mid / LBA High for executing SMART commands */ |
325 | ATA_SMART_LBAM_PASS = 0x4F, | 332 | ATA_SMART_LBAM_PASS = 0x4F, |
326 | ATA_SMART_LBAH_PASS = 0xC2, | 333 | ATA_SMART_LBAH_PASS = 0xC2, |
@@ -723,6 +730,14 @@ static inline int ata_id_has_unload(const u16 *id) | |||
723 | return 0; | 730 | return 0; |
724 | } | 731 | } |
725 | 732 | ||
733 | static inline int ata_id_has_trim(const u16 *id) | ||
734 | { | ||
735 | if (ata_id_major_version(id) >= 7 && | ||
736 | (id[ATA_ID_DATA_SET_MGMT] & 1)) | ||
737 | return 1; | ||
738 | return 0; | ||
739 | } | ||
740 | |||
726 | static inline int ata_id_current_chs_valid(const u16 *id) | 741 | static inline int ata_id_current_chs_valid(const u16 *id) |
727 | { | 742 | { |
728 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 743 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
@@ -863,6 +878,32 @@ static inline void ata_id_to_hd_driveid(u16 *id) | |||
863 | #endif | 878 | #endif |
864 | } | 879 | } |
865 | 880 | ||
881 | /* | ||
882 | * Write up to 'max' LBA Range Entries to the buffer that will cover the | ||
883 | * extent from sector to sector + count. This is used for TRIM and for | ||
884 | * ADD LBA(S) TO NV CACHE PINNED SET. | ||
885 | */ | ||
886 | static inline unsigned ata_set_lba_range_entries(void *_buffer, unsigned max, | ||
887 | u64 sector, unsigned long count) | ||
888 | { | ||
889 | __le64 *buffer = _buffer; | ||
890 | unsigned i = 0; | ||
891 | |||
892 | while (i < max) { | ||
893 | u64 entry = sector | | ||
894 | ((u64)(count > 0xffff ? 0xffff : count) << 48); | ||
895 | buffer[i++] = __cpu_to_le64(entry); | ||
896 | if (count <= 0xffff) | ||
897 | break; | ||
898 | count -= 0xffff; | ||
899 | sector += 0xffff; | ||
900 | } | ||
901 | |||
902 | max = ALIGN(i * 8, 512); | ||
903 | memset(buffer + i, 0, max - i * 8); | ||
904 | return max; | ||
905 | } | ||
906 | |||
866 | static inline int is_multi_taskfile(struct ata_taskfile *tf) | 907 | static inline int is_multi_taskfile(struct ata_taskfile *tf) |
867 | { | 908 | { |
868 | return (tf->command == ATA_CMD_READ_MULTI) || | 909 | return (tf->command == ATA_CMD_READ_MULTI) || |
diff --git a/include/linux/bio.h b/include/linux/bio.h index b900d2c67d29..b89cf2d82898 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -504,6 +504,115 @@ static inline int bio_has_data(struct bio *bio) | |||
504 | return bio && bio->bi_io_vec != NULL; | 504 | return bio && bio->bi_io_vec != NULL; |
505 | } | 505 | } |
506 | 506 | ||
507 | /* | ||
508 | * BIO list managment for use by remapping drivers (e.g. DM or MD). | ||
509 | * | ||
510 | * A bio_list anchors a singly-linked list of bios chained through the bi_next | ||
511 | * member of the bio. The bio_list also caches the last list member to allow | ||
512 | * fast access to the tail. | ||
513 | */ | ||
514 | struct bio_list { | ||
515 | struct bio *head; | ||
516 | struct bio *tail; | ||
517 | }; | ||
518 | |||
519 | static inline int bio_list_empty(const struct bio_list *bl) | ||
520 | { | ||
521 | return bl->head == NULL; | ||
522 | } | ||
523 | |||
524 | static inline void bio_list_init(struct bio_list *bl) | ||
525 | { | ||
526 | bl->head = bl->tail = NULL; | ||
527 | } | ||
528 | |||
529 | #define bio_list_for_each(bio, bl) \ | ||
530 | for (bio = (bl)->head; bio; bio = bio->bi_next) | ||
531 | |||
532 | static inline unsigned bio_list_size(const struct bio_list *bl) | ||
533 | { | ||
534 | unsigned sz = 0; | ||
535 | struct bio *bio; | ||
536 | |||
537 | bio_list_for_each(bio, bl) | ||
538 | sz++; | ||
539 | |||
540 | return sz; | ||
541 | } | ||
542 | |||
543 | static inline void bio_list_add(struct bio_list *bl, struct bio *bio) | ||
544 | { | ||
545 | bio->bi_next = NULL; | ||
546 | |||
547 | if (bl->tail) | ||
548 | bl->tail->bi_next = bio; | ||
549 | else | ||
550 | bl->head = bio; | ||
551 | |||
552 | bl->tail = bio; | ||
553 | } | ||
554 | |||
555 | static inline void bio_list_add_head(struct bio_list *bl, struct bio *bio) | ||
556 | { | ||
557 | bio->bi_next = bl->head; | ||
558 | |||
559 | bl->head = bio; | ||
560 | |||
561 | if (!bl->tail) | ||
562 | bl->tail = bio; | ||
563 | } | ||
564 | |||
565 | static inline void bio_list_merge(struct bio_list *bl, struct bio_list *bl2) | ||
566 | { | ||
567 | if (!bl2->head) | ||
568 | return; | ||
569 | |||
570 | if (bl->tail) | ||
571 | bl->tail->bi_next = bl2->head; | ||
572 | else | ||
573 | bl->head = bl2->head; | ||
574 | |||
575 | bl->tail = bl2->tail; | ||
576 | } | ||
577 | |||
578 | static inline void bio_list_merge_head(struct bio_list *bl, | ||
579 | struct bio_list *bl2) | ||
580 | { | ||
581 | if (!bl2->head) | ||
582 | return; | ||
583 | |||
584 | if (bl->head) | ||
585 | bl2->tail->bi_next = bl->head; | ||
586 | else | ||
587 | bl->tail = bl2->tail; | ||
588 | |||
589 | bl->head = bl2->head; | ||
590 | } | ||
591 | |||
592 | static inline struct bio *bio_list_pop(struct bio_list *bl) | ||
593 | { | ||
594 | struct bio *bio = bl->head; | ||
595 | |||
596 | if (bio) { | ||
597 | bl->head = bl->head->bi_next; | ||
598 | if (!bl->head) | ||
599 | bl->tail = NULL; | ||
600 | |||
601 | bio->bi_next = NULL; | ||
602 | } | ||
603 | |||
604 | return bio; | ||
605 | } | ||
606 | |||
607 | static inline struct bio *bio_list_get(struct bio_list *bl) | ||
608 | { | ||
609 | struct bio *bio = bl->head; | ||
610 | |||
611 | bl->head = bl->tail = NULL; | ||
612 | |||
613 | return bio; | ||
614 | } | ||
615 | |||
507 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 616 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
508 | 617 | ||
509 | #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) | 618 | #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index e03660964e02..ba54c834a590 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -117,7 +117,6 @@ enum rq_flag_bits { | |||
117 | __REQ_RW_META, /* metadata io request */ | 117 | __REQ_RW_META, /* metadata io request */ |
118 | __REQ_COPY_USER, /* contains copies of user pages */ | 118 | __REQ_COPY_USER, /* contains copies of user pages */ |
119 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ | 119 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ |
120 | __REQ_UNPLUG, /* unplug queue on submission */ | ||
121 | __REQ_NOIDLE, /* Don't anticipate more IO after this one */ | 120 | __REQ_NOIDLE, /* Don't anticipate more IO after this one */ |
122 | __REQ_NR_BITS, /* stops here */ | 121 | __REQ_NR_BITS, /* stops here */ |
123 | }; | 122 | }; |
@@ -145,7 +144,6 @@ enum rq_flag_bits { | |||
145 | #define REQ_RW_META (1 << __REQ_RW_META) | 144 | #define REQ_RW_META (1 << __REQ_RW_META) |
146 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) | 145 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) |
147 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) | 146 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) |
148 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) | ||
149 | #define REQ_NOIDLE (1 << __REQ_NOIDLE) | 147 | #define REQ_NOIDLE (1 << __REQ_NOIDLE) |
150 | 148 | ||
151 | #define BLK_MAX_CDB 16 | 149 | #define BLK_MAX_CDB 16 |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 7b73bb8f1970..16ed0284d780 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -155,6 +155,7 @@ void create_empty_buffers(struct page *, unsigned long, | |||
155 | unsigned long b_state); | 155 | unsigned long b_state); |
156 | void end_buffer_read_sync(struct buffer_head *bh, int uptodate); | 156 | void end_buffer_read_sync(struct buffer_head *bh, int uptodate); |
157 | void end_buffer_write_sync(struct buffer_head *bh, int uptodate); | 157 | void end_buffer_write_sync(struct buffer_head *bh, int uptodate); |
158 | void end_buffer_async_write(struct buffer_head *bh, int uptodate); | ||
158 | 159 | ||
159 | /* Things to do with buffers at mapping->private_list */ | 160 | /* Things to do with buffers at mapping->private_list */ |
160 | void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode); | 161 | void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode); |
@@ -197,6 +198,8 @@ extern int buffer_heads_over_limit; | |||
197 | void block_invalidatepage(struct page *page, unsigned long offset); | 198 | void block_invalidatepage(struct page *page, unsigned long offset); |
198 | int block_write_full_page(struct page *page, get_block_t *get_block, | 199 | int block_write_full_page(struct page *page, get_block_t *get_block, |
199 | struct writeback_control *wbc); | 200 | struct writeback_control *wbc); |
201 | int block_write_full_page_endio(struct page *page, get_block_t *get_block, | ||
202 | struct writeback_control *wbc, bh_end_io_t *handler); | ||
200 | int block_read_full_page(struct page*, get_block_t*); | 203 | int block_read_full_page(struct page*, get_block_t*); |
201 | int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, | 204 | int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, |
202 | unsigned long from); | 205 | unsigned long from); |
diff --git a/include/linux/capability.h b/include/linux/capability.h index 4864a43b2b45..c3021105edc0 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -377,7 +377,21 @@ struct cpu_vfs_cap_data { | |||
377 | #define CAP_FOR_EACH_U32(__capi) \ | 377 | #define CAP_FOR_EACH_U32(__capi) \ |
378 | for (__capi = 0; __capi < _KERNEL_CAPABILITY_U32S; ++__capi) | 378 | for (__capi = 0; __capi < _KERNEL_CAPABILITY_U32S; ++__capi) |
379 | 379 | ||
380 | /* | ||
381 | * CAP_FS_MASK and CAP_NFSD_MASKS: | ||
382 | * | ||
383 | * The fs mask is all the privileges that fsuid==0 historically meant. | ||
384 | * At one time in the past, that included CAP_MKNOD and CAP_LINUX_IMMUTABLE. | ||
385 | * | ||
386 | * It has never meant setting security.* and trusted.* xattrs. | ||
387 | * | ||
388 | * We could also define fsmask as follows: | ||
389 | * 1. CAP_FS_MASK is the privilege to bypass all fs-related DAC permissions | ||
390 | * 2. The security.* and trusted.* xattrs are fs-related MAC permissions | ||
391 | */ | ||
392 | |||
380 | # define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \ | 393 | # define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \ |
394 | | CAP_TO_MASK(CAP_MKNOD) \ | ||
381 | | CAP_TO_MASK(CAP_DAC_OVERRIDE) \ | 395 | | CAP_TO_MASK(CAP_DAC_OVERRIDE) \ |
382 | | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \ | 396 | | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \ |
383 | | CAP_TO_MASK(CAP_FOWNER) \ | 397 | | CAP_TO_MASK(CAP_FOWNER) \ |
@@ -392,11 +406,12 @@ struct cpu_vfs_cap_data { | |||
392 | # define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }}) | 406 | # define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }}) |
393 | # define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }}) | 407 | # define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }}) |
394 | # define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }}) | 408 | # define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }}) |
395 | # define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } }) | 409 | # define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ |
410 | | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \ | ||
411 | CAP_FS_MASK_B1 } }) | ||
396 | # define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ | 412 | # define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ |
397 | | CAP_TO_MASK(CAP_SYS_RESOURCE) \ | 413 | | CAP_TO_MASK(CAP_SYS_RESOURCE), \ |
398 | | CAP_TO_MASK(CAP_MKNOD), \ | 414 | CAP_FS_MASK_B1 } }) |
399 | CAP_FS_MASK_B1 } }) | ||
400 | 415 | ||
401 | #endif /* _KERNEL_CAPABILITY_U32S != 2 */ | 416 | #endif /* _KERNEL_CAPABILITY_U32S != 2 */ |
402 | 417 | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 573819ef4cc0..5a40d14daa9f 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -143,7 +143,9 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
143 | * 400-499: Perfect | 143 | * 400-499: Perfect |
144 | * The ideal clocksource. A must-use where | 144 | * The ideal clocksource. A must-use where |
145 | * available. | 145 | * available. |
146 | * @read: returns a cycle value | 146 | * @read: returns a cycle value, passes clocksource as argument |
147 | * @enable: optional function to enable the clocksource | ||
148 | * @disable: optional function to disable the clocksource | ||
147 | * @mask: bitmask for two's complement | 149 | * @mask: bitmask for two's complement |
148 | * subtraction of non 64 bit counters | 150 | * subtraction of non 64 bit counters |
149 | * @mult: cycle to nanosecond multiplier (adjusted by NTP) | 151 | * @mult: cycle to nanosecond multiplier (adjusted by NTP) |
@@ -162,7 +164,9 @@ struct clocksource { | |||
162 | char *name; | 164 | char *name; |
163 | struct list_head list; | 165 | struct list_head list; |
164 | int rating; | 166 | int rating; |
165 | cycle_t (*read)(void); | 167 | cycle_t (*read)(struct clocksource *cs); |
168 | int (*enable)(struct clocksource *cs); | ||
169 | void (*disable)(struct clocksource *cs); | ||
166 | cycle_t mask; | 170 | cycle_t mask; |
167 | u32 mult; | 171 | u32 mult; |
168 | u32 mult_orig; | 172 | u32 mult_orig; |
@@ -271,7 +275,34 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant) | |||
271 | */ | 275 | */ |
272 | static inline cycle_t clocksource_read(struct clocksource *cs) | 276 | static inline cycle_t clocksource_read(struct clocksource *cs) |
273 | { | 277 | { |
274 | return cs->read(); | 278 | return cs->read(cs); |
279 | } | ||
280 | |||
281 | /** | ||
282 | * clocksource_enable: - enable clocksource | ||
283 | * @cs: pointer to clocksource | ||
284 | * | ||
285 | * Enables the specified clocksource. The clocksource callback | ||
286 | * function should start up the hardware and setup mult and field | ||
287 | * members of struct clocksource to reflect hardware capabilities. | ||
288 | */ | ||
289 | static inline int clocksource_enable(struct clocksource *cs) | ||
290 | { | ||
291 | return cs->enable ? cs->enable(cs) : 0; | ||
292 | } | ||
293 | |||
294 | /** | ||
295 | * clocksource_disable: - disable clocksource | ||
296 | * @cs: pointer to clocksource | ||
297 | * | ||
298 | * Disables the specified clocksource. The clocksource callback | ||
299 | * function should power down the now unused hardware block to | ||
300 | * save power. | ||
301 | */ | ||
302 | static inline void clocksource_disable(struct clocksource *cs) | ||
303 | { | ||
304 | if (cs->disable) | ||
305 | cs->disable(cs); | ||
275 | } | 306 | } |
276 | 307 | ||
277 | /** | 308 | /** |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 6faa7e549de4..37bcb50a4d7c 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -76,7 +76,8 @@ struct ftrace_branch_data { | |||
76 | * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code | 76 | * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code |
77 | * to disable branch tracing on a per file basis. | 77 | * to disable branch tracing on a per file basis. |
78 | */ | 78 | */ |
79 | #if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING) | 79 | #if defined(CONFIG_TRACE_BRANCH_PROFILING) \ |
80 | && !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__) | ||
80 | void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | 81 | void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); |
81 | 82 | ||
82 | #define likely_notrace(x) __builtin_expect(!!(x), 1) | 83 | #define likely_notrace(x) __builtin_expect(!!(x), 1) |
@@ -114,7 +115,9 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
114 | * "Define 'is'", Bill Clinton | 115 | * "Define 'is'", Bill Clinton |
115 | * "Define 'if'", Steven Rostedt | 116 | * "Define 'if'", Steven Rostedt |
116 | */ | 117 | */ |
117 | #define if(cond) if (__builtin_constant_p((cond)) ? !!(cond) : \ | 118 | #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) |
119 | #define __trace_if(cond) \ | ||
120 | if (__builtin_constant_p((cond)) ? !!(cond) : \ | ||
118 | ({ \ | 121 | ({ \ |
119 | int ______r; \ | 122 | int ______r; \ |
120 | static struct ftrace_branch_data \ | 123 | static struct ftrace_branch_data \ |
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 096476f1fb35..29b3ce3f2a1d 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
@@ -2,12 +2,20 @@ | |||
2 | #define __LINUX_DEBUG_LOCKING_H | 2 | #define __LINUX_DEBUG_LOCKING_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <asm/atomic.h> | ||
6 | #include <asm/system.h> | ||
5 | 7 | ||
6 | struct task_struct; | 8 | struct task_struct; |
7 | 9 | ||
8 | extern int debug_locks; | 10 | extern int debug_locks; |
9 | extern int debug_locks_silent; | 11 | extern int debug_locks_silent; |
10 | 12 | ||
13 | |||
14 | static inline int __debug_locks_off(void) | ||
15 | { | ||
16 | return xchg(&debug_locks, 0); | ||
17 | } | ||
18 | |||
11 | /* | 19 | /* |
12 | * Generic 'turn off all lock debugging' function: | 20 | * Generic 'turn off all lock debugging' function: |
13 | */ | 21 | */ |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 66ec05a57955..ded2d7c42668 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -116,7 +116,6 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d); | |||
116 | /* | 116 | /* |
117 | * Target features | 117 | * Target features |
118 | */ | 118 | */ |
119 | #define DM_TARGET_SUPPORTS_BARRIERS 0x00000001 | ||
120 | 119 | ||
121 | struct target_type { | 120 | struct target_type { |
122 | uint64_t features; | 121 | uint64_t features; |
diff --git a/include/linux/device.h b/include/linux/device.h index 2918c0e8fdfd..6a69caaac18a 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -551,6 +551,7 @@ extern int (*platform_notify_remove)(struct device *dev); | |||
551 | extern struct device *get_device(struct device *dev); | 551 | extern struct device *get_device(struct device *dev); |
552 | extern void put_device(struct device *dev); | 552 | extern void put_device(struct device *dev); |
553 | 553 | ||
554 | extern void wait_for_device_probe(void); | ||
554 | 555 | ||
555 | /* drivers/base/power/shutdown.c */ | 556 | /* drivers/base/power/shutdown.c */ |
556 | extern void device_shutdown(void); | 557 | extern void device_shutdown(void); |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index d7d090d21031..8083b6a36a38 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -115,7 +115,7 @@ static inline u64 dma_get_mask(struct device *dev) | |||
115 | { | 115 | { |
116 | if (dev && dev->dma_mask && *dev->dma_mask) | 116 | if (dev && dev->dma_mask && *dev->dma_mask) |
117 | return *dev->dma_mask; | 117 | return *dev->dma_mask; |
118 | return DMA_32BIT_MASK; | 118 | return DMA_BIT_MASK(32); |
119 | } | 119 | } |
120 | 120 | ||
121 | extern u64 dma_get_required_mask(struct device *dev); | 121 | extern u64 dma_get_required_mask(struct device *dev); |
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index baabf33be244..a0d9422a1569 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
@@ -70,7 +70,7 @@ extern int ddebug_remove_module(char *mod_name); | |||
70 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ | 70 | DEBUG_HASH2, __LINE__, _DPRINTK_FLAGS_DEFAULT }; \ |
71 | if (__dynamic_dbg_enabled(descriptor)) \ | 71 | if (__dynamic_dbg_enabled(descriptor)) \ |
72 | dev_printk(KERN_DEBUG, dev, \ | 72 | dev_printk(KERN_DEBUG, dev, \ |
73 | KBUILD_MODNAME ": " pr_fmt(fmt),\ | 73 | KBUILD_MODNAME ": " fmt, \ |
74 | ##__VA_ARGS__); \ | 74 | ##__VA_ARGS__); \ |
75 | } while (0) | 75 | } while (0) |
76 | 76 | ||
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 7a204256b155..c59b769f62b0 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -116,6 +116,7 @@ extern void elv_abort_queue(struct request_queue *); | |||
116 | extern void elv_completed_request(struct request_queue *, struct request *); | 116 | extern void elv_completed_request(struct request_queue *, struct request *); |
117 | extern int elv_set_request(struct request_queue *, struct request *, gfp_t); | 117 | extern int elv_set_request(struct request_queue *, struct request *, gfp_t); |
118 | extern void elv_put_request(struct request_queue *, struct request *); | 118 | extern void elv_put_request(struct request_queue *, struct request *); |
119 | extern void elv_drain_elevator(struct request_queue *); | ||
119 | 120 | ||
120 | /* | 121 | /* |
121 | * io scheduler registration | 122 | * io scheduler registration |
diff --git a/include/linux/fb.h b/include/linux/fb.h index f563c5013932..330c4b1bfcaa 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -173,8 +173,12 @@ struct fb_fix_screeninfo { | |||
173 | /* Interpretation of offset for color fields: All offsets are from the right, | 173 | /* Interpretation of offset for color fields: All offsets are from the right, |
174 | * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you | 174 | * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you |
175 | * can use the offset as right argument to <<). A pixel afterwards is a bit | 175 | * can use the offset as right argument to <<). A pixel afterwards is a bit |
176 | * stream and is written to video memory as that unmodified. This implies | 176 | * stream and is written to video memory as that unmodified. |
177 | * big-endian byte order if bits_per_pixel is greater than 8. | 177 | * |
178 | * For pseudocolor: offset and length should be the same for all color | ||
179 | * components. Offset specifies the position of the least significant bit | ||
180 | * of the pallette index in a pixel value. Length indicates the number | ||
181 | * of available palette entries (i.e. # of entries = 1 << length). | ||
178 | */ | 182 | */ |
179 | struct fb_bitfield { | 183 | struct fb_bitfield { |
180 | __u32 offset; /* beginning of bitfield */ | 184 | __u32 offset; /* beginning of bitfield */ |
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h index 671decbd2aeb..934e22d65801 100644 --- a/include/linux/fiemap.h +++ b/include/linux/fiemap.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef _LINUX_FIEMAP_H | 11 | #ifndef _LINUX_FIEMAP_H |
12 | #define _LINUX_FIEMAP_H | 12 | #define _LINUX_FIEMAP_H |
13 | 13 | ||
14 | #include <linux/types.h> | ||
15 | |||
14 | struct fiemap_extent { | 16 | struct fiemap_extent { |
15 | __u64 fe_logical; /* logical offset in bytes for the start of | 17 | __u64 fe_logical; /* logical offset in bytes for the start of |
16 | * the extent from the beginning of the file */ | 18 | * the extent from the beginning of the file */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index bce40a2207ee..5bed436f4353 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -87,6 +87,60 @@ struct inodes_stat_t { | |||
87 | */ | 87 | */ |
88 | #define FMODE_NOCMTIME ((__force fmode_t)2048) | 88 | #define FMODE_NOCMTIME ((__force fmode_t)2048) |
89 | 89 | ||
90 | /* | ||
91 | * The below are the various read and write types that we support. Some of | ||
92 | * them include behavioral modifiers that send information down to the | ||
93 | * block layer and IO scheduler. Terminology: | ||
94 | * | ||
95 | * The block layer uses device plugging to defer IO a little bit, in | ||
96 | * the hope that we will see more IO very shortly. This increases | ||
97 | * coalescing of adjacent IO and thus reduces the number of IOs we | ||
98 | * have to send to the device. It also allows for better queuing, | ||
99 | * if the IO isn't mergeable. If the caller is going to be waiting | ||
100 | * for the IO, then he must ensure that the device is unplugged so | ||
101 | * that the IO is dispatched to the driver. | ||
102 | * | ||
103 | * All IO is handled async in Linux. This is fine for background | ||
104 | * writes, but for reads or writes that someone waits for completion | ||
105 | * on, we want to notify the block layer and IO scheduler so that they | ||
106 | * know about it. That allows them to make better scheduling | ||
107 | * decisions. So when the below references 'sync' and 'async', it | ||
108 | * is referencing this priority hint. | ||
109 | * | ||
110 | * With that in mind, the available types are: | ||
111 | * | ||
112 | * READ A normal read operation. Device will be plugged. | ||
113 | * READ_SYNC A synchronous read. Device is not plugged, caller can | ||
114 | * immediately wait on this read without caring about | ||
115 | * unplugging. | ||
116 | * READA Used for read-ahead operations. Lower priority, and the | ||
117 | * block layer could (in theory) choose to ignore this | ||
118 | * request if it runs into resource problems. | ||
119 | * WRITE A normal async write. Device will be plugged. | ||
120 | * SWRITE Like WRITE, but a special case for ll_rw_block() that | ||
121 | * tells it to lock the buffer first. Normally a buffer | ||
122 | * must be locked before doing IO. | ||
123 | * WRITE_SYNC_PLUG Synchronous write. Identical to WRITE, but passes down | ||
124 | * the hint that someone will be waiting on this IO | ||
125 | * shortly. The device must still be unplugged explicitly, | ||
126 | * WRITE_SYNC_PLUG does not do this as we could be | ||
127 | * submitting more writes before we actually wait on any | ||
128 | * of them. | ||
129 | * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device | ||
130 | * immediately after submission. The write equivalent | ||
131 | * of READ_SYNC. | ||
132 | * WRITE_ODIRECT Special case write for O_DIRECT only. | ||
133 | * SWRITE_SYNC | ||
134 | * SWRITE_SYNC_PLUG Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer. | ||
135 | * See SWRITE. | ||
136 | * WRITE_BARRIER Like WRITE, but tells the block layer that all | ||
137 | * previously submitted writes must be safely on storage | ||
138 | * before this one is started. Also guarantees that when | ||
139 | * this write is complete, it itself is also safely on | ||
140 | * storage. Prevents reordering of writes on both sides | ||
141 | * of this IO. | ||
142 | * | ||
143 | */ | ||
90 | #define RW_MASK 1 | 144 | #define RW_MASK 1 |
91 | #define RWA_MASK 2 | 145 | #define RWA_MASK 2 |
92 | #define READ 0 | 146 | #define READ 0 |
@@ -102,6 +156,11 @@ struct inodes_stat_t { | |||
102 | (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) | 156 | (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) |
103 | #define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) | 157 | #define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) |
104 | #define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER)) | 158 | #define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER)) |
159 | |||
160 | /* | ||
161 | * These aren't really reads or writes, they pass down information about | ||
162 | * parts of device that are now unused by the file system. | ||
163 | */ | ||
105 | #define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) | 164 | #define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) |
106 | #define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) | 165 | #define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) |
107 | 166 | ||
@@ -738,9 +797,6 @@ enum inode_i_mutex_lock_class | |||
738 | I_MUTEX_QUOTA | 797 | I_MUTEX_QUOTA |
739 | }; | 798 | }; |
740 | 799 | ||
741 | extern void inode_double_lock(struct inode *inode1, struct inode *inode2); | ||
742 | extern void inode_double_unlock(struct inode *inode1, struct inode *inode2); | ||
743 | |||
744 | /* | 800 | /* |
745 | * NOTE: in a 32bit arch with a preemptable kernel and | 801 | * NOTE: in a 32bit arch with a preemptable kernel and |
746 | * an UP compile the i_size_read/write must be atomic | 802 | * an UP compile the i_size_read/write must be atomic |
@@ -1699,6 +1755,9 @@ struct file_system_type { | |||
1699 | struct lock_class_key i_alloc_sem_key; | 1755 | struct lock_class_key i_alloc_sem_key; |
1700 | }; | 1756 | }; |
1701 | 1757 | ||
1758 | extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data, | ||
1759 | int (*fill_super)(struct super_block *, void *, int), | ||
1760 | struct vfsmount *mnt); | ||
1702 | extern int get_sb_bdev(struct file_system_type *fs_type, | 1761 | extern int get_sb_bdev(struct file_system_type *fs_type, |
1703 | int flags, const char *dev_name, void *data, | 1762 | int flags, const char *dev_name, void *data, |
1704 | int (*fill_super)(struct super_block *, void *, int), | 1763 | int (*fill_super)(struct super_block *, void *, int), |
@@ -2147,8 +2206,6 @@ extern ssize_t generic_file_splice_read(struct file *, loff_t *, | |||
2147 | struct pipe_inode_info *, size_t, unsigned int); | 2206 | struct pipe_inode_info *, size_t, unsigned int); |
2148 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, | 2207 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, |
2149 | struct file *, loff_t *, size_t, unsigned int); | 2208 | struct file *, loff_t *, size_t, unsigned int); |
2150 | extern ssize_t generic_file_splice_write_nolock(struct pipe_inode_info *, | ||
2151 | struct file *, loff_t *, size_t, unsigned int); | ||
2152 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | 2209 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, |
2153 | struct file *out, loff_t *, size_t len, unsigned int flags); | 2210 | struct file *out, loff_t *, size_t len, unsigned int flags); |
2154 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | 2211 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, |
@@ -2242,9 +2299,8 @@ extern int vfs_readdir(struct file *, filldir_t, void *); | |||
2242 | 2299 | ||
2243 | extern int vfs_stat(char __user *, struct kstat *); | 2300 | extern int vfs_stat(char __user *, struct kstat *); |
2244 | extern int vfs_lstat(char __user *, struct kstat *); | 2301 | extern int vfs_lstat(char __user *, struct kstat *); |
2245 | extern int vfs_stat_fd(int dfd, char __user *, struct kstat *); | ||
2246 | extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *); | ||
2247 | extern int vfs_fstat(unsigned int, struct kstat *); | 2302 | extern int vfs_fstat(unsigned int, struct kstat *); |
2303 | extern int vfs_fstatat(int , char __user *, struct kstat *, int); | ||
2248 | 2304 | ||
2249 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | 2305 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, |
2250 | unsigned long arg); | 2306 | unsigned long arg); |
@@ -2392,7 +2448,7 @@ struct ctl_table; | |||
2392 | int proc_nr_files(struct ctl_table *table, int write, struct file *filp, | 2448 | int proc_nr_files(struct ctl_table *table, int write, struct file *filp, |
2393 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2449 | void __user *buffer, size_t *lenp, loff_t *ppos); |
2394 | 2450 | ||
2395 | int get_filesystem_list(char * buf); | 2451 | int __init get_filesystem_list(char *buf); |
2396 | 2452 | ||
2397 | #endif /* __KERNEL__ */ | 2453 | #endif /* __KERNEL__ */ |
2398 | #endif /* _LINUX_FS_H */ | 2454 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 7ef1caf50269..43fc95d822d5 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #define _FSL_DEVICE_H_ | 18 | #define _FSL_DEVICE_H_ |
19 | 19 | ||
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <linux/phy.h> | ||
22 | 21 | ||
23 | /* | 22 | /* |
24 | * Some conventions on how we handle peripherals on Freescale chips | 23 | * Some conventions on how we handle peripherals on Freescale chips |
@@ -44,31 +43,6 @@ | |||
44 | * | 43 | * |
45 | */ | 44 | */ |
46 | 45 | ||
47 | struct gianfar_platform_data { | ||
48 | /* device specific information */ | ||
49 | u32 device_flags; | ||
50 | char bus_id[BUS_ID_SIZE]; | ||
51 | phy_interface_t interface; | ||
52 | }; | ||
53 | |||
54 | struct gianfar_mdio_data { | ||
55 | /* board specific information */ | ||
56 | int irq[32]; | ||
57 | }; | ||
58 | |||
59 | /* Flags in gianfar_platform_data */ | ||
60 | #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */ | ||
61 | #define FSL_GIANFAR_BRD_IS_REDUCED 0x00000002 /* Set if RGMII, RMII */ | ||
62 | |||
63 | struct fsl_i2c_platform_data { | ||
64 | /* device specific information */ | ||
65 | u32 device_flags; | ||
66 | }; | ||
67 | |||
68 | /* Flags related to I2C device features */ | ||
69 | #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001 | ||
70 | #define FSL_I2C_DEV_CLOCK_5200 0x00000002 | ||
71 | |||
72 | enum fsl_usb2_operating_modes { | 46 | enum fsl_usb2_operating_modes { |
73 | FSL_USB2_MPH_HOST, | 47 | FSL_USB2_MPH_HOST, |
74 | FSL_USB2_DR_HOST, | 48 | FSL_USB2_DR_HOST, |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 015a3d22cf74..8a0c2f221e6b 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -356,6 +356,9 @@ struct ftrace_graph_ret { | |||
356 | 356 | ||
357 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 357 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
358 | 358 | ||
359 | /* for init task */ | ||
360 | #define INIT_FTRACE_GRAPH .ret_stack = NULL, | ||
361 | |||
359 | /* | 362 | /* |
360 | * Stack of return addresses for functions | 363 | * Stack of return addresses for functions |
361 | * of a thread. | 364 | * of a thread. |
@@ -430,10 +433,11 @@ static inline void unpause_graph_tracing(void) | |||
430 | { | 433 | { |
431 | atomic_dec(¤t->tracing_graph_pause); | 434 | atomic_dec(¤t->tracing_graph_pause); |
432 | } | 435 | } |
433 | #else | 436 | #else /* !CONFIG_FUNCTION_GRAPH_TRACER */ |
434 | 437 | ||
435 | #define __notrace_funcgraph | 438 | #define __notrace_funcgraph |
436 | #define __irq_entry | 439 | #define __irq_entry |
440 | #define INIT_FTRACE_GRAPH | ||
437 | 441 | ||
438 | static inline void ftrace_graph_init_task(struct task_struct *t) { } | 442 | static inline void ftrace_graph_init_task(struct task_struct *t) { } |
439 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } | 443 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } |
@@ -445,7 +449,7 @@ static inline int task_curr_ret_stack(struct task_struct *tsk) | |||
445 | 449 | ||
446 | static inline void pause_graph_tracing(void) { } | 450 | static inline void pause_graph_tracing(void) { } |
447 | static inline void unpause_graph_tracing(void) { } | 451 | static inline void unpause_graph_tracing(void) { } |
448 | #endif | 452 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
449 | 453 | ||
450 | #ifdef CONFIG_TRACING | 454 | #ifdef CONFIG_TRACING |
451 | #include <linux/sched.h> | 455 | #include <linux/sched.h> |
@@ -507,33 +511,4 @@ static inline void trace_hw_branch_oops(void) {} | |||
507 | 511 | ||
508 | #endif /* CONFIG_HW_BRANCH_TRACER */ | 512 | #endif /* CONFIG_HW_BRANCH_TRACER */ |
509 | 513 | ||
510 | /* | ||
511 | * A syscall entry in the ftrace syscalls array. | ||
512 | * | ||
513 | * @name: name of the syscall | ||
514 | * @nb_args: number of parameters it takes | ||
515 | * @types: list of types as strings | ||
516 | * @args: list of args as strings (args[i] matches types[i]) | ||
517 | */ | ||
518 | struct syscall_metadata { | ||
519 | const char *name; | ||
520 | int nb_args; | ||
521 | const char **types; | ||
522 | const char **args; | ||
523 | }; | ||
524 | |||
525 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
526 | extern void arch_init_ftrace_syscalls(void); | ||
527 | extern struct syscall_metadata *syscall_nr_to_meta(int nr); | ||
528 | extern void start_ftrace_syscalls(void); | ||
529 | extern void stop_ftrace_syscalls(void); | ||
530 | extern void ftrace_syscall_enter(struct pt_regs *regs); | ||
531 | extern void ftrace_syscall_exit(struct pt_regs *regs); | ||
532 | #else | ||
533 | static inline void start_ftrace_syscalls(void) { } | ||
534 | static inline void stop_ftrace_syscalls(void) { } | ||
535 | static inline void ftrace_syscall_enter(struct pt_regs *regs) { } | ||
536 | static inline void ftrace_syscall_exit(struct pt_regs *regs) { } | ||
537 | #endif | ||
538 | |||
539 | #endif /* _LINUX_FTRACE_H */ | 514 | #endif /* _LINUX_FTRACE_H */ |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index faa1cf848bcd..45257475623c 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -116,7 +116,7 @@ | |||
116 | # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET | 116 | # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | #ifdef CONFIG_SMP | 119 | #if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) |
120 | extern void synchronize_irq(unsigned int irq); | 120 | extern void synchronize_irq(unsigned int irq); |
121 | #else | 121 | #else |
122 | # define synchronize_irq(irq) barrier() | 122 | # define synchronize_irq(irq) barrier() |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index ee9fbc172405..c9087de5c6c6 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -51,6 +51,7 @@ | |||
51 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | 51 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ |
52 | #define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ | 52 | #define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ |
53 | #define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */ | 53 | #define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */ |
54 | #define I2C_HW_B_CX231XX 0x010024 /* Conexant CX231XX USB based cards */ | ||
54 | #define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ | 55 | #define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ |
55 | 56 | ||
56 | /* --- SGI adapters */ | 57 | /* --- SGI adapters */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 00ee11eb9092..ad2580596033 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -274,7 +274,7 @@ struct i2c_board_info { | |||
274 | * are provided using conventional syntax. | 274 | * are provided using conventional syntax. |
275 | */ | 275 | */ |
276 | #define I2C_BOARD_INFO(dev_type, dev_addr) \ | 276 | #define I2C_BOARD_INFO(dev_type, dev_addr) \ |
277 | .type = (dev_type), .addr = (dev_addr) | 277 | .type = dev_type, .addr = (dev_addr) |
278 | 278 | ||
279 | 279 | ||
280 | /* Add-on boards should register/unregister their devices; e.g. a board | 280 | /* Add-on boards should register/unregister their devices; e.g. a board |
diff --git a/include/linux/i2c/s6000.h b/include/linux/i2c/s6000.h new file mode 100644 index 000000000000..d9b34bfdae76 --- /dev/null +++ b/include/linux/i2c/s6000.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __LINUX_I2C_S6000_H | ||
2 | #define __LINUX_I2C_S6000_H | ||
3 | |||
4 | struct s6_i2c_platform_data { | ||
5 | const char *clock; /* the clock to use */ | ||
6 | int bus_num; /* the bus number to register */ | ||
7 | }; | ||
8 | |||
9 | #endif | ||
10 | |||
diff --git a/include/linux/ide.h b/include/linux/ide.h index a5d26f66ef78..ff65fffb078f 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -240,65 +240,38 @@ typedef enum { | |||
240 | } ide_startstop_t; | 240 | } ide_startstop_t; |
241 | 241 | ||
242 | enum { | 242 | enum { |
243 | IDE_VALID_ERROR = (1 << 1), | ||
244 | IDE_VALID_FEATURE = IDE_VALID_ERROR, | ||
245 | IDE_VALID_NSECT = (1 << 2), | ||
246 | IDE_VALID_LBAL = (1 << 3), | ||
247 | IDE_VALID_LBAM = (1 << 4), | ||
248 | IDE_VALID_LBAH = (1 << 5), | ||
249 | IDE_VALID_DEVICE = (1 << 6), | ||
250 | IDE_VALID_LBA = IDE_VALID_LBAL | | ||
251 | IDE_VALID_LBAM | | ||
252 | IDE_VALID_LBAH, | ||
253 | IDE_VALID_OUT_TF = IDE_VALID_FEATURE | | ||
254 | IDE_VALID_NSECT | | ||
255 | IDE_VALID_LBA, | ||
256 | IDE_VALID_IN_TF = IDE_VALID_NSECT | | ||
257 | IDE_VALID_LBA, | ||
258 | IDE_VALID_OUT_HOB = IDE_VALID_OUT_TF, | ||
259 | IDE_VALID_IN_HOB = IDE_VALID_ERROR | | ||
260 | IDE_VALID_NSECT | | ||
261 | IDE_VALID_LBA, | ||
262 | }; | ||
263 | |||
264 | enum { | ||
243 | IDE_TFLAG_LBA48 = (1 << 0), | 265 | IDE_TFLAG_LBA48 = (1 << 0), |
244 | IDE_TFLAG_OUT_HOB_FEATURE = (1 << 1), | 266 | IDE_TFLAG_WRITE = (1 << 1), |
245 | IDE_TFLAG_OUT_HOB_NSECT = (1 << 2), | 267 | IDE_TFLAG_CUSTOM_HANDLER = (1 << 2), |
246 | IDE_TFLAG_OUT_HOB_LBAL = (1 << 3), | 268 | IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 3), |
247 | IDE_TFLAG_OUT_HOB_LBAM = (1 << 4), | ||
248 | IDE_TFLAG_OUT_HOB_LBAH = (1 << 5), | ||
249 | IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE | | ||
250 | IDE_TFLAG_OUT_HOB_NSECT | | ||
251 | IDE_TFLAG_OUT_HOB_LBAL | | ||
252 | IDE_TFLAG_OUT_HOB_LBAM | | ||
253 | IDE_TFLAG_OUT_HOB_LBAH, | ||
254 | IDE_TFLAG_OUT_FEATURE = (1 << 6), | ||
255 | IDE_TFLAG_OUT_NSECT = (1 << 7), | ||
256 | IDE_TFLAG_OUT_LBAL = (1 << 8), | ||
257 | IDE_TFLAG_OUT_LBAM = (1 << 9), | ||
258 | IDE_TFLAG_OUT_LBAH = (1 << 10), | ||
259 | IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE | | ||
260 | IDE_TFLAG_OUT_NSECT | | ||
261 | IDE_TFLAG_OUT_LBAL | | ||
262 | IDE_TFLAG_OUT_LBAM | | ||
263 | IDE_TFLAG_OUT_LBAH, | ||
264 | IDE_TFLAG_OUT_DEVICE = (1 << 11), | ||
265 | IDE_TFLAG_WRITE = (1 << 12), | ||
266 | IDE_TFLAG_CUSTOM_HANDLER = (1 << 13), | ||
267 | IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 14), | ||
268 | IDE_TFLAG_IN_HOB_ERROR = (1 << 15), | ||
269 | IDE_TFLAG_IN_HOB_NSECT = (1 << 16), | ||
270 | IDE_TFLAG_IN_HOB_LBAL = (1 << 17), | ||
271 | IDE_TFLAG_IN_HOB_LBAM = (1 << 18), | ||
272 | IDE_TFLAG_IN_HOB_LBAH = (1 << 19), | ||
273 | IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL | | ||
274 | IDE_TFLAG_IN_HOB_LBAM | | ||
275 | IDE_TFLAG_IN_HOB_LBAH, | ||
276 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_ERROR | | ||
277 | IDE_TFLAG_IN_HOB_NSECT | | ||
278 | IDE_TFLAG_IN_HOB_LBA, | ||
279 | IDE_TFLAG_IN_ERROR = (1 << 20), | ||
280 | IDE_TFLAG_IN_NSECT = (1 << 21), | ||
281 | IDE_TFLAG_IN_LBAL = (1 << 22), | ||
282 | IDE_TFLAG_IN_LBAM = (1 << 23), | ||
283 | IDE_TFLAG_IN_LBAH = (1 << 24), | ||
284 | IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL | | ||
285 | IDE_TFLAG_IN_LBAM | | ||
286 | IDE_TFLAG_IN_LBAH, | ||
287 | IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT | | ||
288 | IDE_TFLAG_IN_LBA, | ||
289 | IDE_TFLAG_IN_DEVICE = (1 << 25), | ||
290 | IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB | | ||
291 | IDE_TFLAG_IN_HOB, | ||
292 | IDE_TFLAG_TF = IDE_TFLAG_OUT_TF | | ||
293 | IDE_TFLAG_IN_TF, | ||
294 | IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE | | ||
295 | IDE_TFLAG_IN_DEVICE, | ||
296 | /* force 16-bit I/O operations */ | 269 | /* force 16-bit I/O operations */ |
297 | IDE_TFLAG_IO_16BIT = (1 << 26), | 270 | IDE_TFLAG_IO_16BIT = (1 << 4), |
298 | /* struct ide_cmd was allocated using kmalloc() */ | 271 | /* struct ide_cmd was allocated using kmalloc() */ |
299 | IDE_TFLAG_DYN = (1 << 27), | 272 | IDE_TFLAG_DYN = (1 << 5), |
300 | IDE_TFLAG_FS = (1 << 28), | 273 | IDE_TFLAG_FS = (1 << 6), |
301 | IDE_TFLAG_MULTI_PIO = (1 << 29), | 274 | IDE_TFLAG_MULTI_PIO = (1 << 7), |
302 | }; | 275 | }; |
303 | 276 | ||
304 | enum { | 277 | enum { |
@@ -309,45 +282,34 @@ enum { | |||
309 | }; | 282 | }; |
310 | 283 | ||
311 | struct ide_taskfile { | 284 | struct ide_taskfile { |
312 | u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */ | 285 | u8 data; /* 0: data byte (for TASKFILE ioctl) */ |
313 | /* 1-5: additional data to support LBA48 */ | 286 | union { /* 1: */ |
314 | union { | 287 | u8 error; /* read: error */ |
315 | u8 hob_error; /* read: error */ | 288 | u8 feature; /* write: feature */ |
316 | u8 hob_feature; /* write: feature */ | ||
317 | }; | ||
318 | |||
319 | u8 hob_nsect; | ||
320 | u8 hob_lbal; | ||
321 | u8 hob_lbam; | ||
322 | u8 hob_lbah; | ||
323 | |||
324 | u8 data; /* 6: low data byte (for TASKFILE IOCTL) */ | ||
325 | |||
326 | union { /* Â 7: */ | ||
327 | u8 error; /* read: error */ | ||
328 | u8 feature; /* write: feature */ | ||
329 | }; | 289 | }; |
330 | 290 | u8 nsect; /* 2: number of sectors */ | |
331 | u8 nsect; /* 8: number of sectors */ | 291 | u8 lbal; /* 3: LBA low */ |
332 | u8 lbal; /* 9: LBA low */ | 292 | u8 lbam; /* 4: LBA mid */ |
333 | u8 lbam; /* 10: LBA mid */ | 293 | u8 lbah; /* 5: LBA high */ |
334 | u8 lbah; /* 11: LBA high */ | 294 | u8 device; /* 6: device select */ |
335 | 295 | union { /* 7: */ | |
336 | u8 device; /* 12: device select */ | 296 | u8 status; /* read: status */ |
337 | |||
338 | union { /* 13: */ | ||
339 | u8 status; /*  read: status  */ | ||
340 | u8 command; /* write: command */ | 297 | u8 command; /* write: command */ |
341 | }; | 298 | }; |
342 | }; | 299 | }; |
343 | 300 | ||
344 | struct ide_cmd { | 301 | struct ide_cmd { |
345 | union { | 302 | struct ide_taskfile tf; |
346 | struct ide_taskfile tf; | 303 | struct ide_taskfile hob; |
347 | u8 tf_array[14]; | 304 | struct { |
348 | }; | 305 | struct { |
306 | u8 tf; | ||
307 | u8 hob; | ||
308 | } out, in; | ||
309 | } valid; | ||
310 | |||
311 | u8 tf_flags; | ||
349 | u8 ftf_flags; /* for TASKFILE ioctl */ | 312 | u8 ftf_flags; /* for TASKFILE ioctl */ |
350 | u32 tf_flags; | ||
351 | int protocol; | 313 | int protocol; |
352 | 314 | ||
353 | int sg_nents; /* number of sg entries */ | 315 | int sg_nents; /* number of sg entries */ |
@@ -662,8 +624,8 @@ struct ide_tp_ops { | |||
662 | void (*write_devctl)(struct hwif_s *, u8); | 624 | void (*write_devctl)(struct hwif_s *, u8); |
663 | 625 | ||
664 | void (*dev_select)(ide_drive_t *); | 626 | void (*dev_select)(ide_drive_t *); |
665 | void (*tf_load)(ide_drive_t *, struct ide_cmd *); | 627 | void (*tf_load)(ide_drive_t *, struct ide_taskfile *, u8); |
666 | void (*tf_read)(ide_drive_t *, struct ide_cmd *); | 628 | void (*tf_read)(ide_drive_t *, struct ide_taskfile *, u8); |
667 | 629 | ||
668 | void (*input_data)(ide_drive_t *, struct ide_cmd *, | 630 | void (*input_data)(ide_drive_t *, struct ide_cmd *, |
669 | void *, unsigned int); | 631 | void *, unsigned int); |
@@ -1162,7 +1124,8 @@ extern int ide_devset_execute(ide_drive_t *drive, | |||
1162 | void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8); | 1124 | void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8); |
1163 | int ide_complete_rq(ide_drive_t *, int, unsigned int); | 1125 | int ide_complete_rq(ide_drive_t *, int, unsigned int); |
1164 | 1126 | ||
1165 | void ide_tf_dump(const char *, struct ide_taskfile *); | 1127 | void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd); |
1128 | void ide_tf_dump(const char *, struct ide_cmd *); | ||
1166 | 1129 | ||
1167 | void ide_exec_command(ide_hwif_t *, u8); | 1130 | void ide_exec_command(ide_hwif_t *, u8); |
1168 | u8 ide_read_status(ide_hwif_t *); | 1131 | u8 ide_read_status(ide_hwif_t *); |
@@ -1170,8 +1133,8 @@ u8 ide_read_altstatus(ide_hwif_t *); | |||
1170 | void ide_write_devctl(ide_hwif_t *, u8); | 1133 | void ide_write_devctl(ide_hwif_t *, u8); |
1171 | 1134 | ||
1172 | void ide_dev_select(ide_drive_t *); | 1135 | void ide_dev_select(ide_drive_t *); |
1173 | void ide_tf_load(ide_drive_t *, struct ide_cmd *); | 1136 | void ide_tf_load(ide_drive_t *, struct ide_taskfile *, u8); |
1174 | void ide_tf_read(ide_drive_t *, struct ide_cmd *); | 1137 | void ide_tf_read(ide_drive_t *, struct ide_taskfile *, u8); |
1175 | 1138 | ||
1176 | void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); | 1139 | void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); |
1177 | void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); | 1140 | void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); |
@@ -1529,7 +1492,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) | |||
1529 | 1492 | ||
1530 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1493 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1531 | 1494 | ||
1532 | u64 ide_get_lba_addr(struct ide_taskfile *, int); | 1495 | u64 ide_get_lba_addr(struct ide_cmd *, int); |
1533 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1496 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
1534 | 1497 | ||
1535 | struct ide_timing { | 1498 | struct ide_timing { |
diff --git a/include/linux/init.h b/include/linux/init.h index 68cb0265d009..f121a7a10c3d 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -247,6 +247,7 @@ struct obs_kernel_param { | |||
247 | 247 | ||
248 | /* Relies on boot_command_line being set */ | 248 | /* Relies on boot_command_line being set */ |
249 | void __init parse_early_param(void); | 249 | void __init parse_early_param(void); |
250 | void __init parse_early_options(char *cmdline); | ||
250 | #endif /* __ASSEMBLY__ */ | 251 | #endif /* __ASSEMBLY__ */ |
251 | 252 | ||
252 | /** | 253 | /** |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index af1de95e711e..d87247d2641f 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/irqflags.h> | 5 | #include <linux/irqflags.h> |
6 | #include <linux/utsname.h> | 6 | #include <linux/utsname.h> |
7 | #include <linux/lockdep.h> | 7 | #include <linux/lockdep.h> |
8 | #include <linux/ftrace.h> | ||
8 | #include <linux/ipc.h> | 9 | #include <linux/ipc.h> |
9 | #include <linux/pid_namespace.h> | 10 | #include <linux/pid_namespace.h> |
10 | #include <linux/user_namespace.h> | 11 | #include <linux/user_namespace.h> |
@@ -14,19 +15,6 @@ | |||
14 | extern struct files_struct init_files; | 15 | extern struct files_struct init_files; |
15 | extern struct fs_struct init_fs; | 16 | extern struct fs_struct init_fs; |
16 | 17 | ||
17 | #define INIT_KIOCTX(name, which_mm) \ | ||
18 | { \ | ||
19 | .users = ATOMIC_INIT(1), \ | ||
20 | .dead = 0, \ | ||
21 | .mm = &which_mm, \ | ||
22 | .user_id = 0, \ | ||
23 | .next = NULL, \ | ||
24 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \ | ||
25 | .ctx_lock = __SPIN_LOCK_UNLOCKED(name.ctx_lock), \ | ||
26 | .reqs_active = 0U, \ | ||
27 | .max_reqs = ~0U, \ | ||
28 | } | ||
29 | |||
30 | #define INIT_MM(name) \ | 18 | #define INIT_MM(name) \ |
31 | { \ | 19 | { \ |
32 | .mm_rb = RB_ROOT, \ | 20 | .mm_rb = RB_ROOT, \ |
@@ -185,6 +173,7 @@ extern struct cred init_cred; | |||
185 | INIT_IDS \ | 173 | INIT_IDS \ |
186 | INIT_TRACE_IRQFLAGS \ | 174 | INIT_TRACE_IRQFLAGS \ |
187 | INIT_LOCKDEP \ | 175 | INIT_LOCKDEP \ |
176 | INIT_FTRACE_GRAPH \ | ||
188 | } | 177 | } |
189 | 178 | ||
190 | 179 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 8a9613d0c674..91bb76f44f14 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -59,6 +59,18 @@ | |||
59 | #define IRQF_NOBALANCING 0x00000800 | 59 | #define IRQF_NOBALANCING 0x00000800 |
60 | #define IRQF_IRQPOLL 0x00001000 | 60 | #define IRQF_IRQPOLL 0x00001000 |
61 | 61 | ||
62 | /* | ||
63 | * Bits used by threaded handlers: | ||
64 | * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run | ||
65 | * IRQTF_DIED - handler thread died | ||
66 | * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed | ||
67 | */ | ||
68 | enum { | ||
69 | IRQTF_RUNTHREAD, | ||
70 | IRQTF_DIED, | ||
71 | IRQTF_WARNED, | ||
72 | }; | ||
73 | |||
62 | typedef irqreturn_t (*irq_handler_t)(int, void *); | 74 | typedef irqreturn_t (*irq_handler_t)(int, void *); |
63 | 75 | ||
64 | /** | 76 | /** |
@@ -71,6 +83,9 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
71 | * @next: pointer to the next irqaction for shared interrupts | 83 | * @next: pointer to the next irqaction for shared interrupts |
72 | * @irq: interrupt number | 84 | * @irq: interrupt number |
73 | * @dir: pointer to the proc/irq/NN/name entry | 85 | * @dir: pointer to the proc/irq/NN/name entry |
86 | * @thread_fn: interupt handler function for threaded interrupts | ||
87 | * @thread: thread pointer for threaded interrupts | ||
88 | * @thread_flags: flags related to @thread | ||
74 | */ | 89 | */ |
75 | struct irqaction { | 90 | struct irqaction { |
76 | irq_handler_t handler; | 91 | irq_handler_t handler; |
@@ -81,18 +96,68 @@ struct irqaction { | |||
81 | struct irqaction *next; | 96 | struct irqaction *next; |
82 | int irq; | 97 | int irq; |
83 | struct proc_dir_entry *dir; | 98 | struct proc_dir_entry *dir; |
99 | irq_handler_t thread_fn; | ||
100 | struct task_struct *thread; | ||
101 | unsigned long thread_flags; | ||
84 | }; | 102 | }; |
85 | 103 | ||
86 | extern irqreturn_t no_action(int cpl, void *dev_id); | 104 | extern irqreturn_t no_action(int cpl, void *dev_id); |
87 | extern int __must_check request_irq(unsigned int, irq_handler_t handler, | 105 | |
88 | unsigned long, const char *, void *); | 106 | #ifdef CONFIG_GENERIC_HARDIRQS |
107 | extern int __must_check | ||
108 | request_threaded_irq(unsigned int irq, irq_handler_t handler, | ||
109 | irq_handler_t thread_fn, | ||
110 | unsigned long flags, const char *name, void *dev); | ||
111 | |||
112 | static inline int __must_check | ||
113 | request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, | ||
114 | const char *name, void *dev) | ||
115 | { | ||
116 | return request_threaded_irq(irq, handler, NULL, flags, name, dev); | ||
117 | } | ||
118 | |||
119 | extern void exit_irq_thread(void); | ||
120 | #else | ||
121 | |||
122 | extern int __must_check | ||
123 | request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, | ||
124 | const char *name, void *dev); | ||
125 | |||
126 | /* | ||
127 | * Special function to avoid ifdeffery in kernel/irq/devres.c which | ||
128 | * gets magically built by GENERIC_HARDIRQS=n architectures (sparc, | ||
129 | * m68k). I really love these $@%#!* obvious Makefile references: | ||
130 | * ../../../kernel/irq/devres.o | ||
131 | */ | ||
132 | static inline int __must_check | ||
133 | request_threaded_irq(unsigned int irq, irq_handler_t handler, | ||
134 | irq_handler_t thread_fn, | ||
135 | unsigned long flags, const char *name, void *dev) | ||
136 | { | ||
137 | return request_irq(irq, handler, flags, name, dev); | ||
138 | } | ||
139 | |||
140 | static inline void exit_irq_thread(void) { } | ||
141 | #endif | ||
142 | |||
89 | extern void free_irq(unsigned int, void *); | 143 | extern void free_irq(unsigned int, void *); |
90 | 144 | ||
91 | struct device; | 145 | struct device; |
92 | 146 | ||
93 | extern int __must_check devm_request_irq(struct device *dev, unsigned int irq, | 147 | extern int __must_check |
94 | irq_handler_t handler, unsigned long irqflags, | 148 | devm_request_threaded_irq(struct device *dev, unsigned int irq, |
95 | const char *devname, void *dev_id); | 149 | irq_handler_t handler, irq_handler_t thread_fn, |
150 | unsigned long irqflags, const char *devname, | ||
151 | void *dev_id); | ||
152 | |||
153 | static inline int __must_check | ||
154 | devm_request_irq(struct device *dev, unsigned int irq, irq_handler_t handler, | ||
155 | unsigned long irqflags, const char *devname, void *dev_id) | ||
156 | { | ||
157 | return devm_request_threaded_irq(dev, irq, handler, NULL, irqflags, | ||
158 | devname, dev_id); | ||
159 | } | ||
160 | |||
96 | extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id); | 161 | extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id); |
97 | 162 | ||
98 | /* | 163 | /* |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index ea330f9e7100..3bf40e246a80 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
@@ -25,7 +25,7 @@ struct ipc_ids { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | struct ipc_namespace { | 27 | struct ipc_namespace { |
28 | struct kref kref; | 28 | atomic_t count; |
29 | struct ipc_ids ids[3]; | 29 | struct ipc_ids ids[3]; |
30 | 30 | ||
31 | int sem_ctls[4]; | 31 | int sem_ctls[4]; |
@@ -44,25 +44,57 @@ struct ipc_namespace { | |||
44 | int shm_tot; | 44 | int shm_tot; |
45 | 45 | ||
46 | struct notifier_block ipcns_nb; | 46 | struct notifier_block ipcns_nb; |
47 | |||
48 | /* The kern_mount of the mqueuefs sb. We take a ref on it */ | ||
49 | struct vfsmount *mq_mnt; | ||
50 | |||
51 | /* # queues in this ns, protected by mq_lock */ | ||
52 | unsigned int mq_queues_count; | ||
53 | |||
54 | /* next fields are set through sysctl */ | ||
55 | unsigned int mq_queues_max; /* initialized to DFLT_QUEUESMAX */ | ||
56 | unsigned int mq_msg_max; /* initialized to DFLT_MSGMAX */ | ||
57 | unsigned int mq_msgsize_max; /* initialized to DFLT_MSGSIZEMAX */ | ||
58 | |||
47 | }; | 59 | }; |
48 | 60 | ||
49 | extern struct ipc_namespace init_ipc_ns; | 61 | extern struct ipc_namespace init_ipc_ns; |
50 | extern atomic_t nr_ipc_ns; | 62 | extern atomic_t nr_ipc_ns; |
51 | 63 | ||
52 | #ifdef CONFIG_SYSVIPC | 64 | extern spinlock_t mq_lock; |
65 | #if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC) | ||
53 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | 66 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, |
67 | #else | ||
68 | #define INIT_IPC_NS(ns) | ||
69 | #endif | ||
54 | 70 | ||
71 | #ifdef CONFIG_SYSVIPC | ||
55 | extern int register_ipcns_notifier(struct ipc_namespace *); | 72 | extern int register_ipcns_notifier(struct ipc_namespace *); |
56 | extern int cond_register_ipcns_notifier(struct ipc_namespace *); | 73 | extern int cond_register_ipcns_notifier(struct ipc_namespace *); |
57 | extern void unregister_ipcns_notifier(struct ipc_namespace *); | 74 | extern void unregister_ipcns_notifier(struct ipc_namespace *); |
58 | extern int ipcns_notify(unsigned long); | 75 | extern int ipcns_notify(unsigned long); |
59 | |||
60 | #else /* CONFIG_SYSVIPC */ | 76 | #else /* CONFIG_SYSVIPC */ |
61 | #define INIT_IPC_NS(ns) | 77 | static inline int register_ipcns_notifier(struct ipc_namespace *ns) |
78 | { return 0; } | ||
79 | static inline int cond_register_ipcns_notifier(struct ipc_namespace *ns) | ||
80 | { return 0; } | ||
81 | static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { } | ||
82 | static inline int ipcns_notify(unsigned long l) { return 0; } | ||
62 | #endif /* CONFIG_SYSVIPC */ | 83 | #endif /* CONFIG_SYSVIPC */ |
63 | 84 | ||
64 | #if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS) | 85 | #ifdef CONFIG_POSIX_MQUEUE |
65 | extern void free_ipc_ns(struct kref *kref); | 86 | extern int mq_init_ns(struct ipc_namespace *ns); |
87 | /* default values */ | ||
88 | #define DFLT_QUEUESMAX 256 /* max number of message queues */ | ||
89 | #define DFLT_MSGMAX 10 /* max number of messages in each queue */ | ||
90 | #define HARD_MSGMAX (131072/sizeof(void *)) | ||
91 | #define DFLT_MSGSIZEMAX 8192 /* max message size */ | ||
92 | #else | ||
93 | static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; } | ||
94 | #endif | ||
95 | |||
96 | #if defined(CONFIG_IPC_NS) | ||
97 | extern void free_ipc_ns(struct ipc_namespace *ns); | ||
66 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | 98 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, |
67 | struct ipc_namespace *ns); | 99 | struct ipc_namespace *ns); |
68 | extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, | 100 | extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, |
@@ -72,14 +104,11 @@ extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, | |||
72 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 104 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
73 | { | 105 | { |
74 | if (ns) | 106 | if (ns) |
75 | kref_get(&ns->kref); | 107 | atomic_inc(&ns->count); |
76 | return ns; | 108 | return ns; |
77 | } | 109 | } |
78 | 110 | ||
79 | static inline void put_ipc_ns(struct ipc_namespace *ns) | 111 | extern void put_ipc_ns(struct ipc_namespace *ns); |
80 | { | ||
81 | kref_put(&ns->kref, free_ipc_ns); | ||
82 | } | ||
83 | #else | 112 | #else |
84 | static inline struct ipc_namespace *copy_ipcs(unsigned long flags, | 113 | static inline struct ipc_namespace *copy_ipcs(unsigned long flags, |
85 | struct ipc_namespace *ns) | 114 | struct ipc_namespace *ns) |
@@ -99,4 +128,18 @@ static inline void put_ipc_ns(struct ipc_namespace *ns) | |||
99 | { | 128 | { |
100 | } | 129 | } |
101 | #endif | 130 | #endif |
131 | |||
132 | #ifdef CONFIG_POSIX_MQUEUE_SYSCTL | ||
133 | |||
134 | struct ctl_table_header; | ||
135 | extern struct ctl_table_header *mq_register_sysctl_table(void); | ||
136 | |||
137 | #else /* CONFIG_POSIX_MQUEUE_SYSCTL */ | ||
138 | |||
139 | static inline struct ctl_table_header *mq_register_sysctl_table(void) | ||
140 | { | ||
141 | return NULL; | ||
142 | } | ||
143 | |||
144 | #endif /* CONFIG_POSIX_MQUEUE_SYSCTL */ | ||
102 | #endif | 145 | #endif |
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 7ebdb4fb4e54..65aae34759de 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -198,6 +198,8 @@ struct kernel_ipmi_msg { | |||
198 | response. When you send a | 198 | response. When you send a |
199 | response message, this will | 199 | response message, this will |
200 | be returned. */ | 200 | be returned. */ |
201 | #define IPMI_OEM_RECV_TYPE 5 /* The response for OEM Channels */ | ||
202 | |||
201 | /* Note that async events and received commands do not have a completion | 203 | /* Note that async events and received commands do not have a completion |
202 | code as the first byte of the incoming data, unlike a response. */ | 204 | code as the first byte of the incoming data, unlike a response. */ |
203 | 205 | ||
diff --git a/include/linux/ipmi_msgdefs.h b/include/linux/ipmi_msgdefs.h index b56a158d587a..df97e6e31e87 100644 --- a/include/linux/ipmi_msgdefs.h +++ b/include/linux/ipmi_msgdefs.h | |||
@@ -58,6 +58,12 @@ | |||
58 | #define IPMI_READ_EVENT_MSG_BUFFER_CMD 0x35 | 58 | #define IPMI_READ_EVENT_MSG_BUFFER_CMD 0x35 |
59 | #define IPMI_GET_CHANNEL_INFO_CMD 0x42 | 59 | #define IPMI_GET_CHANNEL_INFO_CMD 0x42 |
60 | 60 | ||
61 | /* Bit for BMC global enables. */ | ||
62 | #define IPMI_BMC_RCV_MSG_INTR 0x01 | ||
63 | #define IPMI_BMC_EVT_MSG_INTR 0x02 | ||
64 | #define IPMI_BMC_EVT_MSG_BUFF 0x04 | ||
65 | #define IPMI_BMC_SYS_LOG 0x08 | ||
66 | |||
61 | #define IPMI_NETFN_STORAGE_REQUEST 0x0a | 67 | #define IPMI_NETFN_STORAGE_REQUEST 0x0a |
62 | #define IPMI_NETFN_STORAGE_RESPONSE 0x0b | 68 | #define IPMI_NETFN_STORAGE_RESPONSE 0x0b |
63 | #define IPMI_ADD_SEL_ENTRY_CMD 0x44 | 69 | #define IPMI_ADD_SEL_ENTRY_CMD 0x44 |
@@ -109,5 +115,7 @@ | |||
109 | #define IPMI_CHANNEL_MEDIUM_USB1 10 | 115 | #define IPMI_CHANNEL_MEDIUM_USB1 10 |
110 | #define IPMI_CHANNEL_MEDIUM_USB2 11 | 116 | #define IPMI_CHANNEL_MEDIUM_USB2 11 |
111 | #define IPMI_CHANNEL_MEDIUM_SYSINTF 12 | 117 | #define IPMI_CHANNEL_MEDIUM_SYSINTF 12 |
118 | #define IPMI_CHANNEL_MEDIUM_OEM_MIN 0x60 | ||
119 | #define IPMI_CHANNEL_MEDIUM_OEM_MAX 0x7f | ||
112 | 120 | ||
113 | #endif /* __LINUX_IPMI_MSGDEFS_H */ | 121 | #endif /* __LINUX_IPMI_MSGDEFS_H */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 974890b3c52f..b7cbeed972e4 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/irqnr.h> | 22 | #include <linux/irqnr.h> |
23 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
24 | #include <linux/topology.h> | 24 | #include <linux/topology.h> |
25 | #include <linux/wait.h> | ||
25 | 26 | ||
26 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
27 | #include <asm/ptrace.h> | 28 | #include <asm/ptrace.h> |
@@ -158,6 +159,8 @@ struct irq_2_iommu; | |||
158 | * @affinity: IRQ affinity on SMP | 159 | * @affinity: IRQ affinity on SMP |
159 | * @cpu: cpu index useful for balancing | 160 | * @cpu: cpu index useful for balancing |
160 | * @pending_mask: pending rebalanced interrupts | 161 | * @pending_mask: pending rebalanced interrupts |
162 | * @threads_active: number of irqaction threads currently running | ||
163 | * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers | ||
161 | * @dir: /proc/irq/ procfs entry | 164 | * @dir: /proc/irq/ procfs entry |
162 | * @name: flow handler name for /proc/interrupts output | 165 | * @name: flow handler name for /proc/interrupts output |
163 | */ | 166 | */ |
@@ -189,6 +192,8 @@ struct irq_desc { | |||
189 | cpumask_var_t pending_mask; | 192 | cpumask_var_t pending_mask; |
190 | #endif | 193 | #endif |
191 | #endif | 194 | #endif |
195 | atomic_t threads_active; | ||
196 | wait_queue_head_t wait_for_threads; | ||
192 | #ifdef CONFIG_PROC_FS | 197 | #ifdef CONFIG_PROC_FS |
193 | struct proc_dir_entry *dir; | 198 | struct proc_dir_entry *dir; |
194 | #endif | 199 | #endif |
@@ -482,6 +487,16 @@ static inline void init_copy_desc_masks(struct irq_desc *old_desc, | |||
482 | #endif | 487 | #endif |
483 | } | 488 | } |
484 | 489 | ||
490 | static inline void free_desc_masks(struct irq_desc *old_desc, | ||
491 | struct irq_desc *new_desc) | ||
492 | { | ||
493 | free_cpumask_var(old_desc->affinity); | ||
494 | |||
495 | #ifdef CONFIG_GENERIC_PENDING_IRQ | ||
496 | free_cpumask_var(old_desc->pending_mask); | ||
497 | #endif | ||
498 | } | ||
499 | |||
485 | #else /* !CONFIG_SMP */ | 500 | #else /* !CONFIG_SMP */ |
486 | 501 | ||
487 | static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, | 502 | static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, |
@@ -495,6 +510,10 @@ static inline void init_copy_desc_masks(struct irq_desc *old_desc, | |||
495 | { | 510 | { |
496 | } | 511 | } |
497 | 512 | ||
513 | static inline void free_desc_masks(struct irq_desc *old_desc, | ||
514 | struct irq_desc *new_desc) | ||
515 | { | ||
516 | } | ||
498 | #endif /* CONFIG_SMP */ | 517 | #endif /* CONFIG_SMP */ |
499 | 518 | ||
500 | #endif /* _LINUX_IRQ_H */ | 519 | #endif /* _LINUX_IRQ_H */ |
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index c5584ca5b8c9..819acaaac3f5 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h | |||
@@ -5,10 +5,12 @@ | |||
5 | * enum irqreturn | 5 | * enum irqreturn |
6 | * @IRQ_NONE interrupt was not from this device | 6 | * @IRQ_NONE interrupt was not from this device |
7 | * @IRQ_HANDLED interrupt was handled by this device | 7 | * @IRQ_HANDLED interrupt was handled by this device |
8 | * @IRQ_WAKE_THREAD handler requests to wake the handler thread | ||
8 | */ | 9 | */ |
9 | enum irqreturn { | 10 | enum irqreturn { |
10 | IRQ_NONE, | 11 | IRQ_NONE, |
11 | IRQ_HANDLED, | 12 | IRQ_HANDLED, |
13 | IRQ_WAKE_THREAD, | ||
12 | }; | 14 | }; |
13 | 15 | ||
14 | typedef enum irqreturn irqreturn_t; | 16 | typedef enum irqreturn irqreturn_t; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d9e75ec7def5..883cd44ff765 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -377,6 +377,15 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
377 | #define pr_cont(fmt, ...) \ | 377 | #define pr_cont(fmt, ...) \ |
378 | printk(KERN_CONT fmt, ##__VA_ARGS__) | 378 | printk(KERN_CONT fmt, ##__VA_ARGS__) |
379 | 379 | ||
380 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
381 | #ifdef DEBUG | ||
382 | #define pr_devel(fmt, ...) \ | ||
383 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
384 | #else | ||
385 | #define pr_devel(fmt, ...) \ | ||
386 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
387 | #endif | ||
388 | |||
380 | /* If you are writing a driver, please use dev_dbg instead */ | 389 | /* If you are writing a driver, please use dev_dbg instead */ |
381 | #if defined(DEBUG) | 390 | #if defined(DEBUG) |
382 | #define pr_debug(fmt, ...) \ | 391 | #define pr_debug(fmt, ...) \ |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index d5fa565086d1..384ca8bbf1ac 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -34,7 +34,7 @@ extern int __request_module(bool wait, const char *name, ...) \ | |||
34 | #define request_module(mod...) __request_module(true, mod) | 34 | #define request_module(mod...) __request_module(true, mod) |
35 | #define request_module_nowait(mod...) __request_module(false, mod) | 35 | #define request_module_nowait(mod...) __request_module(false, mod) |
36 | #define try_then_request_module(x, mod...) \ | 36 | #define try_then_request_module(x, mod...) \ |
37 | ((x) ?: (__request_module(false, mod), (x))) | 37 | ((x) ?: (__request_module(true, mod), (x))) |
38 | #else | 38 | #else |
39 | static inline int request_module(const char *name, ...) { return -ENOSYS; } | 39 | static inline int request_module(const char *name, ...) { return -ENOSYS; } |
40 | static inline int request_module_nowait(const char *name, ...) { return -ENOSYS; } | 40 | static inline int request_module_nowait(const char *name, ...) { return -ENOSYS; } |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 2ec6cc14a114..bcd9c07848be 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -94,12 +94,16 @@ struct kprobe { | |||
94 | /* Called after addr is executed, unless... */ | 94 | /* Called after addr is executed, unless... */ |
95 | kprobe_post_handler_t post_handler; | 95 | kprobe_post_handler_t post_handler; |
96 | 96 | ||
97 | /* ... called if executing addr causes a fault (eg. page fault). | 97 | /* |
98 | * Return 1 if it handled fault, otherwise kernel will see it. */ | 98 | * ... called if executing addr causes a fault (eg. page fault). |
99 | * Return 1 if it handled fault, otherwise kernel will see it. | ||
100 | */ | ||
99 | kprobe_fault_handler_t fault_handler; | 101 | kprobe_fault_handler_t fault_handler; |
100 | 102 | ||
101 | /* ... called if breakpoint trap occurs in probe handler. | 103 | /* |
102 | * Return 1 if it handled break, otherwise kernel will see it. */ | 104 | * ... called if breakpoint trap occurs in probe handler. |
105 | * Return 1 if it handled break, otherwise kernel will see it. | ||
106 | */ | ||
103 | kprobe_break_handler_t break_handler; | 107 | kprobe_break_handler_t break_handler; |
104 | 108 | ||
105 | /* Saved opcode (which has been replaced with breakpoint) */ | 109 | /* Saved opcode (which has been replaced with breakpoint) */ |
@@ -108,18 +112,28 @@ struct kprobe { | |||
108 | /* copy of the original instruction */ | 112 | /* copy of the original instruction */ |
109 | struct arch_specific_insn ainsn; | 113 | struct arch_specific_insn ainsn; |
110 | 114 | ||
111 | /* Indicates various status flags. Protected by kprobe_mutex. */ | 115 | /* |
116 | * Indicates various status flags. | ||
117 | * Protected by kprobe_mutex after this kprobe is registered. | ||
118 | */ | ||
112 | u32 flags; | 119 | u32 flags; |
113 | }; | 120 | }; |
114 | 121 | ||
115 | /* Kprobe status flags */ | 122 | /* Kprobe status flags */ |
116 | #define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */ | 123 | #define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */ |
124 | #define KPROBE_FLAG_DISABLED 2 /* probe is temporarily disabled */ | ||
117 | 125 | ||
126 | /* Has this kprobe gone ? */ | ||
118 | static inline int kprobe_gone(struct kprobe *p) | 127 | static inline int kprobe_gone(struct kprobe *p) |
119 | { | 128 | { |
120 | return p->flags & KPROBE_FLAG_GONE; | 129 | return p->flags & KPROBE_FLAG_GONE; |
121 | } | 130 | } |
122 | 131 | ||
132 | /* Is this kprobe disabled ? */ | ||
133 | static inline int kprobe_disabled(struct kprobe *p) | ||
134 | { | ||
135 | return p->flags & (KPROBE_FLAG_DISABLED | KPROBE_FLAG_GONE); | ||
136 | } | ||
123 | /* | 137 | /* |
124 | * Special probe type that uses setjmp-longjmp type tricks to resume | 138 | * Special probe type that uses setjmp-longjmp type tricks to resume |
125 | * execution at a specified entry with a matching prototype corresponding | 139 | * execution at a specified entry with a matching prototype corresponding |
@@ -279,6 +293,9 @@ void unregister_kretprobes(struct kretprobe **rps, int num); | |||
279 | void kprobe_flush_task(struct task_struct *tk); | 293 | void kprobe_flush_task(struct task_struct *tk); |
280 | void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); | 294 | void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); |
281 | 295 | ||
296 | int disable_kprobe(struct kprobe *kp); | ||
297 | int enable_kprobe(struct kprobe *kp); | ||
298 | |||
282 | #else /* !CONFIG_KPROBES: */ | 299 | #else /* !CONFIG_KPROBES: */ |
283 | 300 | ||
284 | static inline int kprobes_built_in(void) | 301 | static inline int kprobes_built_in(void) |
@@ -345,5 +362,30 @@ static inline void unregister_kretprobes(struct kretprobe **rps, int num) | |||
345 | static inline void kprobe_flush_task(struct task_struct *tk) | 362 | static inline void kprobe_flush_task(struct task_struct *tk) |
346 | { | 363 | { |
347 | } | 364 | } |
365 | static inline int disable_kprobe(struct kprobe *kp) | ||
366 | { | ||
367 | return -ENOSYS; | ||
368 | } | ||
369 | static inline int enable_kprobe(struct kprobe *kp) | ||
370 | { | ||
371 | return -ENOSYS; | ||
372 | } | ||
348 | #endif /* CONFIG_KPROBES */ | 373 | #endif /* CONFIG_KPROBES */ |
374 | static inline int disable_kretprobe(struct kretprobe *rp) | ||
375 | { | ||
376 | return disable_kprobe(&rp->kp); | ||
377 | } | ||
378 | static inline int enable_kretprobe(struct kretprobe *rp) | ||
379 | { | ||
380 | return enable_kprobe(&rp->kp); | ||
381 | } | ||
382 | static inline int disable_jprobe(struct jprobe *jp) | ||
383 | { | ||
384 | return disable_kprobe(&jp->kp); | ||
385 | } | ||
386 | static inline int enable_jprobe(struct jprobe *jp) | ||
387 | { | ||
388 | return enable_kprobe(&jp->kp); | ||
389 | } | ||
390 | |||
349 | #endif /* _LINUX_KPROBES_H */ | 391 | #endif /* _LINUX_KPROBES_H */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index b450a2628855..3d501db36a26 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -209,6 +209,7 @@ enum { | |||
209 | 209 | ||
210 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ | 210 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ |
211 | 211 | ||
212 | |||
212 | /* struct ata_port pflags */ | 213 | /* struct ata_port pflags */ |
213 | ATA_PFLAG_EH_PENDING = (1 << 0), /* EH pending */ | 214 | ATA_PFLAG_EH_PENDING = (1 << 0), /* EH pending */ |
214 | ATA_PFLAG_EH_IN_PROGRESS = (1 << 1), /* EH in progress */ | 215 | ATA_PFLAG_EH_IN_PROGRESS = (1 << 1), /* EH in progress */ |
@@ -225,6 +226,9 @@ enum { | |||
225 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ | 226 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ |
226 | ATA_PFLAG_INIT_GTM_VALID = (1 << 19), /* initial gtm data valid */ | 227 | ATA_PFLAG_INIT_GTM_VALID = (1 << 19), /* initial gtm data valid */ |
227 | 228 | ||
229 | ATA_PFLAG_PIO32 = (1 << 20), /* 32bit PIO */ | ||
230 | ATA_PFLAG_PIO32CHANGE = (1 << 21), /* 32bit PIO can be turned on/off */ | ||
231 | |||
228 | /* struct ata_queued_cmd flags */ | 232 | /* struct ata_queued_cmd flags */ |
229 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ | 233 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ |
230 | ATA_QCFLAG_DMAMAP = (1 << 1), /* SG table is DMA mapped */ | 234 | ATA_QCFLAG_DMAMAP = (1 << 1), /* SG table is DMA mapped */ |
@@ -689,7 +693,10 @@ struct ata_port { | |||
689 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ | 693 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ |
690 | struct ata_port_operations *ops; | 694 | struct ata_port_operations *ops; |
691 | spinlock_t *lock; | 695 | spinlock_t *lock; |
696 | /* Flags owned by the EH context. Only EH should touch these once the | ||
697 | port is active */ | ||
692 | unsigned long flags; /* ATA_FLAG_xxx */ | 698 | unsigned long flags; /* ATA_FLAG_xxx */ |
699 | /* Flags that change dynamically, protected by ap->lock */ | ||
693 | unsigned int pflags; /* ATA_PFLAG_xxx */ | 700 | unsigned int pflags; /* ATA_PFLAG_xxx */ |
694 | unsigned int print_id; /* user visible unique port ID */ | 701 | unsigned int print_id; /* user visible unique port ID */ |
695 | unsigned int port_no; /* 0 based port no. inside the host */ | 702 | unsigned int port_no; /* 0 based port no. inside the host */ |
@@ -1595,6 +1602,7 @@ extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc); | |||
1595 | extern void ata_sff_error_handler(struct ata_port *ap); | 1602 | extern void ata_sff_error_handler(struct ata_port *ap); |
1596 | extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc); | 1603 | extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc); |
1597 | extern int ata_sff_port_start(struct ata_port *ap); | 1604 | extern int ata_sff_port_start(struct ata_port *ap); |
1605 | extern int ata_sff_port_start32(struct ata_port *ap); | ||
1598 | extern void ata_sff_std_ports(struct ata_ioports *ioaddr); | 1606 | extern void ata_sff_std_ports(struct ata_ioports *ioaddr); |
1599 | extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev, | 1607 | extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev, |
1600 | unsigned long xfer_mask); | 1608 | unsigned long xfer_mask); |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 18146c980b68..a9e3b76aa884 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -75,7 +75,7 @@ int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) | |||
75 | { | 75 | { |
76 | struct mem_cgroup *mem; | 76 | struct mem_cgroup *mem; |
77 | rcu_read_lock(); | 77 | rcu_read_lock(); |
78 | mem = mem_cgroup_from_task((mm)->owner); | 78 | mem = mem_cgroup_from_task(rcu_dereference((mm)->owner)); |
79 | rcu_read_unlock(); | 79 | rcu_read_unlock(); |
80 | return cgroup == mem; | 80 | return cgroup == mem; |
81 | } | 81 | } |
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index 4455b212d75a..c8f51c3c0a72 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h | |||
@@ -29,6 +29,8 @@ struct pcf50633_platform_data { | |||
29 | char **batteries; | 29 | char **batteries; |
30 | int num_batteries; | 30 | int num_batteries; |
31 | 31 | ||
32 | int charging_restart_interval; | ||
33 | |||
32 | /* Callbacks */ | 34 | /* Callbacks */ |
33 | void (*probe_done)(struct pcf50633 *); | 35 | void (*probe_done)(struct pcf50633 *); |
34 | void (*mbc_event_callback)(struct pcf50633 *, int); | 36 | void (*mbc_event_callback)(struct pcf50633 *, int); |
diff --git a/include/linux/mfd/pcf50633/mbc.h b/include/linux/mfd/pcf50633/mbc.h index 6e17619b773a..4119579acf2c 100644 --- a/include/linux/mfd/pcf50633/mbc.h +++ b/include/linux/mfd/pcf50633/mbc.h | |||
@@ -128,7 +128,6 @@ enum pcf50633_reg_mbcs3 { | |||
128 | int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma); | 128 | int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma); |
129 | 129 | ||
130 | int pcf50633_mbc_get_status(struct pcf50633 *); | 130 | int pcf50633_mbc_get_status(struct pcf50633 *); |
131 | void pcf50633_mbc_set_status(struct pcf50633 *, int what, int status); | ||
132 | 131 | ||
133 | #endif | 132 | #endif |
134 | 133 | ||
diff --git a/include/linux/mg_disk.h b/include/linux/mg_disk.h new file mode 100644 index 000000000000..1f76b1ebf627 --- /dev/null +++ b/include/linux/mg_disk.h | |||
@@ -0,0 +1,206 @@ | |||
1 | /* | ||
2 | * include/linux/mg_disk.c | ||
3 | * | ||
4 | * Support for the mGine m[g]flash IO mode. | ||
5 | * Based on legacy hd.c | ||
6 | * | ||
7 | * (c) 2008 mGine Co.,LTD | ||
8 | * (c) 2008 unsik Kim <donari75@gmail.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 __MG_DISK_H__ | ||
16 | #define __MG_DISK_H__ | ||
17 | |||
18 | #include <linux/blkdev.h> | ||
19 | #include <linux/ata.h> | ||
20 | |||
21 | /* name for block device */ | ||
22 | #define MG_DISK_NAME "mgd" | ||
23 | /* name for platform device */ | ||
24 | #define MG_DEV_NAME "mg_disk" | ||
25 | |||
26 | #define MG_DISK_MAJ 0 | ||
27 | #define MG_DISK_MAX_PART 16 | ||
28 | #define MG_SECTOR_SIZE 512 | ||
29 | #define MG_MAX_SECTS 256 | ||
30 | |||
31 | /* Register offsets */ | ||
32 | #define MG_BUFF_OFFSET 0x8000 | ||
33 | #define MG_STORAGE_BUFFER_SIZE 0x200 | ||
34 | #define MG_REG_OFFSET 0xC000 | ||
35 | #define MG_REG_FEATURE (MG_REG_OFFSET + 2) /* write case */ | ||
36 | #define MG_REG_ERROR (MG_REG_OFFSET + 2) /* read case */ | ||
37 | #define MG_REG_SECT_CNT (MG_REG_OFFSET + 4) | ||
38 | #define MG_REG_SECT_NUM (MG_REG_OFFSET + 6) | ||
39 | #define MG_REG_CYL_LOW (MG_REG_OFFSET + 8) | ||
40 | #define MG_REG_CYL_HIGH (MG_REG_OFFSET + 0xA) | ||
41 | #define MG_REG_DRV_HEAD (MG_REG_OFFSET + 0xC) | ||
42 | #define MG_REG_COMMAND (MG_REG_OFFSET + 0xE) /* write case */ | ||
43 | #define MG_REG_STATUS (MG_REG_OFFSET + 0xE) /* read case */ | ||
44 | #define MG_REG_DRV_CTRL (MG_REG_OFFSET + 0x10) | ||
45 | #define MG_REG_BURST_CTRL (MG_REG_OFFSET + 0x12) | ||
46 | |||
47 | /* "Drive Select/Head Register" bit values */ | ||
48 | #define MG_REG_HEAD_MUST_BE_ON 0xA0 /* These 2 bits are always on */ | ||
49 | #define MG_REG_HEAD_DRIVE_MASTER (0x00 | MG_REG_HEAD_MUST_BE_ON) | ||
50 | #define MG_REG_HEAD_DRIVE_SLAVE (0x10 | MG_REG_HEAD_MUST_BE_ON) | ||
51 | #define MG_REG_HEAD_LBA_MODE (0x40 | MG_REG_HEAD_MUST_BE_ON) | ||
52 | |||
53 | |||
54 | /* "Device Control Register" bit values */ | ||
55 | #define MG_REG_CTRL_INTR_ENABLE 0x0 | ||
56 | #define MG_REG_CTRL_INTR_DISABLE (0x1<<1) | ||
57 | #define MG_REG_CTRL_RESET (0x1<<2) | ||
58 | #define MG_REG_CTRL_INTR_POLA_ACTIVE_HIGH 0x0 | ||
59 | #define MG_REG_CTRL_INTR_POLA_ACTIVE_LOW (0x1<<4) | ||
60 | #define MG_REG_CTRL_DPD_POLA_ACTIVE_LOW 0x0 | ||
61 | #define MG_REG_CTRL_DPD_POLA_ACTIVE_HIGH (0x1<<5) | ||
62 | #define MG_REG_CTRL_DPD_DISABLE 0x0 | ||
63 | #define MG_REG_CTRL_DPD_ENABLE (0x1<<6) | ||
64 | |||
65 | /* Status register bit */ | ||
66 | /* error bit in status register */ | ||
67 | #define MG_REG_STATUS_BIT_ERROR 0x01 | ||
68 | /* corrected error in status register */ | ||
69 | #define MG_REG_STATUS_BIT_CORRECTED_ERROR 0x04 | ||
70 | /* data request bit in status register */ | ||
71 | #define MG_REG_STATUS_BIT_DATA_REQ 0x08 | ||
72 | /* DSC - Drive Seek Complete */ | ||
73 | #define MG_REG_STATUS_BIT_SEEK_DONE 0x10 | ||
74 | /* DWF - Drive Write Fault */ | ||
75 | #define MG_REG_STATUS_BIT_WRITE_FAULT 0x20 | ||
76 | #define MG_REG_STATUS_BIT_READY 0x40 | ||
77 | #define MG_REG_STATUS_BIT_BUSY 0x80 | ||
78 | |||
79 | /* handy status */ | ||
80 | #define MG_STAT_READY (MG_REG_STATUS_BIT_READY | MG_REG_STATUS_BIT_SEEK_DONE) | ||
81 | #define MG_READY_OK(s) (((s) & (MG_STAT_READY | \ | ||
82 | (MG_REG_STATUS_BIT_BUSY | \ | ||
83 | MG_REG_STATUS_BIT_WRITE_FAULT | \ | ||
84 | MG_REG_STATUS_BIT_ERROR))) == MG_STAT_READY) | ||
85 | |||
86 | /* Error register */ | ||
87 | #define MG_REG_ERR_AMNF 0x01 | ||
88 | #define MG_REG_ERR_ABRT 0x04 | ||
89 | #define MG_REG_ERR_IDNF 0x10 | ||
90 | #define MG_REG_ERR_UNC 0x40 | ||
91 | #define MG_REG_ERR_BBK 0x80 | ||
92 | |||
93 | /* error code for others */ | ||
94 | #define MG_ERR_NONE 0 | ||
95 | #define MG_ERR_TIMEOUT 0x100 | ||
96 | #define MG_ERR_INIT_STAT 0x101 | ||
97 | #define MG_ERR_TRANSLATION 0x102 | ||
98 | #define MG_ERR_CTRL_RST 0x103 | ||
99 | #define MG_ERR_INV_STAT 0x104 | ||
100 | #define MG_ERR_RSTOUT 0x105 | ||
101 | |||
102 | #define MG_MAX_ERRORS 6 /* Max read/write errors */ | ||
103 | |||
104 | /* command */ | ||
105 | #define MG_CMD_RD 0x20 | ||
106 | #define MG_CMD_WR 0x30 | ||
107 | #define MG_CMD_SLEEP 0x99 | ||
108 | #define MG_CMD_WAKEUP 0xC3 | ||
109 | #define MG_CMD_ID 0xEC | ||
110 | #define MG_CMD_WR_CONF 0x3C | ||
111 | #define MG_CMD_RD_CONF 0x40 | ||
112 | |||
113 | /* operation mode */ | ||
114 | #define MG_OP_CASCADE (1 << 0) | ||
115 | #define MG_OP_CASCADE_SYNC_RD (1 << 1) | ||
116 | #define MG_OP_CASCADE_SYNC_WR (1 << 2) | ||
117 | #define MG_OP_INTERLEAVE (1 << 3) | ||
118 | |||
119 | /* synchronous */ | ||
120 | #define MG_BURST_LAT_4 (3 << 4) | ||
121 | #define MG_BURST_LAT_5 (4 << 4) | ||
122 | #define MG_BURST_LAT_6 (5 << 4) | ||
123 | #define MG_BURST_LAT_7 (6 << 4) | ||
124 | #define MG_BURST_LAT_8 (7 << 4) | ||
125 | #define MG_BURST_LEN_4 (1 << 1) | ||
126 | #define MG_BURST_LEN_8 (2 << 1) | ||
127 | #define MG_BURST_LEN_16 (3 << 1) | ||
128 | #define MG_BURST_LEN_32 (4 << 1) | ||
129 | #define MG_BURST_LEN_CONT (0 << 1) | ||
130 | |||
131 | /* timeout value (unit: ms) */ | ||
132 | #define MG_TMAX_CONF_TO_CMD 1 | ||
133 | #define MG_TMAX_WAIT_RD_DRQ 10 | ||
134 | #define MG_TMAX_WAIT_WR_DRQ 500 | ||
135 | #define MG_TMAX_RST_TO_BUSY 10 | ||
136 | #define MG_TMAX_HDRST_TO_RDY 500 | ||
137 | #define MG_TMAX_SWRST_TO_RDY 500 | ||
138 | #define MG_TMAX_RSTOUT 3000 | ||
139 | |||
140 | /* device attribution */ | ||
141 | /* use mflash as boot device */ | ||
142 | #define MG_BOOT_DEV (1 << 0) | ||
143 | /* use mflash as storage device */ | ||
144 | #define MG_STORAGE_DEV (1 << 1) | ||
145 | /* same as MG_STORAGE_DEV, but bootloader already done reset sequence */ | ||
146 | #define MG_STORAGE_DEV_SKIP_RST (1 << 2) | ||
147 | |||
148 | #define MG_DEV_MASK (MG_BOOT_DEV | MG_STORAGE_DEV | MG_STORAGE_DEV_SKIP_RST) | ||
149 | |||
150 | /* names of GPIO resource */ | ||
151 | #define MG_RST_PIN "mg_rst" | ||
152 | /* except MG_BOOT_DEV, reset-out pin should be assigned */ | ||
153 | #define MG_RSTOUT_PIN "mg_rstout" | ||
154 | |||
155 | /* private driver data */ | ||
156 | struct mg_drv_data { | ||
157 | /* disk resource */ | ||
158 | u32 use_polling; | ||
159 | |||
160 | /* device attribution */ | ||
161 | u32 dev_attr; | ||
162 | |||
163 | /* internally used */ | ||
164 | struct mg_host *host; | ||
165 | }; | ||
166 | |||
167 | /* main structure for mflash driver */ | ||
168 | struct mg_host { | ||
169 | struct device *dev; | ||
170 | |||
171 | struct request_queue *breq; | ||
172 | spinlock_t lock; | ||
173 | struct gendisk *gd; | ||
174 | |||
175 | struct timer_list timer; | ||
176 | void (*mg_do_intr) (struct mg_host *); | ||
177 | |||
178 | u16 id[ATA_ID_WORDS]; | ||
179 | |||
180 | u16 cyls; | ||
181 | u16 heads; | ||
182 | u16 sectors; | ||
183 | u32 n_sectors; | ||
184 | u32 nres_sectors; | ||
185 | |||
186 | void __iomem *dev_base; | ||
187 | unsigned int irq; | ||
188 | unsigned int rst; | ||
189 | unsigned int rstout; | ||
190 | |||
191 | u32 major; | ||
192 | u32 error; | ||
193 | }; | ||
194 | |||
195 | /* | ||
196 | * Debugging macro and defines | ||
197 | */ | ||
198 | #undef DO_MG_DEBUG | ||
199 | #ifdef DO_MG_DEBUG | ||
200 | # define MG_DBG(fmt, args...) \ | ||
201 | printk(KERN_DEBUG "%s:%d "fmt, __func__, __LINE__, ##args) | ||
202 | #else /* CONFIG_MG_DEBUG */ | ||
203 | # define MG_DBG(fmt, args...) do { } while (0) | ||
204 | #endif /* CONFIG_MG_DEBUG */ | ||
205 | |||
206 | #endif | ||
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h new file mode 100644 index 000000000000..79fec6af3f9f --- /dev/null +++ b/include/linux/nilfs2_fs.h | |||
@@ -0,0 +1,801 @@ | |||
1 | /* | ||
2 | * nilfs2_fs.h - NILFS2 on-disk structures and common declarations. | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. | ||
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | * | ||
20 | * Written by Koji Sato <koji@osrg.net> | ||
21 | * Ryusuke Konishi <ryusuke@osrg.net> | ||
22 | */ | ||
23 | /* | ||
24 | * linux/include/linux/ext2_fs.h | ||
25 | * | ||
26 | * Copyright (C) 1992, 1993, 1994, 1995 | ||
27 | * Remy Card (card@masi.ibp.fr) | ||
28 | * Laboratoire MASI - Institut Blaise Pascal | ||
29 | * Universite Pierre et Marie Curie (Paris VI) | ||
30 | * | ||
31 | * from | ||
32 | * | ||
33 | * linux/include/linux/minix_fs.h | ||
34 | * | ||
35 | * Copyright (C) 1991, 1992 Linus Torvalds | ||
36 | */ | ||
37 | |||
38 | #ifndef _LINUX_NILFS_FS_H | ||
39 | #define _LINUX_NILFS_FS_H | ||
40 | |||
41 | #include <linux/types.h> | ||
42 | #include <linux/ioctl.h> | ||
43 | |||
44 | /* | ||
45 | * Inode flags stored in nilfs_inode and on-memory nilfs inode | ||
46 | * | ||
47 | * We define these flags based on ext2-fs because of the | ||
48 | * compatibility reason; to avoid problems in chattr(1) | ||
49 | */ | ||
50 | #define NILFS_SECRM_FL 0x00000001 /* Secure deletion */ | ||
51 | #define NILFS_UNRM_FL 0x00000002 /* Undelete */ | ||
52 | #define NILFS_SYNC_FL 0x00000008 /* Synchronous updates */ | ||
53 | #define NILFS_IMMUTABLE_FL 0x00000010 /* Immutable file */ | ||
54 | #define NILFS_APPEND_FL 0x00000020 /* writes to file may only append */ | ||
55 | #define NILFS_NODUMP_FL 0x00000040 /* do not dump file */ | ||
56 | #define NILFS_NOATIME_FL 0x00000080 /* do not update atime */ | ||
57 | /* Reserved for compression usage... */ | ||
58 | #define NILFS_NOTAIL_FL 0x00008000 /* file tail should not be merged */ | ||
59 | #define NILFS_DIRSYNC_FL 0x00010000 /* dirsync behaviour */ | ||
60 | |||
61 | #define NILFS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | ||
62 | #define NILFS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | ||
63 | |||
64 | |||
65 | #define NILFS_INODE_BMAP_SIZE 7 | ||
66 | /** | ||
67 | * struct nilfs_inode - structure of an inode on disk | ||
68 | * @i_blocks: blocks count | ||
69 | * @i_size: size in bytes | ||
70 | * @i_ctime: creation time (seconds) | ||
71 | * @i_mtime: modification time (seconds) | ||
72 | * @i_ctime_nsec: creation time (nano seconds) | ||
73 | * @i_mtime_nsec: modification time (nano seconds) | ||
74 | * @i_uid: user id | ||
75 | * @i_gid: group id | ||
76 | * @i_mode: file mode | ||
77 | * @i_links_count: links count | ||
78 | * @i_flags: file flags | ||
79 | * @i_bmap: block mapping | ||
80 | * @i_xattr: extended attributes | ||
81 | * @i_generation: file generation (for NFS) | ||
82 | * @i_pad: padding | ||
83 | */ | ||
84 | struct nilfs_inode { | ||
85 | __le64 i_blocks; | ||
86 | __le64 i_size; | ||
87 | __le64 i_ctime; | ||
88 | __le64 i_mtime; | ||
89 | __le32 i_ctime_nsec; | ||
90 | __le32 i_mtime_nsec; | ||
91 | __le32 i_uid; | ||
92 | __le32 i_gid; | ||
93 | __le16 i_mode; | ||
94 | __le16 i_links_count; | ||
95 | __le32 i_flags; | ||
96 | __le64 i_bmap[NILFS_INODE_BMAP_SIZE]; | ||
97 | #define i_device_code i_bmap[0] | ||
98 | __le64 i_xattr; | ||
99 | __le32 i_generation; | ||
100 | __le32 i_pad; | ||
101 | }; | ||
102 | |||
103 | /** | ||
104 | * struct nilfs_super_root - structure of super root | ||
105 | * @sr_sum: check sum | ||
106 | * @sr_bytes: byte count of the structure | ||
107 | * @sr_flags: flags (reserved) | ||
108 | * @sr_nongc_ctime: write time of the last segment not for cleaner operation | ||
109 | * @sr_dat: DAT file inode | ||
110 | * @sr_cpfile: checkpoint file inode | ||
111 | * @sr_sufile: segment usage file inode | ||
112 | */ | ||
113 | struct nilfs_super_root { | ||
114 | __le32 sr_sum; | ||
115 | __le16 sr_bytes; | ||
116 | __le16 sr_flags; | ||
117 | __le64 sr_nongc_ctime; | ||
118 | struct nilfs_inode sr_dat; | ||
119 | struct nilfs_inode sr_cpfile; | ||
120 | struct nilfs_inode sr_sufile; | ||
121 | }; | ||
122 | |||
123 | #define NILFS_SR_MDT_OFFSET(inode_size, i) \ | ||
124 | ((unsigned long)&((struct nilfs_super_root *)0)->sr_dat + \ | ||
125 | (inode_size) * (i)) | ||
126 | #define NILFS_SR_DAT_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 0) | ||
127 | #define NILFS_SR_CPFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 1) | ||
128 | #define NILFS_SR_SUFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 2) | ||
129 | #define NILFS_SR_BYTES (sizeof(struct nilfs_super_root)) | ||
130 | |||
131 | /* | ||
132 | * Maximal mount counts | ||
133 | */ | ||
134 | #define NILFS_DFL_MAX_MNT_COUNT 50 /* 50 mounts */ | ||
135 | |||
136 | /* | ||
137 | * File system states (sbp->s_state, nilfs->ns_mount_state) | ||
138 | */ | ||
139 | #define NILFS_VALID_FS 0x0001 /* Unmounted cleanly */ | ||
140 | #define NILFS_ERROR_FS 0x0002 /* Errors detected */ | ||
141 | #define NILFS_RESIZE_FS 0x0004 /* Resize required */ | ||
142 | |||
143 | /* | ||
144 | * Mount flags (sbi->s_mount_opt) | ||
145 | */ | ||
146 | #define NILFS_MOUNT_ERROR_MODE 0x0070 /* Error mode mask */ | ||
147 | #define NILFS_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */ | ||
148 | #define NILFS_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */ | ||
149 | #define NILFS_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */ | ||
150 | #define NILFS_MOUNT_SNAPSHOT 0x0080 /* Snapshot flag */ | ||
151 | #define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ | ||
152 | #define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order | ||
153 | semantics also for data */ | ||
154 | |||
155 | |||
156 | /** | ||
157 | * struct nilfs_super_block - structure of super block on disk | ||
158 | */ | ||
159 | struct nilfs_super_block { | ||
160 | __le32 s_rev_level; /* Revision level */ | ||
161 | __le16 s_minor_rev_level; /* minor revision level */ | ||
162 | __le16 s_magic; /* Magic signature */ | ||
163 | |||
164 | __le16 s_bytes; /* Bytes count of CRC calculation | ||
165 | for this structure. s_reserved | ||
166 | is excluded. */ | ||
167 | __le16 s_flags; /* flags */ | ||
168 | __le32 s_crc_seed; /* Seed value of CRC calculation */ | ||
169 | __le32 s_sum; /* Check sum of super block */ | ||
170 | |||
171 | __le32 s_log_block_size; /* Block size represented as follows | ||
172 | blocksize = | ||
173 | 1 << (s_log_block_size + 10) */ | ||
174 | __le64 s_nsegments; /* Number of segments in filesystem */ | ||
175 | __le64 s_dev_size; /* block device size in bytes */ | ||
176 | __le64 s_first_data_block; /* 1st seg disk block number */ | ||
177 | __le32 s_blocks_per_segment; /* number of blocks per full segment */ | ||
178 | __le32 s_r_segments_percentage; /* Reserved segments percentage */ | ||
179 | |||
180 | __le64 s_last_cno; /* Last checkpoint number */ | ||
181 | __le64 s_last_pseg; /* disk block addr pseg written last */ | ||
182 | __le64 s_last_seq; /* seq. number of seg written last */ | ||
183 | __le64 s_free_blocks_count; /* Free blocks count */ | ||
184 | |||
185 | __le64 s_ctime; /* Creation time (execution time of | ||
186 | newfs) */ | ||
187 | __le64 s_mtime; /* Mount time */ | ||
188 | __le64 s_wtime; /* Write time */ | ||
189 | __le16 s_mnt_count; /* Mount count */ | ||
190 | __le16 s_max_mnt_count; /* Maximal mount count */ | ||
191 | __le16 s_state; /* File system state */ | ||
192 | __le16 s_errors; /* Behaviour when detecting errors */ | ||
193 | __le64 s_lastcheck; /* time of last check */ | ||
194 | |||
195 | __le32 s_checkinterval; /* max. time between checks */ | ||
196 | __le32 s_creator_os; /* OS */ | ||
197 | __le16 s_def_resuid; /* Default uid for reserved blocks */ | ||
198 | __le16 s_def_resgid; /* Default gid for reserved blocks */ | ||
199 | __le32 s_first_ino; /* First non-reserved inode */ | ||
200 | |||
201 | __le16 s_inode_size; /* Size of an inode */ | ||
202 | __le16 s_dat_entry_size; /* Size of a dat entry */ | ||
203 | __le16 s_checkpoint_size; /* Size of a checkpoint */ | ||
204 | __le16 s_segment_usage_size; /* Size of a segment usage */ | ||
205 | |||
206 | __u8 s_uuid[16]; /* 128-bit uuid for volume */ | ||
207 | char s_volume_name[16]; /* volume name */ | ||
208 | char s_last_mounted[64]; /* directory where last mounted */ | ||
209 | |||
210 | __le32 s_c_interval; /* Commit interval of segment */ | ||
211 | __le32 s_c_block_max; /* Threshold of data amount for | ||
212 | the segment construction */ | ||
213 | __u32 s_reserved[192]; /* padding to the end of the block */ | ||
214 | }; | ||
215 | |||
216 | /* | ||
217 | * Codes for operating systems | ||
218 | */ | ||
219 | #define NILFS_OS_LINUX 0 | ||
220 | /* Codes from 1 to 4 are reserved to keep compatibility with ext2 creator-OS */ | ||
221 | |||
222 | /* | ||
223 | * Revision levels | ||
224 | */ | ||
225 | #define NILFS_CURRENT_REV 2 /* current major revision */ | ||
226 | #define NILFS_MINOR_REV 0 /* minor revision */ | ||
227 | |||
228 | /* | ||
229 | * Bytes count of super_block for CRC-calculation | ||
230 | */ | ||
231 | #define NILFS_SB_BYTES \ | ||
232 | ((long)&((struct nilfs_super_block *)0)->s_reserved) | ||
233 | |||
234 | /* | ||
235 | * Special inode number | ||
236 | */ | ||
237 | #define NILFS_ROOT_INO 2 /* Root file inode */ | ||
238 | #define NILFS_DAT_INO 3 /* DAT file */ | ||
239 | #define NILFS_CPFILE_INO 4 /* checkpoint file */ | ||
240 | #define NILFS_SUFILE_INO 5 /* segment usage file */ | ||
241 | #define NILFS_IFILE_INO 6 /* ifile */ | ||
242 | #define NILFS_ATIME_INO 7 /* Atime file (reserved) */ | ||
243 | #define NILFS_XATTR_INO 8 /* Xattribute file (reserved) */ | ||
244 | #define NILFS_SKETCH_INO 10 /* Sketch file */ | ||
245 | #define NILFS_USER_INO 11 /* Fisrt user's file inode number */ | ||
246 | |||
247 | #define NILFS_SB_OFFSET_BYTES 1024 /* byte offset of nilfs superblock */ | ||
248 | #define NILFS_SUPER_MAGIC 0x3434 /* NILFS filesystem magic number */ | ||
249 | |||
250 | #define NILFS_SEG_MIN_BLOCKS 16 /* Minimum number of blocks in | ||
251 | a full segment */ | ||
252 | #define NILFS_PSEG_MIN_BLOCKS 2 /* Minimum number of blocks in | ||
253 | a partial segment */ | ||
254 | #define NILFS_MIN_NRSVSEGS 8 /* Minimum number of reserved | ||
255 | segments */ | ||
256 | |||
257 | /* | ||
258 | * bytes offset of secondary super block | ||
259 | */ | ||
260 | #define NILFS_SB2_OFFSET_BYTES(devsize) ((((devsize) >> 12) - 1) << 12) | ||
261 | |||
262 | /* | ||
263 | * Maximal count of links to a file | ||
264 | */ | ||
265 | #define NILFS_LINK_MAX 32000 | ||
266 | |||
267 | /* | ||
268 | * Structure of a directory entry | ||
269 | * (Same as ext2) | ||
270 | */ | ||
271 | |||
272 | #define NILFS_NAME_LEN 255 | ||
273 | |||
274 | /* | ||
275 | * The new version of the directory entry. Since V0 structures are | ||
276 | * stored in intel byte order, and the name_len field could never be | ||
277 | * bigger than 255 chars, it's safe to reclaim the extra byte for the | ||
278 | * file_type field. | ||
279 | */ | ||
280 | struct nilfs_dir_entry { | ||
281 | __le64 inode; /* Inode number */ | ||
282 | __le16 rec_len; /* Directory entry length */ | ||
283 | __u8 name_len; /* Name length */ | ||
284 | __u8 file_type; | ||
285 | char name[NILFS_NAME_LEN]; /* File name */ | ||
286 | char pad; | ||
287 | }; | ||
288 | |||
289 | /* | ||
290 | * NILFS directory file types. Only the low 3 bits are used. The | ||
291 | * other bits are reserved for now. | ||
292 | */ | ||
293 | enum { | ||
294 | NILFS_FT_UNKNOWN, | ||
295 | NILFS_FT_REG_FILE, | ||
296 | NILFS_FT_DIR, | ||
297 | NILFS_FT_CHRDEV, | ||
298 | NILFS_FT_BLKDEV, | ||
299 | NILFS_FT_FIFO, | ||
300 | NILFS_FT_SOCK, | ||
301 | NILFS_FT_SYMLINK, | ||
302 | NILFS_FT_MAX | ||
303 | }; | ||
304 | |||
305 | /* | ||
306 | * NILFS_DIR_PAD defines the directory entries boundaries | ||
307 | * | ||
308 | * NOTE: It must be a multiple of 8 | ||
309 | */ | ||
310 | #define NILFS_DIR_PAD 8 | ||
311 | #define NILFS_DIR_ROUND (NILFS_DIR_PAD - 1) | ||
312 | #define NILFS_DIR_REC_LEN(name_len) (((name_len) + 12 + NILFS_DIR_ROUND) & \ | ||
313 | ~NILFS_DIR_ROUND) | ||
314 | |||
315 | |||
316 | /** | ||
317 | * struct nilfs_finfo - file information | ||
318 | * @fi_ino: inode number | ||
319 | * @fi_cno: checkpoint number | ||
320 | * @fi_nblocks: number of blocks (including intermediate blocks) | ||
321 | * @fi_ndatablk: number of file data blocks | ||
322 | */ | ||
323 | struct nilfs_finfo { | ||
324 | __le64 fi_ino; | ||
325 | __le64 fi_cno; | ||
326 | __le32 fi_nblocks; | ||
327 | __le32 fi_ndatablk; | ||
328 | /* array of virtual block numbers */ | ||
329 | }; | ||
330 | |||
331 | /** | ||
332 | * struct nilfs_binfo_v - information for the block to which a virtual block number is assigned | ||
333 | * @bi_vblocknr: virtual block number | ||
334 | * @bi_blkoff: block offset | ||
335 | */ | ||
336 | struct nilfs_binfo_v { | ||
337 | __le64 bi_vblocknr; | ||
338 | __le64 bi_blkoff; | ||
339 | }; | ||
340 | |||
341 | /** | ||
342 | * struct nilfs_binfo_dat - information for the block which belongs to the DAT file | ||
343 | * @bi_blkoff: block offset | ||
344 | * @bi_level: level | ||
345 | * @bi_pad: padding | ||
346 | */ | ||
347 | struct nilfs_binfo_dat { | ||
348 | __le64 bi_blkoff; | ||
349 | __u8 bi_level; | ||
350 | __u8 bi_pad[7]; | ||
351 | }; | ||
352 | |||
353 | /** | ||
354 | * union nilfs_binfo: block information | ||
355 | * @bi_v: nilfs_binfo_v structure | ||
356 | * @bi_dat: nilfs_binfo_dat structure | ||
357 | */ | ||
358 | union nilfs_binfo { | ||
359 | struct nilfs_binfo_v bi_v; | ||
360 | struct nilfs_binfo_dat bi_dat; | ||
361 | }; | ||
362 | |||
363 | /** | ||
364 | * struct nilfs_segment_summary - segment summary | ||
365 | * @ss_datasum: checksum of data | ||
366 | * @ss_sumsum: checksum of segment summary | ||
367 | * @ss_magic: magic number | ||
368 | * @ss_bytes: size of this structure in bytes | ||
369 | * @ss_flags: flags | ||
370 | * @ss_seq: sequence number | ||
371 | * @ss_create: creation timestamp | ||
372 | * @ss_next: next segment | ||
373 | * @ss_nblocks: number of blocks | ||
374 | * @ss_nfinfo: number of finfo structures | ||
375 | * @ss_sumbytes: total size of segment summary in bytes | ||
376 | * @ss_pad: padding | ||
377 | */ | ||
378 | struct nilfs_segment_summary { | ||
379 | __le32 ss_datasum; | ||
380 | __le32 ss_sumsum; | ||
381 | __le32 ss_magic; | ||
382 | __le16 ss_bytes; | ||
383 | __le16 ss_flags; | ||
384 | __le64 ss_seq; | ||
385 | __le64 ss_create; | ||
386 | __le64 ss_next; | ||
387 | __le32 ss_nblocks; | ||
388 | __le32 ss_nfinfo; | ||
389 | __le32 ss_sumbytes; | ||
390 | __le32 ss_pad; | ||
391 | /* array of finfo structures */ | ||
392 | }; | ||
393 | |||
394 | #define NILFS_SEGSUM_MAGIC 0x1eaffa11 /* segment summary magic number */ | ||
395 | |||
396 | /* | ||
397 | * Segment summary flags | ||
398 | */ | ||
399 | #define NILFS_SS_LOGBGN 0x0001 /* begins a logical segment */ | ||
400 | #define NILFS_SS_LOGEND 0x0002 /* ends a logical segment */ | ||
401 | #define NILFS_SS_SR 0x0004 /* has super root */ | ||
402 | #define NILFS_SS_SYNDT 0x0008 /* includes data only updates */ | ||
403 | #define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */ | ||
404 | |||
405 | /** | ||
406 | * struct nilfs_palloc_group_desc - block group descriptor | ||
407 | * @pg_nfrees: number of free entries in block group | ||
408 | */ | ||
409 | struct nilfs_palloc_group_desc { | ||
410 | __le32 pg_nfrees; | ||
411 | }; | ||
412 | |||
413 | /** | ||
414 | * struct nilfs_dat_entry - disk address translation entry | ||
415 | * @dt_blocknr: block number | ||
416 | * @dt_start: start checkpoint number | ||
417 | * @dt_end: end checkpoint number | ||
418 | * @dt_rsv: reserved for future use | ||
419 | */ | ||
420 | struct nilfs_dat_entry { | ||
421 | __le64 de_blocknr; | ||
422 | __le64 de_start; | ||
423 | __le64 de_end; | ||
424 | __le64 de_rsv; | ||
425 | }; | ||
426 | |||
427 | /** | ||
428 | * struct nilfs_dat_group_desc - block group descriptor | ||
429 | * @dg_nfrees: number of free virtual block numbers in block group | ||
430 | */ | ||
431 | struct nilfs_dat_group_desc { | ||
432 | __le32 dg_nfrees; | ||
433 | }; | ||
434 | |||
435 | |||
436 | /** | ||
437 | * struct nilfs_snapshot_list - snapshot list | ||
438 | * @ssl_next: next checkpoint number on snapshot list | ||
439 | * @ssl_prev: previous checkpoint number on snapshot list | ||
440 | */ | ||
441 | struct nilfs_snapshot_list { | ||
442 | __le64 ssl_next; | ||
443 | __le64 ssl_prev; | ||
444 | }; | ||
445 | |||
446 | /** | ||
447 | * struct nilfs_checkpoint - checkpoint structure | ||
448 | * @cp_flags: flags | ||
449 | * @cp_checkpoints_count: checkpoints count in a block | ||
450 | * @cp_snapshot_list: snapshot list | ||
451 | * @cp_cno: checkpoint number | ||
452 | * @cp_create: creation timestamp | ||
453 | * @cp_nblk_inc: number of blocks incremented by this checkpoint | ||
454 | * @cp_inodes_count: inodes count | ||
455 | * @cp_blocks_count: blocks count | ||
456 | * @cp_ifile_inode: inode of ifile | ||
457 | */ | ||
458 | struct nilfs_checkpoint { | ||
459 | __le32 cp_flags; | ||
460 | __le32 cp_checkpoints_count; | ||
461 | struct nilfs_snapshot_list cp_snapshot_list; | ||
462 | __le64 cp_cno; | ||
463 | __le64 cp_create; | ||
464 | __le64 cp_nblk_inc; | ||
465 | __le64 cp_inodes_count; | ||
466 | __le64 cp_blocks_count; /* Reserved (might be deleted) */ | ||
467 | |||
468 | /* Do not change the byte offset of ifile inode. | ||
469 | To keep the compatibility of the disk format, | ||
470 | additional fields should be added behind cp_ifile_inode. */ | ||
471 | struct nilfs_inode cp_ifile_inode; | ||
472 | }; | ||
473 | |||
474 | /* checkpoint flags */ | ||
475 | enum { | ||
476 | NILFS_CHECKPOINT_SNAPSHOT, | ||
477 | NILFS_CHECKPOINT_INVALID, | ||
478 | NILFS_CHECKPOINT_SKETCH, | ||
479 | NILFS_CHECKPOINT_MINOR, | ||
480 | }; | ||
481 | |||
482 | #define NILFS_CHECKPOINT_FNS(flag, name) \ | ||
483 | static inline void \ | ||
484 | nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp) \ | ||
485 | { \ | ||
486 | cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \ | ||
487 | (1UL << NILFS_CHECKPOINT_##flag)); \ | ||
488 | } \ | ||
489 | static inline void \ | ||
490 | nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp) \ | ||
491 | { \ | ||
492 | cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) & \ | ||
493 | ~(1UL << NILFS_CHECKPOINT_##flag)); \ | ||
494 | } \ | ||
495 | static inline int \ | ||
496 | nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \ | ||
497 | { \ | ||
498 | return !!(le32_to_cpu(cp->cp_flags) & \ | ||
499 | (1UL << NILFS_CHECKPOINT_##flag)); \ | ||
500 | } | ||
501 | |||
502 | NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot) | ||
503 | NILFS_CHECKPOINT_FNS(INVALID, invalid) | ||
504 | NILFS_CHECKPOINT_FNS(MINOR, minor) | ||
505 | |||
506 | /** | ||
507 | * struct nilfs_cpinfo - checkpoint information | ||
508 | * @ci_flags: flags | ||
509 | * @ci_pad: padding | ||
510 | * @ci_cno: checkpoint number | ||
511 | * @ci_create: creation timestamp | ||
512 | * @ci_nblk_inc: number of blocks incremented by this checkpoint | ||
513 | * @ci_inodes_count: inodes count | ||
514 | * @ci_blocks_count: blocks count | ||
515 | * @ci_next: next checkpoint number in snapshot list | ||
516 | */ | ||
517 | struct nilfs_cpinfo { | ||
518 | __u32 ci_flags; | ||
519 | __u32 ci_pad; | ||
520 | __u64 ci_cno; | ||
521 | __u64 ci_create; | ||
522 | __u64 ci_nblk_inc; | ||
523 | __u64 ci_inodes_count; | ||
524 | __u64 ci_blocks_count; | ||
525 | __u64 ci_next; | ||
526 | }; | ||
527 | |||
528 | #define NILFS_CPINFO_FNS(flag, name) \ | ||
529 | static inline int \ | ||
530 | nilfs_cpinfo_##name(const struct nilfs_cpinfo *cpinfo) \ | ||
531 | { \ | ||
532 | return !!(cpinfo->ci_flags & (1UL << NILFS_CHECKPOINT_##flag)); \ | ||
533 | } | ||
534 | |||
535 | NILFS_CPINFO_FNS(SNAPSHOT, snapshot) | ||
536 | NILFS_CPINFO_FNS(INVALID, invalid) | ||
537 | NILFS_CPINFO_FNS(MINOR, minor) | ||
538 | |||
539 | |||
540 | /** | ||
541 | * struct nilfs_cpfile_header - checkpoint file header | ||
542 | * @ch_ncheckpoints: number of checkpoints | ||
543 | * @ch_nsnapshots: number of snapshots | ||
544 | * @ch_snapshot_list: snapshot list | ||
545 | */ | ||
546 | struct nilfs_cpfile_header { | ||
547 | __le64 ch_ncheckpoints; | ||
548 | __le64 ch_nsnapshots; | ||
549 | struct nilfs_snapshot_list ch_snapshot_list; | ||
550 | }; | ||
551 | |||
552 | #define NILFS_CPFILE_FIRST_CHECKPOINT_OFFSET \ | ||
553 | ((sizeof(struct nilfs_cpfile_header) + \ | ||
554 | sizeof(struct nilfs_checkpoint) - 1) / \ | ||
555 | sizeof(struct nilfs_checkpoint)) | ||
556 | |||
557 | /** | ||
558 | * struct nilfs_segment_usage - segment usage | ||
559 | * @su_lastmod: last modified timestamp | ||
560 | * @su_nblocks: number of blocks in segment | ||
561 | * @su_flags: flags | ||
562 | */ | ||
563 | struct nilfs_segment_usage { | ||
564 | __le64 su_lastmod; | ||
565 | __le32 su_nblocks; | ||
566 | __le32 su_flags; | ||
567 | }; | ||
568 | |||
569 | /* segment usage flag */ | ||
570 | enum { | ||
571 | NILFS_SEGMENT_USAGE_ACTIVE, | ||
572 | NILFS_SEGMENT_USAGE_DIRTY, | ||
573 | NILFS_SEGMENT_USAGE_ERROR, | ||
574 | |||
575 | /* ... */ | ||
576 | }; | ||
577 | |||
578 | #define NILFS_SEGMENT_USAGE_FNS(flag, name) \ | ||
579 | static inline void \ | ||
580 | nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su) \ | ||
581 | { \ | ||
582 | su->su_flags = cpu_to_le32(le32_to_cpu(su->su_flags) | \ | ||
583 | (1UL << NILFS_SEGMENT_USAGE_##flag));\ | ||
584 | } \ | ||
585 | static inline void \ | ||
586 | nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su) \ | ||
587 | { \ | ||
588 | su->su_flags = \ | ||
589 | cpu_to_le32(le32_to_cpu(su->su_flags) & \ | ||
590 | ~(1UL << NILFS_SEGMENT_USAGE_##flag)); \ | ||
591 | } \ | ||
592 | static inline int \ | ||
593 | nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \ | ||
594 | { \ | ||
595 | return !!(le32_to_cpu(su->su_flags) & \ | ||
596 | (1UL << NILFS_SEGMENT_USAGE_##flag)); \ | ||
597 | } | ||
598 | |||
599 | NILFS_SEGMENT_USAGE_FNS(ACTIVE, active) | ||
600 | NILFS_SEGMENT_USAGE_FNS(DIRTY, dirty) | ||
601 | NILFS_SEGMENT_USAGE_FNS(ERROR, error) | ||
602 | |||
603 | static inline void | ||
604 | nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su) | ||
605 | { | ||
606 | su->su_lastmod = cpu_to_le64(0); | ||
607 | su->su_nblocks = cpu_to_le32(0); | ||
608 | su->su_flags = cpu_to_le32(0); | ||
609 | } | ||
610 | |||
611 | static inline int | ||
612 | nilfs_segment_usage_clean(const struct nilfs_segment_usage *su) | ||
613 | { | ||
614 | return !le32_to_cpu(su->su_flags); | ||
615 | } | ||
616 | |||
617 | /** | ||
618 | * struct nilfs_sufile_header - segment usage file header | ||
619 | * @sh_ncleansegs: number of clean segments | ||
620 | * @sh_ndirtysegs: number of dirty segments | ||
621 | * @sh_last_alloc: last allocated segment number | ||
622 | */ | ||
623 | struct nilfs_sufile_header { | ||
624 | __le64 sh_ncleansegs; | ||
625 | __le64 sh_ndirtysegs; | ||
626 | __le64 sh_last_alloc; | ||
627 | /* ... */ | ||
628 | }; | ||
629 | |||
630 | #define NILFS_SUFILE_FIRST_SEGMENT_USAGE_OFFSET \ | ||
631 | ((sizeof(struct nilfs_sufile_header) + \ | ||
632 | sizeof(struct nilfs_segment_usage) - 1) / \ | ||
633 | sizeof(struct nilfs_segment_usage)) | ||
634 | |||
635 | /** | ||
636 | * nilfs_suinfo - segment usage information | ||
637 | * @sui_lastmod: | ||
638 | * @sui_nblocks: | ||
639 | * @sui_flags: | ||
640 | */ | ||
641 | struct nilfs_suinfo { | ||
642 | __u64 sui_lastmod; | ||
643 | __u32 sui_nblocks; | ||
644 | __u32 sui_flags; | ||
645 | }; | ||
646 | |||
647 | #define NILFS_SUINFO_FNS(flag, name) \ | ||
648 | static inline int \ | ||
649 | nilfs_suinfo_##name(const struct nilfs_suinfo *si) \ | ||
650 | { \ | ||
651 | return si->sui_flags & (1UL << NILFS_SEGMENT_USAGE_##flag); \ | ||
652 | } | ||
653 | |||
654 | NILFS_SUINFO_FNS(ACTIVE, active) | ||
655 | NILFS_SUINFO_FNS(DIRTY, dirty) | ||
656 | NILFS_SUINFO_FNS(ERROR, error) | ||
657 | |||
658 | static inline int nilfs_suinfo_clean(const struct nilfs_suinfo *si) | ||
659 | { | ||
660 | return !si->sui_flags; | ||
661 | } | ||
662 | |||
663 | /* ioctl */ | ||
664 | enum { | ||
665 | NILFS_CHECKPOINT, | ||
666 | NILFS_SNAPSHOT, | ||
667 | }; | ||
668 | |||
669 | /** | ||
670 | * struct nilfs_cpmode - | ||
671 | * @cc_cno: | ||
672 | * @cc_mode: | ||
673 | */ | ||
674 | struct nilfs_cpmode { | ||
675 | __u64 cm_cno; | ||
676 | __u32 cm_mode; | ||
677 | __u32 cm_pad; | ||
678 | }; | ||
679 | |||
680 | /** | ||
681 | * struct nilfs_argv - argument vector | ||
682 | * @v_base: | ||
683 | * @v_nmembs: | ||
684 | * @v_size: | ||
685 | * @v_flags: | ||
686 | * @v_index: | ||
687 | */ | ||
688 | struct nilfs_argv { | ||
689 | __u64 v_base; | ||
690 | __u32 v_nmembs; /* number of members */ | ||
691 | __u16 v_size; /* size of members */ | ||
692 | __u16 v_flags; | ||
693 | __u64 v_index; | ||
694 | }; | ||
695 | |||
696 | /** | ||
697 | * struct nilfs_period - | ||
698 | * @p_start: | ||
699 | * @p_end: | ||
700 | */ | ||
701 | struct nilfs_period { | ||
702 | __u64 p_start; | ||
703 | __u64 p_end; | ||
704 | }; | ||
705 | |||
706 | /** | ||
707 | * struct nilfs_cpstat - | ||
708 | * @cs_cno: checkpoint number | ||
709 | * @cs_ncps: number of checkpoints | ||
710 | * @cs_nsss: number of snapshots | ||
711 | */ | ||
712 | struct nilfs_cpstat { | ||
713 | __u64 cs_cno; | ||
714 | __u64 cs_ncps; | ||
715 | __u64 cs_nsss; | ||
716 | }; | ||
717 | |||
718 | /** | ||
719 | * struct nilfs_sustat - | ||
720 | * @ss_nsegs: number of segments | ||
721 | * @ss_ncleansegs: number of clean segments | ||
722 | * @ss_ndirtysegs: number of dirty segments | ||
723 | * @ss_ctime: creation time of the last segment | ||
724 | * @ss_nongc_ctime: creation time of the last segment not for GC | ||
725 | * @ss_prot_seq: least sequence number of segments which must not be reclaimed | ||
726 | */ | ||
727 | struct nilfs_sustat { | ||
728 | __u64 ss_nsegs; | ||
729 | __u64 ss_ncleansegs; | ||
730 | __u64 ss_ndirtysegs; | ||
731 | __u64 ss_ctime; | ||
732 | __u64 ss_nongc_ctime; | ||
733 | __u64 ss_prot_seq; | ||
734 | }; | ||
735 | |||
736 | /** | ||
737 | * struct nilfs_vinfo - virtual block number information | ||
738 | * @vi_vblocknr: | ||
739 | * @vi_start: | ||
740 | * @vi_end: | ||
741 | * @vi_blocknr: | ||
742 | */ | ||
743 | struct nilfs_vinfo { | ||
744 | __u64 vi_vblocknr; | ||
745 | __u64 vi_start; | ||
746 | __u64 vi_end; | ||
747 | __u64 vi_blocknr; | ||
748 | }; | ||
749 | |||
750 | /** | ||
751 | * struct nilfs_vdesc - | ||
752 | */ | ||
753 | struct nilfs_vdesc { | ||
754 | __u64 vd_ino; | ||
755 | __u64 vd_cno; | ||
756 | __u64 vd_vblocknr; | ||
757 | struct nilfs_period vd_period; | ||
758 | __u64 vd_blocknr; | ||
759 | __u64 vd_offset; | ||
760 | __u32 vd_flags; | ||
761 | __u32 vd_pad; | ||
762 | }; | ||
763 | |||
764 | /** | ||
765 | * struct nilfs_bdesc - | ||
766 | */ | ||
767 | struct nilfs_bdesc { | ||
768 | __u64 bd_ino; | ||
769 | __u64 bd_oblocknr; | ||
770 | __u64 bd_blocknr; | ||
771 | __u64 bd_offset; | ||
772 | __u32 bd_level; | ||
773 | __u32 bd_pad; | ||
774 | }; | ||
775 | |||
776 | #define NILFS_IOCTL_IDENT 'n' | ||
777 | |||
778 | #define NILFS_IOCTL_CHANGE_CPMODE \ | ||
779 | _IOW(NILFS_IOCTL_IDENT, 0x80, struct nilfs_cpmode) | ||
780 | #define NILFS_IOCTL_DELETE_CHECKPOINT \ | ||
781 | _IOW(NILFS_IOCTL_IDENT, 0x81, __u64) | ||
782 | #define NILFS_IOCTL_GET_CPINFO \ | ||
783 | _IOR(NILFS_IOCTL_IDENT, 0x82, struct nilfs_argv) | ||
784 | #define NILFS_IOCTL_GET_CPSTAT \ | ||
785 | _IOR(NILFS_IOCTL_IDENT, 0x83, struct nilfs_cpstat) | ||
786 | #define NILFS_IOCTL_GET_SUINFO \ | ||
787 | _IOR(NILFS_IOCTL_IDENT, 0x84, struct nilfs_argv) | ||
788 | #define NILFS_IOCTL_GET_SUSTAT \ | ||
789 | _IOR(NILFS_IOCTL_IDENT, 0x85, struct nilfs_sustat) | ||
790 | #define NILFS_IOCTL_GET_VINFO \ | ||
791 | _IOWR(NILFS_IOCTL_IDENT, 0x86, struct nilfs_argv) | ||
792 | #define NILFS_IOCTL_GET_BDESCS \ | ||
793 | _IOWR(NILFS_IOCTL_IDENT, 0x87, struct nilfs_argv) | ||
794 | #define NILFS_IOCTL_CLEAN_SEGMENTS \ | ||
795 | _IOW(NILFS_IOCTL_IDENT, 0x88, struct nilfs_argv[5]) | ||
796 | #define NILFS_IOCTL_SYNC \ | ||
797 | _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64) | ||
798 | #define NILFS_IOCTL_RESIZE \ | ||
799 | _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64) | ||
800 | |||
801 | #endif /* _LINUX_NILFS_FS_H */ | ||
diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h index ea8c6d84996d..cc1767f5cca8 100644 --- a/include/linux/parport_pc.h +++ b/include/linux/parport_pc.h | |||
@@ -228,10 +228,11 @@ extern void parport_pc_release_resources(struct parport *p); | |||
228 | extern int parport_pc_claim_resources(struct parport *p); | 228 | extern int parport_pc_claim_resources(struct parport *p); |
229 | 229 | ||
230 | /* PCMCIA code will want to get us to look at a port. Provide a mechanism. */ | 230 | /* PCMCIA code will want to get us to look at a port. Provide a mechanism. */ |
231 | extern struct parport *parport_pc_probe_port (unsigned long base, | 231 | extern struct parport *parport_pc_probe_port(unsigned long base, |
232 | unsigned long base_hi, | 232 | unsigned long base_hi, |
233 | int irq, int dma, | 233 | int irq, int dma, |
234 | struct device *dev); | 234 | struct device *dev, |
235 | extern void parport_pc_unregister_port (struct parport *p); | 235 | int irqflags); |
236 | extern void parport_pc_unregister_port(struct parport *p); | ||
236 | 237 | ||
237 | #endif | 238 | #endif |
diff --git a/include/linux/pci.h b/include/linux/pci.h index a7fe4bbd7ff1..72698d89e767 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -674,6 +674,11 @@ int __must_check pci_reenable_device(struct pci_dev *); | |||
674 | int __must_check pcim_enable_device(struct pci_dev *pdev); | 674 | int __must_check pcim_enable_device(struct pci_dev *pdev); |
675 | void pcim_pin_device(struct pci_dev *pdev); | 675 | void pcim_pin_device(struct pci_dev *pdev); |
676 | 676 | ||
677 | static inline int pci_is_enabled(struct pci_dev *pdev) | ||
678 | { | ||
679 | return (atomic_read(&pdev->enable_cnt) > 0); | ||
680 | } | ||
681 | |||
677 | static inline int pci_is_managed(struct pci_dev *pdev) | 682 | static inline int pci_is_managed(struct pci_dev *pdev) |
678 | { | 683 | { |
679 | return pdev->is_managed; | 684 | return pdev->is_managed; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ee98cd570885..06ba90c211a5 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2514,6 +2514,8 @@ | |||
2514 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG3 0x3433 | 2514 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG3 0x3433 |
2515 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 | 2515 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 |
2516 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 | 2516 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 |
2517 | #define PCI_DEVICE_ID_INTEL_82854_HB 0x358c | ||
2518 | #define PCI_DEVICE_ID_INTEL_82854_IG 0x358e | ||
2517 | #define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 | 2519 | #define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 |
2518 | #define PCI_DEVICE_ID_INTEL_82855GM_IG 0x3582 | 2520 | #define PCI_DEVICE_ID_INTEL_82855GM_IG 0x3582 |
2519 | #define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590 | 2521 | #define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590 |
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h index cb7d10f30763..d4cf7a2ceb3e 100644 --- a/include/linux/pda_power.h +++ b/include/linux/pda_power.h | |||
@@ -31,6 +31,8 @@ struct pda_power_pdata { | |||
31 | unsigned int wait_for_status; /* msecs, default is 500 */ | 31 | unsigned int wait_for_status; /* msecs, default is 500 */ |
32 | unsigned int wait_for_charger; /* msecs, default is 500 */ | 32 | unsigned int wait_for_charger; /* msecs, default is 500 */ |
33 | unsigned int polling_interval; /* msecs, default is 2000 */ | 33 | unsigned int polling_interval; /* msecs, default is 2000 */ |
34 | |||
35 | unsigned long ac_max_uA; /* current to draw when on AC */ | ||
34 | }; | 36 | }; |
35 | 37 | ||
36 | #endif /* __PDA_POWER_H__ */ | 38 | #endif /* __PDA_POWER_H__ */ |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h new file mode 100644 index 000000000000..8f921d74f49f --- /dev/null +++ b/include/linux/percpu-defs.h | |||
@@ -0,0 +1,84 @@ | |||
1 | #ifndef _LINUX_PERCPU_DEFS_H | ||
2 | #define _LINUX_PERCPU_DEFS_H | ||
3 | |||
4 | /* | ||
5 | * Determine the real variable name from the name visible in the | ||
6 | * kernel sources. | ||
7 | */ | ||
8 | #define per_cpu_var(var) per_cpu__##var | ||
9 | |||
10 | /* | ||
11 | * Base implementations of per-CPU variable declarations and definitions, where | ||
12 | * the section in which the variable is to be placed is provided by the | ||
13 | * 'section' argument. This may be used to affect the parameters governing the | ||
14 | * variable's storage. | ||
15 | * | ||
16 | * NOTE! The sections for the DECLARE and for the DEFINE must match, lest | ||
17 | * linkage errors occur due the compiler generating the wrong code to access | ||
18 | * that section. | ||
19 | */ | ||
20 | #define DECLARE_PER_CPU_SECTION(type, name, section) \ | ||
21 | extern \ | ||
22 | __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ | ||
23 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | ||
24 | |||
25 | #define DEFINE_PER_CPU_SECTION(type, name, section) \ | ||
26 | __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ | ||
27 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | ||
28 | |||
29 | /* | ||
30 | * Variant on the per-CPU variable declaration/definition theme used for | ||
31 | * ordinary per-CPU variables. | ||
32 | */ | ||
33 | #define DECLARE_PER_CPU(type, name) \ | ||
34 | DECLARE_PER_CPU_SECTION(type, name, "") | ||
35 | |||
36 | #define DEFINE_PER_CPU(type, name) \ | ||
37 | DEFINE_PER_CPU_SECTION(type, name, "") | ||
38 | |||
39 | /* | ||
40 | * Declaration/definition used for per-CPU variables that must come first in | ||
41 | * the set of variables. | ||
42 | */ | ||
43 | #define DECLARE_PER_CPU_FIRST(type, name) \ | ||
44 | DECLARE_PER_CPU_SECTION(type, name, PER_CPU_FIRST_SECTION) | ||
45 | |||
46 | #define DEFINE_PER_CPU_FIRST(type, name) \ | ||
47 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_FIRST_SECTION) | ||
48 | |||
49 | /* | ||
50 | * Declaration/definition used for per-CPU variables that must be cacheline | ||
51 | * aligned under SMP conditions so that, whilst a particular instance of the | ||
52 | * data corresponds to a particular CPU, inefficiencies due to direct access by | ||
53 | * other CPUs are reduced by preventing the data from unnecessarily spanning | ||
54 | * cachelines. | ||
55 | * | ||
56 | * An example of this would be statistical data, where each CPU's set of data | ||
57 | * is updated by that CPU alone, but the data from across all CPUs is collated | ||
58 | * by a CPU processing a read from a proc file. | ||
59 | */ | ||
60 | #define DECLARE_PER_CPU_SHARED_ALIGNED(type, name) \ | ||
61 | DECLARE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ | ||
62 | ____cacheline_aligned_in_smp | ||
63 | |||
64 | #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ | ||
65 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ | ||
66 | ____cacheline_aligned_in_smp | ||
67 | |||
68 | /* | ||
69 | * Declaration/definition used for per-CPU variables that must be page aligned. | ||
70 | */ | ||
71 | #define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \ | ||
72 | DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") | ||
73 | |||
74 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ | ||
75 | DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") | ||
76 | |||
77 | /* | ||
78 | * Intermodule exports for per-CPU variables. | ||
79 | */ | ||
80 | #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) | ||
81 | #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) | ||
82 | |||
83 | |||
84 | #endif /* _LINUX_PERCPU_DEFS_H */ | ||
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index ee5615d65211..1581ff235c7e 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -9,50 +9,6 @@ | |||
9 | 9 | ||
10 | #include <asm/percpu.h> | 10 | #include <asm/percpu.h> |
11 | 11 | ||
12 | #ifndef PER_CPU_BASE_SECTION | ||
13 | #ifdef CONFIG_SMP | ||
14 | #define PER_CPU_BASE_SECTION ".data.percpu" | ||
15 | #else | ||
16 | #define PER_CPU_BASE_SECTION ".data" | ||
17 | #endif | ||
18 | #endif | ||
19 | |||
20 | #ifdef CONFIG_SMP | ||
21 | |||
22 | #ifdef MODULE | ||
23 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
24 | #else | ||
25 | #define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" | ||
26 | #endif | ||
27 | #define PER_CPU_FIRST_SECTION ".first" | ||
28 | |||
29 | #else | ||
30 | |||
31 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
32 | #define PER_CPU_FIRST_SECTION "" | ||
33 | |||
34 | #endif | ||
35 | |||
36 | #define DEFINE_PER_CPU_SECTION(type, name, section) \ | ||
37 | __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ | ||
38 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | ||
39 | |||
40 | #define DEFINE_PER_CPU(type, name) \ | ||
41 | DEFINE_PER_CPU_SECTION(type, name, "") | ||
42 | |||
43 | #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ | ||
44 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ | ||
45 | ____cacheline_aligned_in_smp | ||
46 | |||
47 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ | ||
48 | DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") | ||
49 | |||
50 | #define DEFINE_PER_CPU_FIRST(type, name) \ | ||
51 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_FIRST_SECTION) | ||
52 | |||
53 | #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) | ||
54 | #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) | ||
55 | |||
56 | /* enough to cover all DEFINE_PER_CPUs in modules */ | 12 | /* enough to cover all DEFINE_PER_CPUs in modules */ |
57 | #ifdef CONFIG_MODULES | 13 | #ifdef CONFIG_MODULES |
58 | #define PERCPU_MODULE_RESERVE (8 << 10) | 14 | #define PERCPU_MODULE_RESERVE (8 << 10) |
@@ -168,4 +124,56 @@ static inline void free_percpu(void *p) | |||
168 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ | 124 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ |
169 | __alignof__(type)) | 125 | __alignof__(type)) |
170 | 126 | ||
127 | /* | ||
128 | * Optional methods for optimized non-lvalue per-cpu variable access. | ||
129 | * | ||
130 | * @var can be a percpu variable or a field of it and its size should | ||
131 | * equal char, int or long. percpu_read() evaluates to a lvalue and | ||
132 | * all others to void. | ||
133 | * | ||
134 | * These operations are guaranteed to be atomic w.r.t. preemption. | ||
135 | * The generic versions use plain get/put_cpu_var(). Archs are | ||
136 | * encouraged to implement single-instruction alternatives which don't | ||
137 | * require preemption protection. | ||
138 | */ | ||
139 | #ifndef percpu_read | ||
140 | # define percpu_read(var) \ | ||
141 | ({ \ | ||
142 | typeof(per_cpu_var(var)) __tmp_var__; \ | ||
143 | __tmp_var__ = get_cpu_var(var); \ | ||
144 | put_cpu_var(var); \ | ||
145 | __tmp_var__; \ | ||
146 | }) | ||
147 | #endif | ||
148 | |||
149 | #define __percpu_generic_to_op(var, val, op) \ | ||
150 | do { \ | ||
151 | get_cpu_var(var) op val; \ | ||
152 | put_cpu_var(var); \ | ||
153 | } while (0) | ||
154 | |||
155 | #ifndef percpu_write | ||
156 | # define percpu_write(var, val) __percpu_generic_to_op(var, (val), =) | ||
157 | #endif | ||
158 | |||
159 | #ifndef percpu_add | ||
160 | # define percpu_add(var, val) __percpu_generic_to_op(var, (val), +=) | ||
161 | #endif | ||
162 | |||
163 | #ifndef percpu_sub | ||
164 | # define percpu_sub(var, val) __percpu_generic_to_op(var, (val), -=) | ||
165 | #endif | ||
166 | |||
167 | #ifndef percpu_and | ||
168 | # define percpu_and(var, val) __percpu_generic_to_op(var, (val), &=) | ||
169 | #endif | ||
170 | |||
171 | #ifndef percpu_or | ||
172 | # define percpu_or(var, val) __percpu_generic_to_op(var, (val), |=) | ||
173 | #endif | ||
174 | |||
175 | #ifndef percpu_xor | ||
176 | # define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=) | ||
177 | #endif | ||
178 | |||
171 | #endif /* __LINUX_PERCPU_H */ | 179 | #endif /* __LINUX_PERCPU_H */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 32cf14a4b034..97e40cb6b588 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -388,6 +388,12 @@ struct phy_driver { | |||
388 | /* Enables or disables interrupts */ | 388 | /* Enables or disables interrupts */ |
389 | int (*config_intr)(struct phy_device *phydev); | 389 | int (*config_intr)(struct phy_device *phydev); |
390 | 390 | ||
391 | /* | ||
392 | * Checks if the PHY generated an interrupt. | ||
393 | * For multi-PHY devices with shared PHY interrupt pin | ||
394 | */ | ||
395 | int (*did_interrupt)(struct phy_device *phydev); | ||
396 | |||
391 | /* Clears up any memory if needed */ | 397 | /* Clears up any memory if needed */ |
392 | void (*remove)(struct phy_device *phydev); | 398 | void (*remove)(struct phy_device *phydev); |
393 | 399 | ||
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 8e4120285f72..c8f038554e80 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -134,6 +134,11 @@ struct pipe_buf_operations { | |||
134 | memory allocation, whereas PIPE_BUF makes atomicity guarantees. */ | 134 | memory allocation, whereas PIPE_BUF makes atomicity guarantees. */ |
135 | #define PIPE_SIZE PAGE_SIZE | 135 | #define PIPE_SIZE PAGE_SIZE |
136 | 136 | ||
137 | /* Pipe lock and unlock operations */ | ||
138 | void pipe_lock(struct pipe_inode_info *); | ||
139 | void pipe_unlock(struct pipe_inode_info *); | ||
140 | void pipe_double_lock(struct pipe_inode_info *, struct pipe_inode_info *); | ||
141 | |||
137 | /* Drop the inode semaphore and wait for a pipe event, atomically */ | 142 | /* Drop the inode semaphore and wait for a pipe event, atomically */ |
138 | void pipe_wait(struct pipe_inode_info *pipe); | 143 | void pipe_wait(struct pipe_inode_info *pipe); |
139 | 144 | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 76e470a299bf..72736fd8223c 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -77,4 +77,46 @@ extern int platform_driver_probe(struct platform_driver *driver, | |||
77 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) | 77 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) |
78 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) | 78 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) |
79 | 79 | ||
80 | /* early platform driver interface */ | ||
81 | struct early_platform_driver { | ||
82 | const char *class_str; | ||
83 | struct platform_driver *pdrv; | ||
84 | struct list_head list; | ||
85 | int requested_id; | ||
86 | }; | ||
87 | |||
88 | #define EARLY_PLATFORM_ID_UNSET -2 | ||
89 | #define EARLY_PLATFORM_ID_ERROR -3 | ||
90 | |||
91 | extern int early_platform_driver_register(struct early_platform_driver *epdrv, | ||
92 | char *buf); | ||
93 | extern void early_platform_add_devices(struct platform_device **devs, int num); | ||
94 | |||
95 | static inline int is_early_platform_device(struct platform_device *pdev) | ||
96 | { | ||
97 | return !pdev->dev.driver; | ||
98 | } | ||
99 | |||
100 | extern void early_platform_driver_register_all(char *class_str); | ||
101 | extern int early_platform_driver_probe(char *class_str, | ||
102 | int nr_probe, int user_only); | ||
103 | extern void early_platform_cleanup(void); | ||
104 | |||
105 | |||
106 | #ifndef MODULE | ||
107 | #define early_platform_init(class_string, platform_driver) \ | ||
108 | static __initdata struct early_platform_driver early_driver = { \ | ||
109 | .class_str = class_string, \ | ||
110 | .pdrv = platform_driver, \ | ||
111 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ | ||
112 | }; \ | ||
113 | static int __init early_platform_driver_setup_func(char *buf) \ | ||
114 | { \ | ||
115 | return early_platform_driver_register(&early_driver, buf); \ | ||
116 | } \ | ||
117 | early_param(class_string, early_platform_driver_setup_func) | ||
118 | #else /* MODULE */ | ||
119 | #define early_platform_init(class_string, platform_driver) | ||
120 | #endif /* MODULE */ | ||
121 | |||
80 | #endif /* _PLATFORM_DEVICE_H_ */ | 122 | #endif /* _PLATFORM_DEVICE_H_ */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 0cdda00f2b2a..58b2aa5312b9 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -161,9 +161,8 @@ struct rcu_data { | |||
161 | unsigned long offline_fqs; /* Kicked due to being offline. */ | 161 | unsigned long offline_fqs; /* Kicked due to being offline. */ |
162 | unsigned long resched_ipi; /* Sent a resched IPI. */ | 162 | unsigned long resched_ipi; /* Sent a resched IPI. */ |
163 | 163 | ||
164 | /* 5) state to allow this CPU to force_quiescent_state on others */ | 164 | /* 5) For future __rcu_pending statistics. */ |
165 | long n_rcu_pending; /* rcu_pending() calls since boot. */ | 165 | long n_rcu_pending; /* rcu_pending() calls since boot. */ |
166 | long n_rcu_pending_force_qs; /* when to force quiescent states. */ | ||
167 | 166 | ||
168 | int cpu; | 167 | int cpu; |
169 | }; | 168 | }; |
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 5621d87c4479..6b361d23a499 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -193,7 +193,7 @@ struct reiserfs_journal { | |||
193 | atomic_t j_wcount; /* count of writers for current commit */ | 193 | atomic_t j_wcount; /* count of writers for current commit */ |
194 | unsigned long j_bcount; /* batch count. allows turning X transactions into 1 */ | 194 | unsigned long j_bcount; /* batch count. allows turning X transactions into 1 */ |
195 | unsigned long j_first_unflushed_offset; /* first unflushed transactions offset */ | 195 | unsigned long j_first_unflushed_offset; /* first unflushed transactions offset */ |
196 | unsigned long j_last_flush_trans_id; /* last fully flushed journal timestamp */ | 196 | unsigned j_last_flush_trans_id; /* last fully flushed journal timestamp */ |
197 | struct buffer_head *j_header_bh; | 197 | struct buffer_head *j_header_bh; |
198 | 198 | ||
199 | time_t j_trans_start_time; /* time this transaction started */ | 199 | time_t j_trans_start_time; /* time this transaction started */ |
diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h new file mode 100644 index 000000000000..12d63a30c347 --- /dev/null +++ b/include/linux/rotary_encoder.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef __ROTARY_ENCODER_H__ | ||
2 | #define __ROTARY_ENCODER_H__ | ||
3 | |||
4 | struct rotary_encoder_platform_data { | ||
5 | unsigned int steps; | ||
6 | unsigned int axis; | ||
7 | unsigned int gpio_a; | ||
8 | unsigned int gpio_b; | ||
9 | unsigned int inverted_a; | ||
10 | unsigned int inverted_b; | ||
11 | }; | ||
12 | |||
13 | #endif /* __ROTARY_ENCODER_H__ */ | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 451186a22ef5..f4e3985c8593 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -205,7 +205,8 @@ extern unsigned long long time_sync_thresh; | |||
205 | #define task_is_stopped_or_traced(task) \ | 205 | #define task_is_stopped_or_traced(task) \ |
206 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) | 206 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) |
207 | #define task_contributes_to_load(task) \ | 207 | #define task_contributes_to_load(task) \ |
208 | ((task->state & TASK_UNINTERRUPTIBLE) != 0) | 208 | ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ |
209 | (task->flags & PF_FROZEN) == 0) | ||
209 | 210 | ||
210 | #define __set_task_state(tsk, state_value) \ | 211 | #define __set_task_state(tsk, state_value) \ |
211 | do { (tsk)->state = (state_value); } while (0) | 212 | do { (tsk)->state = (state_value); } while (0) |
@@ -300,17 +301,11 @@ extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, | |||
300 | struct file *filp, void __user *buffer, | 301 | struct file *filp, void __user *buffer, |
301 | size_t *lenp, loff_t *ppos); | 302 | size_t *lenp, loff_t *ppos); |
302 | extern unsigned int softlockup_panic; | 303 | extern unsigned int softlockup_panic; |
303 | extern unsigned long sysctl_hung_task_check_count; | ||
304 | extern unsigned long sysctl_hung_task_timeout_secs; | ||
305 | extern unsigned long sysctl_hung_task_warnings; | ||
306 | extern int softlockup_thresh; | 304 | extern int softlockup_thresh; |
307 | #else | 305 | #else |
308 | static inline void softlockup_tick(void) | 306 | static inline void softlockup_tick(void) |
309 | { | 307 | { |
310 | } | 308 | } |
311 | static inline void spawn_softlockup_task(void) | ||
312 | { | ||
313 | } | ||
314 | static inline void touch_softlockup_watchdog(void) | 309 | static inline void touch_softlockup_watchdog(void) |
315 | { | 310 | { |
316 | } | 311 | } |
@@ -319,6 +314,15 @@ static inline void touch_all_softlockup_watchdogs(void) | |||
319 | } | 314 | } |
320 | #endif | 315 | #endif |
321 | 316 | ||
317 | #ifdef CONFIG_DETECT_HUNG_TASK | ||
318 | extern unsigned int sysctl_hung_task_panic; | ||
319 | extern unsigned long sysctl_hung_task_check_count; | ||
320 | extern unsigned long sysctl_hung_task_timeout_secs; | ||
321 | extern unsigned long sysctl_hung_task_warnings; | ||
322 | extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, | ||
323 | struct file *filp, void __user *buffer, | ||
324 | size_t *lenp, loff_t *ppos); | ||
325 | #endif | ||
322 | 326 | ||
323 | /* Attach to any functions which should be ignored in wchan output. */ | 327 | /* Attach to any functions which should be ignored in wchan output. */ |
324 | #define __sched __attribute__((__section__(".sched.text"))) | 328 | #define __sched __attribute__((__section__(".sched.text"))) |
@@ -1248,9 +1252,8 @@ struct task_struct { | |||
1248 | /* ipc stuff */ | 1252 | /* ipc stuff */ |
1249 | struct sysv_sem sysvsem; | 1253 | struct sysv_sem sysvsem; |
1250 | #endif | 1254 | #endif |
1251 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 1255 | #ifdef CONFIG_DETECT_HUNG_TASK |
1252 | /* hung task detection */ | 1256 | /* hung task detection */ |
1253 | unsigned long last_switch_timestamp; | ||
1254 | unsigned long last_switch_count; | 1257 | unsigned long last_switch_count; |
1255 | #endif | 1258 | #endif |
1256 | /* CPU-specific state of this task */ | 1259 | /* CPU-specific state of this task */ |
@@ -1287,6 +1290,11 @@ struct task_struct { | |||
1287 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ | 1290 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ |
1288 | spinlock_t alloc_lock; | 1291 | spinlock_t alloc_lock; |
1289 | 1292 | ||
1293 | #ifdef CONFIG_GENERIC_HARDIRQS | ||
1294 | /* IRQ handler threads */ | ||
1295 | struct irqaction *irqaction; | ||
1296 | #endif | ||
1297 | |||
1290 | /* Protection of the PI data structures: */ | 1298 | /* Protection of the PI data structures: */ |
1291 | spinlock_t pi_lock; | 1299 | spinlock_t pi_lock; |
1292 | 1300 | ||
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index 262a8dccfa81..167c33361d9c 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h | |||
@@ -21,6 +21,8 @@ extern long prctl_set_seccomp(unsigned long); | |||
21 | 21 | ||
22 | #else /* CONFIG_SECCOMP */ | 22 | #else /* CONFIG_SECCOMP */ |
23 | 23 | ||
24 | #include <linux/errno.h> | ||
25 | |||
24 | typedef struct { } seccomp_t; | 26 | typedef struct { } seccomp_t; |
25 | 27 | ||
26 | #define secure_computing(x) do { } while (0) | 28 | #define secure_computing(x) do { } while (0) |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 83e4b3ff9cda..57a97e52e58d 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -164,6 +164,9 @@ | |||
164 | /* NWPSERIAL */ | 164 | /* NWPSERIAL */ |
165 | #define PORT_NWPSERIAL 85 | 165 | #define PORT_NWPSERIAL 85 |
166 | 166 | ||
167 | /* MAX3100 */ | ||
168 | #define PORT_MAX3100 86 | ||
169 | |||
167 | #ifdef __KERNEL__ | 170 | #ifdef __KERNEL__ |
168 | 171 | ||
169 | #include <linux/compiler.h> | 172 | #include <linux/compiler.h> |
diff --git a/include/linux/serial_max3100.h b/include/linux/serial_max3100.h new file mode 100644 index 000000000000..4976befb6aeb --- /dev/null +++ b/include/linux/serial_max3100.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Copyright (C) 2007 Christian Pellegrin | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | */ | ||
10 | |||
11 | |||
12 | #ifndef _LINUX_SERIAL_MAX3100_H | ||
13 | #define _LINUX_SERIAL_MAX3100_H 1 | ||
14 | |||
15 | |||
16 | /** | ||
17 | * struct plat_max3100 - MAX3100 SPI UART platform data | ||
18 | * @loopback: force MAX3100 in loopback | ||
19 | * @crystal: 1 for 3.6864 Mhz, 0 for 1.8432 | ||
20 | * @max3100_hw_suspend: MAX3100 has a shutdown pin. This is a hook | ||
21 | * called on suspend and resume to activate it. | ||
22 | * @poll_time: poll time for CTS signal in ms, 0 disables (so no hw | ||
23 | * flow ctrl is possible but you have less CPU usage) | ||
24 | * | ||
25 | * You should use this structure in your machine description to specify | ||
26 | * how the MAX3100 is connected. Example: | ||
27 | * | ||
28 | * static struct plat_max3100 max3100_plat_data = { | ||
29 | * .loopback = 0, | ||
30 | * .crystal = 0, | ||
31 | * .poll_time = 100, | ||
32 | * }; | ||
33 | * | ||
34 | * static struct spi_board_info spi_board_info[] = { | ||
35 | * { | ||
36 | * .modalias = "max3100", | ||
37 | * .platform_data = &max3100_plat_data, | ||
38 | * .irq = IRQ_EINT12, | ||
39 | * .max_speed_hz = 5*1000*1000, | ||
40 | * .chip_select = 0, | ||
41 | * }, | ||
42 | * }; | ||
43 | * | ||
44 | **/ | ||
45 | struct plat_max3100 { | ||
46 | int loopback; | ||
47 | int crystal; | ||
48 | void (*max3100_hw_suspend) (int suspend); | ||
49 | int poll_time; | ||
50 | }; | ||
51 | |||
52 | #endif | ||
diff --git a/include/linux/sht15.h b/include/linux/sht15.h new file mode 100644 index 000000000000..046bce05ecab --- /dev/null +++ b/include/linux/sht15.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * sht15.h - support for the SHT15 Temperature and Humidity Sensor | ||
3 | * | ||
4 | * Copyright (c) 2009 Jonathan Cameron | ||
5 | * | ||
6 | * Copyright (c) 2007 Wouter Horre | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | /** | ||
14 | * struct sht15_platform_data - sht15 connectivity info | ||
15 | * @gpio_data: no. of gpio to which bidirectional data line is connected | ||
16 | * @gpio_sck: no. of gpio to which the data clock is connected. | ||
17 | * @supply_mv: supply voltage in mv. Overridden by regulator if available. | ||
18 | **/ | ||
19 | struct sht15_platform_data { | ||
20 | int gpio_data; | ||
21 | int gpio_sck; | ||
22 | int supply_mv; | ||
23 | }; | ||
24 | |||
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h index 85958277f83d..b65c8881f07a 100644 --- a/include/linux/slow-work.h +++ b/include/linux/slow-work.h | |||
@@ -67,7 +67,7 @@ static inline void slow_work_init(struct slow_work *work, | |||
67 | } | 67 | } |
68 | 68 | ||
69 | /** | 69 | /** |
70 | * slow_work_init - Initialise a very slow work item | 70 | * vslow_work_init - Initialise a very slow work item |
71 | * @work: The work item to initialise | 71 | * @work: The work item to initialise |
72 | * @ops: The operations to use to handle the slow work item | 72 | * @ops: The operations to use to handle the slow work item |
73 | * | 73 | * |
diff --git a/include/linux/spi/ad7879.h b/include/linux/spi/ad7879.h new file mode 100644 index 000000000000..4231104c9afa --- /dev/null +++ b/include/linux/spi/ad7879.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* linux/spi/ad7879.h */ | ||
2 | |||
3 | /* Touchscreen characteristics vary between boards and models. The | ||
4 | * platform_data for the device's "struct device" holds this information. | ||
5 | * | ||
6 | * It's OK if the min/max values are zero. | ||
7 | */ | ||
8 | struct ad7879_platform_data { | ||
9 | u16 model; /* 7879 */ | ||
10 | u16 x_plate_ohms; | ||
11 | u16 x_min, x_max; | ||
12 | u16 y_min, y_max; | ||
13 | u16 pressure_min, pressure_max; | ||
14 | |||
15 | /* [0..255] 0=OFF Starts at 1=550us and goes | ||
16 | * all the way to 9.440ms in steps of 35us. | ||
17 | */ | ||
18 | u8 pen_down_acc_interval; | ||
19 | /* [0..15] Starts at 0=128us and goes all the | ||
20 | * way to 4.096ms in steps of 128us. | ||
21 | */ | ||
22 | u8 first_conversion_delay; | ||
23 | /* [0..3] 0 = 2us, 1 = 4us, 2 = 8us, 3 = 16us */ | ||
24 | u8 acquisition_time; | ||
25 | /* [0..3] Average X middle samples 0 = 2, 1 = 4, 2 = 8, 3 = 16 */ | ||
26 | u8 averaging; | ||
27 | /* [0..3] Perform X measurements 0 = OFF, | ||
28 | * 1 = 4, 2 = 8, 3 = 16 (median > averaging) | ||
29 | */ | ||
30 | u8 median; | ||
31 | /* 1 = AUX/VBAT/GPIO set to GPIO Output */ | ||
32 | u8 gpio_output; | ||
33 | /* Initial GPIO pin state (valid if gpio_output = 1) */ | ||
34 | u8 gpio_default; | ||
35 | }; | ||
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 05eab2f11e63..2ea20320c093 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -51,5 +51,6 @@ struct ads7846_platform_data { | |||
51 | void **filter_data); | 51 | void **filter_data); |
52 | int (*filter) (void *filter_data, int data_idx, int *val); | 52 | int (*filter) (void *filter_data, int data_idx, int *val); |
53 | void (*filter_cleanup)(void *filter_data); | 53 | void (*filter_cleanup)(void *filter_data); |
54 | void (*wait_for_sync)(void); | ||
54 | }; | 55 | }; |
55 | 56 | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 68bb1c501d0d..a0faa18f7b1b 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -204,6 +204,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
204 | * SPI slaves, and are numbered from zero to num_chipselects. | 204 | * SPI slaves, and are numbered from zero to num_chipselects. |
205 | * each slave has a chipselect signal, but it's common that not | 205 | * each slave has a chipselect signal, but it's common that not |
206 | * every chipselect is connected to a slave. | 206 | * every chipselect is connected to a slave. |
207 | * @dma_alignment: SPI controller constraint on DMA buffers alignment. | ||
207 | * @setup: updates the device mode and clocking records used by a | 208 | * @setup: updates the device mode and clocking records used by a |
208 | * device's SPI controller; protocol code may call this. This | 209 | * device's SPI controller; protocol code may call this. This |
209 | * must fail if an unrecognized or unsupported mode is requested. | 210 | * must fail if an unrecognized or unsupported mode is requested. |
@@ -239,7 +240,17 @@ struct spi_master { | |||
239 | */ | 240 | */ |
240 | u16 num_chipselect; | 241 | u16 num_chipselect; |
241 | 242 | ||
242 | /* setup mode and clock, etc (spi driver may call many times) */ | 243 | /* some SPI controllers pose alignment requirements on DMAable |
244 | * buffers; let protocol drivers know about these requirements. | ||
245 | */ | ||
246 | u16 dma_alignment; | ||
247 | |||
248 | /* Setup mode and clock, etc (spi driver may call many times). | ||
249 | * | ||
250 | * IMPORTANT: this may be called when transfers to another | ||
251 | * device are active. DO NOT UPDATE SHARED REGISTERS in ways | ||
252 | * which could break those transfers. | ||
253 | */ | ||
243 | int (*setup)(struct spi_device *spi); | 254 | int (*setup)(struct spi_device *spi); |
244 | 255 | ||
245 | /* bidirectional bulk transfers | 256 | /* bidirectional bulk transfers |
diff --git a/include/linux/splice.h b/include/linux/splice.h index 528dcb93c2f2..5f3faa9d15ae 100644 --- a/include/linux/splice.h +++ b/include/linux/splice.h | |||
@@ -36,6 +36,8 @@ struct splice_desc { | |||
36 | void *data; /* cookie */ | 36 | void *data; /* cookie */ |
37 | } u; | 37 | } u; |
38 | loff_t pos; /* file position */ | 38 | loff_t pos; /* file position */ |
39 | size_t num_spliced; /* number of bytes already spliced */ | ||
40 | bool need_wakeup; /* need to wake up writer */ | ||
39 | }; | 41 | }; |
40 | 42 | ||
41 | struct partial_page { | 43 | struct partial_page { |
@@ -66,6 +68,16 @@ extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *, | |||
66 | splice_actor *); | 68 | splice_actor *); |
67 | extern ssize_t __splice_from_pipe(struct pipe_inode_info *, | 69 | extern ssize_t __splice_from_pipe(struct pipe_inode_info *, |
68 | struct splice_desc *, splice_actor *); | 70 | struct splice_desc *, splice_actor *); |
71 | extern int splice_from_pipe_feed(struct pipe_inode_info *, struct splice_desc *, | ||
72 | splice_actor *); | ||
73 | extern int splice_from_pipe_next(struct pipe_inode_info *, | ||
74 | struct splice_desc *); | ||
75 | extern void splice_from_pipe_begin(struct splice_desc *); | ||
76 | extern void splice_from_pipe_end(struct pipe_inode_info *, | ||
77 | struct splice_desc *); | ||
78 | extern int pipe_to_file(struct pipe_inode_info *, struct pipe_buffer *, | ||
79 | struct splice_desc *); | ||
80 | |||
69 | extern ssize_t splice_to_pipe(struct pipe_inode_info *, | 81 | extern ssize_t splice_to_pipe(struct pipe_inode_info *, |
70 | struct splice_pipe_desc *); | 82 | struct splice_pipe_desc *); |
71 | extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, | 83 | extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, |
diff --git a/include/linux/stringify.h b/include/linux/stringify.h index 0b4388356c87..841cec8ed525 100644 --- a/include/linux/stringify.h +++ b/include/linux/stringify.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * converts to "bar". | 6 | * converts to "bar". |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define __stringify_1(x) #x | 9 | #define __stringify_1(x...) #x |
10 | #define __stringify(x) __stringify_1(x) | 10 | #define __stringify(x...) __stringify_1(x) |
11 | 11 | ||
12 | #endif /* !__LINUX_STRINGIFY_H */ | 12 | #endif /* !__LINUX_STRINGIFY_H */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 3e3a4364cbff..795032edfc46 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -58,10 +58,17 @@ typedef int __bitwise suspend_state_t; | |||
58 | * by @begin(). | 58 | * by @begin(). |
59 | * @prepare() is called right after devices have been suspended (ie. the | 59 | * @prepare() is called right after devices have been suspended (ie. the |
60 | * appropriate .suspend() method has been executed for each device) and | 60 | * appropriate .suspend() method has been executed for each device) and |
61 | * before the nonboot CPUs are disabled (it is executed with IRQs enabled). | 61 | * before device drivers' late suspend callbacks are executed. It returns |
62 | * This callback is optional. It returns 0 on success or a negative | 62 | * 0 on success or a negative error code otherwise, in which case the |
63 | * error code otherwise, in which case the system cannot enter the desired | 63 | * system cannot enter the desired sleep state (@prepare_late(), @enter(), |
64 | * sleep state (@enter() and @finish() will not be called in that case). | 64 | * @wake(), and @finish() will not be called in that case). |
65 | * | ||
66 | * @prepare_late: Finish preparing the platform for entering the system sleep | ||
67 | * state indicated by @begin(). | ||
68 | * @prepare_late is called before disabling nonboot CPUs and after | ||
69 | * device drivers' late suspend callbacks have been executed. It returns | ||
70 | * 0 on success or a negative error code otherwise, in which case the | ||
71 | * system cannot enter the desired sleep state (@enter() and @wake()). | ||
65 | * | 72 | * |
66 | * @enter: Enter the system sleep state indicated by @begin() or represented by | 73 | * @enter: Enter the system sleep state indicated by @begin() or represented by |
67 | * the argument if @begin() is not implemented. | 74 | * the argument if @begin() is not implemented. |
@@ -69,19 +76,26 @@ typedef int __bitwise suspend_state_t; | |||
69 | * error code otherwise, in which case the system cannot enter the desired | 76 | * error code otherwise, in which case the system cannot enter the desired |
70 | * sleep state. | 77 | * sleep state. |
71 | * | 78 | * |
72 | * @finish: Called when the system has just left a sleep state, right after | 79 | * @wake: Called when the system has just left a sleep state, right after |
73 | * the nonboot CPUs have been enabled and before devices are resumed (it is | 80 | * the nonboot CPUs have been enabled and before device drivers' early |
74 | * executed with IRQs enabled). | 81 | * resume callbacks are executed. |
82 | * This callback is optional, but should be implemented by the platforms | ||
83 | * that implement @prepare_late(). If implemented, it is always called | ||
84 | * after @enter(), even if @enter() fails. | ||
85 | * | ||
86 | * @finish: Finish wake-up of the platform. | ||
87 | * @finish is called right prior to calling device drivers' regular suspend | ||
88 | * callbacks. | ||
75 | * This callback is optional, but should be implemented by the platforms | 89 | * This callback is optional, but should be implemented by the platforms |
76 | * that implement @prepare(). If implemented, it is always called after | 90 | * that implement @prepare(). If implemented, it is always called after |
77 | * @enter() (even if @enter() fails). | 91 | * @enter() and @wake(), if implemented, even if any of them fails. |
78 | * | 92 | * |
79 | * @end: Called by the PM core right after resuming devices, to indicate to | 93 | * @end: Called by the PM core right after resuming devices, to indicate to |
80 | * the platform that the system has returned to the working state or | 94 | * the platform that the system has returned to the working state or |
81 | * the transition to the sleep state has been aborted. | 95 | * the transition to the sleep state has been aborted. |
82 | * This callback is optional, but should be implemented by the platforms | 96 | * This callback is optional, but should be implemented by the platforms |
83 | * that implement @begin(), but platforms implementing @begin() should | 97 | * that implement @begin(). Accordingly, platforms implementing @begin() |
84 | * also provide a @end() which cleans up transitions aborted before | 98 | * should also provide a @end() which cleans up transitions aborted before |
85 | * @enter(). | 99 | * @enter(). |
86 | * | 100 | * |
87 | * @recover: Recover the platform from a suspend failure. | 101 | * @recover: Recover the platform from a suspend failure. |
@@ -93,7 +107,9 @@ struct platform_suspend_ops { | |||
93 | int (*valid)(suspend_state_t state); | 107 | int (*valid)(suspend_state_t state); |
94 | int (*begin)(suspend_state_t state); | 108 | int (*begin)(suspend_state_t state); |
95 | int (*prepare)(void); | 109 | int (*prepare)(void); |
110 | int (*prepare_late)(void); | ||
96 | int (*enter)(suspend_state_t state); | 111 | int (*enter)(suspend_state_t state); |
112 | void (*wake)(void); | ||
97 | void (*finish)(void); | 113 | void (*finish)(void); |
98 | void (*end)(void); | 114 | void (*end)(void); |
99 | void (*recover)(void); | 115 | void (*recover)(void); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 6470f74074af..40617c1d8976 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -65,7 +65,7 @@ struct old_linux_dirent; | |||
65 | #include <asm/signal.h> | 65 | #include <asm/signal.h> |
66 | #include <linux/quota.h> | 66 | #include <linux/quota.h> |
67 | #include <linux/key.h> | 67 | #include <linux/key.h> |
68 | #include <linux/ftrace.h> | 68 | #include <trace/syscall.h> |
69 | 69 | ||
70 | #define __SC_DECL1(t1, a1) t1 a1 | 70 | #define __SC_DECL1(t1, a1) t1 a1 |
71 | #define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) | 71 | #define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) |
@@ -148,7 +148,7 @@ struct old_linux_dirent; | |||
148 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ | 148 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ |
149 | "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) | 149 | "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) |
150 | #else | 150 | #else |
151 | #ifdef CONFIG_ALPHA | 151 | #if defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) |
152 | #define SYSCALL_ALIAS(alias, name) \ | 152 | #define SYSCALL_ALIAS(alias, name) \ |
153 | asm ( #alias " = " #name "\n\t.globl " #alias) | 153 | asm ( #alias " = " #name "\n\t.globl " #alias) |
154 | #else | 154 | #else |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 8615d661ab60..bcba84ea2d86 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -309,7 +309,8 @@ extern void tty_set_operations(struct tty_driver *driver, | |||
309 | extern struct tty_driver *tty_find_polling_driver(char *name, int *line); | 309 | extern struct tty_driver *tty_find_polling_driver(char *name, int *line); |
310 | 310 | ||
311 | extern void tty_driver_kref_put(struct tty_driver *driver); | 311 | extern void tty_driver_kref_put(struct tty_driver *driver); |
312 | extern inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | 312 | |
313 | static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | ||
313 | { | 314 | { |
314 | kref_get(&d->kref); | 315 | kref_get(&d->kref); |
315 | return d; | 316 | return d; |
diff --git a/include/linux/usb.h b/include/linux/usb.h index c6b2ab41b908..3aa2cd1f8d08 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1387,6 +1387,7 @@ extern int usb_string(struct usb_device *dev, int index, | |||
1387 | extern int usb_clear_halt(struct usb_device *dev, int pipe); | 1387 | extern int usb_clear_halt(struct usb_device *dev, int pipe); |
1388 | extern int usb_reset_configuration(struct usb_device *dev); | 1388 | extern int usb_reset_configuration(struct usb_device *dev); |
1389 | extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); | 1389 | extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); |
1390 | extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr); | ||
1390 | 1391 | ||
1391 | /* this request isn't really synchronous, but it belongs with the others */ | 1392 | /* this request isn't really synchronous, but it belongs with the others */ |
1392 | extern int usb_driver_set_configuration(struct usb_device *udev, int config); | 1393 | extern int usb_driver_set_configuration(struct usb_device *udev, int config); |
@@ -1491,14 +1492,6 @@ void usb_sg_wait(struct usb_sg_request *io); | |||
1491 | #define usb_pipecontrol(pipe) (usb_pipetype((pipe)) == PIPE_CONTROL) | 1492 | #define usb_pipecontrol(pipe) (usb_pipetype((pipe)) == PIPE_CONTROL) |
1492 | #define usb_pipebulk(pipe) (usb_pipetype((pipe)) == PIPE_BULK) | 1493 | #define usb_pipebulk(pipe) (usb_pipetype((pipe)) == PIPE_BULK) |
1493 | 1494 | ||
1494 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ | ||
1495 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) | ||
1496 | #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) | ||
1497 | #define usb_settoggle(dev, ep, out, bit) \ | ||
1498 | ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \ | ||
1499 | ((bit) << (ep))) | ||
1500 | |||
1501 | |||
1502 | static inline unsigned int __create_pipe(struct usb_device *dev, | 1495 | static inline unsigned int __create_pipe(struct usb_device *dev, |
1503 | unsigned int endpoint) | 1496 | unsigned int endpoint) |
1504 | { | 1497 | { |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index b95842542590..625e9e4639c6 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -29,7 +29,7 @@ | |||
29 | /** | 29 | /** |
30 | * usb_serial_port: structure for the specific ports of a device. | 30 | * usb_serial_port: structure for the specific ports of a device. |
31 | * @serial: pointer back to the struct usb_serial owner of this port. | 31 | * @serial: pointer back to the struct usb_serial owner of this port. |
32 | * @tty: pointer to the corresponding tty for this port. | 32 | * @port: pointer to the corresponding tty_port for this port. |
33 | * @lock: spinlock to grab when updating portions of this structure. | 33 | * @lock: spinlock to grab when updating portions of this structure. |
34 | * @mutex: mutex used to synchronize serial_open() and serial_close() | 34 | * @mutex: mutex used to synchronize serial_open() and serial_close() |
35 | * access for this port. | 35 | * access for this port. |
@@ -44,19 +44,22 @@ | |||
44 | * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe | 44 | * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe |
45 | * for this port. | 45 | * for this port. |
46 | * @bulk_in_buffer: pointer to the bulk in buffer for this port. | 46 | * @bulk_in_buffer: pointer to the bulk in buffer for this port. |
47 | * @bulk_in_size: the size of the bulk_in_buffer, in bytes. | ||
47 | * @read_urb: pointer to the bulk in struct urb for this port. | 48 | * @read_urb: pointer to the bulk in struct urb for this port. |
48 | * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this | 49 | * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this |
49 | * port. | 50 | * port. |
50 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. | 51 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. |
51 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. | 52 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. |
52 | * @write_urb: pointer to the bulk out struct urb for this port. | 53 | * @write_urb: pointer to the bulk out struct urb for this port. |
54 | * @write_urb_busy: port`s writing status | ||
53 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this | 55 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this |
54 | * port. | 56 | * port. |
55 | * @write_wait: a wait_queue_head_t used by the port. | 57 | * @write_wait: a wait_queue_head_t used by the port. |
56 | * @work: work queue entry for the line discipline waking up. | 58 | * @work: work queue entry for the line discipline waking up. |
57 | * @open_count: number of times this port has been opened. | ||
58 | * @throttled: nonzero if the read urb is inactive to throttle the device | 59 | * @throttled: nonzero if the read urb is inactive to throttle the device |
59 | * @throttle_req: nonzero if the tty wants to throttle us | 60 | * @throttle_req: nonzero if the tty wants to throttle us |
61 | * @console: attached usb serial console | ||
62 | * @dev: pointer to the serial device | ||
60 | * | 63 | * |
61 | * This structure is used by the usb-serial core and drivers for the specific | 64 | * This structure is used by the usb-serial core and drivers for the specific |
62 | * ports of a device. | 65 | * ports of a device. |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 139d234923cd..ebb2ea6b4995 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -737,6 +737,11 @@ struct v4l2_input { | |||
737 | #define V4L2_IN_ST_NO_SIGNAL 0x00000002 | 737 | #define V4L2_IN_ST_NO_SIGNAL 0x00000002 |
738 | #define V4L2_IN_ST_NO_COLOR 0x00000004 | 738 | #define V4L2_IN_ST_NO_COLOR 0x00000004 |
739 | 739 | ||
740 | /* field 'status' - sensor orientation */ | ||
741 | /* If sensor is mounted upside down set both bits */ | ||
742 | #define V4L2_IN_ST_HFLIP 0x00000010 /* Frames are flipped horizontally */ | ||
743 | #define V4L2_IN_ST_VFLIP 0x00000020 /* Frames are flipped vertically */ | ||
744 | |||
740 | /* field 'status' - analog */ | 745 | /* field 'status' - analog */ |
741 | #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ | 746 | #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ |
742 | #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ | 747 | #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 93445477f86a..9c1ed1fb6ddb 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -168,6 +168,8 @@ void writeback_set_ratelimit(void); | |||
168 | /* pdflush.c */ | 168 | /* pdflush.c */ |
169 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl | 169 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl |
170 | read-only. */ | 170 | read-only. */ |
171 | extern int nr_pdflush_threads_max; /* Global so it can be exported to sysctl */ | ||
172 | extern int nr_pdflush_threads_min; /* Global so it can be exported to sysctl */ | ||
171 | 173 | ||
172 | 174 | ||
173 | #endif /* WRITEBACK_H */ | 175 | #endif /* WRITEBACK_H */ |