1
0
Fork 0
Commit Graph

62 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
Oleg Drokin 30c0aa3943 staging/lustre/ptlrpc: Fix style vs open parenthesis alignment
This mostly fixes checkpatch complaints about
"Alignment should match open parenthesis"

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:17:41 -08:00
Oleg Drokin dadfcdab43 staging/lustre/ptlrpc: Adjust comments to better conform to coding style
This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:08:59 -08:00
Oleg Drokin f3478e025c staging/lustre: Get rid of object update code
Object update was originally planned to be used for cross-server
updates, so nothign to do with the client. The idea was
later significantly reworked anyway so even wire structs should
not be retained.

This gets rid of update_cmd_t, UPDATE and UPDATE_REPLY rpc and
corresponding subcommands, swabbig logic and such.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 22:05:50 -08:00
Oleg Drokin 8b38208992 staging/lustre/ptlrpc: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:33:11 -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
Ksenija Stanojevic e5b6b5d48f Staging: lustre: Replace LPROCFS_CLIMP_EXIT with up_read
In all call sites type of argument that macro LPROCFS_CLIMP_EXIT
use is the same, so replace it with up_read function.
Also remove the macro since it's no longer used.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ksenija Stanojevic a15b2225dd Staging: lustre: Replace LPROCFS_CLIMP_CHECK with lprocfs_climp_check
Static inline functions are preferred over macros. The function is
placed in obd_class.h instead lprocfs_status.h because obd_class.h
includes header obd.h which contains definition of struct obd_device
and in that way avoids build error: Dereferencing pointer to incomplete
type. Also remove macro LPROCFS_CLIMP_CHECK since it's no longer used.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:37:09 +09:00
Amitoj Kaur Chawla 8d816fb6cd staging: lustre: ptlrpc: Replace seq_printf() with seq_putc()
Replace seq_printf() with seq_putc() since it is more expensive than
seq_putc().

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:37:09 +09:00
Dmitry Eremin 80feb1ef34 staging: lustre: provide separate buffers for libcfs_*2str()
Provide duplicates with separate buffers for libcfs_*2str() functions.

Replace libcfs_nid2str() with libcfs_nid2str_r() function in critical
places.

Provide buffer size for nf_addr2str functions.

Use __u32 as nf_type always

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6070
Reviewed-on: http://review.whamcloud.com/13185
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:52:21 -07:00
Shivani Bhardwaj e3ce40cb73 Staging: lustre: lproc_ptlrpc: Replace simple_strtol with simple_stroul
The variable inst is a __u32 type and hence the function used should be
simple_strtoul.
Semantic patch used:

@@
typedef __u32;
__u32 e;
@@
e =
- simple_strtol
+ simple_strtoul
  (...)

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:38:17 -07:00
Mike Rapoport c9f6bb961d staging: lustre: add a blank line after function/struct/union/enum declarations
Fixes checkpatch.pl CHECK:LINE_SPACING: Please use a blank line after
function/struct/union/enum declarations

The patch is generated using checkpatch.pl --fix-inplace:

for f in $(find drivers/staging/lustre/ -type f) ; do
    ./scripts/checkpatch.pl --types "LINE_SPACING" --fix-inplace -f $f
done

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13 10:21:10 -07:00
Mike Rapoport 106495c41f staging: lustre: remove multiple blank lines
Fixes checkpatch.pl CHECK:LINE_SPACING: Please don't use multiple blank
lines.

The patch is generated using checkpatch.pl --fix-inplace:

for f in $(find drivers/staging/lustre/ -type f) ; do
    ./scripts/checkpatch.pl --types "LINE_SPACING" --test-only=multiple \
    --fix-inplace  -f $f
done

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13 10:21:10 -07:00
Mike Rapoport 50ffcb7edc staging: lustre: add missing blank line after declarations
Fixes checkpatch.pl WARNING:LINE_SPACING: Missing a blank line after
declarations.
The patch is generated using checkpatch.pl --fix-inplace:

