1
0
Fork 0
alistair23-linux/arch/arm
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
..
boot ARM: DT changes, part 2 2016-03-24 19:01:38 -07:00
common Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2016-03-19 16:31:54 -07:00
configs ARM: SoC defconfig updates for v4.6 2016-03-20 15:32:14 -07:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-03-17 11:22:54 -07:00
firmware
include arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections 2016-03-25 16:37:42 -07:00
kernel arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections 2016-03-25 16:37:42 -07:00
kvm KVM: arm/arm64: disable preemption when calling smp_call_function_many 2016-03-21 10:45:22 +01:00
lib
mach-alpine ARM: alpine: select the Alpine MSI controller driver 2016-02-26 22:57:22 +01:00
mach-artpec arm: initial machine port for artpec-6 SoC 2016-02-24 13:55:47 -08:00
mach-asm9260
mach-at91 ARM: at91: remove useless includes and function prototypes 2016-02-17 17:53:02 +01:00
mach-axxia
mach-bcm
mach-berlin
mach-clps711x
mach-cns3xxx ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-davinci ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
mach-digicolor
mach-dove ARM: orion: only select I2C_BOARDINFO when using I2C 2016-02-25 15:37:16 +01:00
mach-ebsa110
mach-efm32
mach-ep93xx
mach-exynos ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
mach-footbridge ARM: 8530/1: remove VIRT_TO_BUS 2016-02-22 16:55:42 +00:00
mach-gemini ARM: gemini: switch to gpiochip_add_data() 2016-02-19 09:51:41 +01:00
mach-highbank
mach-hisi
mach-imx ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx This is the bulk of GPIO changes for kernel v4.6: 2016-03-17 21:05:32 -07:00
mach-keystone ARM: DT updates for v4.6 2016-03-20 15:15:48 -07:00
mach-ks8695 ARM: SoC non-urgent fixes for v4.6 2016-03-20 14:26:57 -07:00
mach-lpc18xx
mach-lpc32xx ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-mediatek ARM: DT updates for v4.6 2016-03-20 15:15:48 -07:00
mach-meson
mach-mmp
mach-moxart
mach-mv78xx0 ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-mvebu The clk changes for this release cycle are mostly dominated by 2016-03-23 06:06:45 -07:00
mach-mxs
mach-netx ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-nomadik
mach-nspire ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-omap1 ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
mach-omap2 ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
mach-orion5x ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-picoxcell
mach-prima2 ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-pxa ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
mach-qcom
mach-realview
mach-rockchip
mach-rpc ARM: 8532/1: uncompress: mark putc as inline 2016-02-22 16:55:42 +00:00
mach-s3c24xx ARM: SoC 64-bit changes for v4.6 2016-03-20 15:08:45 -07:00
mach-s3c64xx ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
mach-s5pv210
mach-sa1100 Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2016-03-19 16:31:54 -07:00
mach-shmobile The clk changes for this release cycle are mostly dominated by 2016-03-23 06:06:45 -07:00
mach-socfpga ARM: SoC non-urgent fixes for v4.6 2016-03-20 14:26:57 -07:00
mach-spear
mach-sti
mach-stm32 ARM: stm32: Identify a new SoC - STM32F469 2016-02-17 17:30:44 +01:00
mach-sunxi
mach-tango
mach-tegra Here's another round of updates for -next: 2016-03-01 17:03:27 -05:00
mach-u300
mach-uniphier ARM: uniphier: rework SMP code to support new System Bus binding 2016-03-18 17:36:37 +01:00
mach-ux500 ARM: SoC cleanups for v4.6 2016-03-20 14:37:22 -07:00
mach-versatile ARM: versatile: move restart to the device tree 2016-02-15 09:58:08 +01:00
mach-vexpress
mach-vt8500
mach-w90x900 Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2016-03-19 16:31:54 -07:00
mach-zx
mach-zynq ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
mm mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
net
nwfpe
oprofile
plat-iop
plat-omap
plat-orion Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2016-03-19 16:31:54 -07:00
plat-pxa ARM: pxa: add the number of DMA requestor lines 2016-02-26 22:57:05 +01:00
plat-samsung MTD updates for v4.6 2016-03-24 19:57:15 -07:00
plat-versatile ARM: plat-versatile: Remove unused clock.c file 2016-02-10 09:22:34 +01:00
probes
tools
vdso ARM/vdso: Mark the vDSO code read-only after init 2016-02-22 08:51:39 +01:00
vfp
xen
Kconfig ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00
Kconfig-nommu
Kconfig.debug
Makefile ARM: SoC platform updates for v4.6 2016-03-20 14:57:08 -07:00