1
0
Fork 0
alistair23-linux/drivers/gpu/drm/i915
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
..
Kconfig drm/i915: Add an optional selection from i915 of CONFIG_MMU_NOTIFIER 2016-02-17 13:58:46 +01:00
Makefile
dvo.h
dvo_ch7xxx.c
dvo_ch7017.c
dvo_ivch.c
dvo_ns2501.c
dvo_sil164.c
dvo_tfp410.c
i915_cmd_parser.c
i915_debugfs.c drm/i915: Reduce the pointer dance of i915_is_ggtt() 2016-02-26 13:15:39 +00:00
i915_dma.c Revert "drm/i915: fix context/engine cleanup order" 2016-02-15 10:50:13 +01:00
i915_drv.c drm/i915: Use atomic helpers for suspend, v2. 2016-02-16 11:23:46 +01:00
i915_drv.h drm/i915: Update DRIVER_DATE to 20160229 2016-02-29 09:59:07 +01:00
i915_gem.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
i915_gem_batch_pool.c
i915_gem_batch_pool.h
i915_gem_context.c drm/i915: Rename vma->*_list to *_link for consistency 2016-02-26 13:15:39 +00:00
i915_gem_debug.c
i915_gem_dmabuf.c dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access() 2016-03-19 11:03:49 +01:00
i915_gem_evict.c drm/i915: Rename vma->*_list to *_link for consistency 2016-02-26 13:15:39 +00:00
i915_gem_execbuffer.c drm/i915: Reduce the pointer dance of i915_is_ggtt() 2016-02-26 13:15:39 +00:00
i915_gem_fence.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2016-03-17 21:38:27 -07:00
i915_gem_gtt.c drm/i915: Reduce the pointer dance of i915_is_ggtt() 2016-02-26 13:15:39 +00:00
i915_gem_gtt.h drm/i915: Reduce the pointer dance of i915_is_ggtt() 2016-02-26 13:15:39 +00:00
i915_gem_render_state.c
i915_gem_render_state.h
i915_gem_shrinker.c drm/i915: Rename vma->*_list to *_link for consistency 2016-02-26 13:15:39 +00:00
i915_gem_stolen.c drm/i915: Rename vma->*_list to *_link for consistency 2016-02-26 13:15:39 +00:00
i915_gem_tiling.c
i915_gem_userptr.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
i915_gpu_error.c drm/i915: Rename vma->*_list to *_link for consistency 2016-02-26 13:15:39 +00:00
i915_guc_reg.h
i915_guc_submission.c
i915_ioc32.c
i915_irq.c drm/i915: Add for_each_pipe_masked() 2016-02-22 19:28:16 +02:00
i915_params.c drm/i915: drop unused i915.disable_vtd_wa module parameter 2016-02-19 17:27:15 +02:00
i915_params.h drm/i915: drop unused i915.disable_vtd_wa module parameter 2016-02-19 17:27:15 +02:00
i915_reg.h drm/i915/gen9: Extend dmc debug mask to include cores 2016-02-22 17:20:28 +02:00
i915_suspend.c drm/i915/bxt: Don't save/restore eDP panel power during suspend (v3) 2016-02-08 11:32:32 +02:00
i915_sysfs.c
i915_trace.h drm/i915: Reduce the pointer dance of i915_is_ggtt() 2016-02-26 13:15:39 +00:00
i915_trace_points.c
i915_vgpu.c
i915_vgpu.h
intel_acpi.c
intel_atomic.c drm/i915: Kill off intel_crtc->atomic.wait_vblank, v6. 2016-02-25 15:16:22 +01:00
intel_atomic_plane.c
intel_audio.c drm/i915: Fix bogus dig_port_map[] assignment for pre-HSW 2016-03-07 18:45:49 +02:00
intel_bios.c
intel_bios.h
intel_crt.c drm/i915/crt: Ensure the HW is powered during HW state readout 2016-02-22 17:44:37 +02:00
intel_csr.c drm/i915/gen9: Check for DC state mismatch 2016-02-22 18:37:25 +02:00
intel_ddi.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
intel_display.c drm/i915: Handle -EDEADLK in drm_atomic_commit from load-detect. 2016-03-14 10:50:58 +02:00
intel_dp.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
intel_dp_link_training.c drm/i915/dp: reduce missing TPS3 support errors to debug logging 2016-02-08 11:37:17 +02:00
intel_dp_mst.c drm/i915: DisplayPort-MST pixel clock check 2016-02-11 10:15:38 +01:00
intel_drv.h drm/i915: Remove update_sprite_watermarks. 2016-02-25 16:32:19 +01:00
intel_dsi.c drm/i915/dsi: Ensure the HW is powered during HW state readout 2016-02-22 17:44:39 +02:00
intel_dsi.h drm/i915/dsi: Using the bpp value wrt the pixel format 2016-02-19 14:56:05 +02:00
intel_dsi_panel_vbt.c drm/i915/dsi: Using the bpp value wrt the pixel format 2016-02-19 14:56:05 +02:00
intel_dsi_pll.c drm/i915/dsi: Using the bpp value wrt the pixel format 2016-02-19 14:56:05 +02:00
intel_dvo.c
intel_fbc.c drm/i915/fbc: enable FBC by default on HSW and BDW 2016-02-19 18:06:16 -02:00
intel_fbdev.c drm/i915: Use atomic state in intel_fb_initial_config. 2016-02-18 10:41:54 +01:00
intel_fifo_underrun.c
intel_frontbuffer.c
intel_guc.h
intel_guc_fwif.h
intel_guc_loader.c drm/i915/guc: Do not wait for firmware load atomically 2016-02-15 16:10:19 +00:00
intel_hdmi.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
intel_hotplug.c
intel_i2c.c drm/i915: Actually retry with bit-banging after GMBUS timeout 2016-03-11 10:23:28 +02:00
intel_lrc.c drm/i915: Execlists cannot pin a context without the object 2016-02-26 13:16:36 +00:00
intel_lrc.h
intel_lvds.c drm/i915/lvds: Ensure the HW is powered during HW state readout 2016-02-22 17:44:40 +02:00
intel_mocs.c
intel_mocs.h
intel_modes.c
intel_opregion.c
intel_overlay.c
intel_panel.c
intel_pm.c drm/i915/skl: Ensure HW is powered during DDB HW state readout 2016-02-22 17:44:40 +02:00
intel_psr.c drm/i915: Enable PSR by default on Haswell and Broadwell. 2016-02-17 13:04:48 -08:00
intel_renderstate.h
intel_renderstate_gen6.c
intel_renderstate_gen7.c
intel_renderstate_gen8.c
intel_renderstate_gen9.c
intel_ringbuffer.c drm/i915: Don't ERROR for an expected intel_rcs_ctx_init() interruption 2016-02-15 10:48:08 +01:00
intel_ringbuffer.h
intel_runtime_pm.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
intel_sdvo.c drm/i915: SDVO pixel clock check 2016-02-11 10:15:44 +01:00
intel_sdvo_regs.h
intel_sideband.c drm/i915: Extend gpio read/write to other cores 2016-02-04 19:11:17 +02:00
intel_sprite.c drm/i915: Standardize on 'cpp' for bytes per pixel 2016-01-28 20:56:57 +02:00
intel_tv.c drm/i915: Use atomic state in tv load detection. 2016-02-18 10:41:49 +01:00
intel_uncore.c drm/i915/bxt: Check BIOS RC6 setup before enabling RC6 2016-02-05 23:35:43 +02:00