for f in $(find drivers/staging/lustre/ -type f) ; do
    ./scripts/checkpatch.pl --types "LINE_SPACING" --test-only=Missing \
    --fix-inplace -f $f
done

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13 10:21:10 -07:00
Rocco Folino 961354612e staging/lustre: Make nrs_policy_get_info_locked() static
This patch fixes the warning generated by sparse: "symbol 'nrs_policy_get_info_locked' was not
declared. Should it be static?" by declaring the function static.

Signed-off-by: Rocco Folino <rocco@devzen.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 08:46:19 +01:00
Oleg Drokin f24f47a477 staging/lustre: Remove unused target_print_req()
This is a server-side request printing function, so we don't
really need it on the client.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 15:22:27 +02:00
Oleg Drokin c860a3bd56 staging/lustre/obdclass: Remove unused lprocfs_wr_evict_client
This is only used on the servers to evict clients.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:06:17 +02:00
Arnd Bergmann 219e6de627 staging/lustre: use 64-bit times for request times
All request timestamps and deadlines in lustre are recorded in time_t
and timeval units, which overflow in 2038 on 32-bit systems.

In this patch, I'm converting them to time64_t and timespec64,
respectively. Unfortunately, this makes a relatively large patch,
but I could not find an obvious way to split it up some more without
breaking atomicity of the change.

Also unfortunately, this introduces two instances of div_u64_rem()
in the request path, which can be slow on 32-bit architectures. This
can probably be avoided by a larger restructuring of the code, but
it is unlikely that lustre is used in performance critical setups
on 32-bit architectures, so it seems better to optimize for correctness
rather than speed here.

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:06:16 +02:00
Arnd Bergmann 0ac0478b65 staging/lustre: use 64-bit time for adaptive timeout
The adaptive timeout handling stores absolute times in 32-bit time_t
quantities, which will overflow in 2038.

This changes it to use time64_t.

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
Anton Gerasimov 9dc3840b4e staging: lustre: moved extern declarations to a header
This patch moves declarations of variables used in several files
across the ptlrpc module from source files to a local header.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 03:58:40 +02:00
Oleg Drokin c0a2472fa8 staging/lustre: Remove references to OBD_ALLOC/FREE* in comments
Since everything is now supposed to use regular kernel alloc and
free functions.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 20:32:11 -07:00
Mike Rapoport b2952d62ba staging: lustre: fix whitespace errors reported by checkpatch.pl
Added/removed spaces and replaced '+1' with '1' in several places to
eliminate SPACING and POINTER_LOCATION errors reported by checkpatch.pl

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:39 -07:00
Julia Lawall 597851ac2a staging: lustre: ptlrpc: Use !x to check for kzalloc failure
!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-13 19:35:53 -07:00
Dan Carpenter b815555df8 Staging: lustre: ptlrpc: signedness bug in high_priority_ratio_store()
We want to store a non-negative int here.  The original code had a check
for unsigned long less than zero which is a mistake but also casting
from a positive long to an int can result in a negative number.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 12:39:01 -07:00
Chris Hanna d0bfef31f4 staging: lustre: ptlrpc: clean up whitespace and align function params
Minor changes to remove excessive whitespace and improve
readability of ptlrpc functions.

