1
0
Fork 0
Commit Graph

78 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 Nunez 19b2056ff7 staging: lustre: Correct missing newline
Several error messages are missing newline characters
at the end of the message. Newlines are added where
necessary and other minor corrections; no punctuation
at the end of an error message, add a return code to
the end of error messages, device name at the beginning,
etc.

There are just a couple of places where newlines are
removed and this is only in LDLM_DEBUG_NOLOCK. The definition
of LDLM_DEBUG_NOLOCK already has a newline in it and
resulted in double newlines printed.

Signed-off-by: James Nunez <james.a.nunez@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4871
Reviewed-on: http://review.whamcloud.com/10000
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Cliff White <cliff.white@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-07 16:17:45 -08:00
Amitoj Kaur Chawla c4418daca7 staging: lustre: osc: Replace kmem_cache_alloc with kmem_cache_zalloc
Use kmem_cache_zalloc instead of manually setting kmem_cache_alloc
with flag GFP_ZERO since kmem_alloc_zalloc sets allocated memory
to zero.

The Coccinelle semantic patch used to make this change is as
follows:
// <smpl>
@@
expression e,f;
@@
- kmem_cache_alloc(e, f |__GFP_ZERO)
+ kmem_cache_zalloc(e, f)
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:18:42 -08:00
Oleg Drokin 79910d7dd5 staging/lustre/osc: 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 72a87fca41 staging/lustre: Remove stray space before newline in messages
There were some messages in Lustre that ended with a space followed by
a newline which is pointless, so remove the extra spaces.
Found with 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 defa220fad staging/lustre: Fix indentation mistakes
none look like bugs or bugs-inducing, mostly just
off by a couple of spaces all around.

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 30aa9c5262 staging/lustre/osc: 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 52ee0d20c1 staging/lustre: Remove ldlm type/mode typedefs
Replace ldlm_mode_t with enum ldlm_mode,
ldlm_type_t with enum ldlm_type

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 d133210f2f staging/lustre: Get rid of cksum_type_t typedef
Replace it with enum cksum_type

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
Amitoj Kaur Chawla f51e5a202e staging: lustre: osc: osc_request: Declare local function and structure as static
Declare osc_cleanup() function and osc_obd_ops structure as static
since they are defined and called only in this file.

Removed osc_cleanup() function prototype since it wasn't required.

This fixes the following sparse warnings:
drivers/staging/lustre/lustre/osc/osc_request.c:3210:5: warning:
symbol 'osc_cleanup' was not declared. Should it be static?
drivers/staging/lustre/lustre/osc/osc_request.c:3259:16: warning:
symbol 'osc_obd_ops' was not declared. Should it be static?

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:38:33 -08:00
Oleg Drokin 7f1ae4c066 staging/lustre/osc: 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
Oleg Drokin ec2d71d083 staging/lustre/osc: Mark osc_getstripe user pointer argument as __user
This shuts some sparse address space mismatch warnings

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:34:00 -08:00
Oleg Drokin e09bee346e staging/lustre: Properly mark obd_iocontrol argument as __user
Also update all methods and calls everywhere.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:29:30 -08:00
Markus Elfring c71d264543 staging: lustre: Fix a jump label position in osc_get_info()
The script "checkpatch.pl" pointed out that labels should not be indented.
Thus delete a horizontal tab before the jump label "out"
in the function "osc_get_info".

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:49:06 -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
James Simmons a045547158 staging: lustre: Update module author to OpenSFS
The modinfo data has gone stale for the author information.
This patch changes all the MODULE_AUTHOR to OpenSFS.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6204
Reviewed-on: http://review.whamcloud.com/16132
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Shraddha Barke 74d4ec1149 Staging: lustre: osc: Declare local functions as static
Declare osc_real_create, osc_create and osc_cleanup as static
since they are used only in this particular file. Also remove the
corresponding declarations from header file.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Dan Carpenter a13b1f3241 staging: lustre: remove o_ prefix from function pointers
We mostly refer to these function pointers using macros that use macro
magic to add the "o_" prefix to the front.  It means that you can't use
cscope to find the caller.  Heck, you can't even grep for it.

