linux-sg2042/drivers/usb/storage
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 PM / Kconfig: Replace PM_RUNTIME with PM in dependencies 2014-12-13 00:44:04 +01:00
Makefile usb: remove libusual 2012-09-05 17:21:36 -07:00
alauda.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
cypress_atacb.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
datafab.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
debug.c usb: storage: use usb_store_dbg instead of US_DEBUGPX 2016-02-20 20:21:53 -08:00
debug.h usb: storage: use usb_store_dbg instead of US_DEBUGPX 2016-02-20 20:21:53 -08:00
ene_ub6250.c usb: storage: ene_ub6250: Remove unnecessary cast in kfree 2016-02-03 13:48:12 -08:00
freecom.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
initializers.c storage: Enable multi-target mode as vendor driver does for SCM eUSCSI bridge 2014-11-24 17:22:38 -08:00
initializers.h USB: storage: fix Huawei mode switching regression 2013-03-07 12:23:17 +08:00
isd200.c USB: rewrite isd200_init_info for readability 2015-10-04 10:51:58 +01:00
jumpshot.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
karma.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
onetouch.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
option_ms.c usb: storage: Convert US_DEBUGP to usb_stor_dbg 2013-04-19 11:46:50 -07:00
option_ms.h
protocol.c USB: storage: fix compile warning 2013-12-09 23:45:39 -08:00
protocol.h
realtek_cr.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
scsiglue.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
scsiglue.h usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
sddr09.c usb: storage: use usb_store_dbg instead of US_DEBUGPX 2016-02-20 20:21:53 -08:00
sddr55.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
shuttle_usbat.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
sierra_ms.c usb: storage: Convert US_DEBUGP to usb_stor_dbg 2013-04-19 11:46:50 -07:00
sierra_ms.h
transport.c usb: usleep_range is preferred over udelay where wakeup is flexible 2015-07-22 15:45:04 -07:00
transport.h
uas-detect.h uas: Set max_sectors_240 quirk for ASM1053 devices 2015-04-28 12:48:57 +02:00
uas.c USB: uas: Reduce can_queue to MAX_CMNDS 2016-03-18 09:19:02 -07:00
unusual_alauda.h
unusual_cypress.h usb-storage: restrict bcdDevice range for Super Top in Cypress ATACB 2014-02-04 12:59:14 -08:00
unusual_datafab.h
unusual_devs.h usb-storage: Fix scsi-sd failure "Invalid field in cdb" for USB adapter JMicron 2015-12-01 10:23:33 -08:00
unusual_ene_ub6250.h
unusual_freecom.h
unusual_isd200.h
unusual_jumpshot.h
unusual_karma.h
unusual_onetouch.h
unusual_realtek.h
unusual_sddr09.h
unusual_sddr55.h
unusual_uas.h usb-storage: Fix scsi-sd failure "Invalid field in cdb" for USB adapter JMicron 2015-12-01 10:23:33 -08:00
unusual_usbat.h
usb.c usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
usb.h usb: storage: fix module reference for scsi host 2015-05-10 16:03:50 +02:00
usual-tables.c USB: storage: Define a new macro for USB storage match rules 2013-02-04 10:40:16 -08:00