aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-27 14:26:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-27 14:26:48 -0400
commit84eda28060f7e7d5f91f81f928532af13b9e44b2 (patch)
treef0b7feeca9b6a21a43f279fb3b566eef1c16584d /include/linux
parentb387e41e523c1aa347cff055455d0dd129357df4 (diff)
parent2164d3344693d2d4799fe91836d61f55516cbdf0 (diff)
Merge branch 'kmap_atomic' of git://github.com/congwang/linux
Pull final kmap_atomic cleanups from Cong Wang: "This should be the final round of cleanup, as the definitions of enum km_type finally get removed from the whole tree. The patches have been in linux-next for a long time." * 'kmap_atomic' of git://github.com/congwang/linux: pipe: remove KM_USER0 from comments vmalloc: remove KM_USER0 from comments feature-removal-schedule.txt: remove kmap_atomic(page, km_type) tile: remove km_type definitions um: remove km_type definitions asm-generic: remove km_type definitions avr32: remove km_type definitions frv: remove km_type definitions powerpc: remove km_type definitions arm: remove km_type definitions highmem: remove the deprecated form of kmap_atomic tile: remove usage of enum km_type frv: remove the second parameter of kmap_atomic_primary() jbd2: remove the second argument of kmap_atomic
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/highmem.h41
-rw-r--r--include/linux/pipe_fs_i.h8
2 files changed, 4 insertions, 45 deletions
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