I looked at preserving the "o_" prefix by removing the macro magic and
adding "o_" to all the call sites but then I realized that, really, the
prefix doesn't add any value.  Let's just remove it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08: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
Mike Rapoport 2ba262fb6a staging: lustre: replace OBDO_FREE with kmem_cache_free
Use kmem_cache_free directly instead of wrapping macro.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:44:26 -07:00
Mike Rapoport 131637b811 staging: lustre: replace OBDO_ALLOC with kmem_cache_alloc
Use direct call to kmem_cache_alloc instead of wrapping macro

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 18:44:26 -07:00
Amitoj Kaur Chawla 167a47c520 staging: lustre: osc: Remove useless cast on void pointer
The semantic patch used to find this is:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:22:26 -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
Shraddha Barke f999d0987e Staging: lustre: osc: Remove null check before kfree
kfree on NULL pointer is a no-op.
The semantic patch used to find such an instance where NULL check is
present before kfree-

// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>smpl>

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 16:45:21 -07:00
Oleg Drokin ef2e0f55ec staging/lustre: Remove mds/ost capabilities support
Client capabilities is an outdated feature that never worked properly,
so let's get rid of the client support since modern servers
don't have this support either.

The patch is big, but since it just removes one large feature,
so it's hopefully easy to verify.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:06:19 +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
Olaf Weber c5c4c6fae0 staging/lustre/ptlrpc: make ptlrpcd threads cpt-aware
On NUMA systems, the placement of worker threads relative to the
memory they use greatly affects performance. The CPT mechanism can be
used to constrain a number of Lustre thread types, and this change
makes it possible to configure the placement of ptlrpcd threads in a
similar manner.

To simplify the code changes, the global structures used to manage
ptlrpcd threads are changed to one per CPT. In particular this means
there will be one ptlrpcd recovery thread per CPT.

To prevent ptlrpcd threads from wandering all over the system, all
ptlrpcd thread are bound to a CPT. Note that some CPT configuration
is always created, but the defaults are not likely to be correct for
a NUMA system. After discussing the options with Liang Zhen we
decided that we would not bind ptlrpcd threads to specific CPUs,
and rather trust the kernel scheduler to migrate ptlrpcd threads.

With all ptlrpcd threads bound to a CPT, but not to specific CPUs,
the load policy mechanism can be radically simplified:

- PDL_POLICY_LOCAL and PDL_POLICY_ROUND are currently identical.
- PDL_POLICY_ROUND, if fully implemented, would cost us the locality
  we are trying to achieve, so most or all calls using this policy
  would have to be changed to PDL_POLICY_LOCAL.
- PDL_POLICY_PREFERRED is not used, and cannot be implemented without
  binding ptlrpcd threads to individual CPUs.
- PDL_POLICY_SAME is rarely used, and cannot be implemented without
  binding ptlrpcd threads to individual CPUs.

The partner mechanism is also updated, because now all ptlrpcd
threads are "bound" threads. The only difference between the various
bind policies, PDB_POLICY_NONE, PDB_POLICY_FULL, PDB_POLICY_PAIR, and
PDB_POLICY_NEIGHBOR, is the number of partner threads. The bind
policy is replaced with a tunable that directly specifies the size of
the groups of ptlrpcd partner threads.

Ensure that the ptlrpc_request_set for a ptlrpcd thread is created on
the same CPT that the thread will work on. When threads are bound to
specific nodes and/or CPUs in a NUMA system, it pays to ensure that
the datastructures used by these threads are also on the same node.

Visible changes:

* ptlrpcd thread names include the CPT number, for example
  "ptlrpcd_02_07". In this case the "07" is relative to the CPT, and
  not a CPU number.

Tunables added:

* ptlrpcd_cpts (string): A CPT string describing the CPU partitions
  that ptlrpcd threads should run on. Used to make ptlrpcd threads
  run on a subset of all CPTs.

* ptlrpcd_per_cpt_max (int): The maximum number of ptlrpcd threads
  to run in a CPT.

* ptlrpcd_partner_group_size (int): The desired number of threads
  in each ptlrpcd partner thread group. Default is 2, corresponding
  to the old PDB_POLICY_PAIR. A negative value makes all ptlrpcd
  threads in a CPT partners of each other.