Signed-off-by: Chris Hanna <hannac@iu.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 12:32:09 -07:00
Dmitry Eremin e4ba525e8f staging/lustre/obd: final removal of procfs stuff
Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 15:26:38 +09:00
Dmitry Eremin 61e87ab0f8 staging/lustre/obd: move status files from procfs to debugfs
change type of
* obd->obd_proc_entry
* obd->obd_svc_procroot
* lov->lov_pool_proc_entry
* obd_type->typ_procroot
* pool_desc->pool_proc_entry

Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:19:57 +09:00
Dmitry Eremin 700815d47f staging/lustre/ldlm: move all remaining files from procfs to debugfs
Move all files except stats. It will be moved later after change
type of obddev->obd_proc_entry member.

Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:14:51 +09:00
Oleg Drokin b40881e579 staging/lustre/ptlrpc: move procfs high_priority_ratio file to sysfs
Move ptlrpc service high_priority_ratio entry from procfs to sysfs.
Currently in use only by ldlm callback service only in
/sys/fs/lustre/ldlm/services/ldlm_cbd/

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:13:20 +09:00
Oleg Drokin 673a6796f2 staging/lustre/ptlrpc: move procfs threads* files to sysfs
Move ptlrpc service threads_min, threads_max and threads_running
entries from procfs to sysfs.
Currently in use only by ldlm callback service only in
/sys/fs/lustre/ldlm/services/ldlm_cbd/

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:13:20 +09:00
Oleg Drokin 328676f823 staging/lustre/ptlrpc: Add infrastructure for sysfs migration
Added necessary plumbing for ptlrpc sysfs integration for registered
services, sysfs directory registration.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:13:20 +09:00
Julia Lawall 848e90c332 Staging: lustre: ptlrpc: lproc_ptlrpc: remove unneeded null test before free
Kfree can cope with a null argument, so drop null tests.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression ptr; @@

- if (ptr != NULL)
  kfree(ptr);
// </smpl>

In the first case, the only cleanup needed is the unlock, so jump to that
directly.

Likewise, in the first two failure cases of ptlrpc_lprocfs_nrs_seq_write,
no cleanup is needed, so just drop the goto and return directly.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:23:56 +02:00
Julia Lawall 9ae1059728 staging: lustre: ptlrpc: Use kzalloc and kfree
Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by
kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree.

A simplified version of the semantic patch that makes these changes is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@ expression ptr,size; @@
- OBD_ALLOC(ptr,size)
+ ptr = kzalloc(size, GFP_NOFS)

@@ expression ptr, size; @@
- OBD_FREE(ptr, size);
+ kfree(ptr);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:23:50 +02:00
Joe Perches 91b3a68558 staging: lustre: Convert uses of "int rc = seq_printf(...)"
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c03 ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Convert these uses to:

	seq_printf(seq, ...);

	return 0;

Done via cocci script:

