aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-15 01:44:51 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-15 01:44:51 -0400
commit43d2548bb2ef7e6d753f91468a746784041e522d (patch)
tree77d13fcd48fd998393abb825ec36e2b732684a73 /include/linux
parent585583d95c5660973bc0cf64add517b040acd8a4 (diff)
parent85082fd7cbe3173198aac0eb5e85ab1edcc6352c (diff)
Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build
Manual fixup of: arch/powerpc/Kconfig
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h6
-rw-r--r--include/linux/bio.h130
-rw-r--r--include/linux/blkdev.h163
-rw-r--r--include/linux/blktrace_api.h1
-rw-r--r--include/linux/bootmem.h2
-rw-r--r--include/linux/console.h2
-rw-r--r--include/linux/crypto.h48
-rw-r--r--include/linux/delay.h1
-rw-r--r--include/linux/efi.h4
-rw-r--r--include/linux/firmware-map.h74
-rw-r--r--include/linux/fs.h3
-rw-r--r--include/linux/ftrace.h144
-rw-r--r--include/linux/genhd.h12
-rw-r--r--include/linux/interrupt.h3
-rw-r--r--include/linux/iocontext.h18
-rw-r--r--include/linux/irqflags.h13
-rw-r--r--include/linux/kernel.h8
-rw-r--r--include/linux/kernel_stat.h2
-rw-r--r--include/linux/kprobes.h4
-rw-r--r--include/linux/linkage.h6
-rw-r--r--include/linux/lockdep.h11
-rw-r--r--include/linux/marker.h40
-rw-r--r--include/linux/mm.h7
-rw-r--r--include/linux/mmiotrace.h85
-rw-r--r--include/linux/mod_devicetable.h9
-rw-r--r--include/linux/page-flags.h1
-rw-r--r--include/linux/pageblock-flags.h8
-rw-r--r--include/linux/preempt.h34
-rw-r--r--include/linux/ptrace.h8
-rw-r--r--include/linux/pwm.h31
-rw-r--r--include/linux/pwm_backlight.h17
-rw-r--r--include/linux/resume-trace.h2
-rw-r--r--include/linux/sched.h77
-rw-r--r--include/linux/security.h49
-rw-r--r--include/linux/smp_lock.h13
-rw-r--r--include/linux/writeback.h2
36 files changed, 906 insertions, 132 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 41f7ce7edd7..0601075d09a 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -82,6 +82,7 @@ char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
82int early_acpi_boot_init(void); 82int early_acpi_boot_init(void);
83int acpi_boot_init (void); 83int acpi_boot_init (void);
84int acpi_boot_table_init (void); 84int acpi_boot_table_init (void);
85int acpi_mps_check (void);
85int acpi_numa_init (void); 86int acpi_numa_init (void);
86 87
87int acpi_table_init (void); 88int acpi_table_init (void);
@@ -250,6 +251,11 @@ static inline int acpi_boot_table_init(void)
250 return 0; 251 return 0;
251} 252}
252 253
254static inline int acpi_mps_check(void)
255{
256 return 0;
257}
258
253static inline int acpi_check_resource_conflict(struct resource *res) 259static inline int acpi_check_resource_conflict(struct resource *res)
254{ 260{
255 return 0; 261 return 0;
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 61c15eaf3fb..0933a14e641 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -64,6 +64,7 @@ struct bio_vec {
64 64
65struct bio_set; 65struct bio_set;
66struct bio; 66struct bio;
67struct bio_integrity_payload;
67typedef void (bio_end_io_t) (struct bio *, int); 68typedef void (bio_end_io_t) (struct bio *, int);
68typedef void (bio_destructor_t) (struct bio *); 69typedef void (bio_destructor_t) (struct bio *);
69 70
@@ -112,6 +113,9 @@ struct bio {
112 atomic_t bi_cnt; /* pin count */ 113 atomic_t bi_cnt; /* pin count */
113 114
114 void *bi_private; 115 void *bi_private;
116#if defined(CONFIG_BLK_DEV_INTEGRITY)
117 struct bio_integrity_payload *bi_integrity; /* data integrity */
118#endif
115 119
116 bio_destructor_t *bi_destructor; /* destructor */ 120 bio_destructor_t *bi_destructor; /* destructor */
117}; 121};
@@ -271,6 +275,29 @@ static inline void *bio_data(struct bio *bio)
271 */ 275 */
272#define bio_get(bio) atomic_inc(&(bio)->bi_cnt) 276#define bio_get(bio) atomic_inc(&(bio)->bi_cnt)
273 277
278#if defined(CONFIG_BLK_DEV_INTEGRITY)
279/*
280 * bio integrity payload
281 */
282struct bio_integrity_payload {
283 struct bio *bip_bio; /* parent bio */
284 struct bio_vec *bip_vec; /* integrity data vector */
285
286 sector_t bip_sector; /* virtual start sector */
287
288 void *bip_buf; /* generated integrity data */
289 bio_end_io_t *bip_end_io; /* saved I/O completion fn */
290
291 int bip_error; /* saved I/O error */
292 unsigned int bip_size;
293
294 unsigned short bip_pool; /* pool the ivec came from */
295 unsigned short bip_vcnt; /* # of integrity bio_vecs */
296 unsigned short bip_idx; /* current bip_vec index */
297
298 struct work_struct bip_work; /* I/O completion */
299};
300#endif /* CONFIG_BLK_DEV_INTEGRITY */
274 301
275/* 302/*
276 * A bio_pair is used when we need to split a bio. 303 * A bio_pair is used when we need to split a bio.
@@ -283,10 +310,14 @@ static inline void *bio_data(struct bio *bio)
283 * in bio2.bi_private 310 * in bio2.bi_private
284 */ 311 */
285struct bio_pair { 312struct bio_pair {
286 struct bio bio1, bio2; 313 struct bio bio1, bio2;
287 struct bio_vec bv1, bv2; 314 struct bio_vec bv1, bv2;
288 atomic_t cnt; 315#if defined(CONFIG_BLK_DEV_INTEGRITY)
289 int error; 316 struct bio_integrity_payload bip1, bip2;
317 struct bio_vec iv1, iv2;
318#endif
319 atomic_t cnt;
320 int error;
290}; 321};
291extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, 322extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool,
292 int first_sectors); 323 int first_sectors);
@@ -333,6 +364,39 @@ extern struct bio *bio_copy_user_iov(struct request_queue *, struct sg_iovec *,
333 int, int); 364 int, int);
334extern int bio_uncopy_user(struct bio *); 365extern int bio_uncopy_user(struct bio *);
335void zero_fill_bio(struct bio *bio); 366void zero_fill_bio(struct bio *bio);
367extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *);
368extern unsigned int bvec_nr_vecs(unsigned short idx);
369
370/*
371 * bio_set is used to allow other portions of the IO system to
372 * allocate their own private memory pools for bio and iovec structures.
373 * These memory pools in turn all allocate from the bio_slab
374 * and the bvec_slabs[].
375 */
376#define BIO_POOL_SIZE 2
377#define BIOVEC_NR_POOLS 6
378
379struct bio_set {
380 mempool_t *bio_pool;
381#if defined(CONFIG_BLK_DEV_INTEGRITY)
382 mempool_t *bio_integrity_pool;
383#endif
384 mempool_t *bvec_pools[BIOVEC_NR_POOLS];
385};
386
387struct biovec_slab {
388 int nr_vecs;
389 char *name;
390 struct kmem_cache *slab;
391};
392
393extern struct bio_set *fs_bio_set;
394
395/*
396 * a small number of entries is fine, not going to be performance critical.
397 * basically we just need to survive
398 */
399#define BIO_SPLIT_ENTRIES 2
336 400
337#ifdef CONFIG_HIGHMEM 401#ifdef CONFIG_HIGHMEM
338/* 402/*
@@ -381,5 +445,63 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
381 __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) 445 __bio_kmap_irq((bio), (bio)->bi_idx, (flags))
382#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) 446#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
383 447
448#if defined(CONFIG_BLK_DEV_INTEGRITY)
449
450#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))
451#define bip_vec(bip) bip_vec_idx(bip, 0)
452
453#define __bip_for_each_vec(bvl, bip, i, start_idx) \
454 for (bvl = bip_vec_idx((bip), (start_idx)), i = (start_idx); \
455 i < (bip)->bip_vcnt; \
456 bvl++, i++)
457
458#define bip_for_each_vec(bvl, bip, i) \
459 __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx)
460
461static inline int bio_integrity(struct bio *bio)
462{
463#if defined(CONFIG_BLK_DEV_INTEGRITY)
464 return bio->bi_integrity != NULL;
465#else
466 return 0;
467#endif
468}
469
470extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *);
471extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int);
472extern void bio_integrity_free(struct bio *, struct bio_set *);
473extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int);
474extern int bio_integrity_enabled(struct bio *bio);
475extern int bio_integrity_set_tag(struct bio *, void *, unsigned int);
476extern int bio_integrity_get_tag(struct bio *, void *, unsigned int);
477extern int bio_integrity_prep(struct bio *);
478extern void bio_integrity_endio(struct bio *, int);
479extern void bio_integrity_advance(struct bio *, unsigned int);
480extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
481extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
482extern int bio_integrity_clone(struct bio *, struct bio *, struct bio_set *);
483extern int bioset_integrity_create(struct bio_set *, int);
484extern void bioset_integrity_free(struct bio_set *);
485extern void bio_integrity_init_slab(void);
486
487#else /* CONFIG_BLK_DEV_INTEGRITY */
488
489#define bio_integrity(a) (0)
490#define bioset_integrity_create(a, b) (0)
491#define bio_integrity_prep(a) (0)
492#define bio_integrity_enabled(a) (0)
493#define bio_integrity_clone(a, b, c) (0)
494#define bioset_integrity_free(a) do { } while (0)
495#define bio_integrity_free(a, b) do { } while (0)
496#define bio_integrity_endio(a, b) do { } while (0)
497#define bio_integrity_advance(a, b) do { } while (0)
498#define bio_integrity_trim(a, b, c) do { } while (0)
499#define bio_integrity_split(a, b, c) do { } while (0)
500#define bio_integrity_set_tag(a, b, c) do { } while (0)
501#define bio_integrity_get_tag(a, b, c) do { } while (0)
502#define bio_integrity_init_slab(a) do { } while (0)
503
504#endif /* CONFIG_BLK_DEV_INTEGRITY */
505
384#endif /* CONFIG_BLOCK */ 506#endif /* CONFIG_BLOCK */
385#endif /* __LINUX_BIO_H */ 507#endif /* __LINUX_BIO_H */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d2a1b71e93c..1ffd8bfdc4c 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -23,7 +23,6 @@
23struct scsi_ioctl_command; 23struct scsi_ioctl_command;
24 24
25struct request_queue; 25struct request_queue;
26typedef struct request_queue request_queue_t __deprecated;
27struct elevator_queue; 26struct elevator_queue;
28typedef struct elevator_queue elevator_t; 27typedef struct elevator_queue elevator_t;
29struct request_pm_state; 28struct request_pm_state;
@@ -34,12 +33,6 @@ struct sg_io_hdr;
34#define BLKDEV_MIN_RQ 4 33#define BLKDEV_MIN_RQ 4
35#define BLKDEV_MAX_RQ 128 /* Default maximum */ 34#define BLKDEV_MAX_RQ 128 /* Default maximum */
36 35
37int put_io_context(struct io_context *ioc);
38void exit_io_context(void);
39struct io_context *get_io_context(gfp_t gfp_flags, int node);
40struct io_context *alloc_io_context(gfp_t gfp_flags, int node);
41void copy_io_context(struct io_context **pdst, struct io_context **psrc);
42
43struct request; 36struct request;
44typedef void (rq_end_io_fn)(struct request *, int); 37typedef void (rq_end_io_fn)(struct request *, int);
45 38
@@ -113,6 +106,7 @@ enum rq_flag_bits {
113 __REQ_ALLOCED, /* request came from our alloc pool */ 106 __REQ_ALLOCED, /* request came from our alloc pool */
114 __REQ_RW_META, /* metadata io request */ 107 __REQ_RW_META, /* metadata io request */
115 __REQ_COPY_USER, /* contains copies of user pages */ 108 __REQ_COPY_USER, /* contains copies of user pages */
109 __REQ_INTEGRITY, /* integrity metadata has been remapped */
116 __REQ_NR_BITS, /* stops here */ 110 __REQ_NR_BITS, /* stops here */
117}; 111};
118 112
@@ -135,6 +129,7 @@ enum rq_flag_bits {
135#define REQ_ALLOCED (1 << __REQ_ALLOCED) 129#define REQ_ALLOCED (1 << __REQ_ALLOCED)
136#define REQ_RW_META (1 << __REQ_RW_META) 130#define REQ_RW_META (1 << __REQ_RW_META)
137#define REQ_COPY_USER (1 << __REQ_COPY_USER) 131#define REQ_COPY_USER (1 << __REQ_COPY_USER)
132#define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
138 133
139#define BLK_MAX_CDB 16 134#define BLK_MAX_CDB 16
140 135
@@ -259,7 +254,14 @@ typedef int (prep_rq_fn) (struct request_queue *, struct request *);
259typedef void (unplug_fn) (struct request_queue *); 254typedef void (unplug_fn) (struct request_queue *);
260 255
261struct bio_vec; 256struct bio_vec;
262typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *); 257struct bvec_merge_data {
258 struct block_device *bi_bdev;
259 sector_t bi_sector;
260 unsigned bi_size;
261 unsigned long bi_rw;
262};
263typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *,
264 struct bio_vec *);
263typedef void (prepare_flush_fn) (struct request_queue *, struct request *); 265typedef void (prepare_flush_fn) (struct request_queue *, struct request *);
264typedef void (softirq_done_fn)(struct request *); 266typedef void (softirq_done_fn)(struct request *);
265typedef int (dma_drain_needed_fn)(struct request *); 267typedef int (dma_drain_needed_fn)(struct request *);
@@ -426,6 +428,32 @@ static inline void queue_flag_set_unlocked(unsigned int flag,
426 __set_bit(flag, &q->queue_flags); 428 __set_bit(flag, &q->queue_flags);
427} 429}
428 430
431static inline int queue_flag_test_and_clear(unsigned int flag,
432 struct request_queue *q)
433{
434 WARN_ON_ONCE(!queue_is_locked(q));
435
436 if (test_bit(flag, &q->queue_flags)) {
437 __clear_bit(flag, &q->queue_flags);
438 return 1;
439 }
440
441 return 0;
442}
443
444static inline int queue_flag_test_and_set(unsigned int flag,
445 struct request_queue *q)
446{
447 WARN_ON_ONCE(!queue_is_locked(q));
448
449 if (!test_bit(flag, &q->queue_flags)) {
450 __set_bit(flag, &q->queue_flags);
451 return 0;
452 }
453
454 return 1;
455}
456
429static inline void queue_flag_set(unsigned int flag, struct request_queue *q) 457static inline void queue_flag_set(unsigned int flag, struct request_queue *q)
430{ 458{
431 WARN_ON_ONCE(!queue_is_locked(q)); 459 WARN_ON_ONCE(!queue_is_locked(q));
@@ -676,7 +704,6 @@ extern int blk_execute_rq(struct request_queue *, struct gendisk *,
676 struct request *, int); 704 struct request *, int);
677extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, 705extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
678 struct request *, int, rq_end_io_fn *); 706 struct request *, int, rq_end_io_fn *);
679extern int blk_verify_command(unsigned char *, int);
680extern void blk_unplug(struct request_queue *q); 707extern void blk_unplug(struct request_queue *q);
681 708
682static inline struct request_queue *bdev_get_queue(struct block_device *bdev) 709static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
@@ -749,6 +776,7 @@ extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
749extern void blk_queue_hardsect_size(struct request_queue *, unsigned short); 776extern void blk_queue_hardsect_size(struct request_queue *, unsigned short);
750extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); 777extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
751extern void blk_queue_dma_pad(struct request_queue *, unsigned int); 778extern void blk_queue_dma_pad(struct request_queue *, unsigned int);
779extern void blk_queue_update_dma_pad(struct request_queue *, unsigned int);
752extern int blk_queue_dma_drain(struct request_queue *q, 780extern int blk_queue_dma_drain(struct request_queue *q,
753 dma_drain_needed_fn *dma_drain_needed, 781 dma_drain_needed_fn *dma_drain_needed,
754 void *buf, unsigned int size); 782 void *buf, unsigned int size);
@@ -802,6 +830,15 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
802 830
803extern int blkdev_issue_flush(struct block_device *, sector_t *); 831extern int blkdev_issue_flush(struct block_device *, sector_t *);
804 832
833/*
834* command filter functions
835*/
836extern int blk_verify_command(struct file *file, unsigned char *cmd);
837extern int blk_cmd_filter_verify_command(struct blk_scsi_cmd_filter *filter,
838 unsigned char *cmd, mode_t *f_mode);
839extern int blk_register_filter(struct gendisk *disk);
840extern void blk_unregister_filter(struct gendisk *disk);
841
805#define MAX_PHYS_SEGMENTS 128 842#define MAX_PHYS_SEGMENTS 128
806#define MAX_HW_SEGMENTS 128 843#define MAX_HW_SEGMENTS 128
807#define SAFE_MAX_SECTORS 255 844#define SAFE_MAX_SECTORS 255
@@ -865,28 +902,116 @@ void kblockd_flush_work(struct work_struct *work);
865#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 902#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
866 MODULE_ALIAS("block-major-" __stringify(major) "-*") 903 MODULE_ALIAS("block-major-" __stringify(major) "-*")
867 904
905#if defined(CONFIG_BLK_DEV_INTEGRITY)
868 906
869#else /* CONFIG_BLOCK */ 907#define INTEGRITY_FLAG_READ 2 /* verify data integrity on read */
870/* 908#define INTEGRITY_FLAG_WRITE 4 /* generate data integrity on write */
871 * stubs for when the block layer is configured out
872 */
873#define buffer_heads_over_limit 0
874 909
875static inline long nr_blockdev_pages(void) 910struct blk_integrity_exchg {
911 void *prot_buf;
912 void *data_buf;
913 sector_t sector;
914 unsigned int data_size;
915 unsigned short sector_size;
916 const char *disk_name;
917};
918
919typedef void (integrity_gen_fn) (struct blk_integrity_exchg *);
920typedef int (integrity_vrfy_fn) (struct blk_integrity_exchg *);
921typedef void (integrity_set_tag_fn) (void *, void *, unsigned int);
922typedef void (integrity_get_tag_fn) (void *, void *, unsigned int);
923
924struct blk_integrity {
925 integrity_gen_fn *generate_fn;
926 integrity_vrfy_fn *verify_fn;
927 integrity_set_tag_fn *set_tag_fn;
928 integrity_get_tag_fn *get_tag_fn;
929
930 unsigned short flags;
931 unsigned short tuple_size;
932 unsigned short sector_size;
933 unsigned short tag_size;
934
935 const char *name;
936
937 struct kobject kobj;
938};
939
940extern int blk_integrity_register(struct gendisk *, struct blk_integrity *);
941extern void blk_integrity_unregister(struct gendisk *);
942extern int blk_integrity_compare(struct block_device *, struct block_device *);
943extern int blk_rq_map_integrity_sg(struct request *, struct scatterlist *);
944extern int blk_rq_count_integrity_sg(struct request *);
945
946static inline unsigned short blk_integrity_tuple_size(struct blk_integrity *bi)
876{ 947{
948 if (bi)
949 return bi->tuple_size;
950
877 return 0; 951 return 0;
878} 952}
879 953
880static inline void exit_io_context(void) 954static inline struct blk_integrity *bdev_get_integrity(struct block_device *bdev)
881{ 955{
956 return bdev->bd_disk->integrity;
882} 957}
883 958
884struct io_context; 959static inline unsigned int bdev_get_tag_size(struct block_device *bdev)
885static inline int put_io_context(struct io_context *ioc)
886{ 960{
887 return 1; 961 struct blk_integrity *bi = bdev_get_integrity(bdev);
962
963 if (bi)
964 return bi->tag_size;
965
966 return 0;
967}
968
969static inline int bdev_integrity_enabled(struct block_device *bdev, int rw)
970{
971 struct blk_integrity *bi = bdev_get_integrity(bdev);
972
973 if (bi == NULL)
974 return 0;
975
976 if (rw == READ && bi->verify_fn != NULL &&
977 (bi->flags & INTEGRITY_FLAG_READ))
978 return 1;
979
980 if (rw == WRITE && bi->generate_fn != NULL &&
981 (bi->flags & INTEGRITY_FLAG_WRITE))
982 return 1;
983
984 return 0;
888} 985}
889 986
987static inline int blk_integrity_rq(struct request *rq)
988{
989 return bio_integrity(rq->bio);
990}
991
992#else /* CONFIG_BLK_DEV_INTEGRITY */
993
994#define blk_integrity_rq(rq) (0)
995#define blk_rq_count_integrity_sg(a) (0)
996#define blk_rq_map_integrity_sg(a, b) (0)
997#define bdev_get_integrity(a) (0)
998#define bdev_get_tag_size(a) (0)
999#define blk_integrity_compare(a, b) (0)
1000#define blk_integrity_register(a, b) (0)
1001#define blk_integrity_unregister(a) do { } while (0);
1002
1003#endif /* CONFIG_BLK_DEV_INTEGRITY */
1004
1005#else /* CONFIG_BLOCK */
1006/*
1007 * stubs for when the block layer is configured out
1008 */
1009#define buffer_heads_over_limit 0
1010
1011static inline long nr_blockdev_pages(void)
1012{
1013 return 0;
1014}
890 1015
891#endif /* CONFIG_BLOCK */ 1016#endif /* CONFIG_BLOCK */
892 1017
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index e3ef903aae8..d084b8d227a 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -129,6 +129,7 @@ struct blk_trace {
129 u32 dev; 129 u32 dev;
130 struct dentry *dir; 130 struct dentry *dir;
131 struct dentry *dropped_file; 131 struct dentry *dropped_file;
132 struct dentry *msg_file;
132 atomic_t dropped; 133 atomic_t dropped;
133}; 134};
134 135
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 686895bacd9..a1d9b79078e 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -84,6 +84,8 @@ extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags);
84 __alloc_bootmem_low(x, PAGE_SIZE, 0) 84 __alloc_bootmem_low(x, PAGE_SIZE, 0)
85#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ 85#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
86 86
87extern int reserve_bootmem_generic(unsigned long addr, unsigned long size,
88 int flags);
87extern unsigned long free_all_bootmem(void); 89extern unsigned long free_all_bootmem(void);
88extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); 90extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);
89extern void *__alloc_bootmem_node(pg_data_t *pgdat, 91extern void *__alloc_bootmem_node(pg_data_t *pgdat,
diff --git a/include/linux/console.h b/include/linux/console.h
index a4f27fbdf54..248e6e3b9b7 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -108,6 +108,8 @@ struct console {
108 struct console *next; 108 struct console *next;
109}; 109};
110 110
111extern int console_set_on_cmdline;
112
111extern int add_preferred_console(char *name, int idx, char *options); 113extern int add_preferred_console(char *name, int idx, char *options);
112extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); 114extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options);
113extern void register_console(struct console *); 115extern void register_console(struct console *);
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 425824bd49f..c43dc47fdf7 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -30,15 +30,17 @@
30 */ 30 */
31#define CRYPTO_ALG_TYPE_MASK 0x0000000f 31#define CRYPTO_ALG_TYPE_MASK 0x0000000f
32#define CRYPTO_ALG_TYPE_CIPHER 0x00000001 32#define CRYPTO_ALG_TYPE_CIPHER 0x00000001
33#define CRYPTO_ALG_TYPE_DIGEST 0x00000002 33#define CRYPTO_ALG_TYPE_COMPRESS 0x00000002
34#define CRYPTO_ALG_TYPE_HASH 0x00000003 34#define CRYPTO_ALG_TYPE_AEAD 0x00000003
35#define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004 35#define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004
36#define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005 36#define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005
37#define CRYPTO_ALG_TYPE_GIVCIPHER 0x00000006 37#define CRYPTO_ALG_TYPE_GIVCIPHER 0x00000006
38#define CRYPTO_ALG_TYPE_COMPRESS 0x00000008 38#define CRYPTO_ALG_TYPE_DIGEST 0x00000008
39#define CRYPTO_ALG_TYPE_AEAD 0x00000009 39#define CRYPTO_ALG_TYPE_HASH 0x00000009
40#define CRYPTO_ALG_TYPE_AHASH 0x0000000a
40 41
41#define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e 42#define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e
43#define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000c
42#define CRYPTO_ALG_TYPE_BLKCIPHER_MASK 0x0000000c 44#define CRYPTO_ALG_TYPE_BLKCIPHER_MASK 0x0000000c
43 45
44#define CRYPTO_ALG_LARVAL 0x00000010 46#define CRYPTO_ALG_LARVAL 0x00000010
@@ -102,6 +104,7 @@ struct crypto_async_request;
102struct crypto_aead; 104struct crypto_aead;
103struct crypto_blkcipher; 105struct crypto_blkcipher;
104struct crypto_hash; 106struct crypto_hash;
107struct crypto_ahash;
105struct crypto_tfm; 108struct crypto_tfm;
106struct crypto_type; 109struct crypto_type;
107struct aead_givcrypt_request; 110struct aead_givcrypt_request;
@@ -131,6 +134,16 @@ struct ablkcipher_request {
131 void *__ctx[] CRYPTO_MINALIGN_ATTR; 134 void *__ctx[] CRYPTO_MINALIGN_ATTR;
132}; 135};
133 136
137struct ahash_request {
138 struct crypto_async_request base;
139
140 unsigned int nbytes;
141 struct scatterlist *src;
142 u8 *result;
143
144 void *__ctx[] CRYPTO_MINALIGN_ATTR;
145};
146
134/** 147/**
135 * struct aead_request - AEAD request 148 * struct aead_request - AEAD request
136 * @base: Common attributes for async crypto requests 149 * @base: Common attributes for async crypto requests
@@ -195,6 +208,17 @@ struct ablkcipher_alg {
195 unsigned int ivsize; 208 unsigned int ivsize;
196}; 209};
197 210
211struct ahash_alg {
212 int (*init)(struct ahash_request *req);
213 int (*update)(struct ahash_request *req);
214 int (*final)(struct ahash_request *req);
215 int (*digest)(struct ahash_request *req);
216 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
217 unsigned int keylen);
218
219 unsigned int digestsize;
220};
221
198struct aead_alg { 222struct aead_alg {
199 int (*setkey)(struct crypto_aead *tfm, const u8 *key, 223 int (*setkey)(struct crypto_aead *tfm, const u8 *key,
200 unsigned int keylen); 224 unsigned int keylen);
@@ -272,6 +296,7 @@ struct compress_alg {
272#define cra_cipher cra_u.cipher 296#define cra_cipher cra_u.cipher
273#define cra_digest cra_u.digest 297#define cra_digest cra_u.digest
274#define cra_hash cra_u.hash 298#define cra_hash cra_u.hash
299#define cra_ahash cra_u.ahash
275#define cra_compress cra_u.compress 300#define cra_compress cra_u.compress
276 301
277struct crypto_alg { 302struct crypto_alg {
@@ -298,6 +323,7 @@ struct crypto_alg {
298 struct cipher_alg cipher; 323 struct cipher_alg cipher;
299 struct digest_alg digest; 324 struct digest_alg digest;
300 struct hash_alg hash; 325 struct hash_alg hash;
326 struct ahash_alg ahash;
301 struct compress_alg compress; 327 struct compress_alg compress;
302 } cra_u; 328 } cra_u;
303 329
@@ -383,6 +409,18 @@ struct hash_tfm {
383 unsigned int digestsize; 409 unsigned int digestsize;
384}; 410};
385 411
412struct ahash_tfm {
413 int (*init)(struct ahash_request *req);
414 int (*update)(struct ahash_request *req);
415 int (*final)(struct ahash_request *req);
416 int (*digest)(struct ahash_request *req);
417 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
418 unsigned int keylen);
419
420 unsigned int digestsize;
421 unsigned int reqsize;
422};
423
386struct compress_tfm { 424struct compress_tfm {
387 int (*cot_compress)(struct crypto_tfm *tfm, 425 int (*cot_compress)(struct crypto_tfm *tfm,
388 const u8 *src, unsigned int slen, 426 const u8 *src, unsigned int slen,
@@ -397,6 +435,7 @@ struct compress_tfm {
397#define crt_blkcipher crt_u.blkcipher 435#define crt_blkcipher crt_u.blkcipher
398#define crt_cipher crt_u.cipher 436#define crt_cipher crt_u.cipher
399#define crt_hash crt_u.hash 437#define crt_hash crt_u.hash
438#define crt_ahash crt_u.ahash
400#define crt_compress crt_u.compress 439#define crt_compress crt_u.compress
401 440
402struct crypto_tfm { 441struct crypto_tfm {
@@ -409,6 +448,7 @@ struct crypto_tfm {
409 struct blkcipher_tfm blkcipher; 448 struct blkcipher_tfm blkcipher;
410 struct cipher_tfm cipher; 449 struct cipher_tfm cipher;
411 struct hash_tfm hash; 450 struct hash_tfm hash;
451 struct ahash_tfm ahash;
412 struct compress_tfm compress; 452 struct compress_tfm compress;
413 } crt_u; 453 } crt_u;
414 454
diff --git a/include/linux/delay.h b/include/linux/delay.h
index 54552d21296..fd832c6d419 100644
--- a/include/linux/delay.h
+++ b/include/linux/delay.h
@@ -41,6 +41,7 @@ static inline void ndelay(unsigned long x)
41#define ndelay(x) ndelay(x) 41#define ndelay(x) ndelay(x)
42#endif 42#endif
43 43
44extern unsigned long lpj_fine;
44void calibrate_delay(void); 45void calibrate_delay(void);
45void msleep(unsigned int msecs); 46void msleep(unsigned int msecs);
46unsigned long msleep_interruptible(unsigned int msecs); 47unsigned long msleep_interruptible(unsigned int msecs);
diff --git a/include/linux/efi.h b/include/linux/efi.h
index a5f359a7ad0..807373d467f 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -287,7 +287,6 @@ efi_guid_unparse(efi_guid_t *guid, char *out)
287extern void efi_init (void); 287extern void efi_init (void);
288extern void *efi_get_pal_addr (void); 288extern void *efi_get_pal_addr (void);
289extern void efi_map_pal_code (void); 289extern void efi_map_pal_code (void);
290extern void efi_map_memmap(void);
291extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); 290extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
292extern void efi_gettimeofday (struct timespec *ts); 291extern void efi_gettimeofday (struct timespec *ts);
293extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ 292extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */
@@ -295,14 +294,11 @@ extern u64 efi_get_iobase (void);
295extern u32 efi_mem_type (unsigned long phys_addr); 294extern u32 efi_mem_type (unsigned long phys_addr);
296extern u64 efi_mem_attributes (unsigned long phys_addr); 295extern u64 efi_mem_attributes (unsigned long phys_addr);
297extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size); 296extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size);
298extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size,
299 u64 attr);
300extern int __init efi_uart_console_only (void); 297extern int __init efi_uart_console_only (void);
301extern void efi_initialize_iomem_resources(struct resource *code_resource, 298extern void efi_initialize_iomem_resources(struct resource *code_resource,
302 struct resource *data_resource, struct resource *bss_resource); 299 struct resource *data_resource, struct resource *bss_resource);
303extern unsigned long efi_get_time(void); 300extern unsigned long efi_get_time(void);
304extern int efi_set_rtc_mmss(unsigned long nowtime); 301extern int efi_set_rtc_mmss(unsigned long nowtime);
305extern int is_available_memory(efi_memory_desc_t * md);
306extern struct efi_memory_map memmap; 302extern struct efi_memory_map memmap;
307 303
308/** 304/**
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h
new file mode 100644
index 00000000000..acbdbcc1605
--- /dev/null
+++ b/include/linux/firmware-map.h
@@ -0,0 +1,74 @@
1/*
2 * include/linux/firmware-map.h:
3 * Copyright (C) 2008 SUSE LINUX Products GmbH
4 * by Bernhard Walle <bwalle@suse.de>
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 v2.0 as published by
8 * the Free Software Foundation
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16#ifndef _LINUX_FIRMWARE_MAP_H
17#define _LINUX_FIRMWARE_MAP_H
18
19#include <linux/list.h>
20#include <linux/kobject.h>
21
22/*
23 * provide a dummy interface if CONFIG_FIRMWARE_MEMMAP is disabled
24 */
25#ifdef CONFIG_FIRMWARE_MEMMAP
26
27/**
28 * Adds a firmware mapping entry. This function uses kmalloc() for memory
29 * allocation. Use firmware_map_add_early() if you want to use the bootmem
30 * allocator.
31 *
32 * That function must be called before late_initcall.
33 *
34 * @start: Start of the memory range.
35 * @end: End of the memory range (inclusive).
36 * @type: Type of the memory range.
37 *
38 * Returns 0 on success, or -ENOMEM if no memory could be allocated.
39 */
40int firmware_map_add(resource_size_t start, resource_size_t end,
41 const char *type);
42
43/**
44 * Adds a firmware mapping entry. This function uses the bootmem allocator
45 * for memory allocation. Use firmware_map_add() if you want to use kmalloc().
46 *
47 * That function must be called before late_initcall.
48 *
49 * @start: Start of the memory range.
50 * @end: End of the memory range (inclusive).
51 * @type: Type of the memory range.
52 *
53 * Returns 0 on success, or -ENOMEM if no memory could be allocated.
54 */
55int firmware_map_add_early(resource_size_t start, resource_size_t end,
56 const char *type);
57
58#else /* CONFIG_FIRMWARE_MEMMAP */
59
60static inline int firmware_map_add(resource_size_t start, resource_size_t end,
61 const char *type)
62{
63 return 0;
64}
65
66static inline int firmware_map_add_early(resource_size_t start,
67 resource_size_t end, const char *type)
68{
69 return 0;
70}
71
72#endif /* CONFIG_FIRMWARE_MEMMAP */
73
74#endif /* _LINUX_FIRMWARE_MAP_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index d8e2762ed14..faac13e2cc5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1870,7 +1870,8 @@ extern void
1870file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); 1870file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
1871extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 1871extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
1872extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 1872extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
1873extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); 1873extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset,
1874 int origin);
1874extern int generic_file_open(struct inode * inode, struct file * filp); 1875extern int generic_file_open(struct inode * inode, struct file * filp);
1875extern int nonseekable_open(struct inode * inode, struct file * filp); 1876extern int nonseekable_open(struct inode * inode, struct file * filp);
1876 1877
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
new file mode 100644
index 00000000000..f368d041e02
--- /dev/null
+++ b/include/linux/ftrace.h
@@ -0,0 +1,144 @@
1#ifndef _LINUX_FTRACE_H
2#define _LINUX_FTRACE_H
3
4#ifdef CONFIG_FTRACE
5
6#include <linux/linkage.h>
7#include <linux/fs.h>
8
9extern int ftrace_enabled;
10extern int
11ftrace_enable_sysctl(struct ctl_table *table, int write,
12 struct file *filp, void __user *buffer, size_t *lenp,
13 loff_t *ppos);
14
15typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
16
17struct ftrace_ops {
18 ftrace_func_t func;
19 struct ftrace_ops *next;
20};
21
22/*
23 * The ftrace_ops must be a static and should also
24 * be read_mostly. These functions do modify read_mostly variables
25 * so use them sparely. Never free an ftrace_op or modify the
26 * next pointer after it has been registered. Even after unregistering
27 * it, the next pointer may still be used internally.
28 */
29int register_ftrace_function(struct ftrace_ops *ops);
30int unregister_ftrace_function(struct ftrace_ops *ops);
31void clear_ftrace_function(void);
32
33extern void ftrace_stub(unsigned long a0, unsigned long a1);
34
35#else /* !CONFIG_FTRACE */
36# define register_ftrace_function(ops) do { } while (0)
37# define unregister_ftrace_function(ops) do { } while (0)
38# define clear_ftrace_function(ops) do { } while (0)
39#endif /* CONFIG_FTRACE */
40
41#ifdef CONFIG_DYNAMIC_FTRACE
42# define FTRACE_HASHBITS 10
43# define FTRACE_HASHSIZE (1<<FTRACE_HASHBITS)
44
45enum {
46 FTRACE_FL_FREE = (1 << 0),
47 FTRACE_FL_FAILED = (1 << 1),
48 FTRACE_FL_FILTER = (1 << 2),
49 FTRACE_FL_ENABLED = (1 << 3),
50 FTRACE_FL_NOTRACE = (1 << 4),
51 FTRACE_FL_CONVERTED = (1 << 5),
52 FTRACE_FL_FROZEN = (1 << 6),
53};
54
55struct dyn_ftrace {
56 struct hlist_node node;
57 unsigned long ip; /* address of mcount call-site */
58 unsigned long flags;
59};
60
61int ftrace_force_update(void);
62void ftrace_set_filter(unsigned char *buf, int len, int reset);
63
64/* defined in arch */
65extern int ftrace_ip_converted(unsigned long ip);
66extern unsigned char *ftrace_nop_replace(void);
67extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr);
68extern int ftrace_dyn_arch_init(void *data);
69extern int ftrace_mcount_set(unsigned long *data);
70extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code,
71 unsigned char *new_code);
72extern int ftrace_update_ftrace_func(ftrace_func_t func);
73extern void ftrace_caller(void);
74extern void ftrace_call(void);
75extern void mcount_call(void);
76
77extern int skip_trace(unsigned long ip);
78
79void ftrace_disable_daemon(void);
80void ftrace_enable_daemon(void);
81
82#else
83# define skip_trace(ip) ({ 0; })
84# define ftrace_force_update() ({ 0; })
85# define ftrace_set_filter(buf, len, reset) do { } while (0)
86# define ftrace_disable_daemon() do { } while (0)
87# define ftrace_enable_daemon() do { } while (0)
88#endif /* CONFIG_DYNAMIC_FTRACE */
89
90/* totally disable ftrace - can not re-enable after this */
91void ftrace_kill(void);
92void ftrace_kill_atomic(void);
93
94static inline void tracer_disable(void)
95{
96#ifdef CONFIG_FTRACE
97 ftrace_enabled = 0;
98#endif
99}
100
101#ifdef CONFIG_FRAME_POINTER
102/* TODO: need to fix this for ARM */
103# define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
104# define CALLER_ADDR1 ((unsigned long)__builtin_return_address(1))
105# define CALLER_ADDR2 ((unsigned long)__builtin_return_address(2))
106# define CALLER_ADDR3 ((unsigned long)__builtin_return_address(3))
107# define CALLER_ADDR4 ((unsigned long)__builtin_return_address(4))
108# define CALLER_ADDR5 ((unsigned long)__builtin_return_address(5))
109# define CALLER_ADDR6 ((unsigned long)__builtin_return_address(6))
110#else
111# define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
112# define CALLER_ADDR1 0UL
113# define CALLER_ADDR2 0UL
114# define CALLER_ADDR3 0UL
115# define CALLER_ADDR4 0UL
116# define CALLER_ADDR5 0UL
117# define CALLER_ADDR6 0UL
118#endif
119
120#ifdef CONFIG_IRQSOFF_TRACER
121 extern void time_hardirqs_on(unsigned long a0, unsigned long a1);
122 extern void time_hardirqs_off(unsigned long a0, unsigned long a1);
123#else
124# define time_hardirqs_on(a0, a1) do { } while (0)
125# define time_hardirqs_off(a0, a1) do { } while (0)
126#endif
127
128#ifdef CONFIG_PREEMPT_TRACER
129 extern void trace_preempt_on(unsigned long a0, unsigned long a1);
130 extern void trace_preempt_off(unsigned long a0, unsigned long a1);
131#else
132# define trace_preempt_on(a0, a1) do { } while (0)
133# define trace_preempt_off(a0, a1) do { } while (0)
134#endif
135
136#ifdef CONFIG_TRACING
137extern void
138ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
139#else
140static inline void
141ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
142#endif
143
144#endif /* _LINUX_FTRACE_H */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index ae7aec3cabe..e8787417f65 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -110,6 +110,14 @@ struct hd_struct {
110#define GENHD_FL_SUPPRESS_PARTITION_INFO 32 110#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
111#define GENHD_FL_FAIL 64 111#define GENHD_FL_FAIL 64
112 112
113#define BLK_SCSI_MAX_CMDS (256)
114#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
115
116struct blk_scsi_cmd_filter {
117 unsigned long read_ok[BLK_SCSI_CMD_PER_LONG];
118 unsigned long write_ok[BLK_SCSI_CMD_PER_LONG];
119 struct kobject kobj;
120};
113 121
114struct gendisk { 122struct gendisk {
115 int major; /* major number of driver */ 123 int major; /* major number of driver */
@@ -120,6 +128,7 @@ struct gendisk {
120 struct hd_struct **part; /* [indexed by minor] */ 128 struct hd_struct **part; /* [indexed by minor] */
121 struct block_device_operations *fops; 129 struct block_device_operations *fops;
122 struct request_queue *queue; 130 struct request_queue *queue;
131 struct blk_scsi_cmd_filter cmd_filter;
123 void *private_data; 132 void *private_data;
124 sector_t capacity; 133 sector_t capacity;
125 134
@@ -141,6 +150,9 @@ struct gendisk {
141 struct disk_stats dkstats; 150 struct disk_stats dkstats;
142#endif 151#endif
143 struct work_struct async_notify; 152 struct work_struct async_notify;
153#ifdef CONFIG_BLK_DEV_INTEGRITY
154 struct blk_integrity *integrity;
155#endif
144}; 156};
145 157
146/* 158/*
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index f1fc7470d26..a86186dd047 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -285,12 +285,11 @@ enum
285struct softirq_action 285struct softirq_action
286{ 286{
287 void (*action)(struct softirq_action *); 287 void (*action)(struct softirq_action *);
288 void *data;
289}; 288};
290 289
291asmlinkage void do_softirq(void); 290asmlinkage void do_softirq(void);
292asmlinkage void __do_softirq(void); 291asmlinkage void __do_softirq(void);
293extern void open_softirq(int nr, void (*action)(struct softirq_action*), void *data); 292extern void open_softirq(int nr, void (*action)(struct softirq_action *));
294extern void softirq_init(void); 293extern void softirq_init(void);
295#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0) 294#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0)
296extern void raise_softirq_irqoff(unsigned int nr); 295extern void raise_softirq_irqoff(unsigned int nr);
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index 2b7a1187cb2..08b987bccf8 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -99,4 +99,22 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
99 return NULL; 99 return NULL;
100} 100}
101 101
102#ifdef CONFIG_BLOCK
103int put_io_context(struct io_context *ioc);
104void exit_io_context(void);
105struct io_context *get_io_context(gfp_t gfp_flags, int node);
106struct io_context *alloc_io_context(gfp_t gfp_flags, int node);
107void copy_io_context(struct io_context **pdst, struct io_context **psrc);
108#else
109static inline void exit_io_context(void)
110{
111}
112
113struct io_context;
114static inline int put_io_context(struct io_context *ioc)
115{
116 return 1;
117}
118#endif
119
102#endif 120#endif
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index e600c4e9b8c..2b1c2e58566 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -12,10 +12,10 @@
12#define _LINUX_TRACE_IRQFLAGS_H 12#define _LINUX_TRACE_IRQFLAGS_H
13 13
14#ifdef CONFIG_TRACE_IRQFLAGS 14#ifdef CONFIG_TRACE_IRQFLAGS
15 extern void trace_hardirqs_on(void);
16 extern void trace_hardirqs_off(void);
17 extern void trace_softirqs_on(unsigned long ip); 15 extern void trace_softirqs_on(unsigned long ip);
18 extern void trace_softirqs_off(unsigned long ip); 16 extern void trace_softirqs_off(unsigned long ip);
17 extern void trace_hardirqs_on(void);
18 extern void trace_hardirqs_off(void);
19# define trace_hardirq_context(p) ((p)->hardirq_context) 19# define trace_hardirq_context(p) ((p)->hardirq_context)
20# define trace_softirq_context(p) ((p)->softirq_context) 20# define trace_softirq_context(p) ((p)->softirq_context)
21# define trace_hardirqs_enabled(p) ((p)->hardirqs_enabled) 21# define trace_hardirqs_enabled(p) ((p)->hardirqs_enabled)
@@ -41,6 +41,15 @@
41# define INIT_TRACE_IRQFLAGS 41# define INIT_TRACE_IRQFLAGS
42#endif 42#endif
43 43
44#if defined(CONFIG_IRQSOFF_TRACER) || \
45 defined(CONFIG_PREEMPT_TRACER)
46 extern void stop_critical_timings(void);
47 extern void start_critical_timings(void);
48#else
49# define stop_critical_timings() do { } while (0)
50# define start_critical_timings() do { } while (0)
51#endif
52
44#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT 53#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
45 54
46#include <asm/irqflags.h> 55#include <asm/irqflags.h>
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2e70006c7fa..f9cd7a513f9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -187,9 +187,6 @@ asmlinkage int vprintk(const char *fmt, va_list args)
187 __attribute__ ((format (printf, 1, 0))); 187 __attribute__ ((format (printf, 1, 0)));
188asmlinkage int printk(const char * fmt, ...) 188asmlinkage int printk(const char * fmt, ...)
189 __attribute__ ((format (printf, 1, 2))) __cold; 189 __attribute__ ((format (printf, 1, 2))) __cold;
190extern int log_buf_get_len(void);
191extern int log_buf_read(int idx);
192extern int log_buf_copy(char *dest, int idx, int len);
193 190
194extern int printk_ratelimit_jiffies; 191extern int printk_ratelimit_jiffies;
195extern int printk_ratelimit_burst; 192extern int printk_ratelimit_burst;
@@ -205,9 +202,6 @@ static inline int vprintk(const char *s, va_list args) { return 0; }
205static inline int printk(const char *s, ...) 202static inline int printk(const char *s, ...)
206 __attribute__ ((format (printf, 1, 2))); 203 __attribute__ ((format (printf, 1, 2)));
207static inline int __cold printk(const char *s, ...) { return 0; } 204static inline int __cold printk(const char *s, ...) { return 0; }
208static inline int log_buf_get_len(void) { return 0; }
209static inline int log_buf_read(int idx) { return 0; }
210static inline int log_buf_copy(char *dest, int idx, int len) { return 0; }
211static inline int printk_ratelimit(void) { return 0; } 205static inline int printk_ratelimit(void) { return 0; }
212static inline int __printk_ratelimit(int ratelimit_jiffies, \ 206static inline int __printk_ratelimit(int ratelimit_jiffies, \
213 int ratelimit_burst) { return 0; } 207 int ratelimit_burst) { return 0; }
@@ -216,7 +210,7 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \
216 { return false; } 210 { return false; }
217#endif 211#endif
218 212
219extern void __attribute__((format(printf, 1, 2))) 213extern void asmlinkage __attribute__((format(printf, 1, 2)))
220 early_printk(const char *fmt, ...); 214 early_printk(const char *fmt, ...);
221 215
222unsigned long int_sqrt(unsigned long); 216unsigned long int_sqrt(unsigned long);
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index e8ffce898bf..cf9f40a91c9 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -1,11 +1,11 @@
1#ifndef _LINUX_KERNEL_STAT_H 1#ifndef _LINUX_KERNEL_STAT_H
2#define _LINUX_KERNEL_STAT_H 2#define _LINUX_KERNEL_STAT_H
3 3
4#include <asm/irq.h>
5#include <linux/smp.h> 4#include <linux/smp.h>
6#include <linux/threads.h> 5#include <linux/threads.h>
7#include <linux/percpu.h> 6#include <linux/percpu.h>
8#include <linux/cpumask.h> 7#include <linux/cpumask.h>
8#include <asm/irq.h>
9#include <asm/cputime.h> 9#include <asm/cputime.h>
10 10
11/* 11/*
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 1036631ff4f..04a3556bdea 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -259,6 +259,10 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
259struct jprobe; 259struct jprobe;
260struct kretprobe; 260struct kretprobe;
261 261
262static inline struct kprobe *get_kprobe(void *addr)
263{
264 return NULL;
265}
262static inline struct kprobe *kprobe_running(void) 266static inline struct kprobe *kprobe_running(void)
263{ 267{
264 return NULL; 268 return NULL;
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index 2119610b24f..56ba3739465 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -1,8 +1,11 @@
1#ifndef _LINUX_LINKAGE_H 1#ifndef _LINUX_LINKAGE_H
2#define _LINUX_LINKAGE_H 2#define _LINUX_LINKAGE_H
3 3
4#include <linux/compiler.h>
4#include <asm/linkage.h> 5#include <asm/linkage.h>
5 6
7#define notrace __attribute__((no_instrument_function))
8
6#ifdef __cplusplus 9#ifdef __cplusplus
7#define CPP_ASMLINKAGE extern "C" 10#define CPP_ASMLINKAGE extern "C"
8#else 11#else
@@ -17,6 +20,9 @@
17# define asmregparm 20# define asmregparm
18#endif 21#endif
19 22
23#define __page_aligned_data __section(.data.page_aligned) __aligned(PAGE_SIZE)
24#define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE)
25
20/* 26/*
21 * This is used by architectures to keep arguments on the stack 27 * This is used by architectures to keep arguments on the stack
22 * untouched by the compiler by keeping them live until the end. 28 * untouched by the compiler by keeping them live until the end.
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 4c4d236ded1..2486eb4edbf 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -182,6 +182,9 @@ struct lock_list {
182 * We record lock dependency chains, so that we can cache them: 182 * We record lock dependency chains, so that we can cache them:
183 */ 183 */
184struct lock_chain { 184struct lock_chain {
185 u8 irq_context;
186 u8 depth;
187 u16 base;
185 struct list_head entry; 188 struct list_head entry;
186 u64 chain_key; 189 u64 chain_key;
187}; 190};
@@ -276,14 +279,6 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
276 (lock)->dep_map.key, sub) 279 (lock)->dep_map.key, sub)
277 280
278/* 281/*
279 * To initialize a lockdep_map statically use this macro.
280 * Note that _name must not be NULL.
281 */
282#define STATIC_LOCKDEP_MAP_INIT(_name, _key) \
283 { .name = (_name), .key = (void *)(_key), }
284
285
286/*
287 * Acquire a lock. 282 * Acquire a lock.
288 * 283 *
289 * Values for "read": 284 * Values for "read":
diff --git a/include/linux/marker.h b/include/linux/marker.h
index 430f6adf976..1290653f924 100644
--- a/include/linux/marker.h
+++ b/include/linux/marker.h
@@ -44,8 +44,8 @@ struct marker {
44 */ 44 */
45 char state; /* Marker state. */ 45 char state; /* Marker state. */
46 char ptype; /* probe type : 0 : single, 1 : multi */ 46 char ptype; /* probe type : 0 : single, 1 : multi */
47 void (*call)(const struct marker *mdata, /* Probe wrapper */ 47 /* Probe wrapper */
48 void *call_private, const char *fmt, ...); 48 void (*call)(const struct marker *mdata, void *call_private, ...);
49 struct marker_probe_closure single; 49 struct marker_probe_closure single;
50 struct marker_probe_closure *multi; 50 struct marker_probe_closure *multi;
51} __attribute__((aligned(8))); 51} __attribute__((aligned(8)));
@@ -58,8 +58,12 @@ struct marker {
58 * Make sure the alignment of the structure in the __markers section will 58 * Make sure the alignment of the structure in the __markers section will
59 * not add unwanted padding between the beginning of the section and the 59 * not add unwanted padding between the beginning of the section and the
60 * structure. Force alignment to the same alignment as the section start. 60 * structure. Force alignment to the same alignment as the section start.
61 *
62 * The "generic" argument controls which marker enabling mechanism must be used.
63 * If generic is true, a variable read is used.
64 * If generic is false, immediate values are used.
61 */ 65 */
62#define __trace_mark(name, call_private, format, args...) \ 66#define __trace_mark(generic, name, call_private, format, args...) \
63 do { \ 67 do { \
64 static const char __mstrtab_##name[] \ 68 static const char __mstrtab_##name[] \
65 __attribute__((section("__markers_strings"))) \ 69 __attribute__((section("__markers_strings"))) \
@@ -72,15 +76,14 @@ struct marker {
72 __mark_check_format(format, ## args); \ 76 __mark_check_format(format, ## args); \
73 if (unlikely(__mark_##name.state)) { \ 77 if (unlikely(__mark_##name.state)) { \
74 (*__mark_##name.call) \ 78 (*__mark_##name.call) \
75 (&__mark_##name, call_private, \ 79 (&__mark_##name, call_private, ## args);\
76 format, ## args); \
77 } \ 80 } \
78 } while (0) 81 } while (0)
79 82
80extern void marker_update_probe_range(struct marker *begin, 83extern void marker_update_probe_range(struct marker *begin,
81 struct marker *end); 84 struct marker *end);
82#else /* !CONFIG_MARKERS */ 85#else /* !CONFIG_MARKERS */
83#define __trace_mark(name, call_private, format, args...) \ 86#define __trace_mark(generic, name, call_private, format, args...) \
84 __mark_check_format(format, ## args) 87 __mark_check_format(format, ## args)
85static inline void marker_update_probe_range(struct marker *begin, 88static inline void marker_update_probe_range(struct marker *begin,
86 struct marker *end) 89 struct marker *end)
@@ -88,15 +91,30 @@ static inline void marker_update_probe_range(struct marker *begin,
88#endif /* CONFIG_MARKERS */ 91#endif /* CONFIG_MARKERS */
89 92
90/** 93/**
91 * trace_mark - Marker 94 * trace_mark - Marker using code patching
92 * @name: marker name, not quoted. 95 * @name: marker name, not quoted.
93 * @format: format string 96 * @format: format string
94 * @args...: variable argument list 97 * @args...: variable argument list
95 * 98 *
96 * Places a marker. 99 * Places a marker using optimized code patching technique (imv_read())
100 * to be enabled when immediate values are present.
97 */ 101 */
98#define trace_mark(name, format, args...) \ 102#define trace_mark(name, format, args...) \
99 __trace_mark(name, NULL, format, ## args) 103 __trace_mark(0, name, NULL, format, ## args)
104
105/**
106 * _trace_mark - Marker using variable read
107 * @name: marker name, not quoted.
108 * @format: format string
109 * @args...: variable argument list
110 *
111 * Places a marker using a standard memory read (_imv_read()) to be
112 * enabled. Should be used for markers in code paths where instruction
113 * modification based enabling is not welcome. (__init and __exit functions,
114 * lockdep, some traps, printk).
115 */
116#define _trace_mark(name, format, args...) \
117 __trace_mark(1, name, NULL, format, ## args)
100 118
101/** 119/**
102 * MARK_NOARGS - Format string for a marker with no argument. 120 * MARK_NOARGS - Format string for a marker with no argument.
@@ -117,9 +135,9 @@ static inline void __printf(1, 2) ___mark_check_format(const char *fmt, ...)
117extern marker_probe_func __mark_empty_function; 135extern marker_probe_func __mark_empty_function;
118 136
119extern void marker_probe_cb(const struct marker *mdata, 137extern void marker_probe_cb(const struct marker *mdata,
120 void *call_private, const char *fmt, ...); 138 void *call_private, ...);
121extern void marker_probe_cb_noarg(const struct marker *mdata, 139extern void marker_probe_cb_noarg(const struct marker *mdata,
122 void *call_private, const char *fmt, ...); 140 void *call_private, ...);
123 141
124/* 142/*
125 * Connect a probe to a marker. 143 * Connect a probe to a marker.
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 689184446fc..2128ef7780c 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -999,8 +999,8 @@ extern void free_area_init_node(int nid, pg_data_t *pgdat,
999extern void free_area_init_nodes(unsigned long *max_zone_pfn); 999extern void free_area_init_nodes(unsigned long *max_zone_pfn);
1000extern void add_active_range(unsigned int nid, unsigned long start_pfn, 1000extern void add_active_range(unsigned int nid, unsigned long start_pfn,
1001 unsigned long end_pfn); 1001 unsigned long end_pfn);
1002extern void shrink_active_range(unsigned int nid, unsigned long old_end_pfn, 1002extern void remove_active_range(unsigned int nid, unsigned long start_pfn,
1003 unsigned long new_end_pfn); 1003 unsigned long end_pfn);
1004extern void push_node_boundaries(unsigned int nid, unsigned long start_pfn, 1004extern void push_node_boundaries(unsigned int nid, unsigned long start_pfn,
1005 unsigned long end_pfn); 1005 unsigned long end_pfn);
1006extern void remove_all_active_ranges(void); 1006extern void remove_all_active_ranges(void);
@@ -1012,6 +1012,8 @@ extern unsigned long find_min_pfn_with_active_regions(void);
1012extern unsigned long find_max_pfn_with_active_regions(void); 1012extern unsigned long find_max_pfn_with_active_regions(void);
1013extern void free_bootmem_with_active_regions(int nid, 1013extern void free_bootmem_with_active_regions(int nid,
1014 unsigned long max_low_pfn); 1014 unsigned long max_low_pfn);
1015typedef int (*work_fn_t)(unsigned long, unsigned long, void *);
1016extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data);
1015extern void sparse_memory_present_with_active_regions(int nid); 1017extern void sparse_memory_present_with_active_regions(int nid);
1016#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID 1018#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
1017extern int early_pfn_to_nid(unsigned long pfn); 1019extern int early_pfn_to_nid(unsigned long pfn);
@@ -1025,6 +1027,7 @@ extern void mem_init(void);
1025extern void show_mem(void); 1027extern void show_mem(void);
1026extern void si_meminfo(struct sysinfo * val); 1028extern void si_meminfo(struct sysinfo * val);
1027extern void si_meminfo_node(struct sysinfo *val, int nid); 1029extern void si_meminfo_node(struct sysinfo *val, int nid);
1030extern int after_bootmem;
1028 1031
1029#ifdef CONFIG_NUMA 1032#ifdef CONFIG_NUMA
1030extern void setup_per_cpu_pageset(void); 1033extern void setup_per_cpu_pageset(void);
diff --git a/include/linux/mmiotrace.h b/include/linux/mmiotrace.h
new file mode 100644
index 00000000000..61d19e1b7a0
--- /dev/null
+++ b/include/linux/mmiotrace.h
@@ -0,0 +1,85 @@
1#ifndef MMIOTRACE_H
2#define MMIOTRACE_H
3
4#include <linux/types.h>
5#include <linux/list.h>
6
7struct kmmio_probe;
8struct pt_regs;
9
10typedef void (*kmmio_pre_handler_t)(struct kmmio_probe *,
11 struct pt_regs *, unsigned long addr);
12typedef void (*kmmio_post_handler_t)(struct kmmio_probe *,
13 unsigned long condition, struct pt_regs *);
14
15struct kmmio_probe {
16 struct list_head list; /* kmmio internal list */
17 unsigned long addr; /* start location of the probe point */
18 unsigned long len; /* length of the probe region */
19 kmmio_pre_handler_t pre_handler; /* Called before addr is executed. */
20 kmmio_post_handler_t post_handler; /* Called after addr is executed */
21 void *private;
22};
23
24/* kmmio is active by some kmmio_probes? */
25static inline int is_kmmio_active(void)
26{
27 extern unsigned int kmmio_count;
28 return kmmio_count;
29}
30
31extern int register_kmmio_probe(struct kmmio_probe *p);
32extern void unregister_kmmio_probe(struct kmmio_probe *p);
33
34/* Called from page fault handler. */
35extern int kmmio_handler(struct pt_regs *regs, unsigned long addr);
36
37/* Called from ioremap.c */
38#ifdef CONFIG_MMIOTRACE
39extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
40 void __iomem *addr);
41extern void mmiotrace_iounmap(volatile void __iomem *addr);
42#else
43static inline void mmiotrace_ioremap(resource_size_t offset,
44 unsigned long size, void __iomem *addr)
45{
46}
47
48static inline void mmiotrace_iounmap(volatile void __iomem *addr)
49{
50}
51#endif /* CONFIG_MMIOTRACE_HOOKS */
52
53enum mm_io_opcode {
54 MMIO_READ = 0x1, /* struct mmiotrace_rw */
55 MMIO_WRITE = 0x2, /* struct mmiotrace_rw */
56 MMIO_PROBE = 0x3, /* struct mmiotrace_map */
57 MMIO_UNPROBE = 0x4, /* struct mmiotrace_map */
58 MMIO_MARKER = 0x5, /* raw char data */
59 MMIO_UNKNOWN_OP = 0x6, /* struct mmiotrace_rw */
60};
61
62struct mmiotrace_rw {
63 resource_size_t phys; /* PCI address of register */
64 unsigned long value;
65 unsigned long pc; /* optional program counter */
66 int map_id;
67 unsigned char opcode; /* one of MMIO_{READ,WRITE,UNKNOWN_OP} */
68 unsigned char width; /* size of register access in bytes */
69};
70
71struct mmiotrace_map {
72 resource_size_t phys; /* base address in PCI space */
73 unsigned long virt; /* base virtual address */
74 unsigned long len; /* mapping size */
75 int map_id;
76 unsigned char opcode; /* MMIO_PROBE or MMIO_UNPROBE */
77};
78
79/* in kernel/trace/trace_mmiotrace.c */
80extern void enable_mmiotrace(void);
81extern void disable_mmiotrace(void);
82extern void mmio_trace_rw(struct mmiotrace_rw *rw);
83extern void mmio_trace_mapping(struct mmiotrace_map *map);
84
85#endif /* MMIOTRACE_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 69b2342d5eb..c4db5827963 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -159,6 +159,15 @@ struct ap_device_id {
159 159
160#define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 160#define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01
161 161
162/* s390 css bus devices (subchannels) */
163struct css_device_id {
164 __u8 match_flags;
165 __u8 type; /* subchannel type */
166 __u16 pad2;
167 __u32 pad3;
168 kernel_ulong_t driver_data;
169};
170
162#define ACPI_ID_LEN 16 /* only 9 bytes needed here, 16 bytes are used */ 171#define ACPI_ID_LEN 16 /* only 9 bytes needed here, 16 bytes are used */
163 /* to workaround crosscompile issues */ 172 /* to workaround crosscompile issues */
164 173
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index f31debfac92..0d2a4e7012a 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -157,6 +157,7 @@ PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active)
157__PAGEFLAG(Slab, slab) 157__PAGEFLAG(Slab, slab)
158PAGEFLAG(Checked, owner_priv_1) /* Used by some filesystems */ 158PAGEFLAG(Checked, owner_priv_1) /* Used by some filesystems */
159PAGEFLAG(Pinned, owner_priv_1) TESTSCFLAG(Pinned, owner_priv_1) /* Xen */ 159PAGEFLAG(Pinned, owner_priv_1) TESTSCFLAG(Pinned, owner_priv_1) /* Xen */
160PAGEFLAG(SavePinned, dirty); /* Xen */
160PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) 161PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved)
161PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private) 162PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private)
162 __SETPAGEFLAG(Private, private) 163 __SETPAGEFLAG(Private, private)
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index e875905f7b1..e8c06122be3 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -25,13 +25,11 @@
25 25
26#include <linux/types.h> 26#include <linux/types.h>
27 27
28/* Macro to aid the definition of ranges of bits */
29#define PB_range(name, required_bits) \
30 name, name ## _end = (name + required_bits) - 1
31
32/* Bit indices that affect a whole block of pages */ 28/* Bit indices that affect a whole block of pages */
33enum pageblock_bits { 29enum pageblock_bits {
34 PB_range(PB_migrate, 3), /* 3 bits required for migrate types */ 30 PB_migrate,
31 PB_migrate_end = PB_migrate + 3 - 1,
32 /* 3 bits required for migrate types */
35 NR_PAGEBLOCK_BITS 33 NR_PAGEBLOCK_BITS
36}; 34};
37 35
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 23f0c54175c..72b1a10a59b 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -10,7 +10,7 @@
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <linux/list.h> 11#include <linux/list.h>
12 12
13#ifdef CONFIG_DEBUG_PREEMPT 13#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER)
14 extern void add_preempt_count(int val); 14 extern void add_preempt_count(int val);
15 extern void sub_preempt_count(int val); 15 extern void sub_preempt_count(int val);
16#else 16#else
@@ -52,6 +52,34 @@ do { \
52 preempt_check_resched(); \ 52 preempt_check_resched(); \
53} while (0) 53} while (0)
54 54
55/* For debugging and tracer internals only! */
56#define add_preempt_count_notrace(val) \
57 do { preempt_count() += (val); } while (0)
58#define sub_preempt_count_notrace(val) \
59 do { preempt_count() -= (val); } while (0)
60#define inc_preempt_count_notrace() add_preempt_count_notrace(1)
61#define dec_preempt_count_notrace() sub_preempt_count_notrace(1)
62
63#define preempt_disable_notrace() \
64do { \
65 inc_preempt_count_notrace(); \
66 barrier(); \
67} while (0)
68
69#define preempt_enable_no_resched_notrace() \
70do { \
71 barrier(); \
72 dec_preempt_count_notrace(); \
73} while (0)
74
75/* preempt_check_resched is OK to trace */
76#define preempt_enable_notrace() \
77do { \
78 preempt_enable_no_resched_notrace(); \
79 barrier(); \
80 preempt_check_resched(); \
81} while (0)
82
55#else 83#else
56 84
57#define preempt_disable() do { } while (0) 85#define preempt_disable() do { } while (0)
@@ -59,6 +87,10 @@ do { \
59#define preempt_enable() do { } while (0) 87#define preempt_enable() do { } while (0)
60#define preempt_check_resched() do { } while (0) 88#define preempt_check_resched() do { } while (0)
61 89
90#define preempt_disable_notrace() do { } while (0)
91#define preempt_enable_no_resched_notrace() do { } while (0)
92#define preempt_enable_notrace() do { } while (0)
93
62#endif 94#endif
63 95
64#ifdef CONFIG_PREEMPT_NOTIFIERS 96#ifdef CONFIG_PREEMPT_NOTIFIERS
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index f98501ba557..c6f5f9dd0ce 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -95,8 +95,12 @@ extern void __ptrace_link(struct task_struct *child,
95 struct task_struct *new_parent); 95 struct task_struct *new_parent);
96extern void __ptrace_unlink(struct task_struct *child); 96extern void __ptrace_unlink(struct task_struct *child);
97extern void ptrace_untrace(struct task_struct *child); 97extern void ptrace_untrace(struct task_struct *child);
98extern int ptrace_may_attach(struct task_struct *task); 98#define PTRACE_MODE_READ 1
99extern int __ptrace_may_attach(struct task_struct *task); 99#define PTRACE_MODE_ATTACH 2
100/* Returns 0 on success, -errno on denial. */
101extern int __ptrace_may_access(struct task_struct *task, unsigned int mode);
102/* Returns true on success, false on denial. */
103extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);
100 104
101static inline int ptrace_reparented(struct task_struct *child) 105static inline int ptrace_reparented(struct task_struct *child)
102{ 106{
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
new file mode 100644
index 00000000000..3945f803d51
--- /dev/null
+++ b/include/linux/pwm.h
@@ -0,0 +1,31 @@
1#ifndef __LINUX_PWM_H
2#define __LINUX_PWM_H
3
4struct pwm_device;
5
6/*
7 * pwm_request - request a PWM device
8 */
9struct pwm_device *pwm_request(int pwm_id, const char *label);
10
11/*
12 * pwm_free - free a PWM device
13 */
14void pwm_free(struct pwm_device *pwm);
15
16/*
17 * pwm_config - change a PWM device configuration
18 */
19int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns);
20
21/*
22 * pwm_enable - start a PWM output toggling
23 */
24int pwm_enable(struct pwm_device *pwm);
25
26/*
27 * pwm_disable - stop a PWM output toggling
28 */
29void pwm_disable(struct pwm_device *pwm);
30
31#endif /* __ASM_ARCH_PWM_H */
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
new file mode 100644
index 00000000000..7a9754c9677
--- /dev/null
+++ b/include/linux/pwm_backlight.h
@@ -0,0 +1,17 @@
1/*
2 * Generic PWM backlight driver data - see drivers/video/backlight/pwm_bl.c
3 */
4#ifndef __LINUX_PWM_BACKLIGHT_H
5#define __LINUX_PWM_BACKLIGHT_H
6
7struct platform_pwm_backlight_data {
8 int pwm_id;
9 unsigned int max_brightness;
10 unsigned int dft_brightness;
11 unsigned int pwm_period_ns;
12 int (*init)(struct device *dev);
13 int (*notify)(int brightness);
14 void (*exit)(struct device *dev);
15};
16
17#endif
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h
index f3f4f28c696..c9ba2fdf807 100644
--- a/include/linux/resume-trace.h
+++ b/include/linux/resume-trace.h
@@ -8,7 +8,7 @@ extern int pm_trace_enabled;
8 8
9struct device; 9struct device;
10extern void set_trace_device(struct device *); 10extern void set_trace_device(struct device *);
11extern void generate_resume_trace(void *tracedata, unsigned int user); 11extern void generate_resume_trace(const void *tracedata, unsigned int user);
12 12
13#define TRACE_DEVICE(dev) do { \ 13#define TRACE_DEVICE(dev) do { \
14 if (pm_trace_enabled) \ 14 if (pm_trace_enabled) \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c5d3f847ca8..21349173d14 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -134,7 +134,6 @@ extern unsigned long nr_running(void);
134extern unsigned long nr_uninterruptible(void); 134extern unsigned long nr_uninterruptible(void);
135extern unsigned long nr_active(void); 135extern unsigned long nr_active(void);
136extern unsigned long nr_iowait(void); 136extern unsigned long nr_iowait(void);
137extern unsigned long weighted_cpuload(const int cpu);
138 137
139struct seq_file; 138struct seq_file;
140struct cfs_rq; 139struct cfs_rq;
@@ -246,6 +245,8 @@ extern asmlinkage void schedule_tail(struct task_struct *prev);
246extern void init_idle(struct task_struct *idle, int cpu); 245extern void init_idle(struct task_struct *idle, int cpu);
247extern void init_idle_bootup_task(struct task_struct *idle); 246extern void init_idle_bootup_task(struct task_struct *idle);
248 247
248extern int runqueue_is_locked(void);
249
249extern cpumask_t nohz_cpu_mask; 250extern cpumask_t nohz_cpu_mask;
250#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 251#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
251extern int select_nohz_load_balancer(int cpu); 252extern int select_nohz_load_balancer(int cpu);
@@ -784,6 +785,8 @@ struct sched_domain {
784 unsigned int balance_interval; /* initialise to 1. units in ms. */ 785 unsigned int balance_interval; /* initialise to 1. units in ms. */
785 unsigned int nr_balance_failed; /* initialise to 0 */ 786 unsigned int nr_balance_failed; /* initialise to 0 */
786 787
788 u64 last_update;
789
787#ifdef CONFIG_SCHEDSTATS 790#ifdef CONFIG_SCHEDSTATS
788 /* load_balance() stats */ 791 /* load_balance() stats */
789 unsigned int lb_count[CPU_MAX_IDLE_TYPES]; 792 unsigned int lb_count[CPU_MAX_IDLE_TYPES];
@@ -823,23 +826,6 @@ extern int arch_reinit_sched_domains(void);
823 826
824#endif /* CONFIG_SMP */ 827#endif /* CONFIG_SMP */
825 828
826/*
827 * A runqueue laden with a single nice 0 task scores a weighted_cpuload of
828 * SCHED_LOAD_SCALE. This function returns 1 if any cpu is laden with a
829 * task of nice 0 or enough lower priority tasks to bring up the
830 * weighted_cpuload
831 */
832static inline int above_background_load(void)
833{
834 unsigned long cpu;
835
836 for_each_online_cpu(cpu) {
837 if (weighted_cpuload(cpu) >= SCHED_LOAD_SCALE)
838 return 1;
839 }
840 return 0;
841}
842
843struct io_context; /* See blkdev.h */ 829struct io_context; /* See blkdev.h */
844#define NGROUPS_SMALL 32 830#define NGROUPS_SMALL 32
845#define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t))) 831#define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t)))
@@ -921,8 +907,8 @@ struct sched_class {
921 void (*set_cpus_allowed)(struct task_struct *p, 907 void (*set_cpus_allowed)(struct task_struct *p,
922 const cpumask_t *newmask); 908 const cpumask_t *newmask);
923 909
924 void (*join_domain)(struct rq *rq); 910 void (*rq_online)(struct rq *rq);
925 void (*leave_domain)(struct rq *rq); 911 void (*rq_offline)(struct rq *rq);
926 912
927 void (*switched_from) (struct rq *this_rq, struct task_struct *task, 913 void (*switched_from) (struct rq *this_rq, struct task_struct *task,
928 int running); 914 int running);
@@ -1039,6 +1025,7 @@ struct task_struct {
1039#endif 1025#endif
1040 1026
1041 int prio, static_prio, normal_prio; 1027 int prio, static_prio, normal_prio;
1028 unsigned int rt_priority;
1042 const struct sched_class *sched_class; 1029 const struct sched_class *sched_class;
1043 struct sched_entity se; 1030 struct sched_entity se;
1044 struct sched_rt_entity rt; 1031 struct sched_rt_entity rt;
@@ -1122,7 +1109,6 @@ struct task_struct {
1122 int __user *set_child_tid; /* CLONE_CHILD_SETTID */ 1109 int __user *set_child_tid; /* CLONE_CHILD_SETTID */
1123 int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ 1110 int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */
1124 1111
1125 unsigned int rt_priority;
1126 cputime_t utime, stime, utimescaled, stimescaled; 1112 cputime_t utime, stime, utimescaled, stimescaled;
1127 cputime_t gtime; 1113 cputime_t gtime;
1128 cputime_t prev_utime, prev_stime; 1114 cputime_t prev_utime, prev_stime;
@@ -1141,12 +1127,12 @@ struct task_struct {
1141 gid_t gid,egid,sgid,fsgid; 1127 gid_t gid,egid,sgid,fsgid;
1142 struct group_info *group_info; 1128 struct group_info *group_info;
1143 kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset; 1129 kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset;
1144 unsigned securebits;
1145 struct user_struct *user; 1130 struct user_struct *user;
1131 unsigned securebits;
1146#ifdef CONFIG_KEYS 1132#ifdef CONFIG_KEYS
1133 unsigned char jit_keyring; /* default keyring to attach requested keys to */
1147 struct key *request_key_auth; /* assumed request_key authority */ 1134 struct key *request_key_auth; /* assumed request_key authority */
1148 struct key *thread_keyring; /* keyring private to this thread */ 1135 struct key *thread_keyring; /* keyring private to this thread */
1149 unsigned char jit_keyring; /* default keyring to attach requested keys to */
1150#endif 1136#endif
1151 char comm[TASK_COMM_LEN]; /* executable name excluding path 1137 char comm[TASK_COMM_LEN]; /* executable name excluding path
1152 - access with [gs]et_task_comm (which lock 1138 - access with [gs]et_task_comm (which lock
@@ -1233,8 +1219,8 @@ struct task_struct {
1233# define MAX_LOCK_DEPTH 48UL 1219# define MAX_LOCK_DEPTH 48UL
1234 u64 curr_chain_key; 1220 u64 curr_chain_key;
1235 int lockdep_depth; 1221 int lockdep_depth;
1236 struct held_lock held_locks[MAX_LOCK_DEPTH];
1237 unsigned int lockdep_recursion; 1222 unsigned int lockdep_recursion;
1223 struct held_lock held_locks[MAX_LOCK_DEPTH];
1238#endif 1224#endif
1239 1225
1240/* journalling filesystem info */ 1226/* journalling filesystem info */
@@ -1262,10 +1248,6 @@ struct task_struct {
1262 u64 acct_vm_mem1; /* accumulated virtual memory usage */ 1248 u64 acct_vm_mem1; /* accumulated virtual memory usage */
1263 cputime_t acct_stimexpd;/* stime since last update */ 1249 cputime_t acct_stimexpd;/* stime since last update */
1264#endif 1250#endif
1265#ifdef CONFIG_NUMA
1266 struct mempolicy *mempolicy;
1267 short il_next;
1268#endif
1269#ifdef CONFIG_CPUSETS 1251#ifdef CONFIG_CPUSETS
1270 nodemask_t mems_allowed; 1252 nodemask_t mems_allowed;
1271 int cpuset_mems_generation; 1253 int cpuset_mems_generation;
@@ -1285,6 +1267,10 @@ struct task_struct {
1285 struct list_head pi_state_list; 1267 struct list_head pi_state_list;
1286 struct futex_pi_state *pi_state_cache; 1268 struct futex_pi_state *pi_state_cache;
1287#endif 1269#endif
1270#ifdef CONFIG_NUMA
1271 struct mempolicy *mempolicy;
1272 short il_next;
1273#endif
1288 atomic_t fs_excl; /* holding fs exclusive resources */ 1274 atomic_t fs_excl; /* holding fs exclusive resources */
1289 struct rcu_head rcu; 1275 struct rcu_head rcu;
1290 1276
@@ -1504,6 +1490,7 @@ static inline void put_task_struct(struct task_struct *t)
1504#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ 1490#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */
1505#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ 1491#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */
1506#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ 1492#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */
1493#define PF_THREAD_BOUND 0x04000000 /* Thread bound to specific cpu */
1507#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ 1494#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
1508#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ 1495#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */
1509#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ 1496#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */
@@ -1573,13 +1560,28 @@ static inline void sched_clock_idle_sleep_event(void)
1573static inline void sched_clock_idle_wakeup_event(u64 delta_ns) 1560static inline void sched_clock_idle_wakeup_event(u64 delta_ns)
1574{ 1561{
1575} 1562}
1576#else 1563
1564#ifdef CONFIG_NO_HZ
1565static inline void sched_clock_tick_stop(int cpu)
1566{
1567}
1568
1569static inline void sched_clock_tick_start(int cpu)
1570{
1571}
1572#endif
1573
1574#else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
1577extern void sched_clock_init(void); 1575extern void sched_clock_init(void);
1578extern u64 sched_clock_cpu(int cpu); 1576extern u64 sched_clock_cpu(int cpu);
1579extern void sched_clock_tick(void); 1577extern void sched_clock_tick(void);
1580extern void sched_clock_idle_sleep_event(void); 1578extern void sched_clock_idle_sleep_event(void);
1581extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1579extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1580#ifdef CONFIG_NO_HZ
1581extern void sched_clock_tick_stop(int cpu);
1582extern void sched_clock_tick_start(int cpu);
1582#endif 1583#endif
1584#endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
1583 1585
1584/* 1586/*
1585 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu 1587 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
@@ -1622,6 +1624,7 @@ extern unsigned int sysctl_sched_child_runs_first;
1622extern unsigned int sysctl_sched_features; 1624extern unsigned int sysctl_sched_features;
1623extern unsigned int sysctl_sched_migration_cost; 1625extern unsigned int sysctl_sched_migration_cost;
1624extern unsigned int sysctl_sched_nr_migrate; 1626extern unsigned int sysctl_sched_nr_migrate;
1627extern unsigned int sysctl_sched_shares_ratelimit;
1625 1628
1626int sched_nr_latency_handler(struct ctl_table *table, int write, 1629int sched_nr_latency_handler(struct ctl_table *table, int write,
1627 struct file *file, void __user *buffer, size_t *length, 1630 struct file *file, void __user *buffer, size_t *length,
@@ -1655,6 +1658,8 @@ extern int can_nice(const struct task_struct *p, const int nice);
1655extern int task_curr(const struct task_struct *p); 1658extern int task_curr(const struct task_struct *p);
1656extern int idle_cpu(int cpu); 1659extern int idle_cpu(int cpu);
1657extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); 1660extern int sched_setscheduler(struct task_struct *, int, struct sched_param *);
1661extern int sched_setscheduler_nocheck(struct task_struct *, int,
1662 struct sched_param *);
1658extern struct task_struct *idle_task(int cpu); 1663extern struct task_struct *idle_task(int cpu);
1659extern struct task_struct *curr_task(int cpu); 1664extern struct task_struct *curr_task(int cpu);
1660extern void set_curr_task(int cpu, struct task_struct *p); 1665extern void set_curr_task(int cpu, struct task_struct *p);
@@ -2131,6 +2136,18 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm)
2131} 2136}
2132#endif 2137#endif
2133 2138
2139#ifdef CONFIG_TRACING
2140extern void
2141__trace_special(void *__tr, void *__data,
2142 unsigned long arg1, unsigned long arg2, unsigned long arg3);
2143#else
2144static inline void
2145__trace_special(void *__tr, void *__data,
2146 unsigned long arg1, unsigned long arg2, unsigned long arg3)
2147{
2148}
2149#endif
2150
2134extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask); 2151extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask);
2135extern long sched_getaffinity(pid_t pid, cpumask_t *mask); 2152extern long sched_getaffinity(pid_t pid, cpumask_t *mask);
2136 2153
@@ -2225,6 +2242,8 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p)
2225} 2242}
2226#endif /* CONFIG_MM_OWNER */ 2243#endif /* CONFIG_MM_OWNER */
2227 2244
2245#define TASK_STATE_TO_CHAR_STR "RSDTtZX"
2246
2228#endif /* __KERNEL__ */ 2247#endif /* __KERNEL__ */
2229 2248
2230#endif 2249#endif
diff --git a/include/linux/security.h b/include/linux/security.h
index 50737c70e78..31c8851ec5d 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -46,7 +46,8 @@ struct audit_krule;
46 */ 46 */
47extern int cap_capable(struct task_struct *tsk, int cap); 47extern int cap_capable(struct task_struct *tsk, int cap);
48extern int cap_settime(struct timespec *ts, struct timezone *tz); 48extern int cap_settime(struct timespec *ts, struct timezone *tz);
49extern int cap_ptrace(struct task_struct *parent, struct task_struct *child); 49extern int cap_ptrace(struct task_struct *parent, struct task_struct *child,
50 unsigned int mode);
50extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); 51extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
51extern int cap_capset_check(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); 52extern int cap_capset_check(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
52extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); 53extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
@@ -79,6 +80,7 @@ struct xfrm_selector;
79struct xfrm_policy; 80struct xfrm_policy;
80struct xfrm_state; 81struct xfrm_state;
81struct xfrm_user_sec_ctx; 82struct xfrm_user_sec_ctx;
83struct seq_file;
82 84
83extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 85extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
84extern int cap_netlink_recv(struct sk_buff *skb, int cap); 86extern int cap_netlink_recv(struct sk_buff *skb, int cap);
@@ -289,10 +291,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
289 * Update module state after a successful pivot. 291 * Update module state after a successful pivot.
290 * @old_path contains the path for the old root. 292 * @old_path contains the path for the old root.
291 * @new_path contains the path for the new root. 293 * @new_path contains the path for the new root.
292 * @sb_get_mnt_opts:
293 * Get the security relevant mount options used for a superblock
294 * @sb the superblock to get security mount options from
295 * @opts binary data structure containing all lsm mount data
296 * @sb_set_mnt_opts: 294 * @sb_set_mnt_opts:
297 * Set the security relevant mount options used for a superblock 295 * Set the security relevant mount options used for a superblock
298 * @sb the superblock to set security mount options for 296 * @sb the superblock to set security mount options for
@@ -1170,6 +1168,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1170 * attributes would be changed by the execve. 1168 * attributes would be changed by the execve.
1171 * @parent contains the task_struct structure for parent process. 1169 * @parent contains the task_struct structure for parent process.
1172 * @child contains the task_struct structure for child process. 1170 * @child contains the task_struct structure for child process.
1171 * @mode contains the PTRACE_MODE flags indicating the form of access.
1173 * Return 0 if permission is granted. 1172 * Return 0 if permission is granted.
1174 * @capget: 1173 * @capget:
1175 * Get the @effective, @inheritable, and @permitted capability sets for 1174 * Get the @effective, @inheritable, and @permitted capability sets for
@@ -1240,11 +1239,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1240 * @pages contains the number of pages. 1239 * @pages contains the number of pages.
1241 * Return 0 if permission is granted. 1240 * Return 0 if permission is granted.
1242 * 1241 *
1243 * @register_security:
1244 * allow module stacking.
1245 * @name contains the name of the security module being stacked.
1246 * @ops contains a pointer to the struct security_operations of the module to stack.
1247 *
1248 * @secid_to_secctx: 1242 * @secid_to_secctx:
1249 * Convert secid to security context. 1243 * Convert secid to security context.
1250 * @secid contains the security ID. 1244 * @secid contains the security ID.
@@ -1295,7 +1289,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1295struct security_operations { 1289struct security_operations {
1296 char name[SECURITY_NAME_MAX + 1]; 1290 char name[SECURITY_NAME_MAX + 1];
1297 1291
1298 int (*ptrace) (struct task_struct *parent, struct task_struct *child); 1292 int (*ptrace) (struct task_struct *parent, struct task_struct *child,
1293 unsigned int mode);
1299 int (*capget) (struct task_struct *target, 1294 int (*capget) (struct task_struct *target,
1300 kernel_cap_t *effective, 1295 kernel_cap_t *effective,
1301 kernel_cap_t *inheritable, kernel_cap_t *permitted); 1296 kernel_cap_t *inheritable, kernel_cap_t *permitted);
@@ -1328,6 +1323,7 @@ struct security_operations {
1328 void (*sb_free_security) (struct super_block *sb); 1323 void (*sb_free_security) (struct super_block *sb);
1329 int (*sb_copy_data) (char *orig, char *copy); 1324 int (*sb_copy_data) (char *orig, char *copy);
1330 int (*sb_kern_mount) (struct super_block *sb, void *data); 1325 int (*sb_kern_mount) (struct super_block *sb, void *data);
1326 int (*sb_show_options) (struct seq_file *m, struct super_block *sb);
1331 int (*sb_statfs) (struct dentry *dentry); 1327 int (*sb_statfs) (struct dentry *dentry);
1332 int (*sb_mount) (char *dev_name, struct path *path, 1328 int (*sb_mount) (char *dev_name, struct path *path,
1333 char *type, unsigned long flags, void *data); 1329 char *type, unsigned long flags, void *data);
@@ -1343,8 +1339,6 @@ struct security_operations {
1343 struct path *new_path); 1339 struct path *new_path);
1344 void (*sb_post_pivotroot) (struct path *old_path, 1340 void (*sb_post_pivotroot) (struct path *old_path,
1345 struct path *new_path); 1341 struct path *new_path);
1346 int (*sb_get_mnt_opts) (const struct super_block *sb,
1347 struct security_mnt_opts *opts);
1348 int (*sb_set_mnt_opts) (struct super_block *sb, 1342 int (*sb_set_mnt_opts) (struct super_block *sb,
1349 struct security_mnt_opts *opts); 1343 struct security_mnt_opts *opts);
1350 void (*sb_clone_mnt_opts) (const struct super_block *oldsb, 1344 void (*sb_clone_mnt_opts) (const struct super_block *oldsb,
@@ -1472,10 +1466,6 @@ struct security_operations {
1472 int (*netlink_send) (struct sock *sk, struct sk_buff *skb); 1466 int (*netlink_send) (struct sock *sk, struct sk_buff *skb);
1473 int (*netlink_recv) (struct sk_buff *skb, int cap); 1467 int (*netlink_recv) (struct sk_buff *skb, int cap);
1474 1468
1475 /* allow module stacking */
1476 int (*register_security) (const char *name,
1477 struct security_operations *ops);
1478
1479 void (*d_instantiate) (struct dentry *dentry, struct inode *inode); 1469 void (*d_instantiate) (struct dentry *dentry, struct inode *inode);
1480 1470
1481 int (*getprocattr) (struct task_struct *p, char *name, char **value); 1471 int (*getprocattr) (struct task_struct *p, char *name, char **value);
@@ -1565,7 +1555,6 @@ struct security_operations {
1565extern int security_init(void); 1555extern int security_init(void);
1566extern int security_module_enable(struct security_operations *ops); 1556extern int security_module_enable(struct security_operations *ops);
1567extern int register_security(struct security_operations *ops); 1557extern int register_security(struct security_operations *ops);
1568extern int mod_reg_security(const char *name, struct security_operations *ops);
1569extern struct dentry *securityfs_create_file(const char *name, mode_t mode, 1558extern struct dentry *securityfs_create_file(const char *name, mode_t mode,
1570 struct dentry *parent, void *data, 1559 struct dentry *parent, void *data,
1571 const struct file_operations *fops); 1560 const struct file_operations *fops);
@@ -1573,7 +1562,8 @@ extern struct dentry *securityfs_create_dir(const char *name, struct dentry *par
1573extern void securityfs_remove(struct dentry *dentry); 1562extern void securityfs_remove(struct dentry *dentry);
1574 1563
1575/* Security operations */ 1564/* Security operations */
1576int security_ptrace(struct task_struct *parent, struct task_struct *child); 1565int security_ptrace(struct task_struct *parent, struct task_struct *child,
1566 unsigned int mode);
1577int security_capget(struct task_struct *target, 1567int security_capget(struct task_struct *target,
1578 kernel_cap_t *effective, 1568 kernel_cap_t *effective,
1579 kernel_cap_t *inheritable, 1569 kernel_cap_t *inheritable,
@@ -1606,6 +1596,7 @@ int security_sb_alloc(struct super_block *sb);
1606void security_sb_free(struct super_block *sb); 1596void security_sb_free(struct super_block *sb);
1607int security_sb_copy_data(char *orig, char *copy); 1597int security_sb_copy_data(char *orig, char *copy);
1608int security_sb_kern_mount(struct super_block *sb, void *data); 1598int security_sb_kern_mount(struct super_block *sb, void *data);
1599int security_sb_show_options(struct seq_file *m, struct super_block *sb);
1609int security_sb_statfs(struct dentry *dentry); 1600int security_sb_statfs(struct dentry *dentry);
1610int security_sb_mount(char *dev_name, struct path *path, 1601int security_sb_mount(char *dev_name, struct path *path,
1611 char *type, unsigned long flags, void *data); 1602 char *type, unsigned long flags, void *data);
@@ -1617,8 +1608,6 @@ void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *d
1617void security_sb_post_addmount(struct vfsmount *mnt, struct path *mountpoint); 1608void security_sb_post_addmount(struct vfsmount *mnt, struct path *mountpoint);
1618int security_sb_pivotroot(struct path *old_path, struct path *new_path); 1609int security_sb_pivotroot(struct path *old_path, struct path *new_path);
1619void security_sb_post_pivotroot(struct path *old_path, struct path *new_path); 1610void security_sb_post_pivotroot(struct path *old_path, struct path *new_path);
1620int security_sb_get_mnt_opts(const struct super_block *sb,
1621 struct security_mnt_opts *opts);
1622int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); 1611int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts);
1623void security_sb_clone_mnt_opts(const struct super_block *oldsb, 1612void security_sb_clone_mnt_opts(const struct super_block *oldsb,
1624 struct super_block *newsb); 1613 struct super_block *newsb);
@@ -1755,9 +1744,11 @@ static inline int security_init(void)
1755 return 0; 1744 return 0;
1756} 1745}
1757 1746
1758static inline int security_ptrace(struct task_struct *parent, struct task_struct *child) 1747static inline int security_ptrace(struct task_struct *parent,
1748 struct task_struct *child,
1749 unsigned int mode)
1759{ 1750{
1760 return cap_ptrace(parent, child); 1751 return cap_ptrace(parent, child, mode);
1761} 1752}
1762 1753
1763static inline int security_capget(struct task_struct *target, 1754static inline int security_capget(struct task_struct *target,
@@ -1881,6 +1872,12 @@ static inline int security_sb_kern_mount(struct super_block *sb, void *data)
1881 return 0; 1872 return 0;
1882} 1873}
1883 1874
1875static inline int security_sb_show_options(struct seq_file *m,
1876 struct super_block *sb)
1877{
1878 return 0;
1879}
1880
1884static inline int security_sb_statfs(struct dentry *dentry) 1881static inline int security_sb_statfs(struct dentry *dentry)
1885{ 1882{
1886 return 0; 1883 return 0;
@@ -1927,12 +1924,6 @@ static inline int security_sb_pivotroot(struct path *old_path,
1927static inline void security_sb_post_pivotroot(struct path *old_path, 1924static inline void security_sb_post_pivotroot(struct path *old_path,
1928 struct path *new_path) 1925 struct path *new_path)
1929{ } 1926{ }
1930static inline int security_sb_get_mnt_opts(const struct super_block *sb,
1931 struct security_mnt_opts *opts)
1932{
1933 security_init_mnt_opts(opts);
1934 return 0;
1935}
1936 1927
1937static inline int security_sb_set_mnt_opts(struct super_block *sb, 1928static inline int security_sb_set_mnt_opts(struct super_block *sb,
1938 struct security_mnt_opts *opts) 1929 struct security_mnt_opts *opts)
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index aab3a4cff4e..813be59bf34 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -27,11 +27,24 @@ static inline int reacquire_kernel_lock(struct task_struct *task)
27extern void __lockfunc lock_kernel(void) __acquires(kernel_lock); 27extern void __lockfunc lock_kernel(void) __acquires(kernel_lock);
28extern void __lockfunc unlock_kernel(void) __releases(kernel_lock); 28extern void __lockfunc unlock_kernel(void) __releases(kernel_lock);
29 29
30/*
31 * Various legacy drivers don't really need the BKL in a specific
32 * function, but they *do* need to know that the BKL became available.
33 * This function just avoids wrapping a bunch of lock/unlock pairs
34 * around code which doesn't really need it.
35 */
36static inline void cycle_kernel_lock(void)
37{
38 lock_kernel();
39 unlock_kernel();
40}
41
30#else 42#else
31 43
32#define lock_kernel() do { } while(0) 44#define lock_kernel() do { } while(0)
33#define unlock_kernel() do { } while(0) 45#define unlock_kernel() do { } while(0)
34#define release_kernel_lock(task) do { } while(0) 46#define release_kernel_lock(task) do { } while(0)
47#define cycle_kernel_lock() do { } while(0)
35#define reacquire_kernel_lock(task) 0 48#define reacquire_kernel_lock(task) 0
36#define kernel_locked() 1 49#define kernel_locked() 1
37 50
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index f462439cc28..bd91987c065 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -105,6 +105,8 @@ extern int vm_highmem_is_dirtyable;
105extern int block_dump; 105extern int block_dump;
106extern int laptop_mode; 106extern int laptop_mode;
107 107
108extern unsigned long determine_dirtyable_memory(void);
109
108extern int dirty_ratio_handler(struct ctl_table *table, int write, 110extern int dirty_ratio_handler(struct ctl_table *table, int write,
109 struct file *filp, void __user *buffer, size_t *lenp, 111 struct file *filp, void __user *buffer, size_t *lenp,
110 loff_t *ppos); 112 loff_t *ppos);