1
0
Fork 0
Commit Graph

383 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
Bhaktipriya Shridhar 6069f756d4 staging: lustre: obdclass: Use list_for_each_entry_safe
Doubly linked lists which are  iterated  using list_empty
and list_entry macros have been replaced with list_for_each_entry_safe
macro.
This makes the iteration simpler and more readable.

This patch replaces the while loop containing list_empty and list_entry
with list_for_each_entry_safe.

This was done with Coccinelle.

@@
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@

T *I1;
+ T *tmp;
...
- while (list_empty(&E1) == 0)
+ list_for_each_entry_safe (I1, tmp, &E1, I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...
}

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08: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
Sebastien Buisson a739735c55 staging: lustre: fix 'NULL pointer dereference' errors
Fix 'NULL pointer dereference' defects found by Coverity version
6.5.3:
Dereference after null check (FORWARD_NULL)
For instance, Passing null pointer to a function which dereferences
it.
Dereference before null check (REVERSE_INULL)
Null-checking variable suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
Dereference null return value (NULL_RETURNS)

The following fixes for the LNet layer are broken out of patch
http://review.whamcloud.com/4720.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2217
Reviewed-on: http://review.whamcloud.com/4720
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>
2016-03-07 16:17:45 -08:00
Frank Zago 9c3796639d staging: lustre: corrected some typos and grammar errors
Cleanup various typos and grammar errors.

Signed-off-by: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5710
Reviewed-on: http://review.whamcloud.com/12201
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-02 15:23:49 -08:00
Bhumika Goyal 2f27a3e298 Staging: lustre: Remove print statement on function failure
The  memory allocation functions generates a call stack containing
all the context information on failure, so print statements can be
removed on failure of these functions. Also remove
unwanted {} around if block after removal of these statements.
Done using coccinelle:

@@
expression e,e1,e2;
identifier x;
@@
e=\(kmalloc\|kmalloc_array\|kzalloc\|
   devm_kzalloc\)(...);
...when!=e=e1
if(!e)
-{
- \(printk\|DBG_8723A\|pr_err\|CERROR\|DBG_88E\)(...);
(
goto x;
|
return e2;
|
return;
)
-}

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:38:34 -08:00
M. Vefa Bicakci c8c21f3b48 staging: lustre: Use const static file_operations struct
This commit corrects the following sparse warning regarding a
file_operations structure being non-static and constifies the
structure in question as well.

  warning: symbol 'lprocfs_stats_seq_fops' was not declared.
    Should it be static?

Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:28:29 -08:00
Andreas Dilger e0f9411344 staging: lustre: make module_init/exit naming consistent
Make the name of the module_init()/_exit() functions consistently
{module_name}_init and {module_name}_exit.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6204
Reviewed-on: http://review.whamcloud.com/16787
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:19:17 -08:00
Andreas Dilger 57878e17f9 staging: lustre: update the MODULE_DESCRIPTION for all lustre modules
Fixup the MODULE_DESCRIPTION for several lustre modules. Some wrongly
place the version in the string or they are not descriptive enough.
Broken out of patch http://review.whamcloud.com/16787.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6204
Reviewed-on: http://review.whamcloud.com/16787
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:19:17 -08:00
James Simmons 5b0e50b964 staging: lustre: add missing MODULE_AUTHOR for LNet selftest module
For several lustre modules the MODULE_VERSION has the wrong value,
located in the wrong place in the source code, or completely missing.
This patch brings it up to date.

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/16729
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:19:17 -08:00
Amitoj Kaur Chawla 99815cb579 staging: lustre: obdclass: 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 926d6fb29e staging/lustre/obdclass: 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 85f552dfa6 staging/lustre: Remove liblustre references from explanations
Since liblustre is no longer with us, referencing to it in the
explanations only makes things less clear

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 6ba59179a3 staging/lustre/obdclass: 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 eb3d998976 staging/lustre: Remove lustre_build_version.h
of the two macroses is contained the LUSTRE_RELEASE was unused and
BUILD_VERSION is too generically named and was replaced with
LUSTRE_VERSION_STRING with all the users (provided by lustre_ver.h)

With in-kernel client the build version should be combined with
kernel build information anyway.

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
Frank Zago 24af3e1676 staging: lustre: missed a few cases of using NULL instead of 0
It is preferable to use NULL instead of 0 for pointers. This fixes sparse
warnings such as:

lustre/fld/fld_request.c:126:17: warning: Using plain integer as NULL pointer

The second parameter of class_match_param() was changed to a const, to
be able to remove a cast in one user, to prevent splitting a long
line. No other code change.

