1
0
Fork 0
Commit Graph

52 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
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
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 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 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
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
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 db9fc06bae staging: lustre: change cfs_hash_ops_t to struct
Change cfs_hash_ops_t to struct cfs_hash_ops.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:02:24 +09: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 5913ef5eb9 Staging: lustre: obdclass: lu_object: Declare local functions as static
Declare lu_dev_add_linkage and lu_object_find 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 16:43:24 -07:00
Shraddha Barke 053118935e Staging: lustre: obdclass: Declare structure as static.
Declare structure as static since it is not accessed anywhere
apart from this particular 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-10-02 11:22:47 +02:00
Oleg Drokin 709e280afa staging/lustre: Remove unused lu_object functions.
Quite a bunch of them are only used on the server.
lu_object_put_nocache, lu_object_invariant, lu_dev_del_linkage,
lu_context_tags_update, lu_context_tags_clear, lu_session_tags_update,
lu_session_tags_clear, lu_env_refill_by_tags, lu_printk_printer,
lu_object_assign_fid, lu_object_anon, lu_buf_free, lu_buf_alloc,
lu_buf_realloc, lu_buf_check_and_alloc, lu_buf_check_and_grow

Reported-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 15:22:27 +02:00
Ann Koehler a0b8803a36 staging/lustre/obdclass: Eliminate hash bucket scans in lu_cache_shrink
The lu_cache_shrink slab shrinker is too slow, accounting for > 90% of
the time spent in shrink_slab when allocating huge pages. Most of its
time is spent iterating over the buckets in each site's object hash
table to compute the number of freeable objects. This iteration is
eliminated by adding an lru length count to the lu_site struct. A
percpu counter is used to maintain the lru length, so that the
lu_site does not need to be locked when an object is accessed through
the hash table. A counter is updated whenever an object is added to
or deleted from any of the hash table buckets. The number of freeable
objects is the sum of the counter values across all cpus.

Signed-off-by: Ann Koehler <amk@cray.com>
Reviewed-on: http://review.whamcloud.com/14066
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6365
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@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:54 -07:00
Frank Zago 6e580ab50a staging/lustre/obdclass: reorganize busy object accounting
Due to some accounting bug, lsb_busy of a hash bucket can become
larger than the total number of objects in said bucket. A busy object
can be counted more than once. When that happens, a negative value is
returned by the shrinker callback.

Instead of trying (and failing) to count the busy objects, count the
objects than are not busy, i.e. the objects that are present on the
lsb_lru list. The number of busy objects is then the difference
between the number of objects in the hash and the objects on the
lsb_lru list.

Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/12468
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5722
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@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:52 -07:00
Julia Lawall ce85ed4d15 staging: lustre: drop null test before destroy functions
Remove unneeded NULL test.

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

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:44 -07:00
Shraddha Barke 2de5855cf9 Staging: lustre: obdclass: Remove typedefs for struct
The Linux kernel coding style guidelines suggest not using typedefs for
structure and enum types. This patch gets rid of the typedefs for
lu_site_stats_t.

The following Coccinelle semantic patch detects the cases for struct type:

@tn@
identifier i;
type td;
@@

-typedef
 struct i { ... }
-td
 ;

@@
type tn.td;
identifier tn.i;
@@

-td
+ struct i

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:47 -07:00
Mike Rapoport ea28d21ac5 staging: lustre: fix GLOBAL_INITIALISERS checkpatch.pl errors
Fix occurencies of the following checkpatch.pl error:
ERROR: do not initialise globals to 0 or NULL

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:12 -07:00
Viresh Kumar 7f44cb0ba8 drivers: staging: Drop unlikely before IS_ERR(_OR_NULL)
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

This also replaces an IS_ERR(x) + (x == NULL) check to IS_ERR_OR_NULL
check.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31 16:18:43 -07:00
Viresh Kumar 208bf77049 staging: lustre: drop redundant check
There is no need to verify that its an error, as we are anyway going to
match the error value to -ENOENT.  Drop the redundant check.

