Skip to content
Permalink
Browse files
mm/highmem: Remove deprecated kmap_atomic
kmap_atomic() is being deprecated in favor of kmap_local_page().

Replace the uses of kmap_atomic() within the highmem code.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
  • Loading branch information
weiny2 authored and intel-lab-lkp committed Dec 10, 2020
1 parent 65cdb4a commit d52646012878888c6a3172a07cd8bdf3d0c39723
Showing 1 changed file with 14 additions and 14 deletions.
@@ -226,9 +226,9 @@ do { \
#ifndef clear_user_highpage
static inline void clear_user_highpage(struct page *page, unsigned long vaddr)
{
void *addr = kmap_atomic(page);
void *addr = kmap_local_page(page);
clear_user_page(addr, vaddr, page);
kunmap_atomic(addr);
kunmap_local(addr);
}
#endif

@@ -279,16 +279,16 @@ alloc_zeroed_user_highpage_movable(struct vm_area_struct *vma,

static inline void clear_highpage(struct page *page)
{
void *kaddr = kmap_atomic(page);
void *kaddr = kmap_local_page(page);
clear_page(kaddr);
kunmap_atomic(kaddr);
kunmap_local(kaddr);
}

static inline void zero_user_segments(struct page *page,
unsigned start1, unsigned end1,
unsigned start2, unsigned end2)
{
void *kaddr = kmap_atomic(page);
void *kaddr = kmap_local_page(page);

BUG_ON(end1 > PAGE_SIZE || end2 > PAGE_SIZE);

@@ -298,7 +298,7 @@ static inline void zero_user_segments(struct page *page,
if (end2 > start2)
memset(kaddr + start2, 0, end2 - start2);

kunmap_atomic(kaddr);
kunmap_local(kaddr);
flush_dcache_page(page);
}

@@ -321,11 +321,11 @@ static inline void copy_user_highpage(struct page *to, struct page *from,
{
char *vfrom, *vto;

vfrom = kmap_atomic(from);
vto = kmap_atomic(to);
vfrom = kmap_local_page(from);
vto = kmap_local_page(to);
copy_user_page(vto, vfrom, vaddr, to);
kunmap_atomic(vto);
kunmap_atomic(vfrom);
kunmap_local(vto);
kunmap_local(vfrom);
}

#endif
@@ -336,11 +336,11 @@ static inline void copy_highpage(struct page *to, struct page *from)
{
char *vfrom, *vto;

vfrom = kmap_atomic(from);
vto = kmap_atomic(to);
vfrom = kmap_local_page(from);
vto = kmap_local_page(to);
copy_page(vto, vfrom);
kunmap_atomic(vto);
kunmap_atomic(vfrom);
kunmap_local(vto);
kunmap_local(vfrom);
}

#endif

0 comments on commit d526460

Please sign in to comment.