Signed-off-by: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/12567
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-22 18:05:49 -08:00
Amitoj Kaur Chawla 886cdbfcd2 staging: lustre: obdclass: Remove header file
Remove duplicate include file. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-22 12:03:22 -08:00
Amitoj Kaur Chawla 8cee691ea8 staging: lustre: obdclass: obd_mount: Declare function as static
Declare lustre_mount() function static since it is defined and called in this
file only.

This fixes the following sparse warning:
drivers/staging/lustre/lustre/obdclass/obd_mount.c:1169:15: warning:
symbol 'lustre_mount' 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:37:02 -08:00
Oleg Drokin cce3c2da7c staging/lustre/obdclass: 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 07ad67450c staging/lustre: Remove server code from class_get_type()
class_get_type has some references to various server modules
that could not exist on the server, so get rid of them.

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 406c1c7cd5 staging/lustre/obdclass: Get rid of /proc references in comments.
Now that the sysfs conversion is complete, also convert all the
remaining comments

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
John L. Hammond 060c2820d0 staging: lustre: remove uses of IS_ERR_VALUE()
Remove most uses of IS_ERR_VALUE(). This macro was often given an int
argument coming from PTR_ERR(). This invokes implementation defined
behavior since the long value gotten by applying PTR_ERR() to a kernel
pointer will usually not be representable as an int. Moreover it may
be just plain wrong to do this since the expressions IS_ERR(p) and
IS_ERR_VALUE((int) PTR_ERR(p)) are not equivalent for a general
pointer p.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3498
Reviewed-on: http://review.whamcloud.com/6759
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:29:23 -08:00
Bhumika Goyal 639868832a Staging: lustre: obdclass: Declare function as static
Declare the function cache_stats_print as static since it is used
only  in this file. Used grep to find occurences. Problem found using
sparse.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:21:15 -08:00
Amitoj Kaur Chawla acdd1b8e68 staging: lustre: obdclass: Use IS_ERR_OR_NULL
Use macro IS_ERR_OR_NULL in place of tests for NULL and IS_ERR.

The Coccinelle semantic patch used to make the change is as follows:

//<smpl>
@@
expression e;
@@

- e == NULL || IS_ERR(e)
+ IS_ERR_OR_NULL(e)
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:21:15 -08:00
Oleg Drokin f3fe3718d8 staging/lustre: Adjust import state history output format
New test scripts expect spaces around state names and square brackets
when parsing debugfs output, so add them to avoid false failures.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:29:55 -08:00
Bhaktipriya Shridhar f06104fb32 staging: lusture: obdclass: Remove return statement in void function
Fix the following checkpatch.pl warning:
WARNING: void function return statements are not generally useful

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 20:17:18 -08:00
Oleg Drokin da33f1dd9f staging/lustre/obdclass: export debugfs functionality for GPL only.
Turns out we mistakenly export some pretty-wide-reaching debugfs
functions as EXPORT_SYMBOL instead of EXPORT_SYMBOL_GPL as we should,
so this patch rectifies the situation.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 17:34:58 -08:00
Bhumika Goyal 6ae07f1b38 Staging:lustre:obdclass:linux:simplify NULL comparison
Remove explicit NULL comparision and replace it with a simpier form.
Detected using checkpatch.pl.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:44:02 -08:00
Bhumika Goyal 197cb405b3 Staging:lustre:obdclass:linux:remove unnecessary braces
Fixed 'braces {} are not necessary for single statement blocks'
checkpatch.pl warning.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:44:02 -08:00
Bhumika Goyal 62fcd58943 Staging:lustre:lustre:obdclass:Remove return from void function
This patch removes the return statement at the end of a void function as
it is not necessary.This was found by checkpatch.pl .

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:42:33 -08:00
Oleg Drokin cadffe60ea staging/lustre: Declare lprocfs_write_frac_u64_helper argument as __user
The buffer that lprocfs_write_frac_u64_helper is working on is
presumed to be a userspace one, so it's not suitable for use
on kernel buffers.

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 e3e8ff41c0 staging/lustre: Mark obd_ioctl_popdata/getdata argument as __user
arg is a userspace pointer and marking it as such makes sparse happy.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:27:25 -08:00
James Simmons 85de1f5516 staging: lustre: cleanup white space in kernel comm code
Cleanup the last white space issues in the kernel comm code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:20:14 -08:00
James Simmons a5f533f593 staging: lustre: fix all conditional comparison to zero for kernelcomm.c
Doing if (rc != 0) or if (rc == 0) is bad form. This patch corrects
kernelcomm.c 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-03 14:20:14 -08:00
James Simmons 2bab480d1c staging: lustre: return proper error code for libcfs_kkuc_msg_put
The functon libcfs_kkuc_msg_put() returns -ENOSYS which is not
correct. Return -ENXIO instead if the kuc header is corrupt.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:20:14 -08:00
James Simmons a0d5e63e43 staging: lustre: use proper braces in libcfs_kkuc_group_put
Add in missing braces for libcfs_kkuc_group_put();.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:20:14 -08:00
James Simmons 13c26b2606 staging: lustre: add space around '+' in kernel_comm code
Add in missing space arouund '+' in the kernel_comm code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:20:14 -08:00
James Simmons 25c450ea43 staging: lustre: cleanup block comment style in kernel_comm code
Fixup the comments to the linux kernel style for the source and
headers related to the kernel_comm work.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:20:14 -08:00
James Simmons fb81e73244 staging: lustre: remove unnecessary NULL checks in kernel_comm.c
Fix checkpatch.pl reports of NULL comparison in kernel_comm.c.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:20:14 -08:00
James Simmons 16b376bbef staging: lustre: convert kernelcomm group to unsigned int
The group variable was converted to an unsigned int in
libcfs_kkuc_group_add() to avoid a potential overflow.
The variable group is used in other kernelcomm functions
so it makes sense to convert the rest of the group
variables to unsigned int.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:20:14 -08:00
Hongchao Zhang 17328956b0 staging: lustre: embed kr_data into kkuc_reg
In struct kkuc_reg, the "kr_data" is difficult to be freed
outside of libcfs, then it's better to change it to be
inline data instead of the data pointer.

Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6485
Reviewed-on: http://review.whamcloud.com/14638
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Robert Read <robert.read@intel.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 14:20:14 -08:00
frank zago e2780478fe staging: lustre: split kernel comm between user and kernel
Split the kernel comm header in libcfs into two new headers
to handle both kernel space and user space for the lustre layer.
This is broken out of the original patch 14270. The part covered
by this change is as follows:

The original libcfs_kernelcomm.h header is split into three parts:
  * lustre_kernelcomm.h, a new header for the kernel parts;
  * uapi_kernelcomm.h, a new header for the data structures shared
    between userspace and kernelspace;
  * lustreapi_internal.h receives the private liblustreapi prototypes.

Various names and filenames have been harmonized to *kernelcomm*.

The unused symbol KUC_FL_BLOCK has been removed.

Signed-off-by: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14270
Reviewed-by: Nathan Rutman <nathan.rutman@seagate.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@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>
2016-02-03 14:20:14 -08:00
frank zago db953dad0c staging: lustre: move kernel_user_comm.c from libcfs to lustre
Move the kernel portion from libcfs to obdclass. This code is
only used by lustre. This is broken out of the original patch
14270. The part covered by this change is as follows:

The original code in kernel_user_comm.c is split into two parts:

  * obdclass/kernelcomm.c for the kernel part. filp_user_write() was
    moved there, and linux-fs.c deleted;
  * liblustreapi_kernelconn.c for the user part. The calls to CDEBUG
    have been removed, and calls to CERROR have been transformed to
    llapi_err_noerrno. The type lustre_kernelcomm has been removed and
    replace by struct lustre_kernelcomm.

Various names and filenames have been harmonized to *kernelcomm*.

Signed-off-by: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14270
Reviewed-by: Nathan Rutman <nathan.rutman@seagate.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@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>
2016-02-03 14:20:14 -08:00
Shraddha Barke fb7a02014b Staging: lustre: obdclass: Declare lu_site_hash_ops as static
lu_site_hash_ops is used only in this particular file. Thus declare
it as static.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:47:30 -08:00
Shraddha Barke 9569ea54eb Staging: lustre: obdclass: Declare cl_env_peek as static
Declare cl_env_peek as static since it is used only in this file.
Also remove the EXPORT SYMBOL.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:47:30 -08:00
Shivani Bhardwaj 53f1a12768 staging: lustre: Remove cl_2queue_add wrapper
Remove the wrapper function cl_2queue_add() and replace all its calls in
different files with the function it wrapped. Also, comments are added
wherever necessary to make the working of function clear. Prototype of
the function is also removed from the header file as it is no longer
needed.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:40:18 -08:00
Shivani Bhardwaj c328ae39e5 staging: lustre: cl_io: Remove cl_lock_descr_fid wrapper
Remove unnecessary wrapper function cl_lock_descr_fid() and replace all
its calls with the function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:40:18 -08:00
Shivani Bhardwaj 97c2bb7bc5 staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper
Remove the wrapper function lustre_posix_acl_xattr_free() and replace its
call in the file xattr with the function kfree() that it wrapped. Also,
its prototype from the header lustre_eacl is removed as it is no longer
of any use.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21 15:40:18 -08:00