Reported-by: "Kirill A. Shutemov" <kirill@shutemov.name>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31 16:03:50 -07:00
Julia Lawall fea2e68e21 lustre: obdclass: Replace uses of OBD_{ALLOC,FREE}_LARGE
Replace uses of OBD_ALLOC_LARGE by libcfs_kvzalloc and OBD_FREE_LARGE by
kvfree.

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

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

- OBD_ALLOC_LARGE(ptr,size)
+ ptr = libcfs_kvzalloc(size, GFP_NOFS)

@@
expression ptr,size;
@@

- OBD_FREE_LARGE(ptr, size);
+ kvfree(ptr);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-11 09:06:11 -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
Julia Lawall d7279044d8 staging: lustre: obdclass: 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:49 +02:00
Supriya Karanth 225f597c60 staging: lustre: remove initialization of static ints
static ints are initialized to 0 by the compiler.
Explicit initialization is not necessary.

Found by checkpatch.pl - ERROR: do not initialise statics to 0 or NULL

changes made using coccinelle script:
@@
type T;
identifier var;
@@

-static T var = 0;
+static T var;

Signed-off-by: Supriya Karanth <iskaranth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 09:54:33 -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
Aya Mahfouz 5d311af062 staging: lustre: obdclass: remove unused variable
This patch removes a variable that was simply used to
store the return value of a function call before
returning it.

The issue was detected and resolved using the following
coccinelle script:

@@
identifier len,f;
@@

-int len;
 ... when != len
     when strict
-len =
+return
        f(...);
-return len;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 16:28:07 -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 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 610f73773a staging: lustre: obdclass: remove ccflags from Makefile
Fix up the relative paths in the .c files to properly build with the
Makefile change.

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-11 22:15:24 -07:00
Greg Kroah-Hartman 9fdaf8c0b9 staging: lustre: remove top level ccflags variable
We need to remove the ccflags from the Lustre code as it prevents
individual object files from building properly in the kernel build
system.  It also hids the horrid mess that the Lustre include files are
made up of.

Start out by removing the toplevel ccflags variable pointing to
drivers/staging/lustre/include/ as a valid include path.  This requires
the absolute include markings of a bunch of .h and .c files, which is
also done here.

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-11 20:51:16 -07:00
Peng Tao b3669a7f54 staging/lustre/libcfs: remove waitq_wait
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:42:38 -07:00
Peng Tao 9e795d3581 staging/lustre/libcfs: remove init_waitqueue_entry_current
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:42:38 -07:00
Peng Tao 72c0824a0b staging/lustre/libcfs: remove cfs_hash_long
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-14 09:27:10 -08:00
Masanari Iida 52cf6acfb0 staging:lustre: Fix typo in comment and printk within lustre/obdclass
This patch fixed spelling typo within lustre/lustre/obdclass.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-14 09:18:39 -08:00
Mikhail Pershin aa4e3c8abc staging/lustre/llog: MGC to use OSD API for backup logs
MGC uses lvfs API to access local llogs blocking removal of old code

- llog_is_empty() and llog_backup() are introduced

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2059
Lustre-change: http://review.whamcloud.com/5049
Cc: Levente Kurusa <levex@linux.com>
Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
[pick client side change only -- Peng Tao]
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-03 08:42:15 -08:00
John L. Hammond 7cd875d2b7 staging/lustre/lu: shrink lu_object by 8 bytes on x86_64
Remove the lo_depth member from struct lu_object.  This field is never
set and only read in lu_object_print().  Remove the lo_flags member.
This field was only used in lu_object_alloc() and can be replaced with
an on-stack mask to keep trace of which layers have been allocated.

Lustre-change: http://review.whamcloud.com/5890
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3059
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-25 19:28:04 -08:00
Peng Tao 8cc7b4b9f1 staging/lustre: remove CFS_MODULE_PARM
Patch generated by coccinelle:

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

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

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

Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-25 12:35:04 -08:00
Lisa Nguyen 6da6eabe10 staging: lustre: Remove typedef and update cfs_hash struct
Remove typedef keyword and rename the cfs_hash_t struct to
cfs_hash in libcfs_hash.h. These changes resolve the "Do
not add new typedefs" warning generated by checkpatch.pl
and meet kernel coding style.

