Skip to content

Commit

Permalink
Merge branch 'kmap_atomic' of git://github.com/congwang/linux
Browse files Browse the repository at this point in the history
Pull kmap_atomic cleanup from Cong Wang.

It's been in -next for a long time, and it gets rid of the (no longer
used) second argument to k[un]map_atomic().

Fix up a few trivial conflicts in various drivers, and do an "evil
merge" to catch some new uses that have come in since Cong's tree.

* 'kmap_atomic' of git://github.com/congwang/linux: (59 commits)
  feature-removal-schedule.txt: schedule the deprecated form of kmap_atomic() for removal
  highmem: kill all __kmap_atomic() [[email protected]: highmem: Fix ARM build break due to __kmap_atomic rename]
  drbd: remove the second argument of k[un]map_atomic()
  zcache: remove the second argument of k[un]map_atomic()
  gma500: remove the second argument of k[un]map_atomic()
  dm: remove the second argument of k[un]map_atomic()
  tomoyo: remove the second argument of k[un]map_atomic()
  sunrpc: remove the second argument of k[un]map_atomic()
  rds: remove the second argument of k[un]map_atomic()
  net: remove the second argument of k[un]map_atomic()
  mm: remove the second argument of k[un]map_atomic()
  lib: remove the second argument of k[un]map_atomic()
  power: remove the second argument of k[un]map_atomic()
  kdb: remove the second argument of k[un]map_atomic()
  udf: remove the second argument of k[un]map_atomic()
  ubifs: remove the second argument of k[un]map_atomic()
  squashfs: remove the second argument of k[un]map_atomic()
  reiserfs: remove the second argument of k[un]map_atomic()
  ocfs2: remove the second argument of k[un]map_atomic()
  ntfs: remove the second argument of k[un]map_atomic()
  ...
  • Loading branch information
torvalds committed Mar 21, 2012
2 parents 69a7aeb + 317b6e1 commit 9f39383
Show file tree
Hide file tree
Showing 180 changed files with 921 additions and 969 deletions.
8 changes: 8 additions & 0 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -535,3 +535,11 @@ Why: This driver provides support for USB storage devices like "USB
(CONFIG_USB_STORAGE) which only drawback is the additional SCSI
stack.
Who: Sebastian Andrzej Siewior <[email protected]>

----------------------------