Tunables obsoleted:

* max_ptlrpcds: The new ptlrcpd_per_cpt_max can be used to obtain the
  same effect.

* ptlrpcd_bind_policy: The new ptlrpcd_partner_group_size can be used
  to obtain the same effect.

Internal interface changes:

* pdb_policy_t and related code have been removed. Groups of partner
  ptlrpcd threads are still created, and all threads in a partner
  group are bound on the same CPT. The ptlrpcd threads bound to a
  CPT are typically divided into several partner groups. The partner
  groups on a CPT all have an equal number of ptlrpcd threads.

* pdl_policy_t and related code have been removed. Since ptlrpcd
  threads are not bound to a specific CPU, all the code that avoids
  scheduling on the current CPU (or attempts to do so) has been
  removed as non-functional. A simplified form of PDL_POLICY_LOCAL
  is kept as the only load policy.

* LIOD_BIND and related code have been removed. All ptlrpcd threads
  are now bound to a CPT, and no additional binding policy is
  implemented.

* ptlrpc_prep_set(): Changed to allocate a ptlrpc_request_set
  on the current CPT.

* ptlrpcd(): If an error is encountered before entering the main loop
  store the error in pc_error before exiting.

* ptlrpcd_start(): Check pc_error to verify that the ptlrpcd thread
  has successfully entered its main loop.

* ptlrpcd_init(): Initialize the struct ptlrpcd_ctl for all threads
  for a CPT before starting any of them. This closes a race during
  startup where a partner thread could reference a non-initialized
  struct ptlrpcd_ctl.

Signed-off-by: Olaf Weber <olaf@sgi.com>
Reviewed-on: http://review.whamcloud.com/13972
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6325
Reviewed-by: Grégoire Pichon <gregoire.pichon@bull.net>
Reviewed-by: Stephen Champion <schamp@sgi.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-15 06:26:55 -07:00
Li Xi aefd9d714d staging/lustre/osc: use global osc_rq_pool to reduce memory usage
The per-osc request pools consume a lot of memory if there are
hundreds of OSCs on one client. This will be a critical problem
if the client doesn't have sufficient memory for both OSCs and
applications.

This patch replaces per-osc request pools with a global pool
osc_rq_pool. The total memory usage is 5MB by default. And it
can be set by a module parameter of OSC:
"options osc osc_reqpool_mem_max=POOL_SIZE". The unit of POOL_SIZE
is MB. If cl_max_rpcs_in_flight is the same for all OSCs, the
memory usage of the OSC pool can be calculated as:
Min(POOL_SIZE * 1M,
    (cl_max_rpcs_in_flight + 2) * OSC number * OST_MAXREQSIZE)

Also, this patch changes the allocation logic of OSC write requests.
The allocation from osc_rq_pool will only be tried after normal
allocation failed.

Signed-off-by: Wu Libin <lwu@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Li Xi <lixi@ddn.com>
Reviewed-on: http://review.whamcloud.com/15422
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6770
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-15 06:26:55 -07:00
Shraddha Barke e72f36e22c Staging: lustre: osc: Space prohibited between function name and open parenthesis
This patch fixes the checkpatch.pl warning:

WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:49 -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
Shraddha Barke b785675385 Staging: lustre: osc: Drop unnecessary cast on void *
This patch does away with the cast on void * as it is unnecessary.

Semantic patch used is as follows:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 12:18:00 -07:00
Julia Lawall 3408e9aeee staging: lustre: osc: 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
Antonio Murdaca 71e8dd9a2f staging: lustre: cleanup not needed else clauses
cleanup checkpatch.pl warnings about not needed else
clauses after a break or return

