diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2006-12-06 23:32:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:21 -0500 |
commit | ad76fb6b5a5183255279e0ab5260715481770678 (patch) | |
tree | 31034294d70f5fc3d6166a76fe9b7f8cd19db0fd /include/linux | |
parent | a866374aecc90c7d90619727ccd851ac096b2fc7 (diff) |
[PATCH] mm: k{,um}map_atomic() vs in_atomic()
Make kmap_atomic/kunmap_atomic denote a pagefault disabled scope. All non
trivial implementations already do this anyway.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/highmem.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index fd7d12daa94f..3d8768b619e9 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
5 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
6 | #include <linux/uaccess.h> | ||
6 | 7 | ||
7 | #include <asm/cacheflush.h> | 8 | #include <asm/cacheflush.h> |
8 | 9 | ||
@@ -41,9 +42,10 @@ static inline void *kmap(struct page *page) | |||
41 | 42 | ||
42 | #define kunmap(page) do { (void) (page); } while (0) | 43 | #define kunmap(page) do { (void) (page); } while (0) |
43 | 44 | ||
44 | #define kmap_atomic(page, idx) page_address(page) | 45 | #define kmap_atomic(page, idx) \ |
45 | #define kunmap_atomic(addr, idx) do { } while (0) | 46 | ({ pagefault_disable(); page_address(page); }) |
46 | #define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn)) | 47 | #define kunmap_atomic(addr, idx) do { pagefault_enable(); } while (0) |
48 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) | ||
47 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) | 49 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) |
48 | #endif | 50 | #endif |
49 | 51 | ||