1
0
Fork 0
Commit Graph

31 Commits (09cbfeaf1a5a67bfb3201e0c83c810cecb2efa5a)

Author SHA1 Message Date
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
James Simmons b794d796b4 staging: lustre: filter remaining extra spacing for lnet selftest
This patch is a result of a filter applied to the lnet selftest
code to remove the last bits of hidden white spaces.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:24:47 -08:00
James Simmons ec436b9a08 staging: lustre: remove extra spacing when setting variable for lnet selftest
Remove any extra spacing for the lines of code setting variables to
some value.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:24:47 -08:00
James Simmons 00b5fdb745 staging: lustre: remove extra spacing of variable declartions for lnet selftest
Remove any extra spacing such as "int   rc" to "int rc" to match
the proper kernel style

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:24:47 -08:00
James Simmons d47e33e8c8 staging: lustre: fix spacing issues checkpatch reported in lnet selftest
Remove any extra spacing as reported by checkpatch.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:24:47 -08:00
James Simmons 8a2c23068e staging: lustre: remove returns in void function for lnet selftest
No reason to have returns at end of void function.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:24:47 -08:00
James Simmons 5fd88337d2 staging: lustre: fix all conditional comparison to zero in LNet layer
Doing if (rc != 0) or if (rc == 0) is bad form. This patch corrects
the LNet code to behavior according to kernel coding standards.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons 06ace26edc staging: lustre: fix all NULL comparisons in LNet layer
This removes every instance of checking a variable against
NULL in the LNet source code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons e767c84028 staging: lustre: remove unnecessary blank lines reported by checkpatch.pl
Remove any useless blank lines reported by checkpatch.pl
for LNet layer.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons c314c319c0 staging: lustre: align all code properly for LNet core
In several places in the LNet core the code doesn't align
up properly. This resolves those checkpath issues.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
James Simmons 4420cfd3f5 staging: lustre: format properly all comment blocks for LNet core
In several places in the LNet core comment blocks don't follow the
linux kernel style. This patch cleans those problems up.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:20:32 -08:00
Andreas Dilger 1dc563a682 staging: lustre: update Intel copyright messages 2015
Update copyright messages in files modified by Intel employees
in 2015 by non-trivial patches.  Exclude patches that are only
deleting code, renaming functions, or adding or removing whitespace.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7243
Reviewed-on: http://review.whamcloud.com/16758
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:38:00 -08:00
Shraddha Barke 168c7a13d4 Staging: lustre: lnet: Remove typedef srpc_server_rpc_t
The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedef for
srpc_server_rpc_t.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Arnd Bergmann d9f79e6bf0 staging/lustre: use 64-bit time for selftest
The lustre selftest code has multiple time stamps that are kept
as 'time_t' or 'unsigned long' and can therefore overflow on
32-bit systems.

This changes the code to use time64_t instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:03:37 +02:00
Mike Shuey 74d6801162 staging: lustre: lnet: selftest: code cleanup - variable spacing, indentation
Unify spacing in variable declarations, and align indentation in headers.
General whitespace cleanups.

Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 09:35:38 +09:00
Achille Aknin b311ebac5b Staging: lustre: brw_test.c: remove unneeded return statement
Remove an unneeded return statement in this file

Signed-off-by: Achille Aknin <achille.aknin@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 11:07:31 +02:00
Heena Sirwani 4a1b86dc6c Staging: lustre: lnet: selftest: Made a function static.
The following patch makes a function static as it is not used by other
files.
The patch fixes the warning:
WARNING: symbol 'brw_server_handle' was not declared. Should it be static?

The above warning was reported by sparse.

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:09 +08:00
Heena Sirwani 0c05ef92f6 Staging: lustre: lnet: selftest: Made a function static.
The following patch makes a function static as it is not used by other
files.
The patch fixes the warning:
WARNING: symbol 'brw_bulk_ready' was not declared. Should it be static?

The above warning was reported by sparse.

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:09 +08:00
Heena Sirwani 6888871cb0 Staging: lustre: lnet: selftest: Made a function static.
The following patch makes a function static as it is not used by other
files.
The patch fixes the warning:
WARNING: symbol 'brw_server_rpc_done' was not declared. Should it be static?

The above warning was reported by sparse.

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:09 +08:00
Heena Sirwani ec17e8113b Staging: lustre: lnet: selftest: Made a function static.
The following patch makes a function static as it is not used by other
files.
The patch fixes the warning:
WARNING: symbol 'brw_check_bulk' was not declared. Should it be static?

The above warning was reported by sparse.

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:09 +08:00
Heena Sirwani 56e1ccac5f Staging: lustre: lnet: selftest: Made a function static.
The following patch makes a function static as it was not used by other
files.
The patch fixes the warning:
WARNING: symbol 'brw_fill_bulk' was not declared. Should it be
static?