Struct variables in other header and source files that
depend on libcfs_hash.h are updated as well.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-26 20:19:30 -07:00
Lisa Nguyen 6ea510c189 staging: lustre: Remove typedef and update cfs_hash_bd struct
Remove typedef keyword and rename the cfs_hash_bd_t struct to
cfs_hash_bd in libcfs_hash.h. These changes resolve the
"Do not add new typedefs" warning generated by checkpatch.pl
and meet kernel coding style.

Struct variables in other header and source files that depend
on libcfs_hash.h are updated as well.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-26 20:18:09 -07:00
Joe Perches ec83e611c2 staging: lustre: Use parenthesis around sizeof
Convert sizeof foo to sizeof(foo) to be more kernel style compatible.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-14 09:34:15 -07:00
Peng Tao fe92a0557a staging/lustre/obdclass: convert lu_object shrinker to count/scan API
convert lu_object shrinker to new count/scan API.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-09-10 18:56:32 -04:00
Greg Kroah-Hartman 0a3bdb0071 staging: lustre: remove RETURN macro
We have a kernel-wide function tracing system, so use that instead of
rolling a custom one just for one filesystem.

Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-03 10:35:28 +08:00
Greg Kroah-Hartman 29aaf4962a staging: lustre: remove ENTRY macro
We have a kernel-wide function tracing system, so use that instead of
rolling a custom one just for one filesystem.

Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02 18:14:51 +08:00
John L. Hammond 631abc6e65 staging/lustre/obdclass: use a dummy structure for lu_ref_link
Move the definition of struct lu_ref_link to lu_ref.h.  If USE_LU_REF
is not defined then define it to be the empty struct.  Change the
return type of lu_ref_add() and lu_ref_add_atomic() to void.  Add
lu_ref_add_at() taking same arguments as lu_ref_add() togerther with a
pointer to a struct lu_ref_link and returning void.  Adjust all
structures containing a lu_ref_link pointer to contain a struct
lu_ref_link instead.  Use lu_ref_add_at() and lu_ref_del_at() to
handle embedded lu_ref_links.

[Original patch mainly changes lu_ref.[ch] but in upstream client we don't
have lu_ref code in the hope of moving to kobject refcounting. So the patch
only picks the other pieces of original patch, in order to keep code in
sync and make it easier to port future patches.]

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3059
Lustre-change: http://review.whamcloud.com/5920
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-24 10:34:00 -07:00
Fan Yong 70b749d43d staging/lustre/scrub: purge inconsistenct objects after OI scrub
When OI scrub repaired the found inconsistency, it needs to purge the
old object out of cache; otherwise, others may still use those cached
stale information.

Original patch adds functions in obdclass that is only used by server.
Drop that part. Only merge in error handling change.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3335
Lustre-change: http://review.whamcloud.com/6697
Signed-off-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 13:45:08 -07:00
Peng Tao 4d2d6e29a8 staging/lustre: don't assert module owner
It can well be NULL if Lustre is builtin.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 12:23:56 -07:00
Peng Tao 4f6cc9ab53 staging/lustre: replace num_physpages with totalram_pages
The global variable num_physpages is going away. Replace it
with totalram_pages.

Cc: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 12:23:53 -07:00
Peng Tao 4a1a01ea52 staging/lustre: surround module_refcount with CONFIG_MODULE_UNLOAD
module_refcount() is not available when CONFIG_MODULE_UNLOAD is off.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 11:31:02 -07:00
Peng Tao d29dc2e418 staging/lustre: remove lu_context_keys_dump and lu_debugging_setup
There are no callers of them. Besides, lu_context_keys_dump breaks
build when CONFIG_MODULES is not set.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 11:31:01 -07:00