diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/backing-dev.h | 3 | ||||
| -rw-r--r-- | include/linux/fs.h | 8 | ||||
| -rw-r--r-- | include/linux/gfp.h | 105 | ||||
| -rw-r--r-- | include/linux/highmem.h | 65 | ||||
| -rw-r--r-- | include/linux/i2c/apds990x.h | 79 | ||||
| -rw-r--r-- | include/linux/i2c/bh1770glc.h | 53 | ||||
| -rw-r--r-- | include/linux/io-mapping.h | 14 | ||||
| -rw-r--r-- | include/linux/kernel.h | 36 | ||||
| -rw-r--r-- | include/linux/kfifo.h | 7 | ||||
| -rw-r--r-- | include/linux/math64.h | 12 | ||||
| -rw-r--r-- | include/linux/memory_hotplug.h | 4 | ||||
| -rw-r--r-- | include/linux/mm.h | 17 | ||||
| -rw-r--r-- | include/linux/mm_types.h | 2 | ||||
| -rw-r--r-- | include/linux/mmzone.h | 10 | ||||
| -rw-r--r-- | include/linux/moduleparam.h | 4 | ||||
| -rw-r--r-- | include/linux/pageblock-flags.h | 5 | ||||
| -rw-r--r-- | include/linux/pagemap.h | 13 | ||||
| -rw-r--r-- | include/linux/ratelimit.h | 2 | ||||
| -rw-r--r-- | include/linux/rmap.h | 30 | ||||
| -rw-r--r-- | include/linux/sched.h | 1 | ||||
| -rw-r--r-- | include/linux/swap.h | 10 | ||||
| -rw-r--r-- | include/linux/types.h | 20 | ||||
| -rw-r--r-- | include/linux/vmalloc.h | 2 | ||||
| -rw-r--r-- | include/linux/workqueue.h | 6 | ||||
| -rw-r--r-- | include/linux/writeback.h | 2 |
25 files changed, 398 insertions, 112 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 35b00746c712..4ce34fa937d4 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
| @@ -111,6 +111,7 @@ void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); | |||
| 111 | 111 | ||
| 112 | extern spinlock_t bdi_lock; | 112 | extern spinlock_t bdi_lock; |
| 113 | extern struct list_head bdi_list; | 113 | extern struct list_head bdi_list; |
| 114 | extern struct list_head bdi_pending_list; | ||
| 114 | 115 | ||
| 115 | static inline int wb_has_dirty_io(struct bdi_writeback *wb) | 116 | static inline int wb_has_dirty_io(struct bdi_writeback *wb) |
| 116 | { | 117 | { |
| @@ -285,7 +286,7 @@ enum { | |||
| 285 | void clear_bdi_congested(struct backing_dev_info *bdi, int sync); | 286 | void clear_bdi_congested(struct backing_dev_info *bdi, int sync); |
| 286 | void set_bdi_congested(struct backing_dev_info *bdi, int sync); | 287 | void set_bdi_congested(struct backing_dev_info *bdi, int sync); |
| 287 | long congestion_wait(int sync, long timeout); | 288 | long congestion_wait(int sync, long timeout); |
| 288 | 289 | long wait_iff_congested(struct zone *zone, int sync, long timeout); | |
| 289 | 290 | ||
| 290 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) | 291 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) |
| 291 | { | 292 | { |
diff --git a/include/linux/fs.h b/include/linux/fs.h index bb20373d0b46..4658777b41cc 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -34,9 +34,9 @@ | |||
| 34 | 34 | ||
| 35 | /* And dynamically-tunable limits and defaults: */ | 35 | /* And dynamically-tunable limits and defaults: */ |
| 36 | struct files_stat_struct { | 36 | struct files_stat_struct { |
| 37 | int nr_files; /* read only */ | 37 | unsigned long nr_files; /* read only */ |
| 38 | int nr_free_files; /* read only */ | 38 | unsigned long nr_free_files; /* read only */ |
| 39 | int max_files; /* tunable */ | 39 | unsigned long max_files; /* tunable */ |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | struct inodes_stat_t { | 42 | struct inodes_stat_t { |
| @@ -402,7 +402,7 @@ extern void __init inode_init_early(void); | |||
| 402 | extern void __init files_init(unsigned long); | 402 | extern void __init files_init(unsigned long); |
| 403 | 403 | ||
| 404 | extern struct files_stat_struct files_stat; | 404 | extern struct files_stat_struct files_stat; |
| 405 | extern int get_max_files(void); | 405 | extern unsigned long get_max_files(void); |
| 406 | extern int sysctl_nr_open; | 406 | extern int sysctl_nr_open; |
| 407 | extern struct inodes_stat_t inodes_stat; | 407 | extern struct inodes_stat_t inodes_stat; |
| 408 | extern int leases_enable, lease_break_time; | 408 | extern int leases_enable, lease_break_time; |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 975609cb8548..e8713d55360a 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -9,6 +9,32 @@ | |||
| 9 | 9 | ||
| 10 | struct vm_area_struct; | 10 | struct vm_area_struct; |
| 11 | 11 | ||
| 12 | /* Plain integer GFP bitmasks. Do not use this directly. */ | ||
| 13 | #define ___GFP_DMA 0x01u | ||
| 14 | #define ___GFP_HIGHMEM 0x02u | ||
| 15 | #define ___GFP_DMA32 0x04u | ||
| 16 | #define ___GFP_MOVABLE 0x08u | ||
| 17 | #define ___GFP_WAIT 0x10u | ||
| 18 | #define ___GFP_HIGH 0x20u | ||
| 19 | #define ___GFP_IO 0x40u | ||
| 20 | #define ___GFP_FS 0x80u | ||
| 21 | #define ___GFP_COLD 0x100u | ||
| 22 | #define ___GFP_NOWARN 0x200u | ||
| 23 | #define ___GFP_REPEAT 0x400u | ||
| 24 | #define ___GFP_NOFAIL 0x800u | ||
| 25 | #define ___GFP_NORETRY 0x1000u | ||
| 26 | #define ___GFP_COMP 0x4000u | ||
| 27 | #define ___GFP_ZERO 0x8000u | ||
| 28 | #define ___GFP_NOMEMALLOC 0x10000u | ||
| 29 | #define ___GFP_HARDWALL 0x20000u | ||
| 30 | #define ___GFP_THISNODE 0x40000u | ||
| 31 | #define ___GFP_RECLAIMABLE 0x80000u | ||
| 32 | #ifdef CONFIG_KMEMCHECK | ||
| 33 | #define ___GFP_NOTRACK 0x200000u | ||
| 34 | #else | ||
| 35 | #define ___GFP_NOTRACK 0 | ||
| 36 | #endif | ||
| 37 | |||
| 12 | /* | 38 | /* |
| 13 | * GFP bitmasks.. | 39 | * GFP bitmasks.. |
| 14 | * | 40 | * |
| @@ -18,10 +44,10 @@ struct vm_area_struct; | |||
| 18 | * without the underscores and use them consistently. The definitions here may | 44 | * without the underscores and use them consistently. The definitions here may |
| 19 | * be used in bit comparisons. | 45 | * be used in bit comparisons. |
| 20 | */ | 46 | */ |
| 21 | #define __GFP_DMA ((__force gfp_t)0x01u) | 47 | #define __GFP_DMA ((__force gfp_t)___GFP_DMA) |
| 22 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) | 48 | #define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM) |
| 23 | #define __GFP_DMA32 ((__force gfp_t)0x04u) | 49 | #define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32) |
| 24 | #define __GFP_MOVABLE ((__force gfp_t)0x08u) /* Page is movable */ | 50 | #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* Page is movable */ |
| 25 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) | 51 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) |
| 26 | /* | 52 | /* |
| 27 | * Action modifiers - doesn't change the zoning | 53 | * Action modifiers - doesn't change the zoning |
| @@ -38,27 +64,22 @@ struct vm_area_struct; | |||
| 38 | * __GFP_MOVABLE: Flag that this page will be movable by the page migration | 64 | * __GFP_MOVABLE: Flag that this page will be movable by the page migration |
| 39 | * mechanism or reclaimed | 65 | * mechanism or reclaimed |
| 40 | */ | 66 | */ |
| 41 | #define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ | 67 | #define __GFP_WAIT ((__force gfp_t)___GFP_WAIT) /* Can wait and reschedule? */ |
| 42 | #define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ | 68 | #define __GFP_HIGH ((__force gfp_t)___GFP_HIGH) /* Should access emergency pools? */ |
| 43 | #define __GFP_IO ((__force gfp_t)0x40u) /* Can start physical IO? */ | 69 | #define __GFP_IO ((__force gfp_t)___GFP_IO) /* Can start physical IO? */ |
| 44 | #define __GFP_FS ((__force gfp_t)0x80u) /* Can call down to low-level FS? */ | 70 | #define __GFP_FS ((__force gfp_t)___GFP_FS) /* Can call down to low-level FS? */ |
| 45 | #define __GFP_COLD ((__force gfp_t)0x100u) /* Cache-cold page required */ | 71 | #define __GFP_COLD ((__force gfp_t)___GFP_COLD) /* Cache-cold page required */ |
| 46 | #define __GFP_NOWARN ((__force gfp_t)0x200u) /* Suppress page allocation failure warning */ | 72 | #define __GFP_NOWARN ((__force gfp_t)___GFP_NOWARN) /* Suppress page allocation failure warning */ |
| 47 | #define __GFP_REPEAT ((__force gfp_t)0x400u) /* See above */ | 73 | #define __GFP_REPEAT ((__force gfp_t)___GFP_REPEAT) /* See above */ |
| 48 | #define __GFP_NOFAIL ((__force gfp_t)0x800u) /* See above */ | 74 | #define __GFP_NOFAIL ((__force gfp_t)___GFP_NOFAIL) /* See above */ |
| 49 | #define __GFP_NORETRY ((__force gfp_t)0x1000u)/* See above */ | 75 | #define __GFP_NORETRY ((__force gfp_t)___GFP_NORETRY) /* See above */ |
| 50 | #define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ | 76 | #define __GFP_COMP ((__force gfp_t)___GFP_COMP) /* Add compound page metadata */ |
| 51 | #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ | 77 | #define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) /* Return zeroed page on success */ |
| 52 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ | 78 | #define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves */ |
| 53 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ | 79 | #define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */ |
| 54 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ | 80 | #define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */ |
| 55 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ | 81 | #define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ |
| 56 | 82 | #define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ | |
| 57 | #ifdef CONFIG_KMEMCHECK | ||
| 58 | #define __GFP_NOTRACK ((__force gfp_t)0x200000u) /* Don't track with kmemcheck */ | ||
| 59 | #else | ||
| 60 | #define __GFP_NOTRACK ((__force gfp_t)0) | ||
| 61 | #endif | ||
| 62 | 83 | ||
| 63 | /* | 84 | /* |
| 64 | * This may seem redundant, but it's a way of annotating false positives vs. | 85 | * This may seem redundant, but it's a way of annotating false positives vs. |
| @@ -186,14 +207,14 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) | |||
| 186 | #endif | 207 | #endif |
| 187 | 208 | ||
| 188 | #define GFP_ZONE_TABLE ( \ | 209 | #define GFP_ZONE_TABLE ( \ |
| 189 | (ZONE_NORMAL << 0 * ZONES_SHIFT) \ | 210 | (ZONE_NORMAL << 0 * ZONES_SHIFT) \ |
| 190 | | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \ | 211 | | (OPT_ZONE_DMA << ___GFP_DMA * ZONES_SHIFT) \ |
| 191 | | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \ | 212 | | (OPT_ZONE_HIGHMEM << ___GFP_HIGHMEM * ZONES_SHIFT) \ |
| 192 | | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \ | 213 | | (OPT_ZONE_DMA32 << ___GFP_DMA32 * ZONES_SHIFT) \ |
| 193 | | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \ | 214 | | (ZONE_NORMAL << ___GFP_MOVABLE * ZONES_SHIFT) \ |
| 194 | | (OPT_ZONE_DMA << (__GFP_MOVABLE | __GFP_DMA) * ZONES_SHIFT) \ | 215 | | (OPT_ZONE_DMA << (___GFP_MOVABLE | ___GFP_DMA) * ZONES_SHIFT) \ |
| 195 | | (ZONE_MOVABLE << (__GFP_MOVABLE | __GFP_HIGHMEM) * ZONES_SHIFT)\ | 216 | | (ZONE_MOVABLE << (___GFP_MOVABLE | ___GFP_HIGHMEM) * ZONES_SHIFT) \ |
| 196 | | (OPT_ZONE_DMA32 << (__GFP_MOVABLE | __GFP_DMA32) * ZONES_SHIFT)\ | 217 | | (OPT_ZONE_DMA32 << (___GFP_MOVABLE | ___GFP_DMA32) * ZONES_SHIFT) \ |
| 197 | ) | 218 | ) |
| 198 | 219 | ||
| 199 | /* | 220 | /* |
| @@ -203,20 +224,20 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) | |||
| 203 | * allowed. | 224 | * allowed. |
| 204 | */ | 225 | */ |
| 205 | #define GFP_ZONE_BAD ( \ | 226 | #define GFP_ZONE_BAD ( \ |
| 206 | 1 << (__GFP_DMA | __GFP_HIGHMEM) \ | 227 | 1 << (___GFP_DMA | ___GFP_HIGHMEM) \ |
| 207 | | 1 << (__GFP_DMA | __GFP_DMA32) \ | 228 | | 1 << (___GFP_DMA | ___GFP_DMA32) \ |
| 208 | | 1 << (__GFP_DMA32 | __GFP_HIGHMEM) \ | 229 | | 1 << (___GFP_DMA32 | ___GFP_HIGHMEM) \ |
| 209 | | 1 << (__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM) \ | 230 | | 1 << (___GFP_DMA | ___GFP_DMA32 | ___GFP_HIGHMEM) \ |
| 210 | | 1 << (__GFP_MOVABLE | __GFP_HIGHMEM | __GFP_DMA) \ | 231 | | 1 << (___GFP_MOVABLE | ___GFP_HIGHMEM | ___GFP_DMA) \ |
| 211 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA) \ | 232 | | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_DMA) \ |
| 212 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_HIGHMEM) \ | 233 | | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_HIGHMEM) \ |
| 213 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA | __GFP_HIGHMEM)\ | 234 | | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_DMA | ___GFP_HIGHMEM) \ |
| 214 | ) | 235 | ) |
| 215 | 236 | ||
| 216 | static inline enum zone_type gfp_zone(gfp_t flags) | 237 | static inline enum zone_type gfp_zone(gfp_t flags) |
| 217 | { | 238 | { |
| 218 | enum zone_type z; | 239 | enum zone_type z; |
| 219 | int bit = flags & GFP_ZONEMASK; | 240 | int bit = (__force int) (flags & GFP_ZONEMASK); |
| 220 | 241 | ||
| 221 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & | 242 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & |
| 222 | ((1 << ZONES_SHIFT) - 1); | 243 | ((1 << ZONES_SHIFT) - 1); |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index e3060ef85b6d..8a85ec109a3a 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
| @@ -28,18 +28,6 @@ static inline void invalidate_kernel_vmap_range(void *vaddr, int size) | |||
| 28 | 28 | ||
| 29 | #include <asm/kmap_types.h> | 29 | #include <asm/kmap_types.h> |
| 30 | 30 | ||
| 31 | #ifdef CONFIG_DEBUG_HIGHMEM | ||
| 32 | |||
| 33 | void debug_kmap_atomic(enum km_type type); | ||
| 34 | |||
| 35 | #else | ||
| 36 | |||
| 37 | static inline void debug_kmap_atomic(enum km_type type) | ||
| 38 | { | ||
| 39 | } | ||
| 40 | |||
| 41 | #endif | ||
| 42 | |||
| 43 | #ifdef CONFIG_HIGHMEM | 31 | #ifdef CONFIG_HIGHMEM |
| 44 | #include <asm/highmem.h> | 32 | #include <asm/highmem.h> |
| 45 | 33 | ||
| @@ -49,6 +37,27 @@ extern unsigned long totalhigh_pages; | |||
| 49 | 37 | ||
| 50 | void kmap_flush_unused(void); | 38 | void kmap_flush_unused(void); |
| 51 | 39 | ||
| 40 | DECLARE_PER_CPU(int, __kmap_atomic_idx); | ||
| 41 | |||
| 42 | static inline int kmap_atomic_idx_push(void) | ||
| 43 | { | ||
| 44 | int idx = __get_cpu_var(__kmap_atomic_idx)++; | ||
| 45 | #ifdef CONFIG_DEBUG_HIGHMEM | ||
| 46 | WARN_ON_ONCE(in_irq() && !irqs_disabled()); | ||
| 47 | BUG_ON(idx > KM_TYPE_NR); | ||
| 48 | #endif | ||
| 49 | return idx; | ||
| 50 | } | ||
| 51 | |||
| 52 | static inline int kmap_atomic_idx_pop(void) | ||
| 53 | { | ||
| 54 | int idx = --__get_cpu_var(__kmap_atomic_idx); | ||
| 55 | #ifdef CONFIG_DEBUG_HIGHMEM | ||
| 56 | BUG_ON(idx < 0); | ||
| 57 | #endif | ||
| 58 | return idx; | ||
| 59 | } | ||
| 60 | |||
| 52 | #else /* CONFIG_HIGHMEM */ | 61 | #else /* CONFIG_HIGHMEM */ |
| 53 | 62 | ||
| 54 | static inline unsigned int nr_free_highpages(void) { return 0; } | 63 | static inline unsigned int nr_free_highpages(void) { return 0; } |
| @@ -66,19 +75,19 @@ static inline void kunmap(struct page *page) | |||
| 66 | { | 75 | { |
| 67 | } | 76 | } |
| 68 | 77 | ||
| 69 | static inline void *kmap_atomic(struct page *page, enum km_type idx) | 78 | static inline void *__kmap_atomic(struct page *page) |
| 70 | { | 79 | { |
| 71 | pagefault_disable(); | 80 | pagefault_disable(); |
| 72 | return page_address(page); | 81 | return page_address(page); |
| 73 | } | 82 | } |
| 74 | #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) | 83 | #define kmap_atomic_prot(page, prot) __kmap_atomic(page) |
| 75 | 84 | ||
| 76 | static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx) | 85 | static inline void __kunmap_atomic(void *addr) |
| 77 | { | 86 | { |
| 78 | pagefault_enable(); | 87 | pagefault_enable(); |
| 79 | } | 88 | } |
| 80 | 89 | ||
| 81 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) | 90 | #define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn)) |
| 82 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) | 91 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) |
| 83 | 92 | ||
| 84 | #define kmap_flush_unused() do {} while(0) | 93 | #define kmap_flush_unused() do {} while(0) |
| @@ -86,12 +95,20 @@ static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx) | |||
| 86 | 95 | ||
| 87 | #endif /* CONFIG_HIGHMEM */ | 96 | #endif /* CONFIG_HIGHMEM */ |
| 88 | 97 | ||
| 89 | /* Prevent people trying to call kunmap_atomic() as if it were kunmap() */ | 98 | /* |
| 90 | /* kunmap_atomic() should get the return value of kmap_atomic, not the page. */ | 99 | * Make both: kmap_atomic(page, idx) and kmap_atomic(page) work. |
| 91 | #define kunmap_atomic(addr, idx) do { \ | 100 | */ |
| 92 | BUILD_BUG_ON(__same_type((addr), struct page *)); \ | 101 | #define kmap_atomic(page, args...) __kmap_atomic(page) |
| 93 | kunmap_atomic_notypecheck((addr), (idx)); \ | 102 | |
| 94 | } while (0) | 103 | /* |
| 104 | * Prevent people trying to call kunmap_atomic() as if it were kunmap() | ||
| 105 | * kunmap_atomic() should get the return value of kmap_atomic, not the page. | ||
| 106 | */ | ||
| 107 | #define kunmap_atomic(addr, args...) \ | ||
| 108 | do { \ | ||
| 109 | BUILD_BUG_ON(__same_type((addr), struct page *)); \ | ||
| 110 | __kunmap_atomic(addr); \ | ||
| 111 | } while (0) | ||
| 95 | 112 | ||
| 96 | /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ | 113 | /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ |
| 97 | #ifndef clear_user_highpage | 114 | #ifndef clear_user_highpage |
| @@ -201,8 +218,8 @@ static inline void copy_user_highpage(struct page *to, struct page *from, | |||
| 201 | vfrom = kmap_atomic(from, KM_USER0); | 218 | vfrom = kmap_atomic(from, KM_USER0); |
| 202 | vto = kmap_atomic(to, KM_USER1); | 219 | vto = kmap_atomic(to, KM_USER1); |
| 203 | copy_user_page(vto, vfrom, vaddr, to); | 220 | copy_user_page(vto, vfrom, vaddr, to); |
| 204 | kunmap_atomic(vfrom, KM_USER0); | ||
| 205 | kunmap_atomic(vto, KM_USER1); | 221 | kunmap_atomic(vto, KM_USER1); |
| 222 | kunmap_atomic(vfrom, KM_USER0); | ||
| 206 | } | 223 | } |
| 207 | 224 | ||
| 208 | #endif | 225 | #endif |
| @@ -214,8 +231,8 @@ static inline void copy_highpage(struct page *to, struct page *from) | |||
| 214 | vfrom = kmap_atomic(from, KM_USER0); | 231 | vfrom = kmap_atomic(from, KM_USER0); |
| 215 | vto = kmap_atomic(to, KM_USER1); | 232 | vto = kmap_atomic(to, KM_USER1); |
| 216 | copy_page(vto, vfrom); | 233 | copy_page(vto, vfrom); |
| 217 | kunmap_atomic(vfrom, KM_USER0); | ||
| 218 | kunmap_atomic(vto, KM_USER1); | 234 | kunmap_atomic(vto, KM_USER1); |
| 235 | kunmap_atomic(vfrom, KM_USER0); | ||
| 219 | } | 236 | } |
| 220 | 237 | ||
| 221 | #endif /* _LINUX_HIGHMEM_H */ | 238 | #endif /* _LINUX_HIGHMEM_H */ |
diff --git a/include/linux/i2c/apds990x.h b/include/linux/i2c/apds990x.h new file mode 100644 index 000000000000..d186fcc5d257 --- /dev/null +++ b/include/linux/i2c/apds990x.h | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | /* | ||
| 2 | * This file is part of the APDS990x sensor driver. | ||
| 3 | * Chip is combined proximity and ambient light sensor. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | ||
| 6 | * | ||
| 7 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or | ||
| 10 | * modify it under the terms of the GNU General Public License | ||
| 11 | * version 2 as published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, but | ||
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 16 | * General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 21 | * 02110-1301 USA | ||
| 22 | * | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef __APDS990X_H__ | ||
| 26 | #define __APDS990X_H__ | ||
| 27 | |||
| 28 | |||
| 29 | #define APDS_IRLED_CURR_12mA 0x3 | ||
| 30 | #define APDS_IRLED_CURR_25mA 0x2 | ||
| 31 | #define APDS_IRLED_CURR_50mA 0x1 | ||
| 32 | #define APDS_IRLED_CURR_100mA 0x0 | ||
| 33 | |||
| 34 | /** | ||
| 35 | * struct apds990x_chip_factors - defines effect of the cover window | ||
| 36 | * @ga: Total glass attenuation | ||
| 37 | * @cf1: clear channel factor 1 for raw to lux conversion | ||
| 38 | * @irf1: IR channel factor 1 for raw to lux conversion | ||
| 39 | * @cf2: clear channel factor 2 for raw to lux conversion | ||
| 40 | * @irf2: IR channel factor 2 for raw to lux conversion | ||
| 41 | * @df: device factor for conversion formulas | ||
| 42 | * | ||
| 43 | * Structure for tuning ALS calculation to match with environment. | ||
| 44 | * Values depend on the material above the sensor and the sensor | ||
| 45 | * itself. If the GA is zero, driver will use uncovered sensor default values | ||
| 46 | * format: decimal value * APDS_PARAM_SCALE except df which is plain integer. | ||
| 47 | */ | ||
| 48 | #define APDS_PARAM_SCALE 4096 | ||
| 49 | struct apds990x_chip_factors { | ||
| 50 | int ga; | ||
| 51 | int cf1; | ||
| 52 | int irf1; | ||
| 53 | int cf2; | ||
| 54 | int irf2; | ||
| 55 | int df; | ||
| 56 | }; | ||
| 57 | |||
| 58 | /** | ||
| 59 | * struct apds990x_platform_data - platform data for apsd990x.c driver | ||
| 60 | * @cf: chip factor data | ||
| 61 | * @pddrive: IR-led driving current | ||
| 62 | * @ppcount: number of IR pulses used for proximity estimation | ||
| 63 | * @setup_resources: interrupt line setup call back function | ||
| 64 | * @release_resources: interrupt line release call back function | ||
| 65 | * | ||
| 66 | * Proximity detection result depends heavily on correct ppcount, pdrive | ||
| 67 | * and cover window. | ||
| 68 | * | ||
| 69 | */ | ||
| 70 | |||
| 71 | struct apds990x_platform_data { | ||
| 72 | struct apds990x_chip_factors cf; | ||
| 73 | u8 pdrive; | ||
| 74 | u8 ppcount; | ||
| 75 | int (*setup_resources)(void); | ||
| 76 | int (*release_resources)(void); | ||
| 77 | }; | ||
| 78 | |||
| 79 | #endif | ||
diff --git a/include/linux/i2c/bh1770glc.h b/include/linux/i2c/bh1770glc.h new file mode 100644 index 000000000000..8b5e2df36c72 --- /dev/null +++ b/include/linux/i2c/bh1770glc.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | * This file is part of the ROHM BH1770GLC / OSRAM SFH7770 sensor driver. | ||
| 3 | * Chip is combined proximity and ambient light sensor. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | ||
| 6 | * | ||
| 7 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or | ||
| 10 | * modify it under the terms of the GNU General Public License | ||
| 11 | * version 2 as published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, but | ||
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 16 | * General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 21 | * 02110-1301 USA | ||
| 22 | * | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef __BH1770_H__ | ||
| 26 | #define __BH1770_H__ | ||
| 27 | |||
| 28 | /** | ||
| 29 | * struct bh1770_platform_data - platform data for bh1770glc driver | ||
| 30 | * @led_def_curr: IR led driving current. | ||
| 31 | * @glass_attenuation: Attenuation factor for covering window. | ||
| 32 | * @setup_resources: Call back for interrupt line setup function | ||
| 33 | * @release_resources: Call back for interrupte line release function | ||
| 34 | * | ||
| 35 | * Example of glass attenuation: 16384 * 385 / 100 means attenuation factor | ||
| 36 | * of 3.85. i.e. light_above_sensor = light_above_cover_window / 3.85 | ||
| 37 | */ | ||
| 38 | |||
| 39 | struct bh1770_platform_data { | ||
| 40 | #define BH1770_LED_5mA 0 | ||
| 41 | #define BH1770_LED_10mA 1 | ||
| 42 | #define BH1770_LED_20mA 2 | ||
| 43 | #define BH1770_LED_50mA 3 | ||
| 44 | #define BH1770_LED_100mA 4 | ||
| 45 | #define BH1770_LED_150mA 5 | ||
| 46 | #define BH1770_LED_200mA 6 | ||
| 47 | __u8 led_def_curr; | ||
| 48 | #define BH1770_NEUTRAL_GA 16384 /* 16384 / 16384 = 1 */ | ||
| 49 | __u32 glass_attenuation; | ||
| 50 | int (*setup_resources)(void); | ||
| 51 | int (*release_resources)(void); | ||
| 52 | }; | ||
| 53 | #endif | ||
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 7fb592793738..8cdcc2a199ad 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
| @@ -81,8 +81,7 @@ io_mapping_free(struct io_mapping *mapping) | |||
| 81 | /* Atomic map/unmap */ | 81 | /* Atomic map/unmap */ |
| 82 | static inline void __iomem * | 82 | static inline void __iomem * |
| 83 | io_mapping_map_atomic_wc(struct io_mapping *mapping, | 83 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
| 84 | unsigned long offset, | 84 | unsigned long offset) |
| 85 | int slot) | ||
| 86 | { | 85 | { |
| 87 | resource_size_t phys_addr; | 86 | resource_size_t phys_addr; |
| 88 | unsigned long pfn; | 87 | unsigned long pfn; |
| @@ -90,13 +89,13 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, | |||
| 90 | BUG_ON(offset >= mapping->size); | 89 | BUG_ON(offset >= mapping->size); |
| 91 | phys_addr = mapping->base + offset; | 90 | phys_addr = mapping->base + offset; |
| 92 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); | 91 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); |
| 93 | return iomap_atomic_prot_pfn(pfn, slot, mapping->prot); | 92 | return iomap_atomic_prot_pfn(pfn, mapping->prot); |
| 94 | } | 93 | } |
| 95 | 94 | ||
| 96 | static inline void | 95 | static inline void |
| 97 | io_mapping_unmap_atomic(void __iomem *vaddr, int slot) | 96 | io_mapping_unmap_atomic(void __iomem *vaddr) |
| 98 | { | 97 | { |
| 99 | iounmap_atomic(vaddr, slot); | 98 | iounmap_atomic(vaddr); |
| 100 | } | 99 | } |
| 101 | 100 | ||
| 102 | static inline void __iomem * | 101 | static inline void __iomem * |
| @@ -137,14 +136,13 @@ io_mapping_free(struct io_mapping *mapping) | |||
| 137 | /* Atomic map/unmap */ | 136 | /* Atomic map/unmap */ |
| 138 | static inline void __iomem * | 137 | static inline void __iomem * |
| 139 | io_mapping_map_atomic_wc(struct io_mapping *mapping, | 138 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
| 140 | unsigned long offset, | 139 | unsigned long offset) |
| 141 | int slot) | ||
| 142 | { | 140 | { |
| 143 | return ((char __force __iomem *) mapping) + offset; | 141 | return ((char __force __iomem *) mapping) + offset; |
| 144 | } | 142 | } |
| 145 | 143 | ||
| 146 | static inline void | 144 | static inline void |
| 147 | io_mapping_unmap_atomic(void __iomem *vaddr, int slot) | 145 | io_mapping_unmap_atomic(void __iomem *vaddr) |
| 148 | { | 146 | { |
| 149 | } | 147 | } |
| 150 | 148 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index edef168a0406..450092c1e35f 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -173,6 +173,11 @@ extern int _cond_resched(void); | |||
| 173 | (__x < 0) ? -__x : __x; \ | 173 | (__x < 0) ? -__x : __x; \ |
| 174 | }) | 174 | }) |
| 175 | 175 | ||
| 176 | #define abs64(x) ({ \ | ||
| 177 | s64 __x = (x); \ | ||
| 178 | (__x < 0) ? -__x : __x; \ | ||
| 179 | }) | ||
| 180 | |||
| 176 | #ifdef CONFIG_PROVE_LOCKING | 181 | #ifdef CONFIG_PROVE_LOCKING |
| 177 | void might_fault(void); | 182 | void might_fault(void); |
| 178 | #else | 183 | #else |
| @@ -203,10 +208,10 @@ extern unsigned long simple_strtoul(const char *,char **,unsigned int); | |||
| 203 | extern long simple_strtol(const char *,char **,unsigned int); | 208 | extern long simple_strtol(const char *,char **,unsigned int); |
| 204 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); | 209 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); |
| 205 | extern long long simple_strtoll(const char *,char **,unsigned int); | 210 | extern long long simple_strtoll(const char *,char **,unsigned int); |
| 206 | extern int strict_strtoul(const char *, unsigned int, unsigned long *); | 211 | extern int __must_check strict_strtoul(const char *, unsigned int, unsigned long *); |
| 207 | extern int strict_strtol(const char *, unsigned int, long *); | 212 | extern int __must_check strict_strtol(const char *, unsigned int, long *); |
| 208 | extern int strict_strtoull(const char *, unsigned int, unsigned long long *); | 213 | extern int __must_check strict_strtoull(const char *, unsigned int, unsigned long long *); |
| 209 | extern int strict_strtoll(const char *, unsigned int, long long *); | 214 | extern int __must_check strict_strtoll(const char *, unsigned int, long long *); |
| 210 | extern int sprintf(char * buf, const char * fmt, ...) | 215 | extern int sprintf(char * buf, const char * fmt, ...) |
| 211 | __attribute__ ((format (printf, 2, 3))); | 216 | __attribute__ ((format (printf, 2, 3))); |
| 212 | extern int vsprintf(char *buf, const char *, va_list) | 217 | extern int vsprintf(char *buf, const char *, va_list) |
| @@ -277,6 +282,11 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
| 277 | asmlinkage int printk(const char * fmt, ...) | 282 | asmlinkage int printk(const char * fmt, ...) |
| 278 | __attribute__ ((format (printf, 1, 2))) __cold; | 283 | __attribute__ ((format (printf, 1, 2))) __cold; |
| 279 | 284 | ||
| 285 | /* | ||
| 286 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | ||
| 287 | * with all other unrelated printk_ratelimit() callsites. Instead use | ||
| 288 | * printk_ratelimited() or plain old __ratelimit(). | ||
| 289 | */ | ||
| 280 | extern int __printk_ratelimit(const char *func); | 290 | extern int __printk_ratelimit(const char *func); |
| 281 | #define printk_ratelimit() __printk_ratelimit(__func__) | 291 | #define printk_ratelimit() __printk_ratelimit(__func__) |
| 282 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 292 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
| @@ -651,6 +661,24 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } | |||
| 651 | (void) (&_max1 == &_max2); \ | 661 | (void) (&_max1 == &_max2); \ |
| 652 | _max1 > _max2 ? _max1 : _max2; }) | 662 | _max1 > _max2 ? _max1 : _max2; }) |
| 653 | 663 | ||
| 664 | #define min3(x, y, z) ({ \ | ||
| 665 | typeof(x) _min1 = (x); \ | ||
| 666 | typeof(y) _min2 = (y); \ | ||
| 667 | typeof(z) _min3 = (z); \ | ||
| 668 | (void) (&_min1 == &_min2); \ | ||
| 669 | (void) (&_min1 == &_min3); \ | ||
| 670 | _min1 < _min2 ? (_min1 < _min3 ? _min1 : _min3) : \ | ||
| 671 | (_min2 < _min3 ? _min2 : _min3); }) | ||
| 672 | |||
| 673 | #define max3(x, y, z) ({ \ | ||
| 674 | typeof(x) _max1 = (x); \ | ||
| 675 | typeof(y) _max2 = (y); \ | ||
| 676 | typeof(z) _max3 = (z); \ | ||
| 677 | (void) (&_max1 == &_max2); \ | ||
| 678 | (void) (&_max1 == &_max3); \ | ||
| 679 | _max1 > _max2 ? (_max1 > _max3 ? _max1 : _max3) : \ | ||
| 680 | (_max2 > _max3 ? _max2 : _max3); }) | ||
| 681 | |||
| 654 | /** | 682 | /** |
| 655 | * min_not_zero - return the minimum that is _not_ zero, unless both are zero | 683 | * min_not_zero - return the minimum that is _not_ zero, unless both are zero |
| 656 | * @x: value1 | 684 | * @x: value1 |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index 62dbee554f60..c238ad2f82ea 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
| @@ -171,11 +171,8 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PTR(unsigned char, 2, void); | |||
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | 173 | ||
| 174 | static inline unsigned int __must_check | 174 | /* __kfifo_must_check_helper() is temporarily disabled because it was faulty */ |
| 175 | __kfifo_must_check_helper(unsigned int val) | 175 | #define __kfifo_must_check_helper(x) (x) |
| 176 | { | ||
| 177 | return val; | ||
| 178 | } | ||
| 179 | 176 | ||
| 180 | /** | 177 | /** |
| 181 | * kfifo_initialized - Check if the fifo is initialized | 178 | * kfifo_initialized - Check if the fifo is initialized |
diff --git a/include/linux/math64.h b/include/linux/math64.h index c87f1528703a..23fcdfcba81b 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h | |||
| @@ -35,6 +35,14 @@ static inline u64 div64_u64(u64 dividend, u64 divisor) | |||
| 35 | return dividend / divisor; | 35 | return dividend / divisor; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | /** | ||
| 39 | * div64_s64 - signed 64bit divide with 64bit divisor | ||
| 40 | */ | ||
| 41 | static inline s64 div64_s64(s64 dividend, s64 divisor) | ||
| 42 | { | ||
| 43 | return dividend / divisor; | ||
| 44 | } | ||
| 45 | |||
| 38 | #elif BITS_PER_LONG == 32 | 46 | #elif BITS_PER_LONG == 32 |
| 39 | 47 | ||
| 40 | #ifndef div_u64_rem | 48 | #ifndef div_u64_rem |
| @@ -53,6 +61,10 @@ extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); | |||
| 53 | extern u64 div64_u64(u64 dividend, u64 divisor); | 61 | extern u64 div64_u64(u64 dividend, u64 divisor); |
| 54 | #endif | 62 | #endif |
| 55 | 63 | ||
| 64 | #ifndef div64_s64 | ||
| 65 | extern s64 div64_s64(s64 dividend, s64 divisor); | ||
| 66 | #endif | ||
| 67 | |||
| 56 | #endif /* BITS_PER_LONG */ | 68 | #endif /* BITS_PER_LONG */ |
| 57 | 69 | ||
| 58 | /** | 70 | /** |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 864035fb8f8a..4307231bd22f 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -70,6 +70,10 @@ extern void online_page(struct page *page); | |||
| 70 | extern int online_pages(unsigned long, unsigned long); | 70 | extern int online_pages(unsigned long, unsigned long); |
| 71 | extern void __offline_isolated_pages(unsigned long, unsigned long); | 71 | extern void __offline_isolated_pages(unsigned long, unsigned long); |
| 72 | 72 | ||
| 73 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
| 74 | extern bool is_pageblock_removable_nolock(struct page *page); | ||
| 75 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | ||
| 76 | |||
| 73 | /* reasonably generic interface to expand the physical pages in a zone */ | 77 | /* reasonably generic interface to expand the physical pages in a zone */ |
| 74 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, | 78 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, |
| 75 | unsigned long nr_pages); | 79 | unsigned long nr_pages); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index a4c66846fb8f..721f451c3029 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -144,6 +144,7 @@ extern pgprot_t protection_map[16]; | |||
| 144 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ | 144 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ |
| 145 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ | 145 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ |
| 146 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ | 146 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ |
| 147 | #define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ | ||
| 147 | 148 | ||
| 148 | /* | 149 | /* |
| 149 | * This interface is used by x86 PAT code to identify a pfn mapping that is | 150 | * This interface is used by x86 PAT code to identify a pfn mapping that is |
| @@ -497,8 +498,8 @@ static inline void set_compound_order(struct page *page, unsigned long order) | |||
| 497 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) | 498 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) |
| 498 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) | 499 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) |
| 499 | 500 | ||
| 500 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allcator */ | 501 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ |
| 501 | #ifdef NODE_NOT_IN_PAGEFLAGS | 502 | #ifdef NODE_NOT_IN_PAGE_FLAGS |
| 502 | #define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) | 503 | #define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) |
| 503 | #define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \ | 504 | #define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \ |
| 504 | SECTIONS_PGOFF : ZONES_PGOFF) | 505 | SECTIONS_PGOFF : ZONES_PGOFF) |
| @@ -723,6 +724,7 @@ static inline int page_mapped(struct page *page) | |||
| 723 | 724 | ||
| 724 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ | 725 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ |
| 725 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ | 726 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ |
| 727 | #define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */ | ||
| 726 | 728 | ||
| 727 | #define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */ | 729 | #define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */ |
| 728 | 730 | ||
| @@ -868,6 +870,7 @@ int __set_page_dirty_no_writeback(struct page *page); | |||
| 868 | int redirty_page_for_writepage(struct writeback_control *wbc, | 870 | int redirty_page_for_writepage(struct writeback_control *wbc, |
| 869 | struct page *page); | 871 | struct page *page); |
| 870 | void account_page_dirtied(struct page *page, struct address_space *mapping); | 872 | void account_page_dirtied(struct page *page, struct address_space *mapping); |
| 873 | void account_page_writeback(struct page *page); | ||
| 871 | int set_page_dirty(struct page *page); | 874 | int set_page_dirty(struct page *page); |
| 872 | int set_page_dirty_lock(struct page *page); | 875 | int set_page_dirty_lock(struct page *page); |
| 873 | int clear_page_dirty_for_io(struct page *page); | 876 | int clear_page_dirty_for_io(struct page *page); |
| @@ -1031,7 +1034,15 @@ extern void unregister_shrinker(struct shrinker *); | |||
| 1031 | 1034 | ||
| 1032 | int vma_wants_writenotify(struct vm_area_struct *vma); | 1035 | int vma_wants_writenotify(struct vm_area_struct *vma); |
| 1033 | 1036 | ||
| 1034 | extern pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl); | 1037 | extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, |
| 1038 | spinlock_t **ptl); | ||
| 1039 | static inline pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, | ||
| 1040 | spinlock_t **ptl) | ||
| 1041 | { | ||
| 1042 | pte_t *ptep; | ||
| 1043 | __cond_lock(*ptl, ptep = __get_locked_pte(mm, addr, ptl)); | ||
| 1044 | return ptep; | ||
| 1045 | } | ||
| 1035 | 1046 | ||
| 1036 | #ifdef __PAGETABLE_PUD_FOLDED | 1047 | #ifdef __PAGETABLE_PUD_FOLDED |
| 1037 | static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, | 1048 | static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index cb57d657ce4d..bb7288a782fd 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -310,6 +310,8 @@ struct mm_struct { | |||
| 310 | #ifdef CONFIG_MMU_NOTIFIER | 310 | #ifdef CONFIG_MMU_NOTIFIER |
| 311 | struct mmu_notifier_mm *mmu_notifier_mm; | 311 | struct mmu_notifier_mm *mmu_notifier_mm; |
| 312 | #endif | 312 | #endif |
| 313 | /* How many tasks sharing this mm are OOM_DISABLE */ | ||
| 314 | atomic_t oom_disable_count; | ||
| 313 | }; | 315 | }; |
| 314 | 316 | ||
| 315 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ | 317 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 3984c4eb41fd..39c24ebe9cfd 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -104,6 +104,8 @@ enum zone_stat_item { | |||
| 104 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ | 104 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ |
| 105 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ | 105 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ |
| 106 | NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */ | 106 | NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */ |
| 107 | NR_DIRTIED, /* page dirtyings since bootup */ | ||
| 108 | NR_WRITTEN, /* page writings since bootup */ | ||
| 107 | #ifdef CONFIG_NUMA | 109 | #ifdef CONFIG_NUMA |
| 108 | NUMA_HIT, /* allocated in intended node */ | 110 | NUMA_HIT, /* allocated in intended node */ |
| 109 | NUMA_MISS, /* allocated in non intended node */ | 111 | NUMA_MISS, /* allocated in non intended node */ |
| @@ -421,6 +423,9 @@ struct zone { | |||
| 421 | typedef enum { | 423 | typedef enum { |
| 422 | ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ | 424 | ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ |
| 423 | ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ | 425 | ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ |
| 426 | ZONE_CONGESTED, /* zone has many dirty pages backed by | ||
| 427 | * a congested BDI | ||
| 428 | */ | ||
| 424 | } zone_flags_t; | 429 | } zone_flags_t; |
| 425 | 430 | ||
| 426 | static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) | 431 | static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) |
| @@ -438,6 +443,11 @@ static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag) | |||
| 438 | clear_bit(flag, &zone->flags); | 443 | clear_bit(flag, &zone->flags); |
| 439 | } | 444 | } |
| 440 | 445 | ||
| 446 | static inline int zone_is_reclaim_congested(const struct zone *zone) | ||
| 447 | { | ||
| 448 | return test_bit(ZONE_CONGESTED, &zone->flags); | ||
| 449 | } | ||
| 450 | |||
| 441 | static inline int zone_is_reclaim_locked(const struct zone *zone) | 451 | static inline int zone_is_reclaim_locked(const struct zone *zone) |
| 442 | { | 452 | { |
| 443 | return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); | 453 | return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 9d2f1837b3d8..112adf8bd47d 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
| @@ -21,8 +21,8 @@ | |||
| 21 | #define __module_cat(a,b) ___module_cat(a,b) | 21 | #define __module_cat(a,b) ___module_cat(a,b) |
| 22 | #define __MODULE_INFO(tag, name, info) \ | 22 | #define __MODULE_INFO(tag, name, info) \ |
| 23 | static const char __module_cat(name,__LINE__)[] \ | 23 | static const char __module_cat(name,__LINE__)[] \ |
| 24 | __used \ | 24 | __used __attribute__((section(".modinfo"), unused, aligned(1))) \ |
| 25 | __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info | 25 | = __stringify(tag) "=" info |
| 26 | #else /* !MODULE */ | 26 | #else /* !MODULE */ |
| 27 | #define __MODULE_INFO(tag, name, info) | 27 | #define __MODULE_INFO(tag, name, info) |
| 28 | #endif | 28 | #endif |
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h index e8c06122be36..19ef95d293ae 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h | |||
| @@ -67,7 +67,8 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags, | |||
| 67 | 67 | ||
| 68 | #define get_pageblock_flags(page) \ | 68 | #define get_pageblock_flags(page) \ |
| 69 | get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) | 69 | get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) |
| 70 | #define set_pageblock_flags(page) \ | 70 | #define set_pageblock_flags(page, flags) \ |
| 71 | set_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) | 71 | set_pageblock_flags_group(page, flags, \ |
| 72 | 0, NR_PAGEBLOCK_BITS-1) | ||
| 72 | 73 | ||
| 73 | #endif /* PAGEBLOCK_FLAGS_H */ | 74 | #endif /* PAGEBLOCK_FLAGS_H */ |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index e12cdc6d79ee..2d1ffe3cf1ee 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -299,6 +299,8 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma, | |||
| 299 | extern void __lock_page(struct page *page); | 299 | extern void __lock_page(struct page *page); |
| 300 | extern int __lock_page_killable(struct page *page); | 300 | extern int __lock_page_killable(struct page *page); |
| 301 | extern void __lock_page_nosync(struct page *page); | 301 | extern void __lock_page_nosync(struct page *page); |
| 302 | extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm, | ||
| 303 | unsigned int flags); | ||
| 302 | extern void unlock_page(struct page *page); | 304 | extern void unlock_page(struct page *page); |
| 303 | 305 | ||
| 304 | static inline void __set_page_locked(struct page *page) | 306 | static inline void __set_page_locked(struct page *page) |
| @@ -351,6 +353,17 @@ static inline void lock_page_nosync(struct page *page) | |||
| 351 | } | 353 | } |
| 352 | 354 | ||
| 353 | /* | 355 | /* |
| 356 | * lock_page_or_retry - Lock the page, unless this would block and the | ||
| 357 | * caller indicated that it can handle a retry. | ||
| 358 | */ | ||
| 359 | static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm, | ||
| 360 | unsigned int flags) | ||
| 361 | { | ||
| 362 | might_sleep(); | ||
| 363 | return trylock_page(page) || __lock_page_or_retry(page, mm, flags); | ||
| 364 | } | ||
| 365 | |||
| 366 | /* | ||
| 354 | * This is exported only for wait_on_page_locked/wait_on_page_writeback. | 367 | * This is exported only for wait_on_page_locked/wait_on_page_writeback. |
| 355 | * Never use this directly! | 368 | * Never use this directly! |
| 356 | */ | 369 | */ |
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 8f69d09a41a5..03ff67b0cdf5 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
| @@ -36,6 +36,8 @@ static inline void ratelimit_state_init(struct ratelimit_state *rs, | |||
| 36 | rs->begin = 0; | 36 | rs->begin = 0; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | extern struct ratelimit_state printk_ratelimit_state; | ||
| 40 | |||
| 39 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | 41 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); |
| 40 | #define __ratelimit(state) ___ratelimit(state, __func__) | 42 | #define __ratelimit(state) ___ratelimit(state, __func__) |
| 41 | 43 | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 31b2fd75dcba..bb83c0da2071 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -25,8 +25,8 @@ | |||
| 25 | * pointing to this anon_vma once its vma list is empty. | 25 | * pointing to this anon_vma once its vma list is empty. |
| 26 | */ | 26 | */ |
| 27 | struct anon_vma { | 27 | struct anon_vma { |
| 28 | spinlock_t lock; /* Serialize access to vma list */ | ||
| 29 | struct anon_vma *root; /* Root of this anon_vma tree */ | 28 | struct anon_vma *root; /* Root of this anon_vma tree */ |
| 29 | spinlock_t lock; /* Serialize access to vma list */ | ||
| 30 | #if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) | 30 | #if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) |
| 31 | 31 | ||
| 32 | /* | 32 | /* |
| @@ -205,9 +205,20 @@ int try_to_unmap_one(struct page *, struct vm_area_struct *, | |||
| 205 | /* | 205 | /* |
| 206 | * Called from mm/filemap_xip.c to unmap empty zero page | 206 | * Called from mm/filemap_xip.c to unmap empty zero page |
| 207 | */ | 207 | */ |
| 208 | pte_t *page_check_address(struct page *, struct mm_struct *, | 208 | pte_t *__page_check_address(struct page *, struct mm_struct *, |
| 209 | unsigned long, spinlock_t **, int); | 209 | unsigned long, spinlock_t **, int); |
| 210 | 210 | ||
| 211 | static inline pte_t *page_check_address(struct page *page, struct mm_struct *mm, | ||
| 212 | unsigned long address, | ||
| 213 | spinlock_t **ptlp, int sync) | ||
| 214 | { | ||
| 215 | pte_t *ptep; | ||
| 216 | |||
| 217 | __cond_lock(*ptlp, ptep = __page_check_address(page, mm, address, | ||
| 218 | ptlp, sync)); | ||
| 219 | return ptep; | ||
| 220 | } | ||
| 221 | |||
| 211 | /* | 222 | /* |
| 212 | * Used by swapoff to help locate where page is expected in vma. | 223 | * Used by swapoff to help locate where page is expected in vma. |
| 213 | */ | 224 | */ |
| @@ -230,7 +241,20 @@ int try_to_munlock(struct page *); | |||
| 230 | /* | 241 | /* |
| 231 | * Called by memory-failure.c to kill processes. | 242 | * Called by memory-failure.c to kill processes. |
| 232 | */ | 243 | */ |
| 233 | struct anon_vma *page_lock_anon_vma(struct page *page); | 244 | struct anon_vma *__page_lock_anon_vma(struct page *page); |
| 245 | |||
| 246 | static inline struct anon_vma *page_lock_anon_vma(struct page *page) | ||
| 247 | { | ||
| 248 | struct anon_vma *anon_vma; | ||
| 249 | |||
| 250 | __cond_lock(RCU, anon_vma = __page_lock_anon_vma(page)); | ||
| 251 | |||
| 252 | /* (void) is needed to make gcc happy */ | ||
| 253 | (void) __cond_lock(&anon_vma->root->lock, anon_vma); | ||
| 254 | |||
| 255 | return anon_vma; | ||
| 256 | } | ||
| 257 | |||
| 234 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | 258 | void page_unlock_anon_vma(struct anon_vma *anon_vma); |
| 235 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 259 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); |
| 236 | 260 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 56154bbb8da9..393ce94e54b7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1706,7 +1706,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
| 1706 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1706 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |
| 1707 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ | 1707 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ |
| 1708 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ | 1708 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ |
| 1709 | #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ | ||
| 1710 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ | 1709 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ |
| 1711 | #define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ | 1710 | #define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ |
| 1712 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ | 1711 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 7cdd63366f88..eba53e71d2cc 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -271,8 +271,18 @@ extern void scan_mapping_unevictable_pages(struct address_space *); | |||
| 271 | extern unsigned long scan_unevictable_pages; | 271 | extern unsigned long scan_unevictable_pages; |
| 272 | extern int scan_unevictable_handler(struct ctl_table *, int, | 272 | extern int scan_unevictable_handler(struct ctl_table *, int, |
| 273 | void __user *, size_t *, loff_t *); | 273 | void __user *, size_t *, loff_t *); |
| 274 | #ifdef CONFIG_NUMA | ||
| 274 | extern int scan_unevictable_register_node(struct node *node); | 275 | extern int scan_unevictable_register_node(struct node *node); |
| 275 | extern void scan_unevictable_unregister_node(struct node *node); | 276 | extern void scan_unevictable_unregister_node(struct node *node); |
| 277 | #else | ||
| 278 | static inline int scan_unevictable_register_node(struct node *node) | ||
| 279 | { | ||
| 280 | return 0; | ||
| 281 | } | ||
| 282 | static inline void scan_unevictable_unregister_node(struct node *node) | ||
| 283 | { | ||
| 284 | } | ||
| 285 | #endif | ||
| 276 | 286 | ||
| 277 | extern int kswapd_run(int nid); | 287 | extern int kswapd_run(int nid); |
| 278 | extern void kswapd_stop(int nid); | 288 | extern void kswapd_stop(int nid); |
diff --git a/include/linux/types.h b/include/linux/types.h index 357dbc19606f..c2a9eb44f2fa 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -121,15 +121,7 @@ typedef __u64 u_int64_t; | |||
| 121 | typedef __s64 int64_t; | 121 | typedef __s64 int64_t; |
| 122 | #endif | 122 | #endif |
| 123 | 123 | ||
| 124 | /* | 124 | /* this is a special 64bit data type that is 8-byte aligned */ |
| 125 | * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid | ||
| 126 | * common 32/64-bit compat problems. | ||
| 127 | * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other | ||
| 128 | * architectures) and to 8-byte boundaries on 64-bit architetures. The new | ||
| 129 | * aligned_64 type enforces 8-byte alignment so that structs containing | ||
| 130 | * aligned_64 values have the same alignment on 32-bit and 64-bit architectures. | ||
| 131 | * No conversions are necessary between 32-bit user-space and a 64-bit kernel. | ||
| 132 | */ | ||
| 133 | #define aligned_u64 __u64 __attribute__((aligned(8))) | 125 | #define aligned_u64 __u64 __attribute__((aligned(8))) |
| 134 | #define aligned_be64 __be64 __attribute__((aligned(8))) | 126 | #define aligned_be64 __be64 __attribute__((aligned(8))) |
| 135 | #define aligned_le64 __le64 __attribute__((aligned(8))) | 127 | #define aligned_le64 __le64 __attribute__((aligned(8))) |
| @@ -186,7 +178,15 @@ typedef __u64 __bitwise __be64; | |||
| 186 | typedef __u16 __bitwise __sum16; | 178 | typedef __u16 __bitwise __sum16; |
| 187 | typedef __u32 __bitwise __wsum; | 179 | typedef __u32 __bitwise __wsum; |
| 188 | 180 | ||
| 189 | /* this is a special 64bit data type that is 8-byte aligned */ | 181 | /* |
| 182 | * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid | ||
| 183 | * common 32/64-bit compat problems. | ||
| 184 | * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other | ||
| 185 | * architectures) and to 8-byte boundaries on 64-bit architetures. The new | ||
| 186 | * aligned_64 type enforces 8-byte alignment so that structs containing | ||
| 187 | * aligned_64 values have the same alignment on 32-bit and 64-bit architectures. | ||
| 188 | * No conversions are necessary between 32-bit user-space and a 64-bit kernel. | ||
| 189 | */ | ||
| 190 | #define __aligned_u64 __u64 __attribute__((aligned(8))) | 190 | #define __aligned_u64 __u64 __attribute__((aligned(8))) |
| 191 | #define __aligned_be64 __be64 __attribute__((aligned(8))) | 191 | #define __aligned_be64 __be64 __attribute__((aligned(8))) |
| 192 | #define __aligned_le64 __le64 __attribute__((aligned(8))) | 192 | #define __aligned_le64 __le64 __attribute__((aligned(8))) |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 63a4fe6d51bd..a03dcf62ca9d 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -53,8 +53,10 @@ static inline void vmalloc_init(void) | |||
| 53 | #endif | 53 | #endif |
| 54 | 54 | ||
| 55 | extern void *vmalloc(unsigned long size); | 55 | extern void *vmalloc(unsigned long size); |
| 56 | extern void *vzalloc(unsigned long size); | ||
| 56 | extern void *vmalloc_user(unsigned long size); | 57 | extern void *vmalloc_user(unsigned long size); |
| 57 | extern void *vmalloc_node(unsigned long size, int node); | 58 | extern void *vmalloc_node(unsigned long size, int node); |
| 59 | extern void *vzalloc_node(unsigned long size, int node); | ||
| 58 | extern void *vmalloc_exec(unsigned long size); | 60 | extern void *vmalloc_exec(unsigned long size); |
| 59 | extern void *vmalloc_32(unsigned long size); | 61 | extern void *vmalloc_32(unsigned long size); |
| 60 | extern void *vmalloc_32_user(unsigned long size); | 62 | extern void *vmalloc_32_user(unsigned long size); |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 070bb7a88936..0c0771f06bfa 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -190,7 +190,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 190 | __INIT_WORK((_work), (_func), 0); \ | 190 | __INIT_WORK((_work), (_func), 0); \ |
| 191 | } while (0) | 191 | } while (0) |
| 192 | 192 | ||
| 193 | #define INIT_WORK_ON_STACK(_work, _func) \ | 193 | #define INIT_WORK_ONSTACK(_work, _func) \ |
| 194 | do { \ | 194 | do { \ |
| 195 | __INIT_WORK((_work), (_func), 1); \ | 195 | __INIT_WORK((_work), (_func), 1); \ |
| 196 | } while (0) | 196 | } while (0) |
| @@ -201,9 +201,9 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 201 | init_timer(&(_work)->timer); \ | 201 | init_timer(&(_work)->timer); \ |
| 202 | } while (0) | 202 | } while (0) |
| 203 | 203 | ||
| 204 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ | 204 | #define INIT_DELAYED_WORK_ONSTACK(_work, _func) \ |
| 205 | do { \ | 205 | do { \ |
| 206 | INIT_WORK_ON_STACK(&(_work)->work, (_func)); \ | 206 | INIT_WORK_ONSTACK(&(_work)->work, (_func)); \ |
| 207 | init_timer_on_stack(&(_work)->timer); \ | 207 | init_timer_on_stack(&(_work)->timer); \ |
| 208 | } while (0) | 208 | } while (0) |
| 209 | 209 | ||
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 72a5d647a5f2..c7299d2ace6b 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -149,6 +149,8 @@ int write_cache_pages(struct address_space *mapping, | |||
| 149 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); | 149 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); |
| 150 | void set_page_dirty_balance(struct page *page, int page_mkwrite); | 150 | void set_page_dirty_balance(struct page *page, int page_mkwrite); |
| 151 | void writeback_set_ratelimit(void); | 151 | void writeback_set_ratelimit(void); |
| 152 | void tag_pages_for_writeback(struct address_space *mapping, | ||
| 153 | pgoff_t start, pgoff_t end); | ||
| 152 | 154 | ||
| 153 | /* pdflush.c */ | 155 | /* pdflush.c */ |
| 154 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl | 156 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl |
