staging: zcache: rename ramster to zcache

[V2: no code changes, patchset now generated via git format-patch -M]

In staging, rename ramster to zcache

The original zcache in staging was a "demo" version, and this new zcache
is a significant rewrite.  While certain disagreements were being resolved,
both "old zcache" and "new zcache" needed to reside in the staging tree
simultaneously.  In order to minimize code change and churn, the newer
version of zcache was temporarily merged into the "ramster" staging driver
which, prior to that, had at one time heavily leveraged the older version
of zcache.  So, recently, "new zcache" resided in the ramster directory.

Got that? No? Sorry, temporary political compromises are rarely pretty.

The older version of zcache is no longer being maintained and has now
been removed from the staging tree.  So now the newer version of zcache
can rightfully reclaim sole possession of the name "zcache".

FYI, this [PATCH 2/5] is simply a "git mv" generated by "git format-patch -M".

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Conflicts:
	drivers/staging/zcache/Kconfig
	drivers/staging/zcache/Makefile
	drivers/staging/zcache/ramster.h
	drivers/staging/zcache/ramster/heartbeat.c
	drivers/staging/zcache/ramster/heartbeat.h
	drivers/staging/zcache/ramster/masklog.c
	drivers/staging/zcache/ramster/masklog.h
	drivers/staging/zcache/ramster/nodemanager.c
	drivers/staging/zcache/ramster/nodemanager.h
	drivers/staging/zcache/ramster/r2net.c
	drivers/staging/zcache/ramster/ramster.c
	drivers/staging/zcache/ramster/ramster.h
	drivers/staging/zcache/ramster/ramster_nodemanager.h
	drivers/staging/zcache/ramster/tcp.c
	drivers/staging/zcache/ramster/tcp.h
	drivers/staging/zcache/ramster/tcp_internal.h
	drivers/staging/zcache/tmem.c
	drivers/staging/zcache/tmem.h
	drivers/staging/zcache/zbud.c
	drivers/staging/zcache/zbud.h
	drivers/staging/zcache/zcache-main.c
	drivers/staging/zcache/zcache.h

Change-Id: If266228e0e70c876ce6847d203723ff19d0400c1
staging: zcache: adjustments to config/build files due to renaming

[V2: no code changes, patchset now generated via git format-patch -M]

In staging/zcache, adjust config/build due to ramster->zcache renaming

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: zcache: fix uninitialized variable compile warning

[V2: no code changes, patchset now generated via git format-patch -M]

Fix unitialized variable in zcache which generates warning during build

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: zcache: fix ppc64 and other arches where PAGE_SIZE!=4K

Replace raw constant 12 with PAGE_SHIFT to fix non-x86 arches and
provoke build failure if PAGE_SHIFT is too big

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: zcache: remove unnecessary braces in zcache-main.c

This fixes a checkpatch.pl issue of
'braces {} are not necessary for single statement blocks'

Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
xen: prepare tmem shim to handle frontswap

Provide the shim code for frontswap for Xen tmem even if the
frontswap patchset is not present yet.  (The egg is before
the chicken.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Reviewed-by: Konrad Wilk <konrad.wilk@oracle.com>
mm: zcache/tmem/cleancache: s/flush/invalidate/

Complete the renaming from "flush" to "invalidate" across
both tmem frontends (cleancache and frontswap) and both tmem backends
(Xen and zcache), as required by akpm.

This change is completely cosmetic.

[v10: no change]
[v9: akpm@linux-foundation.org: change "flush" to "invalidate", part 3]
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Jan Beulich <JBeulich@novell.com>
Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Rik Riel <riel@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
[v11: Remove the frontswap part]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Conflicts:
	mm/cleancache.c

Change-Id: Icb72f1c2c5fbb6025b4b47e4dd3721a177b6dea6
xen/tmem: cleanup

Use 'bool' for boolean variables. Do proper section placement.
Eliminate an unnecessary export.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Conflicts:
	include/xen/tmem.h

Change-Id: I01ed4968d55b7c1f829f7e96e1582c04eb69940e
frontswap: s/put_page/store/g s/get_page/load

Sounds so much more natural.

Suggested-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Conflicts:
	Documentation/vm/frontswap.txt
	drivers/staging/ramster/zcache-main.c
	drivers/staging/zcache/zcache-main.c
	mm/frontswap.c

Change-Id: I2f2e9b109ffac3ee131e814dbfd841c7bd54da90
sync with 3.10. this commit includes the following changes:
removed zram_for_android code, as it didn't compile anymore

staging: Remove unnecessary OOM messages …
alloc failures already get standardized OOM
messages and a dump_stack.

For the affected mallocs around these OOM messages:

Converted kzallocs with multiplies to kcalloc.
Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/strlen/strncpy to kstrdup.
Moved a spin_lock below a removed OOM message and
removed a now unnecessary spin_unlock.
Neatened alignment and whitespace.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
78110bb8dc Browse code
Joe Perches authored 6 months ago

zram: fix zram_bvec_read duplicate dump failure message and stat accu… …
…mulation

When zram decompress fails, the code unnecessarily dumps failure messages and
does stat accumulation in function zram_decompress_page(), this work is already
done in function zram_decompress_page, the patch skips the redundant work.

Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25eeb66759 Browse code
Wanpeng Li authored 5 months ago

Change-Id: I2ce5ebad11848c1d8ce1be0ae1209049665fb924
removed old ZRAM_FOR_ANDROID completely

Change-Id: I1373b4ea6d7fdde8345e1ee4695489f76f17e4ef
backport zram_for_android from 3.4 (i9500) by derteufel

Change-Id: I2cdff34e84dc25f80335bce5769b6cd87043271e
Staging: android: binder: Don't call dump_stack in binder_vma_open

If user-space partially unmaps the driver, binder_vma_open
would dump the kernel stack. This is not a kernel bug however
and will be treated as if the whole area was unmapped once
binder_vma_close gets called.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Wrap accesses to the fd_sets in struct fdtable

Wrap accesses to the fd_sets in struct fdtable (for recording open files and
close-on-exec flags) so that we can move away from using fd_sets since we
abuse the fd_set structs by not allocating the full-sized structure under
normal circumstances and by non-core code looking at the internals of the
fd_sets.

The first abuse means that use of FD_ZERO() on these fd_sets is not permitted,
since that cannot be told about their abnormal lengths.

This introduces six wrapper functions for setting, clearing and testing
close-on-exec flags and fd-is-open flags:

	void __set_close_on_exec(int fd, struct fdtable *fdt);
	void __clear_close_on_exec(int fd, struct fdtable *fdt);
	bool close_on_exec(int fd, const struct fdtable *fdt);
	void __set_open_fd(int fd, struct fdtable *fdt);
	void __clear_open_fd(int fd, struct fdtable *fdt);
	bool fd_is_open(int fd, const struct fdtable *fdt);

Note that I've prepended '__' to the names of the set/clear functions because
they require the caller to hold a lock to use them.

Note also that I haven't added wrappers for looking behind the scenes at the
the array.  Possibly that should exist too.

Signed-off-by: David Howells <dhowells@redhat.com>
Link: http://lkml.kernel.org/r/20120216174942.23314.1364.stgit@warthog.procyon.org.uk
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
fs: Remove missed ->fds_bits from cessation use of fd_set structs internally

Stephen Rothwell reported that the following commit broke the
linux-next build:

  1fd36adcd98c: Replace the fd_sets in struct fdtable with an array of unsigned longs

Fix places where ->fds_bits needed to be removed as the core
kernel no longer uses fd_set internally for file descriptor
table management.  There are two places:

 (1) drivers/staging/android/binder.c

 (2) arch/mips/kernel/kspd.c

     Question: Should sp_cleanup() in the MIPS arch be using find_next_bit()
     or fls()?

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Ralf Bächle <ralf@linux-mips.org>
cc: Arve Hjønnevåg <arve@android.com>
Link: http://lkml.kernel.org/r/20120224105707.32170.11550.stgit@warthog.procyon.org.uk
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Staging:android: Change type for binder_debug_no_lock switch to bool

GCC warns that module_param_named() indirectly returns a bool type value
which is different from 'int' type binder_debug_no_lock declared. Change
it to bool because it is a internal switch for debugging.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: android: binder: Fix use-after-free bug

binder_update_page_range could read freed memory if the vma of the
selected process was freed right before the check that the vma
belongs to the mm struct it just locked.

If the vm_mm pointer in that freed vma struct had also been rewritten
with a value that matched the locked mm struct, then the code would
proceed and possibly modify the freed vma.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers: staging: android: binder.c: fix printk macros

Change printk() messages to pr_* macros.

Signed-off-by: Sherwin Soltani <sherwin@wybc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: android: binder: Make task_get_unused_fd_flags function static

Silence the following warning:
drivers/staging/android/binder.c:368:5: warning:
symbol 'task_get_unused_fd_flags' was not declared. Should it be static?

Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: android: binder: Remove an inconsequential conditional macro

Removes an inconsequential conditional macro.

Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>