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
..
amd
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
2016-04-04 10:41:08 -07:00
arm
drm: Add support for ARM's HDLCD controller.
2016-02-10 13:44:16 +00:00
armada
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
2016-04-04 10:41:08 -07:00
ast
Merge tag 'topic/drm-misc-2016-03-14' of git://anongit.freedesktop.org/drm-intel into drm-next
2016-03-16 11:09:26 +10:00
atmel-hlcdc
drm/atmel-hlcdc: use helper to get crtc state
2016-03-15 14:09:48 +01:00
bochs
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
2016-03-21 13:48:00 -07:00
bridge
drm/bridge: removed dummy mode_fixup function from dw-hdmi.
2016-02-11 09:24:01 +01:00
cirrus
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
2016-03-21 13:48:00 -07:00
etnaviv
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
2016-03-21 13:48:00 -07:00
exynos
drm/exynos: add DRM_EXYNOS_GEM_MAP ioctl
2016-03-13 14:54:03 +09:00
fsl-dcu
drm/fsl-dcu: removed optional dummy crtc mode_fixup function.
2016-03-04 18:16:45 +01:00
gma500
drm/gma: removed optional dummy crtc mode_fixup function.
2016-03-04 17:58:34 +01:00
i2c
Merge drm-fixes into drm-next.
2016-03-14 09:46:02 +10:00
i810
i915
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
2016-04-04 10:41:08 -07:00
imx
Merge drm-fixes into drm-next.
2016-03-14 09:46:02 +10:00
mga
mgag200
drm/mgag200: removed optional dummy crtc mode_fixup function.
2016-03-04 17:54:17 +01:00
msm
Merge tag 'topic/drm-misc-2016-03-14' of git://anongit.freedesktop.org/drm-intel into drm-next
2016-03-16 11:09:26 +10:00
nouveau
nouveau: fix nv40_perfctr_next() cleanup regression
2016-03-16 15:08:43 +10:00
omapdrm
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
2016-03-25 08:48:31 -07:00
panel
drm/panel: Changes for v4.6-rc1
2016-03-17 08:09:44 +10:00
qxl
Merge drm-fixes into drm-next.
2016-03-14 09:46:02 +10:00
r128
radeon
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
2016-04-04 10:41:08 -07:00
rcar-du
drm/rcar-du: removed optional dummy crtc mode_fixup function.
2016-03-04 17:58:47 +01:00
rockchip
imx-drm vblank IRQ control, fence support, and of endpoint helpers
2016-03-02 17:52:51 +10:00
savage
shmobile
drm/shmobile: removed optional dummy crtc mode_fixup function.
2016-03-04 17:59:44 +01:00
sis
sti
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
2016-03-21 13:48:00 -07:00
tdfx
tegra
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
2016-03-21 13:48:00 -07:00
tilcdc
drm/tilcdc: Use devm_kzalloc() and devm_kcalloc() for private data
2016-02-25 16:39:47 +02:00
ttm
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
2016-04-04 10:41:08 -07:00
udl
dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access()
2016-03-19 11:03:49 +01:00
vc4
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
2016-03-21 13:48:00 -07:00
vgem
via
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
2016-04-04 10:41:08 -07:00
virtio
drm/virtio: removed optional dummy crtc mode_fixup function.
2016-03-04 18:15:38 +01:00
vmwgfx
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
2016-03-21 13:48:00 -07:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic.c
Merge tag 'topic/drm-misc-2016-03-22' of git://anongit.freedesktop.org/drm-intel into drm-next
2016-03-24 08:41:59 +10:00
drm_atomic_helper.c
Merge tag 'topic/drm-misc-2016-03-22' of git://anongit.freedesktop.org/drm-intel into drm-next
2016-03-24 08:41:59 +10:00
drm_auth.c
drm_bridge.c
drm/bridge: Make (pre/post) enable/disable callbacks optional
2016-03-02 17:31:03 +01:00
drm_bufs.c
drm_cache.c
drm_context.c
drm_crtc.c
Merge tag 'topic/drm-misc-2016-03-14' of git://anongit.freedesktop.org/drm-intel into drm-next
2016-03-16 11:09:26 +10:00
drm_crtc_helper.c
drm: introduce pipe color correction properties
2016-03-08 13:57:32 +01:00
drm_crtc_internal.h
drm_debugfs.c
drm_dma.c
drm_dp_aux_dev.c
drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers.
2016-02-12 14:22:40 +01:00
drm_dp_helper.c
drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers.
2016-02-12 14:22:40 +01:00
drm_dp_mst_topology.c
Revert "drm/dp/mst: change MST detection scheme"
2016-02-17 14:07:48 +10:00
drm_drv.c
drm: move MODULE_PARM_DESC to other file
2016-01-08 15:32:29 +01:00
drm_edid.c
drm/edid: Extract SADs properly from multiple audio data blocks
2016-03-13 19:36:17 +01:00
drm_edid_load.c
drm/edid: convert to use match_string() helper
2016-03-17 15:09:34 -07:00
drm_encoder_slave.c
drm: fixes when i2c encoder slave mode_fixup is null.
2016-02-10 15:14:49 +01:00
drm_fb_cma_helper.c
drm/fb_cma_helper: remove duplicate const from drm_fb_cma_alloc
2016-01-20 13:55:57 +01:00
drm_fb_helper.c
drm/fb_helper: Use add_one_connector in add_all_connectors.
2016-02-15 14:56:46 +01:00
drm_flip_work.c
drm_fops.c
drm: Nuke vblank event file cleanup code
2016-02-08 09:55:47 +01:00
drm_gem.c
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
2016-04-04 10:41:08 -07:00
drm_gem_cma_helper.c
dma, mm/pat: Rename dma_*_writecombine() to dma_*_wc()
2016-03-09 14:57:51 +01:00
drm_global.c
drm_hashtab.c
tree wide: use kvfree() than conditional kfree()/vfree()
2016-01-22 17:02:18 -08:00
drm_info.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_irq.c
Merge drm-fixes into drm-next.
2016-03-14 09:46:02 +10:00
drm_kms_helper_common.c
drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers.
2016-02-12 14:22:40 +01:00
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dsi.c
drm/dsi: Get DSI host by DT device node
2016-03-02 17:02:54 +01:00
drm_mm.c
drm_modes.c
drm: modes: add missing [drm] to message printing
2016-02-09 16:34:44 +01:00
drm_modeset_lock.c
drm/doc: Convert to markdown
2015-12-15 10:22:26 +01:00
drm_of.c
drm: add drm_of_encoder_active_endpoint helpers
2016-02-10 14:19:21 +01:00
drm_panel.c
drm_pci.c
drm: add drm_pcie_get_max_link_width helper (v2)
2015-12-21 16:42:31 -05:00
drm_plane_helper.c
drm_platform.c
drm_prime.c
drm: prime: Honour O_RDWR during prime-handle-to-fd
2016-02-09 09:25:12 +01:00
drm_probe_helper.c
Merge branch 'for-linus' into for-next
2015-12-23 08:33:34 +01:00
drm_rect.c
drm_scatter.c
drm_sysfs.c
drm/sysfs: use kobj_to_dev()
2016-01-13 16:43:07 +01:00
drm_trace.h
drm_trace_points.c
drm_vm.c
drm_vma_manager.c
Kconfig
Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next
2016-02-19 11:13:01 +10:00
Makefile
Merge tag 'topic/drm-misc-2016-02-18' of git://anongit.freedesktop.org/drm-intel into drm-next
2016-02-19 10:57:44 +10:00