Signed-off-by: Antonio Murdaca <antonio.murdaca@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:15:38 -07:00
Chris Hanna 29ac6840d7 staging: lustre: osc: clean up whitespace and align function parameters
Minor changes to remove excessive whitespace and improve
readability of osc 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
Oleg Drokin 9b8013023c staging/lustre/obdclass: Prepare for procfs to sysfs migration
Add necessary plumbing to register obd types and instances
under /sys/fs/lustre

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:18:23 +09:00
Oleg Drokin 2962b440df staging/lustre: Remove useless num_refs procfs variable
Every obd type registers it, but it's not really needed by anybody.
Remove all the supporting infrastructure too.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:16:54 +09:00
Julia Lawall 59e267c07b Staging: lustre: osc: 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>

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 7795178d1e staging: lustre: osc: 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
Niu Yawei 3ce08cd7a2 staging/lustre: update timestamps after buiding rpc
The mtime/atime/ctime in the write RPC has to be updated after
the RPC is built (where xid is generated), otherwise, it could
race with the setattr and updating wrong timestamps on OST side.

Seems this regression was introduced when landing clio code.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-on: http://review.whamcloud.com/13261
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5951
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 11:11:44 +01:00
Hatice ERTÜRK 7cf1054b8c Staging: lustre: lustre: osc: Insert missing space before '|'
Insert missing space before '|' to improve readability.

This Error found with checkpatch.pl

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 15:14:53 -08:00
Andreas Ruprecht b47ea4bbfe staging: lustre: osc: Make osc_init() static
osc_init() is marked as the module_init function in osc_request.c
and is never used anywhere else. Hence, it can (and should) be
declared static.

sparse also complained about this with the following warning, which
is fixed by this patch.

andreas@workbox:~/linux-next$ make C=1 M=drivers/staging/lustre/lustre/osc/
[...]
drivers/staging/lustre/lustre/osc/osc_request.c:3335:12: warning:
symbol 'osc_init' was not declared. Should it be static?
[...]

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:27:16 +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
Heena Sirwani 41f8d410ae Staging: lustre: lustre: osc: Remove variable that is not very useful.
The following patch removes a variable that is not very useful using
coccinelle.
The semantic patch used was:
@@
identifier ret;
@@

-int ret = 0;
 ... when != ret
     when strict
-return ret;
+return 0;

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:10 +08:00
Tina Johnson 26c4ea46a5 Staging: lustre: Replace GOTO macro with necessary code
The GOTO macro is neither standard in Linux nor does its definiton
contain much useful code. Hence GOTO can be replaced with useful
parts of its definition. In a statement like GOTO(label, rc), the
replacing code will be goto label if rc is a constant or a variable.
But in cases like GOTO(label, e) where e is an assignment statement,
both assignment and goto statements are kept.

This patch was done using Coccinelle and the following semantic
patch was used:

@@
identifier rc,label;
expression e;
constant c;
@@

(
-GOTO(label,rc = e);
+rc = e;
+goto label;
|
-GOTO(label,rc);
+goto label;
|
-GOTO(label,c);
+goto label;
)

Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:18:41 -07:00
John L. Hammond f024bad46a staging/lustre: remove obd_ost.h
Move the structures defined in lustre/include/obd_ost.h to the one
file that uses them (lustre/osc/osc_request.c). Remove the unused
function osc_update_enqueue(). Remove the then empty header
lustre/include/obd_ost.h.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 12:37:04 -07:00
John L. Hammond dd45f477f5 staging/lustre/osc: remove obsolete llog handling code
In osc_request.c there is no reason to handle any llog contexts since
they are never setup. Remove the functions unused function
osc_llog_init() and the obsolete function osc_llog_finish(). Remove
the llog cleanup code in osc_disconnect() and osc_precleanup().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 12:37:04 -07:00
John L. Hammond 5a659b6370 staging/lustre/osc: remove unused OBD methods
Remove the unused OBD device methods:
    osc_brw()
    osc_cancel()
    osc_cancel_unused()
    osc_change_cbdata()
    osc_enqueue()
    osc_punch()
    osc_sync()
and their supporting functions.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 12:37:03 -07:00
Greg Donald e8291974f9 drivers: staging: lustre: Fix return is not a function, parentheses are not required errors
Fix checkpatch.pl return is not a function, parentheses are not required errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 10:29:51 -07:00
Julia Lawall fbe7c6c72a staging: lustre: remove parentheses from return arguments
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier i;
constant c;
@@

return
- (
    \(i\|-i\|i(...)\|c\)
- )
  ;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 12:07:35 -07:00