aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/feature-removal-schedule.txt8
-rw-r--r--arch/arm/include/asm/kmap_types.h26
-rw-r--r--arch/avr32/include/asm/kmap_types.h24
-rw-r--r--arch/frv/include/asm/highmem.h34
-rw-r--r--arch/frv/include/asm/kmap_types.h24
-rw-r--r--arch/frv/mb93090-mb00/pci-dma.c4
-rw-r--r--arch/frv/mm/cache-page.c8
-rw-r--r--arch/frv/mm/highmem.c20
-rw-r--r--arch/powerpc/include/asm/kmap_types.h31
-rw-r--r--arch/tile/include/asm/kmap_types.h31
-rw-r--r--arch/tile/mm/highmem.c2
-rw-r--r--arch/um/include/asm/kmap_types.h18
-rw-r--r--fs/jbd2/commit.c4
-rw-r--r--fs/pipe.c2
-rw-r--r--include/asm-generic/kmap_types.h34
-rw-r--r--include/linux/highmem.h41
-rw-r--r--include/linux/pipe_fs_i.h8
-rw-r--r--mm/vmalloc.c8
18 files changed, 44 insertions, 283 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 61d1a89baeaf..76112dac7659 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -512,14 +512,6 @@ Who: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
512 512
513---------------------------- 513----------------------------
514 514
515What: kmap_atomic(page, km_type)
516When: 3.5
517Why: The old kmap_atomic() with two arguments is deprecated, we only
518 keep it for backward compatibility for few cycles and then drop it.
519Who: Cong Wang <amwang@redhat.com>
520
521----------------------------
522
523What: get_robust_list syscall 515What: get_robust_list syscall
524When: 2013 516When: 2013
525Why: There appear to be no production users of the get_robust_list syscall, 517Why: There appear to be no production users of the get_robust_list syscall,
diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h
index e51b1e81df05..83eb2f772911 100644
--- a/arch/arm/include/asm/kmap_types.h
+++ b/arch/arm/include/asm/kmap_types.h
@@ -4,30 +4,6 @@
4/* 4/*
5 * This is the "bare minimum". AIO seems to require this. 5 * This is the "bare minimum". AIO seems to require this.
6 */ 6 */
7enum km_type { 7#define KM_TYPE_NR 16
8 KM_BOUNCE_READ,
9 KM_SKB_SUNRPC_DATA,
10 KM_SKB_DATA_SOFTIRQ,
11 KM_USER0,
12 KM_USER1,
13 KM_BIO_SRC_IRQ,
14 KM_BIO_DST_IRQ,
15 KM_PTE0,
16 KM_PTE1,
17 KM_IRQ0,
18 KM_IRQ1,
19 KM_SOFTIRQ0,
20 KM_SOFTIRQ1,
21 KM_L1_CACHE,
22 KM_L2_CACHE,
23 KM_KDB,
24 KM_TYPE_NR
25};
26
27#ifdef CONFIG_DEBUG_HIGHMEM
28#define KM_NMI (-1)
29#define KM_NMI_PTE (-1)
30#define KM_IRQ_PTE (-1)
31#endif
32 8
33#endif 9#endif
diff --git a/arch/avr32/include/asm/kmap_types.h b/arch/avr32/include/asm/kmap_types.h
index b7f5c6870107..479330b89796 100644
--- a/arch/avr32/include/asm/kmap_types.h
+++ b/arch/avr32/include/asm/kmap_types.h
@@ -2,29 +2,9 @@
2#define __ASM_AVR32_KMAP_TYPES_H 2#define __ASM_AVR32_KMAP_TYPES_H
3 3
4#ifdef CONFIG_DEBUG_HIGHMEM 4#ifdef CONFIG_DEBUG_HIGHMEM
5# define D(n) __KM_FENCE_##n , 5# define KM_TYPE_NR 29
6#else 6#else
7# define D(n) 7# define KM_TYPE_NR 14
8#endif 8#endif
9 9
10enum km_type {
11D(0) KM_BOUNCE_READ,
12D(1) KM_SKB_SUNRPC_DATA,
13D(2) KM_SKB_DATA_SOFTIRQ,
14D(3) KM_USER0,
15D(4) KM_USER1,
16D(5) KM_BIO_SRC_IRQ,
17D(6) KM_BIO_DST_IRQ,
18D(7) KM_PTE0,
19D(8) KM_PTE1,
20D(9) KM_PTE2,
21D(10) KM_IRQ0,
22D(11) KM_IRQ1,
23D(12) KM_SOFTIRQ0,
24D(13) KM_SOFTIRQ1,
25D(14) KM_TYPE_NR
26};
27
28#undef D
29
30#endif /* __ASM_AVR32_KMAP_TYPES_H */ 10#endif /* __ASM_AVR32_KMAP_TYPES_H */
diff --git a/arch/frv/include/asm/highmem.h b/arch/frv/include/asm/highmem.h
index 716956a5317b..b3adc93611f3 100644
--- a/arch/frv/include/asm/highmem.h
+++ b/arch/frv/include/asm/highmem.h
@@ -76,15 +76,16 @@ extern struct page *kmap_atomic_to_page(void *ptr);
76 76
77#ifndef __ASSEMBLY__ 77#ifndef __ASSEMBLY__
78 78
79#define __kmap_atomic_primary(type, paddr, ampr) \ 79#define __kmap_atomic_primary(cached, paddr, ampr) \
80({ \ 80({ \
81 unsigned long damlr, dampr; \ 81 unsigned long damlr, dampr; \
82 \ 82 \
83 dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \ 83 dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \
84 \ 84 \
85 if (type != __KM_CACHE) \ 85 if (!cached) \
86 asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \ 86 asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \
87 else \ 87 else \
88 /* cache flush page attachment point */ \
88 asm volatile("movgs %0,iampr"#ampr"\n" \ 89 asm volatile("movgs %0,iampr"#ampr"\n" \
89 "movgs %0,dampr"#ampr"\n" \ 90 "movgs %0,dampr"#ampr"\n" \
90 :: "r"(dampr) : "memory" \ 91 :: "r"(dampr) : "memory" \
@@ -112,29 +113,20 @@ extern struct page *kmap_atomic_to_page(void *ptr);
112 (void *) damlr; \ 113 (void *) damlr; \
113}) 114})
114 115
115static inline void *kmap_atomic_primary(struct page *page, enum km_type type) 116static inline void *kmap_atomic_primary(struct page *page)
116{ 117{
117 unsigned long paddr; 118 unsigned long paddr;
118 119
119 pagefault_disable(); 120 pagefault_disable();
120 paddr = page_to_phys(page); 121 paddr = page_to_phys(page);
121 122
122 switch (type) { 123 return __kmap_atomic_primary(1, paddr, 2);
123 case 0: return __kmap_atomic_primary(0, paddr, 2);
124 case 1: return __kmap_atomic_primary(1, paddr, 3);
125 case 2: return __kmap_atomic_primary(2, paddr, 4);
126 case 3: return __kmap_atomic_primary(3, paddr, 5);
127
128 default:
129 BUG();
130 return NULL;
131 }
132} 124}
133 125
134#define __kunmap_atomic_primary(type, ampr) \ 126#define __kunmap_atomic_primary(cached, ampr) \
135do { \ 127do { \
136 asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \ 128 asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \
137 if (type == __KM_CACHE) \ 129 if (cached) \
138 asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \ 130 asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \
139} while(0) 131} while(0)
140 132
@@ -143,17 +135,9 @@ do { \
143 asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \ 135 asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \
144} while(0) 136} while(0)
145 137
146static inline void kunmap_atomic_primary(void *kvaddr, enum km_type type) 138static inline void kunmap_atomic_primary(void *kvaddr)
147{ 139{
148 switch (type) { 140 __kunmap_atomic_primary(1, 2);
149 case 0: __kunmap_atomic_primary(0, 2); break;
150 case 1: __kunmap_atomic_primary(1, 3); break;
151 case 2: __kunmap_atomic_primary(2, 4); break;
152 case 3: __kunmap_atomic_primary(3, 5); break;
153
154 default:
155 BUG();
156 }
157 pagefault_enable(); 141 pagefault_enable();
158} 142}
159 143
diff --git a/arch/frv/include/asm/kmap_types.h b/arch/frv/include/asm/kmap_types.h
index f8e16b2a5804..43901f220963 100644
--- a/arch/frv/include/asm/kmap_types.h
+++ b/arch/frv/include/asm/kmap_types.h
@@ -2,28 +2,6 @@
2#ifndef _ASM_KMAP_TYPES_H 2#ifndef _ASM_KMAP_TYPES_H
3#define _ASM_KMAP_TYPES_H 3#define _ASM_KMAP_TYPES_H
4 4
5enum km_type { 5#define KM_TYPE_NR 17
6 /* arch specific kmaps - change the numbers attached to these at your peril */
7 __KM_CACHE, /* cache flush page attachment point */
8 __KM_PGD, /* current page directory */
9 __KM_ITLB_PTD, /* current instruction TLB miss page table lookup */
10 __KM_DTLB_PTD, /* current data TLB miss page table lookup */
11
12 /* general kmaps */
13 KM_BOUNCE_READ,
14 KM_SKB_SUNRPC_DATA,
15 KM_SKB_DATA_SOFTIRQ,
16 KM_USER0,
17 KM_USER1,
18 KM_BIO_SRC_IRQ,
19 KM_BIO_DST_IRQ,
20 KM_PTE0,
21 KM_PTE1,
22 KM_IRQ0,
23 KM_IRQ1,
24 KM_SOFTIRQ0,
25 KM_SOFTIRQ1,
26 KM_TYPE_NR
27};
28 6
29#endif 7#endif
diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c
index 4f8d8bcdc7de..82478979ac9a 100644
--- a/arch/frv/mb93090-mb00/pci-dma.c
+++ b/arch/frv/mb93090-mb00/pci-dma.c
@@ -62,14 +62,14 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
62 dampr2 = __get_DAMPR(2); 62 dampr2 = __get_DAMPR(2);
63 63
64 for (i = 0; i < nents; i++) { 64 for (i = 0; i < nents; i++) {
65 vaddr = kmap_atomic_primary(sg_page(&sg[i]), __KM_CACHE); 65 vaddr = kmap_atomic_primary(sg_page(&sg[i]));
66 66
67 frv_dcache_writeback((unsigned long) vaddr, 67 frv_dcache_writeback((unsigned long) vaddr,
68 (unsigned long) vaddr + PAGE_SIZE); 68 (unsigned long) vaddr + PAGE_SIZE);
69 69
70 } 70 }
71 71
72 kunmap_atomic_primary(vaddr, __KM_CACHE); 72 kunmap_atomic_primary(vaddr);
73 if (dampr2) { 73 if (dampr2) {
74 __set_DAMPR(2, dampr2); 74 __set_DAMPR(2, dampr2);
75 __set_IAMPR(2, dampr2); 75 __set_IAMPR(2, dampr2);
diff --git a/arch/frv/mm/cache-page.c b/arch/frv/mm/cache-page.c
index b24ade27a0f0..8e09dae0ec3f 100644
--- a/arch/frv/mm/cache-page.c
+++ b/arch/frv/mm/cache-page.c
@@ -26,11 +26,11 @@ void flush_dcache_page(struct page *page)
26 26
27 dampr2 = __get_DAMPR(2); 27 dampr2 = __get_DAMPR(2);
28 28
29 vaddr = kmap_atomic_primary(page, __KM_CACHE); 29 vaddr = kmap_atomic_primary(page);
30 30
31 frv_dcache_writeback((unsigned long) vaddr, (unsigned long) vaddr + PAGE_SIZE); 31 frv_dcache_writeback((unsigned long) vaddr, (unsigned long) vaddr + PAGE_SIZE);
32 32
33 kunmap_atomic_primary(vaddr, __KM_CACHE); 33 kunmap_atomic_primary(vaddr);
34 34
35 if (dampr2) { 35 if (dampr2) {
36 __set_DAMPR(2, dampr2); 36 __set_DAMPR(2, dampr2);
@@ -54,12 +54,12 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
54 54
55 dampr2 = __get_DAMPR(2); 55 dampr2 = __get_DAMPR(2);
56 56
57 vaddr = kmap_atomic_primary(page, __KM_CACHE); 57 vaddr = kmap_atomic_primary(page);
58 58
59 start = (start & ~PAGE_MASK) | (unsigned long) vaddr; 59 start = (start & ~PAGE_MASK) | (unsigned long) vaddr;
60 frv_cache_wback_inv(start, start + len); 60 frv_cache_wback_inv(start, start + len);
61 61
62 kunmap_atomic_primary(vaddr, __KM_CACHE); 62 kunmap_atomic_primary(vaddr);
63 63
64 if (dampr2) { 64 if (dampr2) {
65 __set_DAMPR(2, dampr2); 65 __set_DAMPR(2, dampr2);
diff --git a/arch/frv/mm/highmem.c b/arch/frv/mm/highmem.c
index 31902c9d5be5..bed9a9bd3c10 100644
--- a/arch/frv/mm/highmem.c
+++ b/arch/frv/mm/highmem.c
@@ -50,11 +50,11 @@ void *kmap_atomic(struct page *page)
50 /* 50 /*
51 * The first 4 primary maps are reserved for architecture code 51 * The first 4 primary maps are reserved for architecture code
52 */ 52 */
53 case 0: return __kmap_atomic_primary(4, paddr, 6); 53 case 0: return __kmap_atomic_primary(0, paddr, 6);
54 case 1: return __kmap_atomic_primary(5, paddr, 7); 54 case 1: return __kmap_atomic_primary(0, paddr, 7);
55 case 2: return __kmap_atomic_primary(6, paddr, 8); 55 case 2: return __kmap_atomic_primary(0, paddr, 8);
56 case 3: return __kmap_atomic_primary(7, paddr, 9); 56 case 3: return __kmap_atomic_primary(0, paddr, 9);
57 case 4: return __kmap_atomic_primary(8, paddr, 10); 57 case 4: return __kmap_atomic_primary(0, paddr, 10);
58 58
59 case 5 ... 5 + NR_TLB_LINES - 1: 59 case 5 ... 5 + NR_TLB_LINES - 1:
60 return __kmap_atomic_secondary(type - 5, paddr); 60 return __kmap_atomic_secondary(type - 5, paddr);
@@ -70,11 +70,11 @@ void __kunmap_atomic(void *kvaddr)
70{ 70{
71 int type = kmap_atomic_idx(); 71 int type = kmap_atomic_idx();
72 switch (type) { 72 switch (type) {
73 case 0: __kunmap_atomic_primary(4, 6); break; 73 case 0: __kunmap_atomic_primary(0, 6); break;
74 case 1: __kunmap_atomic_primary(5, 7); break; 74 case 1: __kunmap_atomic_primary(0, 7); break;
75 case 2: __kunmap_atomic_primary(6, 8); break; 75 case 2: __kunmap_atomic_primary(0, 8); break;
76 case 3: __kunmap_atomic_primary(7, 9); break; 76 case 3: __kunmap_atomic_primary(0, 9); break;
77 case 4: __kunmap_atomic_primary(8, 10); break; 77 case 4: __kunmap_atomic_primary(0, 10); break;
78 78
79 case 5 ... 5 + NR_TLB_LINES - 1: 79 case 5 ... 5 + NR_TLB_LINES - 1:
80 __kunmap_atomic_secondary(type - 5, kvaddr); 80 __kunmap_atomic_secondary(type - 5, kvaddr);
diff --git a/arch/powerpc/include/asm/kmap_types.h b/arch/powerpc/include/asm/kmap_types.h
index bca8fdcd2542..5acabbd7ac6f 100644
--- a/arch/powerpc/include/asm/kmap_types.h
+++ b/arch/powerpc/include/asm/kmap_types.h
@@ -10,36 +10,7 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13enum km_type { 13#define KM_TYPE_NR 16
14 KM_BOUNCE_READ,
15 KM_SKB_SUNRPC_DATA,
16 KM_SKB_DATA_SOFTIRQ,
17 KM_USER0,
18 KM_USER1,
19 KM_BIO_SRC_IRQ,
20 KM_BIO_DST_IRQ,
21 KM_PTE0,
22 KM_PTE1,
23 KM_IRQ0,
24 KM_IRQ1,
25 KM_SOFTIRQ0,
26 KM_SOFTIRQ1,
27 KM_PPC_SYNC_PAGE,
28 KM_PPC_SYNC_ICACHE,
29 KM_KDB,
30 KM_TYPE_NR
31};
32
33/*
34 * This is a temporary build fix that (so they say on lkml....) should no longer
35 * be required after 2.6.33, because of changes planned to the kmap code.
36 * Let's try to remove this cruft then.
37 */
38#ifdef CONFIG_DEBUG_HIGHMEM
39#define KM_NMI (-1)
40#define KM_NMI_PTE (-1)
41#define KM_IRQ_PTE (-1)
42#endif
43 14
44#endif /* __KERNEL__ */ 15#endif /* __KERNEL__ */
45#endif /* _ASM_POWERPC_KMAP_TYPES_H */ 16#endif /* _ASM_POWERPC_KMAP_TYPES_H */
diff --git a/arch/tile/include/asm/kmap_types.h b/arch/tile/include/asm/kmap_types.h
index 3d0f20246260..92b28e3e9972 100644
--- a/arch/tile/include/asm/kmap_types.h
+++ b/arch/tile/include/asm/kmap_types.h
@@ -23,35 +23,6 @@
23 * adds 4MB of required address-space. For now we leave KM_TYPE_NR 23 * adds 4MB of required address-space. For now we leave KM_TYPE_NR
24 * set to depth 8. 24 * set to depth 8.
25 */ 25 */
26enum km_type { 26#define KM_TYPE_NR 8
27 KM_TYPE_NR = 8
28};
29
30/*
31 * We provide dummy definitions of all the stray values that used to be
32 * required for kmap_atomic() and no longer are.
33 */
34enum {
35 KM_BOUNCE_READ,
36 KM_SKB_SUNRPC_DATA,
37 KM_SKB_DATA_SOFTIRQ,
38 KM_USER0,
39 KM_USER1,
40 KM_BIO_SRC_IRQ,
41 KM_BIO_DST_IRQ,
42 KM_PTE0,
43 KM_PTE1,
44 KM_IRQ0,
45 KM_IRQ1,
46 KM_SOFTIRQ0,
47 KM_SOFTIRQ1,
48 KM_SYNC_ICACHE,
49 KM_SYNC_DCACHE,
50 KM_UML_USERCOPY,
51 KM_IRQ_PTE,
52 KM_NMI,
53 KM_NMI_PTE,
54 KM_KDB
55};
56 27
57#endif /* _ASM_TILE_KMAP_TYPES_H */ 28#endif /* _ASM_TILE_KMAP_TYPES_H */
diff --git a/arch/tile/mm/highmem.c b/arch/tile/mm/highmem.c
index ef8e5a62b6e3..347d123b14be 100644
--- a/arch/tile/mm/highmem.c
+++ b/arch/tile/mm/highmem.c
@@ -93,7 +93,7 @@ static DEFINE_PER_CPU(struct kmap_amps, amps);
93 * If we examine it earlier we are exposed to a race where it looks 93 * If we examine it earlier we are exposed to a race where it looks
94 * writable earlier, but becomes immutable before we write the PTE. 94 * writable earlier, but becomes immutable before we write the PTE.
95 */ 95 */
96static void kmap_atomic_register(struct page *page, enum km_type type, 96static void kmap_atomic_register(struct page *page, int type,
97 unsigned long va, pte_t *ptep, pte_t pteval) 97 unsigned long va, pte_t *ptep, pte_t pteval)
98{ 98{
99 unsigned long flags; 99 unsigned long flags;
diff --git a/arch/um/include/asm/kmap_types.h b/arch/um/include/asm/kmap_types.h
index 6c03acdb4405..2e0a6b1d8300 100644
--- a/arch/um/include/asm/kmap_types.h
+++ b/arch/um/include/asm/kmap_types.h
@@ -8,22 +8,6 @@
8 8
9/* No more #include "asm/arch/kmap_types.h" ! */ 9/* No more #include "asm/arch/kmap_types.h" ! */
10 10
11enum km_type { 11#define KM_TYPE_NR 14
12 KM_BOUNCE_READ,
13 KM_SKB_SUNRPC_DATA,
14 KM_SKB_DATA_SOFTIRQ,
15 KM_USER0,
16 KM_USER1,
17 KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */
18 KM_BIO_SRC_IRQ,
19 KM_BIO_DST_IRQ,
20 KM_PTE0,
21 KM_PTE1,
22 KM_IRQ0,
23 KM_IRQ1,
24 KM_SOFTIRQ0,
25 KM_SOFTIRQ1,
26 KM_TYPE_NR
27};
28 12
29#endif 13#endif
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 216f4299f65e..af5280fb579b 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -349,12 +349,12 @@ static void jbd2_block_tag_csum_set(journal_t *j, journal_block_tag_t *tag,
349 return; 349 return;
350 350
351 sequence = cpu_to_be32(sequence); 351 sequence = cpu_to_be32(sequence);
352 addr = kmap_atomic(page, KM_USER0); 352 addr = kmap_atomic(page);
353 csum = jbd2_chksum(j, j->j_csum_seed, (__u8 *)&sequence, 353 csum = jbd2_chksum(j, j->j_csum_seed, (__u8 *)&sequence,
354 sizeof(sequence)); 354 sizeof(sequence));
355 csum = jbd2_chksum(j, csum, addr + offset_in_page(bh->b_data), 355 csum = jbd2_chksum(j, csum, addr + offset_in_page(bh->b_data),
356 bh->b_size); 356 bh->b_size);
357 kunmap_atomic(addr, KM_USER0); 357 kunmap_atomic(addr);
358 358
359 tag->t_checksum = cpu_to_be32(csum); 359 tag->t_checksum = cpu_to_be32(csum);
360} 360}
diff --git a/fs/pipe.c b/fs/pipe.c
index 49c1065256fd..95cbd6b227e6 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -224,7 +224,7 @@ static void anon_pipe_buf_release(struct pipe_inode_info *pipe,
224 * and the caller has to be careful not to fault before calling 224 * and the caller has to be careful not to fault before calling
225 * the unmap function. 225 * the unmap function.
226 * 226 *
227 * Note that this function occupies KM_USER0 if @atomic != 0. 227 * Note that this function calls kmap_atomic() if @atomic != 0.
228 */ 228 */
229void *generic_pipe_buf_map(struct pipe_inode_info *pipe, 229void *generic_pipe_buf_map(struct pipe_inode_info *pipe,
230 struct pipe_buffer *buf, int atomic) 230 struct pipe_buffer *buf, int atomic)
diff --git a/include/asm-generic/kmap_types.h b/include/asm-generic/kmap_types.h
index 0232ccb76f2b..90f99c74dd38 100644
--- a/include/asm-generic/kmap_types.h
+++ b/include/asm-generic/kmap_types.h
@@ -2,39 +2,9 @@
2#define _ASM_GENERIC_KMAP_TYPES_H 2#define _ASM_GENERIC_KMAP_TYPES_H
3 3
4#ifdef __WITH_KM_FENCE 4#ifdef __WITH_KM_FENCE
5# define KMAP_D(n) __KM_FENCE_##n , 5# define KM_TYPE_NR 41
6#else 6#else
7# define KMAP_D(n) 7# define KM_TYPE_NR 20
8#endif 8#endif
9 9
10enum km_type {
11KMAP_D(0) KM_BOUNCE_READ,
12KMAP_D(1) KM_SKB_SUNRPC_DATA,
13KMAP_D(2) KM_SKB_DATA_SOFTIRQ,
14KMAP_D(3) KM_USER0,
15KMAP_D(4) KM_USER1,
16KMAP_D(5) KM_BIO_SRC_IRQ,
17KMAP_D(6) KM_BIO_DST_IRQ,
18KMAP_D(7) KM_PTE0,
19KMAP_D(8) KM_PTE1,
20KMAP_D(9) KM_IRQ0,
21KMAP_D(10) KM_IRQ1,
22KMAP_D(11) KM_SOFTIRQ0,
23KMAP_D(12) KM_SOFTIRQ1,
24KMAP_D(13) KM_SYNC_ICACHE,
25KMAP_D(14) KM_SYNC_DCACHE,
26/* UML specific, for copy_*_user - used in do_op_one_page */
27KMAP_D(15) KM_UML_USERCOPY,
28KMAP_D(16) KM_IRQ_PTE,
29KMAP_D(17) KM_NMI,
30KMAP_D(18) KM_NMI_PTE,
31KMAP_D(19) KM_KDB,
32/*
33 * Remember to update debug_kmap_atomic() when adding new kmap types!
34 */
35KMAP_D(20) KM_TYPE_NR
36};
37
38#undef KMAP_D
39
40#endif 10#endif
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index d3999b4e26cc..774fa47b3b5b 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -110,54 +110,15 @@ static inline void kmap_atomic_idx_pop(void)
110#endif 110#endif
111 111
112/* 112/*
113 * NOTE:
114 * kmap_atomic() and kunmap_atomic() with two arguments are deprecated.
115 * We only keep them for backward compatibility, any usage of them
116 * are now warned.
117 */
118
119#define PASTE(a, b) a ## b
120#define PASTE2(a, b) PASTE(a, b)
121
122#define NARG_(_2, _1, n, ...) n
123#define NARG(...) NARG_(__VA_ARGS__, 2, 1, :)
124
125static inline void __deprecated *kmap_atomic_deprecated(struct page *page,
126 enum km_type km)
127{
128 return kmap_atomic(page);
129}
130
131#define kmap_atomic1(...) kmap_atomic(__VA_ARGS__)
132#define kmap_atomic2(...) kmap_atomic_deprecated(__VA_ARGS__)
133#define kmap_atomic(...) PASTE2(kmap_atomic, NARG(__VA_ARGS__)(__VA_ARGS__))
134
135static inline void __deprecated __kunmap_atomic_deprecated(void *addr,
136 enum km_type km)
137{
138 __kunmap_atomic(addr);
139}
140
141/*
142 * Prevent people trying to call kunmap_atomic() as if it were kunmap() 113 * Prevent people trying to call kunmap_atomic() as if it were kunmap()
143 * kunmap_atomic() should get the return value of kmap_atomic, not the page. 114 * kunmap_atomic() should get the return value of kmap_atomic, not the page.
144 */ 115 */
145#define kunmap_atomic_deprecated(addr, km) \ 116#define kunmap_atomic(addr) \
146do { \
147 BUILD_BUG_ON(__same_type((addr), struct page *)); \
148 __kunmap_atomic_deprecated(addr, km); \
149} while (0)
150
151#define kunmap_atomic_withcheck(addr) \
152do { \ 117do { \
153 BUILD_BUG_ON(__same_type((addr), struct page *)); \ 118 BUILD_BUG_ON(__same_type((addr), struct page *)); \
154 __kunmap_atomic(addr); \ 119 __kunmap_atomic(addr); \
155} while (0) 120} while (0)
156 121
157#define kunmap_atomic1(...) kunmap_atomic_withcheck(__VA_ARGS__)
158#define kunmap_atomic2(...) kunmap_atomic_deprecated(__VA_ARGS__)
159#define kunmap_atomic(...) PASTE2(kunmap_atomic, NARG(__VA_ARGS__)(__VA_ARGS__))
160/**** End of C pre-processor tricks for deprecated macros ****/
161 122
162/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ 123/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */
163#ifndef clear_user_highpage 124#ifndef clear_user_highpage
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index e1ac1ce16fb0..e11d1c0fc60f 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -86,11 +86,9 @@ struct pipe_buf_operations {
86 * mapping or not. The atomic map is faster, however you can't take 86 * mapping or not. The atomic map is faster, however you can't take
87 * page faults before calling ->unmap() again. So if you need to eg 87 * page faults before calling ->unmap() again. So if you need to eg
88 * access user data through copy_to/from_user(), then you must get 88 * access user data through copy_to/from_user(), then you must get
89 * a non-atomic map. ->map() uses the KM_USER0 atomic slot for 89 * a non-atomic map. ->map() uses the kmap_atomic slot for
90 * atomic maps, so you can't map more than one pipe_buffer at once 90 * atomic maps, you have to be careful if mapping another page as
91 * and you have to be careful if mapping another page as source 91 * source or destination for a copy.
92 * or destination for a copy (IOW, it has to use something else
93 * than KM_USER0).
94 */ 92 */
95 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); 93 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int);
96 94
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 2aad49981b57..c7ac8e1b3ac7 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1975,9 +1975,7 @@ static int aligned_vwrite(char *buf, char *addr, unsigned long count)
1975 * IOREMAP area is treated as memory hole and no copy is done. 1975 * IOREMAP area is treated as memory hole and no copy is done.
1976 * 1976 *
1977 * If [addr...addr+count) doesn't includes any intersects with alive 1977 * If [addr...addr+count) doesn't includes any intersects with alive
1978 * vm_struct area, returns 0. 1978 * vm_struct area, returns 0. @buf should be kernel's buffer.
1979 * @buf should be kernel's buffer. Because this function uses KM_USER0,
1980 * the caller should guarantee KM_USER0 is not used.
1981 * 1979 *
1982 * Note: In usual ops, vread() is never necessary because the caller 1980 * Note: In usual ops, vread() is never necessary because the caller
1983 * should know vmalloc() area is valid and can use memcpy(). 1981 * should know vmalloc() area is valid and can use memcpy().
@@ -2051,9 +2049,7 @@ finished:
2051 * IOREMAP area is treated as memory hole and no copy is done. 2049 * IOREMAP area is treated as memory hole and no copy is done.
2052 * 2050 *
2053 * If [addr...addr+count) doesn't includes any intersects with alive 2051 * If [addr...addr+count) doesn't includes any intersects with alive
2054 * vm_struct area, returns 0. 2052 * vm_struct area, returns 0. @buf should be kernel's buffer.
2055 * @buf should be kernel's buffer. Because this function uses KM_USER0,
2056 * the caller should guarantee KM_USER0 is not used.
2057 * 2053 *
2058 * Note: In usual ops, vwrite() is never necessary because the caller 2054 * Note: In usual ops, vwrite() is never necessary because the caller
2059 * should know vmalloc() area is valid and can use memcpy(). 2055 * should know vmalloc() area is valid and can use memcpy().