aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-03-09 21:29:25 -0500
committerLinus Walleij <linus.walleij@linaro.org>2016-03-09 21:29:25 -0500
commitcc998d8bc74341f6bbbcd63ab4449a6acfc45ee9 (patch)
tree2f4e23fa1ceb83b3e720afd52d9a5ef2be26c77e /include/linux
parentd2d13ed01362ecddc3f76f9cca31b0cd5d663a7e (diff)
parent81f70ba233d5f660e1ea5fe23260ee323af5d53a (diff)
Merge tag 'v4.5-rc5' into devel
Linux 4.5-rc5
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/blkdev.h9
-rw-r--r--include/linux/ceph/ceph_features.h16
-rw-r--r--include/linux/cgroup-defs.h6
-rw-r--r--include/linux/cleancache.h16
-rw-r--r--include/linux/compiler.h2
-rw-r--r--include/linux/cpuset.h6
-rw-r--r--include/linux/crush/crush.h8
-rw-r--r--include/linux/dax.h11
-rw-r--r--include/linux/devpts_fs.h4
-rw-r--r--include/linux/efi.h5
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/fsnotify_backend.h5
-rw-r--r--include/linux/ftrace.h7
-rw-r--r--include/linux/gfp.h6
-rw-r--r--include/linux/hrtimer.h34
-rw-r--r--include/linux/intel-iommu.h3
-rw-r--r--include/linux/iommu.h16
-rw-r--r--include/linux/irqdomain.h1
-rw-r--r--include/linux/libata.h1
-rw-r--r--include/linux/lightnvm.h4
-rw-r--r--include/linux/lockdep.h4
-rw-r--r--include/linux/memcontrol.h2
-rw-r--r--include/linux/mm.h9
-rw-r--r--include/linux/mm_types.h6
-rw-r--r--include/linux/mmzone.h6
-rw-r--r--include/linux/module.h19
-rw-r--r--include/linux/netdevice.h11
-rw-r--r--include/linux/of.h2
-rw-r--r--include/linux/perf_event.h9
-rw-r--r--include/linux/pfn.h2
-rw-r--r--include/linux/pfn_t.h21
-rw-r--r--include/linux/radix-tree.h22
-rw-r--r--include/linux/raid/pq.h2
-rw-r--r--include/linux/rmap.h14
-rw-r--r--include/linux/skbuff.h1
-rw-r--r--include/linux/swiotlb.h3
-rw-r--r--include/linux/tracepoint.h5
-rw-r--r--include/linux/tty.h1
-rw-r--r--include/linux/ucs2_string.h4
-rw-r--r--include/linux/workqueue.h9
40 files changed, 215 insertions, 102 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 29189aeace19..4571ef1a12a9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -682,9 +682,12 @@ static inline bool blk_write_same_mergeable(struct bio *a, struct bio *b)
682/* 682/*
683 * q->prep_rq_fn return values 683 * q->prep_rq_fn return values
684 */ 684 */
685#define BLKPREP_OK 0 /* serve it */ 685enum {
686#define BLKPREP_KILL 1 /* fatal error, kill */ 686 BLKPREP_OK, /* serve it */
687#define BLKPREP_DEFER 2 /* leave on queue */ 687 BLKPREP_KILL, /* fatal error, kill, return -EIO */
688 BLKPREP_DEFER, /* leave on queue */
689 BLKPREP_INVALID, /* invalid command, kill, return -EREMOTEIO */
690};
688 691
689extern unsigned long blk_max_low_pfn, blk_max_pfn; 692extern unsigned long blk_max_low_pfn, blk_max_pfn;
690 693
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h
index f89b31d45cc8..c1ef6f14e7be 100644
--- a/include/linux/ceph/ceph_features.h
+++ b/include/linux/ceph/ceph_features.h
@@ -63,6 +63,18 @@
63#define CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY (1ULL<<49) 63#define CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY (1ULL<<49)
64// duplicated since it was introduced at the same time as MIN_SIZE_RECOVERY 64// duplicated since it was introduced at the same time as MIN_SIZE_RECOVERY
65#define CEPH_FEATURE_OSD_PROXY_FEATURES (1ULL<<49) /* overlap w/ above */ 65#define CEPH_FEATURE_OSD_PROXY_FEATURES (1ULL<<49) /* overlap w/ above */
66#define CEPH_FEATURE_MON_METADATA (1ULL<<50)
67#define CEPH_FEATURE_OSD_BITWISE_HOBJ_SORT (1ULL<<51) /* can sort objs bitwise */
68#define CEPH_FEATURE_OSD_PROXY_WRITE_FEATURES (1ULL<<52)
69#define CEPH_FEATURE_ERASURE_CODE_PLUGINS_V3 (1ULL<<53)
70#define CEPH_FEATURE_OSD_HITSET_GMT (1ULL<<54)
71#define CEPH_FEATURE_HAMMER_0_94_4 (1ULL<<55)
72#define CEPH_FEATURE_NEW_OSDOP_ENCODING (1ULL<<56) /* New, v7 encoding */
73#define CEPH_FEATURE_MON_STATEFUL_SUB (1ULL<<57) /* stateful mon subscription */
74#define CEPH_FEATURE_MON_ROUTE_OSDMAP (1ULL<<57) /* peon sends osdmaps */
75#define CEPH_FEATURE_CRUSH_TUNABLES5 (1ULL<<58) /* chooseleaf stable mode */
76// duplicated since it was introduced at the same time as CEPH_FEATURE_CRUSH_TUNABLES5
77#define CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING (1ULL<<58) /* New, v7 encoding */
66 78
67/* 79/*
68 * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature 80 * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature
@@ -108,7 +120,9 @@ static inline u64 ceph_sanitize_features(u64 features)
108 CEPH_FEATURE_CRUSH_TUNABLES3 | \ 120 CEPH_FEATURE_CRUSH_TUNABLES3 | \
109 CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \ 121 CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \
110 CEPH_FEATURE_MSGR_KEEPALIVE2 | \ 122 CEPH_FEATURE_MSGR_KEEPALIVE2 | \
111 CEPH_FEATURE_CRUSH_V4) 123 CEPH_FEATURE_CRUSH_V4 | \
124 CEPH_FEATURE_CRUSH_TUNABLES5 | \
125 CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING)
112 126
113#define CEPH_FEATURES_REQUIRED_DEFAULT \ 127#define CEPH_FEATURES_REQUIRED_DEFAULT \
114 (CEPH_FEATURE_NOSRCADDR | \ 128 (CEPH_FEATURE_NOSRCADDR | \
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index 7f540f7f588d..789471dba6fb 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -127,6 +127,12 @@ struct cgroup_subsys_state {
127 */ 127 */
128 u64 serial_nr; 128 u64 serial_nr;
129 129
130 /*
131 * Incremented by online self and children. Used to guarantee that
132 * parents are not offlined before their children.
133 */
134 atomic_t online_cnt;
135
130 /* percpu_ref killing and RCU release */ 136 /* percpu_ref killing and RCU release */
131 struct rcu_head rcu_head; 137 struct rcu_head rcu_head;
132 struct work_struct destroy_work; 138 struct work_struct destroy_work;
diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h
index bda5ec0b4b4d..fccf7f44139d 100644
--- a/include/linux/cleancache.h
+++ b/include/linux/cleancache.h
@@ -37,7 +37,7 @@ struct cleancache_ops {
37 void (*invalidate_fs)(int); 37 void (*invalidate_fs)(int);
38}; 38};
39 39
40extern int cleancache_register_ops(struct cleancache_ops *ops); 40extern int cleancache_register_ops(const struct cleancache_ops *ops);
41extern void __cleancache_init_fs(struct super_block *); 41extern void __cleancache_init_fs(struct super_block *);
42extern void __cleancache_init_shared_fs(struct super_block *); 42extern void __cleancache_init_shared_fs(struct super_block *);
43extern int __cleancache_get_page(struct page *); 43extern int __cleancache_get_page(struct page *);
@@ -48,14 +48,14 @@ extern void __cleancache_invalidate_fs(struct super_block *);
48 48
49#ifdef CONFIG_CLEANCACHE 49#ifdef CONFIG_CLEANCACHE
50#define cleancache_enabled (1) 50#define cleancache_enabled (1)
51static inline bool cleancache_fs_enabled(struct page *page)
52{
53 return page->mapping->host->i_sb->cleancache_poolid >= 0;
54}
55static inline bool cleancache_fs_enabled_mapping(struct address_space *mapping) 51static inline bool cleancache_fs_enabled_mapping(struct address_space *mapping)
56{ 52{
57 return mapping->host->i_sb->cleancache_poolid >= 0; 53 return mapping->host->i_sb->cleancache_poolid >= 0;
58} 54}
55static inline bool cleancache_fs_enabled(struct page *page)
56{
57 return cleancache_fs_enabled_mapping(page->mapping);
58}
59#else 59#else
60#define cleancache_enabled (0) 60#define cleancache_enabled (0)
61#define cleancache_fs_enabled(_page) (0) 61#define cleancache_fs_enabled(_page) (0)
@@ -89,11 +89,9 @@ static inline void cleancache_init_shared_fs(struct super_block *sb)
89 89
90static inline int cleancache_get_page(struct page *page) 90static inline int cleancache_get_page(struct page *page)
91{ 91{
92 int ret = -1;
93
94 if (cleancache_enabled && cleancache_fs_enabled(page)) 92 if (cleancache_enabled && cleancache_fs_enabled(page))
95 ret = __cleancache_get_page(page); 93 return __cleancache_get_page(page);
96 return ret; 94 return -1;
97} 95}
98 96
99static inline void cleancache_put_page(struct page *page) 97static inline void cleancache_put_page(struct page *page)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 00b042c49ccd..48f5aab117ae 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -144,7 +144,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
144 */ 144 */
145#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) 145#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
146#define __trace_if(cond) \ 146#define __trace_if(cond) \
147 if (__builtin_constant_p((cond)) ? !!(cond) : \ 147 if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
148 ({ \ 148 ({ \
149 int ______r; \ 149 int ______r; \
150 static struct ftrace_branch_data \ 150 static struct ftrace_branch_data \
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 85a868ccb493..fea160ee5803 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -137,6 +137,8 @@ static inline void set_mems_allowed(nodemask_t nodemask)
137 task_unlock(current); 137 task_unlock(current);
138} 138}
139 139
140extern void cpuset_post_attach_flush(void);
141
140#else /* !CONFIG_CPUSETS */ 142#else /* !CONFIG_CPUSETS */
141 143
142static inline bool cpusets_enabled(void) { return false; } 144static inline bool cpusets_enabled(void) { return false; }
@@ -243,6 +245,10 @@ static inline bool read_mems_allowed_retry(unsigned int seq)
243 return false; 245 return false;
244} 246}
245 247
248static inline void cpuset_post_attach_flush(void)
249{
250}
251
246#endif /* !CONFIG_CPUSETS */ 252#endif /* !CONFIG_CPUSETS */
247 253
248#endif /* _LINUX_CPUSET_H */ 254#endif /* _LINUX_CPUSET_H */
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h
index 48b49305716b..be8f12b8f195 100644
--- a/include/linux/crush/crush.h
+++ b/include/linux/crush/crush.h
@@ -59,7 +59,8 @@ enum {
59 CRUSH_RULE_SET_CHOOSELEAF_TRIES = 9, /* override chooseleaf_descend_once */ 59 CRUSH_RULE_SET_CHOOSELEAF_TRIES = 9, /* override chooseleaf_descend_once */
60 CRUSH_RULE_SET_CHOOSE_LOCAL_TRIES = 10, 60 CRUSH_RULE_SET_CHOOSE_LOCAL_TRIES = 10,
61 CRUSH_RULE_SET_CHOOSE_LOCAL_FALLBACK_TRIES = 11, 61 CRUSH_RULE_SET_CHOOSE_LOCAL_FALLBACK_TRIES = 11,
62 CRUSH_RULE_SET_CHOOSELEAF_VARY_R = 12 62 CRUSH_RULE_SET_CHOOSELEAF_VARY_R = 12,
63 CRUSH_RULE_SET_CHOOSELEAF_STABLE = 13
63}; 64};
64 65
65/* 66/*
@@ -205,6 +206,11 @@ struct crush_map {
205 * mappings line up a bit better with previous mappings. */ 206 * mappings line up a bit better with previous mappings. */
206 __u8 chooseleaf_vary_r; 207 __u8 chooseleaf_vary_r;
207 208
209 /* if true, it makes chooseleaf firstn to return stable results (if
210 * no local retry) so that data migrations would be optimal when some
211 * device fails. */
212 __u8 chooseleaf_stable;
213
208#ifndef __KERNEL__ 214#ifndef __KERNEL__
209 /* 215 /*
210 * version 0 (original) of straw_calc has various flaws. version 1 216 * version 0 (original) of straw_calc has various flaws. version 1
diff --git a/include/linux/dax.h b/include/linux/dax.h
index 8204c3dc3800..818e45078929 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -14,6 +14,17 @@ int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t,
14 dax_iodone_t); 14 dax_iodone_t);
15int __dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t, 15int __dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t,
16 dax_iodone_t); 16 dax_iodone_t);
17
18#ifdef CONFIG_FS_DAX
19struct page *read_dax_sector(struct block_device *bdev, sector_t n);
20#else
21static inline struct page *read_dax_sector(struct block_device *bdev,
22 sector_t n)
23{
24 return ERR_PTR(-ENXIO);
25}
26#endif
27
17#ifdef CONFIG_TRANSPARENT_HUGEPAGE 28#ifdef CONFIG_TRANSPARENT_HUGEPAGE
18int dax_pmd_fault(struct vm_area_struct *, unsigned long addr, pmd_t *, 29int dax_pmd_fault(struct vm_area_struct *, unsigned long addr, pmd_t *,
19 unsigned int flags, get_block_t, dax_iodone_t); 30 unsigned int flags, get_block_t, dax_iodone_t);
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index 251a2090a554..e0ee0b3000b2 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -19,6 +19,8 @@
19 19
20int devpts_new_index(struct inode *ptmx_inode); 20int devpts_new_index(struct inode *ptmx_inode);
21void devpts_kill_index(struct inode *ptmx_inode, int idx); 21void devpts_kill_index(struct inode *ptmx_inode, int idx);
22void devpts_add_ref(struct inode *ptmx_inode);
23void devpts_del_ref(struct inode *ptmx_inode);
22/* mknod in devpts */ 24/* mknod in devpts */
23struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, 25struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
24 void *priv); 26 void *priv);
@@ -32,6 +34,8 @@ void devpts_pty_kill(struct inode *inode);
32/* Dummy stubs in the no-pty case */ 34/* Dummy stubs in the no-pty case */
33static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } 35static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
34static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } 36static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
37static inline void devpts_add_ref(struct inode *ptmx_inode) { }
38static inline void devpts_del_ref(struct inode *ptmx_inode) { }
35static inline struct inode *devpts_pty_new(struct inode *ptmx_inode, 39static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
36 dev_t device, int index, void *priv) 40 dev_t device, int index, void *priv)
37{ 41{
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 569b5a866bb1..47be3ad7d3e5 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1199,7 +1199,10 @@ int efivar_entry_iter(int (*func)(struct efivar_entry *, void *),
1199struct efivar_entry *efivar_entry_find(efi_char16_t *name, efi_guid_t guid, 1199struct efivar_entry *efivar_entry_find(efi_char16_t *name, efi_guid_t guid,
1200 struct list_head *head, bool remove); 1200 struct list_head *head, bool remove);
1201 1201
1202bool efivar_validate(efi_char16_t *var_name, u8 *data, unsigned long len); 1202bool efivar_validate(efi_guid_t vendor, efi_char16_t *var_name, u8 *data,
1203 unsigned long data_size);
1204bool efivar_variable_is_removable(efi_guid_t vendor, const char *name,
1205 size_t len);
1203 1206
1204extern struct work_struct efivar_work; 1207extern struct work_struct efivar_work;
1205void efivar_run_worker(void); 1208void efivar_run_worker(void);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1a2046275cdf..ae681002100a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -484,9 +484,6 @@ struct block_device {
484 int bd_fsfreeze_count; 484 int bd_fsfreeze_count;
485 /* Mutex for freeze */ 485 /* Mutex for freeze */
486 struct mutex bd_fsfreeze_mutex; 486 struct mutex bd_fsfreeze_mutex;
487#ifdef CONFIG_FS_DAX
488 int bd_map_count;
489#endif
490}; 487};
491 488
492/* 489/*
@@ -2907,7 +2904,7 @@ extern void replace_mount_options(struct super_block *sb, char *options);
2907 2904
2908static inline bool io_is_direct(struct file *filp) 2905static inline bool io_is_direct(struct file *filp)
2909{ 2906{
2910 return (filp->f_flags & O_DIRECT) || IS_DAX(file_inode(filp)); 2907 return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host);
2911} 2908}
2912 2909
2913static inline int iocb_flags(struct file *file) 2910static inline int iocb_flags(struct file *file)
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 6b7e89f45aa4..533c4408529a 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -220,10 +220,7 @@ struct fsnotify_mark {
220 /* List of marks by group->i_fsnotify_marks. Also reused for queueing 220 /* List of marks by group->i_fsnotify_marks. Also reused for queueing
221 * mark into destroy_list when it's waiting for the end of SRCU period 221 * mark into destroy_list when it's waiting for the end of SRCU period
222 * before it can be freed. [group->mark_mutex] */ 222 * before it can be freed. [group->mark_mutex] */
223 union { 223 struct list_head g_list;
224 struct list_head g_list;
225 struct rcu_head g_rcu;
226 };
227 /* Protects inode / mnt pointers, flags, masks */ 224 /* Protects inode / mnt pointers, flags, masks */
228 spinlock_t lock; 225 spinlock_t lock;
229 /* List of marks for inode / vfsmount [obj_lock] */ 226 /* List of marks for inode / vfsmount [obj_lock] */
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 0639dcc98195..c2b340e23f62 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -165,7 +165,6 @@ struct ftrace_ops {
165 ftrace_func_t saved_func; 165 ftrace_func_t saved_func;
166 int __percpu *disabled; 166 int __percpu *disabled;
167#ifdef CONFIG_DYNAMIC_FTRACE 167#ifdef CONFIG_DYNAMIC_FTRACE
168 int nr_trampolines;
169 struct ftrace_ops_hash local_hash; 168 struct ftrace_ops_hash local_hash;
170 struct ftrace_ops_hash *func_hash; 169 struct ftrace_ops_hash *func_hash;
171 struct ftrace_ops_hash old_hash; 170 struct ftrace_ops_hash old_hash;
@@ -604,6 +603,7 @@ extern int ftrace_arch_read_dyn_info(char *buf, int size);
604 603
605extern int skip_trace(unsigned long ip); 604extern int skip_trace(unsigned long ip);
606extern void ftrace_module_init(struct module *mod); 605extern void ftrace_module_init(struct module *mod);
606extern void ftrace_module_enable(struct module *mod);
607extern void ftrace_release_mod(struct module *mod); 607extern void ftrace_release_mod(struct module *mod);
608 608
609extern void ftrace_disable_daemon(void); 609extern void ftrace_disable_daemon(void);
@@ -613,8 +613,9 @@ static inline int skip_trace(unsigned long ip) { return 0; }
613static inline int ftrace_force_update(void) { return 0; } 613static inline int ftrace_force_update(void) { return 0; }
614static inline void ftrace_disable_daemon(void) { } 614static inline void ftrace_disable_daemon(void) { }
615static inline void ftrace_enable_daemon(void) { } 615static inline void ftrace_enable_daemon(void) { }
616static inline void ftrace_release_mod(struct module *mod) {} 616static inline void ftrace_module_init(struct module *mod) { }
617static inline void ftrace_module_init(struct module *mod) {} 617static inline void ftrace_module_enable(struct module *mod) { }
618static inline void ftrace_release_mod(struct module *mod) { }
618static inline __init int register_ftrace_command(struct ftrace_func_command *cmd) 619static inline __init int register_ftrace_command(struct ftrace_func_command *cmd)
619{ 620{
620 return -EINVAL; 621 return -EINVAL;
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 28ad5f6494b0..af1f2b24bbe4 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -547,16 +547,16 @@ static inline bool pm_suspended_storage(void)
547} 547}
548#endif /* CONFIG_PM_SLEEP */ 548#endif /* CONFIG_PM_SLEEP */
549 549
550#ifdef CONFIG_CMA 550#if (defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || defined(CONFIG_CMA)
551
552/* The below functions must be run on a range from a single zone. */ 551/* The below functions must be run on a range from a single zone. */
553extern int alloc_contig_range(unsigned long start, unsigned long end, 552extern int alloc_contig_range(unsigned long start, unsigned long end,
554 unsigned migratetype); 553 unsigned migratetype);
555extern void free_contig_range(unsigned long pfn, unsigned nr_pages); 554extern void free_contig_range(unsigned long pfn, unsigned nr_pages);
555#endif
556 556
557#ifdef CONFIG_CMA
557/* CMA stuff */ 558/* CMA stuff */
558extern void init_cma_reserved_pageblock(struct page *page); 559extern void init_cma_reserved_pageblock(struct page *page);
559
560#endif 560#endif
561 561
562#endif /* __LINUX_GFP_H */ 562#endif /* __LINUX_GFP_H */
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 76dd4f0da5ca..2ead22dd74a0 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -87,7 +87,8 @@ enum hrtimer_restart {
87 * @function: timer expiry callback function 87 * @function: timer expiry callback function
88 * @base: pointer to the timer base (per cpu and per clock) 88 * @base: pointer to the timer base (per cpu and per clock)
89 * @state: state information (See bit values above) 89 * @state: state information (See bit values above)
90 * @start_pid: timer statistics field to store the pid of the task which 90 * @is_rel: Set if the timer was armed relative
91 * @start_pid: timer statistics field to store the pid of the task which
91 * started the timer 92 * started the timer
92 * @start_site: timer statistics field to store the site where the timer 93 * @start_site: timer statistics field to store the site where the timer
93 * was started 94 * was started
@@ -101,7 +102,8 @@ struct hrtimer {
101 ktime_t _softexpires; 102 ktime_t _softexpires;
102 enum hrtimer_restart (*function)(struct hrtimer *); 103 enum hrtimer_restart (*function)(struct hrtimer *);
103 struct hrtimer_clock_base *base; 104 struct hrtimer_clock_base *base;
104 unsigned long state; 105 u8 state;
106 u8 is_rel;
105#ifdef CONFIG_TIMER_STATS 107#ifdef CONFIG_TIMER_STATS
106 int start_pid; 108 int start_pid;
107 void *start_site; 109 void *start_site;
@@ -321,6 +323,27 @@ static inline void clock_was_set_delayed(void) { }
321 323
322#endif 324#endif
323 325
326static inline ktime_t
327__hrtimer_expires_remaining_adjusted(const struct hrtimer *timer, ktime_t now)
328{
329 ktime_t rem = ktime_sub(timer->node.expires, now);
330
331 /*
332 * Adjust relative timers for the extra we added in
333 * hrtimer_start_range_ns() to prevent short timeouts.
334 */
335 if (IS_ENABLED(CONFIG_TIME_LOW_RES) && timer->is_rel)
336 rem.tv64 -= hrtimer_resolution;
337 return rem;
338}
339
340static inline ktime_t
341hrtimer_expires_remaining_adjusted(const struct hrtimer *timer)
342{
343 return __hrtimer_expires_remaining_adjusted(timer,
344 timer->base->get_time());
345}
346
324extern void clock_was_set(void); 347extern void clock_was_set(void);
325#ifdef CONFIG_TIMERFD 348#ifdef CONFIG_TIMERFD
326extern void timerfd_clock_was_set(void); 349extern void timerfd_clock_was_set(void);
@@ -390,7 +413,12 @@ static inline void hrtimer_restart(struct hrtimer *timer)
390} 413}
391 414
392/* Query timers: */ 415/* Query timers: */
393extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); 416extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust);
417
418static inline ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
419{
420 return __hrtimer_get_remaining(timer, false);
421}
394 422
395extern u64 hrtimer_get_next_event(void); 423extern u64 hrtimer_get_next_event(void);
396 424
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 821273ca4873..2d9b650047a5 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -235,6 +235,9 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)
235/* low 64 bit */ 235/* low 64 bit */
236#define dma_frcd_page_addr(d) (d & (((u64)-1) << PAGE_SHIFT)) 236#define dma_frcd_page_addr(d) (d & (((u64)-1) << PAGE_SHIFT))
237 237
238/* PRS_REG */
239#define DMA_PRS_PPR ((u32)1)
240
238#define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \ 241#define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \
239do { \ 242do { \
240 cycles_t start_time = get_cycles(); \ 243 cycles_t start_time = get_cycles(); \
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index f28dff313b07..a5c539fa5d2b 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -133,8 +133,9 @@ struct iommu_dm_region {
133 133
134/** 134/**
135 * struct iommu_ops - iommu ops and capabilities 135 * struct iommu_ops - iommu ops and capabilities
136 * @domain_init: init iommu domain 136 * @capable: check capability
137 * @domain_destroy: destroy iommu domain 137 * @domain_alloc: allocate iommu domain
138 * @domain_free: free iommu domain
138 * @attach_dev: attach device to an iommu domain 139 * @attach_dev: attach device to an iommu domain
139 * @detach_dev: detach device from an iommu domain 140 * @detach_dev: detach device from an iommu domain
140 * @map: map a physically contiguous memory region to an iommu domain 141 * @map: map a physically contiguous memory region to an iommu domain
@@ -144,8 +145,15 @@ struct iommu_dm_region {
144 * @iova_to_phys: translate iova to physical address 145 * @iova_to_phys: translate iova to physical address
145 * @add_device: add device to iommu grouping 146 * @add_device: add device to iommu grouping
146 * @remove_device: remove device from iommu grouping 147 * @remove_device: remove device from iommu grouping
148 * @device_group: find iommu group for a particular device
147 * @domain_get_attr: Query domain attributes 149 * @domain_get_attr: Query domain attributes
148 * @domain_set_attr: Change domain attributes 150 * @domain_set_attr: Change domain attributes
151 * @get_dm_regions: Request list of direct mapping requirements for a device
152 * @put_dm_regions: Free list of direct mapping requirements for a device
153 * @domain_window_enable: Configure and enable a particular window for a domain
154 * @domain_window_disable: Disable a particular window for a domain
155 * @domain_set_windows: Set the number of windows for a domain
156 * @domain_get_windows: Return the number of windows for a domain
149 * @of_xlate: add OF master IDs to iommu grouping 157 * @of_xlate: add OF master IDs to iommu grouping
150 * @pgsize_bitmap: bitmap of supported page sizes 158 * @pgsize_bitmap: bitmap of supported page sizes
151 * @priv: per-instance data private to the iommu driver 159 * @priv: per-instance data private to the iommu driver
@@ -182,9 +190,9 @@ struct iommu_ops {
182 int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr, 190 int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr,
183 phys_addr_t paddr, u64 size, int prot); 191 phys_addr_t paddr, u64 size, int prot);
184 void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr); 192 void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr);
185 /* Set the numer of window per domain */ 193 /* Set the number of windows per domain */
186 int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count); 194 int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count);
187 /* Get the numer of window per domain */ 195 /* Get the number of windows per domain */
188 u32 (*domain_get_windows)(struct iommu_domain *domain); 196 u32 (*domain_get_windows)(struct iommu_domain *domain);
189 197
190#ifdef CONFIG_OF_IOMMU 198#ifdef CONFIG_OF_IOMMU
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index f64622ad02c1..04579d9fbce4 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -70,6 +70,7 @@ struct irq_fwspec {
70 */ 70 */
71enum irq_domain_bus_token { 71enum irq_domain_bus_token {
72 DOMAIN_BUS_ANY = 0, 72 DOMAIN_BUS_ANY = 0,
73 DOMAIN_BUS_WIRED,
73 DOMAIN_BUS_PCI_MSI, 74 DOMAIN_BUS_PCI_MSI,
74 DOMAIN_BUS_PLATFORM_MSI, 75 DOMAIN_BUS_PLATFORM_MSI,
75 DOMAIN_BUS_NEXUS, 76 DOMAIN_BUS_NEXUS,
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 851821bfd553..bec2abbd7ab2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -526,6 +526,7 @@ enum ata_lpm_policy {
526enum ata_lpm_hints { 526enum ata_lpm_hints {
527 ATA_LPM_EMPTY = (1 << 0), /* port empty/probing */ 527 ATA_LPM_EMPTY = (1 << 0), /* port empty/probing */
528 ATA_LPM_HIPM = (1 << 1), /* may use HIPM */ 528 ATA_LPM_HIPM = (1 << 1), /* may use HIPM */
529 ATA_LPM_WAKE_ONLY = (1 << 2), /* only wake up link */
529}; 530};
530 531
531/* forward declarations */ 532/* forward declarations */
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index d6750111e48e..2190419bdf0a 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -135,6 +135,10 @@ enum {
135 /* Memory types */ 135 /* Memory types */
136 NVM_ID_FMTYPE_SLC = 0, 136 NVM_ID_FMTYPE_SLC = 0,
137 NVM_ID_FMTYPE_MLC = 1, 137 NVM_ID_FMTYPE_MLC = 1,
138
139 /* Device capabilities */
140 NVM_ID_DCAP_BBLKMGMT = 0x1,
141 NVM_UD_DCAP_ECC = 0x2,
138}; 142};
139 143
140struct nvm_id_lp_mlc { 144struct nvm_id_lp_mlc {
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index c57e424d914b..4dca42fd32f5 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -66,7 +66,7 @@ struct lock_class {
66 /* 66 /*
67 * class-hash: 67 * class-hash:
68 */ 68 */
69 struct list_head hash_entry; 69 struct hlist_node hash_entry;
70 70
71 /* 71 /*
72 * global list of all lock-classes: 72 * global list of all lock-classes:
@@ -199,7 +199,7 @@ struct lock_chain {
199 u8 irq_context; 199 u8 irq_context;
200 u8 depth; 200 u8 depth;
201 u16 base; 201 u16 base;
202 struct list_head entry; 202 struct hlist_node entry;
203 u64 chain_key; 203 u64 chain_key;
204}; 204};
205 205
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 9ae48d4aeb5e..792c8981e633 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -51,7 +51,7 @@ enum mem_cgroup_stat_index {
51 MEM_CGROUP_STAT_SWAP, /* # of pages, swapped out */ 51 MEM_CGROUP_STAT_SWAP, /* # of pages, swapped out */
52 MEM_CGROUP_STAT_NSTATS, 52 MEM_CGROUP_STAT_NSTATS,
53 /* default hierarchy stats */ 53 /* default hierarchy stats */
54 MEMCG_SOCK, 54 MEMCG_SOCK = MEM_CGROUP_STAT_NSTATS,
55 MEMCG_NR_STAT, 55 MEMCG_NR_STAT,
56}; 56};
57 57
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f1cd22f2df1a..516e14944339 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -201,11 +201,13 @@ extern unsigned int kobjsize(const void *objp);
201#endif 201#endif
202 202
203#ifdef CONFIG_STACK_GROWSUP 203#ifdef CONFIG_STACK_GROWSUP
204#define VM_STACK_FLAGS (VM_GROWSUP | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) 204#define VM_STACK VM_GROWSUP
205#else 205#else
206#define VM_STACK_FLAGS (VM_GROWSDOWN | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) 206#define VM_STACK VM_GROWSDOWN
207#endif 207#endif
208 208
209#define VM_STACK_FLAGS (VM_STACK | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT)
210
209/* 211/*
210 * Special vmas that are non-mergable, non-mlock()able. 212 * Special vmas that are non-mergable, non-mlock()able.
211 * Note: mm/huge_memory.c VM_NO_THP depends on this definition. 213 * Note: mm/huge_memory.c VM_NO_THP depends on this definition.
@@ -1341,8 +1343,7 @@ static inline int stack_guard_page_end(struct vm_area_struct *vma,
1341 !vma_growsup(vma->vm_next, addr); 1343 !vma_growsup(vma->vm_next, addr);
1342} 1344}
1343 1345
1344extern struct task_struct *task_of_stack(struct task_struct *task, 1346int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t);
1345 struct vm_area_struct *vma, bool in_group);
1346 1347
1347extern unsigned long move_page_tables(struct vm_area_struct *vma, 1348extern unsigned long move_page_tables(struct vm_area_struct *vma,
1348 unsigned long old_addr, struct vm_area_struct *new_vma, 1349 unsigned long old_addr, struct vm_area_struct *new_vma,
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index d3ebb9d21a53..624b78b848b8 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -424,9 +424,9 @@ struct mm_struct {
424 unsigned long total_vm; /* Total pages mapped */ 424 unsigned long total_vm; /* Total pages mapped */
425 unsigned long locked_vm; /* Pages that have PG_mlocked set */ 425 unsigned long locked_vm; /* Pages that have PG_mlocked set */
426 unsigned long pinned_vm; /* Refcount permanently increased */ 426 unsigned long pinned_vm; /* Refcount permanently increased */
427 unsigned long data_vm; /* VM_WRITE & ~VM_SHARED/GROWSDOWN */ 427 unsigned long data_vm; /* VM_WRITE & ~VM_SHARED & ~VM_STACK */
428 unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE */ 428 unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE & ~VM_STACK */
429 unsigned long stack_vm; /* VM_GROWSUP/DOWN */ 429 unsigned long stack_vm; /* VM_STACK */
430 unsigned long def_flags; 430 unsigned long def_flags;
431 unsigned long start_code, end_code, start_data, end_data; 431 unsigned long start_code, end_code, start_data, end_data;
432 unsigned long start_brk, brk, start_stack; 432 unsigned long start_brk, brk, start_stack;
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 33bb1b19273e..7b6c2cfee390 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -682,6 +682,12 @@ typedef struct pglist_data {
682 */ 682 */
683 unsigned long first_deferred_pfn; 683 unsigned long first_deferred_pfn;
684#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */ 684#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
685
686#ifdef CONFIG_TRANSPARENT_HUGEPAGE
687 spinlock_t split_queue_lock;
688 struct list_head split_queue;
689 unsigned long split_queue_len;
690#endif
685} pg_data_t; 691} pg_data_t;
686 692
687#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) 693#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages)
diff --git a/include/linux/module.h b/include/linux/module.h
index 4560d8f1545d..2bb0c3085706 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -324,6 +324,12 @@ struct module_layout {
324#define __module_layout_align 324#define __module_layout_align
325#endif 325#endif
326 326
327struct mod_kallsyms {
328 Elf_Sym *symtab;
329 unsigned int num_symtab;
330 char *strtab;
331};
332
327struct module { 333struct module {
328 enum module_state state; 334 enum module_state state;
329 335
@@ -405,15 +411,10 @@ struct module {
405#endif 411#endif
406 412
407#ifdef CONFIG_KALLSYMS 413#ifdef CONFIG_KALLSYMS
408 /* 414 /* Protected by RCU and/or module_mutex: use rcu_dereference() */
409 * We keep the symbol and string tables for kallsyms. 415 struct mod_kallsyms *kallsyms;
410 * The core_* fields below are temporary, loader-only (they 416 struct mod_kallsyms core_kallsyms;
411 * could really be discarded after module init). 417
412 */
413 Elf_Sym *symtab, *core_symtab;
414 unsigned int num_symtab, core_num_syms;
415 char *strtab, *core_strtab;
416
417 /* Section attributes */ 418 /* Section attributes */
418 struct module_sect_attrs *sect_attrs; 419 struct module_sect_attrs *sect_attrs;
419 420
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5ac140dcb789..289c2314d766 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -512,7 +512,6 @@ static inline void napi_enable(struct napi_struct *n)
512 clear_bit(NAPI_STATE_NPSVC, &n->state); 512 clear_bit(NAPI_STATE_NPSVC, &n->state);
513} 513}
514 514
515#ifdef CONFIG_SMP
516/** 515/**
517 * napi_synchronize - wait until NAPI is not running 516 * napi_synchronize - wait until NAPI is not running
518 * @n: napi context 517 * @n: napi context
@@ -523,12 +522,12 @@ static inline void napi_enable(struct napi_struct *n)
523 */ 522 */
524static inline void napi_synchronize(const struct napi_struct *n) 523static inline void napi_synchronize(const struct napi_struct *n)
525{ 524{
526 while (test_bit(NAPI_STATE_SCHED, &n->state)) 525 if (IS_ENABLED(CONFIG_SMP))
527 msleep(1); 526 while (test_bit(NAPI_STATE_SCHED, &n->state))
527 msleep(1);
528 else
529 barrier();
528} 530}
529#else
530# define napi_synchronize(n) barrier()
531#endif
532 531
533enum netdev_queue_state_t { 532enum netdev_queue_state_t {
534 __QUEUE_STATE_DRV_XOFF, 533 __QUEUE_STATE_DRV_XOFF,
diff --git a/include/linux/of.h b/include/linux/of.h
index dd10626a615f..dc6e39696b64 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -929,7 +929,7 @@ static inline int of_get_available_child_count(const struct device_node *np)
929 return num; 929 return num;
930} 930}
931 931
932#ifdef CONFIG_OF 932#if defined(CONFIG_OF) && !defined(MODULE)
933#define _OF_DECLARE(table, name, compat, fn, fn_type) \ 933#define _OF_DECLARE(table, name, compat, fn, fn_type) \
934 static const struct of_device_id __of_table_##name \ 934 static const struct of_device_id __of_table_##name \
935 __used __section(__##table##_of_table) \ 935 __used __section(__##table##_of_table) \
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index f9828a48f16a..b35a61a481fa 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -634,9 +634,6 @@ struct perf_event_context {
634 int nr_cgroups; /* cgroup evts */ 634 int nr_cgroups; /* cgroup evts */
635 void *task_ctx_data; /* pmu specific data */ 635 void *task_ctx_data; /* pmu specific data */
636 struct rcu_head rcu_head; 636 struct rcu_head rcu_head;
637
638 struct delayed_work orphans_remove;
639 bool orphans_remove_sched;
640}; 637};
641 638
642/* 639/*
@@ -729,7 +726,7 @@ extern int perf_event_init_task(struct task_struct *child);
729extern void perf_event_exit_task(struct task_struct *child); 726extern void perf_event_exit_task(struct task_struct *child);
730extern void perf_event_free_task(struct task_struct *task); 727extern void perf_event_free_task(struct task_struct *task);
731extern void perf_event_delayed_put(struct task_struct *task); 728extern void perf_event_delayed_put(struct task_struct *task);
732extern struct perf_event *perf_event_get(unsigned int fd); 729extern struct file *perf_event_get(unsigned int fd);
733extern const struct perf_event_attr *perf_event_attrs(struct perf_event *event); 730extern const struct perf_event_attr *perf_event_attrs(struct perf_event *event);
734extern void perf_event_print_debug(void); 731extern void perf_event_print_debug(void);
735extern void perf_pmu_disable(struct pmu *pmu); 732extern void perf_pmu_disable(struct pmu *pmu);
@@ -1044,7 +1041,7 @@ extern void perf_swevent_put_recursion_context(int rctx);
1044extern u64 perf_swevent_set_period(struct perf_event *event); 1041extern u64 perf_swevent_set_period(struct perf_event *event);
1045extern void perf_event_enable(struct perf_event *event); 1042extern void perf_event_enable(struct perf_event *event);
1046extern void perf_event_disable(struct perf_event *event); 1043extern void perf_event_disable(struct perf_event *event);
1047extern int __perf_event_disable(void *info); 1044extern void perf_event_disable_local(struct perf_event *event);
1048extern void perf_event_task_tick(void); 1045extern void perf_event_task_tick(void);
1049#else /* !CONFIG_PERF_EVENTS: */ 1046#else /* !CONFIG_PERF_EVENTS: */
1050static inline void * 1047static inline void *
@@ -1070,7 +1067,7 @@ static inline int perf_event_init_task(struct task_struct *child) { return 0; }
1070static inline void perf_event_exit_task(struct task_struct *child) { } 1067static inline void perf_event_exit_task(struct task_struct *child) { }
1071static inline void perf_event_free_task(struct task_struct *task) { } 1068static inline void perf_event_free_task(struct task_struct *task) { }
1072static inline void perf_event_delayed_put(struct task_struct *task) { } 1069static inline void perf_event_delayed_put(struct task_struct *task) { }
1073static inline struct perf_event *perf_event_get(unsigned int fd) { return ERR_PTR(-EINVAL); } 1070static inline struct file *perf_event_get(unsigned int fd) { return ERR_PTR(-EINVAL); }
1074static inline const struct perf_event_attr *perf_event_attrs(struct perf_event *event) 1071static inline const struct perf_event_attr *perf_event_attrs(struct perf_event *event)
1075{ 1072{
1076 return ERR_PTR(-EINVAL); 1073 return ERR_PTR(-EINVAL);
diff --git a/include/linux/pfn.h b/include/linux/pfn.h
index 2d8e49711b63..1132953235c0 100644
--- a/include/linux/pfn.h
+++ b/include/linux/pfn.h
@@ -10,7 +10,7 @@
10 * backing is indicated by flags in the high bits of the value. 10 * backing is indicated by flags in the high bits of the value.
11 */ 11 */
12typedef struct { 12typedef struct {
13 unsigned long val; 13 u64 val;
14} pfn_t; 14} pfn_t;
15#endif 15#endif
16 16
diff --git a/include/linux/pfn_t.h b/include/linux/pfn_t.h
index 0703b5360d31..94994810c7c0 100644
--- a/include/linux/pfn_t.h
+++ b/include/linux/pfn_t.h
@@ -9,14 +9,13 @@
9 * PFN_DEV - pfn is not covered by system memmap by default 9 * PFN_DEV - pfn is not covered by system memmap by default
10 * PFN_MAP - pfn has a dynamic page mapping established by a device driver 10 * PFN_MAP - pfn has a dynamic page mapping established by a device driver
11 */ 11 */
12#define PFN_FLAGS_MASK (((unsigned long) ~PAGE_MASK) \ 12#define PFN_FLAGS_MASK (((u64) ~PAGE_MASK) << (BITS_PER_LONG_LONG - PAGE_SHIFT))
13 << (BITS_PER_LONG - PAGE_SHIFT)) 13#define PFN_SG_CHAIN (1ULL << (BITS_PER_LONG_LONG - 1))
14#define PFN_SG_CHAIN (1UL << (BITS_PER_LONG - 1)) 14#define PFN_SG_LAST (1ULL << (BITS_PER_LONG_LONG - 2))
15#define PFN_SG_LAST (1UL << (BITS_PER_LONG - 2)) 15#define PFN_DEV (1ULL << (BITS_PER_LONG_LONG - 3))
16#define PFN_DEV (1UL << (BITS_PER_LONG - 3)) 16#define PFN_MAP (1ULL << (BITS_PER_LONG_LONG - 4))
17#define PFN_MAP (1UL << (BITS_PER_LONG - 4)) 17
18 18static inline pfn_t __pfn_to_pfn_t(unsigned long pfn, u64 flags)
19static inline pfn_t __pfn_to_pfn_t(unsigned long pfn, unsigned long flags)
20{ 19{
21 pfn_t pfn_t = { .val = pfn | (flags & PFN_FLAGS_MASK), }; 20 pfn_t pfn_t = { .val = pfn | (flags & PFN_FLAGS_MASK), };
22 21
@@ -29,7 +28,7 @@ static inline pfn_t pfn_to_pfn_t(unsigned long pfn)
29 return __pfn_to_pfn_t(pfn, 0); 28 return __pfn_to_pfn_t(pfn, 0);
30} 29}
31 30
32extern pfn_t phys_to_pfn_t(dma_addr_t addr, unsigned long flags); 31extern pfn_t phys_to_pfn_t(phys_addr_t addr, u64 flags);
33 32
34static inline bool pfn_t_has_page(pfn_t pfn) 33static inline bool pfn_t_has_page(pfn_t pfn)
35{ 34{
@@ -48,7 +47,7 @@ static inline struct page *pfn_t_to_page(pfn_t pfn)
48 return NULL; 47 return NULL;
49} 48}
50 49
51static inline dma_addr_t pfn_t_to_phys(pfn_t pfn) 50static inline phys_addr_t pfn_t_to_phys(pfn_t pfn)
52{ 51{
53 return PFN_PHYS(pfn_t_to_pfn(pfn)); 52 return PFN_PHYS(pfn_t_to_pfn(pfn));
54} 53}
@@ -87,7 +86,7 @@ static inline pmd_t pfn_t_pmd(pfn_t pfn, pgprot_t pgprot)
87#ifdef __HAVE_ARCH_PTE_DEVMAP 86#ifdef __HAVE_ARCH_PTE_DEVMAP
88static inline bool pfn_t_devmap(pfn_t pfn) 87static inline bool pfn_t_devmap(pfn_t pfn)
89{ 88{
90 const unsigned long flags = PFN_DEV|PFN_MAP; 89 const u64 flags = PFN_DEV|PFN_MAP;
91 90
92 return (pfn.val & flags) == flags; 91 return (pfn.val & flags) == flags;
93} 92}
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 7c88ad156a29..f54be7082207 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -379,12 +379,28 @@ void **radix_tree_next_chunk(struct radix_tree_root *root,
379 struct radix_tree_iter *iter, unsigned flags); 379 struct radix_tree_iter *iter, unsigned flags);
380 380
381/** 381/**
382 * radix_tree_iter_retry - retry this chunk of the iteration
383 * @iter: iterator state
384 *
385 * If we iterate over a tree protected only by the RCU lock, a race
386 * against deletion or creation may result in seeing a slot for which
387 * radix_tree_deref_retry() returns true. If so, call this function
388 * and continue the iteration.
389 */
390static inline __must_check
391void **radix_tree_iter_retry(struct radix_tree_iter *iter)
392{
393 iter->next_index = iter->index;
394 return NULL;
395}
396
397/**
382 * radix_tree_chunk_size - get current chunk size 398 * radix_tree_chunk_size - get current chunk size
383 * 399 *
384 * @iter: pointer to radix tree iterator 400 * @iter: pointer to radix tree iterator
385 * Returns: current chunk size 401 * Returns: current chunk size
386 */ 402 */
387static __always_inline unsigned 403static __always_inline long
388radix_tree_chunk_size(struct radix_tree_iter *iter) 404radix_tree_chunk_size(struct radix_tree_iter *iter)
389{ 405{
390 return iter->next_index - iter->index; 406 return iter->next_index - iter->index;
@@ -418,9 +434,9 @@ radix_tree_next_slot(void **slot, struct radix_tree_iter *iter, unsigned flags)
418 return slot + offset + 1; 434 return slot + offset + 1;
419 } 435 }
420 } else { 436 } else {
421 unsigned size = radix_tree_chunk_size(iter) - 1; 437 long size = radix_tree_chunk_size(iter);
422 438
423 while (size--) { 439 while (--size > 0) {
424 slot++; 440 slot++;
425 iter->index++; 441 iter->index++;
426 if (likely(*slot)) 442 if (likely(*slot))
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index a7a06d1dcf9c..a0118d5929a9 100644
--- a/include/linux/raid/pq.h
+++ b/include/linux/raid/pq.h
@@ -152,6 +152,8 @@ void raid6_dual_recov(int disks, size_t bytes, int faila, int failb,
152 152
153# define jiffies raid6_jiffies() 153# define jiffies raid6_jiffies()
154# define printk printf 154# define printk printf
155# define pr_err(format, ...) fprintf(stderr, format, ## __VA_ARGS__)
156# define pr_info(format, ...) fprintf(stdout, format, ## __VA_ARGS__)
155# define GFP_KERNEL 0 157# define GFP_KERNEL 0
156# define __get_free_pages(x, y) ((unsigned long)mmap(NULL, PAGE_SIZE << (y), \ 158# define __get_free_pages(x, y) ((unsigned long)mmap(NULL, PAGE_SIZE << (y), \
157 PROT_READ|PROT_WRITE, \ 159 PROT_READ|PROT_WRITE, \
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index bdf597c4f0be..a07f42bedda3 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -109,20 +109,6 @@ static inline void put_anon_vma(struct anon_vma *anon_vma)
109 __put_anon_vma(anon_vma); 109 __put_anon_vma(anon_vma);
110} 110}
111 111
112static inline void vma_lock_anon_vma(struct vm_area_struct *vma)
113{
114 struct anon_vma *anon_vma = vma->anon_vma;
115 if (anon_vma)
116 down_write(&anon_vma->root->rwsem);
117}
118
119static inline void vma_unlock_anon_vma(struct vm_area_struct *vma)
120{
121 struct anon_vma *anon_vma = vma->anon_vma;
122 if (anon_vma)
123 up_write(&anon_vma->root->rwsem);
124}
125
126static inline void anon_vma_lock_write(struct anon_vma *anon_vma) 112static inline void anon_vma_lock_write(struct anon_vma *anon_vma)
127{ 113{
128 down_write(&anon_vma->root->rwsem); 114 down_write(&anon_vma->root->rwsem);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 11f935c1a090..4ce9ff7086f4 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -299,6 +299,7 @@ struct sk_buff;
299#else 299#else
300#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 1) 300#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 1)
301#endif 301#endif
302extern int sysctl_max_skb_frags;
302 303
303typedef struct skb_frag_struct skb_frag_t; 304typedef struct skb_frag_struct skb_frag_t;
304 305
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index e7a018eaf3a2..017fced60242 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -1,10 +1,13 @@
1#ifndef __LINUX_SWIOTLB_H 1#ifndef __LINUX_SWIOTLB_H
2#define __LINUX_SWIOTLB_H 2#define __LINUX_SWIOTLB_H
3 3
4#include <linux/dma-direction.h>
5#include <linux/init.h>
4#include <linux/types.h> 6#include <linux/types.h>
5 7
6struct device; 8struct device;
7struct dma_attrs; 9struct dma_attrs;
10struct page;
8struct scatterlist; 11struct scatterlist;
9 12
10extern int swiotlb_force; 13extern int swiotlb_force;
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index acd522a91539..acfdbf353a0b 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -14,8 +14,10 @@
14 * See the file COPYING for more details. 14 * See the file COPYING for more details.
15 */ 15 */
16 16
17#include <linux/smp.h>
17#include <linux/errno.h> 18#include <linux/errno.h>
18#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/cpumask.h>
19#include <linux/rcupdate.h> 21#include <linux/rcupdate.h>
20#include <linux/tracepoint-defs.h> 22#include <linux/tracepoint-defs.h>
21 23
@@ -132,6 +134,9 @@ extern void syscall_unregfunc(void);
132 void *it_func; \ 134 void *it_func; \
133 void *__data; \ 135 void *__data; \
134 \ 136 \
137 if (!cpu_online(raw_smp_processor_id())) \
138 return; \
139 \
135 if (!(cond)) \ 140 if (!(cond)) \
136 return; \ 141 return; \
137 prercu; \ 142 prercu; \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 2fd8708ea888..d9fb4b043f56 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -649,6 +649,7 @@ extern long vt_compat_ioctl(struct tty_struct *tty,
649/* tty_mutex.c */ 649/* tty_mutex.c */
650/* functions for preparation of BKL removal */ 650/* functions for preparation of BKL removal */
651extern void __lockfunc tty_lock(struct tty_struct *tty); 651extern void __lockfunc tty_lock(struct tty_struct *tty);
652extern int tty_lock_interruptible(struct tty_struct *tty);
652extern void __lockfunc tty_unlock(struct tty_struct *tty); 653extern void __lockfunc tty_unlock(struct tty_struct *tty);
653extern void __lockfunc tty_lock_slave(struct tty_struct *tty); 654extern void __lockfunc tty_lock_slave(struct tty_struct *tty);
654extern void __lockfunc tty_unlock_slave(struct tty_struct *tty); 655extern void __lockfunc tty_unlock_slave(struct tty_struct *tty);
diff --git a/include/linux/ucs2_string.h b/include/linux/ucs2_string.h
index cbb20afdbc01..bb679b48f408 100644
--- a/include/linux/ucs2_string.h
+++ b/include/linux/ucs2_string.h
@@ -11,4 +11,8 @@ unsigned long ucs2_strlen(const ucs2_char_t *s);
11unsigned long ucs2_strsize(const ucs2_char_t *data, unsigned long maxlength); 11unsigned long ucs2_strsize(const ucs2_char_t *data, unsigned long maxlength);
12int ucs2_strncmp(const ucs2_char_t *a, const ucs2_char_t *b, size_t len); 12int ucs2_strncmp(const ucs2_char_t *a, const ucs2_char_t *b, size_t len);
13 13
14unsigned long ucs2_utf8size(const ucs2_char_t *src);
15unsigned long ucs2_as_utf8(u8 *dest, const ucs2_char_t *src,
16 unsigned long maxlength);
17
14#endif /* _LINUX_UCS2_STRING_H_ */ 18#endif /* _LINUX_UCS2_STRING_H_ */
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 0e32bc71245e..ca73c503b92a 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -311,6 +311,7 @@ enum {
311 311
312 __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ 312 __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */
313 __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ 313 __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */
314 __WQ_LEGACY = 1 << 18, /* internal: create*_workqueue() */
314 315
315 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ 316 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */
316 WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ 317 WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */
@@ -411,12 +412,12 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
411 alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args) 412 alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args)
412 413
413#define create_workqueue(name) \ 414#define create_workqueue(name) \
414 alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, (name)) 415 alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name))
415#define create_freezable_workqueue(name) \ 416#define create_freezable_workqueue(name) \
416 alloc_workqueue("%s", WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, \ 417 alloc_workqueue("%s", __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \
417 1, (name)) 418 WQ_MEM_RECLAIM, 1, (name))
418#define create_singlethread_workqueue(name) \ 419#define create_singlethread_workqueue(name) \
419 alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name) 420 alloc_ordered_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, name)
420 421
421extern void destroy_workqueue(struct workqueue_struct *wq); 422extern void destroy_workqueue(struct workqueue_struct *wq);
422 423