The above warning was reported by sparse.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:58:15 -07:00
Heena Sirwani 43311238ce Staging: lustre: lnet: selftest: Made a function static.
The following patch makes a function static as it was not used by other
files.
The patch fixes the warning:
WARNING: symbol 'brw_check_page' was not declared. Should it be static?

The above warning was reported by sparse.

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:58:15 -07:00
Heena Sirwani 2e3e133d2e Staging: lustre: lnet: selftest: Made a function static.
The following patch makes a function static as it was not used by other
files.
The patch fixes the warning:
WARNING: symbol 'brw_fill_page' was not declared. Should it be static?

The above warning was reported by sparse.

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:58:15 -07:00
Heena Sirwani d4b2d88a08 Staging: lustre: lnet: selftest: Made a function static.
The following patch makes a function static as it is not used by other
files.
The patch fixes the following warning:
WARNING: symbol brw_inject_one_error was not declared. Should it be
static?

The above warning was reported by sparse.

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:58:15 -07:00
Heena Sirwani d5bd050416 Staging: lustre: lnet: selftest: Made a function static.
The following patch makes a function static as it was not used by other
files.
The patch fixes the following warning:
WARNING: symbol brw_client_init was not declared. Should it be static?

The above warning was reported by sparse.

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:58:15 -07:00
Greg Kroah-Hartman 55f5a824b9 staging: lustre: remove LPX64 define
Just use the proper modifier type...

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 20:26:07 -07:00
Peng Tao 8cc7b4b9f1 staging/lustre: remove CFS_MODULE_PARM
Patch generated by coccinelle:

@generic_type@
declarer name CFS_MODULE_PARM;
declarer name module_param;
declarer name MODULE_PARM_DESC;
expression E1, E2, E3, E4;
type t;
@@
-CFS_MODULE_PARM(E1, E2, t, E3, E4);
+module_param(E1, t, E3);
+MODULE_PARM_DESC(E1, E4);

@charp@
expression E1, E2, E3, E4, E5;
@@
-CFS_MODULE_PARM(E1, E2, E3, E4, E5);
+module_param(E1, E3, E4);
+MODULE_PARM_DESC(E1, E5);

With manual modification to remove CFS_MODULE_PARM definition and
fix up checkpatch.pl warnnings.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-25 12:35:04 -08:00
Lisa Nguyen 5f849bb0e4 staging/lustre/lnet/selftest: Remove unnecessary spaces in brw_test.c
Remove spaces between function names and open parentheses to
eliminate warnings generated by checkpatch.pl and meet kernel
coding standards.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19 13:35:27 -07:00
Lisa Nguyen 5252bbfde5 staging/lustre/lnet/selftest: Fix trailing statements in brw_test.c
Fix trailing statement errors generated by checkpatch.pl in
brw_test.c to meet kernel coding standards.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19 13:35:27 -07:00
Masanari Iida 2b28432642 staging: lustre: Fix typo in lustre/lnet
Correct spelling typo in comments and debug messages.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26 06:29:09 -07:00
Peng Tao d7e09d0397 staging: add Lustre file system client support
Lustre is the most deployed distributed file system
in the HPC (High Performance Computing) world. The patch
adds its client side support.

The code is not very clean and needs to live in drivers/staging
for some time for continuing cleanup work. See
drivers/staging/lustre/TODO for details.

The code is based on Lustre master commit faefbfc04

commit faefbfc0460bc00f2ee4c1c1c86aa1e39b9eea49
Author: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Date:   Tue Apr 30 23:05:21 2013 +0400

    LU-3244 utils: tunefs.lustre should preserve virgin label

Plus a few under-review patches on Whamcloud gerrit:
3.8 kernel support:
http://review.whamcloud.com/#change,5973
http://review.whamcloud.com/#change,5974
http://review.whamcloud.com/#change,5768
http://review.whamcloud.com/#change,5781
http://review.whamcloud.com/#change,5763
http://review.whamcloud.com/#change,5613
http://review.whamcloud.com/#change,5655

3.9 kernel support:
http://review.whamcloud.com/#change,5898
http://review.whamcloud.com/#change,5899

Kconfig/Kbuild:
http://review.whamcloud.com/#change,4646
http://review.whamcloud.com/#change,4644

libcfs cleanup:
http://review.whamcloud.com/#change,2831
http://review.whamcloud.com/#change,4775
http://review.whamcloud.com/#change,4776
http://review.whamcloud.com/#change,4777
http://review.whamcloud.com/#change,4778
http://review.whamcloud.com/#change,4779
http://review.whamcloud.com/#change,4780

All starting/trailing whitespaces are removed, to match kernel
coding style. Also ran scripts/cleanfile on all lustre source files.

[maked the Kconfig depend on BROKEN as the recent procfs changes causes
this to fail - gregkh]

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-14 13:54:50 -04:00