OpenCloudOS-Kernel/include/linux/ceph
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
..
auth.h libceph: message signature support 2014-12-17 20:09:50 +03:00
buffer.h libceph: nuke ceph_kvfree() 2014-12-17 20:09:50 +03:00
ceph_debug.h
ceph_features.h libceph: revamp subs code, switch to SUBSCRIBE2 protocol 2016-03-25 18:51:38 +01:00
ceph_frag.h ceph: ceph_frag_contains_value can be boolean 2016-01-21 19:36:07 +01:00
ceph_fs.h ceph: fix security xattr deadlock 2016-03-25 18:51:55 +01:00
ceph_hash.h
debugfs.h libceph: simplify our debugfs attr macro 2015-04-20 18:55:39 +03:00
decode.h remove extra definitions of U32_MAX 2014-01-23 16:36:55 -08:00
libceph.h mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
mdsmap.h ceph: update support for PGID64, PGPOOL3, OSDENC protocol features 2013-02-26 15:02:25 -08:00
messenger.h libceph: fix ceph_msg_revoke() 2016-01-21 19:36:08 +01:00
mon_client.h libceph: monc hunt rate is 3s with backoff up to 30s 2016-03-25 18:51:39 +01:00
msgpool.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
msgr.h libceph: use keepalive2 to verify the mon session is alive 2015-09-08 23:14:30 +03:00
osd_client.h libceph: add helper that duplicates last extent operation 2016-03-25 18:51:43 +01:00
osdmap.h libceph: osdmap.h: Add missing format newlines 2015-04-20 18:55:35 +03:00
pagelist.h libceph: fixup includes in pagelist.h 2014-12-17 20:09:53 +03:00
rados.h libceph: sync osd op definitions in rados.h 2014-10-14 12:57:02 -07:00
types.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00