OpenCloudOS-Kernel/arch/powerpc/platforms/cell
Kirill A. Shutemov 09cbfeaf1a mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
ago with promise that one day it will be possible to implement page
cache with bigger chunks than PAGE_SIZE.

This promise never materialized.  And unlikely will.

We have many places where PAGE_CACHE_SIZE assumed to be equal to
PAGE_SIZE.  And it's constant source of confusion on whether
PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
especially on the border between fs and mm.

Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
breakage to be doable.

Let's stop pretending that pages in page cache are special.  They are
not.

The changes are pretty straight-forward:

 - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;

 - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;

 - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};

 - page_cache_get() -> get_page();

 - page_cache_release() -> put_page();

This patch contains automated changes generated with coccinelle using
script below.  For some reason, coccinelle doesn't patch header files.
I've called spatch for them manually.

The only adjustment after coccinelle is revert of changes to
PAGE_CAHCE_ALIGN definition: we are going to drop it later.

There are few places in the code where coccinelle didn't reach.  I'll
fix them manually in a separate patch.  Comments and documentation also
will be addressed with the separate patch.

virtual patch

@@
expression E;
@@
- E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E

@@
expression E;
@@
- E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E

@@
@@
- PAGE_CACHE_SHIFT
+ PAGE_SHIFT

@@
@@
- PAGE_CACHE_SIZE
+ PAGE_SIZE

@@
@@
- PAGE_CACHE_MASK
+ PAGE_MASK

@@
expression E;
@@
- PAGE_CACHE_ALIGN(E)
+ PAGE_ALIGN(E)

@@
expression E;
@@
- page_cache_get(E)
+ get_page(E)

@@
expression E;
@@
- page_cache_release(E)
+ put_page(E)

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-04-04 10:41:08 -07:00
..
spufs mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
Kconfig powerpc/cell: Remove the Cell QPACE code 2015-12-14 20:41:50 +11:00
Makefile powerpc/cell: Remove the Cell QPACE code 2015-12-14 20:41:50 +11:00
axon_msi.c irqdomain: Use irq_domain_get_of_node() instead of direct field access 2015-10-13 19:01:23 +02:00
cbe_powerbutton.c powerpc: Fix up modules that should be including module.h 2011-10-31 19:30:38 -04:00
cbe_regs.c powerpc: various straight conversions from module.h --> export.h 2011-10-31 19:30:44 -04:00
cbe_thermal.c powerpc/cell: cbe_thermal.c: Cleaning up a variable is of the wrong type 2014-06-24 14:05:59 +10:00
cell.h powerpc/cell: Move controller ops from ppc_md to controller_ops 2015-04-11 20:49:17 +10:00
cpufreq_spudemand.c workqueue: make deferrable delayed_work initializer names consistent 2012-08-21 13:18:23 -07:00
interrupt.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
interrupt.h powerpc/cell: Rename ipi functions to match current abstractions 2011-05-26 13:38:58 +10:00
iommu.c powerpc/iommu: Move tce_xxx callbacks from ppc_md to iommu_table 2015-06-11 15:14:56 +10:00
pervasive.c powerpc: More fixes for lazy IRQ vs. idle 2012-07-10 19:16:07 +10:00
pervasive.h powerpc/cell: Cleanup sysreset_hack for IBM cell blades 2008-07-22 10:39:31 +10:00
pmu.c powerpc/cell: Only iterate over online nodes in cbe_init_pm_irq() 2013-04-24 14:22:30 +10:00
ras.c mm: rename alloc_pages_exact_node() to __alloc_pages_node() 2015-09-08 15:35:28 -07:00
ras.h
setup.c powerpc/cell: Fix iommu breakage caused by controller_ops change 2015-04-14 17:13:31 +10:00
smp.c powerpc: Drop return value of smp_ops->probe() 2015-04-10 20:02:49 +10:00
spider-pci.c powerpc/pci: Move IO workarounds to the common kernel dir 2011-04-27 14:18:29 +10:00
spider-pic.c irqdomain: Use irq_domain_get_of_node() instead of direct field access 2015-10-13 19:01:23 +02:00
spu_base.c powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault 2014-12-05 16:26:15 +11:00
spu_callbacks.c powerpc: Add a proper syscall for switching endianness 2015-03-28 22:03:40 +11:00
spu_manage.c of/irq: simplify args to irq_create_of_mapping 2013-10-24 11:42:57 +01:00
spu_notify.c powerpc: fix implicit notifier use in converting to export.h 2011-10-31 19:30:41 -04:00
spu_priv1_mmio.c powerpc: remove non-required uses of include <linux/module.h> 2011-10-31 19:30:44 -04:00
spu_priv1_mmio.h
spu_syscalls.c powerpc/cell: Fix compilation with CONFIG_COREDUMP=n 2014-07-11 12:55:05 +10:00