1
0
Fork 0
alistair23-linux/drivers/gpu/drm/amd/amdgpu
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/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
Makefile drm/amdgpu: rename amdgpu_sched.c to amdgpu_job.c 2016-02-10 14:17:23 -05:00
ObjectID.h
amdgpu.h Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-18 07:16:25 +10:00
amdgpu_acp.c drm/amd: cleanup get_mfd_cell_dev() 2016-02-26 12:43:47 -05:00
amdgpu_acp.h drm/amd: add pm domain for ACP IP sub blocks 2016-02-10 14:17:09 -05:00
amdgpu_acpi.c drm/amdgpu: mv amdgpu_acpi.h to amd/include/amd_acpi.h 2015-12-21 16:42:05 -05:00
amdgpu_afmt.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_amdkfd.c drm/amdgpu: Return -EPROBE_DEFER when amdkfd not loaded 2016-02-27 22:52:40 +02:00
amdgpu_amdkfd.h drm/amdgpu: Return -EPROBE_DEFER when amdkfd not loaded 2016-02-27 22:52:40 +02:00
amdgpu_amdkfd_gfx_v7.c drm/amdgpu: fix non-ANSI declaration of amdgpu_amdkfd_gfx_*_get_functions() 2016-01-28 14:39:34 +02:00
amdgpu_amdkfd_gfx_v8.c drm/amdgpu: fix non-ANSI declaration of amdgpu_amdkfd_gfx_*_get_functions() 2016-01-28 14:39:34 +02:00
amdgpu_atombios.c drm/amdgpu: add check for atombios GPU virtualization table 2016-02-10 14:17:10 -05:00
amdgpu_atombios.h drm/amdgpu: add check for atombios GPU virtualization table 2016-02-10 14:17:10 -05:00
amdgpu_atpx_handler.c drm/amdgpu: disable runtime pm on PX laptops without dGPU power control 2016-03-09 13:03:52 -05:00
amdgpu_benchmark.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
amdgpu_bios.c drm/amdgpu: Use new read bios from rom callback 2015-12-02 12:45:59 -05:00
amdgpu_bo_list.c drm/amdgpu: move get_user_pages out of amdgpu_ttm_tt_pin_userptr v6 2016-03-08 11:01:50 -05:00
amdgpu_cgs.c drm/amdgpu: add a cgs interface to fetch cg and pg flags 2016-02-08 10:37:46 -05:00
amdgpu_connectors.c drm/amdgpu: return from atombios_dp_get_dpcd only when error 2016-03-02 11:01:25 -05:00
amdgpu_connectors.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_cs.c drm/amdgpu: release_pages requires linux/pagemap.h 2016-03-21 13:22:52 +10:00
amdgpu_ctx.c drm/amdgpu: fix coding style in amdgpu_ctx.c 2016-02-12 15:42:54 -05:00
amdgpu_device.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-17 08:25:04 +10:00
amdgpu_display.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
amdgpu_dpm.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_dpm.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_drv.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-17 08:25:04 +10:00
amdgpu_drv.h drm/amdgpu: merge amdgpu_family.h into amd_shared.h (v2) 2015-08-17 16:50:21 -04:00
amdgpu_encoders.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_fb.c drm/amdgpu: don't init fbdev if we don't have any connectors 2016-01-26 00:35:56 -05:00
amdgpu_fence.c drm/amdgpu: switch back to 32bit hw fences v2 2016-03-16 18:00:10 -04:00
amdgpu_gart.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
amdgpu_gds.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_gem.c drm/amdgpu: release_pages requires linux/pagemap.h 2016-03-21 13:22:52 +10:00
amdgpu_gfx.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_gfx.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_i2c.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_i2c.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_ib.c drm/amdgpu: move ib.fence to job.fence 2016-03-17 11:54:11 -04:00
amdgpu_ih.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
amdgpu_ih.h drm/amdgpu: Implement irq interfaces for CGS 2015-08-17 16:50:09 -04:00
amdgpu_ioc32.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_irq.c drm/amdgpu: add missing irq.h include 2016-01-14 08:07:55 +10:00
amdgpu_irq.h drm/amdgpu: add irq domain support 2016-01-11 09:52:57 -05:00
amdgpu_job.c drm/amdgpu: use sched fence if possible 2016-03-17 11:54:53 -04:00
amdgpu_kms.c drm/amdgpu/gfx: clean up harvest configuration (v2) 2016-02-12 15:47:18 -05:00
amdgpu_mn.c drm/amdgpu: add invalidate_page callback for userptrs 2016-03-21 11:52:14 -04:00
amdgpu_mode.h drm/amdgpu: remove page flip work queue v3 2016-02-16 17:25:38 -05:00
amdgpu_object.c drm/amdgpu: always wait before kmap a BO 2016-03-14 13:43:09 -04:00
amdgpu_object.h drm/amdgpu: cleanup gem init/finit 2016-02-16 17:46:24 -05:00
amdgpu_pll.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_pll.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_pm.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
amdgpu_pm.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_powerplay.c drm/amd/powerplay: send event to notify powerplay all modules are initialized. 2016-03-02 11:01:22 -05:00
amdgpu_powerplay.h drm/amd/powerplay: add basic powerplay framework 2015-12-21 16:42:07 -05:00
amdgpu_prime.c drm/amdgpu: cleanup gem init/finit 2016-02-16 17:46:24 -05:00
amdgpu_ring.c drm/amdgpu: add number of hardware submissions to amdgpu_fence_driver_init_ring 2016-03-16 17:59:12 -04:00
amdgpu_sa.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-18 07:16:25 +10:00
amdgpu_sync.c drm/amdgpu: add slap cache for sync objects as well 2016-03-08 11:01:47 -05:00
amdgpu_test.c drm/amdgpu: clean up hw semaphore support in driver 2016-02-10 14:16:49 -05:00
amdgpu_trace.h drm/amdgpu: trace the pd_addr in vm_grab_id as well 2016-02-29 11:33:59 -05:00
amdgpu_trace_points.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_ttm.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
amdgpu_ucode.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
amdgpu_ucode.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_uvd.c drm/amdgpu: move ib.fence to job.fence 2016-03-17 11:54:11 -04:00
amdgpu_uvd.h drm/amdgpu: send UVD IB tests directly to the ring again 2016-02-10 14:17:23 -05:00
amdgpu_vce.c drm/amdgpu: move ib.fence to job.fence 2016-03-17 11:54:11 -04:00
amdgpu_vce.h drm/amdgpu: send VCE IB tests directly to the ring again 2016-02-10 14:17:24 -05:00
amdgpu_vm.c drm/amdgpu: Revert "add mutex for ba_va->valids/invalids" 2016-03-09 13:04:02 -05:00
atom.c drm/amdgpu/atom: add support for new div32 opcodes (v3) 2015-10-14 16:16:24 -04:00
atom.h drm/amdgpu/atom: add support for new div32 opcodes (v3) 2015-10-14 16:16:24 -04:00
atombios_crtc.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_crtc.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_dp.c drm/amdgpu/dp: add back special handling for NUTMEG 2016-03-08 11:26:34 -05:00
atombios_dp.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_encoders.c drm/amdgpu: Restore LCD backlight level on resume 2015-09-29 15:08:53 -04:00
atombios_encoders.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_i2c.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_i2c.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
ci_dpm.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-17 08:25:04 +10:00
ci_dpm.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
ci_smc.c drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
cik.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-17 08:25:04 +10:00
cik.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cik_dpm.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cik_ih.c drm/amdgpu: add irq domain support 2016-01-11 09:52:57 -05:00
cik_ih.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cik_sdma.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-18 07:16:25 +10:00
cik_sdma.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cikd.h drm/amdgpu: fix rb bitmap & cu bitmap calculation 2016-03-03 01:00:20 -05:00
clearstate_ci.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
clearstate_defs.h drm/amdgpu: add clearstate_defs.h 2015-06-03 21:03:12 -04:00
clearstate_vi.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
cz_dpm.c drm/amdgpu/cz: remove commented out call to enable vce pg 2016-03-02 11:01:24 -05:00
cz_dpm.h drm/amdgpu/cz: add code to enable forcing VCE clocks 2016-01-13 12:12:43 -05:00
cz_ih.c drm/amdgpu: add irq domain support 2016-01-11 09:52:57 -05:00
cz_ih.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cz_smc.c drm/amdgpu: Update SMC/DPM for Stoney 2015-10-21 12:19:46 -04:00
cz_smumgr.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
dce_v8_0.c drm/amd/amdgpu: Fix indentation in do_set_base() (DCEv8) 2016-03-08 11:01:57 -05:00
dce_v8_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
dce_v10_0.c drm/amd/amdgpu: Fix identation in do_set_base() (DCEv10) 2016-03-08 11:01:55 -05:00
dce_v10_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
dce_v11_0.c drm/amd/amdgpu: Fix indentation in dce_v11_0_crtc_do_set_base() 2016-03-08 11:01:53 -05:00
dce_v11_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
fiji_dpm.c drm/amdgpu: rename fiji_smumgr.h to fiji_smum.h 2015-12-21 16:42:44 -05:00
fiji_smc.c drm/amdgpu/smu: skip SMC ucode loading on SR-IOV capable boards (v2) 2016-02-10 14:17:13 -05:00
fiji_smum.h drm/amdgpu: rename fiji_smumgr.h to fiji_smum.h 2015-12-21 16:42:44 -05:00
gfx_v7_0.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-18 07:16:25 +10:00
gfx_v7_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
gfx_v8_0.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-18 07:16:25 +10:00
gfx_v8_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
gmc_v7_0.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-17 08:25:04 +10:00
gmc_v7_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
gmc_v8_0.c drm/amdgpu: Clear HDP_MISC_CNTL.HDP_FLUSH_INVALIDATE_CACHE 2016-03-08 11:01:44 -05:00
gmc_v8_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
iceland_dpm.c drm/amdgpu/iceland: don't call smu_init on resume 2015-06-10 09:32:25 -04:00
iceland_ih.c drm/amdgpu: add irq domain support 2016-01-11 09:52:57 -05:00
iceland_ih.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
iceland_sdma_pkt_open.h drm/amdgpu: add count field for the SDMA NOP packet v2 2015-09-02 12:21:35 -04:00
iceland_smc.c drm/amdgpu/smu: skip SMC ucode loading on SR-IOV capable boards (v2) 2016-02-10 14:17:13 -05:00
iceland_smumgr.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
kv_dpm.c drma/dmgpu: move cg and pg flags into shared headers 2016-02-08 10:37:47 -05:00
kv_dpm.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
kv_smc.c drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
ppsmc.h drm/amdgpu: add ppsmc.h 2015-06-03 21:03:13 -04:00
sdma_v2_4.c drm/amdgpu: move ib.fence to job.fence 2016-03-17 11:54:11 -04:00
sdma_v2_4.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
sdma_v3_0.c drm/amdgpu: move ib.fence to job.fence 2016-03-17 11:54:11 -04:00
sdma_v3_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
smu_ucode_xfer_vi.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
tonga_dpm.c drm/amdgpu: fix tonga smu resume 2016-01-15 12:43:11 -05:00
tonga_ih.c drm/amdgpu: add irq domain support 2016-01-11 09:52:57 -05:00
tonga_ih.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
tonga_sdma_pkt_open.h drm/amdgpu: add count field for the SDMA NOP packet v2 2015-09-02 12:21:35 -04:00
tonga_smc.c drm/amdgpu/smu: skip SMC ucode loading on SR-IOV capable boards (v2) 2016-02-10 14:17:13 -05:00
tonga_smum.h drm/amdgpu: rename tonga_smumgr.h to tonga_smum.h 2015-12-21 16:42:43 -05:00
uvd_v4_2.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
uvd_v4_2.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
uvd_v5_0.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
uvd_v5_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
uvd_v6_0.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
uvd_v6_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
vce_v2_0.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
vce_v2_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
vce_v3_0.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
vce_v3_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
vi.c Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-03-17 08:25:04 +10:00
vi.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
vi_dpm.h drm/amdgpu: Add Fiji support to SMC and DPM (v2) 2015-08-17 16:50:26 -04:00
vid.h drm/amdgpu: fix rb bitmap & cu bitmap calculation 2016-03-03 01:00:20 -05:00