linux-stable/drivers/block/drbd
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
..
drbd_actlog.c drbd: avoid potential deadlock during handshake 2015-11-25 09:22:03 -07:00
drbd_bitmap.c tree wide: use kvfree() than conditional kfree()/vfree() 2016-01-22 17:02:18 -08:00
drbd_debugfs.c wrappers for ->i_mutex access 2016-01-22 18:04:28 -05:00
drbd_debugfs.h drbd: debugfs: add basic hierarchy 2014-07-10 18:35:16 +02:00
drbd_int.h drbd: Use shash and ahash 2016-01-27 20:36:08 +08:00
drbd_interval.c drbd: use RB_DECLARE_CALLBACKS() to define augment callbacks 2014-09-18 09:00:17 -06:00
drbd_interval.h drbd: application writes may set-in-sync in protocol != C 2014-07-10 18:35:02 +02:00
drbd_main.c drbd: Use shash and ahash 2016-01-27 20:36:08 +08:00
drbd_nl.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
drbd_nla.c drbd: Remove drbd_wrappers.h 2014-04-30 13:46:54 -06:00
drbd_nla.h drbd: Split off netlink mandatory attribute handling into separate file 2012-11-08 16:57:45 +01:00
drbd_proc.c drbd: Move enum write_ordering_e to drbd.h 2015-11-25 09:22:00 -07:00
drbd_protocol.h drbd: Create a dedicated workqueue for sending acks on the control connection 2015-11-25 09:22:01 -07:00
drbd_receiver.c drbd: Use shash and ahash 2016-01-27 20:36:08 +08:00
drbd_req.c drbd: fix "endless" transfer log walk in protocol A 2015-11-25 09:22:03 -07:00
drbd_req.h drbd: De-inline drbd_should_do_remote() and drbd_should_send_out_of_sync() 2015-11-25 09:22:00 -07:00
drbd_state.c drbd: make suspend_io() / resume_io() must be thread and recursion safe 2015-11-25 09:22:03 -07:00
drbd_state.h drbd: Fix locking across all resources 2015-11-25 09:22:00 -07:00
drbd_state_change.h drbd: Backport the "events2" command 2015-11-25 09:22:00 -07:00
drbd_strings.c drbd: Move string function prototypes from linux/drbd.h to drbd_string.h 2014-02-17 16:50:37 +01:00
drbd_strings.h drbd: Move string function prototypes from linux/drbd.h to drbd_string.h 2014-02-17 16:50:37 +01:00
drbd_vli.h Fix common misspellings 2011-03-31 11:26:23 -03:00
drbd_worker.c drbd: Use shash and ahash 2016-01-27 20:36:08 +08:00
Kconfig drbd: update Kconfig to match current dependencies 2012-12-06 13:08:29 +01:00
Makefile drbd: debugfs: add basic hierarchy 2014-07-10 18:35:16 +02:00