linux/fs/ocfs2/cluster
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
..
Makefile ocfs2: remove versioning information 2014-01-21 16:19:41 -08:00
heartbeat.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
heartbeat.h ocfs2: fix deadlock between o2hb thread and o2net_wq 2014-10-09 22:25:47 -04:00
masklog.c ocfs2: remove __mlog_cpu_guess 2015-06-24 17:49:39 -07:00
masklog.h ocfs2: reduce object size of mlog uses 2015-06-24 17:49:39 -07:00
netdebug.c fs/ocfs2/cluster/netdebug.c: use seq_open_private() not seq_open() 2014-10-09 22:25:47 -04:00
nodemanager.c configfs: switch ->default groups to a linked list 2016-03-06 16:11:24 +01:00
nodemanager.h ocfs2/cluster: Make fence method configurable - v2 2009-12-02 16:49:26 -08:00
ocfs2_heartbeat.h
ocfs2_nodemanager.h ocfs2/dlm: Add message DLM_QUERY_REGION 2010-10-09 10:26:23 -07:00
quorum.c ocfs2: quorum: add a log for node not fenced 2014-08-29 16:28:17 -07:00
quorum.h
sys.c VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms. 2014-03-24 12:21:00 +10:30
sys.h
tcp.c ocfs2: o2net: should remove debugfs in o2net_init() out branch 2015-06-24 17:49:39 -07:00
tcp.h ocfs2: o2net: set tcp user timeout to max value 2014-08-29 16:28:16 -07:00
tcp_internal.h ocfs2: fix wrong comment 2015-02-10 14:30:28 -08:00