Umount process relies on lu_site_purge(-1) to purge all
objects before umount, however, if there happen to have a
cache shrinker which calls lu_site_purge(nr) in parallel,
some objects may still being freed by cache shrinker even
after the lu_site_purge(-1) called by umount done.
This can be simply fixed by serializing purge threads,
since it doesn't make any sense to have them in parallel.
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5331
Reviewed-on: http://review.whamcloud.com/11099 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John L. Hammond [Sun, 18 Sep 2016 20:37:07 +0000 (16:37 -0400)]
staging: lustre: obd: add rnb_ prefix to struct niobuf_remote members
Add the prefix rnb_ to the members of struct niobuf_remote. Delete the
relevant compat macros from ofd_internal.h.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5061
Reviewed-on: http://review.whamcloud.com/10452 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John L. Hammond [Sun, 18 Sep 2016 20:37:06 +0000 (16:37 -0400)]
staging: lustre: obd: add lnb_ prefix to members of struct niobuf_local
Add the prefix lnb_ to the members of struct niobuf_local that do not
already have it. Change the struct dentry *lnb_dentry member to void
*lnb_data as it is not used to hold a pointer to struct dentry.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5061
Reviewed-on: http://review.whamcloud.com/10451 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wang di [Sun, 18 Sep 2016 20:37:05 +0000 (16:37 -0400)]
staging: lustre: lmv: Do not ignore ENOENT in lmv_unlink
Return correct value (rc) in lmv_unlink. In lmv_unlink,
-ENOENT might be ingored for local directory unlink.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5371
Reviewed-on: http://review.whamcloud.com/11170 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
two optimizations in the busy loop wait in class_cleanup():
(1) remove unnecessary spinlocks protecting obd_conn_inprogress
access
(2) replace cond_resched by more suitable yield to unconditionally
yield the CPU if the condition check fails.
Signed-off-by: Alexander Zarochentsev <alexander_zarochentsev@xyratex.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5397
Xyratex-bug-id: MRP-1991
Reviewed-on: http://review.whamcloud.com/11198 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wang di [Sun, 18 Sep 2016 20:37:03 +0000 (16:37 -0400)]
staging: lustre: lmv: honor MDT index when creating volatile file
LMV should honor MDT index embedded in the name of volatile
file, then during hsm restore, the file under striped dir can
be restored to the right MDT.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4691
Reviewed-on: http://review.whamcloud.com/10866 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Henri Doreau <henri.doreau@cea.fr> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Li Xi [Sun, 18 Sep 2016 20:37:00 +0000 (16:37 -0400)]
staging: lustre: llite: fix ll_statahead_thread() problems on failure
When ll_prep_md_op_data() fails, ll_statahead_thread() does not
release reference of sai and parent dentry. It does not wake
up parent thread either. This patch fixes these problems.
Signed-off-by: Li Xi <lixi@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5274
Reviewed-on: http://review.whamcloud.com/10940 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch compresses the return logic into a single statement
and removes the now unused return variable.
Done using coccinelle:
@@
type T;
identifier r;
@@
- T r;
... when !=r
- r =
+ return
...;
- return r;
staging: ks7010: Remove space after '(' and before ')'
The patch fixes the following errors detected by checkpatch.pl:
ERROR: space prohibited before that close parenthesis ')'
ERROR: space prohibited after that open parenthesis '('
staging: media: davinci_vpfe: Use BIT macro instead of left shifting 1
This patch replaces left shifts on 1 with the BIT(x) macro, as suggested
by checkpatch.pl.
This was done using coccinelle script:
@@
constant c;
@@
- (1 << c)
+ BIT(c)
Staging: ks7010: Remove extern keyword from function declaration
Remove extern specifier from function declaration as they have
it by default. Also move extern declaration from .c files to
their respective header file 'ks_hostif.h'. Coccinelle was used
to remove extern and other changes were done by hand.
Script:
@@
identifier func;
type T;
@@
- extern
T func(...);
staging: lustre: lmv: mark symbols static where possible
We get a few warnings when building kernel with W=1:
drivers/staging/lustre/lustre/lmv/lmv_obd.c:1640:1: warning: no previous prototype for 'lmv_locate_target_for_name' [-Wmissing-prototypes]
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2421:5: warning: no previous prototype for 'lmv_read_page' [-Wmissing-prototypes]
....
In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
so this patch marks these functions with 'static'.
staging/lustre: clean function declaration in cl_io.c up
We get 1 warning when building kernel with W=1:
drivers/staging/lustre/lustre/obdclass/cl_page.c:488:6: warning: no previous prototype for 'cl_page_disown0' [-Wmissing-prototypes]
In fact, this function is declared in
drivers/staging/lustre/lustre/obdclass/cl_io.c, but should be
removed in a header file. thus can be recognized in other file.
So this patch moves the declaration into
drivers/staging/lustre/lustre/include/cl_object.h.
staging: lustre: obdclass: clean function declarations in obd_config.c and class_obd.c up
We get 3 warnings when building kernel with W=1:
drivers/staging/lustre/lustre/obdclass/obd_mount.c:705:5: warning: no previous prototype for 'lustre_check_exclusion' [-Wmissing-prototypes]
drivers/staging/lustre/lustre/obdclass/obd_mount.c:1226:5: warning: no previous prototype for 'lustre_register_fs' [-Wmissing-prototypes]
drivers/staging/lustre/lustre/obdclass/obd_mount.c:1231:5: warning: no previous prototype for 'lustre_unregister_fs' [-Wmissing-prototypes]
In fact, the first function is declared in
drivers/staging/lustre/lustre/obdclass/obd_config.c,
and the other two functions are declared in
drivers/staging/lustre/lustre/obdclass/class_obd.c,
but all of these functions should be declared in
a header file, thus can be recognized in other file.
So this patch moves the declarations into
drivers/staging/lustre/lustre/include/obd_class.h.
staging/lustre: clean function declaration in super25.c up
We get 1 warning when building kernel with W=1:
drivers/staging/lustre/lustre/obdclass/obd_config.c:719:6: warning: no previous prototype for 'lustre_register_client_process_config' [-Wmissing-prototypes]
In fact, this function is declared in
drivers/staging/lustre/lustre/llite/super25.c, but should be
moved into a header file, thus can be recognized in other file.
So this patch moves the declaration into
drivers/staging/lustre/lustre/include/lprocfs_status.h.
staging: lustre: clean function declaration in super25.c up
We get 1 warning when building kernel with W=1:
drivers/staging/lustre/lnet/selftest/conctl.c:804:1: warning: no previous prototype for 'lstcon_ioctl_entry' [-Wmissing-prototypes]
In fact, this function is declared in
drivers/staging/lustre/lustre/llite/super25.c, but should be
moved into a header file, thus can be recognized in other file.
So this patch moves the declaration into
drivers/staging/lustre/lnet/selftest/console.h
Staging: ks7010: Replace memset with eth_zero_addr
Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Coccinelle was used to do the replacement and add the
header file linux/etherdevice.h if not already present.
Script:
@header@
@@
#include <linux/etherdevice.h>
staging: wilc1000: Use sizeof type *pointer instead of sizeof type
The patch uses the size of the dereference to a variable instead of it's type,
to make the code more resistant to type changes in the future. The type of the
pointer variable here is the same as the type in the argument that is being
replaced in sizeof().
Staging: comedi: s626: Remove all unused functions
Remove all #ifdef'ed static functions as they are not used anywhere
in the kernel. Some functions were detected using Coccinelle but removed by
hand and some were removed as the functions in which they were getting
used were also unused functions.
Script:
The newly added Hi6220 Ion code fails to build when the ION_OF helpers
are not present:
drivers/staging/android/ion/hisilicon/hi6220_ion.o: In function `hi6220_ion_remove':
hi6220_ion.c:(.text.hi6220_ion_remove+0x4c): undefined reference to `ion_destroy_platform_data'
drivers/staging/android/ion/hisilicon/hi6220_ion.o: In function `hi6220_ion_probe':
hi6220_ion.c:(.text.hi6220_ion_probe+0x5c): undefined reference to `ion_parse_dt'
hi6220_ion.c:(.text.hi6220_ion_probe+0xf8): undefined reference to `ion_destroy_platform_data'
This selects the symbol when needed.
Fixes: 2b40182a19bc ("staging: android: ion: Add ion driver for Hi6220 SoC platform") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Laura Abbott <labbott@redhat.com> Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: android: ion: Fix return value check in hi6220_ion_probe()
In case of error, the function ion_device_create() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().
Instead of storing the return value of a function call into a variable and
then returning it, we can club the two into a single return statement. This
change was made using the following semantic patch by Coccinelle:
add braces to if/else clause to fix the checkpatch issue braces {}
should be used on all arms of if/else block. Does not affect flow
because only single statement inside if/else block.
staging: gs_fpgaboot: Remove FSF address from GPL notice
This patch fixes the checkpatch.pl warning:
CHECK: Do not include the paragraph about writing to the Free Software
Foundation's mailing address from the sample GPL notice. The FSF has
changed addresses in the past, and may do so again. Linux already
includes a copy of the GPL.
The function xlr_wakeup_queue is not used anywhere in the kernel.
Therefore, remove it. The static unused functions were detected
using Coccinelle but the change was done by hand.
Script used:
staging: ks7010: Remove the explicit cast on kmalloc
The assignment operator implicitly converts a void pointer to the type of the
pointer it is assigned to. Hence an explicit cast on the result of the kmalloc
function is not required.
Moshe Green [Thu, 15 Sep 2016 20:16:11 +0000 (23:16 +0300)]
staging: sm750fb: fix block comment style and spelling issues in ddk750_chip.c
Fix the following warning types:
- line length
- block comment line * prefix
- trailing */ on a separate line
found by the checkpatch.pl tool in multiple block comments.
Fix a single spelling error in a comment.
Signed-off-by: Moshe Green <mgmoshes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>