@@
struct seq_file *seq;
int i;
@@
-	i = seq_printf(seq,
+	seq_printf(seq,
		   ...);
	...
-	return i;
+	return 0;

@@
struct seq_file *seq;
int i;
@@
-	i = 0;
-	i += seq_printf(seq,
+	seq_printf(seq,
	           ...);
	...
-	return i;
+	return 0;

With some additional reformatting and typing post conversion
to remove the now unnecessary "int i;" declaration.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 20:19:01 -08:00
Joe Perches 8faeebdf15 staging: lustre: Convert "return seq_printf(...)" uses
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c03 ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Convert these "return seq_printf(...)" uses to:

	seq_printf(seq, ...);
	return 0;

Done via cocci script:

@@
struct seq_file *seq;
@@

-	return
	\(seq_printf\|seq_puts\|seq_putc\)(seq,
	...);

+	return 0;

With some additional reformatting and typing post conversion.

Miscellanea:

o convert an rc++ use to a bool
o use seq_puts with fixed strings where appropriate

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:21:21 -08:00
Melike Yurtoglu b2ca1d8b50 Staging: lustre: Deleted space prohibited between function name and open parenthesis
WARNING: space prohibited between function name and open parenthesis '('
Remove unnecessary space between function name and opening parenthesis.
That was found by running checkpatch

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 16:35:11 -08:00
Melike Yurtoglu dddf4c23bb Staging: lustre: Added const
WARNING: struct file_operations should normally be const.
That was found by running checkpatch.

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 16:35:11 -08:00
Jon Bernard b3c986d3c1 staging: lustre: ptlrpc: fix lproc_ptlrpc static declarations
This patch fixes the following sparse warnings:

drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:51:3⚠️
 symbol 'll_rpc_opcode_table' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:142:3: warning:
 symbol 'll_eopcode_table' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:178:12: warning:
 symbol 'll_eopcode2str' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:731:1: warning:
 symbol 'ptlrpc_lprocfs_svc_req_history_seek' was not declared. Should it be static?

Signed-off-by: Jon Bernard <jbernard@tuxion.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Fred Chou ff2bf19e8d staging:lustre:lustre:ptlrpc: fix sparse warnings in lproc_ptlrpc.c
Fixed the below warning in sparse:

drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:184:6:
warning: symbol 'ptlrpc_lprocfs_register' was not declared.
Should it be static?

Signed-off-by: Fred Chou <fred.chou.nd@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:30:59 -08:00
Tristan Lelong e84962e3af staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
This patch fix a sparse warning in lustre sources

warning: incorrect type in argument 1 (different address spaces)
    expected void [noderef] <asn:1>*to
    got char *<noident>

This is done by adding the missing __user attribute on userland pointers inside the LPROC_SEQ_FOPS like macros:
- LPROC_SEQ_FOPS
- LPROC_SEQ_FOPS_RW_TYPE
- LPROC_SEQ_FOPS_WR_ONLY
- LDLM_POOL_PROC_WRITER

The patch also updates all the functions that are used by this macro:
- lprocfs_wr_*
- *_seq_write

as well as some helpers used by the previously modified functions (otherwise fixing the sparse warning add some new ones):
- lprocfs_write_frac_helper
- lprocfs_write_helper
- lprocfs_write_u64_helper

The patch also fixes one __user pointer direct dereference by strncmp in function fld_proc_hash_seq_write.

Signed-off-by: Tristan Lelong <tristan@lelong.xyz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:26:22 -08:00
Joe Perches 2d00bd17a2 staging: lustre: Coalesce string fragments
Join the string fragments to make it easier to grep.

Ignored all the 80+ column lines.
Added many missing spaces when coalescing formats.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-23 13:17:57 -08:00
Greg Donald 9c234f6cb4 drivers: staging: lustre: Fix "'foo* bar' should be 'foo *bar'" errors
Fix checkpatch.pl "'foo* bar' should be 'foo *bar'" errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:14 +08:00
Greg Donald 4d1d413aea drivers: staging: lustre: Fix "else should follow close brace '}'" errors
Fix checkpatch.pl "else should follow close brace '}'" errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:13 +08:00
Julia Lawall a9b3e8f30e staging: lustre: ptlrpc: expand the GOTO macro
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier lbl;
identifier rc;
constant c;
@@

- GOTO(lbl,\(rc\|c\));
+ goto lbl;

@@
identifier lbl;
expression rc;
@@

- GOTO(lbl,rc);
+ rc;
+ goto lbl;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 12:49:17 -07:00
Greg Donald 1d8cb70c7b drivers: staging: lustre: Fix space required after that ',' errors
Fix checkpatch.pl space required after that ',' errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 12:05:39 -07:00
Anil Belur 29dd4f9be6 staging: lustre: ptlrpc: lproc_ptlrpc.c - fix dereferenceing user space buffer
- this fixes sparse warning for directly deferencing user space buffer

drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:652:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:652:33:    expected void const [noderef] <asn:1>*from
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:652:33:    got char const *buffer

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-01 14:42:51 -07:00
Greg Kroah-Hartman f267cdb464 staging: lustre: use CONFIG_PROC_FS
Don't rely on a "custom" LPROCFS define, it's not needed, just check for
the real thing.  This will let us delete a whole .h file that is not
being used for anything other than one #define.

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 21:13:25 -07:00
Greg Kroah-Hartman b0f5aad587 staging: lustre: remove LPU64 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:25:57 -07:00
Greg Kroah-Hartman f537dd2c3c staging: lustre: remove LPD64 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 18:41:09 -07:00
Greg Kroah-Hartman 7264b8a5db staging: lustre: remove cfs_time_current_sec wrapper
Just call get_seconds() directly.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-12 00:38:48 -07:00