What: kmap_atomic(page, km_type)
When: 3.5
Why: The old kmap_atomic() with two arguments is deprecated, we only
keep it for backward compatibility for few cycles and then drop it.
Who: Cong Wang <[email protected]>
2 changes: 1 addition & 1 deletion arch/arm/include/asm/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static inline void *kmap_high_get(struct page *page)
#ifdef CONFIG_HIGHMEM
extern void *kmap(struct page *page);
extern void kunmap(struct page *page);
extern void *__kmap_atomic(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern void *kmap_atomic_pfn(unsigned long pfn);
extern struct page *kmap_atomic_to_page(const void *ptr);
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mm/copypage-fa.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ void fa_copy_user_highpage(struct page *to, struct page *from,
{
void *kto, *kfrom;

kto = kmap_atomic(to, KM_USER0);
kfrom = kmap_atomic(from, KM_USER1);
kto = kmap_atomic(to);
kfrom = kmap_atomic(from);
fa_copy_user_page(kto, kfrom);
kunmap_atomic(kfrom, KM_USER1);
kunmap_atomic(kto, KM_USER0);
kunmap_atomic(kfrom);
kunmap_atomic(kto);
}

/*
Expand All @@ -58,7 +58,7 @@ void fa_copy_user_highpage(struct page *to, struct page *from,
*/
void fa_clear_user_highpage(struct page *page, unsigned long vaddr)
{
void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
void *ptr, *kaddr = kmap_atomic(page);
asm volatile("\
mov r1, %2 @ 1\n\
mov r2, #0 @ 1\n\
Expand All @@ -77,7 +77,7 @@ void fa_clear_user_highpage(struct page *page, unsigned long vaddr)
: "=r" (ptr)
: "0" (kaddr), "I" (PAGE_SIZE / 32)
: "r1", "r2", "r3", "ip", "lr");
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr);
}

struct cpu_user_fns fa_user_fns __initdata = {
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mm/copypage-feroceon.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ void feroceon_copy_user_highpage(struct page *to, struct page *from,
{
void *kto, *kfrom;

kto = kmap_atomic(to, KM_USER0);
kfrom = kmap_atomic(from, KM_USER1);
kto = kmap_atomic(to);
kfrom = kmap_atomic(from);
flush_cache_page(vma, vaddr, page_to_pfn(from));
feroceon_copy_user_page(kto, kfrom);
kunmap_atomic(kfrom, KM_USER1);
kunmap_atomic(kto, KM_USER0);
kunmap_atomic(kfrom);
kunmap_atomic(kto);
}

void feroceon_clear_user_highpage(struct page *page, unsigned long vaddr)
{
void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
void *ptr, *kaddr = kmap_atomic(page);
asm volatile ("\
mov r1, %2 \n\
mov r2, #0 \n\
Expand All @@ -102,7 +102,7 @@ void feroceon_clear_user_highpage(struct page *page, unsigned long vaddr)
: "=r" (ptr)
: "0" (kaddr), "I" (PAGE_SIZE / 32)
: "r1", "r2", "r3", "r4", "r5", "r6", "r7", "ip", "lr");
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr);
}

struct cpu_user_fns feroceon_user_fns __initdata = {
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mm/copypage-v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ void v3_copy_user_highpage(struct page *to, struct page *from,
{
void *kto, *kfrom;

kto = kmap_atomic(to, KM_USER0);
kfrom = kmap_atomic(from, KM_USER1);
kto = kmap_atomic(to);
kfrom = kmap_atomic(from);
v3_copy_user_page(kto, kfrom);
kunmap_atomic(kfrom, KM_USER1);
kunmap_atomic(kto, KM_USER0);
kunmap_atomic(kfrom);
kunmap_atomic(kto);
}

/*
Expand All @@ -56,7 +56,7 @@ void v3_copy_user_highpage(struct page *to, struct page *from,
*/
void v3_clear_user_highpage(struct page *page, unsigned long vaddr)
{
void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
void *ptr, *kaddr = kmap_atomic(page);
asm volatile("\n\
mov r1, %2 @ 1\n\
mov r2, #0 @ 1\n\
Expand All @@ -72,7 +72,7 @@ void v3_clear_user_highpage(struct page *page, unsigned long vaddr)
: "=r" (ptr)
: "0" (kaddr), "I" (PAGE_SIZE / 64)
: "r1", "r2", "r3", "ip", "lr");
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr);
}

struct cpu_user_fns v3_user_fns __initdata = {
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mm/copypage-v4mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ mc_copy_user_page(void *from, void *to)
void v4_mc_copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma)
{
void *kto = kmap_atomic(to, KM_USER1);
void *kto = kmap_atomic(to);

if (!test_and_set_bit(PG_dcache_clean, &from->flags))
__flush_dcache_page(page_mapping(from), from);
Expand All @@ -85,15 +85,15 @@ void v4_mc_copy_user_highpage(struct page *to, struct page *from,

raw_spin_unlock(&minicache_lock);

kunmap_atomic(kto, KM_USER1);
kunmap_atomic(kto);
}

/*
* ARMv4 optimised clear_user_page
*/
void v4_mc_clear_user_highpage(struct page *page, unsigned long vaddr)
{
void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
void *ptr, *kaddr = kmap_atomic(page);
asm volatile("\
mov r1, %2 @ 1\n\
mov r2, #0 @ 1\n\
Expand All @@ -111,7 +111,7 @@ void v4_mc_clear_user_highpage(struct page *page, unsigned long vaddr)
: "=r" (ptr)
: "0" (kaddr), "I" (PAGE_SIZE / 64)
: "r1", "r2", "r3", "ip", "lr");
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr);
}

struct cpu_user_fns v4_mc_user_fns __initdata = {
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mm/copypage-v4wb.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ void v4wb_copy_user_highpage(struct page *to, struct page *from,
{
void *kto, *kfrom;

kto = kmap_atomic(to, KM_USER0);
kfrom = kmap_atomic(from, KM_USER1);
kto = kmap_atomic(to);
kfrom = kmap_atomic(from);
flush_cache_page(vma, vaddr, page_to_pfn(from));
v4wb_copy_user_page(kto, kfrom);
kunmap_atomic(kfrom, KM_USER1);
kunmap_atomic(kto, KM_USER0);
kunmap_atomic(kfrom);
kunmap_atomic(kto);
}

/*
Expand All @@ -67,7 +67,7 @@ void v4wb_copy_user_highpage(struct page *to, struct page *from,
*/
void v4wb_clear_user_highpage(struct page *page, unsigned long vaddr)
{
void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
void *ptr, *kaddr = kmap_atomic(page);
asm volatile("\
mov r1, %2 @ 1\n\
mov r2, #0 @ 1\n\
Expand All @@ -86,7 +86,7 @@ void v4wb_clear_user_highpage(struct page *page, unsigned long vaddr)
: "=r" (ptr)
: "0" (kaddr), "I" (PAGE_SIZE / 64)
: "r1", "r2", "r3", "ip", "lr");
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr);
}

struct cpu_user_fns v4wb_user_fns __initdata = {
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mm/copypage-v4wt.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ void v4wt_copy_user_highpage(struct page *to, struct page *from,
{
void *kto, *kfrom;

kto = kmap_atomic(to, KM_USER0);
kfrom = kmap_atomic(from, KM_USER1);
kto = kmap_atomic(to);
kfrom = kmap_atomic(from);
v4wt_copy_user_page(kto, kfrom);
kunmap_atomic(kfrom, KM_USER1);
kunmap_atomic(kto, KM_USER0);
kunmap_atomic(kfrom);
kunmap_atomic(kto);
}

/*
Expand All @@ -62,7 +62,7 @@ void v4wt_copy_user_highpage(struct page *to, struct page *from,
*/
void v4wt_clear_user_highpage(struct page *page, unsigned long vaddr)
{
void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
void *ptr, *kaddr = kmap_atomic(page);
asm volatile("\
mov r1, %2 @ 1\n\
mov r2, #0 @ 1\n\
Expand All @@ -79,7 +79,7 @@ void v4wt_clear_user_highpage(struct page *page, unsigned long vaddr)
: "=r" (ptr)
: "0" (kaddr), "I" (PAGE_SIZE / 64)
: "r1", "r2", "r3", "ip", "lr");
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr);
}

struct cpu_user_fns v4wt_user_fns __initdata = {
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mm/copypage-v6.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ static void v6_copy_user_highpage_nonaliasing(struct page *to,
{
void *kto, *kfrom;

kfrom = kmap_atomic(from, KM_USER0);
kto = kmap_atomic(to, KM_USER1);
kfrom = kmap_atomic(from);
kto = kmap_atomic(to);
copy_page(kto, kfrom);
kunmap_atomic(kto, KM_USER1);
kunmap_atomic(kfrom, KM_USER0);
kunmap_atomic(kto);
kunmap_atomic(kfrom);
}

/*
Expand All @@ -51,9 +51,9 @@ static void v6_copy_user_highpage_nonaliasing(struct page *to,
*/
static void v6_clear_user_highpage_nonaliasing(struct page *page, unsigned long vaddr)
{
void *kaddr = kmap_atomic(page, KM_USER0);
void *kaddr = kmap_atomic(page);
clear_page(kaddr);
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr);
}

/*
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mm/copypage-xsc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
{
void *kto, *kfrom;

kto = kmap_atomic(to, KM_USER0);
kfrom = kmap_atomic(from, KM_USER1);
kto = kmap_atomic(to);
kfrom = kmap_atomic(from);
flush_cache_page(vma, vaddr, page_to_pfn(from));
xsc3_mc_copy_user_page(kto, kfrom);
kunmap_atomic(kfrom, KM_USER1);
kunmap_atomic(kto, KM_USER0);
kunmap_atomic(kfrom);
kunmap_atomic(kto);
}

/*
Expand All @@ -90,7 +90,7 @@ void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
*/
void xsc3_mc_clear_user_highpage(struct page *page, unsigned long vaddr)
{
void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
void *ptr, *kaddr = kmap_atomic(page);
asm volatile ("\
mov r1, %2 \n\
mov r2, #0 \n\
Expand All @@ -105,7 +105,7 @@ void xsc3_mc_clear_user_highpage(struct page *page, unsigned long vaddr)
: "=r" (ptr)
: "0" (kaddr), "I" (PAGE_SIZE / 32)
: "r1", "r2", "r3");
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr);
}

struct cpu_user_fns xsc3_mc_user_fns __initdata = {
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mm/copypage-xscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ mc_copy_user_page(void *from, void *to)
void xscale_mc_copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma)
{
void *kto = kmap_atomic(to, KM_USER1);
void *kto = kmap_atomic(to);

if (!test_and_set_bit(PG_dcache_clean, &from->flags))
__flush_dcache_page(page_mapping(from), from);
Expand All @@ -107,7 +107,7 @@ void xscale_mc_copy_user_highpage(struct page *to, struct page *from,

raw_spin_unlock(&minicache_lock);

kunmap_atomic(kto, KM_USER1);
kunmap_atomic(kto);
}

/*
Expand All @@ -116,7 +116,7 @@ void xscale_mc_copy_user_highpage(struct page *to, struct page *from,
void
xscale_mc_clear_user_highpage(struct page *page, unsigned long vaddr)
{
void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
void *ptr, *kaddr = kmap_atomic(page);
asm volatile(
"mov r1, %2 \n\
mov r2, #0 \n\
Expand All @@ -133,7 +133,7 @@ xscale_mc_clear_user_highpage(struct page *page, unsigned long vaddr)
: "=r" (ptr)
: "0" (kaddr), "I" (PAGE_SIZE / 32)
: "r1", "r2", "r3", "ip");
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr);
}

struct cpu_user_fns xscale_mc_user_fns __initdata = {
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void kunmap(struct page *page)
}
EXPORT_SYMBOL(kunmap);

void *__kmap_atomic(struct page *page)
void *kmap_atomic(struct page *page)
{
unsigned int idx;
unsigned long vaddr;
Expand Down Expand Up @@ -81,7 +81,7 @@ void *__kmap_atomic(struct page *page)

return (void *)vaddr;
}
EXPORT_SYMBOL(__kmap_atomic);
EXPORT_SYMBOL(kmap_atomic);

void __kunmap_atomic(void *kvaddr)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/frv/include/asm/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static inline void kunmap_atomic_primary(void *kvaddr, enum km_type type)
pagefault_enable();
}

void *__kmap_atomic(struct page *page);
void *kmap_atomic(struct page *page);
void __kunmap_atomic(void *kvaddr);

#endif /* !__ASSEMBLY__ */
Expand Down
4 changes: 2 additions & 2 deletions arch/frv/mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct page *kmap_atomic_to_page(void *ptr)
return virt_to_page(ptr);
}

void *__kmap_atomic(struct page *page)
void *kmap_atomic(struct page *page)
{
unsigned long paddr;
int type;
Expand All @@ -64,7 +64,7 @@ void *__kmap_atomic(struct page *page)
return NULL;
}
}
EXPORT_SYMBOL(__kmap_atomic);
EXPORT_SYMBOL(kmap_atomic);

void __kunmap_atomic(void *kvaddr)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/include/asm/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern void kunmap_high(struct page *page);

extern void *kmap(struct page *page);
extern void kunmap(struct page *page);
extern void *__kmap_atomic(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern void *kmap_atomic_pfn(unsigned long pfn);
extern struct page *kmap_atomic_to_page(void *ptr);
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/mm/c-r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ static inline void local_r4k_flush_cache_page(void *args)
if (map_coherent)
vaddr = kmap_coherent(page, addr);
else
vaddr = kmap_atomic(page, KM_USER0);
vaddr = kmap_atomic(page);
addr = (unsigned long)vaddr;
}

Expand All @@ -521,7 +521,7 @@ static inline void local_r4k_flush_cache_page(void *args)
if (map_coherent)
kunmap_coherent();
else
kunmap_atomic(vaddr, KM_USER0);
kunmap_atomic(vaddr);
}
}

Expand Down
Loading

0 comments on commit 9f39383

Please sign in to comment.